Repository navigation
feat(#1603): one hook channel per checkout — doctor fails when repo hooks and a sequant plugin are both active; init/update skip the hooks group when the plugin is enabled - #1618
Merged
admarble merged 2 commits intoOct 28, 2026
Conversation
…ck, init/update/sync honour "hooks": "plugin" Shared detector src/lib/hook-channels.ts resolves enabled plugins through installed_plugins.json and counts one as a channel only when its hooks/hooks.json registers pre-tool.sh. ADR-0022 records the manifest field. Entire-Checkpoint: cc8249b073c0
… carries the repo hooks; PluginHookChannel file-local Resolves the QA follow-up: with a hook-shipping plugin enabled and .claude/hooks already present, init still skips the hooks group and now prints one line saying both channels are active and that doctor's Hook channels check fails until the repo copy goes. Mutation-verified test. PluginHookChannel is unexported so lint:health returns to the baseline. Entire-Checkpoint: 8c9796038eb1
admarble
added a commit
that referenced
this pull request
Oct 27, 2026
…e-local exports unexported, ADR renumbered to 0023 behind #1603 QA fix_now items from the #1604 verdict: a runner that throws after the patch is captured now restores by patch and names the patch path (new test); defaultVitestRunner, renderMutation and VitestRunResult are file-local so lint:health returns to the baseline. The ADR moves from 0022 to 0023 because #1603's PR #1618 ships ADR-0022 and lands first. Entire-Checkpoint: 776551c51856
This was referenced Oct 27, 2026
admarble
deleted the
feature/1603-feat-doctor-init-one-hook-channel-per-checkout-doc
branch
October 28, 2026 06:34
admarble
added a commit
that referenced
this pull request
Oct 28, 2026
…ication refuses a dirty tree, requires a real failing run, restores by patch, and is the only producer of SEQUANT_MUTATION markers (#1620) * feat(#1604): sequant mutation begin | check | render — mutation verification refuses a dirty tree, requires a real failing run, restores by patch, and produces the SEQUANT_MUTATION markers begin records HEAD on a clean tree; check resolves one test with vitest list, captures the mutation with git add -A + git diff --cached --binary, requires the named test to fail under it and pass after git apply -R --index, and appends the record to .sequant/mutations/<N>.json; render prints markers through renderMutationMarker. Under sequant run, openOrUpdatePR reads the record file and buildAutomatedPRBody appends its markers, deduped against exec's. renderMutationMarker escapes backticks. ADR-0022, docs/reference/mutation-verification.md. Entire-Checkpoint: 8b53a986ce4a * docs(#1604): renderMutationMarker comment names the \u0060 escape Entire-Checkpoint: 9681f39698b6 * test(#1604): AC-5 round-trip test name carries no brace or comment delimiter Entire-Checkpoint: c7585144cbf8 * fix(#1604): check restores the tree when the runner throws, three file-local exports unexported, ADR renumbered to 0023 behind #1603 QA fix_now items from the #1604 verdict: a runner that throws after the patch is captured now restores by patch and names the patch path (new test); defaultVitestRunner, renderMutation and VitestRunResult are file-local so lint:health returns to the baseline. The ADR moves from 0022 to 0023 because #1603's PR #1618 ships ADR-0022 and lands first. Entire-Checkpoint: 776551c51856
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
#1603 is implemented and pushed on
feature/1603-feat-doctor-init-one-hook-channel-per-checkout-doc(commit 9c6e3c1). This is an orchestrated run, so I opened no PR; the orchestrator opens it.src/lib/hook-channels.ts(detectHookChannels) is the only new reader ofinstalled_plugins.json; nothing insrcread it before. It mergesenabledPluginsin the order user, then project, then local, so a localfalseturns off a usertrue. It resolves each plugin's install path, preferring this checkout's local or project entry over the user entry, and counts a plugin only if itshooks/hooks.jsonregisterspre-tool.sh. It never matches on the plugin name. A missing or malformed file counts as "no channel" and never throws.doctor. The newHook channelscheck fails when both channels are active, names both files, and gives both fixes. When the manifest has"hooks": "plugin", theHooksandSettingschecks pass instead of warning.init. When a plugin ships the hooks,initwrites no.claude/hooks/and no.claude/settings.json, records"hooks": "plugin"in the manifest, and prints one line before the confirmation prompt.--agent opencodeand--agent codexstill get the repo hooks, because their wrappers run.claude/hooks/pre-tool.sh.updateandsync. Both drop.claude/hooks/**and.claude/settings.jsonfrom everything they compute or write when the manifest has the field. Forsyncthat covers the drift scan, the version-current report, the dry run, the apply preview andcopyTemplates.docs/features/plugin-distribution.mdstates the one-channel rule and names the check, and the "Hooks … viasequant init" row no longer implies both channels. There is a CHANGELOG entry and ADR-0022 (a manifest field rather than an install group, becauseupdaterefuses any partialgroupsscope).Where this differs from the founding doc
updateskips the hooks when the plugin is enabled. Hereupdatereads"hooks": "plugin"from the manifest instead of detecting the plugin again, so a checkout keeps whatinitchose even on a machine without the plugin (ADR-0022, Option C).syncis outside "May touch". I changed it anyway (derived AC-6): without it, the nextsequant syncwould put the hooks back and undo AC-2.warncase (neither channel present while the manifest expects hooks) is not implemented, because no AC covers it.writer-state-matrix.test.tsto unsetCLAUDE_CONFIG_DIR. The detector reads that variable, as Claude Code does, and the test would otherwise stop being independent of the machine.AC verification
npx vitest run src/commands/doctor.test.ts -t "Hook channels"→ 8 passed, 0 failed (both active → fail naming both paths; repo only; plugin only; plugin with nohooks/hooks.json; localfalseoverride; local-scope entry; malformed registry; manifest-pluginHooks/Settingspass)npx vitest run src/commands/init.test.ts -t "plugin channel"→ 3 passed, plustemplates.test.ts"skipHooks leaves out only .claude/hooks and .claude/settings.json" on a real filesystemnpx vitest run src/commands/update.test.ts -t "hooks: plugin"→ 3 passedgrep -c 'Hook channels' docs/features/plugin-distribution.md→ 1npx vitest run src/commands/sync.test.ts -t "hooks: plugin"→ 3 passedMutation-verified: AC-1 — deleted the fail branch in
checkHookChannels;src/commands/doctor.test.ts > 1603 AC-1: Hook channels > fails when repo hooks and a hook-shipping plugin are both active, naming both pathsfailed (and the local-scope case); restored.Mutation-verified: AC-2 — deleted the
skipHooksspreaFixes #1603
Follow-ups
doctorcheck (testnames both active channels…, mutation-verified below).Runner verification (graph-run, 2026-10-26)
Executed in the worktree at 9c6e3c1, then again at 50561b2:
npx vitest run src/commands/doctor.test.ts -t "Hook channels"→ 8 passed (≥ 4 required).npx vitest run src/commands/init.test.ts -t "plugin channel"→ 3 passed, now 4 with the re-init notice test.npx vitest run src/commands/update.test.ts -t "hooks: plugin"→ 3 passed.npx vitest run src/commands/sync.test.ts -t "hooks: plugin"→ 3 passed.grep -c 'Hook channels' docs/features/plugin-distribution.md→ 1. AC-5 skill-dir diff count → 0.npx tsc --noEmit,eslint --max-warnings 0andnpm run lint:healthclean after the fix commit (unusedExportsback at the 339 baseline;initCommandstays under 200 lines).Fix commit 50561b2 beyond the agent's work: the QA follow-up above (one-line notice on re-init) and
PluginHookChannelmade file-local (it turnedhealth-advisoryred: 339 → 340). Mutation-verified: follow-up — deleted thewarnBothHookChannelscall ininitCommand;src/commands/init.test.ts > 1603 AC-2: plugin channel > names both active channels when .claude/hooks already exists and a plugin ships the hooksfailed; restored.The
SEQUANT_QA_VERDICTon the issue names commit 9c6e3c1; the runner fix is the only commit after it. Merge order: this PR lands before #1620, which carries ADR-0023 to this PR's ADR-0022.🤖 Generated by
sequant run