Skip to content

FE-895: Pi component test harness#234

Merged
lunelson merged 13 commits into
nextfrom
ln/fe-895-pi-component-test-harness
Jun 19, 2026
Merged

FE-895: Pi component test harness#234
lunelson merged 13 commits into
nextfrom
ln/fe-895-pi-component-test-harness

Conversation

@lunelson

@lunelson lunelson commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Test-harness and topology work for the Brunch .pi TUI components, picked up opportunistically on the prompt-skill-consolidation branch and split out into its own review unit. Stacked under FE-893 and above the FE-873 web-driver follow-ups.

Changes

  • VirtualTerminal test harness + workspace-dialog preflight viewport proof
  • runtime-axis-picker harness integration test
  • .pi/components topology README (+ correction)
  • virtual-terminal render idle-wait tightening

Commits (oldest → newest)

  • 190b680e add VirtualTerminal harness + workspace-dialog preflight viewport proof
  • 5b673e4c add runtime-axis-picker harness integration test
  • 5e18b4e2 add .pi/components topology README
  • 183f22a2 Tighten virtual terminal render idle wait
  • 83abdb36 docs: correct pi components topology README

Verification

npm run verify green at the top of the stack (124 files / 941 tests + 1 todo, build).

lunelson added 13 commits June 17, 2026 21:21
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.

lunelson commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@lunelson lunelson changed the title FE-xxx: add VirtualTerminal harness + workspace-dialog preflight viewport proof FE-895: Pi component test harness Jun 19, 2026
@lunelson lunelson marked this pull request as ready for review June 19, 2026 08:44
Copilot AI review requested due to automatic review settings June 19, 2026 08:44
@cursor

cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only and documentation changes; @xterm/headless is a devDependency with no production wiring changes.

Overview
Introduces a shared VirtualTerminal test helper (@xterm/headless + pi-tui Terminal) so vitest can drive a real TUI, assert on getViewport() text, and send keys through sendInput. waitForRender waits for an idle write window (with unit tests for late writes and timeout).

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; FakeTerminal stays for lifecycle-only cases.

Adds src/.pi/components/README.md documenting fractal layout, dependency rules, and the two-tier test convention (direct render vs harness). Removes the completed planning card under memory/cards/.

Reviewed by Cursor Bugbot for commit 83abdb3. Bugbot is set up for automated code reviews on this repo. Configure here.

Base automatically changed from ln/fe-873-web-driver-followups to next June 19, 2026 08:47
@lunelson lunelson merged commit dea0fbb into next Jun 19, 2026
12 of 13 checks passed
@lunelson lunelson deleted the ln/fe-895-pi-component-test-harness branch June 19, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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-dialog preflight and the runtime posture axis picker.
  • Adds .pi/components topology README documenting layout/dependency rules and the two-tier testing approach; adds @xterm/headless dev 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 {
Comment on lines +74 to +75
terminal.stop();
tui.stop();
Comment on lines +110 to +111
terminal.stop();
tui.stop();
Comment on lines +142 to +143
terminal.stop();
tui.stop();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants