Skip to content

[TUI v2][P0] T10: establish terminal safety, accessibility, performance, and cross-platform acceptance gates #417

Open

Description

@BunsDev

Outcome

A terminal UI that remains fast, private, keyboard-operable and recoverable under large workloads, hostile output and real platform behavior. This is a reusable gate, not a last-minute screenshot pass. Parent: #406.

Dependencies

Ownership

Extend existing TUI tests, .github/workflows/tui-tests.yml, relevant scripts and src-rust/crates/tui/ tests/benchmarks. Keep terminal lifecycle ownership centralized. New test module names are implementation choices recorded in the spec; do not invent a second test runner or telemetry service.

Acceptance

  • Snapshot matrix covers 20x6, 40x12, 60x20, 80x24, 120x40 and 180x50; truecolor/256/16/NO_COLOR; UTF-8 and ASCII fallback; default/terminal-native/high-contrast options; reduced motion and keyboard-only use.
  • Content fixtures include CJK, combining marks, emoji, bidi/control characters, huge paths, 100,000-line transcript, 10,000-line diff, binary output, streaming bursts and rapid resize. Focus, approvals and cancellation stay usable.
  • Virtualization/caching keeps work proportional to visible content where feasible. Bound queues and diagnostics; preserve semantic events while coalescing presentation frames. Measure memory growth rather than silently dropping history.
  • Proposed release targets on the recorded reference machine: key-to-visible p95 <50 ms; normal resize p95 <100 ms; active render p95 <33 ms; cold usable-frame latency no more than 10% above Classic; comparable-workload RSS no more than 15% above Classic without reviewed justification. Report samples/hardware/terminal/settings and baseline variance. These are targets, not current measurements.
  • Idle mode performs no decorative redraw loop. Optional activity animation is capped and disabled by reduced motion; no model calls or external telemetry are generated by benchmarks.
  • Untrusted output cannot emit OSC52 clipboard writes, arbitrary hyperlinks, screen-clearing/cursor controls, fake permission chrome or hidden executable commands. Safe rendering is tested at the adapter and actual PTY boundary.
  • Terminal guard restores raw mode, cursor, alternate screen and keyboard protocol on ordinary exit, handled interrupts, panic and cleanup-capable failures. Document unavoidable SIGKILL/host-crash limitations and recovery steps instead of promising impossible cleanup.
  • Run actual Linux/macOS PTY and Windows ConPTY/native-console journeys; exercise tmux and a representative remote/SSH terminal. Compilation or Linux tmux is not proof of Windows acceptance. Unsupported combinations are documented honestly.
  • All snapshots/logs/diagnostics use synthetic content. Secrets, private memory and prompt bodies are not uploaded in CI artifacts. Document readable plain-output/no-TTY fallback without changing existing headless protocol behavior.

Verification evidence

Use Ratatui Buffer/TestBackend assertions, property tests for size/layout/input, controlled real-binary PTY/ConPTY runs, benchmarks and failure injection. Verify required tests actually ran; zero matches, skipped gates and flaky reruns are not passes. Retain the initial failure alongside successful remediation. Run exact-head format/check/Clippy/workspace gates and applicable noninteractive contract suites.

Long-running goal prompt

Implement T10 of epic #406 as soon as #408/#409 are stable, coordinating test ownership with the shell team. Refresh source/instructions and record the reference machine, terminal and SHAs. Extend the existing harness rather than creating a parallel framework. Add adversarial terminal-content, Unicode/resize, large-transcript/diff, queue-pressure, lifecycle and privacy regressions first. Measure Classic and Next under comparable deterministic workloads, then fix the smallest actual rendering/lifecycle bottleneck without dropping semantic events or weakening checks. Qualify the M1 journeys once #410/#411/#412 land and provide hooks for later feature matrices. Obtain native-platform evidence where available and label missing evidence explicitly. Do not claim cleanup after uncatchable termination or privacy beyond terminal capture limits. Preserve existing lifecycle issues, release holds and Git authorization boundaries.

Follow-up prompt

Resume T10 from recorded commands, fixtures and benchmark data. Refresh current heads and existing lifecycle findings; rerun the original failing scenario before accepting a fix. Verify actual executed test counts, comparable performance samples, no secret-bearing artifacts and native-platform coverage. Finish the smallest remaining safety/performance defect, rerun the relevant matrix and report verified platforms, proposed targets met/missed and untested cases. Never substitute a timeout increase, skipped check or generated mockup for acceptance evidence.

Activity

  1. added
    enhancementNew feature or request
    crate:tuiTerminal UI crate (src-rust/crates/tui)
    crate:coreCore crate (src-rust/crates/core)
    on Oct 28, 2026
  2. BunsDev commented on Nov 2, 2026

    @BunsDev
    MemberAuthor

    Status, 2026-11-02: one slice is up as #438 (stacked on #436). This issue stays open. Against the acceptance list:

    Covered by #438 (buffer level, with tmux case 11 at the PTY):

    • Snapshot matrix:
      • sizes 20x6, 40x12, 60x20, 80x24, 120x40 and 180x50;
      • truecolor, 256, 16 and NO_COLOR, where NO_COLOR draws no color at all;
      • UTF-8 and ASCII glyphs;
      • dark and light schemes, full and reduced motion;
      • every inspector page, with an approval pending, plain, and with an error notice.
    • Untrusted output: OSC 52, OSC 8, OSC 0, screen clear, cursor control, C1, CR, BS and NUL never reach a cell. Six leaks were found and fixed in Next: the toast, error notices, the header, field values, attachment labels and the terminal title. Classic's title is tracked in Classic terminal title writes untrusted session titles raw into the OSC sequence #437.
    • Content fixtures: CJK, combining marks, ZWJ emoji and bidi in the corpus; a 100,000-line transcript, a 10,000-line diff-shaped result and binary output render inert, with the way back visible.

    Open:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crate:coreCore crate (src-rust/crates/core)crate:tuiTerminal UI crate (src-rust/crates/tui)enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions