Expand description
Doctrine candidates: export postmortem findings into a havamal incubation file for human promotion.
Red line (tested, not commented): the machine never writes main doctrine. This module only ever opens the single configured incubation file, and only rewrites the managed block inside it — bytes outside the block are preserved exactly. Candidates carry provenance (session, trigger, evidence) and a dedup key so re-runs never duplicate. Promotion out of incubation is always a human edit (havamal maintenance sweep).
Opt-in: wiring reads EDDA_INCUBATION_PATH; unset ⇒ this module is never
called (zero behavior change — same shape as EDDA_LLM_API_KEY).
Structs§
- Doctrine
Candidate - A doctrine candidate bound for the incubation file.
Constants§
- CANDIDATES_
SECTION_ END - CANDIDATES_
SECTION_ START - MAX_
CANDIDATES_ PER_ RUN - Hard cap of candidates appended per postmortem run (anti-flooding).
Functions§
- resolve_
incubation_ path - Resolve the incubation path from the env value.
None/empty ⇒ feature off. Relative paths resolve againstcwd(the session’s repo root). - select_
candidates - Pick at most
maxcandidates from a postmortem result: high-severity lessons first, then rule proposals with confidence ≥ 0.7. - sync_
candidates_ to_ incubation - Append new candidates into the managed block of the incubation file.
- sync_
candidates_ to_ incubation_ with_ hints - Same as
sync_candidates_to_incubationbut appends per-candidate “Related in doctrine (machine hint, not judgment)” blocks derived fromdoctrine_entries(seecrate::sign_check). Passing an empty slice reproduces the base behavior exactly — sign-check is opt-in, off by default.