monitoring: per-service memory and health on the device cards — the wire rests mem_mb: null with no chip because no per-service monitoring slice exists #1433

Closed
opened 2026-09-12 15:03:41 +00:00 by ben · 3 comments
Owner

Parent

Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit 078cd5b3 on founding-ui-two-colour-rail-ceremony, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: cd dashboard && pnpm harness → http://localhost:5198/panel.html?scenario=steady&tab=<tab>.

Gap

The Overview device card lists each service on a device with its memory and a health pill (dashboard/src/components/shell/DeviceCard.vue:41-45). The wire (internal/controlapi/fleet.go FleetNodeService) sends mem_mb and chip as pointers that REST NULL/omitted by their own comment: "the classifier holds no per-service reading yet". So live, every service row reads — and (after the 2026-09-12 fix that made the card guard the absent chip instead of throwing) shows no pill. Nothing is wrong on the wire — the monitoring slice behind it does not exist.

Governing: DDR 0202 (device detail + cards), ADR 0100 (never a fabricated green), the monitoring classifier (internal/monitor).

What to do

  • internal/monitor: a per-service reading per node — memory from the service's cgroup (systemd MemoryCurrent via the agent's telemetry) and a per-service health verdict (the unit's active state + the existing service probe) — classified by the same classifier that grades node chips, never a second rule.
  • Join it onto FleetNodeService.MemMB / .Chip in the fleet projection; DeviceTelemetry for P9 gets the same rows.
  • Dashboard: fleetLive.test.ts asserts a running service reports a number and an up chip; the harness scenario chat-down already paints the down case.

Acceptance criteria

  • Given a device running chat and files, when the Fleet read returns, then each service row carries mem_mb > 0 and a chip with status: up.
  • Given a service whose unit is failed, then its chip is down with the classifier's label, and the device chip reflects it (one rule, DDR 0155 §3).
  • Given the agent has not reported yet, then both stay null and the card draws — with no pill.
## Parent Control-panel UI pass (Ben, 2026-09-10 → 09-12, commit `078cd5b3` on `founding-ui-two-colour-rail-ceremony`, merged to main 2026-09-12). Filed from the end-of-pass review (#1399 sweep): every place the shipped UI shows or implies something the product does not do yet. Browser harness: `cd dashboard && pnpm harness` → `http://localhost:5198/panel.html?scenario=steady&tab=<tab>`. ## Gap The Overview device card lists each service on a device with its memory and a health pill (`dashboard/src/components/shell/DeviceCard.vue:41-45`). The wire (`internal/controlapi/fleet.go` `FleetNodeService`) sends `mem_mb` and `chip` as pointers that REST NULL/omitted by their own comment: "the classifier holds no per-service reading yet". So live, every service row reads `—` and (after the 2026-09-12 fix that made the card guard the absent chip instead of throwing) shows no pill. Nothing is wrong on the wire — the monitoring slice behind it does not exist. Governing: DDR 0202 (device detail + cards), ADR 0100 (never a fabricated green), the monitoring classifier (`internal/monitor`). ## What to do - `internal/monitor`: a per-service reading per node — memory from the service's cgroup (systemd `MemoryCurrent` via the agent's telemetry) and a per-service health verdict (the unit's active state + the existing service probe) — classified by the same classifier that grades node chips, never a second rule. - Join it onto `FleetNodeService.MemMB` / `.Chip` in the fleet projection; `DeviceTelemetry` for P9 gets the same rows. - Dashboard: `fleetLive.test.ts` asserts a running service reports a number and an `up` chip; the harness scenario `chat-down` already paints the down case. ## Acceptance criteria - [ ] Given a device running chat and files, when the Fleet read returns, then each service row carries `mem_mb` > 0 and a chip with `status: up`. - [ ] Given a service whose unit is failed, then its chip is `down` with the classifier's label, and the device chip reflects it (one rule, DDR 0155 §3). - [ ] Given the agent has not reported yet, then both stay null and the card draws `—` with no pill.

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

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

Ruled by agent under ADR 0174 — veto anytime.

Decision: this slice ships the per-service monitoring reading and its join end-to-end — the wire block, the monitor projection, and the fleet-projection join — but defers the agent sampler's real per-service cgroup collection (systemd MemoryCurrent reads + the unit-discovery / slug↔unit mapping) to a follow-up SOURCE ticket.

What landed:

  • internal/enroll ResourceReadings gains a nullable Services []ServiceReading{service, mem_bytes?, active?} block — additive on the SAME heartbeat, no new agent binary/port/ingest surface (DDR 0202).
  • internal/monitor Orchestrator.NodeServiceReadings(id) grades each placed service by the SAME rule that grades the node chip: a standing critical alert names it down (the same alert deviceRow reflects — one rule, DDR 0155 §3), a fresh node whose unit reports active reads up, anything else no chip (never a fabricated green, ADR 0100); memory from the reported mem_bytes.
  • whole_surfaces.go joins that onto FleetNodeService.mem_mb / .chip.
  • fleetLive.test.ts asserts AC1/2/3; the harness steady/chat-down scenarios already paint the up/down cases.

Why two-way door: additive nullable wire block + a projection method + a projection join, all revertible by a later commit and proven by monitor/wire/dashboard seam tests. Not on the one-way list (no credentials, no security widening, no trust accept, no data destruction, no spend).

Deferred SOURCE: the agent (internal/sampler + the idss-agent report unit) does not yet read per-service cgroup memory or know which systemd unit a catalogue slug maps to — that mapping is deployment-side and needs its own slice, exactly as node-readings shipped the ingest+monitor (#208) before the sampler source (#1221). Until it lands the block rests nil and the card honestly draws — with no pill (AC3). Recommend a follow-up ticket: "monitoring: agent sampler fills the per-service cgroup memory + unit-active block on the heartbeat."

**Ruled by agent under ADR 0174 — veto anytime.** **Decision:** this slice ships the per-service monitoring *reading* and its join end-to-end — the wire block, the monitor projection, and the fleet-projection join — but **defers the agent sampler's real per-service cgroup collection** (systemd `MemoryCurrent` reads + the unit-discovery / slug↔unit mapping) to a follow-up SOURCE ticket. **What landed:** - `internal/enroll` `ResourceReadings` gains a nullable `Services []ServiceReading{service, mem_bytes?, active?}` block — additive on the SAME heartbeat, no new agent binary/port/ingest surface (DDR 0202). - `internal/monitor` `Orchestrator.NodeServiceReadings(id)` grades each placed service by the SAME rule that grades the node chip: a standing critical alert names it `down` (the same alert `deviceRow` reflects — one rule, DDR 0155 §3), a fresh node whose unit reports active reads `up`, anything else no chip (never a fabricated green, ADR 0100); memory from the reported `mem_bytes`. - `whole_surfaces.go` joins that onto `FleetNodeService.mem_mb` / `.chip`. - `fleetLive.test.ts` asserts AC1/2/3; the harness `steady`/`chat-down` scenarios already paint the up/down cases. **Why two-way door:** additive nullable wire block + a projection method + a projection join, all revertible by a later commit and proven by monitor/wire/dashboard seam tests. Not on the one-way list (no credentials, no security widening, no trust accept, no data destruction, no spend). **Deferred SOURCE:** the agent (`internal/sampler` + the `idss-agent report` unit) does not yet read per-service cgroup memory or know which systemd unit a catalogue slug maps to — that mapping is deployment-side and needs its own slice, exactly as node-readings shipped the ingest+monitor (#208) before the sampler source (#1221). Until it lands the block rests nil and the card honestly draws `—` with no pill (AC3). Recommend a follow-up ticket: "monitoring: agent sampler fills the per-service cgroup memory + unit-active block on the heartbeat."

close-report for #1433 — status success

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

envelope
{
  "issue": 1433,
  "status": "success",
  "commits": [
    "25a5fd12672fc39d522a55e2615419ac70397935"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/whole_surfaces.go",
    "control-plane/cmd/control-plane/whole_surfaces_test.go",
    "dashboard/tests/unit/fleetLive.test.ts",
    "internal/enroll/enroll.go",
    "internal/monitor/servicereadings.go",
    "internal/monitor/servicereadings_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/monitor/ ./internal/enroll/ ./internal/controlapi/ ./control-plane/cmd/control-plane/ ./internal/sampler/ ./internal/join/",
      "exit_code": 0
    },
    {
      "command": "vitest run tests/unit/fleetLive.test.ts",
      "exit_code": 0
    },
    {
      "command": "vue-tsc -p tsconfig.json --noEmit",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Given a device running chat and files, when the Fleet read returns, then each service row carries mem_mb > 0 and a chip with status: up": "internal/monitor/servicereadings.go NodeServiceReadings grades an active+fresh service up with MemMB from the report; proven by TestNodeServiceReadings_RunningServiceReportsMemAndUpChip and the production join TestWholeFleet_JoinsPerServiceMemoryAndChip (mem_mb=384, chip status up/ok); dashboard fleetLive.test.ts asserts memMb>0 + up chip on the files/chat rows",
    "Given a service whose unit is failed, then its chip is down with the classifier's label, and the device chip reflects it (one rule, DDR 0155 §3)": "serviceChip returns down from the SAME standing critical alert deviceRow reads; TestNodeServiceReadings_FailedServiceReadsDownFromTheSameAlert asserts chat chip down AND the rimu device row StatusToken=chat-down from the one alert; fleetLive.test.ts asserts rimu chat chip status down",
    "Given the agent has not reported yet, then both stay null and the card draws — with no pill": "no report -> perSvc empty -> MemMB nil and Chip nil; TestNodeServiceReadings_UnreportedDeviceStaysNull and TestWholeFleet_ServiceReadingsNullBeforeAgentReports assert null mem_mb + no chip; fleetLive.test.ts asserts matai (not-set-up) joins zero service rows and rimu chat mem_mb is null"
  },
  "summary": "Per-service memory and health now flow from monitoring onto the device cards' FleetNodeService.mem_mb/.chip, graded by the same rule that grades the node chip.",
  "reason": "",
  "blockers": []
}
**close-report** for #1433 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1433, "status": "success", "commits": [ "25a5fd12672fc39d522a55e2615419ac70397935" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/whole_surfaces.go", "control-plane/cmd/control-plane/whole_surfaces_test.go", "dashboard/tests/unit/fleetLive.test.ts", "internal/enroll/enroll.go", "internal/monitor/servicereadings.go", "internal/monitor/servicereadings_test.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/monitor/ ./internal/enroll/ ./internal/controlapi/ ./control-plane/cmd/control-plane/ ./internal/sampler/ ./internal/join/", "exit_code": 0 }, { "command": "vitest run tests/unit/fleetLive.test.ts", "exit_code": 0 }, { "command": "vue-tsc -p tsconfig.json --noEmit", "exit_code": 0 } ], "criteria": { "Given a device running chat and files, when the Fleet read returns, then each service row carries mem_mb > 0 and a chip with status: up": "internal/monitor/servicereadings.go NodeServiceReadings grades an active+fresh service up with MemMB from the report; proven by TestNodeServiceReadings_RunningServiceReportsMemAndUpChip and the production join TestWholeFleet_JoinsPerServiceMemoryAndChip (mem_mb=384, chip status up/ok); dashboard fleetLive.test.ts asserts memMb>0 + up chip on the files/chat rows", "Given a service whose unit is failed, then its chip is down with the classifier's label, and the device chip reflects it (one rule, DDR 0155 §3)": "serviceChip returns down from the SAME standing critical alert deviceRow reads; TestNodeServiceReadings_FailedServiceReadsDownFromTheSameAlert asserts chat chip down AND the rimu device row StatusToken=chat-down from the one alert; fleetLive.test.ts asserts rimu chat chip status down", "Given the agent has not reported yet, then both stay null and the card draws — with no pill": "no report -> perSvc empty -> MemMB nil and Chip nil; TestNodeServiceReadings_UnreportedDeviceStaysNull and TestWholeFleet_ServiceReadingsNullBeforeAgentReports assert null mem_mb + no chip; fleetLive.test.ts asserts matai (not-set-up) joins zero service rows and rimu chat mem_mb is null" }, "summary": "Per-service memory and health now flow from monitoring onto the device cards' FleetNodeService.mem_mb/.chip, graded by the same rule that grades the node chip.", "reason": "", "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.

Dependencies

No dependencies set.

Reference
Matou/idss#1433
No description provided.