From a6af2c09ac2e7bcea2636d4e9e73a9efe6449b82 Mon Sep 17 00:00:00 2001 From: ruv Date: Sun, 4 Oct 2026 17:24:21 -0400 Subject: [PATCH] =?UTF-8?q?docs(adr):=20ADR-448=20=E2=80=94=20The=20Room,?= =?UTF-8?q?=20a=20shared=20console=20feed=20for=20humans=20and=20agents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proposes a new ruflo-console page that merges the Events feed, the Claude-control action log, and the existing broadcast/mission-aside/ mission-guide write actions into one place to watch and talk to the swarm. Grounded in a live trace of the console's single-slot pending confirm (runner.ts): two independent ways a confirm silently disappears today (no queue, and a >30s-late "yes" is dropped with no trace) were found while testing the four model tools end to end, and fixing the second (emit a ConsoleEvent on expiry) is included as the one behavioral change this ADR makes beyond adding the page. Co-Authored-By: RuFlo --- ...8-console-the-room-shared-activity-feed.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 v3/docs/adr/ADR-448-console-the-room-shared-activity-feed.md diff --git a/v3/docs/adr/ADR-448-console-the-room-shared-activity-feed.md b/v3/docs/adr/ADR-448-console-the-room-shared-activity-feed.md new file mode 100644 index 0000000000..8ab4c6eda2 --- /dev/null +++ b/v3/docs/adr/ADR-448-console-the-room-shared-activity-feed.md @@ -0,0 +1,75 @@ +# ADR 448: The Room — a shared live feed where a person, Claude and the swarm watch and talk to each other + +Status: Proposed + +Date: 2026 10 04 + +Scope: `plugins/ruflo-console`: new `hooks/views/room.ts`, `hooks/data/room.ts`; edits to `hooks/state.ts` (`ViewId`, `VIEWS`, `Pending`), `hooks/views/pane.ts` (`BODIES`), `hooks/runner.ts` (`ask`), `hooks/palette.ts` (three new ids), `hooks/model-tools.ts` (`console_state` reads the new feed). + +Builds on: ADR 407 (cockpit), ADR 416 (Timeline and Events — read-only, per-page), ADR 444 (Claude controls the console — the model tools and the pending-confirm contract this ADR extends). + +## 1. Why + +Testing the console's four model tools end to end (a full page sweep plus `console_set`/`console_run` probes, 2026-10-04) surfaced a real gap: a person asked the console to create a mission; a few minutes and several unrelated console actions later the pending confirm was simply gone — no mission, no error, nothing in `console_state` pointing at what happened to it. Tracing it through the source (`hooks/runner.ts`, `hooks/model-tools.ts`) found two independent ways that happens, both already in the shipped code, neither visible anywhere: + +- **`state.pending` is one slot, not a queue.** `ask()` (`runner.ts:141`) assigns it unconditionally. `model-tools.ts:276` *does* guard Claude's own `console_run` against clobbering a person's pending action ("never replaced, never cleared") — but nothing guards the reverse, and nothing guards a person's own second click. Two asks in a row anywhere in the console still only ever leave one pending. +- **A confirm older than 30 s is silently dropped.** `PENDING_TTL_MS = 30_000` (`runner.ts:15`); `confirm()` (`runner.ts:147-150`) nulls `state.pending` either way and only *speaks* the "more than 30 s, ask again" outcome into the console's own `say()` — which is local, transient UI text, not `state.outcome`, not `control.log`, not an event. A person who answers "y" a minute later sees it fail only if they were still looking at that exact screen; `console_state` afterward shows `waiting: null` with no trace that anything was asked, let alone refused. + +The console already has three real pages for *watching* (Timeline, Events, Approvals) and three real ways to *write into the room* (`broadcast`, `mission-aside`, `mission-guide` — ADR 406/443, `hooks/mission-palette.ts:34-35`, `hooks/palette.ts:136`). Nothing puts the two together, and nothing makes the one pending confirm — the single most consequential thing on screen — impossible to miss. The user asked for a dashboard that helps a human and the agents "see what's happening" and collaborate; this ADR is that page, built from what already exists rather than a fourth notification system (the claims lesson: don't build a fifth of something that already has four). + +## 2. What was checked + +- `hooks/state.ts:24` (`ViewId`), `:35` (`VIEWS`) and `hooks/views/pane.ts:62-91` (`BODIES`, the render dispatch) are the only three places a page is wired in; two letters are free on the tab row (`VIEWS` keys in use: `0-9 b c g q e w i z u f a l v t d m s`; `h j k n o p r x y` are not), so the new page needs no existing key moved. +- `hooks/watch.ts` + `hooks/views/manage.ts` (ADR 416) already hold `ConsoleEvent` history (300 kept, paged) and the per-lane busy/idle timeline; this ADR reads both, it does not re-collect them. +- `hooks/model-tools.ts:94` (`say`) already writes `control.log: ControlEntry[]` — every tool call Claude makes through the four `mcp__ruflo-console__` tools, with its outcome. That is exactly "what Claude is doing", already recorded, just not shown next to anything else. +- `hooks/palette.ts:68,136` and `hooks/mission-palette.ts:34-35`: `broadcast `, `mission-aside ` and `mission-guide ` are the three existing, already-confirm-gated ways something typed by a person reaches the hive or Claude. A fourth input box was rejected for the same reason the claims system is not getting a fifth tracker. +- Read `hooks/views/manage.ts`'s `timelineView`/`eventsView` in full: both are strictly read-only (ADR 416 §5), their one outward action is "ask Claude", itself gated. The Room differs on purpose: it is the one page meant to be written into, by a person or by an agent action that lands in it as a side effect. + +## 3. Decision + +### 3.1 The page + +A new view, `room` (`ViewId`, key `r`, icon `💬`, label "The Room", blurb "what the people and the agents here are saying and doing, live — and the one thing waiting for a yes"), `rows: 30`. Layout, newest first: + +1. **The pending banner, always first, bold, never scrolled past.** If `state.pending !== null`: its label, what it expects, which page raised it (`pending.view`), and **how old it is against the 30 s window** (`Date.now() - pending.askedAtMs`), so a person sees "22s — answer soon" instead of discovering the miss after the fact. This is the same data `pane.ts`'s confirm row already has; The Room is where it is unmissable instead of a line under whichever page happened to be open. +2. **Say something** — three fields, not a new one: the existing `broadcast`, `mission-aside` and `mission-guide` palette entries, run exactly as `/ruflo run ` would (`console_run`'s own contract). Each still asks first, per its existing class; the Room adds no bypass. +3. **The feed** — one merged, chronological list: + - every `ConsoleEvent` from `watch.ts` (swarm, claim, memory, mod — unchanged from Events), tagged by kind as today; + - every `ControlEntry` from `control.log` (Claude's own tool calls and their outcome — unchanged from the Claude-control section on Overview, ADR 444 §3), tagged `🤖 claude`; + - the three text actions above, tagged by who sent them, the moment they're confirmed. + + Same mechanics as Events (ADR 416 §2.2): kind chips, find, pause/resume, paging — reused, not reinvented, because Events already solved "a feed too long to read live." +4. **Who's here** — the per-lane busy/idle summary `timelineView` already computes (`manage.ts:27-57`), condensed to one line per lane (name, busy % of the last 15 min, last tool call), each with the existing "✦ ask Claude" button. + +### 3.2 The one behavioral fix this ADR makes (not just a new page) + +An expired confirm must leave a trace. `confirm()` (`runner.ts:147-150`) gains one line: when `isFresh` is false, push a `ConsoleEvent` ("a confirm for '