Skip to content

test(hooks): executable CLAUDE.md prose ↔ prior-art hook sync (closes a #hope-as-gate) - #984

Merged
artyhoo merged 1 commit into
stagingfrom
test/prior-art-prose-sync
Jul 11, 2026
Merged

test(hooks): executable CLAUDE.md prose ↔ prior-art hook sync (closes a #hope-as-gate)#984
artyhoo merged 1 commit into
stagingfrom
test/prior-art-prose-sync

Conversation

@artyhoo

@artyhoo artyhoo commented Jul 11, 2026

Copy link
Copy Markdown
Owner

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:

  • parses the nonDepBlockRe alternation out of prior-art.ts source; asserts every skipped block name is present (backticked) in the CLAUDE.md explicit-dependency bullet;
  • canonical-trio floor (overrides/resolutions/pnpm) guards against silently narrowing the regex;
  • paired negatives: stale prose missing a code block name fails containment; a moved/renamed bullet makes the extractor throw (loud, not silent-pass).

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-247 executes on every test:hooks run (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.ts loc()/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).

… 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.
@artyhoo
artyhoo merged commit e798952 into staging Jul 11, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants