test(terminal): headless redraw-drain harness + real-parser coalescing proof#180
Conversation
…g proof Two headless validations for the terminal renderer lag/duplication work, with no live agent swarm (which overloads the very renderer under test): 1. pty-coalesce-equivalence.test.ts — proves with the REAL xterm VT parser (@xterm/headless) that writing a redraw stream per-chunk is byte-for-byte identical to one coalesced write, including chunk boundaries that fall in the MIDDLE of a CSI sequence. This is the correctness justification for the write-coalescing change (PR "coalesce per-frame PTY chunks into one write"). 2. redraw-drain.spec.ts — Playwright harness driving real xterm + predictive echo in headless Chrome via window.__pearMock, reading the parsed grid back through a new gated readRuntimeViewportText probe. Finishes the team's scaffolded burst mode: REDRAW_BURST_FRAMES injects N redraw frames into one rAF flush — the condition coalescing acts on. Per-chunk vs coalesced: max render lag 1773→16 frames, rendered 43%→100%, never-drains→drains in 26ms, longest frame 120ms→54ms. See REDRAW-DRAIN-RESULTS.md. The probe is gated on VITE_PEAR_MOCK_IPC (web/mock build only), tree-shaken from the Electron bundle. writeChunks is left at the main baseline here; the production coalescing fix lives in its own PR. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
Warning Review limit reached
More reviews will be available in 40 minutes and 21 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. Reviewed PR #180 against Addressed comments
Local validation run:
I removed the local |
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
Fixed one validated breakage: Changed: Validation run:
All passed locally. I also removed the generated Addressed comments
I queried PR metadata once: GitHub reported the PR mergeable at the checked head, and the only returned status was |
|
Reviewed PR #180 from Addressed comments
Validation run locally:
All of the above passed after installing the required Playwright Chromium browser locally. I did not verify GitHub CI status, mergeability, or PR conflict state from GitHub, so I am not ending with |
|
Your free trial PR review limit of 300 PRs has been reached. Please upgrade your plan to continue using CodeAnt AI. |
|
✅ pr-reviewer applied fixes — committed and pushed Reviewed PR #180 and made one small fix: corrected misleading wording in pty-coalesce-equivalence.test.ts that claimed Validation run:
All passed locally. I removed generated Addressed comments
I’m not ending with |
|
Reviewed PR #180 against Validation run:
All local commands passed. I removed generated Addressed comments
Remote metadata showed the PR as mergeable/clean, GitHub Actions check-runs completed successfully, |
|
pr-reviewer could not complete review for #180 in AgentWorkforce/pear. |
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. pr-reviewer could not complete review for #180 in AgentWorkforce/pear. |
|
Reviewed PR #180 against Local validation passed:
Generated Addressed comments
|
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. Reviewed PR #180 against Validation passed locally:
Generated artifacts from validation were removed: Remote metadata checked via GitHub: PR is mergeable/clean; GitHub Actions Addressed comments
|
|
ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed. Reviewed PR #180 and found no current defect requiring edits in this checkout. The prior actionable findings are already handled in the PR. Validation passed locally:
I removed generated Remote metadata fetched through the GitHub connector: PR is open and mergeable, the GitHub Actions workflow jobs Addressed comments
|
|
pr-reviewer could not complete review for #180 in AgentWorkforce/pear. |
What
Two headless validations for the terminal renderer lag/duplication work — no live agent swarm required (running a swarm overloads the very renderer under test, which is what crashed the app during investigation). Finishes the scaffolded redraw-drain work and adds a real-parser correctness proof.
Test-only:
writeChunksis left at the main baseline here; the production coalescing fix lives in its own PR (#179). The only production-code addition is a small read-only probe gated onVITE_PEAR_MOCK_IPC(web/mock build), tree-shaken from the Electron bundle.1. Real-parser equivalence proof —
pty-coalesce-equivalence.test.tsUses
@xterm/headless(real VT parser + buffer, no DOM) to prove that writing a cursor-addressing redraw stream per-chunk is byte-for-byte identical to one coalesced write — including the hard case where a chunk boundary falls in the middle of a CSI sequence (\x1b[12+;1H). This is the correctness justification behind #179's coalescing; if a future xterm bump broke the streaming-parser property, this goes red.Runs in vitest (
nodeproject) in ~170ms.2. Headless drain harness —
redraw-drain.spec.ts(npm run test:redraw)Playwright drives real xterm + real predictive-echo in headless Chrome via
window.__pearMock.injectPtyChunk, reading the parsed grid back through the newreadRuntimeViewportTextprobe.Finishes the team's burst mode (the config existed; the inject loop didn't use it):
REDRAW_BURST_FRAMESinjects N redraw frames into one rAF flush — the exact condition write-coalescing acts on. With one chunk per frame the change is invisible; burst mode isolates it.Per-chunk vs coalesced (16 frames/flush × 120 = 1920 frames)
Under per-chunk writes the renderer falls ~1773 frames behind and never catches up; coalescing collapses the N predictive-echo headless-model parses + promise ticks into one per flush, so the grid keeps up — full drain, lag bounded to one burst. See
REDRAW-DRAIN-RESULTS.md.Notes
Gates: vitest 238/238,
tsc --noEmitclean,build:web+test:redrawpass.🤖 Generated with Claude Code