You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681
Epic: graph-2026-11-simplify (follow-up of #1652) Tier: mechanical Execution: sequant_run
Problem
#1652 (D-8) adds the "do not run" block for needs-human Evidence to the qa dispatch in batch-executor.ts's phase loop. The ready gate's QA passes are dispatched elsewhere and do not get it:
sequant run --ready-gate: runReadyGateForIssue in src/lib/workflow/batch-executor.ts hands config to runReadyGate, whose qa pass is buildPhaseConfig(opts, { fullQa: true }) in src/lib/workflow/ready-gate.ts.
sequant ready <n>: src/commands/ready.ts:351 calls runReadyGate with no block either.
#1652's Done-when says every qa dispatch. Its QA (verdict at 8ad978a) named this gap; the dispatch sites were outside #1652's "may touch".
buildPhaseConfig spreads opts.config and the qa pass sets no promptContext, so a block in the config the gate receives reaches its qa pass. The loop pass sets its own promptContext, which replaces it.
Acceptance Criteria
AC-1: On both paths, the gate's qa pass for an issue with one needs-human AC carries the block that names that AC and its command, and an issue with none gets no block. Evidence: npx vitest run src/lib/workflow/ready-gate.evidence-reach.test.ts → ≥ 3 passed, 0 failed
runReadyGateForIssue in batch-executor.ts (--ready-gate);
the runReadyGate call at src/commands/ready.ts:351 (sequant ready).
Both gate paths reach the qa pass through buildPhaseConfig(opts, { fullQa: true }) in ready-gate.ts, which spreads opts.config. The loop pass sets its own promptContext.
If one shared site would serve all three better (for example ready-gate.ts, which is outside "May touch"), say so in the spec comment and stop there. Don't edit outside "May touch".
Run vitest only in the worktree, never in the main checkout.vitest.global-setup.ts runs npm run build, and spec runs in the main checkout, so a vitest run there rebuilds the live dist/ that this run is using.
AC-1's test file doesn't exist on main ("No test files found"). AC-2's two files pass there (6 tests).
AC-1 and AC-2 are single-line with Evidence: clauses. AC-1's file doesn't exist on main, so it fails today (non-vacuous). AC-2's files pass today by design; it is a labelled (constraint).
AC-1 "≥ 3 passed" is a floor on test count. The plan below names 4 cases so each path and the empty case are pinned separately.
AC-1: Both gate paths' qa pass carries the block; an issue with no needs-human AC gets none
Verification: Unit Test (ready-gate.evidence-reach.test.ts, new) Scenario: Given an AC record with one needs-human Evidence → When runReadyGateForIssue (stubbed runGate) and the sequant ready call site build the gate config → Then config.promptContext names the AC and its command; with no needs-human AC → promptContext is unchanged. Assumptions: The qa pass spreads opts.config (buildPhaseConfig, ready-gate.ts:380), so a block in the config handed to runReadyGate reaches every qa pass.
AC-2: Standard qa dispatch unchanged
Verification: Existing tests (constraint) Scenario: Run both existing evidence-reach files → 0 failed.
Implementation Plan
Phase 1: Wire the block (stays inside "May touch")
batch-executor.ts, runReadyGateForIssue only: classify the AC record (acRecordFor + needsHumanAcs, same try/noteSuppressed shape as classifyIssueEvidence) and pass withEvidenceReachContext(config, "qa", needsHuman) as the gate's config. This needs a state manager: add an optional stateManager to ReadyGateForIssueArgs and pass services.stateManager from the call site (~line 2855).
src/commands/ready.ts: before the runReadyGate call (~351), read the record with getStateManager() + acRecordFor, and pass withEvidenceReachContext(config, "qa", needsHuman). withEvidenceReachContext is already exported.
Order matters: the state init at ~387 runs after the gate. If the AC record isn't there yet, sequant ready on an untracked issue gets no block. The record comes from /spec, so for the normal flow it exists. Test the no-record case: no block, no throw.
Phase 2: Test
New ready-gate.evidence-reach.test.ts, 4 cases: (a) --ready-gate helper with one needs-human AC → runGate receives the block naming AC and command; (b) same with none → config unchanged; (c) sequant ready path with one → block; (d) the gate's real buildPhaseConfig qa pass keeps the block while the loop pass (own promptContext) does not. Case (d) is the point: the loop pass replaces it, which is correct.
CHANGELOG entry.
Design Review
Where does this logic belong? One shared site would be better: runReadyGate in ready-gate.ts (or buildPhaseConfig's qa branch) could classify once for both entry points. That file is outside "May touch", so per the runner note I stop at saying so; the plan uses the two permitted call sites. Cost: two call sites duplicate the classify-then-wrap step (a third caller would be a third copy).
Simplest correct approach: wrap the config at each gate entry with the existing withEvidenceReachContext. Rejected: editing ready-gate.ts (out of scope).
Reviewer challenge: "Why not once in ready-gate.ts?" Answered in 1. Also: does the loop's promptContext replace the block? Yes, and the loop is not a qa pass.
Producers/consumers: producers of the block: withEvidenceReachContext (batch loop, plus the two new sites). Consumer: getPhasePrompt appends promptContext. Both gate paths funnel into buildPhaseConfig. Since all three call the same exported helper, no field-parity test is needed.
Feature Quality Planning
All standard checks pass. Notable items:
sequant ready for an issue without a state record gets no block (silent). Covered by test (c)-variant; consider a follow-up if that's common.
Run vitest only in the worktree (global setup rebuilds dist/).
Open Questions
Put the classification in ready-gate.ts instead? — Recommendation: no here (out of "May touch"); file a follow-up. Impact if wrong: one fewer duplicated call site.
Recommended Workflow
Phases: exec → qa Quality Loop: disabled Reasoning: Mechanical, two call sites plus one new test file. AC-1 is a declared unit-test evidence, but the test file is itself the deliverable, so testgen adds nothing.
Minor polish: helper lives in the heavy batch-executor module, and the test keeps an unused import alive with a dummy type export — dropped: optional polish, non-blocking
Suggestions:
ready.ts now imports the whole batch-executor.ts just for withEvidenceReachContext. That helper would sit more naturally in evidence-reach.ts or a small shared module. There is no import cycle today.
The test file ends with export type _Unused = PhaseResult; to keep an unused import quiet. Dropping the PhaseResult import is simpler.
acRecordFor registers an AC record from the issue body when an issue is tracked but has none. So sequant ready can now write state.json before the gate starts. The phase loop already does this, so it is consistent, but it is a new side effect on the ready path.
The sequant ready empty case is tested as "untracked issue", not "tracked issue with no needs-human AC". The --ready-gate side covers the tracked-with-none case, and both paths use the same helper.
Needs human review:
Required CI check had not finished when QA ran
Reviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-sonnet-5-5).
Activity
admarble commentedon Nov 16, 2026
Runner context, 2026-11-15: the repo since this issue was written
mainis at677e1bbde: feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652 (merged as4d02df11f), docs(ready): the ready gate's docs drop the second-look claim — describe the qa → loop → qa mechanism and its policy, cite #1344 for what was measured #1650 and fix(marketplace): the generated README links the ready gate's old anchor after #1650 #1680 are in.src/lib/evidence-reach.tsexportsneedsHumanAcsandbuildEvidenceReachContext.batch-executor.tshaswithEvidenceReachContext(base, phase, needsHuman)andclassifyIssueEvidence(which reads the AC record throughacRecordFor).Three places dispatch a qa pass:
dispatchLoopPhaseinbatch-executor.ts, already covered by feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652;runReadyGateForIssueinbatch-executor.ts(--ready-gate);runReadyGatecall atsrc/commands/ready.ts:351(sequant ready).Both gate paths reach the qa pass through
buildPhaseConfig(opts, { fullQa: true })inready-gate.ts, which spreadsopts.config. The loop pass sets its ownpromptContext.If one shared site would serve all three better (for example
ready-gate.ts, which is outside "May touch"), say so in the spec comment and stop there. Don't edit outside "May touch".Run vitest only in the worktree, never in the main checkout.
vitest.global-setup.tsrunsnpm run build, and spec runs in the main checkout, so a vitest run there rebuilds the livedist/that this run is using.AC-1's test file doesn't exist on
main("No test files found"). AC-2's two files pass there (6 tests).admarble commentedon Nov 16, 2026
Complexity: Standard (2 ACs, 3 directories)
AC Quality Check
Evidence:clauses. AC-1's file doesn't exist onmain, so it fails today (non-vacuous). AC-2's files pass today by design; it is a labelled(constraint).Scope Assessment
Non-Goals: present (classifier rules, gate policy/loop/verdict handling).
Verdict: ✅ SCOPE_OK
Acceptance Criteria
AC-1: Both gate paths' qa pass carries the block; an issue with no needs-human AC gets none
Verification: Unit Test (
ready-gate.evidence-reach.test.ts, new)Scenario: Given an AC record with one needs-human Evidence → When
runReadyGateForIssue(stubbedrunGate) and thesequant readycall site build the gate config → Thenconfig.promptContextnames the AC and its command; with no needs-human AC →promptContextis unchanged.Assumptions: The qa pass spreads
opts.config(buildPhaseConfig,ready-gate.ts:380), so a block in the config handed torunReadyGatereaches every qa pass.AC-2: Standard qa dispatch unchanged
Verification: Existing tests (constraint)
Scenario: Run both existing evidence-reach files → 0 failed.
Implementation Plan
Phase 1: Wire the block (stays inside "May touch")
batch-executor.ts,runReadyGateForIssueonly: classify the AC record (acRecordFor+needsHumanAcs, same try/noteSuppressedshape asclassifyIssueEvidence) and passwithEvidenceReachContext(config, "qa", needsHuman)as the gate'sconfig. This needs a state manager: add an optionalstateManagertoReadyGateForIssueArgsand passservices.stateManagerfrom the call site (~line 2855).src/commands/ready.ts: before therunReadyGatecall (~351), read the record withgetStateManager()+acRecordFor, and passwithEvidenceReachContext(config, "qa", needsHuman).withEvidenceReachContextis already exported.sequant readyon an untracked issue gets no block. The record comes from/spec, so for the normal flow it exists. Test the no-record case: no block, no throw.Phase 2: Test
ready-gate.evidence-reach.test.ts, 4 cases: (a)--ready-gatehelper with one needs-human AC →runGatereceives the block naming AC and command; (b) same with none → config unchanged; (c)sequant readypath with one → block; (d) the gate's realbuildPhaseConfigqa pass keeps the block while the loop pass (ownpromptContext) does not. Case (d) is the point: the loop pass replaces it, which is correct.Design Review
runReadyGateinready-gate.ts(orbuildPhaseConfig's qa branch) could classify once for both entry points. That file is outside "May touch", so per the runner note I stop at saying so; the plan uses the two permitted call sites. Cost: two call sites duplicate the classify-then-wrap step (a third caller would be a third copy).withEvidenceReachContext. Rejected: editingready-gate.ts(out of scope).withEvidenceReachContext. feat(qa): Evidence that names an env file, a production CLI or a live URL is handed to a person — classified in code, listed in the qa prompt as "do not run", recorded per AC in the run log, printed with its command in the run summary #1652 covered one of three qa dispatch sites and this issue covers the other two; this is the first re-patch of that class, below the ≥2 threshold. Recordingclass tracked: ready-gate.ts shared siteas a follow-up suggestion.ready-gate.ts?" Answered in 1. Also: does the loop'spromptContextreplace the block? Yes, and the loop is not a qa pass.withEvidenceReachContext(batch loop, plus the two new sites). Consumer:getPhasePromptappendspromptContext. Both gate paths funnel intobuildPhaseConfig. Since all three call the same exported helper, no field-parity test is needed.Feature Quality Planning
All standard checks pass. Notable items:
sequant readyfor an issue without a state record gets no block (silent). Covered by test (c)-variant; consider a follow-up if that's common.dist/).Open Questions
ready-gate.tsinstead? — Recommendation: no here (out of "May touch"); file a follow-up. Impact if wrong: one fewer duplicated call site.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Mechanical, two call sites plus one new test file. AC-1 is a declared unit-test evidence, but the test file is itself the deliverable, so testgen adds nothing.
Label Review
Current: none. Recommended:
planned. Quality Loop: won't auto-enable.admarble commentedon Nov 16, 2026
QA Verdict: NEEDS_VERIFICATION
AC coverage: 2/2 met
Gaps:
Suggestions:
ready.tsnow imports the wholebatch-executor.tsjust forwithEvidenceReachContext. That helper would sit more naturally inevidence-reach.tsor a small shared module. There is no import cycle today.export type _Unused = PhaseResult;to keep an unused import quiet. Dropping thePhaseResultimport is simpler.acRecordForregisters an AC record from the issue body when an issue is tracked but has none. Sosequant readycan now writestate.jsonbefore the gate starts. The phase loop already does this, so it is consistent, but it is a new side effect on thereadypath.sequant readyempty case is tested as "untracked issue", not "tracked issue with no needs-human AC". The--ready-gateside covers the tracked-with-none case, and both paths use the same helper.Needs human review:
Reviewed in a separate session by claude-code (claude-opus-5-5); the change was written by claude-code (claude-sonnet-5-5).
test(#1681): drop the unused PhaseResult import and its placeholder e…
refactor(#1688): option A — the needs-human block joins only in execu…