Wiki rot detector loop
Definition¶
Trust-fleet caretaker loop (ADR-0045 §4.9) that detects broken code citations in per-repo wikis. On each tick it walks every RepoWikiStore-registered repo's wiki entries, extracts code references via three patterns (path.py:symbol, dotted src.module.Class, and bare identifiers inside fenced code blocks as hints only), then verifies each hard cite. HydraFlow-self cites are checked via AST introspection; managed-repo cites are verified via grep over wiki markdown mirrors. For each broken cite the loop files a hydraflow-find + wiki-rot issue via PRManager, with a fuzzy-match suggestion from difflib.get_close_matches when the containing module still exists. After three unresolved attempts for a given slug+cite pair the loop escalates to hitl-escalation + wiki-rot-stuck.
Invariants¶
- Kill-switch:
enabled_cb("wiki_rot_detector")only — no config field (ADR-0049 trust-fleet convention). - Calls
reraise_on_credit_or_bug(exc)in its broad except block to preventCreditExhaustedErrorfrom being silently swallowed. - Does not run on startup (
run_on_startup=False) — the first tick is deferred to the normal interval.