Repository navigation
Description
Summary
sequant ready <issue> runs a full-weight qa → loop → qa pipeline that can take several minutes, but unlike sequant run it shows no live progress — after the static header it sits silent until the final report prints. Users can't tell it's working or what phase it's in. This was observed on the first real sequant ready run (#694).
Root cause
sequant ready and sequant run were built on different output paths. ready ships as a thin synchronous command with no renderer wiring:
src/commands/ready.ts:
- Prints a static
ui.headerBox("SEQUANT READY")+ muted config lines (:132-150) - Calls
runReadyGate(...)synchronously, passing only arunPhasecallback — no progress/phase-plan callbacks, no renderer, no heartbeat (:153-169) - Prints the final markdown
result.reportat the end (:218)
By contrast src/commands/run.ts builds the live UI via buildProgressWiring (RunRenderer, #618) + renderTui, plus LivenessHeartbeat (#574), and wires onProgress / onPhasePlan into the renderer (run.ts:105-140).
sequant run |
sequant ready |
|
|---|---|---|
| Live phase matrix (pending → running → ✔/✘) | ✅ | ❌ |
| Liveness heartbeat / spinner | ✅ | ❌ |
| Progress callbacks wired to a renderer | ✅ | ❌ |
| During-run feedback | live grid | silence |
The phase executor (executePhaseWithRetry) is shared between both commands, so the progress signal exists — ready just doesn't capture it into a renderer.
Acceptance Criteria
-
sequant ready <issue>shows live, in-place progress while theqa → loop → qagate runs (current phase + iteration visible), instead of going silent between header and final report. - The live UI reuses the existing renderer infrastructure (
buildProgressWiring/ RunRenderer feat(cli): unified run renderer — two-zone live grid + events #618 + the phase-matrix) rather than a bespoke second renderer — visual parity withsequant run. - A liveness/heartbeat indicator (feat(run): -q mode silent for entire phase duration — no liveness or stall signal #574) is present so a long-running, output-quiet phase is distinguishable from a hang.
-
--jsonoutput is unchanged (no live rendering when piping /--json); rendering is gated on TTY the same wayrunis. -
--verbosecontinues to work and does not double-render. - The final structured report (
result.report) still prints after the live zone is disposed (no clobbering, clean scrollback — same dispose pattern asrun.ts:185-186).
Non-Goals
- Changing the
readygate logic, policy, or report content — this is purely the progress-rendering layer. - Animating the single-phase case differently from the multi-iteration case beyond what the existing renderer already does.
Notes
- Introduced with
sequant ready(feat(cli):sequant ready <issue>— post-resolve A+ QA gate that drives an issue to merge-readiness #683, landed in3ca827a). - Single-issue live frame styling was recently fixed in fix(cli-ui): single-issue live frame renders boxless indented labels #690 (
324f4ec) — that renderer is the one to reuse.
Activity
admarble commentedon Jun 2, 2026
📋 Spec — Issue #697
Complexity: Standard (6 ACs, 2 directories)
AC Quality Check
All 6 ACs are concrete and verifiable. Minor notes:
buildProgressWiring/RunRendereris reused (no bespoke second renderer). ✅ (review-verified)--jsonunchanged,--verboseno double-render, report prints after dispose. ✅No vague/unmeasurable/open-ended patterns. No title/body tension.
Scope Assessment
Non-Goals (from issue):
readygate logic, policy, or report content — purely the progress-rendering layer.src/commands/,src/lib/workflow/)Verdict:⚠️ SCOPE_WARNING — triggered solely by the AC-count proxy (6 ≥ yellow). The change is a single cohesive feature; several "ACs" are really constraints on one edit (TTY gating, verbose, dispose). Effectively SCOPE_OK — no split recommended.
Acceptance Criteria
AC-1: Live, in-place progress during the
qa → loop → qagateVerification: Unit Test (event emission) + Manual Test (TTY)
Scenario: Given
sequant ready <issue>on a TTY → When the gate runs qa/loop iterations → Then the renderer receivesstart/completeevents per phase with the loopiterationset, and the live zone shows the current phase + iteration instead of silence.Assumptions:
runReadyGateis the orchestrator here (notRunOrchestrator), so it must emit the progress events itself around eachrunPhasecall.AC-2: Reuse existing renderer (
buildProgressWiring/ RunRenderer #618 + phase-matrix)Verification: Unit Test + Review
Scenario: Given the ready command → When it builds its live UI → Then it calls the shared
buildProgressWiring(...)(fromsrc/commands/run-progress.ts) and the single-issueRunRenderer, not a new bespoke renderer. Visual parity withsequant run.Assumptions:
buildProgressWiringis reusable as-is for a single issue; single-issue frame styling was fixed in #690.AC-3: Liveness/heartbeat indicator present (#574)
Verification: Unit Test
Scenario: Given a long, output-quiet phase → When no completion event fires for a while → Then a heartbeat/spinner or stall indicator distinguishes work-in-progress from a hang (same mechanism
runuses —RunRenderer's live-zone tick /stallThresholdMs, orLivenessHeartbeat).Assumptions: The
RunRendererlive-zone tick +stallThresholdMsalready supplies liveness; an explicitLivenessHeartbeatis only needed for the quiet path (ready has no--quiet).AC-4:
--jsonoutput unchanged; rendering gated on TTY likerunVerification: Integration Test
Scenario: Given
sequant ready <issue> --json(or piped/non-TTY) → When the gate runs → Then no live rendering occurs and stdout is exactly the existing JSON object. The renderer is only built when!options.json; the renderer itself degrades to non-TTY line mode when piping (parity withrun).Assumptions: Building the wiring is skipped entirely under
--jsonso no stray writes corrupt the JSON.AC-5:
--verboseworks and does not double-renderVerification: Integration Test + Review
Scenario: Given
sequant ready <issue> --verbose→ When a phase streams agent output → Then the renderer is paused during streaming and resumed after (no duplicated frames). Achieved by passing theRunRendereras thePhasePauseHandle(7th arg) intoexecutePhaseWithRetry.Assumptions:
RunRenderersatisfiesPhasePauseHandle(it implementspause/resume/appendNotice).AC-6: Final
result.reportprints after the live zone is disposedVerification: Integration Test
Scenario: Given any completed ready run → When the gate returns → Then the live zone is disposed first and the markdown report prints to clean scrollback (no clobbering), mirroring
run.ts:185-186(displaySummary(...); renderer?.dispose();).Assumptions: Dispose ordering must happen before the
console.log(result.report)write.Implementation Plan
Phase 1: Thread progress callbacks through the gate engine
src/lib/workflow/ready-gate.ts— AddonProgress?: ProgressCallbackand (optionally)onPhasePlan?: PhasePlanCallbacktoRunReadyGateOptions(import from./types.js).runReadyGate, wrap eachopts.runPhase("qa"|"loop", …)call: emitonProgress(issueNumber, phase, "start", { iteration })before,"complete"(withdurationSeconds) on success and"failed"(witherror) on theLOOP_FAILED/ catch paths. Use the existingiterationscounter as theiterationvalue so the matrix rendersloop N/M.ready-gate.test.tsinjection-based unit tests (which never pass callbacks) stay green.Phase 2: Wire the renderer in the command shell
src/commands/ready.ts— When!options.json, callbuildProgressWiring({ tuiEnabled: false, quiet: false, issueNumbers: [issueNumber], phaseTimeoutSeconds: phaseTimeout, maxLoopIterations: maxIterations })(from./run-progress.js). Do not pre-seedbasePhases— the ready pipeline is dynamic (1–N qa/loop passes), so stream phases as they fire (matches auto-detect streaming). (Open Question 1.)onProgressintorunReadyGate(...).rendereras thePhasePauseHandle(7th positional arg) into therunPhasewrapper:executePhaseWithRetry(issueNumber, phase, config, undefined, wt, undefined, renderer ?? undefined)— this gives verbose streaming the pause/resume behavior (AC-5).renderer?.registerIssue({ issueNumber }).console.log(result.report)with: dispose the live zone first, then print —renderer?.dispose(); console.log(result.report);(AC-6). Add a SIGINT handler that callsrenderer?.dispose()before ShutdownManager's banner (mirrorrun.ts:159-162), and dispose any heartbeat in afinally.Phase 3: Tests
ready-gate.test.ts— add a case assertingonProgressfiresstart/completewith correctphase+iterationacross a 2-iterationqa → loop → qarun, andfailedonLOOP_FAILED.ready.test.ts— assert: (a) renderer NOT built under--json(clean JSON, no live writes); (b) renderer built +registerIssuecalled on the non-json path; (c)dispose()called before the report write; (d) verbose passes the renderer as pause handle.Design Review
runsplit: event emission belongs in the orchestrator (runReadyGate, since it owns the phase loop here), and renderer construction/disposal belongs in the command shell (ready.ts). No new module needed.buildProgressWiring+RunRendererverbatim withissueNumbers: [issueNumber]. Rejected: a bespoke ready-only renderer (violates AC-2) and refactoringRunOrchestratorto drive ready (out of scope, over-engineered — the gate engine already owns the loop).run.tswiring pattern exactly:buildProgressWiring→ wireonProgress→ pass renderer asphasePauseHandle→dispose()after summary (run.ts:107-191).executePhaseWithRetry?" — becauseexecutePhaseWithRetryhas noonProgressparam (it'sRunOrchestrator/batch-executor that emits in therunpath); the ready engine is the equivalent orchestrator and is the natural emit site. Also: "Does seeding no phase plan still show a matrix?" — yes; streaming mode renders cells as phases fire (auto-detect parity), avoiding a stuck-pendingloopcell when the gate stops after the first qa.Feature Quality Planning
All standard checks pass. Notable items:
RunReadyGateOptions— backward-compatible; existing injected-runner tests unaffected.feedback_qa_self_eval_cleanup): the live-zone timer and any heartbeat must be disposed on every exit path — success, the catch block (ready.ts:170-179), and SIGINT. Ensure the earlycatchpath disposes the renderer too, not just the happy path.bin/cli.ts.option()change required (avoids the usual CLI-wiring-gap pitfall).Derived ACs
Open Questions
plannedPhases). The ready pipeline length is dynamic (could stop after one qa, or run N qa/loop passes), so a fixed["qa","loop"]seed would leave aloopcell stuckpendingwhen the gate stops early. Streaming renders cells as phases fire (auto-detect parity). Impact if wrong: cosmetic only (a stale pending cell); easy to revisit.RunRendererlive tick, or addLivenessHeartbeat? — Recommendation: rely on the renderer's live-zone tick +stallThresholdMs(which is whatrun's non-quiet path uses).LivenessHeartbeatis the quiet-mode mechanism and ready has no--quiet. Impact if wrong: AC-3 under-served; mitigated by passingphaseTimeoutSecondssostallThresholdMsis derived.Recommended Workflow
Phases: exec → qa
Quality Loop: disabled (single cohesive change; SCOPE_WARNING is an AC-count artifact, not real complexity)
Reasoning: CLI/TypeScript change with existing test files to extend (
ready.test.ts,ready-gate.test.ts); no UI/browser surface (terminal rendering is unit/integration-tested, not browser-tested).testgenis optional — the two existing test files already provide the stubs to extend, so a dedicated testgen phase adds little. No security surface.Label Review
Current:
enhancementRecommended:
enhancement(+plannedadded by this phase)Reason: Single-feature enhancement; no
complex/breaking/uiwarranted. Nono-browser-testneeded since no.tsx/.jsxinvolved (terminal renderer).Quality Loop: Won't auto-enable — SCOPE_WARNING here is the 6-AC proxy, not genuine multi-feature scope.
admarble commentedon Jun 2, 2026
QA Review for Issue #697
PR: #698 (
feature/697-…) — closes #697 · HEAD:029b93b· CI: 4/4 greenAC Coverage
runReadyGateemitsstart/complete/failedwith 1-based QA-passiterationviarunPhaseTracked; wired torenderer.onEvent. Tested:ready-gate.test.tsasserts exact event sequence acrossqa→loop→qa.buildProgressWiring/RunRenderer #618, no bespoke rendererready.tscalls the sharedbuildProgressWiring({tuiEnabled:false,quiet:false,issueNumbers:[issueNumber],…});registerIssuehappens inside the shared wiring. Test asserts the call + args.stallThresholdMs = phaseTimeoutSeconds*1000/2, andphaseTimeoutis threaded in. Matchesrun's non-quiet path;LivenessHeartbeat(quiet-only) correctly staysnull. Per spec Open-Q2.--json/non-TTY unchanged, rendering gated likerun!options.json. TestAC-4invokesreadyCommand(…,{json:true})→buildProgressWiringnot called,onProgressundefined, pause-handle arg undefined, no report marker in stdout.--verboseworks, no double-renderspinner: PhasePauseHandle) toexecutePhaseWithRetry— same pause/resume mechanism asrun.ts. Test asserts arg[6] === renderer.renderer?.dispose(); console.log(result.report). Test assertsdisposeinvocation order precedes the reportconsole.log.renderer?.dispose(); heartbeat?.dispose(); process.off), SIGINT (renderer?.dispose()). Error-path test asserts dispose + exitCode 2.Coverage: 7/7 AC items fully met (6 original + 1 derived)
CI Status
build (22.x)typecheckvalidate-pluginvalidate-skillsCI Summary: 4 passed, 0 pending, 0 failed. No CI-gating AC items pending.
Quality Metrics
any)as unknown ascasts)tsc --noEmitvitest run ready.test.ts ready-gate.test.tsTest Coverage Analysis
src/commands/ready.tsready.test.ts(drivesreadyCommandfor AC-2/4/5/6 + error path)src/lib/workflow/ready-gate.tsready-gate.test.ts(AC-1 emission, LOOP_FAILED, throw, back-compat)Coverage: 2/2 changed source files have tests. No critical-tier (auth/payment/security) paths touched.
Code Review
Strengths:
runexactly: event emission in the gate engine (runReadyGate, the owner of the qa→loop→qa loop), renderer construction/disposal in the command shell. No new module.runPhaseTrackedcorrectly emitsfailedon bothphaseResult.success === falseand a thrown runner (re-throws after emitting), so a renderer reflecting the failed cell is whatready.ts's catch path then disposes.onProgresskeeps all existing injection-based gate tests green — verified by the "no-op when omitted" test.Issues: None blocking.
Suggestions (non-blocking):
buildProgressWiringis called withoutautoDetectPhases, soregisterIssuerecordsautoDetect: undefined. Behavior is correct (streaming renders cells as events fire, no stuck-pending cell), but passingautoDetectPhases: truewould make the streaming intent explicit and match therunauto-detect path 1:1. Purely cosmetic — defer.Test Quality Review
invocationCallOrder), and the json/non-json output — not internals.process.exitCodesaved/restored inafterEach.Anti-Pattern Detection
No N+1, empty catch (the two
catch {}are intentional best-effort with documented rationale), hardcoded secrets, or uncleared timers in the diff.package.jsonunchanged → no dependency audit.Call-Site Review
New exported surface:
RunReadyGateOptions.onProgress?(optional field, not a new exported function) and internalrunPhaseTracked. The two prioropts.runPhase("qa"|"loop", …)call sites were both migrated torunPhaseTracked— no un-migrated sibling call sites remain inrunReadyGate. Verified by reading the diff hunks.Execution Evidence
npx tsc --noEmitnpx vitest run src/commands/ready.test.ts src/lib/workflow/ready-gate.test.tsreadyCommandis invoked directly (with mocked collaborators) in the AC-4/5/6 + error-path tests, exercising the real command shell wiring end-to-end. No new flags added → nobin/cli.tschange required (confirmed). Evidence status: Complete.CLI Registration Verification
Option interface modified:
RunReadyGateOptionsgainedonProgress?— but this is an internal engine option (set programmatically from the command shell), not a user-facing CLI flag. NomergedOptions.X-style runtime consumption, nobin/cli.tsregistration needed. Status: N/A (internal-only field).Skill Command Verification / Detection Pattern Verification
N/A — no
.claude/skills/**/*.mdchanges in this diff.Risk Assessment
--verbosestreaming (the test asserts the renderer is passed as the pause handle, not that frames are de-duplicated at runtime). Acceptable: the pause mechanism isrun.ts's proven, shared code path — this PR only changes who is passed in, not the mechanism.readyvsrun;runalready has the wiring and this PR bringsreadyto parity. No other gate-style command shares the gap. PR feat(tui): upgradesequant readyto the boxed Ink TUI + harden TUI (#699) #700/feat(tui): upgradesequant readyto the boxed Ink TUI + harden TUI for large batches #699 (boxed Ink TUI forready) is an explicit follow-up, not an overlapping fix.runReadyGaterunPhasecall sites (qa and loop) were migrated torunPhaseTracked— no adjacent un-instrumented call site remains.Adversarial Re-Read
Findings: No gaps found because: (1) traced all four exit paths in
ready.ts(json / non-json / catch / SIGINT) and confirmed each disposes the renderer + heartbeat and removes the SIGINT listener — no leak, no double-dispose; (2) confirmedbuildProgressWiringreturns a non-null renderer fortuiEnabled:false, quiet:falseand a null heartbeat, so AC-3 liveness is genuinely served by the renderer'sstallThresholdMstick (not a silently-null heartbeat); (3) verified theexecutePhaseWithRetry7th positional arg isspinner: PhasePauseHandleand the renderer satisfies it (implementspause/resume/appendNotice); (4) ran the suite (38 pass) and tsc (clean) myself rather than trusting the PR body; (5) checked the issue's Non-Goals — no gate-logic/policy/report change crept in (the diff only adds emission + renderer plumbing); (6) theiterationvalue is theiterationscounter (1-based QA-pass index), matching the AC's "loop N/M" requirement, and the test asserts the exact iteration progression.Status: Clean
Verdict: READY_FOR_MERGE
All 6 original ACs + the derived cleanup AC are MET with behavior-focused test coverage. CI is fully green,
tscis clean, and 38 tests pass locally. The change is a tight, single-purpose parity fix that reusesrun's shared renderer infrastructure exactly as the spec prescribed, respects every Non-Goal, and disposes resources on all exit paths. The one suggestion (explicitautoDetectPhases: true) is cosmetic and does not affect correctness.Documentation
[Unreleased]entry present for feat(cli):sequant ready— wire live phase-matrix renderer (parity withsequant run) #697Documentation: Before merging, optionally run
/docs 697— though the CHANGELOG entry already covers the user-visible behavior change.Next Steps
sequant ready(#697) #698.autoDetectPhases: trueintobuildProgressWiringfor explicit streaming parity withrun.sequant readyto the boxed Ink TUI + harden TUI (#699) #700/feat(tui): upgradesequant readyto the boxed Ink TUI + harden TUI for large batches #699 upgradesreadyto the boxed Ink TUI — separate effort, not blocking.feat(cli): wire live phase-matrix renderer into `sequant ready` (#697) (
feat(tui): upgrade `sequant ready` to the boxed Ink TUI + harden TUI (#…
feat(tui): upgrade `sequant ready` to the boxed Ink TUI + harden TUI (#…