test: paired-negative tests for .claude/hooks/check-doc-authority.sh - #198
Merged
Conversation
chore: resync staging→main (promote 38 PRs + 3 merge-commits)
Wave 3 git.ts analog — flagship edit-time gate previously had 0 tests. ❌ REQUIRED_HEADER_DOC (.claude/rules/doc-authority-hierarchy.md) edited without `> **Authoritative for:**` → exit 1 + FAIL on stderr ✅ same file WITH header → exit 0 ✅ non-required file inside repo / path outside repo → off-path skip, exit 0 ✅ boundary: mid-prose mention (no blockquote) → exit 1 ✅ boundary: marker inside fenced code block (stripped) → exit 1 ✅ empty stdin file_path → exit 0 Reference pattern: check-hook-marker.test.ts (vitest + spawnSync + cwd=REPO_ROOT). Isolation: writeFixtureOverRepoFile saves/restores original content; never deletes. Mutation-sanity verified: hook broken → 3 ❌ tests fail; hook restored → 8/8 pass. Prior-art: skipped — test additions for existing capability, no new capability introduced (Track M.4.1 kickoff §3).
…ate) 2026-05-23-ast-test-drop-honest-accounting.md was present in the worktree without the required <!-- scope:... --> on line 1, causing principle 10 pre-push check to fail. Prior-art: skipped — structural annotation fix, no new capability.
artyhoo
enabled auto-merge (squash)
May 24, 2026 11:23
artyhoo
added a commit
that referenced
this pull request
May 25, 2026
… detection) (#220) Run `bash .claude/skills/meta-orchestrator/helpers/plan-currency-check.sh` (L2 Stage 3 detection shipped in #217) → 88 UNTRACKED-N entries surfaced between the 2026-05-22 reconciliation and origin/staging tip (#217). Map each to an existing §0 / Track row by adding the PR number to its evidence cell, or to a new §0 row for two umbrellas that landed in full since the prior snapshot. Re-run helper → 0 UNTRACKED remaining. Key changes: - Snapshot date 2026-05-22 → 2026-05-25 (header + §0). - N8 row: A-phase 🔲 → 🟡 — C1 SSOT-existence (#170), C2 kickoff T-enumeration floor (#174), C3 principle 13 §1.7 substance (#178), C4 delivery-channel marker (#177), activation #180. C5 + cost-levers remain gated on §5.3 utilisation trigger. - Track M.1 / M.4 → DONE: M.1 codified T20 via #212 (with NB note — recommendation-laziness took the T20 slot, mutation-equivalence T-bump 20→21 still pending); M.4 6 paired-negative bash-hook tests shipped #195/#196/#197/#198/#199/#200. - Two new §0 rows: Meta-orchestrator skill (Track P) — BUILD #186 + audit rounds #192/#193/#194/#201/#202 + UX refactor #203/#204/#205 + planner-completeness #213/#214/#217 + §1.7 PR-body mandate #216; Recommendation-laziness discipline — R-phase #206/#207, benchmark #210, I-phase Sub-waves A/C/D #211/#212/#215. - N7 row: + dogfood research-patch #135 / §4 demotion #166 / live-trial verified #171. N4b row: + design #136 / record #118. - Infra paragraph: PR refs for I.1 follow-ups (#121/#123/#124/#125/ #128/#130/#131/#143/#145/#146/#147/#148/#149/#172/#187), I.2 (#139/#142/#154/#175), I.3 DN-4 (#126/#132/#133/#138/#140/#152/ #159/#161/#162/#167). - Track 2.3 (channel-earliness audit) → DONE 2026-05-23 (#181); removed from "What actually remains". - Footer subsection: standalone work (#191 satellite-arch / #189 guard-liveness / #173 storm-readiness / #176 §10 port / #182 cleanup), Wave 10 follow-ups (#110/#112/#113), plan-revision history (#108/ #109/#153/#155/#157/#160/#164/#165/#168/#179/#185). Verification: - `bash .claude/skills/meta-orchestrator/helpers/plan-currency-check.sh | grep -c '^UNTRACKED'` → 0 (down from 88). - `npx markdownlint-cli docs/meta-factory/wave-sequencing-plan.md` → no violations. - `npx vitest run packages/core/skills/plan-currency-check.test.ts` → 14/14 passed. Prior-art: skipped — chore, doc reconciliation only, no new capability or rule introduced.
17 tasks
This was referenced Jul 3, 2026
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.
Summary
packages/core/hooks/check-doc-authority.test.ts— 8 vitest functional tests for the flagship PostToolUse edit-time gate (check-doc-authority.sh)2026-05-23-ast-test-drop-honest-accounting.mdwas missing<!-- scope:... -->annotation (committed in a separate chore commit)Test contract (8 tests)
> **Authoritative for:**Authoritative for:in mid-prose (no blockquote)Mutation-sanity verified
Hook broken → 3 ❌ tests fail; hook restored → 8/8 pass.
Implementation notes
check-hook-marker.test.ts(vitest + spawnSync + cwd=REPO_ROOT)writeFixtureOverRepoFilesaves original content + restores inafterEach; never deletes required docsFIXTURE_REQUIRED_DOC = '.claude/rules/doc-authority-hierarchy.md'(exists in worktree, is inREQUIRED_HEADER_DOCS)cwd: REPO_ROOTin spawnSync — required soprocess.cwd()in09-doc-authority-hierarchy.ts:168resolves to repo rootjqunavailable (describe.skipIf(!JQ))§1.7 Forward-check applied
check-doc-authority.sh) — not a capability commit per CLAUDE.md definitionPrior-art: skipped — test additions for existing capabilityescape hatch correct; warn-only flag from pre-push is expected and passesdoc-authority-hierarchy.md §2: test files explicitly exempt from authority headers§1.7 Backward-check applied
packages/core/hooks/check-doc-authority.test.ts(new),docs/meta-factory/research-patches/2026-05-23-ast-test-drop-honest-accounting.md(scope annotation added)hooks/pre-push.test.ts,principles/09-doc-authority-hierarchy.test.ts) were confirmed pre-existing before this branch — both caused byCLAUDE.mdmissing in the main repo's main branch at the time of worktree creation (CLAUDE.md was restored to worktree before push; pre-push passes)