Move the daemon's ConfigView renderer and readiness probes off webui.Server #1447
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#1447
Reference in new issue
Block a user
webui.Server still declares Cfg *config.Holder (internal/webui/server.go:44) with eight production read sites. The UI process never receives a holder -- compose() leaves it nil and TestComposeUIServerHoldsNoDaemonState fails if that changes -- so this is residue on the daemon side, not a live coupling.
It survives because internal/app/archied keeps a webui.Server (bootstrap.go:392, and bootstrap.go:1240 still does b.web.Cfg = b.d.Cfg) for two daemon jobs that have nothing to do with serving HTTP: building the published ConfigView snapshot (LocalConfigView, bootstrap.go:1353) and holding the readiness probes (readiness.go:31 reads b.web.Cfg.Get()).
Root-cause fix is a split at the producer, the same move already made for store contracts: the ConfigView DTO stays where the UI renders it, the builder moves to the daemon's configuration owner, and readiness stops hanging off a Server the daemon never serves. webui.Server then loses Cfg entirely, along with the eight nil-guarded degradation branches (api_config.go, api_tasks.go, api_logs.go, api_chat.go, api_setup.go, api_capabilities.go, server.go trustForwardedHeaders).
Note before starting: those branches are what the UI process runs today, since Cfg is nil there. Check each against the published ConfigView and the UI's own Options before deleting, because some of them (log file path, chat ShowToolCalls, TrustForwardedHeaders, the setup checklist, forge links on task rows) are dashboard behaviour that may currently be silently degraded in the extracted process. That overlaps the smoke suite still open on archie-core-8cda.5.6.
Recorded 2026-09-11 while landing the deletion-gate architecture test; see docs/prds/ui-service-boundary.md, 'Deletion gate: SATISFIED'.
Close reason
Landed as c2904da. webui.Server lost Cfg, ConfigProvenance, LastReload, ConfigOverrides and SetProvenance; LocalConfigView became the pure webui.BuildConfigView over a ConfigViewInput the daemon assembles (boot.configViewInput), and readiness/health moved onto boot fields (cfgHolder, channelManager, chat, healthRegistry). Boot owns one Holder; buildDaemon's b.web.Cfg = b.d.Cfg replacement dance is gone, and operator retry caps now follow reloads.
Per the bead's own note, each nil-guarded branch was checked before deletion rather than deleted wholesale. Two were degraded features, not dead code, and are now restored: ConfigView gained a chat section (show_tool_calls, operator, channel_configured) so the chat page expands tool calls and /api/setup renders its checklist in the extracted process. Asserted end to end in cmd/archie-ui/main_test.go. The PRD's 'two dashboard values still degrade' paragraph is updated.
Editable moved to handleConfig, decided by Server.UpdateConfig, so the pending write contract wires one field.
Side effects, both filed rather than dropped: overlay.Store gained Keys (Snapshot nests dotted keys, so the overridden list was publishing 'budgets' where the dashboard resets 'budgets.max_steps' -- fixed here with tests); multi-identity forge links went to archie-core-pv6t.
task check green.
Imported from beads
archie-core-ml30· GitHub #812 · type task · priority P2 · created 2026-09-11 · closed 2026-09-11sam wrote (originally 2026-09-11):
Investigation 2026-09-11 (verified against main @57d9be5).
Bead's premise holds, and the real scope is larger than "move two jobs off
webui.Server": the daemon never calls b.web.Handler(). Nothing in
internal/app/archied serves the dashboard (only archieui/run.go:79 does), so
b.web is a struct the daemon fills as a data carrier, not a server.
What the daemon actually reads off b.web:
readiness probe (readiness.go:31)
chatTaskActorAdapter (bootstrap.go:560)
LocalConfigView
What the daemon writes and nothing reads (dead production wiring):
frozen config.NewHolder(cfg), not the live holder)
Their three adapter files (skill_ui.go, memory_ui.go, curator_ui.go) exist
only to feed a Server that serves nothing.
Recommended shape (producer split, no new package):
BuildConfigView(cfg config.Config, opts ConfigViewOptions) ConfigView,
where opts carries provenance, overrides, reload status. The DTO and its
unexported helpers (reposView, providersView, lockedConfigKeys,
buildConfigSchema) stay put; only the *Server receiver goes. Server keeps
ConfigSource, which is all the UI needs.
directly; provenance moves to a boot field (b.currentProvenance already
exists as configuration.Provenance; convert at the publish site).
of b.web.*; the health registry becomes a boot field.
assignments and the three adapter files.
Behaviour delta for the UI process: none. Every branch deleted is already the
nil side there. Verified individually:
below it; the Cfg branch is daemon-only.
Cfg are both nil in the UI process).
reduces to s.Channels != nil, same value.
Options.TrustForwardedHeaders field.
fixing those means publishing the fields in ConfigView, which is the
separate projection work the PRD already names (archie-core-8cda.5.6).
Test fallout: archieui/compose_test.go:58 asserts srv.Cfg == nil and stops
compiling when the field goes. That clause should be deleted (structurally
impossible beats asserted), and the PRD's "Acceptance criterion 1 is amended"
paragraph updated to say the residue is gone.
Adjacent, out of scope, worth its own bead: UpdateConfig, ResetConfig and
UpdateRepoField are set only in webui's own tests. In production all three are
nil, so Editable is permanently false and the three write handlers always
answer 503. That is a whole descoped write surface still carrying handler and
test code.