Skip to content

refactor: simplify terminal regression fixtures - #134387

Merged
steipete merged 1 commit into
mainfrom
codex/test-audit-terminal-counter-fixtures
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-audit-terminal-counter-fixtures

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 18:51
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 2:58 PM ET / 18:58 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 1 item remains

Keep 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
Reviewed head: e009ce73be298ec4d09a8a7c31db1656cf14a8e4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test refactor with no supported correctness or security finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only refactor changes no production behavior; the external-contributor real-behavior gate does not apply.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored test-only refactor changes no production behavior; the external-contributor real-behavior gate does not apply.
Evidence reviewed 6 items Introduced scope: The verified merge-base-to-head diff changes only two terminal-core test files; no production source is introduced.
Native regression retained: The 150,000-row case still runs renderTable in a native Node subprocess and now checks line count, rows, header, and matching borders.
Owner and caller: The renderer processes each row through the table owner, and the sessions command uses that owner to render listed sessions, matching the CLI-stack regression rationale.
Findings None None.
Security None None.

How this fits together

Terminal 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
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: the patch has no actionable finding and remains a normal maintainer-owned review item.
Agent review details

Security

None.

PR surface

Tests 0. Total 0 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 31 31 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 31 31 0

Review metrics

Metric Value Why it matters
Production versus test delta production 0; tests +31/-31 (net 0) The patch only relocates and simplifies test assertions without expanding runtime behavior.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This is behavior-neutral test-fixture cleanup with no production change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only refactor changes no production behavior; the external-contributor real-behavior gate does not apply.

Label justifications:

  • P3: This is behavior-neutral test-fixture cleanup with no production change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored test-only refactor changes no production behavior; the external-contributor real-behavior gate does not apply.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete steipete self-assigned this Aug 31, 2026
@steipete
steipete merged commit ebc71a9 into main Aug 31, 2026
207 checks passed
@steipete
steipete deleted the codex/test-audit-terminal-counter-fixtures branch August 31, 2026 19:55
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant