repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Close the reattach gap in the RPC frontend surface

90023a9e91489488fdfa49e87d7d08815fcfe118

Claude <noreply@anthropic.com> ·

SSH signature · not checked

Browse filesCompare with HEAD

p28 proved a full UI is buildable on smith rpc for a client present
from the start, but disproved it for mid-session attach: the
notification stream is a live tail with no replay, so a late client
cannot rebuild the steering queue and run status, which are ephemeral
and never persisted. §10.4 gains session/snapshot for exactly that
ephemeral state, names the two notification payloads the reconstruction
leans on (session_compact covered span, session_tree node), and fixes
cost/context as poll-only for v1. The completeness claim moves from
prototype-gated to proven-with-additions.

Edits SPEC §10.4 and the p28 result block in prototypes/PLAN.md.

Changed files (2)

+39 / −8 text lines

Diff layout

docs/SPEC.md

Modified

+24 / −8 text lines

24112411 client can answer block/allow/replace. A pure observer client that
24122412 registers nothing still needs the reverse channel for these.
24132413- **A driver namespace has no §9.10 origin** and is RPC-only: `session/open`,
2414 `session/attach`, `session/list`, `session/dump`, `session/fork`,
2415 `session/subscribe`, `prompt/submit`, `command/run`. Lua never needs these
2416 because a plugin already runs inside a live session; an RPC client must
2417 drive one from outside.
2414 `session/attach`, `session/list`, `session/dump`, `session/snapshot`,
2415 `session/fork`, `session/subscribe`, `prompt/submit`, `command/run`. Lua
2416 never needs these because a plugin already runs inside a live session; an RPC
2417 client must drive one from outside. `session/dump` returns persisted state
2418 (transcript, tree, leaf, folds); `session/snapshot` returns the *ephemeral*
2419 process state a live tail cannot replay — the steering/follow-up queue
2420 (§6.1) and in-flight run status — which a mid-session attach needs and which
2421 is never a session entry (prototype-proven, p28).
24182422- **Lua-runtime-only surfaces are omitted** in headless RPC: `tui`,
24192423 `shortcut` (no terminal, no keyboard).
24272431(§9.8). It is an adapter, not a mirror, by three rules: non-blocking events
24282432project to notifications; blocking events (`tool_call`, `session_before_*`)
24292433project to server→client requests the client answers; and frontend-private
2430`EngineEvent` variants (TUI-internal UI state) are omitted. Whether this
2431adapter is *complete* — every externally-meaningful `EngineEvent` reaching a
2432frontend that needs it — is prototype-gated (p28); p24 proved the projection
2433mechanics, not sufficiency for a full alternative UI.
2434`EngineEvent` variants (panel toggle, resize, selection/focus/scroll) are
2435omitted. Prototype-proven sufficient for a full alternative UI (p28: a headless
2436client reconstructed transcript, tools, steering queue, tree/leaf, model, cost,
2437fold, and secret placeholders from the wire alone), subject to:
2439- two notification payload guarantees the reconstruction depends on —
2440 `session_compact` carries the covered span `{summary_id, start, end}` (the
2441 fold is assembly-time and storage-invisible, §6.9), and `session_tree`
2442 carries `{id, parent, kind}` plus the leaf (branches are emergent, §6.5);
2443- `session/snapshot` for mid-session attach, since the live notification tail
2444 has no replay and the steering queue + run status are ephemeral (above);
2445- cost/context is poll-only via `getContextUsage` in v1 (no push event); a
2446 `context_usage` notification may be added if a live indicator warrants it.
2448Secret plaintext never crosses the wire — only `smith:sec:N` placeholders and
2449their labels (§6.7), tap-verified in p28.
24352451## 11. Security Model

prototypes/PLAN.md

Modified

+15 / −0 text lines

20002000Upgrade the §10.4 completeness claim from p28-gated to proven, or add the
20012001missing driver methods / event projections the spike finds.
2003### Result
2005Status: complete. Proved: a headless client reconstructs a full session's
2006`UiState` (transcript with reassembled deltas, tool views, steering queue,
2007tree/leaf, model, cost, fold, secret labels) deep-equal to ground truth from
2008the RPC stream alone; 34 EngineEvent variants classify as 25 notification / 4
2009request / 5 frontend-private; blocking `tool_call` round-trips; secret
2010plaintext never crosses the wire. **Disproved**: the sufficiency claim for
2011mid-session ATTACH — the live tail has no replay, so a late client cannot
2012rebuild the ephemeral steering queue + run status (never a session entry;
2013`session/dump` covers persisted state only). Folded into §10.4: added
2014`session/snapshot`, two notification payload guarantees (`session_compact`
2015span, `session_tree` node), poll-only cost/context for v1. Spec issues: P2
2016session/snapshot, P2 payload guarantees, P3 cost/context push.
20032018## Reporting Template
20052020Each completed prototype updates this plan with a result block in the