For AI agents: the documentation index is at llms.txt. Markdown versions are available by appending .md to any page URL, including this page's markdown.
Design
Rule, unit, request and finding contracts, plus the pipeline map.
Contracts
Rule
One YAML file per rule at data/rules/<domain>/<id>.yaml, with id equal to the filename. Fields live in src/types.ts (Rule) and are validated fail-closed by src/rules/validate.ts. An invalid rule aborts before any request is made.
A rule writes only what cannot be derived. The loader fills in domain from the category and tier from which of mechanical and question are present. For every unit kind but source it also fills scope.include from the unit kinds. Every rule skips tests, stories and changelogs; scope.exclude adds to that list.
- A mechanical section alone runs in code (
tier: mechanical). A raw-source regex only nominates a candidate. Its match does not prove the source skill’s conclusion. - A question alone sends one question per matching unit (
tier: jev). - Both together make the mechanical part a candidate filter (
tier: both). Only units it fires on go to Jev, and the mechanical hit never surfaces alone. A whole file past the context budget is judged on a window around the first candidate match, under the file’s unit id. - Anything that counts, compares or measures is a code rule in
src/rules/code/*.ts, withcheck(unit)in place ofmechanical. The loader returns both kinds in one list. preconditions.notGeneratedskips minified bundles and files that say they are generated.mechanical.absentpairs withregex. The rule fires only whenregexmatches andabsentmatches nowhere in the unit.mechanical.codeOnlymasks strings and comments in a JS or TSsourceunit, so a pattern quoted in a string or a comment never fires.thresholds.actandthresholds.revieware per rule. At or aboveactfails the run; between the two prints a review note; below is silent.severity(majororminor) says how bad a finding is if real. It is independent of probability.sourcepoints at the exact file and line the rule was harvested from.handWrittenlists the keysscripts/port-rules.tsmust not overwrite.- Raw-source candidates carry a
reviewprocedure: applicability, exceptions, evidence and verification. They stay review-only under every tuning overlay and report as .
Published with Edda