# KV1 verify — tui-kit extraction (2026-07-17)

Audience: AI coding agents first.

## Verdict

Branch `refactor/tui-kit` verified. K1–K3 implemented, externally reviewed (codex gpt-5.6-sol/medium, 4 iterations to CLEAN), all findings fixed on-branch.

## Evidence

- `cargo build --release --workspace`: Finished, zero warnings.
- `cargo test --workspace`: 15 suites, 0 failed, 0 warnings (incl. frozen pty parity suite 12/12; tui-kit 58 unit tests).
- `cargo clippy --workspace --all-targets -- -D warnings`: clean.
- Dep gate: `cargo tree -p tui-kit -e normal` → ratatui + unicode-width only; crossterm dev-dep only.
- Grep gate: zero `Color::` literals outside `theme.rs` (enforced by `tests/no_inline_colors.rs`).
- Screen walk (real pty 40×140, release binary): default theme renders named-ANSI only (0 RGB sequences); `--theme deck` renders pinned RGB tokens (#7aa2f7 accent, #e0af68 warn, #565f89 dim observed); ANSI-stripped content byte-identical between themes modulo one poll-timing frame. `--theme bogus` → exit 2, error lists valid themes (fail-closed). `RUNPLAN_TUI_THEME` env honored, flag wins.
- Consumer example: `deck_sample` runs and exits 0 in a pty. NOTE: `timeout <sec> <tui-binary>` without `--foreground` parks the child in a background process group → SIGTTOU stop on raw-mode setup; use `timeout --foreground` for TUI smoke tests.

## Review loop (codex sol/medium)

- Iter 1: 7 findings → 6 fixed (7459979), 1 skipped by design (pager interaction logic — K1 plan mandates wholesale module move, public API unchanged).
- Iter 2: 5 findings (wrap_text nontermination, clippy type_complexity, palette exact-fit clip, İ lowercase-expansion miss, `--theme --flag` swallow) → fixed (2a230b1).
- Iter 3: 2 edge findings (combining mark severed on forced split, İ-shortcut false positive) → fixed (7aa6641).
- Iter 4: CLEAN (boundary probes + exhaustive 1.1M-expansion scan by reviewer).

## Skipped by design

- `Color::White` at header status_line: `Theme::runplan()` token set pins the pre-extraction palette; no token equals White — inventing one would break the pin.
- `cargo fmt --check` fails at base commit — pre-existing, out of scope.

## Environment notes

- Root repo flipped to bare + main advanced (obs-viz merge) mid-run by a concurrent session; work continued in recreated worktree from branch refs, zero loss.
- codex npm install broke mid-run (missing platform binary) — user reinstalled globally as root.
