events.sqlite vacuum moves host-side

retention is a host concern — agents have no business doing their
own cleanup, and a misbehaving harness could skip it. drop
spawn_events_vacuum from both hive-ag3nt and hive-m1nd, drop the
matching Bus::vacuum + EventStore::vacuum methods. new
hive_c0re::events_vacuum module sweeps every existing
agents/<name>/state/hyperhive-events.sqlite on the same hourly
cadence as the broker vacuum. same two-stage delete (older than 7
days, trim to 2000 newest). called from main alongside broker
vacuum.

also: server-side state badge entered into todo.md (today's badge
is derived client-side from sse, fine for idle/thinking but a
state machine that grows compacting/napping wants authoritative
status from the harness).
This commit is contained in:
müde 2026-05-15 20:10:34 +02:00
parent 897e7c07ae
commit 89ccc5e6c5
6 changed files with 89 additions and 63 deletions

17
TODO.md
View file

@ -34,6 +34,23 @@ Pick anything from here when relevant. Cross-cutting design notes live in
`napping 😴` once the `/compact` trigger and `nap` tool exist —
both need a harness signal (an explicit `LiveEvent::StateChange`
variant or piggyback on Note).
- **Server-side state badge.** Today the badge is computed client-side
from `turn_start`/`turn_end` events. On page reload mid-turn the
history replay re-derives it, but with a `compacting` / `napping`
state coming and a non-trivial state machine it's better to track
authoritative state in the harness and expose it via
`GET /api/state` (`status: "thinking" | "idle" | "compacting" |
"napping"`). JS just renders. Drops the
derive-from-events-and-pray code path.
- **Terminal: inline diffs for Write/Edit.** Today a `Write` /
`Edit` tool-use row just shows the file path. Render the actual
change inline in the terminal: for `Edit`, a small `+`/`-`
per-line diff between `input.old_string` and `input.new_string`;
for `Write`, the first few lines of `input.content` (it's all
"+"). Keep collapsed by default (`<details>` like the existing
tool_result rollups), expand to full diff on click. Color via
the same `.diff-add` / `.diff-del` classes the dashboard
approval diff already uses.
- **Terminal: `/model` slash command.** Operator-typeable model
override from the terminal. Depends on the model-override work
above; once an override mechanism exists, wire a `/model <name>`