test: consolidate hook-utils suites into one shared lib suite#25
Conversation
The four per-plugin hook-utils.test.sh copies had diverged (three identical in logic, ruff-format's adding six read_file_path membership cases) while testing the byte-identical lib. The union now lives beside the source as lib/hook-utils.test.sh with a neutral hook id, and the hook-utils-sync CI lane runs it — copy byte-identity means testing the source covers every plugin copy. Plugins keep only their black-box hook contract tests. All four plugin versions bump patch so installed copies drop the now-removed per-plugin lib test file. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012NNwc8U9MbgWsd5sbrfpPh
|
Claude finished @kyle-sexton's task in 1m 52s —— View job PR Review
Verdict: Looks good — one pre-existing test quality observation below, nothing blocking. This is a clean consolidation. The design rationale is sound: the byte-identity CI gate already guarantees the plugin copies are identical to the source, so testing the source is sufficient. Removing ~1 000 lines of duplicate tests without losing coverage is a net improvement. CI wiring
Step ordering in the
lib/hook-utils.test.sh
The 43-case suite is the correct superset: it subsumes the three identical per-plugin versions and adds the six One pre-existing observation (inherited, not introduced here):
Test 9 ("relative sink, no anchor: fail-open skip") removes Plugin version bumpsAll four plugins bumped patch:
Patch is the right semver level for removing a file with no behavioral change to the hooks themselves. Consumers updating will have the deleted Migration playbookThe "Known follow-up" is correctly replaced with the settled state. The new wording accurately describes the architecture (source ↔ copies, one suite, CI-enforced). SummaryNo correctness, security, or CLAUDE.md alignment issues. The Test 9 |
…e IV, flip pre-build (#939) Dated Phase-4 note: operator ruling (2026-07-22) to move at maximum speed within the predicate's intent. Calendar gates stay binding; sanctioned levers are front-loaded seeding (genuine items only), parallel Phase IV ignition (gate already met), and pre-built Phase III flip machinery. Records same-day watch activity: drain PRs #23/#24/#26 + Dependabot #25 merged in kyle-sexton/autonomy-demo-scratch, queue reseeded (scratch#27–#31), predicate completions=6. ## Related - kyle-sexton/autonomy-demo-scratch#27, #28, #29, #30, #31. No linked issue — status-note documentation; nothing in this repo closes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5 <noreply@anthropic.com>


Summary
Closes the follow-up recorded in the shared-code decision record (#24): the four per-plugin
hooks/hook-utils.test.shsuites had diverged — three were logic-identical (differing only in hook-id/extension fixtures), ruff-format's added sixhook::read_file_pathmembership-guard cases — despite testing the byte-identical lib.sample-hookid and a lib-scoped header) now lives atlib/hook-utils.test.sh, beside the canonical source.hook-utils-syncCI lane runs the suite — since the lane already enforces that every plugin copy is byte-identical to the source, testing the source covers the copies. Lib unit tests now run in CI for the first time (previously manual-only).<plugin>.test.sh).Verification
lib/hook-utils.test.sh: 43/43 pass.claude plugin validate×4 +--strictcatalog pass; shellcheck, actionlint, markdownlint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_012NNwc8U9MbgWsd5sbrfpPh
Note
Low Risk
Test and packaging-only changes; no shared runtime library behavior is modified in this diff.
Overview
Consolidates duplicated
hook-utilsunit tests into a single suite atlib/hook-utils.test.shand removes the four per-pluginhooks/hook-utils.test.shcopies (bash-lint, biome-format, markdown-formatter, ruff-format).The shared suite generalizes telemetry fixtures to a neutral
sample-hookid and documents that byte-identical plugin copies are covered by testing the canonical lib. Thehook-utils-syncCI job now runsbash lib/hook-utils.test.shafter the sync check, so lib unit tests are enforced in CI for the first time.Docs in
MIGRATION-PLAYBOOK.mdreplace the deferred “merge the four suites” note with the settled single-suite model. Patch version bumps on all four carrying plugins so installs drop the removed test files from cached plugin trees.Reviewed by Cursor Bugbot for commit fed7c3d. Bugbot is set up for automated code reviews on this repo. Configure here.