Skip to main content

Module candidates

Module candidates 

Source
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§

DoctrineCandidate
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 against cwd (the session’s repo root).
select_candidates
Pick at most max candidates 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_incubation but appends per-candidate “Related in doctrine (machine hint, not judgment)” blocks derived from doctrine_entries (see crate::sign_check). Passing an empty slice reproduces the base behavior exactly — sign-check is opt-in, off by default.