From 96aa05c470b879188c9cda3838a6ab0e4be5547f Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Tue, 22 Sep 2026 08:10:01 +1000 Subject: [PATCH] fix(archieui): let the boundary guard permit a contract-backed channel reader The UI boundary test forbade wiring Server.Channels, and it was right about what the field used to hold: a live *status.Manager is a runtime handle this process has no business owning. It now holds a reader over the State Store's channel-status contract, which is the same shape as the Mappings, Bindings and ApplyStatus fields the guard already expects to be wired. The distinction it draws is the handle, not the name, so the assertion moves with the field and says why. Also adopts task fmt's rewrite of the reader's status construction: go fix drops the explicit embedded Descriptor, and formatter output is law here. --- internal/app/archieui/compose_test.go | 9 ++++++++- internal/webui/api_config.go | 14 ++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/internal/app/archieui/compose_test.go b/internal/app/archieui/compose_test.go index 1f899a33e..cd36972a0 100644 --- a/internal/app/archieui/compose_test.go +++ b/internal/app/archieui/compose_test.go @@ -82,7 +82,6 @@ func TestComposeUIServerHoldsNoDaemonState(t *testing.T) { "RunningVersions": srv.RunningVersions, "Events": srv.Events, "Curators": srv.Curators, - "Channels": srv.Channels, "LogFeed": srv.LogFeed, "WorkRequests": srv.WorkRequests, } @@ -91,6 +90,14 @@ func TestComposeUIServerHoldsNoDaemonState(t *testing.T) { t.Errorf("%s is wired; it is a daemon-owned callback or runtime handle with no contract behind it yet", name) } } + // Channels is the same shape as Mappings/Bindings below: the field used to + // hold a live *status.Manager, which is a runtime handle this process has no + // business owning, and it now holds a reader over the State Store's + // channel-status contract (webui.RemoteChannelStatus). The distinction the + // guard draws is the handle, not the name. + if srv.Channels == nil { + t.Error("Channels is unwired; the channel-status pair is a State Store contract the composed client implements") + } // Mappings and bindings are the other way round: ratified State Store // contracts, carried by the client this process already holds, so // leaving them nil would degrade two pages that have an owner. diff --git a/internal/webui/api_config.go b/internal/webui/api_config.go index a6aeb9c38..25e64115e 100644 --- a/internal/webui/api_config.go +++ b/internal/webui/api_config.go @@ -447,14 +447,12 @@ func (r remoteChannelStatus) Snapshot() []status.Status { out := make([]status.Status, 0, len(rows)) for _, row := range rows { out = append(out, status.Status{ - Descriptor: status.Descriptor{ - ID: row.ID, - Name: row.Name, - Configured: row.Configured, - ReloadSupported: row.ReloadSupported, - Detail: row.Detail, - }, - State: status.State(row.State), + ID: row.ID, + Name: row.Name, + Configured: row.Configured, + ReloadSupported: row.ReloadSupported, + Detail: row.Detail, + State: status.State(row.State), }) } return out