transport: shell-compose-controlplane — register the fleet/overview/settings services in main.go #159

Closed
opened 2026-07-28 19:54:56 +00:00 by ben · 1 comment
Owner

Parent

ADR 0037. The three main.go composition follow-ups deferred by the closing comments of #152 (fleet), #153 (overview) and #154 (settings) — none was filed at close; recovered by Ben's #128 review 2026-07-28 (the same dropped-thread class as #156).

The gap (verified in code 2026-07-28)

control-plane/cmd/control-plane/main.go registers only WithBackups / WithProvision / WithUpdates / WithMembers (monitoring rides in as NewHandler's required reader). WithFleet, WithOverview and WithSettings exist in internal/controlapi/ with handlers and integration tests, but are never registered in the production binary — so GET /api/v1/fleet, GET /api/v1/overview and the six /settings/* endpoints 404 against the real control plane, while productionDashboardDeps wires real HTTP clients that call them. The #152–#154 live tests pass because they spin their own test servers with the services registered.

What to build

Follow the resting fail-loud composition pattern #155 established for members (compile-time-asserted stubs; honest freshly-founded reads; acts fail loud — #132 / ADR 0100 bar prod fakes):

  1. Fleet — a real FleetService joining the fleet store × monitoring's per-node health chip (the #152 follow-up note), resting on the honest founded state (the gateway alone).
  2. Overview — a real OverviewService fanning out over the five owners (monitoring headline, backups coverage, the four needs-attention queues, first-run counts — the #153 follow-up note), composed from the orchestrators main.go already constructs.
  3. Settings — a resting brandkit-backed settings service (the #154 deferred note): the real brandkit seam behind Validate/Compile, honest resting community details + updates summary.
  4. Register all three in controlapi.NewHandler alongside the existing four options.

Acceptance criteria

  • Given the production binary, GET /api/v1/fleet, GET /api/v1/overview and every /settings/* endpoint respond (no 404): reads project the honest freshly-founded state; unwireable acts fail loud.
  • Given main.go, compile-time assertions prove each resting stub satisfies its port (the #155 discipline), and main_test.go seam-tests the honest-empty reads and fail-loud acts per service.
  • No prod fake stands in (#132, ADR 0100).

Task manifest

task: transport:shell-compose-controlplane
implements_edge: "the Fleet/Overview/Settings tabs' endpoints are served by the production control plane"
interface: "controlapi.WithFleet/WithOverview/WithSettings registered in main.go over real/resting services"
seam: "control-plane/cmd/control-plane/main_test.go (the #155 pattern); existing *_integration_test.go stay green"
acceptance: "see Acceptance criteria above"
depends_on: []
out_of_scope: [engine production adapters (the engine-adapters arc), rescue composition (#158), screen changes]
needs_human_decision: []
## Parent ADR 0037. The three `main.go` composition follow-ups deferred by the closing comments of **#152** (fleet), **#153** (overview) and **#154** (settings) — none was filed at close; recovered by Ben's #128 review 2026-07-28 (the same dropped-thread class as #156). ## The gap (verified in code 2026-07-28) `control-plane/cmd/control-plane/main.go` registers only `WithBackups` / `WithProvision` / `WithUpdates` / `WithMembers` (monitoring rides in as `NewHandler`'s required reader). `WithFleet`, `WithOverview` and `WithSettings` exist in `internal/controlapi/` with handlers and integration tests, but are **never registered in the production binary** — so `GET /api/v1/fleet`, `GET /api/v1/overview` and the six `/settings/*` endpoints **404 against the real control plane**, while `productionDashboardDeps` wires real HTTP clients that call them. The #152–#154 live tests pass because they spin their own test servers with the services registered. ## What to build Follow the resting fail-loud composition pattern #155 established for members (compile-time-asserted stubs; honest freshly-founded reads; acts fail loud — #132 / ADR 0100 bar prod fakes): 1. **Fleet** — a real `FleetService` joining the fleet store × monitoring's per-node health chip (the #152 follow-up note), resting on the honest founded state (the gateway alone). 2. **Overview** — a real `OverviewService` fanning out over the five owners (monitoring headline, backups coverage, the four needs-attention queues, first-run counts — the #153 follow-up note), composed from the orchestrators `main.go` already constructs. 3. **Settings** — a resting brandkit-backed settings service (the #154 deferred note): the real `brandkit` seam behind Validate/Compile, honest resting community details + updates summary. 4. Register all three in `controlapi.NewHandler` alongside the existing four options. ## Acceptance criteria - [ ] Given the production binary, `GET /api/v1/fleet`, `GET /api/v1/overview` and every `/settings/*` endpoint respond (no 404): reads project the honest freshly-founded state; unwireable acts fail loud. - [ ] Given `main.go`, compile-time assertions prove each resting stub satisfies its port (the #155 discipline), and `main_test.go` seam-tests the honest-empty reads and fail-loud acts per service. - [ ] No prod fake stands in (#132, ADR 0100). ## Task manifest ```yaml task: transport:shell-compose-controlplane implements_edge: "the Fleet/Overview/Settings tabs' endpoints are served by the production control plane" interface: "controlapi.WithFleet/WithOverview/WithSettings registered in main.go over real/resting services" seam: "control-plane/cmd/control-plane/main_test.go (the #155 pattern); existing *_integration_test.go stay green" acceptance: "see Acceptance criteria above" depends_on: [] out_of_scope: [engine production adapters (the engine-adapters arc), rescue composition (#158), screen changes] needs_human_decision: [] ```
Author
Owner

Done on origin/main (6b37a29).

WithFleet / WithOverview / WithSettings are now registered in the production binary (control-plane/cmd/control-plane/main.go), so GET /api/v1/fleet, GET /api/v1/overview and the six /settings/* endpoints no longer 404 against the real control plane (they did, while productionDashboardDeps already called them). Follows the #155 resting fail-loud composition (ADR 0100 / #132).

What was built (control-plane/cmd/control-plane/shell_surfaces.go, new):

  • Fleet — restingFleet joins the fleet store × monitoring: the founded gateway alone as row one (a structural honest placeholder, never an invented device name — DDR 0095), each node joined with monitoring's chip, which reads the honest unknown at rest (no heartbeat yet; shell owns no health truth, ADR 0097). The join is real — a node monitoring does classify carries its chip verbatim.
  • Overview — restingOverview fans out over the five owners main() constructs: monitoring health/alerts, backups' coverage (honestly noting founding's Identity dataset awaits its first copy — a warn, not a fake ok), members' awaiting-approval queue, the update channel's pending releases, and the fleet/provisioning first-run counts (all empty/zero at rest). Enroll's pending-devices queue rests unwired-not-faked (it's not in the composition root yet), the same discipline #152 used for the device-add strip.
  • Settings — restingSettings: validate / preview run over the REAL brandkit seam (Validate/Compile), community details rest honest-empty (founding's store not wired), the updates summary reads the wired update policy; the one unwireable act — Apply — FAILS LOUD (no durable brand-kit store to commit to).

Acceptance:

  • ✅ Every endpoint responds, reads honest, acts fail loud: the three options are registered in NewHandler; reads project the freshly-founded state, ApplyBrandKit fails loud.
  • ✅ Compile-time assertions + seam tests: var _ controlapi.FleetService/OverviewService/SettingsService = resting…{} proves each service satisfies its port (the #155 discipline); the five resting orchestrators are factored into one restingControlPlane() so main_test.go seam-tests exactly what production ships — TestRestingFleetReadsProjectTheGatewayAlone, TestRestingOverviewReadsProjectTheQuietGlance, TestRestingSettingsReadsRestAndApplyFailsLoud (honest-empty reads + fail-loud Apply).
  • ✅ No prod fake stands in (#132, ADR 0100).

No spec/screen change — the endpoints and dashboard clients already existed (#152–#154); the existing *_integration_test.go stay green. out_of_scope [engine adapters, rescue #158, screen changes] untouched. (Go toolchain isn't in the sandbox — the Go tests run in CI.)

Evidence: control-plane/cmd/control-plane/shell_surfaces.go + main.go + main_test.go; STATUS.md milestone log.

Done on `origin/main` (`6b37a29`). `WithFleet` / `WithOverview` / `WithSettings` are now registered in the production binary (`control-plane/cmd/control-plane/main.go`), so `GET /api/v1/fleet`, `GET /api/v1/overview` and the six `/settings/*` endpoints no longer 404 against the real control plane (they did, while `productionDashboardDeps` already called them). Follows the #155 resting fail-loud composition (ADR 0100 / #132). **What was built** (`control-plane/cmd/control-plane/shell_surfaces.go`, new): - **Fleet** — `restingFleet` joins the fleet store × monitoring: the founded gateway alone as row one (a structural honest placeholder, never an invented device name — DDR 0095), each node joined with monitoring's chip, which reads the honest `unknown` at rest (no heartbeat yet; shell owns no health truth, ADR 0097). The join is real — a node monitoring does classify carries its chip verbatim. - **Overview** — `restingOverview` fans out over the five owners `main()` constructs: monitoring health/alerts, backups' coverage (honestly noting founding's Identity dataset awaits its first copy — a `warn`, not a fake `ok`), members' awaiting-approval queue, the update channel's pending releases, and the fleet/provisioning first-run counts (all empty/zero at rest). Enroll's pending-devices queue rests unwired-not-faked (it's not in the composition root yet), the same discipline #152 used for the device-add strip. - **Settings** — `restingSettings`: `validate` / `preview` run over the REAL `brandkit` seam (Validate/Compile), community details rest honest-empty (founding's store not wired), the updates summary reads the wired update policy; the one unwireable act — **Apply** — **FAILS LOUD** (no durable brand-kit store to commit to). **Acceptance:** - ✅ *Every endpoint responds, reads honest, acts fail loud:* the three options are registered in `NewHandler`; reads project the freshly-founded state, `ApplyBrandKit` fails loud. - ✅ *Compile-time assertions + seam tests:* `var _ controlapi.FleetService/OverviewService/SettingsService = resting…{}` proves each service satisfies its port (the #155 discipline); the five resting orchestrators are factored into one `restingControlPlane()` so `main_test.go` seam-tests exactly what production ships — `TestRestingFleetReadsProjectTheGatewayAlone`, `TestRestingOverviewReadsProjectTheQuietGlance`, `TestRestingSettingsReadsRestAndApplyFailsLoud` (honest-empty reads + fail-loud Apply). - ✅ *No prod fake stands in* (#132, ADR 0100). No spec/screen change — the endpoints and dashboard clients already existed (#152–#154); the existing `*_integration_test.go` stay green. `out_of_scope` [engine adapters, rescue #158, screen changes] untouched. (Go toolchain isn't in the sandbox — the Go tests run in CI.) **Evidence:** `control-plane/cmd/control-plane/shell_surfaces.go` + `main.go` + `main_test.go`; STATUS.md milestone log.
ben closed this issue 2026-07-28 20:24:11 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#159
No description provided.