> ## Continuous-process anchor
>
> This spec describes an instance of one of the retired-script themes
> documented in docs/design/retired_scripts_patterns.md. Before
> implementing, read:
>
> 1. The "Design principles for continuous processes" section of that
> atlas — every principle is load-bearing. In particular:
> - LLMs for semantic judgment; rules for syntactic validation.
> - Gap-predicate driven, not calendar-driven.
> - Idempotent + version-stamped + observable.
> - No hardcoded entity lists, keyword lists, or canonical-name tables.
> - Three surfaces: FastAPI + orchestra + MCP.
> - Progressive improvement via outcome-feedback loop.
> 2. The theme entry in the atlas matching this task's capability:
> A4 (pick the closest from Atlas A1–A7, Agora AG1–AG5,
> Exchange EX1–EX4, Forge F1–F2, Senate S1–S8, Cross-cutting X1–X2).
> 3. If the theme is not yet rebuilt as a continuous process, follow
> docs/planning/specs/rebuild_theme_template_spec.md to scaffold it
> BEFORE doing the per-instance work.
>
> **Specific scripts named below in this spec are retired and must not
> be rebuilt as one-offs.** Implement (or extend) the corresponding
> continuous process instead.
Continuously reduce the backlog of weakly linked or unlinked wiki pages using high-confidence artifact_links, node_wiki_links, and KG associations. Prioritize world-model impact and report backlog reduction each run.
kg_node_id already set but missing node_wiki_links entrieskg_node_id where the slug matches known KG entities (genes-PROTEIN, diseases-DISEASE patterns)knowledge_edges entitiesci_crosslink_wiki_kg.py — Step 1: Link pages WITH kg_node_id to node_wiki_linksci_crosslink_wiki_kg.py — Step 2: Slug-based matching for pages without kg_node_idcross_link_wiki_kg_advanced.py — Content-based entity extraction for remaining pagesknowledge_edges) and common neurodegeneration entities:
kg_node_id have corresponding node_wiki_links entriescross_link_wiki_kg_advanced.py had no DB lock retry in create_links() — caused OperationalError under loadsafe_insert_links_batch() with 5-retry exponential backoff for batch insertscreate_links() to deduplicate links before insert and use batch operations[Atlas] Add DB lock retry to cross_link_wiki_kg_advanced [task:55e3ea08-76c2-4974-9dc3-a304848cf1a9]ci_crosslink_wiki_kg.py Step 1 had wrong join key — wiki_entity_name (slug like genes-htr1f) was compared to wp.title (display name like HTR1F), causing all existence checks to misswp.title → wp.slug in Step 1 SELECT, NOT EXISTS clause, and report_coverage()[Atlas] Fix wiki_entity_name join key in ci_crosslink_wiki_kg [task:55e3ea08-76c2-4974-9dc3-a304848cf1a9]create_links() used WHERE id=? but many wiki_pages have NULL id (SQLite TEXT PK allows NULL); page_update_list was always 0WHERE slug=? (the true unique key); stored slug in links_to_create instead of page_idscripts/ci_crosslink_wiki_kg.py — rebuilt from retired-script pattern as a proper PostgreSQL script using scidex.core.databasegenes-mtor → MTOR); DB lock retry via safe_insert_links_batch
[Atlas] Add ci_crosslink_wiki_kg.py pipeline script [task:55e3ea08-76c2-4974-9dc3-a304848cf1a9]PRAGMA integrity_check shows corrupted B-tree pages (Tree 27950, Tree 1059642). Full-table scans on wiki_pages and knowledge_edges fail with "database disk image is malformed"ci_crosslink_wiki_kg.py and cross_link_wiki_kg_advanced.py crash on corrupted B-tree pages — wrapped all queries in try/except sqlite3.DatabaseError with graceful degradationreport_coverage/report_backlog return -1 for corrupted queries instead of crashingstep1/step2 catch corruption and return 0 instead of crashing[Atlas] Make wiki-KG crosslink scripts resilient to DB corruption [task:55e3ea08-76c2-4974-9dc3-a304848cf1a9]{
"requirements": {
"coding": 7,
"reasoning": 6,
"analysis": 6,
"safety": 6
},
"completion_shas": [
"2393824c9a145a60b6bc4d99eaca8bae9eb4d949"
],
"completion_shas_checked_at": "2026-04-13T10:04:55.792546+00:00",
"completion_shas_missing": [
"1cc1e8c017f7fda1f55e35f3f86483e1f82d2e24",
"580de88bc9b488262ec9ff6158f00a643b1d907a",
"2c3c268e4116b16b61d711d8a791a4fcc217d1e3",
"3b29e183fb2f8f055ba25c8f964bae9552e336a8",
"52dced35847c5ab6f841ee3542305d8c36f600ec",
"460a79e0b1a399eb2c7896cedc5b18b49ac5b705",
"d038ee74bb8f85a5e9e7f11d6f57fef06114da4d",
"eac104935745ebfd7c529e7a4179eba66d39b77f",
"257d88853a5ef623306802a39b0d29262c98aaee",
"4e47bc38dbbb2d5455c95e0b95e25e8e194c88d4",
"75d14a3021238021fbe9dd0123aac9c60a6f4069",
"27d2dd53502f41d58e3182d562eb907465e14494",
"e847a04825f109c757fdbf6a5dbb1aee84b13c2f",
"d1fff2b4bc506d4784303bae2524dc1b1135c348",
"35f81be24516df3398c4cb6bb4eacafbfcf55cf4",
"2dced1708e235c4b8b41aa73b8e5ef6c66514d11",
"cafdbd8929e41c7ec6132ff7d258704081c3525d",
"5416d373a34b742925bc2c922a1aff7676f44678",
"6a0df564c8ca62b3e210f07ac6c765eaab26a1f3"
]
}