Skip to main content

Module sign_check

Module sign_check 

Source
Expand description

Sign-check: surface doctrine entries that share a family with a machine candidate — so at sign time the operator sees related existing scars next to the candidate, and can judge for themselves whether it duplicates or contradicts what’s already in doctrine.

Vocabulary alignment (Foundry q328 review verdict): reuses [scars::normalize_prefix] and [scars::PREFIX_LEN] verbatim. We do NOT introduce a rival “contradiction” concept — same by_label/family key, same rules. The machine only hints; the human judges.

Contract:

  • Read failure-memory.md, layer-1-ideology.md, layer-6-heart-methods.md from a doctrine dir; parse ### <heading> entries.
  • Compute family key for each entry (first line after heading).
  • For a candidate maxim, compute its family key and find entries with the same key.
  • Render a “Related in doctrine (machine hint, not judgment)” markdown block, or empty string when no related entries exist.

Opt-in: this module is only invoked when both EDDA_INCUBATION_PATH and EDDA_DOCTRINE_PATH are set. Unset ⇒ zero behavior change (candidate render stays exactly as SELECTOR3 shipped it).

Structs§

DoctrineEntry
A single doctrine entry parsed from a doctrine markdown file.

Constants§

DOCTRINE_FILES
Doctrine files scanned for related entries. Ordered by scan priority.

Functions§

load_doctrine_entries
Load all parseable entries from a doctrine directory. Missing directory or missing files are silently skipped (best-effort).
parse_entries
Parse ### <heading> entries from a doctrine file’s markdown. Family key is computed from the heading (with any FM-N: / 6.N: / L1.N: numeric prefix stripped) — humans identify a scar by its heading, not its body, and candidate maxims (from Lesson.text) are one-line summaries that align with headings, not with bullet bodies. first_line is stored for display context only; it does not drive matching.
related_entries
Find entries whose family key relates to the candidate’s. Vocabulary alignment: family key = normalize_prefix(...), same function scars.rs uses. Match rule: keys equal OR one is a prefix of the other (candidate maxims often carry trailing qualifiers like “(machine-surfaced)” that make them longer than the canonical heading; either direction is OK).
render_related_hint
Render a markdown hint block (“Related in doctrine (machine hint, not judgment)”) for a candidate, or empty string when no related entries.