Terminal restoration cannot be guaranteed for an owned exit path.
---
id: SMH-PLAN-TUIR0001
type: plan
title: "Fullscreen TUI and Replay"
spec: SMH-SPEC-SPEC0001
status: draft
depends_on: []
---
# Fullscreen TUI and Replay
## Entry
- The harness exposes stable runtime events and sandboxed UI registration.
- Sessions and traces reconstruct provider-free state.
## Order
1. Add fullscreen terminal entry, restoration, panic-safe shutdown, and signal handling in `smith-cli` and `smith-tui`.
2. Add conservative capability detection, bounded probes, explicit overrides, and plain-terminal fallback.
3. Add normalized keyboard, paste, mouse, resize, and focus events.
4. Add deterministic widget, overlay, theme, and layout primitives in `smith-tui`.
5. Add structured plugin render descriptions and the default fullscreen layout.
6. Add an independently scrollable transcript with sticky-bottom control and explicit jump to latest.
7. Add stable search, selection, link activation, viewport navigation, and focus routing.
8. Add replay reconstruction, seek, speed, range, and comparison over session and trace inputs.
9. Add structured VCS snapshot, diff, restore, undo, redo, and time-travel primitives.
10. Expose replay and VCS workflows through built-in plugins.
## Interfaces
- `smith-tui::terminal`: fullscreen lifecycle and capabilities.
- `smith-tui::event`: normalized input independent of terminal quirks.
- `smith-tui::view`: deterministic widgets, viewport, overlays, and themes.
- Plugin UI SDK: product layout and structured presentation.
- Replay: recorded state to deterministic render model.
- VCS SDK: validated history queries and mutations.
## Verification
- Smith starts directly in fullscreen mode; no regular scrollback mode exists.
- Terminal state is restored after normal exit, error, abort, and supported signals.
- Capability failure or timeout degrades without blocking startup.
- User overrides win over detection.
- New output does not move a transcript whose user scrolled away from the bottom.
- Search, selection, links, and pointer actions target stable visible content.
- Rust widgets do not own product layout.
- Replay reconstructs the same state without provider credentials.
- VCS mutations validate targets and remain attributable to session events.
## Exit
Users can operate, inspect, replay, and revisit a session through one fullscreen terminal interface.
## Stop conditions
- Correct replay needs data absent from durable session or trace contracts.
- Plugin render descriptions require arbitrary terminal writes.
- Terminal restoration cannot be guaranteed for an owned exit path.