feat(messaging): restart only the channel whose settings changed

archie-core-zfb0.4. Channel settings were restart-required as a whole: a
change to one channel needed a process restart that restarted every channel.

The Messaging Service now reconciles the stored channel-settings resource on
the apply-status restamp interval (docs/prds/plugin-settings-live.md), re-layers
it over the file document exactly as boot does, and restarts only the channel
whose transport settings changed. Every other channel keeps serving.

A restart is stop-and-start, not an in-place reload: each channel gets its own
supervisor and a rebuild factory, so email and webhook -- which have no reload
seam -- are restarted too. Telegram's Start still calls dropPendingUpdates
before it long-polls, so the rule holds on the reconcile path as on /restart. A
replacement is built before the running channel is touched, so a configuration
this build cannot run leaves the running channel serving.

The composed set and the bound listen addresses are process bindings: enabling
or disabling a channel, or changing chat.webhook_addr / chat.email.listen_addr,
is refused and reported for a restart rather than applied. A channel rebuild
that fails is not recorded as applied, so it is retried on the next tick. The
applied version reaches apply status, and ChannelSettingsKind flips to live.

Files: internal/app/archiemessaging/{compose,reconcile,supervise,run}.go,
controlplane ApplyMode, archied runtime watch, configuration.md, the config
skill matrix and the regenerated dev-docs artifact.

Verified: go test ./internal/app/archiemessaging/... (race clean); go test
./cmd/archie-messaging/... ./internal/app/controlplane/... ./internal/app/archied/...
./internal/config/...; go vet and golangci-lint run on those packages (0 issues);
go fix ./... and golangci-lint fmt produced no diff; task docs:artifact:check.
This commit is contained in:
sam committed 2026-10-02 11:31:05 +10:00
1 parent cd878f3c4d
commit 9ccb6e2418
14 files changed
+848 -100

No files matched your search

+13 -9
View File
@@ -335,17 +335,21 @@ Two properties matter to anyone changing this area:
query, so boot records the last published settings and the reload re-applies
them from there.
- **Live kinds arrive on a watch.** Provider settings, model role assignments,
repository policies and scheduling policy are `ApplyMode: live`
(archie-core-zfb0.1): the daemon keeps a watch per kind and, on a new
version, re-runs `boot.runtimeConfig` over the published snapshot and
repository policies, scheduling policy, plugin settings, review settings and
channel settings are `ApplyMode: live`: the daemon keeps a watch per kind and,
on a new version, re-runs `boot.runtimeConfig` over the published snapshot and
republishes through `config.Holder`. A candidate the layered document cannot
run is refused before it is published — last-known-good keeps running and
the refusal is reported through apply status. The kinds stay
restart-required while a startup-built component still holds their value
(tool, plugin, container and channel settings today); a kind joins the live
list only with a consumer that re-reads it, and the model/provider half of
it also rebuilds the gateway chat runtime's provider set and the chat model
list the chat surfaces offer.
the refusal is reported through apply status. A kind whose consumer lives in
another process reconciles there too: `archie-messaging` re-reads the stored
channel settings on the apply-status restamp interval and restarts only the
channel whose transport settings changed, while the listen addresses it has
bound and the set of channels it composed stay process bindings that take
effect on restart. A kind joins the live list only with a consumer that
re-reads it; one whose startup-built consumer never does stays
restart-required, and the model/provider half of the live set also rebuilds
the gateway chat runtime's provider set and the chat model list the chat
surfaces offer.
## Completion criteria