Three boundary hygiene rules (enforce + least-resistance)
Goal
- Author the three gap-rules research confirmed absent; each cites the registry/lint as backing.
- Extend
PHASE-54, never restate it — restating the umbrella would be theLEAKthis plan guards against.
Implementation Sketch
- Registration-required (COVER family): a new canon-IR consumer MUST appear in
ori_ir::canon::consumerswith its pool subset; lint-enforced. - Least-resistance (PHASE/SSOT family): the canonical read-API MUST be at least as ergonomic as re-deriving; a canonical query more painful than the re-derivation shortcut is itself a
LEAK:frontend-reimplementationrisk factor. - Proactive-at-add (mirrors
DESIGN-23fires-on-first shape, scoped to MEANING re-derivation): the first hand-rolled name-res/type-inf/trait-op-res/pattern-compilation in a NEW consumer isLEAK:frontend-reimplementation, caught at authoring; scopeori_evalruntime-dispatch as allowed. - Add matching
finding-categories.mdsubcats; no-duplication check vsPHASE-54(cite/extend, never restate).
Spec References
impl-hygiene.md PHASE-54 / DESIGN-23 / COVER-* / SSOT-*; finding-categories.md LEAK:frontend-reimplementation; skill-vocabulary.md §3 (prescriptive-only).
Work Items
- Complete the registration-required rule by replacing the existing COVER-35 STUB text at impl-hygiene.md:272 in place — do NOT allocate a new COVER number (COVER-35 is already the highest COVER id in the file and its own stub sentence names this section as the landing site). Land the full rule text (severity, cure, pin-via, matching the
- PREFIX-NN (was CATEGORY:subcat): directive (Severity); cure; pin via ...shape every other rule follows) citingori_ir::canon::consumers::CANON_CONSUMERS(compiler/ori_ir/src/canon/consumers.rs) as the registry andcompiler_repo/scripts/crate-dag-lint.py check_registered_consumers/check_unregistered_consumersas the lint-enforced backing. Extend PHASE-54 + COVER-09, never restate either. - Author the least-resistance rule (PHASE/SSOT family) with the ergonomics-risk-factor directive.
- Author the proactive-at-add rule mirroring
DESIGN-23’s shape, scoped to meaning re-derivation,ori_evaldispatch carved out. - Add
finding-categories.mdsubcats + run the no-duplication check againstPHASE-54. - Add finding-categories.md subcats: one new/extended
LEAK:*sibling to the shippedLEAK:frontend-reimplementation(finding-categories.md:25) per new/completed rule in this section (the completed COVER-35 registration-gap, the new least-resistance rule, the new proactive-at-add rule) — cite/extend PHASE-54, never restate it. Then regenerate the frozen token surface: runpython -m scripts.finding_categories freezeand verify withpython -m scripts.finding_categories freeze --check(must report ‘freeze in sync’) socategory_tokens()reflects the new subcats, not just the.md. Finally run the no-duplication check the section’s own Goal demands: re-read PHASE-54’s full text (impl-hygiene.md:112) immediately before finalizing each new rule’s wording, and confirmpython3 -c "from scripts.impl_hygiene_review_runtime.rules_parser import load_rules; from scripts.impl_hygiene_review_runtime.rule_metadata import finding_categories_tier_drift; rs=load_rules('.claude/rules/impl-hygiene.md'); print(finding_categories_tier_drift(rs, '.claude/rules/finding-categories.md'))"reports only the 2 pre-existing, unrelated drift entries (dead-instrumentation-dependency, trace-target-naming-drift) with no new drift introduced by this section’s edits. - Fix the section’s own plan-wide success criterion sc-20775d1462 BEFORE authoring any of the three rules: its probe_ref (
python -m scripts.plan_corpus check-rules impl-hygiene finding-categories) names a nonexistent scripts.plan_corpus subcommand — verified live, argparse rejects ‘check-rules’ and lists the real choices as check|discover|docgen|migrate|coherence|export|resolve-content-hash-drift-detected|advance-section|set-cross-plan-needs|recover-layer-criteria. This is the THIRD instance of the identical phantom-probe_ref defect class in this plan (walking-skeleton’s dossier flagged its own instance; consumer-registration-lint’s w-8a2865ab already fixed sc-5a808987f4’s phantomscripts.consumer_ssot_lintthe same way). Amend sc-20775d1462 viascripts/plan_corpus/write.py:amend_success_criterion(never a hand-edit — plan.json is script-only per plan-read-discipline.md Sec2.1) to point at the real, working parity machinery:rules_parser.load_rules('.claude/rules/impl-hygiene.md')(verified: parses 610 rules) composed withrule_metadata.finding_categories_tier_drift(rule_set, '.claude/rules/finding-categories.md')(verified: runs clean modulo 2 pre-existing unrelated drift entries), or a thin —self-test wrapper over them — never the fictional check-rules CLI verb. This section cannot honestly claim its own north-star gate is provable while its criterion’s probe_ref does not resolve to a real command. - (abandoned) COVER family, next free number
Fresh intel (regenerated)
This section authors PROSE (three impl-hygiene.md rules + finding-categories.md subcats), not code — its “terrain” is a rule-catalog gap, not a Rust symbol surface. The registry+lint spine it cites (ori_ir::canon::consumers + crate-dag-lint.py) is ALREADY FULLY BUILT, WIRED, AND GREEN on the real tree (verified live: crate-dag-lint.py exits 0, --self-test passes, lefthook + test-all.sh both invoke it in --warn-only mode). This section’s entire job is to turn three implicit facts into three explicit, citable rules.
Three decisions this package forces before any prose is written:
- The section’s own plan-wide success criterion (
sc-20775d1462) is a phantom-primitive-ref — the THIRD instance of this exact defect class in this plan. Itsprobe_refispython -m scripts.plan_corpus check-rules impl-hygiene finding-categories—check-rulesis not a validscripts.plan_corpussubcommand (verified live:argparserejects it, real choices arecheck|discover|docgen|migrate|coherence|export|resolve-content-hash-drift-detected|advance-section|set-cross-plan-needs|recover-layer-criteria). Both sibling sections already hit and fixed the identical shape on their own criteria (walking-skeleton’s dossier flagged it;consumer-registration-lint’sw-8a2865abfixedsc-5a808987f4’s phantomscripts.consumer_ssot_lint). This section MUST fixsc-20775d1462’sprobe_refviascripts/plan_corpus/write.pybefore it can honestly claim its own north-star gate — never author the three rules while leaving the criterion unprovable. - A real, working parity-checker already exists for exactly this criterion’s intent — reuse it, don’t invent a new probe.
scripts/impl_hygiene_review_runtime/rules_parser.py:load_rules('.claude/rules/impl-hygiene.md')(verified live: parses 610 rules across the 14 canonicalPREFIX-NNfamilies) +rule_metadata.py:finding_categories_tier_drift(rule_set, fc_path)(verified live: runs clean against the current tree modulo 2 PRE-EXISTING, unrelated drift entries —dead-instrumentation-dependencyandtrace-target-naming-drifttier mismatches, neither touching this section’s rules) is the SSOT parity machinery.scripts/finding_categories/api.py:category_tokens()is the sibling machine-readable token freeze. The correctedprobe_refshould invoke one of these (or a thin--self-testwrapper over them), never a fictional CLI verb. - COVER-35 (the walking-skeleton’s stub) currently has NO finding-categories.md counterpart at all — confirmed by the drift-checker’s silence.
finding_categories_tier_driftonly flagged 2 UNRELATED pre-existing mismatches; it said nothing about COVER-35 because COVER-35 carries no(was CATEGORY:subcat)tag to check. This section’sw-bdd9abd3(“Add finding-categories.md subcats”) is not cosmetic — it is closing a real, currently-invisible-to-tooling gap. The natural home is aLEAK:*sibling family to the ALREADY-SHIPPEDLEAK:frontend-reimplementation(finding-categories.md line 25) — one new/extended subcat per rule (COVER-35 registration-gap, the new least-resistance rule, the new proactive-at-add rule), never a restatement offrontend-reimplementationitself.
DIG DEEPER
scripts/intel-query.sh plan-status canonical-consumer-boundary --human
scripts/intel-query.sh dag-ascii canonical-consumer-boundary --human
python -m scripts.plan_corpus.read plans/canonical-consumer-boundary --criteria --section s-8001a4b8
python -m scripts.plan_corpus check-rules impl-hygiene finding-categories # confirms: invalid choice, reproduces finding #1
python3 -c "from scripts.impl_hygiene_review_runtime.rules_parser import load_rules; from scripts.impl_hygiene_review_runtime.rule_metadata import finding_categories_tier_drift; rs=load_rules('.claude/rules/impl-hygiene.md'); print(rs.rule_count, finding_categories_tier_drift(rs, '.claude/rules/finding-categories.md'))"
(full dossier: boundary-hygiene-rules—s-8001a4b8.intel.md)