observability: transport-log-catalogue — scope → log-target resolution and the followable-targets read, with the reason for an empty answer #807

Closed
opened 2026-08-25 10:58:33 +00:00 by matou-build-agent · 3 comments

Parent

Feature spec: #791 — control-panel observability child spec: logs (P10) (DDR 0203).
Design ticket #760; slice-map fan-in #770; wayfinder map #7.
Slice transport-log-catalogue of docs/slices/observability.yaml; covers spec #791 stories 24–26 (wire half), 38.

What to build

What is followable is the control plane's answer, not the surface's guess. A log scope — an
operation log, a service, a node, or a subject reference — resolves server-side to zero or more
log targets, each carrying its name, kind (operation log / service unit), node and whether it
is live or finished-and-replayable.

A thin projection over the owners (fleet store × the service catalogue × the operation-log store),
re-deriving nothing and mapping faults to the shared Problem body exactly as the existing Fleet
route does. Scope → targets resolution lives here and nowhere else.

The load-bearing honesty rule: an empty answer carries its REASON — a not-yet-deployed
service, a node with no units and an aged-out operation log each read differently. That is what
makes P10-S0x an answer rather than a blank, and it is why the empty case is not an empty array
the client has to interpret. This one read is what both S1's scope control and S0x's offer list
render, so two frames can never disagree about what is followable.

Acceptance criteria

  • (story 36) Given a log scope (an operation log, a service, a node, or a subject reference), when the catalogue read is served, then the control plane resolves it to zero or more log targets, each carrying name, kind, node and whether it is live or finished-and-replayable.
  • (story 36/24) Given a scope resolving to zero targets, then the response carries the reason — a stated answer, not an empty array — and a not-yet-deployed service, a node with no units and an aged-out operation log each read differently.
  • (story 30) Given the catalogue read, then it is the one answer both S1's scope control and S0x's offer list will render — there is no second resolution path.
  • (story 39) Given the OpenAPI spec, then it carries the followable-targets read with snake_case wire fields camelised at the client boundary, served through the generated client (no hand-rolled fetch).
  • (story 37) Given an unauthenticated or non-operator caller, then the read is refused exactly as every other admin route is, with no fact disclosed.
  • Given an owner read that faults, then it maps to the shared Problem body.

Blocked by

  • #806 — observability:logstream-hub
  • shell:transport-fleet-live (#152 — done, satisfied)
  • monitoring:status-surface-classifier (#80 — done, satisfied)

Task manifest

task: observability:transport-log-catalogue
interface: a control-plane catalogue read resolving a log scope to zero or more log targets (name, kind,
  node, live-or-replayable) and carrying an explicit **reason** when it resolves to none — one route on
  the existing OpenAPI spec behind the community door
seam: 'transport integration tests (prior art `fleet_integration_test.go`, `authgate_test.go`, `fleetLive.test.ts`):
  a scope resolving to N targets; a scope resolving to zero **with its reason**; the three different empty
  reasons; an owner fault mapping to the shared Problem body; an unauthenticated caller refused disclosing
  nothing'
acceptance:
- given: a scope naming a service with two running units
  when: the catalogue read is served
  then: two targets return, each with name, kind, node and live-or-replayable
- given: a scope naming a service with no running unit
  when: the catalogue read is served
  then: zero targets return **with the reason stated**, distinct from the aged-out-operation-log reason
- given: an unauthenticated caller
  when: the catalogue read is requested
  then: it is refused with no fact disclosed
- given: an owner that faults
  when: the read is served
  then: the shared Problem body is returned
depends_on:
- logstream-hub
- shell:transport-fleet-live
- monitoring:status-surface-classifier
out_of_scope:
- the SSE route and the bounded download (`transport-log-stream-sse`)
- any client-side resolution or candidate list — the surface renders this answer verbatim
- custom multi-target sets / operator-composed target baskets
- log retention, indexing or time-range query
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: **#791** — control-panel observability child spec: logs (P10) (DDR 0203). Design ticket #760; slice-map fan-in **#770**; wayfinder map #7. Slice `transport-log-catalogue` of `docs/slices/observability.yaml`; covers spec #791 stories 24–26 (wire half), 38. ## What to build **What is followable is the control plane's answer, not the surface's guess.** A **log scope** — an operation log, a service, a node, or a subject reference — resolves server-side to zero or more **log targets**, each carrying its name, kind (operation log / service unit), node and whether it is live or finished-and-replayable. A thin projection over the owners (fleet store × the service catalogue × the operation-log store), re-deriving nothing and mapping faults to the shared Problem body exactly as the existing Fleet route does. Scope → targets resolution lives **here and nowhere else**. The load-bearing honesty rule: **an empty answer carries its REASON** — a not-yet-deployed service, a node with no units and an aged-out operation log each read differently. That is what makes P10-S0x an answer rather than a blank, and it is why the empty case is not an empty array the client has to interpret. This one read is what both S1's scope control and S0x's offer list render, so two frames can never disagree about what is followable. ## Acceptance criteria - [ ] (story 36) Given a log scope (an operation log, a service, a node, or a subject reference), when the catalogue read is served, then the control plane resolves it to zero or more log targets, each carrying name, kind, node and whether it is live or finished-and-replayable. - [ ] (story 36/24) Given a scope resolving to **zero** targets, then the response carries the **reason** — a stated answer, not an empty array — and a not-yet-deployed service, a node with no units and an aged-out operation log each read differently. - [ ] (story 30) Given the catalogue read, then it is the one answer both S1's scope control and S0x's offer list will render — there is no second resolution path. - [ ] (story 39) Given the OpenAPI spec, then it carries the followable-targets read with snake_case wire fields camelised at the client boundary, served through the **generated client** (no hand-rolled fetch). - [ ] (story 37) Given an unauthenticated or non-operator caller, then the read is refused exactly as every other admin route is, with no fact disclosed. - [ ] Given an owner read that faults, then it maps to the shared Problem body. ## Blocked by - #806 — `observability:logstream-hub` - `shell:transport-fleet-live` (#152 — done, satisfied) - `monitoring:status-surface-classifier` (#80 — done, satisfied) ## Task manifest ```yaml task: observability:transport-log-catalogue interface: a control-plane catalogue read resolving a log scope to zero or more log targets (name, kind, node, live-or-replayable) and carrying an explicit **reason** when it resolves to none — one route on the existing OpenAPI spec behind the community door seam: 'transport integration tests (prior art `fleet_integration_test.go`, `authgate_test.go`, `fleetLive.test.ts`): a scope resolving to N targets; a scope resolving to zero **with its reason**; the three different empty reasons; an owner fault mapping to the shared Problem body; an unauthenticated caller refused disclosing nothing' acceptance: - given: a scope naming a service with two running units when: the catalogue read is served then: two targets return, each with name, kind, node and live-or-replayable - given: a scope naming a service with no running unit when: the catalogue read is served then: zero targets return **with the reason stated**, distinct from the aged-out-operation-log reason - given: an unauthenticated caller when: the catalogue read is requested then: it is refused with no fact disclosed - given: an owner that faults when: the read is served then: the shared Problem body is returned depends_on: - logstream-hub - shell:transport-fleet-live - monitoring:status-surface-classifier out_of_scope: - the SSE route and the bounded download (`transport-log-stream-sse`) - any client-side resolution or candidate list — the surface renders this answer verbatim - custom multi-target sets / operator-composed target baskets - log retention, indexing or time-range query 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=matou-dev-server-01 run=10067
(automated multi-host claim — lowest live claim id works this ticket)

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

close-report for #807 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit e78d63ad is not reachable from origin/main (not landed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'dashboard/src/lib/api/generated.ts' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/logcatalogue.go' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/logcatalogue_integration_test.go' is not in the diff of the claimed commits
  • changed_files: 'packages/openapi-spec/openapi.yaml' is not in the diff of the claimed commits
  • changed_files: 'packages/openapi-spec/tests/unit/spec.test.ts' is not in the diff of the claimed commits
envelope
{
  "issue": 807,
  "status": "success",
  "commits": [
    "e78d63ad"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/api/generated.ts",
    "internal/controlapi/logcatalogue.go",
    "internal/controlapi/logcatalogue_integration_test.go",
    "packages/openapi-spec/openapi.yaml",
    "packages/openapi-spec/tests/unit/spec.test.ts"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi -run TestLogCatalogue -count=1",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check (check:client)",
      "exit_code": 0
    },
    {
      "command": "vitest run (packages/openapi-spec)",
      "exit_code": 0
    },
    {
      "command": "git push (pre-push go test ./... gate)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 36 — scope resolves to zero or more targets each carrying name, kind, node, live-or-replayable": "internal/controlapi/logcatalogue.go LogTarget{Name,Kind,Node,Live}; test TestLogCatalogue_ScopeResolvesToTargetsEachWithNameKindNodeLive",
    "story 36/24 — zero targets carries the reason, three distinct empty reasons": "LogTargets.Reason present when Targets empty; Reason* constants service_not_deployed/node_has_no_units/operation_log_aged_out; test TestLogCatalogue_ZeroTargetsCarryTheReasonAndTheThreeReasonsDiffer",
    "story 30 — one answer both S1 and S0x render, no second resolution path": "single route GET /api/v1/logs/targets/{scope} over the one LogCatalogue seam; no client-side resolution added (out_of_scope honoured)",
    "story 39 — OpenAPI spec carries the read, snake_case camelised at client boundary, generated client": "packages/openapi-spec/openapi.yaml /logs/targets/{scope} + LogTargets/LogTarget/LogTargetsReason; regenerated dashboard/src/lib/api/generated.ts getLogsTargets; check:client in sync",
    "story 37 — unauthenticated/non-operator refused, no fact disclosed": "operatorAuthed refuses 401 before Resolve; test TestLogCatalogue_UnauthenticatedIsRefusedDisclosingNothing (catalogue never consulted, no target fact in body)",
    "owner fault maps to the shared Problem body": "writeReadErr -> 500 Problem; test TestLogCatalogue_OwnerFaultMapsToProblem"
  },
  "summary": "Added the scope→targets catalogue read: one control-plane route resolving a log scope to zero or more log targets and carrying the stated reason when none, served through the generated client behind the community door.",
  "blockers": []
}
**close-report** for #807 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit e78d63ad is not reachable from origin/main (not landed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'dashboard/src/lib/api/generated.ts' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/logcatalogue.go' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/logcatalogue_integration_test.go' is not in the diff of the claimed commits - changed_files: 'packages/openapi-spec/openapi.yaml' is not in the diff of the claimed commits - changed_files: 'packages/openapi-spec/tests/unit/spec.test.ts' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 807, "status": "success", "commits": [ "e78d63ad" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/api/generated.ts", "internal/controlapi/logcatalogue.go", "internal/controlapi/logcatalogue_integration_test.go", "packages/openapi-spec/openapi.yaml", "packages/openapi-spec/tests/unit/spec.test.ts" ], "tests": [ { "command": "go test ./internal/controlapi -run TestLogCatalogue -count=1", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check (check:client)", "exit_code": 0 }, { "command": "vitest run (packages/openapi-spec)", "exit_code": 0 }, { "command": "git push (pre-push go test ./... gate)", "exit_code": 0 } ], "criteria": { "story 36 — scope resolves to zero or more targets each carrying name, kind, node, live-or-replayable": "internal/controlapi/logcatalogue.go LogTarget{Name,Kind,Node,Live}; test TestLogCatalogue_ScopeResolvesToTargetsEachWithNameKindNodeLive", "story 36/24 — zero targets carries the reason, three distinct empty reasons": "LogTargets.Reason present when Targets empty; Reason* constants service_not_deployed/node_has_no_units/operation_log_aged_out; test TestLogCatalogue_ZeroTargetsCarryTheReasonAndTheThreeReasonsDiffer", "story 30 — one answer both S1 and S0x render, no second resolution path": "single route GET /api/v1/logs/targets/{scope} over the one LogCatalogue seam; no client-side resolution added (out_of_scope honoured)", "story 39 — OpenAPI spec carries the read, snake_case camelised at client boundary, generated client": "packages/openapi-spec/openapi.yaml /logs/targets/{scope} + LogTargets/LogTarget/LogTargetsReason; regenerated dashboard/src/lib/api/generated.ts getLogsTargets; check:client in sync", "story 37 — unauthenticated/non-operator refused, no fact disclosed": "operatorAuthed refuses 401 before Resolve; test TestLogCatalogue_UnauthenticatedIsRefusedDisclosingNothing (catalogue never consulted, no target fact in body)", "owner fault maps to the shared Problem body": "writeReadErr -> 500 Problem; test TestLogCatalogue_OwnerFaultMapsToProblem" }, "summary": "Added the scope→targets catalogue read: one control-plane route resolving a log scope to zero or more log targets and carrying the stated reason when none, served through the generated client behind the community door.", "blockers": [] } ``` </details>
Author
Member

close-report for #807 — status success

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

envelope
{
  "issue": 807,
  "status": "success",
  "commits": [
    "e78d63ad"
  ],
  "changed_files": [
    "STATUS.md",
    "dashboard/src/lib/api/generated.ts",
    "internal/controlapi/logcatalogue.go",
    "internal/controlapi/logcatalogue_integration_test.go",
    "packages/openapi-spec/openapi.yaml",
    "packages/openapi-spec/tests/unit/spec.test.ts"
  ],
  "tests": [
    {
      "command": "go test ./internal/controlapi -run TestLogCatalogue -count=1",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "node scripts/generate-client.mjs --check (check:client)",
      "exit_code": 0
    },
    {
      "command": "vitest run (packages/openapi-spec)",
      "exit_code": 0
    },
    {
      "command": "git push (pre-push go test ./... gate)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "story 36 — scope resolves to zero or more targets each carrying name, kind, node, live-or-replayable": "internal/controlapi/logcatalogue.go LogTarget{Name,Kind,Node,Live}; test TestLogCatalogue_ScopeResolvesToTargetsEachWithNameKindNodeLive",
    "story 36/24 — zero targets carries the reason, three distinct empty reasons": "LogTargets.Reason present when Targets empty; Reason* constants service_not_deployed/node_has_no_units/operation_log_aged_out; test TestLogCatalogue_ZeroTargetsCarryTheReasonAndTheThreeReasonsDiffer",
    "story 30 — one answer both S1 and S0x render, no second resolution path": "single route GET /api/v1/logs/targets/{scope} over the one LogCatalogue seam; no client-side resolution added (out_of_scope honoured)",
    "story 39 — OpenAPI spec carries the read, snake_case camelised at client boundary, generated client": "packages/openapi-spec/openapi.yaml /logs/targets/{scope} + LogTargets/LogTarget/LogTargetsReason; regenerated dashboard/src/lib/api/generated.ts getLogsTargets; check:client in sync",
    "story 37 — unauthenticated/non-operator refused, no fact disclosed": "operatorAuthed refuses 401 before Resolve; test TestLogCatalogue_UnauthenticatedIsRefusedDisclosingNothing (catalogue never consulted, no target fact in body)",
    "owner fault maps to the shared Problem body": "writeReadErr -> 500 Problem; test TestLogCatalogue_OwnerFaultMapsToProblem"
  },
  "summary": "Added the scope→targets catalogue read: one control-plane route resolving a log scope to zero or more log targets and carrying the stated reason when none, served through the generated client behind the community door.",
  "blockers": []
}
**close-report** for #807 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 807, "status": "success", "commits": [ "e78d63ad" ], "changed_files": [ "STATUS.md", "dashboard/src/lib/api/generated.ts", "internal/controlapi/logcatalogue.go", "internal/controlapi/logcatalogue_integration_test.go", "packages/openapi-spec/openapi.yaml", "packages/openapi-spec/tests/unit/spec.test.ts" ], "tests": [ { "command": "go test ./internal/controlapi -run TestLogCatalogue -count=1", "exit_code": 0 }, { "command": "go vet ./internal/controlapi/", "exit_code": 0 }, { "command": "node scripts/generate-client.mjs --check (check:client)", "exit_code": 0 }, { "command": "vitest run (packages/openapi-spec)", "exit_code": 0 }, { "command": "git push (pre-push go test ./... gate)", "exit_code": 0 } ], "criteria": { "story 36 — scope resolves to zero or more targets each carrying name, kind, node, live-or-replayable": "internal/controlapi/logcatalogue.go LogTarget{Name,Kind,Node,Live}; test TestLogCatalogue_ScopeResolvesToTargetsEachWithNameKindNodeLive", "story 36/24 — zero targets carries the reason, three distinct empty reasons": "LogTargets.Reason present when Targets empty; Reason* constants service_not_deployed/node_has_no_units/operation_log_aged_out; test TestLogCatalogue_ZeroTargetsCarryTheReasonAndTheThreeReasonsDiffer", "story 30 — one answer both S1 and S0x render, no second resolution path": "single route GET /api/v1/logs/targets/{scope} over the one LogCatalogue seam; no client-side resolution added (out_of_scope honoured)", "story 39 — OpenAPI spec carries the read, snake_case camelised at client boundary, generated client": "packages/openapi-spec/openapi.yaml /logs/targets/{scope} + LogTargets/LogTarget/LogTargetsReason; regenerated dashboard/src/lib/api/generated.ts getLogsTargets; check:client in sync", "story 37 — unauthenticated/non-operator refused, no fact disclosed": "operatorAuthed refuses 401 before Resolve; test TestLogCatalogue_UnauthenticatedIsRefusedDisclosingNothing (catalogue never consulted, no target fact in body)", "owner fault maps to the shared Problem body": "writeReadErr -> 500 Problem; test TestLogCatalogue_OwnerFaultMapsToProblem" }, "summary": "Added the scope→targets catalogue read: one control-plane route resolving a log scope to zero or more log targets and carrying the stated reason when none, served through the generated client behind the community door.", "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#807
No description provided.