Skip to content

fix(ready): per-AC status is not recorded on the ready gate's QA phases — sequant ready and --ready-gate skip the #1525 producer, so the AC record goes stale after the gate #1621

Open

Description

@admarble

Follow-up of #1525 (PR #1619); QA 1's human-flagged gap. Blocked by #1525.

Problem

#1525's Done-when reads: "After a QA phase, state.json's AC items and the run log's acs[] say what QA said, per criterion." Its producer, recordAcStatuses (src/lib/workflow/ac-status.ts), has one call site: recordLoopPhaseOutcome in src/lib/workflow/batch-executor.ts, the sequant run quality loop. The ready gate's qa → loop → qa pipeline dispatches its QA phases through runPhaseTracked (src/lib/workflow/ready-gate.ts:841) via the ReadyPhaseRunner wrappers in src/commands/ready.ts:373 (sequant ready) and src/lib/workflow/batch-executor.ts:1086 (sequant run --ready-gate). None of the three calls the producer.

So sequant run is covered and sequant ready / --ready-gate are not: after a gate run, the AC record and acs[] still say what the last loop QA said, which is older than the gate's own verdict, and every renderer that reads the record (#1526) shows the stale row. ready-gate.ts holds no StateManager; ready.ts gets one from getStateManager().

Candidate fix sites, not decided here:

  1. The two ReadyPhaseRunner wrappers (ready.ts:373, batch-executor.ts:1086): two call lines, the gate module untouched.
  2. runPhaseTracked in ready-gate.ts, given a StateManager through RunReadyGateOptions.
  3. executePhaseWithRetry in src/lib/workflow/phase-executor.ts, so every caller gets it and the loop hook at batch-executor.ts retires: one producer, one call site. Touches refactor(logs): one run-log module — parseLogFile, listLogFiles, resolveLogDir, formatDuration defined once #1471's file.

Acceptance Criteria

  • AC-1: A QA phase run by the ready gate writes the AC record. Evidence: npx vitest run src/lib/workflow/ac-status.integration.test.ts -t "ready gate" → ≥ 1 passed, 0 failed (real StateManager on a temp dir, no fs mock; a stub ReadyPhaseRunner returns a QA PhaseResult whose output carries AC rows; after the gate path runs, getAcceptanceCriteria(issue).items carry those statuses)
  • AC-1 is classified as a gate test by isGateTestEvidence; the PR body carries its SEQUANT_MUTATION record (remove the producer call from the gate path → the new case fails; restore).
  • AC-2: The producer keeps one definition and the loop path still records. Evidence: grep -rn 'export async function recordAcStatuses' src --include='*.ts' | wc -l | tr -d ' ' → 1 and npx vitest run src/lib/workflow/ac-status.integration.test.ts → ≥ 7 passed, 0 failed (the six feat(run): one producer for per-AC status — parse the QA phase output, write the state record through updateACStatus, carry acs[] in the run log; unknown is a status #1525 cases plus the new one)
  • AC-3: No skill directory is touched. Evidence: git diff --name-only $(git merge-base origin/main HEAD)..HEAD | grep -cE '^(plugin/|\.claude/skills/|templates/skills/)' → 0 (constraint)

May touch

src/commands/ready.ts, src/lib/workflow/ready-gate.ts, src/lib/workflow/batch-executor.ts (the --ready-gate wrapper and, under fix 3, retiring the loop hook), src/lib/workflow/phase-executor.ts (fix 3 only), src/lib/workflow/ac-status.integration.test.ts, CHANGELOG.

Non-Goals

Activity

  1. added
    enhancement
    graph-2026-10-review-surface
    on Oct 28, 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

    enhancementgraph-2026-10-review-surface

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions