Skip to content

fix(cli): rebind -q to --quiet, quality-loop now -Q (#658) - #660

Merged
admarble merged 3 commits into
mainfrom
feature/658-fix-cli-q-is-short-for-quality-loop-not-quiet-sile
May 17, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/658-fix-cli-q-is-short-for-quality-loop-not-quiet-sile

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Restore UNIX convention: -q is now the short form for --quiet on sequant run. Previously, Commander assigned -q to --quality-loop (registered first in bin/cli.ts:234) and --quiet was long-form-only — so npx sequant run … -q activated the quality loop while users believed they had silenced the renderer.
  • --quality-loop keeps a short form, rebound to -Q. Keeps assess SKILL.md examples and the chain suggestion ergonomic.
  • BREAKING for anyone scripting sequant run … -q for quality-loop (CHANGELOG entry added under Changed).

AC Verification

AC Source Description Status Evidence
AC-1 Original bin/cli.ts: -q binds to --quiet, not --quality-loop ✅ bin/cli.ts:234,250; new regression test pins both forms
AC-2 Original npx sequant run <issue> -q → heartbeat only, no renderer grid ✅ Inline Commander parse: -q → quiet=true,qualityLoop=undefined; -Q → quiet=undefined,qualityLoop=true. Renderer gate at run-progress.ts:59-60 (!tuiEnabled && !quiet) unchanged
AC-3 Original docs/incidents/655/negative-result.md mode-discrepancy callout updated ✅ §How to capture AC-1 callout rewritten — explains the puzzle dissolves once bin/cli.ts:234 is read
AC-4 Original Sweep -q references → update where they mean quality-loop, leave where they mean quiet ✅ See "Sites touched" below
AC-5 Derived CHANGELOG.md Changed/BREAKING entry ✅ [Unreleased] → ### Changed — flagged as BREAKING
AC-6 Derived Regression test pins both bindings ✅ src/commands/cli.integration.test.ts — 2 new cases under run command short-form bindings (#658)

Sites touched

Code (binding fix):

  • bin/cli.ts — -q moved from --quality-loop to --quiet; --quality-loop gets -Q
  • src/lib/assess-collision-detect.ts:269 — chain suggestion uses -Q
  • src/lib/__tests__/assess-collision-detect.test.ts:118, 302 — fixture + regex
  • src/lib/__tests__/solve-comment-parser.test.ts:218, 225 — assess flag table fixture
  • src/commands/cli.integration.test.ts — new regression test

Assess SKILL (3-mirror sync): all -q → -Q in:

  • skills/assess/SKILL.md, templates/skills/assess/SKILL.md, .claude/skills/assess/SKILL.md
  • skills/assess/references/predicted-collision-detection.md (×3 mirrors)

Docs:

  • docs/reference/cheat-sheet.md, docs/reference/run-command.md — flag tables (run-command.md now lists -q, --quiet too)
  • docs/reference/chain-mode-analysis-2026-05.md — example chain command
  • docs/features/assess-minimal-flags.md, assess-unification.md, spec-by-default.md — assess workflow examples
  • docs/internal/what-weve-built.md — quality-loop bullet; heartbeat bullet preserved with explicit -q/--quiet
  • docs/incidents/655/negative-result.md — mode-discrepancy callout rewritten; static-analysis table relabeled quiet mode for clarity

Left as-is (already correct under the fix or unrelated):

  • docs/features/quiet-mode-heartbeat.md, docs/features/run-renderer.md, docs/features/experimental-tui-dashboard.md — quiet-mode references are correct now that -q activates quiet
  • src/lib/workflow/heartbeat.ts, heartbeat.test.ts, src/commands/run-progress.test.ts — heartbeat = quiet, correct post-fix
  • src/lib/cli-ui/scrollback-harness.test.ts:70 — historical artifact from fix(cli): #624's duplicate-header fix doesn't catch real log-update/scrollback bug (v2.3.0 regression confirmed) #647 narrative, preserved per spec
  • All grep -q, gh -q, git -q, jq -q, pip install -q, etc. — unrelated tools

Live verification

args ["123","-q"]      → quiet=true,  qualityLoop=undefined
args ["123","-Q"]      → quiet=undefined, qualityLoop=true
args ["123","-q","-Q"] → quiet=true,  qualityLoop=true

run --help output (post-fix):

-Q, --quality-loop    Enable quality loop with auto-retry
-q, --quiet           Suppress version warnings and non-essential output

Test plan

  • npm run build passes
  • npm run lint passes
  • npx vitest run src/commands/cli.integration.test.ts — 6/6 pass (incl. 2 new)
  • npx vitest run src/lib/__tests__/assess-collision-detect.test.ts src/lib/__tests__/solve-comment-parser.test.ts — all pass
  • npx vitest run src/lib/workflow/heartbeat.test.ts src/commands/run-progress.test.ts src/lib/cli-ui/scrollback-harness.test.ts — no regressions
  • 3-mirror sync verified via diff -q after sweep

Closes #658

…#658)

`bin/cli.ts` registered `-q, --quality-loop` before `--quiet`, so Commander
assigned `-q` to quality-loop and `--quiet` got no short form. Users typing
`npx sequant run … -q` activated the quality loop while believing they had
silenced the renderer (the renderer stayed wired because `quiet === undefined`).

This restores UNIX convention and matches the existing `-q, --quiet` binding
on `sync`/`doctor`. `--quality-loop` keeps a short form, rebound to `-Q`,
so assess SKILL.md examples and the chain suggestion in
`assess-collision-detect.ts` stay ergonomic.

Breaking for anyone scripting `sequant run … -q` for quality-loop — flagged
in CHANGELOG under Changed / BREAKING.

Sweep covered docs, assess SKILL.md (3-dir mirrors) + references doc
(3-dir mirrors), the chain suggestion in `src/lib/assess-collision-detect.ts`
and its test, and the solve-comment-parser fixture. Heartbeat/quiet docs
(quiet-mode-heartbeat.md, run-renderer.md, experimental-tui-dashboard.md)
were already prose-correct under the fix and left as-is.

Mode-discrepancy callout in docs/incidents/655/negative-result.md rewritten
to explain that the original "in -q mode" puzzle dissolves once the broken
binding is read off bin/cli.ts:234 — renderer was active because -q set
qualityLoop, not quiet.

New regression test in src/commands/cli.integration.test.ts pins both
`-q → --quiet` and `-Q → --quality-loop` bindings against `run --help`.

Live-verified via inline Commander introspection:
- args ["123","-q"]      → quiet=true,  qualityLoop=undefined
- args ["123","-Q"]      → quiet=undefined, qualityLoop=true
- args ["123","-q","-Q"] → quiet=true,  qualityLoop=true

Entire-Checkpoint: eef503c9d252
QA noted two doc lines were inconsistent with the corrected `-q`/`--quiet`
binding:

- Line 115 ("Quiet mode" bullet) claimed the renderer still runs in quiet
  mode. With `-q` now bound to `--quiet`, run-progress.ts:60 gates the
  renderer off; the liveness heartbeat replaces it.
- Line 180 (SEQUANT_DEBUG_RENDERER example) included `-q`, which now
  disables the renderer — so no debug frames would emit. Dropped `-q`;
  the renderer is the default.

Per CLAUDE.md: no Co-Authored-By line.

Entire-Checkpoint: 91f75164fd6a
admarble added a commit that referenced this pull request May 17, 2026
…es over 36m (#661)

Captures the `npx sequant run 658 -q` session that produced PR #660, with
SEQUANT_DEBUG_RENDERER=1 instrumentation enabled. This is the AC-1 evidence
#647 has been waiting for.

Headline finding:
- terminal.typescript contains 2,181 `SEQUANT WORKFLOW · #N · Xs elapsed`
  header lines persisted in scrollback (~1 per second over a 36-minute run).
  Every renderer redraw fails to erase the previous frame from scrollback.
  Mechanism #1 confirmed at scale.

Also captured:
- Mid-string char drops + U+FFFD overlay (distinct from #655 Symptom A's
  byte-math pattern). Cause undetermined — see notes.md for the
  script(1)-wrapper caveat that prevents discriminating "renderer alone"
  vs "exacerbated by stderr co-writer."

Artifacts:
- terminal.typescript: 3.1 MB script(1) byte-stream capture (authoritative)
- scrollback.txt: 2.4 KB manual pbpaste from an earlier #656 run
- notes.md: run command, counts, symptom summary, caveats

Entire-Checkpoint: 45ec46202785
@admarble
admarble merged commit d9a416b into main May 17, 2026
8 checks passed
@admarble
admarble deleted the feature/658-fix-cli-q-is-short-for-quality-loop-not-quiet-sile branch May 17, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): -q is short for --quality-loop, not --quiet — silently bypasses quiet-mode rendering

1 participant