test(hooks): executable CLAUDE.md prose ↔ prior-art hook sync (closes a #hope-as-gate) - #984
Merged
Merged
Conversation
… attention-only) CLAUDE.md:36 promises «the prose definition and the hook stay in sync», but nothing enforced it — a #hope-as-gate per attention-is-not-a-mechanism.md §1 (detection layer was «a reviewer will notice»). Reviewer verification on 2026-07-11 confirmed: zero automated checks reference the capability-commit definition. New tests parse the nonDepBlockRe alternation out of prior-art.ts source and assert each skipped block name (overrides/resolutions/pnpm) is named in the CLAUDE.md explicit-dependency bullet; a canonical-trio floor guards against silently narrowing the regex; paired negatives cover stale prose and a moved/renamed bullet (extractor throws — loud, not silent-pass). RED observed: mutating the CLAUDE.md bullet (dropping `resolutions`) fails the containment test; restored prose → 108/108 green. Runs in test:hooks (pre-push + CI audit-self), i.e. earlier than human review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Invited follow-up from the 2026-07-11 reviewer verification: the «prose definition and the hook stay in sync» promise at CLAUDE.md:36 had no enforcement — verified as a
#hope-as-gate(attention-is-not-a-mechanism.md §1): zero automated checks referenced the capability-commit definition (searched principles/, audit-self/, scripts/, workflows under three phrasings).Change
packages/core/hooks/checks/prior-art.test.ts— new describe block making the overrides-exclusion clause of the sync executable:nonDepBlockRealternation out ofprior-art.tssource; asserts every skipped block name is present (backticked) in the CLAUDE.md explicit-dependency bullet;overrides/resolutions/pnpm) guards against silently narrowing the regex;RED observed before trusting the test: mutating CLAUDE.md (dropping
`resolutions`) → 1 failed; restored → 108/108.Channel: runs inside
test:hooks→ pre-push + CI (audit-self), i.e. the check fires earlier than the human-review channel it replaces.Scope note: the sync is made executable for the block-exclusion clause specifically (the clause added in PR #983). The rest of the prose bullet (semver-prefix list, LOC thresholds) remains attention-synced — extending coverage is possible but was not invited; noted as future candidate.
§1.7 Self-discipline check (REQUIRED if PR touches discipline-bearing files)
§1.7 Forward-check applied
The rule this PR strengthens («prose and hook stay in sync», CLAUDE.md:36) now fails at the earliest reachable channel instead of relying on reviewer attention:
packages/core/hooks/checks/prior-art.test.ts:180-247executes on everytest:hooksrun (pre-push step + CI audit-self job). Paired negatives are non-vacuous — RED was observed against a real prose mutation before the test was committed.§1.7 Backward-check applied
Class of this change = making an attention-only sync promise executable. Sibling surfaces where the same class occurs, swept: CLAUDE.md:38 LOC-thresholds + semver-prefix prose vs
prior-art.tsloc()/dep-regex (GAP-KNOWN — deliberately out of invited scope, recorded above as future candidate);packages/core/principles/09-doc-authority-hierarchy.test.ts(doc-structure checks exist but none cover capability-commit definition — confirmed by grep, SWEPT-CLEAN for overlap);.github/workflows/audit-self.yml§7 trailer backstop (validates trailers, not the definition text — SWEPT-CLEAN);packages/core/audit-self/audit-ai-docs.ts(ai-docs drift scope, no capability-commit references — SWEPT-CLEAN).