Phase 3: Extract the UI Service #114

Closed
opened 2026-10-27 13:35:00 +00:00 by sam · 1 comment
Owner

Third extraction in the resolved order. By this phase UI is finally a
genuinely thin client: internal/webui serves the SPA from ui/dist and
calls Gateway's ChatContract (Phase 1) and State Store's read contracts
(Phase 2) instead of holding internal objects or importing internal/store
directly.

This closes the last verified coupling from the PRD's "Why this shape"
section: bootstrap.go:1239's shared config.Holder ("web and the daemon
must share ONE Holder", bootstrap.go:1236, handed to webui at
bootstrap.go:336). Under this phase each service owns its own
configuration surface -- nothing shares a live in-process struct across a
service boundary because there is no longer a shared process for UI.

Depends on Phase 2 (State Store) per the resolved extraction order -- UI
needs both ChatContract (Phase 1) and the State Store's read contracts
(Phase 2) available before it can become a peer rather than an
in-process consumer.

Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1
(Phase 3 section) and the PRD's target-services table entry for UI
Service.

Acceptance criteria

  • [amended 2026-09-11] The UI Service process no longer receives the
    daemon's live config.Holder; it owns its own configuration surface and
    renders configuration from the published ConfigView snapshot, so no live
    struct crosses the service boundary. (Original wording: "internal/webui
    (or a new UI Service binary/process) no longer receives the daemon's live
    config.Holder". Amended to name the process rather than the package: the
    internal/webui package still declares Cfg because the daemon reuses its
    Server type as a local ConfigView renderer and readiness-probe holder.
    That is residue inside the daemon's own process, tracked by
    archie-core-ml30, not a coupling between services. Verified by
    internal/app/archieui/TestComposeUIServerHoldsNoDaemonState, and by the
    daemon serving no dashboard listener at all.)
  • internal/webui's chat and task paths call Gateway's ChatContract and
    State Store's contracts exclusively -- no remaining direct references
    to gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry or
    internal/store types. (Verified: go list -deps ./internal/webui links
    no banned runtime package, and cmd/archie-ui/architecture_test.go
    re-runs that gate on every task check.)
  • [amended 2026-09-11] The UI Service can start and serve ui/dist against a
    remote Gateway and State Store. (Original wording said "with mode =
    "remote" for both contracts"; no mode field was ever added -- the
    empty-target local fallback was deleted in Phase 2, so remote is the only
    mode and [services.*].target is required.)
  • task check and task ui pass; the dashboard's existing pages (tasks,
    logs, health) continue to work end-to-end against the now-remote
    contracts. (Verified: task check exit 0; task ui exit 0 with ui/dist
    unchanged; cmd/archie-ui/main_test.go drives the real binary over HTTP
    against a live Gateway and State Store.)

Close reason

Phase 3 complete. All four acceptance criteria verified against code: (1) the UI process receives no config.Holder (TestComposeUIServerHoldsNoDaemonState) and the daemon serves no dashboard listener -- the only dashboard http.Server is internal/app/archieui/run.go:86; criterion amended to name the process, with the daemon-side webui.Server ConfigView-renderer residue tracked in archie-core-ml30 (P2, daemon-internal, not a cross-service coupling). (2) go list -deps ./internal/webui links no banned runtime package; no gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry refs; no internal/store or internal/gateway import. (3) UI serves ui/dist against remote Gateway + State Store; 'mode = remote' amended -- no mode field exists, remote is the only mode since the Phase 2 local fallback was deleted. (4) task check exit 0, task ui exit 0 with ui/dist unchanged, cmd/archie-ui/main_test.go drives the real binary over HTTP against live dependencies. Deletion gate enforced on every check. Unblocks archie-core-8cda.6 (Phase 4).


Imported from beads archie-core-8cda.5 · GitHub #746 · type task · priority P3 · created 2026-09-05 · closed 2026-09-11

Third extraction in the resolved order. By this phase UI is finally a genuinely thin client: internal/webui serves the SPA from ui/dist and calls Gateway's ChatContract (Phase 1) and State Store's read contracts (Phase 2) instead of holding internal objects or importing internal/store directly. This closes the last verified coupling from the PRD's "Why this shape" section: bootstrap.go:1239's shared config.Holder ("web and the daemon must share ONE Holder", bootstrap.go:1236, handed to webui at bootstrap.go:336). Under this phase each service owns its own configuration surface -- nothing shares a live in-process struct across a service boundary because there is no longer a shared process for UI. Depends on Phase 2 (State Store) per the resolved extraction order -- UI needs both ChatContract (Phase 1) and the State Store's read contracts (Phase 2) available before it can become a peer rather than an in-process consumer. Full reasoning: docs/inspiration/service-decomposition-open-questions-research-2026-09-05.md#1 (Phase 3 section) and the PRD's target-services table entry for UI Service. ### Acceptance criteria - [amended 2026-09-11] The UI Service process no longer receives the daemon's live config.Holder; it owns its own configuration surface and renders configuration from the published ConfigView snapshot, so no live struct crosses the service boundary. (Original wording: "internal/webui (or a new UI Service binary/process) no longer receives the daemon's live config.Holder". Amended to name the process rather than the package: the `internal/webui` package still declares Cfg because the daemon reuses its Server type as a local ConfigView renderer and readiness-probe holder. That is residue inside the daemon's own process, tracked by archie-core-ml30, not a coupling between services. Verified by internal/app/archieui/TestComposeUIServerHoldsNoDaemonState, and by the daemon serving no dashboard listener at all.) - internal/webui's chat and task paths call Gateway's ChatContract and State Store's contracts exclusively -- no remaining direct references to gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry or internal/store types. (Verified: `go list -deps ./internal/webui` links no banned runtime package, and cmd/archie-ui/architecture_test.go re-runs that gate on every `task check`.) - [amended 2026-09-11] The UI Service can start and serve ui/dist against a remote Gateway and State Store. (Original wording said "with mode = \"remote\" for both contracts"; no `mode` field was ever added -- the empty-target local fallback was deleted in Phase 2, so remote is the only mode and [services.*].target is required.) - task check and task ui pass; the dashboard's existing pages (tasks, logs, health) continue to work end-to-end against the now-remote contracts. (Verified: `task check` exit 0; `task ui` exit 0 with ui/dist unchanged; cmd/archie-ui/main_test.go drives the real binary over HTTP against a live Gateway and State Store.) ### Close reason Phase 3 complete. All four acceptance criteria verified against code: (1) the UI process receives no config.Holder (TestComposeUIServerHoldsNoDaemonState) and the daemon serves no dashboard listener -- the only dashboard http.Server is internal/app/archieui/run.go:86; criterion amended to name the process, with the daemon-side webui.Server ConfigView-renderer residue tracked in archie-core-ml30 (P2, daemon-internal, not a cross-service coupling). (2) go list -deps ./internal/webui links no banned runtime package; no gateway.Router/SessionStore/Turns/ModelManager/PersonaRegistry refs; no internal/store or internal/gateway import. (3) UI serves ui/dist against remote Gateway + State Store; 'mode = remote' amended -- no mode field exists, remote is the only mode since the Phase 2 local fallback was deleted. (4) task check exit 0, task ui exit 0 with ui/dist unchanged, cmd/archie-ui/main_test.go drives the real binary over HTTP against live dependencies. Deletion gate enforced on every check. Unblocks archie-core-8cda.6 (Phase 4). --- _Imported from beads `archie-core-8cda.5` · GitHub #746 · type task · priority P3 · created 2026-09-05 · closed 2026-09-11_
sam added the lowtask labels 2026-10-27 13:35:00 +00:00
sam self-assigned this 2026-10-27 13:35:00 +00:00
sam closed this issue 2026-10-27 13:35:00 +00:00
Author
Owner

sam wrote (originally 2026-09-11):

2026-09-11: child .5.6 closed. The UI process side of Phase 3 is done and now fenced: deletion gate enforced on every task check, real-process smoke suite green, task check exit 0.

Left open on purpose. Acceptance criterion 1 says internal/webui no longer receives the daemon's live config.Holder. The UI process does not (compose leaves Cfg nil, TestComposeUIServerHoldsNoDaemonState fails if that changes), but internal/app/archied/bootstrap.go:1240 still runs b.web.Cfg = b.d.Cfg for the webui.Server the daemon keeps as its ConfigView renderer and readiness-probe holder. archie-core-ml30 is that split. Close this once ml30 lands, or amend the criterion to name the UI process rather than the package if the daemon-side renderer is considered out of scope.

_sam wrote (originally 2026-09-11):_ 2026-09-11: child .5.6 closed. The UI process side of Phase 3 is done and now fenced: deletion gate enforced on every task check, real-process smoke suite green, task check exit 0. Left open on purpose. Acceptance criterion 1 says internal/webui no longer receives the daemon's live config.Holder. The UI process does not (compose leaves Cfg nil, TestComposeUIServerHoldsNoDaemonState fails if that changes), but internal/app/archied/bootstrap.go:1240 still runs b.web.Cfg = b.d.Cfg for the webui.Server the daemon keeps as its ConfigView renderer and readiness-probe holder. archie-core-ml30 is that split. Close this once ml30 lands, or amend the criterion to name the UI process rather than the package if the daemon-side renderer is considered out of scope.
sam added a new dependency 2026-10-27 13:41:44 +00:00
sam added a new dependency 2026-10-27 13:41:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#114