Skip to content

Establish the deterministic headless desk test harness before feature screens #108

Description

@clintecker

Problem

A TUI can appear correct while key bindings, focus, async messages, resizing, and subprocess transitions are wrong. Waiting until screens exist to add a harness would accumulate untestable UI behavior.

Direction

Add a reusable headless Textual harness using App.run_test() and Pilot, fixed viewport fixtures, injected read models/processes, semantic widget queries, and active-signal assertions. Build it alongside the first app shell, before DESK and RUN feature work.

Dependencies

Invariants

  • Tests contain no sleeps, wall-clock deadlines, real tool probes, or terminal-dependent timing.
  • Pilot interactions assert state, return values, refusals, and terminal outcomes—not only screenshots.
  • Every async transition has an observable completion signal.
  • Fixed 80×24 and expanded viewports are first-class fixtures.
  • Snapshot tests supplement semantic assertions and never replace them.

Acceptance

  • Harness helpers construct the app against a composable book fixture and smart fake adapters.
  • Tests demonstrate key presses, clicks, focus, resize, worker completion, refusal, and failure paths.
  • Failures include the active screen, focused widget, model state, and captured child output.
  • A bounded snapshot policy defines review/update rules and stable SVG normalization.
  • The harness is documented for contributors and linked from the invariant ledger.

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ci-cdGitHub Actions, releases, and toolchain imagesarea:dxContributor tooling, tests, maintainability, and development workflowarea:tuiTerminal UI, operator desk, and interactive run controlarea:verificationExecutable contracts and artifact verificationenhancementNew feature or requestpriority:P1High: required for a trustworthy supported workflowtest-layer:L2Component, adapter, and active-signal contracts

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions