Optimize continuous-improve loop: skip redundant review checks, dedup bugs, no double commits, default skip-unchanged
This commit is contained in:
@@ -38,3 +38,4 @@
|
||||
785e2c 1771806758
|
||||
78a490 1771806810
|
||||
78e9e7 1771806915
|
||||
801168 1771807000
|
||||
|
||||
|
@@ -6269,3 +6269,13 @@ To https://gitea.home.everyonce.com/daniel/factbase-ancient-history.git
|
||||
|
||||
[0m[1G[0m[0m[?25h
|
||||
status: UPDATED | Cyrus the Great | changes: Applied 23 answered review questions; fixed duplicate title; added Old Persian name (Kūruš); added parentage (father Cambyses I, mother Mandane daughter of Astyages); added successor Cambyses II; noted Astyages was Cyrus's maternal grandfather; added Edict of Cyrus (~538 BCE) with Ezra citation; enriched Cyrus Cylinder entry (Akkadian cuneiform, found 1879 in Ésagila temple, "first charter of human rights"); added Tomyris as Massagetae queen; added Syr Darya as battle location; added Pasargadae UNESCO World Heritage status; added geographic extent (Egypt to Indus Valley); added Herodotus as new footnote [^3]
|
||||
[main 8ee54f4] improve: Cyrus the Great
|
||||
5 files changed, 114 insertions(+)
|
||||
delete mode 100644 .factbase/factbase.db-shm
|
||||
delete mode 100644 .factbase/factbase.db-wal
|
||||
[2026-02-23 00:36:40] ✅ Committed: improve: Cyrus the Great
|
||||
[2026-02-23 00:36:40] Done (77s) — UPDATED
|
||||
[2026-02-23 00:36:45] [33/66] Next up...
|
||||
[2026-02-23 00:36:45] ━━━ [Alexander the Great] (817dc2) reviews=0 garbage=0 ━━━
|
||||
[2026-02-23 00:36:45] 🧹 Bash cleanup applied
|
||||
[2026-02-23 00:36:45] 🔍 Enrichment + review pass
|
||||
|
||||
@@ -18,7 +18,7 @@ PRIORITY="reviews"
|
||||
CYCLE_DELAY=5
|
||||
MODEL="claude-sonnet-4.6"
|
||||
START_AT=0
|
||||
SKIP_UNCHANGED=false
|
||||
SKIP_UNCHANGED=true
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--priority) PRIORITY="$2"; shift 2 ;;
|
||||
@@ -190,11 +190,19 @@ ${excerpt}
|
||||
echo "$related"
|
||||
}
|
||||
|
||||
# ─── Fetch existing Vikunja bug titles (for dedup) ───
|
||||
get_existing_bug_titles() {
|
||||
curl -s "https://vikunja.home.everyonce.com/api/v1/projects/2/tasks" \
|
||||
-H "Authorization: Bearer tk_ff251f3d3512775c71913bc2f8ec0dabbf5016a8" \
|
||||
2>/dev/null | grep -oP '"title":"[^"]*"' | sed 's/"title":"//;s/"$//' || true
|
||||
}
|
||||
|
||||
# ─── Agent-based processing (review questions + enrichment) ───
|
||||
process_entity_agent() {
|
||||
local fb_id="$1"
|
||||
local file="$2"
|
||||
local title="$3"
|
||||
local review_count="${4:-0}"
|
||||
|
||||
cd "$DOCS_DIR"
|
||||
|
||||
@@ -204,6 +212,9 @@ process_entity_agent() {
|
||||
local related
|
||||
related=$(get_related_context "$file")
|
||||
|
||||
local existing_bugs
|
||||
existing_bugs=$(get_existing_bug_titles)
|
||||
|
||||
local prompt
|
||||
prompt="You are continuously improving a factbase knowledge base, one entity at a time.
|
||||
Use factbase MCP tools — call get_authoring_guide if you need formatting rules.
|
||||
@@ -223,12 +234,19 @@ $related
|
||||
=== END MENTIONS ==="
|
||||
fi
|
||||
|
||||
prompt+='
|
||||
if [[ -n "$existing_bugs" ]]; then
|
||||
prompt+="
|
||||
|
||||
STEPS — work through in order, skip any that do not apply:
|
||||
=== EXISTING VIKUNJA BUG REPORTS (do NOT file duplicates) ===
|
||||
$existing_bugs
|
||||
=== END EXISTING BUGS ==="
|
||||
fi
|
||||
|
||||
1. RESOLVE REVIEW QUESTIONS:
|
||||
Call get_review_queue(doc_id='"'"''"$fb_id"''"'"') — if there are open questions, answer them.
|
||||
# Build review step conditionally
|
||||
local review_step=""
|
||||
if [[ "$review_count" -gt 0 ]]; then
|
||||
review_step='1. RESOLVE REVIEW QUESTIONS:
|
||||
Call get_review_queue(doc_id='"'"''"$fb_id"''"'"') — if there are open (unanswered) questions, answer them.
|
||||
|
||||
Patterns learned from resolving thousands of these:
|
||||
- CONFLICT (chronological overlaps): Boundary-year overlaps in sequential reigns or periods
|
||||
@@ -244,9 +262,18 @@ STEPS — work through in order, skip any that do not apply:
|
||||
for newer scholarship.
|
||||
- MISSING: Search with search_knowledge and search_content. If not found, defer.
|
||||
|
||||
After answering, call apply_review_answers(doc_id='"'"''"$fb_id"''"'"'). Then re-read the
|
||||
file with get_entity and verify apply did not corrupt it (garbage footnotes, mangled title).
|
||||
If it did, fix with update_document.
|
||||
IMPORTANT: Only call apply_review_answers if get_review_queue shows unanswered > 0.
|
||||
After applying, re-read the file with get_entity and verify apply did not corrupt it
|
||||
(garbage footnotes, mangled title). If it did, fix with update_document.'
|
||||
else
|
||||
review_step='1. REVIEW QUESTIONS: SKIP — the wrapper already confirmed 0 open review questions for this entity.'
|
||||
fi
|
||||
|
||||
prompt+='
|
||||
|
||||
STEPS — work through in order, skip any that do not apply:
|
||||
|
||||
'"$review_step"'
|
||||
|
||||
2. IDENTITY & ORGANIZATION:
|
||||
For ruler documents: if the title is a single name, alias, or epithet (not a full name),
|
||||
@@ -280,6 +307,10 @@ STEPS — work through in order, skip any that do not apply:
|
||||
FEATURES — any friction, missing capability, awkward multi-step workaround, or gap that
|
||||
slowed you down or limited what you could accomplish. Use title prefix "[factbase][feature]".
|
||||
|
||||
CRITICAL: Before filing ANY bug or feature request, check the EXISTING VIKUNJA BUG REPORTS
|
||||
section above. If a similar issue is already filed, do NOT file a duplicate. Only file if
|
||||
the issue is genuinely new.
|
||||
|
||||
CRITICAL: Factbase is domain-agnostic — it is used for many different knowledge bases, not
|
||||
just this one. Your bug reports and feature requests MUST describe the issue in terms of
|
||||
factbase tool behavior, not in terms of ancient history content. For example:
|
||||
@@ -301,7 +332,10 @@ STEPS — work through in order, skip any that do not apply:
|
||||
Priority: 1-2 for features/minor issues, 3 for normal bugs, 4-5 for data loss or blocking failures.
|
||||
|
||||
RULES:
|
||||
- The document content is already provided above — do NOT call get_entity to re-read it
|
||||
unless you just called apply_review_answers and need to verify the result
|
||||
- Use update_document to edit — be surgical, change only what needs changing
|
||||
- Do NOT run git add, git commit, or git push — the wrapper script handles all git operations
|
||||
- If nothing needs changing, say so and move on
|
||||
|
||||
IMPORTANT: When finished, output exactly one line:
|
||||
@@ -369,7 +403,7 @@ process_entity() {
|
||||
|
||||
if [[ "$needs_agent" == true ]]; then
|
||||
local agent_output
|
||||
agent_output=$(process_entity_agent "$fb_id" "$file" "$title")
|
||||
agent_output=$(process_entity_agent "$fb_id" "$file" "$title" "$review_count")
|
||||
echo "$agent_output"
|
||||
|
||||
summary=$(echo "$agent_output" | grep -oP '(?<=<action_summary>).*(?=</action_summary>)' | tail -1)
|
||||
|
||||
@@ -118,3 +118,6 @@
|
||||
[2026-02-23T00:35:15+00:00] 78e9e7 | Zoroastrianism
|
||||
status: UPDATED | Zoroastrianism | changes: Applied 24 answered review questions; fixed duplicate H1 heading and spurious @t[~2001] tag (bug filed as Vikunja #94); enriched with Encyclopaedia Iranica scholarship — added Aməša Spəntas, Magi priesthood, Saošyant savior figure, Frašō-kərəti eschatology, Parthian/Sasanian period details with dates, Avesta canonization under Khosrow I, Parsi migration timing (8th–9th c. CE), updated population figures (~50,000 Parsis per 2011 census, ~100,000–120,000 worldwide); added two new footnotes (Encyclopaedia Iranica, Wikipedia population list)
|
||||
duration: 98s
|
||||
[2026-02-23T00:36:40+00:00] 801168 | Cyrus the Great
|
||||
status: UPDATED | Cyrus the Great | changes: Applied 23 answered review questions; fixed duplicate title; added Old Persian name (Kūruš); added parentage (father Cambyses I, mother Mandane daughter of Astyages); added successor Cambyses II; noted Astyages was Cyrus's maternal grandfather; added Edict of Cyrus (~538 BCE) with Ezra citation; enriched Cyrus Cylinder entry (Akkadian cuneiform, found 1879 in Ésagila temple, "first charter of human rights"); added Tomyris as Massagetae queen; added Syr Darya as battle location; added Pasargadae UNESCO World Heritage status; added geographic extent (Egypt to Indus Valley); added Herodotus as new footnote [^3]
|
||||
duration: 77s
|
||||
|
||||
Binary file not shown.
@@ -73,3 +73,6 @@
|
||||
{"level":"info","message":"Starting MCP server","service":"mcp-puppeteer","timestamp":"2026-02-23 00:35:24.861"}
|
||||
{"level":"info","message":"MCP server started successfully","service":"mcp-puppeteer","timestamp":"2026-02-23 00:35:24.867"}
|
||||
{"level":"info","message":"Puppeteer MCP Server closing","service":"mcp-puppeteer","timestamp":"2026-02-23 00:36:37.519"}
|
||||
{"level":"info","message":"Starting MCP server","service":"mcp-puppeteer","timestamp":"2026-02-23 00:36:47.776"}
|
||||
{"level":"info","message":"MCP server started successfully","service":"mcp-puppeteer","timestamp":"2026-02-23 00:36:47.778"}
|
||||
{"level":"info","message":"Puppeteer MCP Server closing","service":"mcp-puppeteer","timestamp":"2026-02-23 00:38:22.081"}
|
||||
|
||||
@@ -7,85 +7,33 @@
|
||||
Alexander III of Macedon (356–323 BCE), known as Alexander the Great, conquered the Persian Empire and created one of the largest empires in ancient history, spreading Greek culture from Egypt to India. @t[356 BCE..323 BCE]
|
||||
|
||||
## Key Facts
|
||||
- Born: 356 BCE, Pella, Macedon @t[=356 BCE]
|
||||
- Died: 323 BCE, Babylon (age 32) @t[=323 BCE]
|
||||
- Reign: 336–323 BCE @t[336 BCE..323 BCE]
|
||||
- Father: Philip II of Macedon
|
||||
- Tutor: Aristotle
|
||||
- Born: 356 BCE, Pella, Macedon @t[=356 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Died: 323 BCE, Babylon (age 32) @t[=323 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Reign: 336–323 BCE @t[336 BCE..323 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Father: Philip II of Macedon (II = Regnal number. Standard historical convention.) <!-- reviewed:2026-02-23 -->
|
||||
- Tutor: Aristotle <!-- reviewed:2026-02-23 -->
|
||||
|
||||
## Major Campaigns
|
||||
- Battle of Granicus (334 BCE): First victory against Persia in Anatolia @t[=334 BCE]
|
||||
- Battle of Issus (333 BCE): Defeated Darius III @t[=333 BCE]
|
||||
- Siege of Tyre (332 BCE): Seven-month siege of the island city @t[=332 BCE]
|
||||
- Battle of Gaugamela (331 BCE): Decisive defeat of the Persian Empire @t[=331 BCE] [^1]
|
||||
- Indian campaign (327–325 BCE): Defeated King Porus at the Hydaspes @t[327 BCE..325 BCE]
|
||||
|
||||
- Battle of Granicus (334 BCE): First victory against Persia in Anatolia @t[=334 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Battle of Issus (333 BCE): Defeated Darius III (III = Regnal number. Standard historical convention.) @t[=333 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Siege of Tyre (332 BCE): Seven-month siege of the island city @t[=332 BCE] <!-- reviewed:2026-02-23 -->
|
||||
- Battle of Gaugamela (331 BCE): Decisive defeat of the Persian Empire @t[=331 BCE] [^1] <!-- reviewed:2026-02-23 -->
|
||||
- Indian campaign (327–325 BCE): Defeated King Porus at the Hydaspes @t[327 BCE..325 BCE] <!-- reviewed:2026-02-23 -->
|
||||
## Legacy
|
||||
- Founded over 20 cities, most notably Alexandria in Egypt
|
||||
- Spread Hellenistic culture across the Near East and Central Asia
|
||||
- Empire divided among his generals (Diadochi) after his death [^2]
|
||||
- Ptolemaic Egypt, Seleucid Empire, and Antigonid Macedon emerged as successor states
|
||||
- Spread Hellenistic culture across the Near East and Central Asia <!-- reviewed:2026-02-23 -->
|
||||
- Empire divided among his generals (Diadochi) after his death @t[~1991] [^2] <!-- reviewed:2026-02-23 -->
|
||||
- Ptolemaic Egypt, Seleucid Empire, and Antigonid Macedon emerged as successor states <!-- reviewed:2026-02-23 -->
|
||||
|
||||
---
|
||||
[^1]: Arrian, *Anabasis of Alexander*
|
||||
[^2]: Green, P. *Alexander of Macedon* (University of California Press, 1991)
|
||||
---
|
||||
[^2]: Green, P. *Alexander of Macedon* (University of California Press, 1991)---
|
||||
|
||||
## Review Queue
|
||||
|
||||
<!-- factbase:review -->
|
||||
- [x] `@q[temporal]` Line 10: "Born: 356 BCE, Pella, Macedon" - when was this true?
|
||||
> 356 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 11: "Died: 323 BCE, Babylon (age 32)" - when was this true?
|
||||
> 323 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 12: "Reign: 336–323 BCE" - when was this true?
|
||||
> 323 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 13: "Father: Philip II of Macedon" - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[temporal]` Line 14: "Tutor: Aristotle" - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[temporal]` Line 17: "Battle of Granicus (334 BCE): First victory against Persia in Anatolia" - when was this true?
|
||||
> 334 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 18: "Battle of Issus (333 BCE): Defeated Darius III" - when was this true?
|
||||
> 333 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 19: "Siege of Tyre (332 BCE): Seven-month siege of the island city" - when was this true?
|
||||
> 332 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 20: "Battle of Gaugamela (331 BCE): Decisive defeat of the Persian Empire [^1]" - when was this true?
|
||||
> 331 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 21: "Indian campaign (327–325 BCE): Defeated King Porus at the Hydaspes" - when was this true?
|
||||
> 325 BCE event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2]. BCE temporal tags not yet supported by factbase.
|
||||
- [x] `@q[temporal]` Line 24: "Founded over 20 cities, most notably Alexandria in Egypt" - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[temporal]` Line 25: "Spread Hellenistic culture across the Near East and Central Asia" - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[temporal]` Line 26: "Empire divided among his generals (Diadochi) after his death [^2]" - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[temporal]` Line 27: "Ptolemaic Egypt, Seleucid Empire, and Antigonid Macedon emerged as successor ..." - when was this true?
|
||||
> Historical event. Attested by Arrian (~130 CE) [^1]; Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 10: "Born: 356 BCE, Pella, Macedon" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 11: "Died: 323 BCE, Babylon (age 32)" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 12: "Reign: 336–323 BCE" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 13: "Father: Philip II of Macedon" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 14: "Tutor: Aristotle" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 17: "Battle of Granicus (334 BCE): First victory against Persia in Anatolia" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 18: "Battle of Issus (333 BCE): Defeated Darius III" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 19: "Siege of Tyre (332 BCE): Seven-month siege of the island city" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 21: "Indian campaign (327–325 BCE): Defeated King Porus at the Hydaspes" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 24: "Founded over 20 cities, most notably Alexandria in Egypt" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 25: "Spread Hellenistic culture across the Near East and Central Asia" - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
- [x] `@q[missing]` Line 27: "Ptolemaic Egypt, Seleucid Empire, and Antigonid Macedon emerged as successor ..." - what is the source?
|
||||
> Arrian Anabasis [^1] and Green (1991) [^2].
|
||||
|
||||
|
||||
- [x] `@q[ambiguous]` Line 13: "Father: Philip II of Macedon" - what does "II" mean in this context?
|
||||
> Regnal number. Standard historical convention.
|
||||
- [x] `@q[ambiguous]` Line 18: "Battle of Issus (333 BCE): Defeated Darius III" - what does "III" mean in this context?
|
||||
|
||||
Reference in New Issue
Block a user