docs: describe the push_todo lifecycle-notice migration

This commit is contained in:
damocles 2026-08-02 23:48:53 +02:00 committed by mara
commit 601cd295e5
2 changed files with 28 additions and 32 deletions

View file

@ -132,8 +132,8 @@ without it has nothing of its own to withdraw.
`InitConfig` approvals seed a brand-new agent's proposed config repo.
On approve, hive-c0re seeds it with a default `agent.nix` template and
sends `HelperEvent::ConfigReady { agent }` to the submitting agent's
inbox via `notify_submitter`. The submitting agent reviews, edits, and
pushes a todo (`push_todo_submitter`) into the submitting agent's
in-container store. The submitting agent reviews, edits, and
commits the template; the operator then **spawns** the agent (the
`Spawn` approval / `◆ R3QU3ST SP4WN` button), which creates the
container from that config. From then on, config changes go through a
@ -626,12 +626,6 @@ root agent. Variants (`hive_sh4re::HelperEvent`):
- `ApprovalResolved { id, agent, commit_ref, status, note }`
fired by `actions::approve` + `actions::deny` whenever an
approval transitions to its terminal state.
- `Rebuilt { agent, ok, note }``auto_update::rebuild_agent`
(covers startup scan + manual `/rebuild` from dashboard) +
the `MergeConfigPr` deploy.
- `Killed { agent }` — admin `HostRequest::Kill` + dashboard
`/kill` + the `Kill` MCP tool.
- `Destroyed { agent }``actions::destroy`.
- `ContainerCrash { agent, note }``crash_watch`: a previously-
running container went away with no operator-initiated transient
state (Stopping / Restarting / Destroying / Rebuilding) AND no
@ -640,16 +634,6 @@ root agent. Variants (`hive_sh4re::HelperEvent`):
lifecycle op finishes between two crash-watch polls and the
container shows briefly as "stopped without transient" before
the next start). The root agent can `start` it again or escalate.
- `NeedsLogin { agent }` — sub-agent has no claude session yet.
The root agent can't act directly (interactive OAuth); typically flags
the operator.
- `LoggedIn { agent }` — sub-agent just completed login. The root agent
often greets the agent on this event.
- `ConfigReady { agent }` — a new agent's proposed config repo was
just seeded (post-`InitConfig` approval). The root agent can now
edit `/agents/<agent>/config/agent.nix`, commit the changes, and
hand off to the operator to **spawn** the agent (the `Spawn`
approval creates the container from that config).
- `NeedsUpdate { agent }` — sub-agent's recorded flake rev is
stale. The root agent calls `update(name)` to rebuild — idempotent,
no approval required.
@ -662,20 +646,33 @@ root agent. Variants (`hive_sh4re::HelperEvent`):
The recipient responds via `Answer { id, answer }` and the
asker sees the matching `QuestionAnswered`.
Optional `sha` field on `ApprovalResolved` and `Rebuilt` carries the
canonical hive-c0re-vouched commit sha. Optional `tag` on the same two
carries the deploy bookkeeping tag — `deployed/<id>` on a successful
build or `failed/<id>` on a failed one, planted by the `MergeConfigPr`
deploy. Both fields are `Option`: `None` on the paths that don't deploy
a new commit (spawn / init_config / meta-update / deny, and
The rest of the original lifecycle notices — `Rebuilt`, `Killed`,
`Destroyed`, `NeedsLogin`, `LoggedIn`, `ConfigReady` — were pure "FYI,
check when convenient" events with no reason to drive an immediate
turn, so they've been migrated off `HelperEvent` onto
`push_todo`/`push_todo_submitter` (see above): `agent_todo_socket`
push instead of a broker message, `subsystem = "core"`,
`key = "<event>:<agent>"` for dedup, one free-text `summary` in place
of the old structured fields (`rebuilt_todo_summary` renders
`Rebuilt`'s former `ok`/`note`/`sha`/`tag` into that string).
Optional `sha` field on `ApprovalResolved` carries the canonical
hive-c0re-vouched commit sha. Optional `tag` carries the deploy
bookkeeping tag — `deployed/<id>` on a successful build or
`failed/<id>` on a failed one, planted by the `MergeConfigPr` deploy.
Both fields are `Option`: `None` on the paths that don't deploy a new
commit (spawn / init_config / meta-update / deny, and
`auto_update::rebuild_agent` reapplying the existing main, or the
dashboard `↻ R3BU1LD` button when the lock didn't move). When set,
`git show <sha>` against `/agents/<n>/applied.git` inside the
bootstrap container yields the exact tree that was referenced.
To add a new event: new `HelperEvent` variant + call sites + update
`prompts/system.md` (`<!-- role:manager -->` block, the lifecycle-
event list) so the root agent knows the new shape.
To add a new lifecycle notice: if it needs to drive an immediate turn
(a live conversation like `Ask`/`Answer`, or something genuinely
urgent), add a `HelperEvent` variant + call sites + update
`prompts/system.md`'s message-event list. If it's "FYI, check when
convenient," call `push_todo`/`push_todo_submitter` directly instead —
no new wire type needed.
## Auto-update on startup