Skip to content

feat(cli): keel tui — live read-only operator dashboard - #140

Merged
eaitbrahim merged 1 commit into
mainfrom
feat/tui-dashboard
Jul 24, 2026
Merged

feat(cli): keel tui — live read-only operator dashboard#140
eaitbrahim merged 1 commit into
mainfrom
feat/tui-dashboard

Conversation

@eaitbrahim

Copy link
Copy Markdown
Contributor

What

Adds keel tui — a full-screen, auto-refreshing, read-only terminal dashboard for watching a running agent / the funded paper-forward at a glance. It is built directly on the pure gather_status(...) -> StatusReport that keel status (PR #138) was deliberately left as the substrate for, and is strictly a view over that same report (it never re-derives Rail 11 / freshness / autonomy logic).

Shows: mode, kill-switch, autonomy, Rail 11 drawdown/equity state, open positions (bracket-less positions flagged), rule counts + live rules, per-product data freshness (stale series flagged), and subscriptions — colour-coded and refreshed on an interval.

Why now

The funded paper-forward (5-trend Turtle, $10k + $500/mo) is live and accrues trades toward the n=100 floor over months. Watching it meant re-running keel status by hand; this is the auto-refreshing dashboard the user asked for, and it's unblocked today — no monorepo split or keel-client protocol needed.

Design

  • Pure, testable core: build_screen/render_plain/_freshness_style are pure functions of the StatusReport; the curses I/O (_paint/run_live) is a thin layer tested against a fake stdscr.
  • No new dependency: stdlib curses only, in keeping with the project's hand-rolled ethos (no rich/textual). curses is imported lazily so the module stays importable and the core tests stay portable.
  • Strictly read-only: NEVER calls the broker or touches the network; cannot confirm/kill/arm anything (that's a separate, larger, gated feature).
  • Operational robustness: --once renders one frame to stdout (pipes/CI); --interval N sets cadence; the live loop re-opens the repo each poll (so it reflects a separate keel agent's committed writes) and survives a transient DB read error (e.g. database is locked from the writer) by painting an alert line instead of crashing.

Testing

  • 39 new tests (tests/commands/test_tui.py); full suite 1519 passed, ruff check clean.
  • Includes regression guards for two issues an independent review caught: colour was silently disabled (missing use_default_colors()-1 background illegal under curses.wrapper), and the live loop crashing on a transient SQLite lock.
  • keel tui --once verified against the real keel.db.

Design spec: docs/superpowers/specs/2026-07-24-tui-dashboard-design.md

🤖 Generated with Claude Code

A full-screen, auto-refreshing terminal dashboard built directly on the
pure `gather_status(...) -> StatusReport` that `keel status` (PR #138) was
left as the substrate for. It is strictly a *view* over the same report:
mode, kill-switch, autonomy, Rail 11 drawdown/equity, open positions, rule
counts, per-product data freshness and subscriptions, colour-coded and
refreshed on an interval so an operator can watch the funded paper-forward
at a glance.

- Pure, testable core (`build_screen`/`render_plain`/`_freshness_style`);
  never re-derives Rail 11 / freshness / autonomy logic.
- stdlib `curses` only — no new dependency (in keeping with the project's
  hand-rolled ethos). `curses` imported lazily so the module stays
  importable and the pure-core tests stay portable.
- Strictly read-only: NEVER calls the broker or touches the network, and
  cannot confirm/kill/arm anything.
- `--once` renders a single frame to stdout (pipes/CI); `--interval N`
  sets the refresh cadence; the live loop re-opens the repo each poll (so
  it reflects a separate `keel agent`'s committed writes) and survives a
  transient DB read error by painting an alert instead of crashing.

39 new tests. Design spec: docs/superpowers/specs/2026-07-24-tui-dashboard-design.md

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@eaitbrahim
eaitbrahim merged commit 5abb368 into main Jul 24, 2026
1 check passed
@eaitbrahim
eaitbrahim deleted the feat/tui-dashboard branch July 24, 2026 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant