Alice TUI/CLI → Ultra-Ideal (#489) — master plan
Date: 2026-06-16 · Owner: Tycho · Source: NAO directive 2026-06-16 ("красиво и приятно по цветам, пару тем светлых/тёмных, украсть у топовых, до ультра идеала, супер-полезные команды, ВСЕ конфиги → hot-reload + командами/самой Алисой, auto-mode + permissions, и всё всё").
Backed by the ranker competitor scan (openalice-ranker/data/reports/) + claude-code-changelog + openfang/openhands/opencode/gemini-cli/codex review.
Where Alice already wins (don't rebuild)
- TUI framework: ratatui 0.29 retained-mode — stronger base than claw-code (raw crossterm) and Hermes (Ink/React two-process).
- @-context picker (3 tabs File/Memory/Worker +
#L10-L20line ranges) — richer than both Hermes and claw-code. - Shipped: multi-pane (sessions/memory/tool-feed), 7 slash commands, streaming, input modes (Normal/AutoAccept/Plan enum), cockpit Phase-A/B, theme module scaffold (
ui/theme.rs),!shell-exec (this wave, commit fbb4e496e).
The gaps (ranked, with who has it)
Phase A — THEME SYSTEM (highest visible win)
Today ui/theme.rs is one hardcoded ANSI-16 palette. Target = a real theme system like OpenCode (11 JSON themes) / Claude Code (/theme + color editor) / Codex (/theme + schema).
- A1. Named-theme registry with light AND dark built-ins. Steal palettes:
tokyonight, catppuccin(+macchiato), gruvbox, nord, everforest, one-dark, ayu, kanagawa(OpenCode set) + a clean light (catppuccin-latte/ayu-light). - A2.
/themeslash command → picker overlay (type-to-filter, live preview). - A3. Custom themes as JSON at
~/.config/openalice/themes/<name>.json(global) and.openalice/themes/(project), truecolor with ANSI-16 fallback. - A4. Light-ANSI correctness (the Claude Code 2.1.144 invisible-diff-line bug: never render near-bg-on-bg).
- Files:
crates/tui/src/ui/theme.rs(registry), newui/theme_picker.rsoverlay,commands.rs(+theme), config binding (Phase C).
Phase B — PERMISSIONS + AUTO-MODE
Alice has the InputMode enum (Normal/AutoAccept/Plan) but no enforcement/UI.
- B1. Adopt the clean 4-mode enum (gemini-cli):
default / auto_edit / yolo / plan. Map onto existing InputMode;planblocks writes even when an allow-rule matches (Claude Code 2.1.154). - B2. Interactive approval overlay (once / session / always / deny, number-key select) — Hermes
prompts.tsx. Wire to a pending-approval queue. - B3. Sensitive-file write guard — always prompt before exec-granting build configs (
.npmrc,.bazelrc,.pre-commit-config.yaml,.devcontainer/) + shell startup files (.zshenv,.bash_login), even under auto-accept (CC 2.1.136/160). - B4. Parameter-level + wildcard rules:
Tool(param:value),WebFetch(domain:*.x),Read(secrets-*/config.json)(CC 2.1.178/169). - B5. Approvals as a CLI noun:
alice-cli approvals list|approve|reject --json(openfang) for out-of-band grant. - B6. Budget/iteration kill-switch in config:
max_budget_per_task,max_iterations(openhands[core]). - B7 (stretch). Configurable risk classifier
security_analyzer = heuristic|llmdeciding approve/deny, not just static allowlists (openhands[security]).
Phase C — CONFIG: everything → config, hot-reload, command/self-editable
Phase 9 oa.yaml + ConfigResolver already exist (#442/#457). Extend to "all params live in config, hot-reloadable, editable by command or by Alice".
- C1. Audit every tunable currently behind an env var or constant → promote into
oa.yamlwith a typed key + default + doc-comment. (Self-documenting, alphabetized, sectioned — openhandsconfig.template.tomlhouse style.) - C2. Hot-reload on file change (notify watcher) — already partially in the ConfigResolver; verify it covers the TUI + runtime knobs.
- C3. `alice-cli config get|set|edit|validate|diff` (exists, Phase 9a) + `alice-cli doctor --fix` (openfang) self-heal.
- C4. In-TUI `/config` settings screen (openfang
settings.rs): editable provider keys, model catalog (context+cost), live provider health/latency probe. - C5. Alice-self-editable config — a guarded tool so Alice can change her own parameters on request (already has memory/charter; extend to config keys with an allowlist + audit).
- C6.
fallbackModelchain +availableModels/enforceAvailableModelsallowlist (CC 2.1.166/175) — governable, resilient model choice.
Phase D — USEFUL COMMANDS + SURFACE
- D1. Steal slash commands:
/doctor(health flat-tree),/simplify(cleanup-only review),/effort(persist-as-default),/resume(fuzzy session picker that ACTUALLY loads history — Alice's sidebar currently lists but doesn't open: "M9 deferred"),/export(transcript→markdown),/side(scope-fork side conversation). - D2. Streaming markdown + syntax highlighting (pulldown-cmark + syntect — steal from claw-code
render.rs, same language). Today Alice streams plain text. - D3. Security-posture dashboard (
/security) — active features grouped Core/Configurable/Monitoring incl. prompt-injection scanner + audit trail (openfang). - D4. Quick wins:
Ctrl+Ocopy last response (SSH-safe),Ctrl+Rslash-history reverse-search,Ctrl+Gopen$EDITOR, mouse click/scroll.
Execution order
A (themes, visible) → B (permissions, safety) → C (config, depth) → D (commands). Each phase ships independently with tests; no phase blocks the prod path (TUI is a dev surface). Build is now fast (thin-LTO + sccache, commit 36940232d).
Already shipped this wave
!shell-exec prefix (fbb4e496e) — Phase D quick win, first slice.