Repository navigation
feat(#624): run renderer follow-ups — frame stability, attempt counter, summary teardown, failure dedup - #627
Merged
admarble merged 2 commits intoMay 11, 2026
Conversation
…r, summary teardown, failure dedup Four post-launch fixes to the unified RunRenderer (#618 / PR #620) surfaced by a real `npx sequant run 608 604 -q` transcript on 2026-05-10. Item 1 — live-zone height cap (TTYRenderer): - Bound the live frame at `max(8, rows - 5)` (rows - 7 with banner). - New `RenderOptions.rows`, `getRows()`/`getMaxLiveRows()` helpers, dynamic `effectiveRowCap()` derived from terminal height, and a belt-and-braces `clampFrameHeight()` truncation with overflow indicator. Dynamic cap only engages when `rows` is explicitly provided so existing tests / detached stdout keep pre-#624 behavior. Item 2 — summary teardown / width clamp: - `NonTTYRenderer.renderSummary` no longer hardcodes columns=80; it shares the same column source as the TTY path. - New `SUMMARY_COLUMN_CAP = 110` applied in `TTYRenderer.renderSummary`, `NonTTYRenderer.renderSummary`, and `renderRunSummary` so wide terminals can't produce grids that overflow narrower readers. Item 3 — exec attempt counter: - Events log on retried non-loop phases shows `(attempt N/M)` (replacing the `(loop N/3)` literal). - TTY status cell shows `loop N/M · last fail: <short reason>` while the loop phase is running. - Shared `formatRetrySuffix(iteration, maxIterations, kind)` helper used by all three retry-suffix sites — eliminates drift. - `RenderOptions.maxLoopIterations` threaded from settings through `run-progress.ts` so the M denominator is data-driven, not /3. - `ProgressEvent.iteration`, `emitProgressLine` `extra.iteration`, and `ProgressCallback`'s extra all extended; `batch-executor` populates `iteration` on every phase event + surrounding loop events. Item 4 — failure dedup: - `IssueState.lastFailureSignature` + `firstAttemptForSignature` track first occurrence of each normalized error. - New `failureSignature(error)` helper strips ANSI escapes, lowercases, trims, truncates to 80 chars. - 3-state machine (`first-seen → abbreviated → final-full`) folds repeated identical failures; final allowed iteration re-emits the full text so divergent failures stay visible at max-iter. Derived AC-D1: test-mode `log-update` stub tracks `replacementCount` and `lastFrame`; exposed via `TTYRenderer.getTestStub()` so frame- stability tests assert on replacement count instead of parsing buf.out. Tests: 51 new cases in `run-renderer-624.test.ts` covering all 15 ACs + 3 derived ACs, including a `replayTranscript()` helper that replays the verbatim #624 motivating transcript across both render paths at the AC-2.5 (columns × rows × issue count) matrix. All 3,059 existing tests pass; 51 new tests added → 3,110 total.
15 tasks
…stronger AC assertions Address 9 gaps surfaced during the QA re-read pass on PR #627: - Per-phase failure dedup: move lastFailureSignature + firstAttemptForSignature from IssueState to PhaseState so cross-phase signature collisions don't produce misleading "same failure as attempt N" text. - clampFrameHeight + effectiveRowCap: remove rowsOverride-undefined short-circuits, bump DEFAULT_TERMINAL_ROWS from 24 to 100. AC-1.1 "regardless of issue count" is now literally enforced; the generous default keeps existing tests passing with no over-constraint. - TTYTestStub: add clearCalls + doneCalls counters; AC-2.2 now verifies the renderer actually invokes logUpdate.clear() + logUpdate.done() rather than trusting the stub's local state reset. - AC-2.3 (TTY + NonTTY): assert summary widths are identical at cols=110 and cols=200 (pins the 110 cap rather than relying on 115-char slack). - AC-2.1 + AC-2.4: add box-char/alphanumeric-adjacency assertions catching the verbatim `├───────�ing:` corruption from the motivating transcript. - AC-4.3 split: new literal "3 identical with maxIter=3" test alongside a renamed "(divergence)" test. - Per-phase dedup positive test: exec-fail then qa-fail with same string emits full qa text (never abbreviates across phases). - emitProgressLine iteration propagation: 5 new cases covering payload contents on start/complete/failed and the SEQUANT_ORCHESTRATOR-unset no-op. - @tautology-skip pragma on run-renderer-624.test.ts with a documented reason (helper-wrapped construction false positive in the detector's body scan). - D3 doc: V8 does not support \p{Block=Box_Drawing} property escape. The codepoint range `[─-╿]/u` IS the canonical JS equivalent — platform-agnostic, no Windows CI runner needed. - AC-1.2 doc comment explaining why `stub.lastFrame` is the right assertion target (not `buf.joined()`). 3066 tests pass (3059 + 7 new), build clean.
admarble
added a commit
that referenced
this pull request
Sep 9, 2026
…stronger AC assertions Address 9 gaps surfaced during the QA re-read pass on PR #627: - Per-phase failure dedup: move lastFailureSignature + firstAttemptForSignature from IssueState to PhaseState so cross-phase signature collisions don't produce misleading "same failure as attempt N" text. - clampFrameHeight + effectiveRowCap: remove rowsOverride-undefined short-circuits, bump DEFAULT_TERMINAL_ROWS from 24 to 100. AC-1.1 "regardless of issue count" is now literally enforced; the generous default keeps existing tests passing with no over-constraint. - TTYTestStub: add clearCalls + doneCalls counters; AC-2.2 now verifies the renderer actually invokes logUpdate.clear() + logUpdate.done() rather than trusting the stub's local state reset. - AC-2.3 (TTY + NonTTY): assert summary widths are identical at cols=110 and cols=200 (pins the 110 cap rather than relying on 115-char slack). - AC-2.1 + AC-2.4: add box-char/alphanumeric-adjacency assertions catching the verbatim `├───────�ing:` corruption from the motivating transcript. - AC-4.3 split: new literal "3 identical with maxIter=3" test alongside a renamed "(divergence)" test. - Per-phase dedup positive test: exec-fail then qa-fail with same string emits full qa text (never abbreviates across phases). - emitProgressLine iteration propagation: 5 new cases covering payload contents on start/complete/failed and the SEQUANT_ORCHESTRATOR-unset no-op. - @tautology-skip pragma on run-renderer-624.test.ts with a documented reason (helper-wrapped construction false positive in the detector's body scan). - D3 doc: V8 does not support \p{Block=Box_Drawing} property escape. The codepoint range `[─-╿]/u` IS the canonical JS equivalent — platform-agnostic, no Windows CI runner needed. - AC-1.2 doc comment explaining why `stub.lastFrame` is the right assertion target (not `buf.joined()`). 3066 tests pass (3059 + 7 new), build clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Four post-launch fixes to the unified RunRenderer (#618 / PR #620) surfaced by a real
npx sequant run 608 604 -qtranscript:TTYRendererbounds the live frame atmax(8, rows − 5)solog-updatenever loses cursor tracking and stacks duplicateSEQUANT WORKFLOW ·headers.NonTTYRenderer.renderSummaryno longer hardcodescolumns: 80;SUMMARY_COLUMN_CAP = 110applied uniformly across both render paths to eliminate the├───────�ing:corruption.(attempt N/M)on retried non-loop phases; TTY status cell showsloop N/M · last fail: <short reason>while the loop phase is running. SharedformatRetrySuffix()helper eliminates drift between three sibling sites.(same failure as attempt K); full text re-emitted on divergent or final-iteration failures.log-updatestub tracksreplacementCountandlastFrame; exposed viaTTYRenderer.getTestStub().Pre-PR AC Verification
clampFrameHeight()+effectiveRowCap()inrun-renderer.tsrun-renderer-624.test.tsAC-1.2 viagetTestStub()renderSummaryflushes log-update before handofflogUpdateClear()+logUpdateDone()beforerenderSummaryBlockSUMMARY_COLUMN_CAPinTTYRenderer.renderSummary+NonTTYRenderer.renderSummary+renderRunSummary\x1b[K, no U+FFFD)(attempt N/M)from 2nd execformatRetrySuffix()inappendEventLine(attempt N/M)suffixformatRetrySuffix()inemitEventLineloop N/M · last fail: <reason>statusHeader()loop branch(attempt 2/3)and(attempt 3/3)failureSignatureabbreviates subsequentdecideDedup()inrun-renderer.tsdecideDedupreturnsfullwhencurrentAttempt >= maxIterationsTTYRenderer._testStub+getTestStub()maxLoopIterationsthreaded through all 3 retry sitesRenderOptions.maxLoopIterations+formatRetrySuffix[─-╿]rangeFiles Changed
src/lib/cli-ui/run-renderer-types.ts— new fields onProgressEvent,IssueState,RenderOptionssrc/lib/cli-ui/run-renderer.ts— height cap, attempt counter, dedup, test stubsrc/lib/cli-ui/run-renderer-624.test.ts— 51 new test cases (new file)src/lib/cli-ui/__snapshots__/run-renderer.test.ts.snap— snapshot updates for wider NonTTY summarysrc/lib/workflow/batch-executor.ts— threaditerationon every phase eventsrc/lib/workflow/types.ts—ProgressCallbackextra now includesiterationsrc/commands/run-progress.ts— passrows: process.stdout.rows+maxLoopIterationsto renderersrc/commands/run.ts— readmaxLoopIterationsfrom resolved configCHANGELOG.md— Unreleased entry under AddedTest Results
npx vitest run: 130 files, 3,059 tests pass (51 new inrun-renderer-624.test.ts+ 2 snapshot updates)npm run build: cleannpm run lint: cleanQuality Plan Alignment
getTestStub(),replayTranscript()formatRetrySuffix/3literals\p{Block=Box_Drawing}regex compatibilityiterationfalls throughTest plan
npm run buildpassesnpm run lintpassesnpx sequant run 608 604 -qagainst the motivating transcript reproduces clean output (no duplicate headers, no├───────�corruption,(attempt N/M)suffixes on retried exec)Closes #624