feat(state): carry channel lifecycle from the Messaging Service to the dashboard

archie-core-8cda.6.8's carrier. The service now records channel lifecycle and has
nowhere to put it: /api/channels answered with nothing because
webui.Server.Channels had no production source, and reload answered 501 for the
same reason. This adds the surface the register decided on, following the split
archie-core-ymut established for config snapshots -- a pair of administrative RPCs
whose writer is one process and whose reader is the UI -- and wires both ends.

Wire and store: PutChannelStatus / ListChannelStatus, with ChannelStatus carrying
id, name, state, detail, configured, reload_supported and observed_at. The store
holds one row per channel and replaces the reported set, so a channel the reporter
no longer mentions is deleted rather than left standing as a stale "running"; an
empty report clears the table, because hosting no channels is a fact worth
reporting. A row without an id is refused: it could never be replaced or removed
by a later report.

Writer: the service publishes on every lifecycle transition through a coalescing
signal -- a burst of transitions is one write, since a reader only wants the latest
state of every channel -- plus a start-up report and a final report after shutdown,
so a stopped service leaves the store honest. A failed write is logged and retried
on the next signal; the dashboard losing channel state is worth a warning and never
worth failing a channel start over.

Reader: webui.Server.Channels becomes a source rather than a concrete manager, and
webui.RemoteChannelStatus reads the store the way RemoteConfigView reads the config
snapshot. A store it cannot reach reports nothing rather than a stale "running",
and a state the reader does not recognise is carried through rather than dropped.

The contract's own index gains the group in the same change that adds the RPCs --
a surface the grouped table does not list is one nobody finds -- and the count moves
to 51. The register records why the surface is the State Store rather than a
resource kind, and why reload gets its own surface rather than a field here: reading
status must not be able to retrigger an action, a transient request is not
distinguishable from state once anything polls it, and it would invert the
writer/reader relationship the precedent establishes.

Verified: task check exit 0. New coverage: the store's replace-the-set semantics
and its refusal of an id-less row, the reader's mapping including an unknown state,
and the publisher's start-up, transition and final reports.
This commit is contained in:
sam committed 2026-09-22 08:04:44 +10:00
1 parent fb265f2ad0
commit d6f526ce4f
23 files changed
+1445 -406

No files matched your search

+18 -6
View File
@@ -348,12 +348,24 @@ What that decides, so the implementation need not invent it:
change that adds the RPCs -- the table is the contract's own index, and a
surface it does not list is a surface nobody finds.
**Left open here, deliberately.** Reload runs the other way -- the UI asks the
service to reload a channel -- and the config-snapshot precedent only describes a
writer-to-reader direction. Two candidates: a second surface carrying a request
the service observes and clears, or a field on the same surface the service
watches. Deciding it now would be choosing a lifetime for a request queue by
analogy with a status report; they are not the same object.
**Reload gets its own surface, with its own lifetime (decided 2026-09-22).** Reload
runs the other way -- the UI asks the service to reload a channel -- and the two
candidates were a request surface the service observes and clears, or a field on
the status surface the service watches. It is the first. The reasoning, recorded
because it would look arbitrary later:
- A request queue and a status report do not share a lifetime, so they should not
share a surface. A pending request is transient and has an outcome; a channel's
state is durable and has a current value.
- A "please reload" field on the status resource makes READING status capable of
RETRIGGERING an action, and makes a transient request indistinguishable from
state the moment anything polls it.
- It would also invert the writer/reader relationship the precedent establishes:
the service would have to clear a field on an object whose whole contract is
that the service reports it.
So the status surface stays writer-is-service, and the request carrier is its own
object with its own states.
`archie-core-8cda.6.9`'s component self-report is the **same shape**: a process
reporting something about itself for the UI to read. Whether it shares this
+4 -1
View File
@@ -259,11 +259,14 @@ Methods are named after the store methods so the mapping is unambiguous. `workfl
| BindingTaskCreator | `EnqueueBindingTask` |
| Config snapshot | `PutConfigSnapshot`, `GetConfigSnapshot` |
| Apply status | `PutApplyStatus`, `ListApplyStatus` |
| Channel status | `PutChannelStatus`, `ListChannelStatus` |
| Task log | `ReadTaskLog`, `StreamTaskLogContent` |
That is **49 unique contract RPCs** across one service (the `TaskEvents.Close` method is dropped).
That is **51 unique contract RPCs** across one service (the `TaskEvents.Close` method is dropped).
`Close()` is **excluded** from the wire (it is server lifecycle, not a client call) — see §11.
The channel-status pair follows the config snapshot's split for the same reason: the writer is the process that HOSTS the channels -- the Messaging Service, which alone observes whether a channel is starting, running or failed -- and the reader is the UI process. Both RPCs are administrative, so a task-scoped grant reaches neither. A channel's state is runtime state rather than a settings document, which is why it is not a `ControlPlaneService` resource kind: a failed channel is not a document anybody edits. Asking for a reload travels on its own surface rather than through this one; see `docs/architecture/migration-decisions.md`, "Channel state to the dashboard".
The config-snapshot pair was added by `archie-core-ymut` (see
`docs/architecture/migration-decisions.md`, "Dashboard configuration page"). It is the one
surface whose writer is the daemon and whose reader is the UI process, and both RPCs are