observability: transport-replication-read — one GET on the existing backups route family, one more face on HttpBackupsClient #821

Closed
opened 2026-08-25 10:59:31 +00:00 by matou-build-agent · 2 comments

Parent

Feature spec: #793 — control-panel observability child spec: backup replication matrix (P7-S7) (DDR 0205).
Design ticket #762; slice-map fan-in #770; wayfinder map #7.
Slice transport-replication-read of docs/slices/observability.yaml; covers spec #793 stories 55–58 (transport half).

What to build

One route, one method: a GET on the existing backups route family returning the replication
view, registered beside the existing overview/runs/policy routes and behind the same auth gate.
OpenAPI spec first (the spec is the contract, ADR 0037), generated client, thin handler over the
orchestrator, faults on the shared Problem body.

HttpBackupsClient grows a replication() method and implements one more interface — it is
already the single instance satisfying all P7 faces, and the surface composes them from that one
instance. camelize at the boundary as everywhere (standards:wire-snake-case, #126): the wire
stays snake_case and no component ever sees it.

No new client class, no hand-rolled fetch.

Acceptance criteria

  • (story 58) Given the replication read, when the transport is inspected, then it is a single GET on the backups route family, served by a thin handler over the orchestrator, mapped snake_case → camelCase at the existing wire.ts boundary, with faults on the shared Problem body — no new client class, no hand-rolled fetch.
  • (story 58) Given HttpBackupsClient, then it grows a replication() method and implements one more interface — it stays the single instance satisfying all P7 faces.
  • (story 5) Given an unauthenticated caller, then the replication read is refused by the existing auth gate with no fact disclosed, exactly as every other backups route is.
  • Given the view, then it round-trips snake_case → camelCase intact through the generated client.
  • Given a control-plane fault, then it surfaces as the shared Problem body the surface can render honestly.
  • (ADR 0037) Given the route, then the OpenAPI spec is written first and the client is generated from it.

Blocked by

  • #819 — observability:backup-pair-projection
  • backups:transport-backups-rescue-live (#130 — done, satisfied)

Task manifest

task: observability:transport-replication-read
interface: one `GET` on the existing backups route family returning the replication view, thin over the
  orchestrator's `Replication`; `HttpBackupsClient.replication()` added on the generated client with `camelize`
  at the existing `wire.ts` boundary
seam: 'the transport seam driven against a real control-plane process over the generated client (prior
  art `backups_integration_test.go`, `backupsLive.test.ts`, `backupsGuard304.test.ts`): the view round-trips
  snake_case → camelCase intact; an unauthenticated call is refused disclosing nothing; a control-plane
  fault surfaces as the shared Problem body'
acceptance:
- given: an authenticated operator
  when: the replication route is requested
  then: the whole view returns, camelised at the boundary, from a thin handler over the orchestrator
- given: an unauthenticated caller
  when: the replication route is requested
  then: it is refused with no fact disclosed
- given: a control-plane fault
  when: the route is served
  then: the shared Problem body is returned
- given: the dashboard client layer
  when: it is inspected
  then: '`HttpBackupsClient` carries `replication()` and no new client class or hand-rolled fetch exists'
depends_on:
- backup-pair-projection
- backups:transport-backups-rescue-live
out_of_scope:
- a new client class or a hand-rolled fetch
- the screen itself (`dashboard-replication-matrix`)
- '`/backups/replication` as a deep-linkable URL'
- any write verb — the read is read-only; the one act is the inherited `retryTarget`
needs_human_decision: []

Emitted by /to-tickets over docs/slices/observability.yaml in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.

## Parent Feature spec: **#793** — control-panel observability child spec: backup replication matrix (P7-S7) (DDR 0205). Design ticket #762; slice-map fan-in **#770**; wayfinder map #7. Slice `transport-replication-read` of `docs/slices/observability.yaml`; covers spec #793 stories 55–58 (transport half). ## What to build One route, one method: a `GET` on the **existing** backups route family returning the replication view, registered beside the existing overview/runs/policy routes and behind the **same auth gate**. OpenAPI spec first (the spec is the contract, ADR 0037), generated client, thin handler over the orchestrator, faults on the shared `Problem` body. `HttpBackupsClient` grows a `replication()` method and implements one more interface — it is already the single instance satisfying all P7 faces, and the surface composes them from that one instance. `camelize` at the boundary as everywhere (`standards:wire-snake-case`, #126): the wire stays snake_case and **no component ever sees it**. **No new client class, no hand-rolled fetch.** ## Acceptance criteria - [ ] (story 58) Given the replication read, when the transport is inspected, then it is a single GET on the backups route family, served by a thin handler over the orchestrator, mapped snake_case → camelCase at the existing `wire.ts` boundary, with faults on the shared Problem body — **no new client class, no hand-rolled fetch**. - [ ] (story 58) Given `HttpBackupsClient`, then it grows a `replication()` method and implements one more interface — it stays the single instance satisfying all P7 faces. - [ ] (story 5) Given an unauthenticated caller, then the replication read is refused by the existing auth gate with **no fact disclosed**, exactly as every other backups route is. - [ ] Given the view, then it round-trips snake_case → camelCase intact through the generated client. - [ ] Given a control-plane fault, then it surfaces as the shared Problem body the surface can render honestly. - [ ] (ADR 0037) Given the route, then the OpenAPI spec is written first and the client is generated from it. ## Blocked by - #819 — `observability:backup-pair-projection` - `backups:transport-backups-rescue-live` (#130 — done, satisfied) ## Task manifest ```yaml task: observability:transport-replication-read interface: one `GET` on the existing backups route family returning the replication view, thin over the orchestrator's `Replication`; `HttpBackupsClient.replication()` added on the generated client with `camelize` at the existing `wire.ts` boundary seam: 'the transport seam driven against a real control-plane process over the generated client (prior art `backups_integration_test.go`, `backupsLive.test.ts`, `backupsGuard304.test.ts`): the view round-trips snake_case → camelCase intact; an unauthenticated call is refused disclosing nothing; a control-plane fault surfaces as the shared Problem body' acceptance: - given: an authenticated operator when: the replication route is requested then: the whole view returns, camelised at the boundary, from a thin handler over the orchestrator - given: an unauthenticated caller when: the replication route is requested then: it is refused with no fact disclosed - given: a control-plane fault when: the route is served then: the shared Problem body is returned - given: the dashboard client layer when: it is inspected then: '`HttpBackupsClient` carries `replication()` and no new client class or hand-rolled fetch exists' depends_on: - backup-pair-projection - backups:transport-backups-rescue-live out_of_scope: - a new client class or a hand-rolled fetch - the screen itself (`dashboard-replication-matrix`) - '`/backups/replication` as a deep-linkable URL' - any write verb — the read is read-only; the one act is the inherited `retryTarget` needs_human_decision: [] ``` --- *Emitted by `/to-tickets` over `docs/slices/observability.yaml` in an unattended session under ADR 0174 (two-way-door posture — Ben's veto is asynchronous, never blocking). Advances #797.*
Author
Member

swarm-claim host=elitebook-distributed-server-03 run=10063
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=elitebook-distributed-server-03 run=10063 (automated multi-host claim — lowest live claim id works this ticket)
Author
Member

close-report for #821 — status success

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

envelope
{
  "issue": 821,
  "status": "success",
  "commits": [
    "4f5ad86"
  ],
  "changed_files": [
    "packages/openapi-spec/openapi.yaml",
    "dashboard/src/lib/api/generated.ts",
    "dashboard/src/lib/api/backupsClient.ts",
    "dashboard/src/lib/backups.ts",
    "internal/controlapi/backups.go",
    "internal/controlapi/backups_integration_test.go",
    "dashboard/tests/unit/backupsLive.test.ts",
    "STATUS.md"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/ ./internal/backup/",
      "exit_code": 0
    },
    {
      "command": "npx vitest run tests/unit/backupsLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "npx vue-tsc --noEmit",
      "exit_code": 0
    },
    {
      "command": "npx eslint src/lib/api/backupsClient.ts src/lib/backups.ts tests/unit/backupsLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "node packages/openapi-spec/scripts/generate-client.mjs --check",
      "exit_code": 0
    },
    {
      "command": "npx vitest run (packages/openapi-spec spec.test.ts)",
      "exit_code": 0
    },
    {
      "command": "pre-push gate: nix develop .#go-ci -> go build/vet/test ./... (all packages)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 58 — single GET on the backups route family, thin handler over the orchestrator, snake→camel at wire.ts, faults on shared Problem, no new client class / no hand-rolled fetch": "openapi.yaml GET /backups/replication (getBackupsReplication, 200->ReplicationView, 500->Problem); internal/controlapi/backups.go registerBackups adds a thin writeJSON over svc.Replication beside overview/runs/policy; backupsClient.ts replication() = camelize(await this.client.getBackupsReplication()) — reuses generated.ts, no new class, no fetch",
    "story 58 — HttpBackupsClient grows replication() and implements one more interface, staying the single instance for all P7 faces": "backupsClient.ts: BackupReplicationClient added to the implements list of HttpBackupsClient (already implementing 7 faces) and replication() method added; verified by vue-tsc",
    "story 5 — unauthenticated caller refused by the existing auth gate, no fact disclosed, exactly as every other backups route": "the route registers inside registerBackups on the shared mux with no per-route auth code; the ingress Caddy forward_auth gate (WithAuthGate, ADR 0074) fronts the whole /api/v1/backups/* family identically, so it inherits the same posture and discloses no fact of its own",
    "round-trips snake_case -> camelCase intact through the generated client": "backupsLive.test.ts 'round-trips the P7-S7 matrix snake_case -> camelCase' asserts currentCount/totalCount/targetsCurrent/onTargets/gradeLabel/fromFounding and nested pair datasetId/reachabilityLabel/lastVerifiedStatus/sizeLastKnown/snapshotsLastKnown/retryable — all camelized",
    "control-plane fault surfaces as the shared Problem body": "backupsLive.test.ts 'surfaces a control-plane fault as the shared Problem body' — a 500 Problem reply makes c.replication() reject with a ControlPlaneError carrying the Problem message",
    "ADR 0037 — OpenAPI spec written first, client generated from it": "packages/openapi-spec/openapi.yaml is edited first; dashboard/src/lib/api/generated.ts is regenerated via scripts/generate-client.mjs; check:client passes (client in sync with the spec)"
  },
  "summary": "The P7-S7 replication matrix's transport read: one GET on the existing backups route family thin over Orchestrator.Replication, with HttpBackupsClient growing replication() and one more face on the generated client.",
  "blockers": []
}
**close-report** for #821 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 821, "status": "success", "commits": [ "4f5ad86" ], "changed_files": [ "packages/openapi-spec/openapi.yaml", "dashboard/src/lib/api/generated.ts", "dashboard/src/lib/api/backupsClient.ts", "dashboard/src/lib/backups.ts", "internal/controlapi/backups.go", "internal/controlapi/backups_integration_test.go", "dashboard/tests/unit/backupsLive.test.ts", "STATUS.md" ], "tests": [ { "command": "go test ./internal/controlapi/", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/ ./internal/backup/", "exit_code": 0 }, { "command": "npx vitest run tests/unit/backupsLive.test.ts", "exit_code": 0 }, { "command": "npx vue-tsc --noEmit", "exit_code": 0 }, { "command": "npx eslint src/lib/api/backupsClient.ts src/lib/backups.ts tests/unit/backupsLive.test.ts", "exit_code": 0 }, { "command": "node packages/openapi-spec/scripts/generate-client.mjs --check", "exit_code": 0 }, { "command": "npx vitest run (packages/openapi-spec spec.test.ts)", "exit_code": 0 }, { "command": "pre-push gate: nix develop .#go-ci -> go build/vet/test ./... (all packages)", "exit_code": 0 } ], "criteria": { "story 58 — single GET on the backups route family, thin handler over the orchestrator, snake→camel at wire.ts, faults on shared Problem, no new client class / no hand-rolled fetch": "openapi.yaml GET /backups/replication (getBackupsReplication, 200->ReplicationView, 500->Problem); internal/controlapi/backups.go registerBackups adds a thin writeJSON over svc.Replication beside overview/runs/policy; backupsClient.ts replication() = camelize(await this.client.getBackupsReplication()) — reuses generated.ts, no new class, no fetch", "story 58 — HttpBackupsClient grows replication() and implements one more interface, staying the single instance for all P7 faces": "backupsClient.ts: BackupReplicationClient added to the implements list of HttpBackupsClient (already implementing 7 faces) and replication() method added; verified by vue-tsc", "story 5 — unauthenticated caller refused by the existing auth gate, no fact disclosed, exactly as every other backups route": "the route registers inside registerBackups on the shared mux with no per-route auth code; the ingress Caddy forward_auth gate (WithAuthGate, ADR 0074) fronts the whole /api/v1/backups/* family identically, so it inherits the same posture and discloses no fact of its own", "round-trips snake_case -> camelCase intact through the generated client": "backupsLive.test.ts 'round-trips the P7-S7 matrix snake_case -> camelCase' asserts currentCount/totalCount/targetsCurrent/onTargets/gradeLabel/fromFounding and nested pair datasetId/reachabilityLabel/lastVerifiedStatus/sizeLastKnown/snapshotsLastKnown/retryable — all camelized", "control-plane fault surfaces as the shared Problem body": "backupsLive.test.ts 'surfaces a control-plane fault as the shared Problem body' — a 500 Problem reply makes c.replication() reject with a ControlPlaneError carrying the Problem message", "ADR 0037 — OpenAPI spec written first, client generated from it": "packages/openapi-spec/openapi.yaml is edited first; dashboard/src/lib/api/generated.ts is regenerated via scripts/generate-client.mjs; check:client passes (client in sync with the spec)" }, "summary": "The P7-S7 replication matrix's transport read: one GET on the existing backups route family thin over Orchestrator.Replication, with HttpBackupsClient growing replication() and one more face on the generated client.", "blockers": [] } ``` </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.

Reference
Matou/idss#821
No description provided.