- The TUI must actually run.
cargo build -p cortex-cliproducesCortex;Cortexwith a TTY starts the interactive UI. - Use the existing
cortex-tui-frameworkcrates (buffer, layout, widgets, input, text, terminal). Do not add a second widget toolkit. - Layouts must reflow. Prefer flex/constraint layout over hardcoded 80×24 coordinates. Test a narrow (40×12) and a wide (120×40) viewport when you change a surface.
- Every surface you change needs:
- a unit test for the logic, and
- a headless snapshot or ratatui-style test (
cortex-tui-captureMockTerminal/FrameCapture, or acortex-tui-bufferrender + assert).
- No mocks that report success. A snapshot of an error state must contain the product-facing error string.
- Do not block the render thread on network I/O. Agent turns, login, and tool exec stay on the engine / tokio tasks.
- Color and style go through
cortex-tui-core. Do not hardcode ANSI in widgets except in capture tests that assert the buffer.