Documentation
¶
Overview ¶
formwork-universal-cure-census — ratchet R3: no rule arm may pair an EXISTENTIAL detector with a UNIVERSAL cure.
Usage: go run -C tools/formwork-universal-cure-census . <repo-root>
Product enforcement is formwork type:command (.formwork/rules/exists-rule-cure-not-universal.yaml) with origin on this file. Exit 0 = no mis-paired arms, 1 = offenders listed, 2 = usage/env error.
The hole ¶
The audit measured 396 "absence-only" rules: they prove they fail when the guarded thing is DELETED but stay green on realistic present-but-wrong violations, because `mode: exists` asserts only that the pattern appears somewhere in scope. Most existential rules are honest — their cure asks for presence, which is what the detector checks. The hole is the arm whose cure states a UNIVERSAL obligation (every / each / all of) while detection stays existential: "every route must call checkFoo" is not discharged by one route calling it, yet the arm goes green on the first compliant file and cannot see any violation after it.
The detector ¶
The engine's scanner skips .formwork (spec §11), so no declarative rule can read the rule corpus — that is why this is an external tool like the vacuity census, not a forbidden-pattern arm. Per rule file, an arm FLAGS when it carries `mode: exists` AND its cure TEXT contains a universal- obligation word (every / each / all of). Both halves are arm-local, and the universal word must sit in the cure block itself (the `cure:` line plus its folded continuation) — not in a nearby comment, not in a sibling arm's cure. A whole-file co-occurrence false-positives on multi-arm files where one arm is existential and a DIFFERENT arm's cure is universal (the api-factory-cmd-lifecycle-class shape, pinned by testdata/pass-3), and a proximity window false-positives on an honest cure parked next to a comment that says "each" (the entitlements-audit-10001 shape, pinned by testdata/pass-4).
No known debt ¶
Every flagged arm is a finding. There is no list to carry one in: a mis-paired arm is cured or the census fails.