Skip to content

feat(qa): the ready gate's qa passes get #1652's do-not-run block (--ready-gate and sequant ready) #1681

Closed

Description

@admarble

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

May touch

src/lib/workflow/batch-executor.ts (runReadyGateForIssue only), src/commands/ready.ts (the runReadyGate call's config only), src/lib/workflow/ready-gate.evidence-reach.test.ts (new), CHANGELOG.

Non-Goals

  • The classifier's rules (src/lib/evidence-reach.ts).
  • The gate's policy, loop or verdict handling.

Done when

The qa passes of sequant ready and sequant run --ready-gate get the same do-not-run block as a standard qa dispatch.

Activity

  1. admarble commented on Nov 16, 2026

    @admarble
    ContributorAuthor

    Runner context, 2026-11-15: the repo since this issue was written

  2. admarble commented on Nov 16, 2026

    @admarble
    ContributorAuthor

    Complexity: Standard (2 ACs, 3 directories)

    AC Quality Check

    • 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.

    Scope Assessment

    Non-Goals: present (classifier rules, gate policy/loop/verdict handling).

    Metric Value Status
    Feature count 1 ✅
    AC items 2 ✅
    Directory spread 3 ✅

    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 (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")

    1. 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).
    2. 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

    1. 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.
    2. CHANGELOG entry.

    Design Review

    1. 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).
    2. Simplest correct approach: wrap the config at each gate entry with the existing withEvidenceReachContext. Rejected: editing ready-gate.ts (out of scope).
    3. Pattern / re-patch count: follows 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's 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. Recording class tracked: ready-gate.ts shared site as a follow-up suggestion.
    4. 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.
    5. 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

    1. 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.

    Label Review

    Current: none. Recommended: planned. Quality Loop: won't auto-enable.

  3. added
    planned
    on Nov 16, 2026
  4. admarble commented on Nov 16, 2026

    @admarble
    ContributorAuthor

    QA Verdict: NEEDS_VERIFICATION

    AC coverage: 2/2 met

    Gaps:

    • 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).

  5. added a commit that references this issue on Nov 16, 2026
  6. added a commit that references this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    planned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions