observability: the P10 logs transport is never mounted — catalogue/stream/download routes 404 on a real gateway #868

Closed
opened 2026-08-26 03:59:53 +00:00 by ben · 3 comments
Owner

The gap

The P10 logs tier landed at its seams and is never mounted on the real control plane. All three logs routes are registered only by Options that no production composition root passes, so on a shipped gateway every logs affordance answers 404:

  • GET /api/v1/logs/targets/{scope} — WithLogCatalogue (#807)
  • GET /api/v1/logs/stream/{scope} — WithLogStream (#808)
  • GET /api/v1/logs/download/{scope} — same option

Evidence. control-plane/cmd/control-plane/main.go:811 composes controlapi.NewHandler(c.mon, log, opts...) with 20+ options (WithBackups, WithFleet, WithRescue, WithOverview, …). Neither WithLogStream nor WithLogCatalogue is among them. Repo-wide, the only non-test callers of WithLogCatalogue are its own definition and logcatalogue_integration_test.go; WithLogStream has no caller outside its definition at all.

And there is no production LogCatalogue. internal/controlapi/logcatalogue.go:102 defines the interface; the only implementation in the tree is the test fake in logcatalogue_integration_test.go:39. #807's slice note promised "a thin projection over the owners (fleet store × service catalogue × operation-log store)" — the interface, the route and the honest-empty Reason codes landed, the projection did not. Likewise logstream.HubFollower needs a FollowFunc bound to something real; no journald/container/file adapter exists (grep journalctl hits only internal/vm/manager.go).

So the shell mounts (#809 LogsScreen, #811 the @open-logs/@download-logs binding), the SSE hub (#806) and the browser stream source (#810) are all correct and unit-proven against fakes, sitting on top of a transport that answers nothing in production.

Why this is filed separately

It is not one slice's miss — the slice map has no mount/composition slice for this tier at all (docs/slices/observability.yaml, logstream-hub → transport-log-catalogue → transport-log-stream-sse → the dashboard/shell slices). Nothing downstream noticed because every seam test injects its own fake.

What to build

  • A production LogCatalogue implementation: resolve a scope to LogTarget{Name,Kind,Node,Live} over the real owners (fleet store × service catalogue × operation-log store), with the three honest-empty Reason codes (service_not_deployed, node_has_no_units, operation_log_aged_out) served from real state.
  • A production FollowFunc for the hub — what a service-unit target actually follows on a node (the deploy/agent door is the existing pattern), and what an operation-log target replays.
  • Both wired into control-plane/cmd/control-plane/main.go's option list alongside the other reads.
  • A regression that fails when a logs route is unregistered — the composition root asserted, not just the Option. This class of miss (built at the seam, never mounted) is invisible to every existing test.
  • docs/slices/observability.yaml gains the mount slice so the map records it.

Blocks

#859 (converge backups + rescue log emitters onto the shell open-logs intent) — converging more emitters onto an intent whose transport is unmounted adds surface, not capability. This should land first.

Refs

DDR 0203 (the logs surface), ADR 0027 (the Open/Download promise), spec #791, #806/#807/#808/#809/#810/#811.

## The gap The P10 logs tier landed at its seams and is **never mounted on the real control plane**. All three logs routes are registered only by `Option`s that no production composition root passes, so on a shipped gateway every logs affordance answers 404: - `GET /api/v1/logs/targets/{scope}` — `WithLogCatalogue` (#807) - `GET /api/v1/logs/stream/{scope}` — `WithLogStream` (#808) - `GET /api/v1/logs/download/{scope}` — same option **Evidence.** `control-plane/cmd/control-plane/main.go:811` composes `controlapi.NewHandler(c.mon, log, opts...)` with 20+ options (`WithBackups`, `WithFleet`, `WithRescue`, `WithOverview`, …). Neither `WithLogStream` nor `WithLogCatalogue` is among them. Repo-wide, the only non-test callers of `WithLogCatalogue` are its own definition and `logcatalogue_integration_test.go`; `WithLogStream` has no caller outside its definition at all. **And there is no production `LogCatalogue`.** `internal/controlapi/logcatalogue.go:102` defines the interface; the only implementation in the tree is the test fake in `logcatalogue_integration_test.go:39`. #807's slice note promised "a thin projection over the owners (fleet store × service catalogue × operation-log store)" — the interface, the route and the honest-empty `Reason` codes landed, the projection did not. Likewise `logstream.HubFollower` needs a `FollowFunc` bound to something real; no journald/container/file adapter exists (`grep journalctl` hits only `internal/vm/manager.go`). So the shell mounts (#809 `LogsScreen`, #811 the `@open-logs`/`@download-logs` binding), the SSE hub (#806) and the browser stream source (#810) are all correct and unit-proven against fakes, sitting on top of a transport that answers nothing in production. ## Why this is filed separately It is not one slice's miss — the slice map has no mount/composition slice for this tier at all (`docs/slices/observability.yaml`, `logstream-hub` → `transport-log-catalogue` → `transport-log-stream-sse` → the dashboard/shell slices). Nothing downstream noticed because every seam test injects its own fake. ## What to build - [ ] A production `LogCatalogue` implementation: resolve a scope to `LogTarget{Name,Kind,Node,Live}` over the real owners (fleet store × service catalogue × operation-log store), with the three honest-empty `Reason` codes (`service_not_deployed`, `node_has_no_units`, `operation_log_aged_out`) served from real state. - [ ] A production `FollowFunc` for the hub — what a `service-unit` target actually follows on a node (the deploy/agent door is the existing pattern), and what an `operation-log` target replays. - [ ] Both wired into `control-plane/cmd/control-plane/main.go`'s option list alongside the other reads. - [ ] A regression that fails when a logs route is unregistered — the composition root asserted, not just the Option. This class of miss (built at the seam, never mounted) is invisible to every existing test. - [ ] `docs/slices/observability.yaml` gains the mount slice so the map records it. ## Blocks **#859** (converge backups + rescue log emitters onto the shell open-logs intent) — converging more emitters onto an intent whose transport is unmounted adds surface, not capability. This should land first. ## Refs DDR 0203 (the logs surface), ADR 0027 (the Open/Download promise), spec #791, #806/#807/#808/#809/#810/#811.

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

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

Ruled by agent under ADR 0174 — veto anytime.

The decision. This ticket asked for both the MOUNT (a production LogCatalogue + wiring the transport into the composition root + a regression) and the live-follow SOURCE ("what a service-unit target actually follows on a node"). On implementation the source turned out to need two owners that do not exist in the tree and cannot be honestly invented in a mount slice:

  1. A service→systemd-unit-name mapping — a catalogue slug (files) is not its unit (phpfpm-nextcloud.service). Nothing maps one to the other; deciding where that lives is a design call. needs-design.
  2. A remote node-journal streaming transport (ssh <target> journalctl -u <unit> -f) — no live-follow-a-unit transport exists (only the one-shot clan.Adapter.UnitActive systemctl is-active; journalctl is invoked nowhere remotely). It also carries the one runtime/operator-log posture question in this arc.

What I shipped (the two-way door): the mount + the real catalogue. The routes now ANSWER real state instead of 404, gated as every other admin route, with a composition-root regression that fails when a logs route is unmounted (the class of miss the ticket names). Honest limit (ADR 0100): the live follow fails loud and the download is the honest empty artifact until the source lands — never a fake tail.

Why this is a two-way door: the mount + catalogue is fully revertible (delete logs_wiring.go, drop one append) and proven by logs_wiring_test.go + logcatalogue_integration_test.go. The source adapters are the genuinely-separate slices, filed as #876 (node-journal streaming source + the service→unit mapping, needs-design) and #877 (the durable operation-log line store, needs-design). Neither the mount nor the split touches a one-way door.

What proves it: go test ./control-plane/... ./internal/controlapi/ ./internal/logstream/ green; the composition-root regression asserts all three routes are mounted (401, never 404) over a real composed control plane.

Unblocks #859 (converge emitters onto the open-logs intent — now a mounted transport to converge onto).

**Ruled by agent under ADR 0174 — veto anytime.** **The decision.** This ticket asked for both the MOUNT (a production `LogCatalogue` + wiring the transport into the composition root + a regression) and the live-follow SOURCE ("what a service-unit target actually follows on a node"). On implementation the source turned out to need two owners that do not exist in the tree and cannot be honestly invented in a mount slice: 1. **A service→systemd-unit-name mapping** — a catalogue slug (`files`) is not its unit (`phpfpm-nextcloud.service`). Nothing maps one to the other; deciding where that lives is a design call. **`needs-design`.** 2. **A remote node-journal streaming transport** (`ssh <target> journalctl -u <unit> -f`) — no live-follow-a-unit transport exists (only the one-shot `clan.Adapter.UnitActive` `systemctl is-active`; `journalctl` is invoked nowhere remotely). It also carries the one runtime/operator-log **posture** question in this arc. **What I shipped (the two-way door):** the mount + the real catalogue. The routes now ANSWER real state instead of 404, gated as every other admin route, with a composition-root regression that fails when a logs route is unmounted (the class of miss the ticket names). Honest limit (ADR 0100): the live follow fails loud and the download is the honest empty artifact until the source lands — never a fake tail. **Why this is a two-way door:** the mount + catalogue is fully revertible (delete `logs_wiring.go`, drop one `append`) and proven by `logs_wiring_test.go` + `logcatalogue_integration_test.go`. The source adapters are the genuinely-separate slices, filed as **#876** (node-journal streaming source + the service→unit mapping, `needs-design`) and **#877** (the durable operation-log line store, `needs-design`). Neither the mount nor the split touches a one-way door. **What proves it:** `go test ./control-plane/... ./internal/controlapi/ ./internal/logstream/` green; the composition-root regression asserts all three routes are mounted (401, never 404) over a real composed control plane. Unblocks #859 (converge emitters onto the open-logs intent — now a mounted transport to converge onto).

close-report for #868 — status success

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

envelope
{
  "issue": 868,
  "status": "success",
  "commits": [
    "b74e5ef94bb6696be9468b4ca12fdcdddf8db484"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/compose.go",
    "control-plane/cmd/control-plane/logs_wiring.go",
    "control-plane/cmd/control-plane/logs_wiring_test.go",
    "control-plane/cmd/control-plane/main.go",
    "control-plane/cmd/control-plane/resting_composition.go",
    "control-plane/cmd/control-plane/whole_composition.go",
    "docs/slices/observability.yaml"
  ],
  "tests": [
    {
      "command": "go test ./control-plane/cmd/control-plane/ -run 'TestLogs|TestFleetLogCatalogue|TestEmptyLogDownloader'",
      "exit_code": 0
    },
    {
      "command": "go test ./control-plane/... ./internal/controlapi/ ./internal/logstream/ ./internal/fleetstate/ ./internal/catalogue/",
      "exit_code": 0
    },
    {
      "command": "go build ./... && go vet ./... && go test ./... (root module, full seam)",
      "exit_code": 0
    },
    {
      "command": "golangci-lint run --new-from-rev origin/main ./... (no new lint from this change)",
      "exit_code": 0
    },
    {
      "command": "cd broker && go build ./... && go vet ./... && go test ./... && golangci-lint run ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A production LogCatalogue: resolve a scope to LogTarget{Name,Kind,Node,Live} over the real owners, with the three honest-empty Reason codes served from real state": "DONE — fleetLogCatalogue in control-plane/cmd/control-plane/logs_wiring.go: the thin projection over the fleet-state read (logFleetReader.Devices) x the fixed service catalogue. A service resolves to one live service-unit target per node running it; a node to its units; service_not_deployed / node_has_no_units / operation_log_aged_out each served from real state. Proven: TestFleetLogCatalogueResolvesRealServiceUnits + TestFleetLogCatalogueEmptyAnswersCarryDistinctReasons (logs_wiring_test.go)",
    "A production FollowFunc for the hub — service-unit node follow + operation-log replay": "MOUNTED over the real hub (#806) via controlapi.HubFollower; the live-follow LINE SOURCE is honest-rested (ADR 0100): it needs two owners that do not exist in the tree — a service->systemd-unit-name mapping (undesigned; a slug is not its unit) and a remote node-journal streaming transport (journalctl -f/-n over the deploy/agent SSH door, an operator-log posture call). Both filed as #876 (needs-design) and #877 (needs-design). Until they land the follow FAILS LOUD (errLogSourceNotWired) and the download is the honest empty artifact / 404 for an unknown scope, never a fake tail. Ruled agent-side under ADR 0174 (mount = two-way door; sources = filed follow-ups) — see issue ruling comment",
    "Both wired into control-plane/cmd/control-plane/main.go's option list alongside the other reads": "DONE — main.go appends logsSurfaceOptions(c, gateResolver) UNCONDITIONALLY (whole and resting); composed gains logFleet, set to the real projection in composeWhole and emptyFleet in composeResting",
    "A regression that fails when a logs route is unregistered — the composition root asserted, not just the Option": "DONE — TestLogsMountedAtCompositionRoot builds the handler over a REAL composed control plane's logsSurfaceOptions and asserts all three routes answer 401 (mounted+gated), never 404; TestLogsSurfaceOptionsMountsAllThreeRoutes asserts the whole transport is mounted (logs_wiring_test.go)",
    "docs/slices/observability.yaml gains the mount slice so the map records it": "DONE — transport-log-mount (ticket 868) added after shell-logs-intent-mount, depends_on the catalogue/SSE/hub slices, recording the mount/composition slice the DAG never held"
  },
  "summary": "Mounted the P10 logs transport on the real control plane over a production LogCatalogue, closing the 404 that every logs route answered on a shipped gateway, with a composition-root regression and the slice-map mount slice.",
  "reason": "The tier landed at its seams but was never mounted (main() wired neither WithLogCatalogue nor WithLogStream); this slice mounts it over real state. The live-follow line source (service->unit mapping + remote node-journal streaming) is genuinely-absent, undesigned infrastructure honest-rested per ADR 0100 and filed as #876/#877 (needs-design), ruled under ADR 0174.",
  "blockers": []
}
**close-report** for #868 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 868, "status": "success", "commits": [ "b74e5ef94bb6696be9468b4ca12fdcdddf8db484" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/compose.go", "control-plane/cmd/control-plane/logs_wiring.go", "control-plane/cmd/control-plane/logs_wiring_test.go", "control-plane/cmd/control-plane/main.go", "control-plane/cmd/control-plane/resting_composition.go", "control-plane/cmd/control-plane/whole_composition.go", "docs/slices/observability.yaml" ], "tests": [ { "command": "go test ./control-plane/cmd/control-plane/ -run 'TestLogs|TestFleetLogCatalogue|TestEmptyLogDownloader'", "exit_code": 0 }, { "command": "go test ./control-plane/... ./internal/controlapi/ ./internal/logstream/ ./internal/fleetstate/ ./internal/catalogue/", "exit_code": 0 }, { "command": "go build ./... && go vet ./... && go test ./... (root module, full seam)", "exit_code": 0 }, { "command": "golangci-lint run --new-from-rev origin/main ./... (no new lint from this change)", "exit_code": 0 }, { "command": "cd broker && go build ./... && go vet ./... && go test ./... && golangci-lint run ./...", "exit_code": 0 } ], "criteria": { "A production LogCatalogue: resolve a scope to LogTarget{Name,Kind,Node,Live} over the real owners, with the three honest-empty Reason codes served from real state": "DONE — fleetLogCatalogue in control-plane/cmd/control-plane/logs_wiring.go: the thin projection over the fleet-state read (logFleetReader.Devices) x the fixed service catalogue. A service resolves to one live service-unit target per node running it; a node to its units; service_not_deployed / node_has_no_units / operation_log_aged_out each served from real state. Proven: TestFleetLogCatalogueResolvesRealServiceUnits + TestFleetLogCatalogueEmptyAnswersCarryDistinctReasons (logs_wiring_test.go)", "A production FollowFunc for the hub — service-unit node follow + operation-log replay": "MOUNTED over the real hub (#806) via controlapi.HubFollower; the live-follow LINE SOURCE is honest-rested (ADR 0100): it needs two owners that do not exist in the tree — a service->systemd-unit-name mapping (undesigned; a slug is not its unit) and a remote node-journal streaming transport (journalctl -f/-n over the deploy/agent SSH door, an operator-log posture call). Both filed as #876 (needs-design) and #877 (needs-design). Until they land the follow FAILS LOUD (errLogSourceNotWired) and the download is the honest empty artifact / 404 for an unknown scope, never a fake tail. Ruled agent-side under ADR 0174 (mount = two-way door; sources = filed follow-ups) — see issue ruling comment", "Both wired into control-plane/cmd/control-plane/main.go's option list alongside the other reads": "DONE — main.go appends logsSurfaceOptions(c, gateResolver) UNCONDITIONALLY (whole and resting); composed gains logFleet, set to the real projection in composeWhole and emptyFleet in composeResting", "A regression that fails when a logs route is unregistered — the composition root asserted, not just the Option": "DONE — TestLogsMountedAtCompositionRoot builds the handler over a REAL composed control plane's logsSurfaceOptions and asserts all three routes answer 401 (mounted+gated), never 404; TestLogsSurfaceOptionsMountsAllThreeRoutes asserts the whole transport is mounted (logs_wiring_test.go)", "docs/slices/observability.yaml gains the mount slice so the map records it": "DONE — transport-log-mount (ticket 868) added after shell-logs-intent-mount, depends_on the catalogue/SSE/hub slices, recording the mount/composition slice the DAG never held" }, "summary": "Mounted the P10 logs transport on the real control plane over a production LogCatalogue, closing the 404 that every logs route answered on a shipped gateway, with a composition-root regression and the slice-map mount slice.", "reason": "The tier landed at its seams but was never mounted (main() wired neither WithLogCatalogue nor WithLogStream); this slice mounts it over real state. The live-follow line source (service->unit mapping + remote node-journal streaming) is genuinely-absent, undesigned infrastructure honest-rested per ADR 0100 and filed as #876/#877 (needs-design), ruled under ADR 0174.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#868
No description provided.