transport: control-plane-tracer — the first real seam over HTTP, end to end #127

Closed
opened 2026-07-26 22:03:40 +00:00 by ben · 1 comment
Owner

Parent

ADR 0037 (OpenAPI client). Filed from Ben's rulings 2026-07-26 after the review sweep of 6596977..9e946b7: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now. The tracer bullet for the whole transport arc.

What to build

The control plane serves its first real seam over HTTP — monitoring status (read-only, safest) — and the dashboard's monitoring surface reads it live. The OpenAPI spec grows past /healthz to describe the endpoints; the dashboard gets its generated client under a lib/api layer; the monitoring client gets its first non-fake implementation. This ticket sets the pattern (endpoint shape, error mapping, client generation, wiring point) every later surface migration copies.

Acceptance criteria

  • Given a running control plane, when the dashboard's monitoring surface loads, then fleet/service status renders from the real endpoint — no fake in the path.
  • Given the OpenAPI spec, it describes the monitoring endpoints and the client is generated from it (no hand-rolled fetch).
  • Given a control-plane error or unreachability, the surface shows its honest degraded state (the same one its tests drive).
  • The wiring point selects real-vs-fake explicitly — the pattern the fakes:testing-seam ticket will enforce everywhere.

Blocked by

  • shell:dashboard-composition — a reachable screen to prove it on.
  • standards:wire-snake-case — the wire convention this transport ossifies.

Task manifest

task: transport:control-plane-tracer
implements_flow: p5-monitoring
implements_edge: "S1 reads live status over HTTP (the tracer path)"
wireframe: docs/ux/wireframes/p5-monitoring/p5-s1-fleet-and-services-status.html
interface: "control-plane HTTP endpoints for the monitor seam + OpenAPI spec + generated dashboard client under lib/api"
seam: "an integration test driving the surface against a real control-plane process; OpenAPI spec is the contract"
acceptance: "see Acceptance criteria above"
depends_on: [shell:dashboard-composition, standards:wire-snake-case]
out_of_scope: [remaining surfaces (their own migration tickets), auth hardening beyond what ADR 0038 already rules]
needs_human_decision: []
## Parent ADR 0037 (OpenAPI client). Filed from Ben's rulings 2026-07-26 after the review sweep of `6596977..9e946b7`: integration-last was deliberate seam-first sequencing — now build the integration layer; and pay all standards debt now. The tracer bullet for the whole transport arc. ## What to build The control plane serves its first real seam over HTTP — monitoring status (read-only, safest) — and the dashboard's monitoring surface reads it live. The OpenAPI spec grows past `/healthz` to describe the endpoints; the dashboard gets its generated client under a `lib/api` layer; the monitoring client gets its first non-fake implementation. This ticket sets the pattern (endpoint shape, error mapping, client generation, wiring point) every later surface migration copies. ## Acceptance criteria - [ ] Given a running control plane, when the dashboard's monitoring surface loads, then fleet/service status renders from the real endpoint — no fake in the path. - [ ] Given the OpenAPI spec, it describes the monitoring endpoints and the client is generated from it (no hand-rolled fetch). - [ ] Given a control-plane error or unreachability, the surface shows its honest degraded state (the same one its tests drive). - [ ] The wiring point selects real-vs-fake explicitly — the pattern the fakes:testing-seam ticket will enforce everywhere. ## Blocked by - shell:dashboard-composition — a reachable screen to prove it on. - standards:wire-snake-case — the wire convention this transport ossifies. ## Task manifest ```yaml task: transport:control-plane-tracer implements_flow: p5-monitoring implements_edge: "S1 reads live status over HTTP (the tracer path)" wireframe: docs/ux/wireframes/p5-monitoring/p5-s1-fleet-and-services-status.html interface: "control-plane HTTP endpoints for the monitor seam + OpenAPI spec + generated dashboard client under lib/api" seam: "an integration test driving the surface against a real control-plane process; OpenAPI spec is the contract" acceptance: "see Acceptance criteria above" depends_on: [shell:dashboard-composition, standards:wire-snake-case] out_of_scope: [remaining surfaces (their own migration tickets), auth hardening beyond what ADR 0038 already rules] needs_human_decision: [] ```
Author
Owner

Done in 6f8fe10 (on origin/main).

The first real seam over HTTP, end to end — the pattern every later surface migration copies.

  • Spec (ADR 0037): packages/openapi-spec/openapi.yaml grows past /healthz to /monitor/status (the P5-S1 StatusView) and /monitor/alert-count, plus a Problem error shape; snake_case wire (#126).
  • Control plane serves it: new internal/controlapi — a narrow MonitorReader face (*monitor.Orchestrator satisfies it by construction) behind a method-aware net/http mux under /api/v1. control-plane/cmd/control-plane now wires a real (resting) orchestrator and blocks serving the API. httptest handler tests + an integration test drive the real orchestrator’s projection over HTTP.
  • Dashboard reads it live, generated: dashboard/src/lib/api/generated.ts is a committed, generated client (from the spec via packages/openapi-spec/scripts/generate-client.mjs; pnpm --filter @ourcloud/openapi-spec run check:client in scripts/seam-smoke.sh fails CI on drift) — no hand-rolled fetch. HttpMonitoringClient maps snake_case→camelCase; HttpReachabilitySource pings healthz so a control-plane error flips the honest DX degraded state the DX tests already drive.
  • Wiring point explicit: productionDashboardDeps + bootstrap select the real HTTP monitoring client for the services surface, every other surface still its seam fake until its own migration ticket — one place naming, per surface, real-vs-fake (the pattern the fakes:testing-seam ticket generalises).

Acceptance: (1) ServicesSurface renders fleet/service status from the real endpoint over the generated client — component integration test dashboard/tests/unit/controlPlaneTracer.test.ts, no fake in the path. (2) spec describes the endpoints, client generated (CI-checked in sync). (3) a 5xx/unreachable control plane flips the reachability probe → the shell shows the DX degraded state. (4) the bootstrap selects real-vs-fake explicitly.

Out of scope (their own tickets): the remaining monitoring surfaces (drill-in/respond/alert-contact) and every other feature’s transport.

Note: local sandbox has no Go/pnpm toolchain; verified statically (eslint + prettier over all touched TS, the generator --check, careful review). Full nix develop -c scripts/seam-smoke.sh runs in CI.

Done in `6f8fe10` (on `origin/main`). The first real seam over HTTP, end to end — the pattern every later surface migration copies. - **Spec (ADR 0037):** `packages/openapi-spec/openapi.yaml` grows past `/healthz` to `/monitor/status` (the P5-S1 `StatusView`) and `/monitor/alert-count`, plus a `Problem` error shape; snake_case wire (#126). - **Control plane serves it:** new `internal/controlapi` — a narrow `MonitorReader` face (`*monitor.Orchestrator` satisfies it by construction) behind a method-aware `net/http` mux under `/api/v1`. `control-plane/cmd/control-plane` now wires a real (resting) orchestrator and blocks serving the API. httptest handler tests + an integration test drive the **real orchestrator**’s projection over HTTP. - **Dashboard reads it live, generated:** `dashboard/src/lib/api/generated.ts` is a committed, **generated** client (from the spec via `packages/openapi-spec/scripts/generate-client.mjs`; `pnpm --filter @ourcloud/openapi-spec run check:client` in `scripts/seam-smoke.sh` fails CI on drift) — no hand-rolled fetch. `HttpMonitoringClient` maps snake_case→camelCase; `HttpReachabilitySource` pings healthz so a control-plane error flips the honest DX degraded state the DX tests already drive. - **Wiring point explicit:** `productionDashboardDeps` + `bootstrap` select the real HTTP monitoring client for the services surface, every other surface still its seam fake until its own migration ticket — one place naming, per surface, real-vs-fake (the pattern the fakes:testing-seam ticket generalises). **Acceptance:** (1) `ServicesSurface` renders fleet/service status from the real endpoint over the generated client — component integration test `dashboard/tests/unit/controlPlaneTracer.test.ts`, no fake in the path. (2) spec describes the endpoints, client generated (CI-checked in sync). (3) a 5xx/unreachable control plane flips the reachability probe → the shell shows the DX degraded state. (4) the bootstrap selects real-vs-fake explicitly. **Out of scope (their own tickets):** the remaining monitoring surfaces (drill-in/respond/alert-contact) and every other feature’s transport. Note: local sandbox has no Go/pnpm toolchain; verified statically (eslint + prettier over all touched TS, the generator `--check`, careful review). Full `nix develop -c scripts/seam-smoke.sh` runs in CI.
ben closed this issue 2026-07-27 12:46:22 +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#127
No description provided.