Skip to content

docs(#655): AC-D1 negative result — synthetic harness does not reproduce - #657

Merged
admarble merged 3 commits into
mainfrom
feature/655-investigate-cli-652-renderer-corruption-column-mis
May 17, 2026
Merged

admarble merged 3 commits into
mainfrom
feature/655-investigate-cli-652-renderer-corruption-column-mis

Conversation

@admarble

@admarble admarble commented May 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Diagnose-first investigation for #655 (Symptom A renderer corruption, column-mismatch hypothesis refuted in #654, real cause unknown). /exec cannot drive AC-1 autonomously — real-run capture is HITL. This PR parks the work with the AC-D1 deliverable (negative result + reproduction instructions) so the next iteration can pick up from a real-run trace instead of relitigating the static analysis.

  • Static analysis (spec phase 2): audited every process.stdout.write / console.log reachable from npx sequant run … (both default mode and -q). There is no second stdout writer in either mode — the renderer owns stdout in default mode (gated on !quiet && !tuiEnabled, run-progress.ts:59-60), the heartbeat owns it in -q mode (gated on quiet && !tuiEnabled, run-progress.ts:46-49), and they are mutually exclusive. phase-executor.ts:675 is gated on config.verbose, so it does not write in non-verbose runs. No second-writer mechanism in the source tree, in either mode. The corrected static-analysis table also surfaces a contradiction with the issue body's "-q mode" claim: the ✔ glyph in the corrupted line is produced only by the renderer, which is not wired in -q. See docs/incidents/655/negative-result.md §"How to capture AC-1" for the mode-discrepancy callout.
  • Synthetic reproduction (spec phase 1): the fix(cli): #624's duplicate-header fix doesn't catch real log-update/scrollback bug (v2.3.0 regression confirmed) #647 scrollback harness already exists. This PR adds one further lock-in test driving the motivating issue's exact event sequence (complete loop → failed loop for the same issue) at a 100-col stream + 80-col physical width + pause/resume between events. The overlay detector (single row containing both ✔ and Claude Code returned) asserts no Symptom A row is produced. Passes today — purpose is to catch any future regression that makes Symptom A reachable synthetically.
  • No production code changes. AC-1..4 remain unmet, deferred until a real trace lands. SEQUANT_DEBUG_RENDERER=1 instrumentation (run-renderer.ts:557-606) is unchanged and ready; capture instructions are in docs/incidents/655/negative-result.md.

AC coverage

AC Status Evidence
AC-1 🔄 Deferred Requires HITL real-run capture; SEQUANT_DEBUG_RENDERER=1 instrumentation in place
AC-2 🔄 Deferred Requires AC-1 evidence
AC-3 🔄 Deferred Requires AC-2 mechanism to know which harness to write
AC-4 🔄 Deferred Requires AC-2 mechanism
AC-D1 ✅ Implemented docs/incidents/655/negative-result.md + lock-in test in scrollback-harness.test.ts
AC-D2 ⏭️ N/A Conditional on AC-2 implicating logUpdateClear; not reached

Test plan

Closes only AC-D1. Issue #655 remains open for AC-1..4.

🤖 Generated with Claude Code

…uce Symptom A

Diagnose-first investigation per spec. /exec cannot drive AC-1 autonomously
(real-run capture is HITL); this commit ships the AC-D1 deliverable so the
work parks with verifiable artifacts and a clear next step.

Static analysis (spec phase 2): audited every process.stdout.write /
console.log reachable from `npx sequant run … -q`. In non-verbose mode the
renderer is the sole stdout writer — phase-executor:675 is gated on
config.verbose, heartbeat is NonTTY-mode only. There is no second-writer
mechanism in the source tree.

Synthetic reproduction (spec phase 1): the #647 scrollback harness already
exists. This commit adds one further lock-in test driving the motivating
issue's exact event sequence (complete `loop` → failed `loop` for the same
issue) at 100-col stream + 80-col physical width + pause/resume between
events. The overlay detector (a row containing both the green ✔ marker AND
the error string) asserts that no Symptom A row is produced. Passes today;
its purpose is to catch any future regression that makes Symptom A reachable
synthetically.

The forensic byte math from the issue body (`complete[0:8] + failed[col 9+]`
on the same row) therefore points to: terminal-emulator-side rendering,
a writer the static read missed, or a measurement artifact in the original
transcript. Discriminating between these requires AC-1 evidence from a real
corrupted run. Instrumentation (SEQUANT_DEBUG_RENDERER=1, run-renderer.ts:
557-606) is unchanged and ready; reproduction instructions are in the
negative-result write-up.

No production code changes. AC-1..4 remain unmet, deferred until a real
trace lands.

Artifacts:
- docs/incidents/655/negative-result.md
- src/lib/cli-ui/scrollback-harness.test.ts (new lock-in test)

Entire-Checkpoint: 7dbee3a19aa4
…screpancy

QA review of PR #657 surfaced two doc precision gaps in the negative-result
write-up (`AC_MET_BUT_NOT_A_PLUS`, non-blocking):

1. The `LivenessHeartbeat` row in the static-analysis table claimed
   "NonTTY-mode only", but the actual gating in `run-progress.ts:46-49` is
   `quiet && !tuiEnabled` — i.e. quiet-mode only (TTY or non-TTY).
2. The "How to capture AC-1" section didn't acknowledge that the renderer
   (sole source of the `✔` glyph in the corrupted line) is NOT wired in `-q`
   mode (see `run-progress.ts:59-60`), contradicting the issue body's claim
   that the motivating transcript was `-q`.

While correcting (1), the renderer row in the same table was found to have
the inverse error — listed as "Yes, sole intended writer" for `-q`, despite
the renderer not being wired in `-q`. Both rows are now corrected for
internal consistency.

The AC-1 capture instructions now lead with a mode-discrepancy callout and
drop `-q` from the example command, so the next HITL capture exercises the
code path that actually produces the corruption.

No production code or tests changed.

Entire-Checkpoint: 5210a64609c5
Follow-up to ba35122. QA re-review surfaced two surviving sites
in `docs/incidents/655/negative-result.md` where the pre-correction
framing — "`-q` mode" / "non-verbose mode" — outlived the substantive
table fix:

1. TL;DR (line 10) said "the renderer is the sole stdout writer in
   non-verbose mode", which directly contradicts the corrected §2
   table (in `-q` mode the heartbeat — not the renderer — owns
   stdout; `-q` is non-verbose).
2. §2 heading and opening sentence scoped the static analysis to
   "`-q` mode", but the corrected table actually covers both modes
   — that is how it establishes the mode-discrepancy callout in
   §"How to capture AC-1".

Both now describe both run modes explicitly and reference the
gating callsites (`run-progress.ts:46-49` and `:59-60`). Grepped
the file for "non-verbose" / "NonTTY" / "stdout writers in `-q`
mode" / "renderer ... sole" framings; zero surviving instances of
the false claim.

No production code or test changes.
@admarble
admarble merged commit 6b6db1e into main May 17, 2026
5 checks passed
admarble added a commit that referenced this pull request Sep 9, 2026
…screpancy

QA review of PR #657 surfaced two doc precision gaps in the negative-result
write-up (`AC_MET_BUT_NOT_A_PLUS`, non-blocking):

1. The `LivenessHeartbeat` row in the static-analysis table claimed
   "NonTTY-mode only", but the actual gating in `run-progress.ts:46-49` is
   `quiet && !tuiEnabled` — i.e. quiet-mode only (TTY or non-TTY).
2. The "How to capture AC-1" section didn't acknowledge that the renderer
   (sole source of the `✔` glyph in the corrupted line) is NOT wired in `-q`
   mode (see `run-progress.ts:59-60`), contradicting the issue body's claim
   that the motivating transcript was `-q`.

While correcting (1), the renderer row in the same table was found to have
the inverse error — listed as "Yes, sole intended writer" for `-q`, despite
the renderer not being wired in `-q`. Both rows are now corrected for
internal consistency.

The AC-1 capture instructions now lead with a mode-discrepancy callout and
drop `-q` from the example command, so the next HITL capture exercises the
code path that actually produces the corruption.

No production code or tests changed.

Entire-Checkpoint: 5210a64609c5
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.

1 participant