Repository navigation
refactor: simplify terminal regression fixtures - #134387
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:58 PM ET / 18:58 UTC. ClawSweeper reviewWhat this changesThe branch replaces a test-local stream call tracker with counters and consolidates the 150,000-row table assertions into the existing native Node subprocess regression. Merge readinessKeep open. The test-only refactor preserves the large-table regression at the native Node boundary and the broken-pipe assertions; it is not on fetched current main, and this maintainer-labeled PR is not eligible for automated cleanup. Priority: P3 Review scores
Verification
How this fits togetherTerminal Core renders formatted CLI tables and safely writes terminal output. Its table and stream-writer helpers feed commands such as session listing and log tailing, while these tests protect their output and broken-pipe behavior. flowchart LR
A[CLI commands] --> B[Terminal table renderer]
B --> C[Formatted table output]
C --> D[Terminal stream]
D --> E[Safe stream writer]
E --> F[Broken-pipe handling]
G[Regression tests] --> B
G --> E
Before merge
Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the focused consolidation with the native subprocess retained as the canonical large-table regression boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors regression fixtures rather than reporting a user-facing failure; the retained native subprocess directly represents the historical stack-sensitive scenario. Is this the best way to solve the issue? Yes. Consolidating the 150,000-row checks at the native Node process is the stronger owner-boundary regression while retaining small worker cases for ordinary coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2d5f0f348a88. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Terminal-core renders the same 150,000-row table twice: once in the Vitest worker and again in a native Node subprocess. Its stream-writer tests also carry a generic call-tracking helper even though they only observe notification counts.
Why This Change Was Made
Keep the subprocess regression for the native stack limit and move the worker case's line-count, row-count, header and border assertions into it. Keep the zero-row and three-row worker cases. The subprocess still uses the same Node executable, preload, inputs and 30-second deadline, and returns only five scalar observations.
Replace the custom spy with test-local counters and ordinary write functions. Both stream-writer cases and all eight assertions remain, including clearing only the observed notification count before writing to the same closed writer again. Plain counters also preserve this file's existing unit-fast project; importing the framework mock API would change its routing and setup.
User Impact
No production changes. Test changes are +31/-31 lines across two files: one generic helper and one duplicate large-row case removed, with the large-row assertions retained in the stronger existing subprocess check.
Evidence
The unchanged baseline passes all 70 cases. The final candidate passes 69, and a complete comparison confirms identical remaining project names, case names and execution order: two stream-writer cases in unit-fast, followed by 67 table cases in unit-fast-isolated. There is no routing override, concurrency change or weaker assertion.
A temporary historical-fault control restores the original Math.max spread implementation. The retained subprocess case fails with RangeError: Maximum call stack size exceeded; the production owner was restored afterward. This directly checks that removing the duplicate worker case preserves detection of the original failure.
All 19 changed-file checks pass, including package test types, lint, boundaries and dead exports. Managed Codex review is scoped-clean at the configured P0 threshold, supplemented by direct owner, caller, classifier, configuration and dependency inspection. No performance improvement or live-provider behavior is claimed.