Repository navigation
feat(#1349): improve(skills): phases run affected tests (vitest --changed) instead of the full suite; CI keeps the full run - #1358
Merged
admarble merged 6 commits intoOct 8, 2026
Conversation
…the full suite Entire-Checkpoint: 466129e947a7
…npm test; add the whole-tree tautology scanner QA round 1 found exec still telling the agent to run npm test in several steps, contradicting the new section. Each now points at the affected-tests run, guarded by a gate test over exec and qa. The dangling 'see the next block for others' now points at the section. A fourth rule names scripts/qa/tautology-detector-cli.test.ts, which reads every test file, so no path rule selects it. Entire-Checkpoint: 9b1024182cfb
…the 600 s Bash cap Entire-Checkpoint: 3bbc3d9c2aff
…jects; select skill-tree tests when a skill changes CI's full suite failed skill-allowed-tools-gate.test.ts (#1287): Bash(npx vitest:*) and Bash(npx jest:*) are runner wildcards outside RUNNER_ALLOWLIST. The grants are dropped; phases run under bypassPermissions and interactive runs ask. The gate test iterates SKILL_ROOTS and names no path, so no affected-test rule selected it; rule 4 now adds every test that references SKILL_ROOTS when a skill file changes. Entire-Checkpoint: d163c54ab0c2
…unt/shard step QA round 2: qa's region lacked exec's rule 4 (tautology scanner, SKILL_ROOTS lookup) and the large-set sharding, so qa could miss the allowed-tools gate. The region now carries both; the exec-only gate tests run over both skills. Entire-Checkpoint: fee5f8d045c8
…skills-phases-run-affected-tests-vitest-ch
admarble
deleted the
feature/1349-improve-skills-phases-run-affected-tests-vitest-ch
branch
October 8, 2026 03:37
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
Exec and qa now run the tests a branch affects instead of the full
npm test. CI'stestjob stays the full-suite merge gate. (This body was rebuilt from exec's transcript: the 2.19.0 MCP server dropped exec's summary and left the placeholder, #1311.)npx vitest run --changed origin/main(jest:--changedSince). On top of that they run the test files named in each AC'sEvidence:command and every changed test file. Agrep -rlF "<changed path>"lookup adds the tests that read a changed non-test file. CI stays the full-suite merge gate. Each skill'sallowed-toolsgainednpx vitestandnpx jest.resolveAffectedTestCommandanddetectTestRunnerare insrc/lib/stacks.ts, notstack-config.ts. That file only persists.sequant/stack.jsonand holds no commands. A stack with no affected mode falls back to its full test command.docs/adr/0010-phases-run-affected-tests.md, with status Proposed, and a CHANGELOG entry. The mirrors were synced withnpm run sync:skills.Pre-PR AC verification
--changed origin/mainand--changedSinceappear in.claude/skills/exec/SKILL.mdandqa/SKILL.md, inside delimitedaffected-tests (#1349)regions. Round 1 left several "Runnpm test" steps elsewhere in exec; they now point at the affected-tests run, and a gate test keeps them out of both skills.affectedTestcases insrc/lib/stacks.test.tscover vitest and jest, the fallback, and runner detectionsrc/lib/ac-parser.ts:npx vitest list --changed --filesOnly→ 23 files includingsrc/lib/ac-parser.test.ts(2.7 s);npx vitest run --changed→ 23 files, 522 tests passed, 11 s wall (re-measured by the runner, idle machine; exec's 56 s was under load). A hub module (mutation-marker.ts) selects 60 of 373 files and ran past 300 s, so the skill now counts the set first and shards a large one (--shard=1/3..3/3, each undertimeout 590).scripts/affected-tests-skill.test.tsruns the documentedgrep -rlFcommand from each skill's region against.claude/skills/exec/SKILL.md. It findsscripts/exec-skill-marker.test.ts.lint:skill-sync(48 synced) andlint:skill-gatespassChecks
npm run buildandnpm run lintpass. Targeted tests pass: 181 acrossstacks,affected-tests-skill,exec-skill-markerandcheck-skill-sync.lint:skill-callsreports no violations.Mutation records
Each mutation failed exactly that test, and I restored the file afterwards. I did not run the
parseMutationMarkerscheck from/qa§6i on these markers.QA round 1 fixes (runner,
2b4c38d5,e0689326)npm test" step in exec (worktree setup, quick checks, the per-change loop, conversions, re-run after fixes, the results checklist) and the coverage step in qa now refer to the affected-tests run. New gate test:no other step tells the agent to run the bare npm test(exec and qa).scripts/qa/tautology-detector-cli.test.tsreads every test file, so no import or path rule selects it, but a new tautological test fails it (docs(exec/qa): the SEQUANT_MUTATION failedTest contract (<test file> > <name>) is enforced by the classifier but never told to authors — tripped 2 of 4 gate PRs #1104, feat(exec/qa): explicit in-place checkout mode — run a phase on a branch in the current clone without creating or resolving a worktree #1136). It's now named for any branch that changes a test file.vitest list --changed origin/main --filesOnly, shard above ~40 files.Mutation-verified: AC-1 — restored one "3. Run
npm test" step in exec;scripts/affected-tests-skill.test.ts > exec and qa run affected tests, not the full suite > exec: no other step tells the agent to run the bare npm testfailed; restored.Mutation-verified: AC-4 — deleted rule 4 (the whole-tree scanner) from the exec region;
scripts/affected-tests-skill.test.ts > exec and qa run affected tests, not the full suite > exec: names the whole-tree tautology scanner, which no path rule selectsfailed; restored.Mutation-verified: AC-3 — changed
--shard=1/3in the exec region;scripts/affected-tests-skill.test.ts > exec and qa run affected tests, not the full suite > exec: counts a large affected set and shards it under the Bash capfailed; restored.CI round fix (
790caae2)CI's full suite failed
src/lib/__tests__/skill-allowed-tools-gate.test.ts(#1287): round 1 addedBash(npx vitest:*)andBash(npx jest:*)to exec and qa, and those are runner wildcards outsideRUNNER_ALLOWLIST. The grants are dropped. Phases run underbypassPermissions, and interactive/execasks before a vitest call. Widening the allowlist tonpx vitest run *is the owner's call (#1292 narrowed it on purpose).That gate iterates
SKILL_ROOTSand names no path, so no affected-test rule selected it, which is the gap this PR is meant to close. Rule 4 now adds every test that referencesSKILL_ROOTSwhen a skill file changes. On this branch the rules select 42 files: 780 tests in 17 s, all passing.Mutation-verified: AC-4 — renamed
SKILL_ROOTSin the exec region's skill-tree lookup;scripts/affected-tests-skill.test.ts > exec and qa run affected tests, not the full suite > exec: the documented skill-tree lookup selects the allowed-tools gatefailed; restored.QA round 2 fix (
9e28bebd)QA round 2 returned
AC_MET_BUT_NOT_A_PLUS. Its one fixable gap: qa's region lacked exec's rule 4 and the count/shard step. It now carries both, and the exec-only gate tests run over both skills.Mutation-verified: AC-4 — renamed
SKILL_ROOTSin the qa region's skill-tree lookup;scripts/affected-tests-skill.test.ts > exec and qa run affected tests, not the full suite > qa: the documented skill-tree lookup selects the allowed-tools gatefailed; restored.Follow-up (not in this PR):
loopandfullsolvestill saynpm test(ADR-0010 Consequences). The resolver instacks.tshas no production caller yet: the skills spell the commands out, and a test keeps them in sync with it.Pre-PR confidence check
--changedhas a wide blast radius. A change to a module many files import, likestacks.tsormutation-marker.ts, selects most of the suite, so the 120 s bar fails there.qaskill's reverse-lookup test is a copy of the exec one.loop,fullsolveandteststill saynpm test; that's a follow-up, as the spec noted.Fixes #1349
🤖 Generated by
sequant run; runner fixes after QA round 1