catalogue: wire the catalogue read + request routes into the production composition root (#1123/#1124/#1121 arc gap) #1135

Closed
opened 2026-09-02 00:32:28 +00:00 by matou-build-agent · 2 comments

Symptom

The catalogue read route GET /api/v1/catalogue (internal/controlapi.WithCatalogue, #1123) and the send/request routes (WithCatalogueRequests, #1124) are not wired into the production composition root (control-plane/cmd/control-plane/whole_composition.go) — they are only exercised from their integration tests. The servicerequest ledger (#1121) is likewise not instantiated there.

Consequence: in production the dashboard's P4-S2 "For this device" dress (#1126) and the Browse tab (T8) receive no catalogue data — the dashboard degrades to the undressed picker (by design, never a blocked deploy) and the Browse/Request surfaces have no backend. The OpenAPI path + generated client for the read now exist (added in #1126), so only the server-side Option wiring remains.

Proposed fix

In whole_composition.go, register:

  • controlapi.WithCatalogue(controlapi.NewCatalogueRead(projection, <servicerequest ledger>), <session resolver>) — the fleet projection (already built) supplies running-where; the ledger supplies request states.
  • controlapi.WithCatalogueRequests(...) over the broker send path (ADR 0219) + the same ledger.
  • Instantiate the durable servicerequest ledger (a single jsonstore document, #1121) in the state dir, shared by both.

Add a composition-root wiring test alongside the existing updates_rollout_wiring_test.go pattern asserting the routes answer (200 authed / 401 unauthed).

Found while working

#1126 (catalogue T7 — S2 wears the dress): the dashboard client half (spec entry, generated getCatalogue, HttpProvisionClient.catalogueDisplay) shipped there; this is the server half the read depends on to actually dress in production.

## Symptom The catalogue read route `GET /api/v1/catalogue` (`internal/controlapi.WithCatalogue`, #1123) and the send/request routes (`WithCatalogueRequests`, #1124) are **not wired into the production composition root** (`control-plane/cmd/control-plane/whole_composition.go`) — they are only exercised from their integration tests. The `servicerequest` ledger (#1121) is likewise not instantiated there. Consequence: in production the dashboard's P4-S2 "For this device" dress (#1126) and the Browse tab (T8) receive no catalogue data — the dashboard degrades to the undressed picker (by design, never a blocked deploy) and the Browse/Request surfaces have no backend. The OpenAPI path + generated client for the read now exist (added in #1126), so only the server-side `Option` wiring remains. ## Proposed fix In `whole_composition.go`, register: - `controlapi.WithCatalogue(controlapi.NewCatalogueRead(projection, <servicerequest ledger>), <session resolver>)` — the fleet `projection` (already built) supplies running-where; the ledger supplies request states. - `controlapi.WithCatalogueRequests(...)` over the broker send path (ADR 0219) + the same ledger. - Instantiate the durable `servicerequest` ledger (a single jsonstore document, #1121) in the state dir, shared by both. Add a composition-root wiring test alongside the existing `updates_rollout_wiring_test.go` pattern asserting the routes answer (200 authed / 401 unauthed). ## Found while working #1126 (catalogue T7 — S2 wears the dress): the dashboard client half (spec entry, generated `getCatalogue`, `HttpProvisionClient.catalogueDisplay`) shipped there; this is the server half the read depends on to actually dress in production.
Author
Member

swarm-claim host=matou-dev-server-01 run=16126
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16126 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #1135 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1135,
  "status": "success",
  "commits": [
    "23bfab91"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/catalogue_wiring.go",
    "control-plane/cmd/control-plane/catalogue_wiring_test.go",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/whole_composition.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/",
      "exit_code": 0
    }
  ],
  "criteria": {
    "WithCatalogue(NewCatalogueRead(projection, ledger), resolver) registered in the production composition root": "whole_composition.go builds controlapi.NewCatalogueRead(projection, requestLedger) into composed.catalogueRead; main.go folds it in via catalogueSurfaceOptions",
    "WithCatalogueRequests over the broker send path + the same ledger": "catalogue_wiring.go newCatalogueSender wires servicerequest.NewSender over brokerclient.New(IDSS_BROKER_URL) + the shared requestLedger + catalogueValidator; main.go mounts it via catalogueSurfaceOptions",
    "durable servicerequest ledger (single jsonstore document) instantiated in the state dir, shared by both": "whole_composition.go: requestLedger := servicerequest.NewFileLedger(filepath.Join(deps.stateDir, \"servicerequest.json\")) passed to both the read and the sender",
    "composition-root wiring test asserting the routes answer (200 authed / 401 unauthed)": "catalogue_wiring_test.go TestCatalogueMountedAtCompositionRoot (read 401 unauthed / 200 authed with both tiers), TestCatalogueRequestsMountedAtCompositionRoot (send mounted, no-kind -> 400 no broker call), TestCatalogueSurfaceOptions_RestsWhenUnwired (resting mounts nothing) — all green"
  },
  "summary": "Wired the P4-S2b catalogue read + Service-request send routes and the shared servicerequest ledger into the production whole composition, with a composition-root wiring test.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1135 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1135, "status": "success", "commits": [ "23bfab91" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/catalogue_wiring.go", "control-plane/cmd/control-plane/catalogue_wiring_test.go", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/whole_composition.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./control-plane/cmd/control-plane/", "exit_code": 0 } ], "criteria": { "WithCatalogue(NewCatalogueRead(projection, ledger), resolver) registered in the production composition root": "whole_composition.go builds controlapi.NewCatalogueRead(projection, requestLedger) into composed.catalogueRead; main.go folds it in via catalogueSurfaceOptions", "WithCatalogueRequests over the broker send path + the same ledger": "catalogue_wiring.go newCatalogueSender wires servicerequest.NewSender over brokerclient.New(IDSS_BROKER_URL) + the shared requestLedger + catalogueValidator; main.go mounts it via catalogueSurfaceOptions", "durable servicerequest ledger (single jsonstore document) instantiated in the state dir, shared by both": "whole_composition.go: requestLedger := servicerequest.NewFileLedger(filepath.Join(deps.stateDir, \"servicerequest.json\")) passed to both the read and the sender", "composition-root wiring test asserting the routes answer (200 authed / 401 unauthed)": "catalogue_wiring_test.go TestCatalogueMountedAtCompositionRoot (read 401 unauthed / 200 authed with both tiers), TestCatalogueRequestsMountedAtCompositionRoot (send mounted, no-kind -> 400 no broker call), TestCatalogueSurfaceOptions_RestsWhenUnwired (resting mounts nothing) — all green" }, "summary": "Wired the P4-S2b catalogue read + Service-request send routes and the shared servicerequest ledger into the production whole composition, with a composition-root wiring test.", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
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.

Dependencies

No dependencies set.

Reference
Matou/idss#1135
No description provided.