FrankenTUI

repository·main·Indexed 42 days ago

https://github.com/dicklesworthstone/frankentui

A terminal user interface (TUI) framework and ecosystem focused on high-performance rendering. It includes the doctor_frankentui CLI for diagnostics, environment certification, and migration workflows, as well as tools for terminal capability detection, concolic differential exploration for trace divergences, and cargo-fuzz targets for critical components like layout engines and text rendering pipelines.

Tokens
269.1K
Snippets
518
Records
1.1K
Agent score
55%

What's inside FrankenTUI

  1. Overview of FrankenTUI Vision and Feature Status

    main

    The FrankenTUI project maintains a comprehensive vision checklist tracking the implementation status of its core architectural goals. The status legend used is:

    • WORKING: Feature is implemented and reachable in production.
    • PARTIAL: Feature exists but is incomplete or has limitations.
    • DEAD: Feature exists in code but is unreachable in production or unreferenced.
    • OPT-IN: Feature is available but disabled by default.
    • WRONG_API: Feature exists, but the public API or documentation shape is incorrect.
    • NOT_STARTED: Feature has not been implemented.
    • UNPROVEN: Feature implementation is not yet verified.
    • UNREFERENCED: Code exists but is not used by the main application.

    Key working features include deterministic buffer-to-ANSI rendering, the 'one-writer' rule for terminal output, RAII cleanup on panics, and a pane workspace system with drag/dock/snap capabilities. Some advanced features like BOCPD resize coalescing and Conformal frame-time gating are currently OPT-IN.

  2. Overview of the TUI Inspector toolkit

    main

    The tui_inspector is a shell and VHS-based toolkit designed for deterministic TUI (Terminal User Interface) capture. It is primarily used to target MCP (Model Context Protocol) server processes to record interaction artifacts for local or CI regression testing.

    Core Capabilities:

    • Video Capture: Generates reproducible video captures using scripted key sequences.
    • Data Seeding: Optionally seeds live demo data via MCP JSON-RPC during the capture process.
    • Snapshots: Extracts snapshot images at specific timestamps.
    • Suite Execution: Batches and runs multiple profile suites.
    • Reporting: Renders aggregate JSON and HTML reports of run results.
    • Health Checks: Runs doctor checks to verify dependencies and wiring.
  3. Overview of FrankenTUI Telemetry Event Schema

    main

    FrankenTUI uses an OpenTelemetry (OTEL) based telemetry system to track runtime performance, rendering efficiency, and system decisions. The schema is designed to be stable and conservative, prioritizing the redaction of sensitive user data (PII) while providing high-resolution timing and structural metadata for building dashboards and alerts.

    Key characteristics:

    • Stable Schema: Uses semantic versioning (currently 1.0.0).
    • Microsecond Precision: All duration fields use microseconds (duration_us).
    • Redaction by Default: Sensitive data like user input, file paths, and environment variables are strictly prohibited from telemetry.
  4. Understand the doctor_frankentui verification stack

    main

    The doctor_frankentui crate uses a multi-layered verification stack to ensure reliability, realism, and determinism. The stack is enforced via CI gates and includes:

    • Unit & Integration Tests: Uses real subprocesses, networks, and filesystems (no mocked business logic).
    • No-Fake Realism Policy: Prevents unannotated shims or fakes in tests.
    • E2E Observability: Validates end-to-end workflows using JSONL telemetry and artifact manifests.
    • Determinism Soaks: Detects non-volatile divergence across repeated runs.
    • Shadow Comparisons: Compares default vs. conservative workflows to detect quality drift.
    • Coverage Gates: Enforces per-module coverage floors.

    Verification results are indexed in artifact_map.txt and artifact_map.json within the CI artifact roots.

  5. Assess the current state of FrankenTUI (v0.7.0)

    main

    As of the September 2026 assessment, FrankenTUI is a published native terminal UI framework. While the core kernel and many features are functional, certain high-level visions and specific user journeys are still in development.

    What is currently functional:

    • Native kernel and facade startup.
    • Inline log presentation.
    • Substantial widget library.
    • Subscriptions.
    • Headless simulation and live pane interactions.
    • Version 0.7.0 availability (native binaries, crates, and docs.rs pages).

    Known limitations and incomplete features:

    • Doctor Coverage: The doctor verification gate still has coverage deficits.
    • Browser/Web: While Mac browser rendering works in specific paths, the complete browser/GPU/IME/mobile matrix is not yet fully proven. Linux SwiftShader may produce a blank viewport.
    • Accessibility: The accessibility tree does not yet automatically reach an OS screen reader.
    • Subprocess Streaming: The flagship interactive subprocess example is currently absent; the underlying streaming boundary is currently unbounded.
    • Other incomplete areas: Full editor support, widget/focus management, RTL/formatting, and certain supported-host commitments.
  6. Understand the FrankenTUI Spec Doc Diff Analysis framework

    main

    The Spec Doc Diff Analysis is a structured audit used to track the evolution of the FrankenTUI specification corpus. It is derived from git commit diffs and manual categorization. The analysis focuses on the following scope:

    • docs/spec/**
    • docs/specs/**

    It categorizes changes into specific 'Buckets' to understand the nature of specification updates and uses various 'Metrics' to measure the magnitude of those changes.

  7. Map the FrankenTUI codebase and runtime pipeline

    main

    To understand how data flows through the system or where to implement changes, follow the runtime pipeline from the backend to the terminal writer:

    TerminalSession/backend $\rightarrow$ Event $\rightarrow$ Program/Model $\rightarrow$ Frame/Buffer $\rightarrow$ BufferDiff $\rightarrow$ Presenter $\rightarrow$ TerminalWriter.

    High-signal entry points

    • Terminal lifecycle (RAII, raw mode, cleanup): crates/ftui-core/src/terminal_session.rs (Native backend: crates/ftui-tty/src/lib.rs)
    • Canonical events: crates/ftui-core/src/event.rs
    • Runtime loop (Elm-style) & command execution: crates/ftui-runtime/src/program.rs
    • Output coordination (screen modes, one-writer rule, diff selection, ANSI emission): crates/ftui-runtime/src/terminal_writer.rs
    • Render kernel: crates/ftui-render/src/{cell.rs,buffer.rs,frame.rs,diff.rs,presenter.rs}

    Crate Boundaries

    • ftui: Public facade
    • ftui-core: Input, capabilities, and lifecycle
    • ftui-render: Render kernel
    • ftui-runtime: Runtime
    • ftui-widgets: Widgets
    • ftui-backend: Traits for backends
    • ftui-tty: Native (Unix-first) backend
    • ftui-web: Web/WASM primitives
    • ftui-harness / ftui-pty: Snapshot and PTY utilities
    • ftui-demo-showcase: Reference app and snapshots
  8. Current capabilities and status of FrankenTUI

    main

    As of the 0.7.0 release (September 2026), FrankenTUI provides a set of verified features and experimental modules. Developers should note the following status of core architectural promises:

    Working Features (Verified)

    • Inline scrollback/stable chrome: Supported via terminal_writer/inline_mode and PTY suites.
    • Deterministic buffer/diff/presentation: Verified via render kernel and harness property tests.
    • Single Terminal Writer: Provided by TerminalWriter with sanitized log paths.
    • Composable runnable facade: Default/slim registry consumers pass real PTY journeys.
    • State persistence: Supported via registry/runtime load-save.
    • Input macro record/replay: Integrated via input_macro.
    • Headless simulator: Available via simulator/deterministic test corpus.
    • Elm runtime/subscriptions: Includes task/tick/fs-watch helpers.
    • No unsafe implementation: Follows a strict crate policy (with governance FFI exceptions).
    • Hyperlinks: Supported via link registry and OSC 8 presenter.
    • Modals: Supported via widget/focus stack.
    • Rope text: Integrated with rope/editor.
    • Animation: Supported via widget animation code and tests.
    • Effect queue/backpressure: Supported via effects runtime.

    Partial or Experimental Features (Use with caution)

    • Accessibility/live regions: Runtime tree and ten widget implementations exist, but real Assistive Technology (AT) journeys are not yet demonstrated.
    • i18n/RTL/formatting: Catalogs and plurals are present, but directionality and formatting are incomplete.
    • Focus management: The manager is functional, but the accessibility connection is incomplete.
    • Windows support: MSVC native binaries/builds pass, but the full interactive console/lifecycle matrix is still being verified.
    • Advanced UI: Pane drag/dock/snap/throw, Table themes, and Stylesheets are currently in development or incomplete.
  9. Understand the FrankenTUI development and roadmap status

    main

    The project uses a structured planning system based on 'Beads' (tasks/epics) and 'BV' (a validation/ledger system). As of the 2026-09-01 reality check, the roadmap is divided into two primary rounds of ambition:

    • Round 1 (Native Focus): Strengthening the native experience from basic installability to responsive, bounded subprocess interaction.
    • Round 2 (Web/AT/Performance Focus): Strengthening web/Accessibility (AT) acceptance (moving from Rust output to actual host behavior) and performance (measuring total cost on identical outputs rather than just microbenchmarks).

    Developers should note that the project tracks progress through specific task IDs (e.g., .28.7, .33.1) and uses br ready to report claimable tasks.

  10. Overview of FrankenTUI (ftui) Architecture

    main

    FrankenTUI (ftui) is a high-performance, minimal terminal UI kernel designed for building robust, flicker-free terminal applications. It is specifically optimized for 'agent-ergonomic' use cases, such as AI agent harnesses (e.g., Claude Code style), where streaming logs must coexist with a stable UI chrome without sacrificing native terminal scrollback.

    The project follows a Three-Ring Architecture to ensure stability and rapid evolution:

    1. Kernel (Sacred): The stable, minimal core containing primitives like Frame, Buffer, Cell, the diff engine, the ANSI presenter, and input parsing.
    2. Widgets (Reusable): Components built on kernel primitives, such as Panels, Lists, Tables, and Inputs.
    3. Extras (Feature-gated): Higher-level features like Markdown support, syntax highlighting, and SSH/PTY integration.

    Key design goals include being inline-first (preserving native scrollback), flicker-free (using diffed, buffered output), and deterministic (rendering is a pure function of model state, terminal size, and theme).

  11. Overview of the doctor_frankentui crate

    main

    The doctor_frankentui crate (located at crates/doctor_frankentui) is a Rust-based port of the legacy tui_inspector tool. It is designed to provide deterministic TUI capture workflows, profile-driven orchestration, and automated reporting. It replaces fragile shell scripts with typed configurations and metadata schemas, making it suitable for both local diagnostics and CI environments.

    Key capabilities include:

    • Profile-driven capture orchestration: Running specific TUI scenarios based on defined profiles.
    • VHS tape generation: Creating .tape files from key-token sequences.
    • JSON-RPC seeding: Optional live seeding of data via JSON-RPC.
    • Suite execution: Running multiple profiles in sequence.
    • Report generation: Producing both JSON and HTML reports.
    • Doctor checks: Verifying environment dependencies and wiring.
    • Deterministic artifacts: Generating consistent outputs including run_meta.json, run_summary.txt, logs, tapes, and media.
  12. What is the UI Inspector and its core capabilities

    main

    The UI Inspector is an interactive debugging tool designed to help developers visualize and debug the widget tree, hit-test regions, and layout constraints.

    Key Capabilities:

    • Widget Tree Visualization: View the hierarchical structure of rendered widgets.
    • Hit-Test Debugging: Visualize clickable regions including their HitId, HitRegion, and HitData.
    • Layout Inspection: Inspect widget bounds, constraints, and size negotiations.
    • Interactive Exploration: Use mouse hover and clicks to select widgets for detailed inspection.
    • Minimal Overhead: The tool uses lazy evaluation and has no impact on performance when disabled.