FE-895: Pi component test harness#234
Conversation
Proves the VirtualTerminal harness generalizes beyond workspace-dialog preflight by driving the runtime strategy picker through a real pi-tui TUI overlay: focus set, arrow/hjkl cycling visible in getViewport(), Enter commit, and Esc cancel all route through terminal.sendInput. Also repairs the invalid JSON escape (\; -> \\;) introduced in the Card 1 package.json edit, which blocked npm/rolldown parsing.
Documents the fractal sub-tree organization, dependency direction, layout sketch, and the two-tier test convention (direct-render + VirtualTerminal harness integration) for Pi TUI components. Retires the tooling scope file now that Cards 1–3 are complete.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR SummaryLow Risk Overview New harness coverage: workspace dialog preflight (picker copy + Enter → continue decision) and runtime strategy picker (overlay focus, hjkl/arrows, Enter commit, Esc cancel). Existing direct-render tests are unchanged; Adds Reviewed by Cursor Bugbot for commit 83abdb3. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
⚠️ Not ready to approve
A couple of small but important harness/test hygiene issues (terminal interface signature narrowing and teardown order) should be fixed to avoid masking cleanup behavior and interface drift.
Pull request overview
This PR adds an xterm-backed VirtualTerminal harness to enable end-to-end Pi TUI component tests under Vitest, alongside new harness-based integration tests and a topology README that codifies .pi/components ownership and testing conventions.
Changes:
- Introduces
VirtualTerminal(xterm headless) test harness with a render-idle wait and viewport capture utilities. - Adds harness integration tests for
workspace-dialogpreflight and the runtime posture axis picker. - Adds
.pi/componentstopology README documenting layout/dependency rules and the two-tier testing approach; adds@xterm/headlessdev dependency.
File summaries
| File | Description |
|---|---|
| src/.pi/components/README.md | New topology README documenting ownership, layout, dependency rules, and test conventions for .pi/components. |
| src/.pi/tests/workspace-dialog-preflight.harness.test.ts | New harness test proving runWorkspaceDialogPreflight renders and resolves via real TUI input. |
| src/.pi/tests/support/virtual-terminal.ts | New xterm-headless-backed Terminal implementation for integration-style TUI tests. |
| src/.pi/tests/support/virtual-terminal.test.ts | Unit tests for VirtualTerminal.waitForRender behavior and timeout failure mode. |
| src/.pi/tests/runtime-axis-picker.harness.test.ts | New integration tests driving the runtime posture picker via real TUI(VirtualTerminal) overlay input routing. |
| package.json | Adds @xterm/headless as a dev dependency. |
| package-lock.json | Locks @xterm/headless dependency resolution. |
| memory/cards/tooling--pi-tui-component-harness.md | Removes the card document now that the harness + conventions are materialized elsewhere. |
Copilot's findings
- Files reviewed: 25/26 changed files
- Comments generated: 4
Note
Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return false; | ||
| } | ||
|
|
||
| start(onInput: (data: string) => void, _onResize: () => void): void { |
| terminal.stop(); | ||
| tui.stop(); |
| terminal.stop(); | ||
| tui.stop(); |
| terminal.stop(); | ||
| tui.stop(); |

Test-harness and topology work for the Brunch
.piTUI components, picked up opportunistically on theprompt-skill-consolidationbranch and split out into its own review unit. Stacked under FE-893 and above the FE-873 web-driver follow-ups.Changes
VirtualTerminaltest harness + workspace-dialog preflight viewport proofruntime-axis-pickerharness integration test.pi/componentstopology README (+ correction)Commits (oldest → newest)
190b680eadd VirtualTerminal harness + workspace-dialog preflight viewport proof5b673e4cadd runtime-axis-picker harness integration test5e18b4e2add .pi/components topology README183f22a2Tighten virtual terminal render idle wait83abdb36docs: correct pi components topology READMEVerification
npm run verifygreen at the top of the stack (124 files / 941 tests + 1 todo, build).