Repository navigation
Description
Epic: graph-2026-10-freeze-b Tier: mechanical Execution: sequant_run
Problem
Phase agents run in worktrees created from HEAD, so they run the committed .claude/hooks/, not the copies on disk in the main checkout. #1354 added a warning for this case, but only for .claude/skills/: src/lib/skills-commit-state.ts lists tracked-but-modified files under SKILLS_DIR_PATH alone. A sequant sync or update that rewrites pre-tool.sh or post-tool.sh and is never committed leaves every later phase running the old hooks, with no warning anywhere.
Field evidence: ad-motion commit e48f63e (2026-10-07): "pre-tool.sh and post-tool.sh were left uncommitted at 2.18.0 by the 2026-09-27 sync, so phase worktrees ran the older committed hooks." Ten days of phases ran pre-2.18.0 guard logic with no signal.
ADR-0012 doesn't remove this. Its skills-only plugin view carries no hooks, so hooks remain committed project files.
Proposal
Extend the commit-state check to .claude/hooks/ and keep one shared warning. The same callers (run-orchestrator.ts:1240, doctor.ts, sync.ts) print it, so no caller logic changes.
Acceptance Criteria
- AC-1: The commit-state check reports tracked files with uncommitted changes under
.claude/hooks/as well as.claude/skills/, and the shared warning names which directory each file is in. Evidence: unit tests in a temp git repo covering a modified tracked hook (warns, names.claude/hooks/), a modified tracked skill (unchanged behaviour), and both clean (no warning), mutation-verified by removing the hooks path from the check - AC-2:
sequant run,doctorandsyncprint the hooks warning through their existing call sites, with no new call site added. Evidence:grep -n 'getSkillsCommitState\|formatSkillsCommitWarning' src/commands/doctor.ts src/commands/sync.ts src/lib/workflow/run-orchestrator.tsshows the same three call sites as before, and one existing caller test asserts the hooks line (doctor's orrun-orchestrator's, notsync's:sync.tsand its tests are fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409's scope in this graph) - AC-3: Untracked hook files produce no warning (as for skills, where fix(doctor/run):
doctorandrun --dry-runreport success when nothing would work #1257's doctor check owns untracked files). Evidence: a unit test with an untracked file under.claude/hooks/showing no warning
May touch
src/lib/skills-commit-state.ts (rename the module or export only if needed; if so, keep the old names as re-exports), its tests, and one caller test (doctor or run-orchestrator; not sync, which is #1409's), CHANGELOG.md.
Prior fixes / producers
- fix(run): skills freshness is read from the working tree, but phases use committed skills — an uncommitted sync names the wrong version and silently runs old skills #1354: the skills-only version of this check (
git log -- src/lib/skills-commit-state.ts). - Producer of the warning: one module (
skills-commit-state.ts); consumers: three call sites, unchanged. Graph neighbour: fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409 reads the manifest and editssync.ts; this issue edits neither. - feat(doctor): report each phase skill's source; narrow the committed-skills guards (ADR-0012 follow-up 3) #1399 (ADR-0012 follow-up 3, blocked by feat(run): load phase skills from the installed package when the project doesn't commit them (ADR-0012 follow-up 2) #1398) narrows the same module's skills warning to tracked skills. The two changes touch the same function, so whichever lands second rebases. Neither changes the other's semantics.
Non-Goals
- No edit to
.claude/skills/,templates/skills/orplugin/, so the change is freeze-safe. - No auto-commit and no blocking. The check stays a warning.
Activity
docs(graph): add #1456 and #1460 to graph-2026-10-freeze-b (#1462)
admarble commentedon Oct 16, 2026
Runner context (graph-2026-10-freeze-b, wave 2)
Wave 1 merged on 2026-10-16.
mainis at 9f1fb3f and includes #1440, #1396, #1305, #1325, #1405 and #1409. These notes are for both the exec phase and the qa phase:npm test(the full suite) in exec or qa. Each phase stops after 30 minutes with no progress, and these phases run the published sequant 2.19.0, which has no affected-tests mode. Run the test files you change or name withnpx vitest run <file>. CI runs the full suite on the PR.mainbut not released). Keep braces out of themutationandfailedTesttext.plugin/,.claude/skills/ortemplates/skills/.src/commands/update.tsandsync.install-scope.integration.test.ts. Leave both alone. As the issue says, the caller test isdoctor's orrun-orchestrator's, notsync's.admarble commentedon Oct 16, 2026
Complexity: Standard (3 ACs, 3 directories)
AC Quality Check
All three ACs are single-line with an
Evidence:clause. Notes:maintoday. Not vacuous.grepis vacuous on its own: it matches the same three call sites before and after the change. The caller-test half is the real gate. Keep it, and read the grep as a "no new call site" guard..claude/hooks/.Scope Assessment
Non-Goals: present (no edits to skills/templates/plugin; no auto-commit or blocking).
src/lib,src/commands,src/lib/workflow)Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Check covers
.claude/hooks/, warning names the directoryVerification: Integration Test (temp git repo, extends
src/lib/skills-commit-state.integration.test.ts)Scenario: Given a committed hook modified on disk → When
getSkillsCommitState+formatSkillsCommitWarningrun → Then the warning names.claude/hooks/. Skill-only, hook-only and both-clean cases are covered too.Assumptions:
git status --porcelainpaths are repo-root-relative, so the directory can be derived from the path prefix.AC-2: Existing call sites print it, no new call site
Verification: Unit Test (
doctor.test.ts) plus the grepScenario: Given
getSkillsCommitStatemocked to return a.claude/hooks/pre-tool.shentry → WhendoctorCommandruns → Then output contains.claude/hooks/.AC-3: Untracked hooks stay silent
Verification: Integration Test
Scenario: Given an untracked file under
.claude/hooks/→ When the state is read → Thenmodifiedis[]and the warning is null.--untracked-files=noalready guarantees this.Implementation Plan
Phase 1: Producer (
src/lib/skills-commit-state.ts)HOOKS_DIR_PATH = ".claude/hooks". Pass both pathspecs togit status(-- .claude/skills .claude/hooks). Keepmodified: string[]of full repo-relative paths, so theSkillsCommitStateshape and thedoctor.test.tsmock stay valid and no caller changes.formatSkillsCommitWarning, groupmodifiedby directory prefix.doctor.test.ts:397asserts2 tracked files under .claude/skills/ have uncommitted changesandcommitted skills (2.15.1).1 tracked file under .claude/hooks/ has uncommitted changes. Use a hooks-specific tail:phases will use the committed hooks. Commit instruction:Commit .claude/hooks/ before running.Keep the.sequant-manifest.jsonhint skills-only.Phase 2: Tests
doctor.test.tsnext to the fix(run): skills freshness is read from the working tree, but phases use committed skills — an uncommitted sync names the wrong version and silently runs old skills #1354 case (AC-2).CHANGELOG.mdentry.HOOKS_DIR_PATHfrom the pathspec and confirm the hook-modified case fails. Record it in the PR body asMutation-verified: AC-1 — <mutation>; src/lib/skills-commit-state.integration.test.ts > ... failed; restored.Keep braces out of the marker text (published 2.19.0 parser cuts at the first}). Commit before mutating.Design Review
skills-commit-state.ts. All three consumers format through it.git log -S SKILLS_DIR_PATHshows only fix(#1354): warn when tracked skills have uncommitted changes — phases use the committed ones #1385 for the real code, so this is the first extension, not a recurrence. feat(doctor): report each phase skill's source; narrow the committed-skills guards (ADR-0012 follow-up 3) #1399 will narrow the same function; whichever lands second rebases..claude/settings*.jsonor.sequant/?" Out of scope; the issue names hooks only.skills-commit-state.ts. Consumers:run-orchestrator.ts:1239,doctor.ts:788,sync.ts:901, plus the tests.sync.tsis untouched (fix(sync): a --only skills install warns 'N file(s) differ' forever, and the suggested sync --force overwrites the repo's constitution #1409/fix(#1409): update records a full install in the manifest #1477 scope).Feature Quality Planning
Notable gaps. The call sites are gated by skills conditions, so the hooks warning can be silently skipped.
run-orchestrator.ts:1238only checks whenskillsPreflightActive && useWorktreeIsolation. IfskillsPreflightActiveis false while hooks are modified, no warning prints. Check what sets it during exec. If it can be false in a real project, the issue's "no caller logic changes" claim is wrong.doctor.ts:788sits in theelseof the untracked-skills branch, and the check is named "Skills Committed" with pass text "Core skills are committed". With untracked skills present, or the skills directory absent, a modified hook is never reported. When hooks are the only modification, the label still reads as a skills check.sync.tsgoes through the same function, so the hooks line appears there without edits.Derived ACs
doctorwarns and the run pre-flight prints the warning. Evidence: doctor test withmodifiedholding only a hooks path (no skills entry), plus the same case in therun-orchestratorgate.Open Questions
skillsPreflightActivecan be false, allow the hooks warning through that gate with a minimal caller change. Impact if wrong: the field-evidence case (ad-motion) stays unwarned. This contradicts "no caller logic changes", but not AC-2's "no new call site".Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Small mechanical fix in one module. Tests are declared in the AC Evidence, so testgen adds nothing. Constraints from the runner context: do not run the full
npm test(usenpx vitest run <file>), and leaveplugin/,.claude/skills/,templates/skills/,src/commands/update.tsandsync.install-scope.integration.test.tsuntouched.Label Review
Current: bug, graph-2026-10-freeze-b
Recommended: bug, graph-2026-10-freeze-b, planned
Quality Loop: Won't auto-enable.
admarble commentedon Oct 16, 2026
QA Verdict: AC_MET_BUT_NOT_A_PLUS
AC coverage: 4/4 met
Gaps:
doctor.ts:776-785only callsgetSkillsCommitStatein theelsebranch of the untracked-core-skills check. If any core skill is untracked, a modified tracked hook is never reported. The spec raised this in Open Question 1, and the diff does not change it. It is non-blocking because it only happens in a half-set-up checkout, and fix(doctor/run):doctorandrun --dry-runreport success when nothing would work #1257's warning fires there.skills-commit-state.ts:1-17still says the module covers only "tracked files under.claude/skills/". This is cosmetic.Suggestions:
skills || state.modified.lengthfallback keeps paths outside both directories (as used by older mocks) counted as skills. It works, but it is implicit; a one-line comment would make it clear.docs(#1456): skills-commit-state header names the hooks coverage
admarble commentedon Oct 16, 2026
Follow-up ledger (runner, wave 2): spec OQ-1 / QA risk gap "doctor never reports modified tracked hooks when any core skill is untracked" is dropped for this issue.
Reason:
doctor.ts:776-800runs the commit-state check only in theelsebranch of #1257's untracked-core-skills check. When a core skill is untracked,doctoralready warns that phase worktrees won't see the skills and that.claude/skills/has to be committed before anysequant run. That's a setup gap that stops the run anyway. Once it's fixed, the nextdoctorreports the hooks. The run pre-flight (run-orchestrator.ts:1238) has no such branch and warns whenever a Claude driver resolves skills, which covers the field case (ad-motion). Changing doctor's gate would be a caller-logic change this issue's scope ruled out. If the owner wants both warnings at once, that's a new issue.fix(#1456): uncommitted hook changes go unwarned — phases run the com…