Repository navigation
Description
Description
When running sequant run with --verbose, the StateManager verbose messages (📊 State saved: .sequant/state.json) interleave with the phase spinner's terminal control character updates, causing garbled output. Additionally, verbose mode outputs repetitive low-value messages that obscure the useful signals.
Reproduction
npx sequant run 1 --quality-loop --verboseObserved Behavior
The worktree path display gets garbled:
Issue #1
Worktree: /Users/tony/Documeequant/state.json
Expected:
Issue #1
Worktree: /Users/tony/Documents/Projects/worktrees/feature/1-feat-foundation-...
📊 State saved: .sequant/state.json
The 📊 State saved message overwrites part of the spinner line mid-render because both console.log() calls from StateManager and the spinner's in-place terminal updates (\r / ANSI escape codes) are writing to stdout without coordination.
Verbose noise
📊 State saved: .sequant/state.json fires 10+ times per run and adds no information beyond what the phase transition messages already convey. Useful signals like Phase spec → completed get buried in repetitive state-save lines.
Useful (keep):
📊 Phase spec → in_progress for issue #1📊 Phase spec → completed for issue #1📊 Issue #1 status → ready_for_merge
Noise (suppress or demote):
📊 State saved: .sequant/state.json(repeated per transition)📊 Metrics saved: .sequant/metrics.json
Root Cause
- Phase spinner uses terminal control characters to update in-place (every 5s via
ELAPSED_UPDATE_INTERVAL_MS) StateManager.saveState()callsconsole.log()whenverbose: true(state-manager.ts ~line 139)- These two output mechanisms are uncoordinated — when a state save fires while the spinner is mid-render, the outputs collide
Acceptance Criteria
- Verbose state tracking messages do not overwrite or interleave with spinner output
- Worktree paths and phase progress are always fully readable in
--verbosemode - Repetitive low-value messages (
State saved,Metrics saved) are suppressed or only emitted at a debug level, not in standard--verbose - Phase transitions and status changes remain visible in
--verbosemode - Non-verbose mode remains unaffected
Possible Approaches
- Pause spinner before verbose logs: Temporarily stop the spinner, emit the log, resume spinner
- Buffer verbose messages: Queue them and flush when spinner completes or pauses
- Use spinner's own logging API: Route verbose messages through the spinner so it can coordinate output
- Tiered verbosity: Keep
--verbosefor operator-useful signals, add--debugfor state-save level detail
Context
Discovered during pm-projects experiment (sequant run 1 --quality-loop --verbose). Only affects --verbose mode since StateManager messages are gated behind the verbose flag.
Activity
admarble commentedon Feb 15, 2026
Spec Plan — #282 Spinner + Verbose Log Interleaving
Root Cause
Two distinct problems:
Spinner garbling:
configureUI()is never called withverbose: truefromrun.ts. Even in--verbosemode,shouldAnimate()returnstruein TTY, creatingAnimatedSpinner(ora-based with\r+ ANSI cursor control). WhenStateManager.saveState()callsconsole.log()concurrently, the outputs collide and garble the terminal.Verbose noise:
saveState()logs📊 State saved: ...on EVERY call. Since higher-level methods (e.g.,initializeIssue,updatePhaseStatus) also have their own verbose logs AND callsaveState()internally, you get redundant messages. Same pattern inMetricsWriter.saveMetrics().Acceptance Criteria
--verbosemodeState saved,Metrics saved) are suppressed--verbosemodeImplementation Plan
Phase 1: Fix spinner garbling (AC-1, AC-2)
src/commands/run.ts(~line 1665), addconfigureUI({ verbose: true })whenconfig.verboseis true. This switchesshouldAnimate()→false, usingTextSpinner(line-based output, no cursor control).Phase 2: Suppress verbose noise (AC-3)
In
src/lib/workflow/state-manager.ts, remove the verbose log fromsaveState()(lines 138-140). The operation-level logs (phase transitions, issue init, etc.) already provide the meaningful signals.In
src/lib/workflow/metrics-writer.ts, remove the verbose log fromsaveMetrics()(lines 129-131). Keep therecordRun()verbose log which provides operation-level info.Phase 3: Verify remaining verbose messages (AC-4)
📊 Phase X → Y for issue #N📊 Issue #N status → X📊 Initialized issue #N: titleScope: 3 files, ~5 lines changed. Minimal risk.
Non-Goals
--debugverbosity level (can be done later if needed)Verification Criteria
configureUIis called withverbose: truewhen verbose mode enabled--verbose --dry-runand verify no garbled outputsaveState()no longer callsconsole.logupdatePhaseStatus()still logs phase transitions when verboseconfigureUINOT called with verbose when verbose mode disabledRecommended Workflow
Phases: exec → qa
Quality Loop: disabled
Reasoning: Small, focused bug fix with clear scope. No UI changes.
fix: prevent spinner + verbose log interleaving garbling terminal output
admarble commentedon Feb 15, 2026
/fullsolve Complete
Issue: #282 — Spinner + verbose log interleaving garbles terminal output
Status: READY_FOR_MERGE
Summary
Two fixes for
--verbosemode terminal garbling:Propagate verbose to cli-ui — Added
ui.configure({ verbose: true })inrun.tsso spinners useTextSpinner(line-basedconsole.log()) instead ofAnimatedSpinner(ora with\r/ANSI cursor control). This eliminates the collision between spinner updates and verbose log output.Suppress noise — Removed repetitive
📊 State savedand📊 Metrics savedmessages fromsaveState()/saveMetrics(). These fired 10+ times per run and buried useful signals. All 12 operator-useful verbose messages (phase transitions, status changes, etc.) are preserved.AC Coverage
Quality
PR
PR: #284
fix: prevent spinner + verbose log interleaving garbling terminal out…
docs: update what-weve-built with #282 verbose spinner fix