Remove stale OpenCode service-failure monitor entry on Vega #225

Closed
opened 2026-09-12 19:49:24 +01:00 by nimmo · 3 comments
Owner

Problem

The composed services.serviceFailureMonitor.services list for Vega still contains opencode, but the OpenCode web-server systemd service was removed in commit c7e0a683. Current source has no systemd.services.opencode implementation; the remaining OpenCode references are CLI/package configuration.

Because the failure-monitor module applies unitConfig.OnFailure with lib.genAttrs, a stale name can create or modify a unit definition that no longer corresponds to an owned service and makes monitoring coverage misleading. AGENTS.md also still says Vega posts failures for opencode.

Scope

  • Remove the stale Vega failure-monitor entry.
  • Update the corresponding AGENTS.md topology statement.
  • Evaluate Vega's composed monitored-service list and ensure every entry maps to an intentionally owned unit.
  • Add a small assertion or regression check if practical so retired service names cannot linger silently.

Acceptance criteria

  • opencode is absent from Vega's composed failure-monitor list.
  • Every remaining composed name maps to an intended unit.
  • AGENTS.md matches current coverage.
  • Appropriate evaluation/checks pass.

Discovered while verifying the Monitoring and Service Investigation runbook for wiki issue #222 at source commit 556df88494.

## Problem The composed `services.serviceFailureMonitor.services` list for Vega still contains `opencode`, but the OpenCode web-server systemd service was removed in commit c7e0a683. Current source has no `systemd.services.opencode` implementation; the remaining OpenCode references are CLI/package configuration. Because the failure-monitor module applies `unitConfig.OnFailure` with `lib.genAttrs`, a stale name can create or modify a unit definition that no longer corresponds to an owned service and makes monitoring coverage misleading. `AGENTS.md` also still says Vega posts failures for `opencode`. ## Scope - Remove the stale Vega failure-monitor entry. - Update the corresponding AGENTS.md topology statement. - Evaluate Vega's composed monitored-service list and ensure every entry maps to an intentionally owned unit. - Add a small assertion or regression check if practical so retired service names cannot linger silently. ## Acceptance criteria - [ ] `opencode` is absent from Vega's composed failure-monitor list. - [ ] Every remaining composed name maps to an intended unit. - [ ] AGENTS.md matches current coverage. - [ ] Appropriate evaluation/checks pass. Discovered while verifying the Monitoring and Service Investigation runbook for wiki issue #222 at source commit 556df88494686003b1c4f20c8e0b99b5afc16a6e.
Author
Owner

Confirmed the stale entry is still live in source, so this was not already done: hosts/vega/default.nix listed "opencode" and no systemd.services.opencode exists anywhere in the tree.

Addressed in commit 078dacc on main:

  • Removed opencode from Vega's composed services.serviceFailureMonitor.services.
  • Corrected the AGENTS.md Paseo topology line, which still claimed Vega monitors opencode.
  • Added scripts/check-service-failure-monitor.nix, wired as checks.x86_64-linux.service-failure-monitor-coverage, which asserts every watched unit name on any monitoring host is owned by a real service definition (a description, an ExecStart, or an Exec script). The monitor's own generated stub carries only unitConfig.OnFailure, so unit existence in the evaluated config alone does not prove ownership.

Correction on the observable effect: the stale name produced a stub only in the evaluated configuration. NixOS's generator emits no unit file for a service with no ExecStart, so /etc/systemd/system/opencode.service never existed on Vega and systemctl status opencode.service reports "could not be found" on the old generation too. Absence of that unit file is therefore not a valid canary for this change.

Validation so far: nix flake check passes on all hosts and the new check builds; reverting the removal locally makes the new check fail on the opencode assertion, so the guard is sensitive to this drift rather than vacuously true.

Remaining before closure: a genuine deployment of the new configuration to Vega (test activation at minimum, plus a persistent generation and a no-op auto-update follow-up) confirming the closure builds and activates with monitored coverage unchanged for the intended units: paseo, atticd, trilium-server, docker-paseo-relay, docker-paseo-webui.

Confirmed the stale entry is still live in source, so this was not already done: `hosts/vega/default.nix` listed `"opencode"` and no `systemd.services.opencode` exists anywhere in the tree. Addressed in commit 078dacc on `main`: - Removed `opencode` from Vega's composed `services.serviceFailureMonitor.services`. - Corrected the AGENTS.md Paseo topology line, which still claimed Vega monitors `opencode`. - Added `scripts/check-service-failure-monitor.nix`, wired as `checks.x86_64-linux.service-failure-monitor-coverage`, which asserts every watched unit name on any monitoring host is owned by a real service definition (a description, an `ExecStart`, or an Exec script). The monitor's own generated stub carries only `unitConfig.OnFailure`, so unit existence in the evaluated config alone does not prove ownership. Correction on the observable effect: the stale name produced a stub only in the **evaluated configuration**. NixOS's generator emits no unit file for a service with no ExecStart, so `/etc/systemd/system/opencode.service` never existed on Vega and `systemctl status opencode.service` reports "could not be found" on the old generation too. Absence of that unit file is therefore **not** a valid canary for this change. Validation so far: `nix flake check` passes on all hosts and the new check builds; reverting the removal locally makes the new check fail on the `opencode` assertion, so the guard is sensitive to this drift rather than vacuously true. Remaining before closure: a genuine deployment of the new configuration to Vega (test activation at minimum, plus a persistent generation and a no-op auto-update follow-up) confirming the closure builds and activates with monitored coverage unchanged for the intended units: `paseo`, `atticd`, `trilium-server`, `docker-paseo-relay`, `docker-paseo-webui`.
Author
Owner

Live evidence on Vega (2026-10-07)

just test-remote vega (action test) completed at 16:33: captured snapshot built on Nova, closure signed on Electra, copied to Vega, activated with test. Activation reported no errors.

Post-activation state on Vega:

  • systemctl list-units --type=service --state=failed → 0 loaded units.
  • Monitored coverage unchanged for the intended units, all loaded active running: atticd, docker-paseo-relay, docker-paseo-webui, paseo, trilium-server.
  • /run/current-system and the numbered profile links are unchanged (newest is system-552-link, 16:01). The copied closure matched the running system, so the corrected configuration is byte-identical at the closure level.

That last point is the finding, not a failure: the stale opencode name had no runtime footprint at all, so removing it produces no new generation and no observable delta. A persistent generation plus a no-op auto-update follow-up is therefore unachievable by design for this change; the no-op was observed directly instead.

Acceptance criteria

  • opencode absent from Vega's composed failure-monitor list — confirmed by evaluating the flake.
  • Every remaining composed name maps to an intended unit — the new guard proves ownership (non-empty description, serviceConfig, or script) for every watched name on electra, lena, lyra and vega.
  • AGENTS.md matches current coverage — the Paseo topology line no longer claims Vega monitors opencode.
  • Evaluation/checks pass — nix flake check passes, including checks.x86_64-linux.service-failure-monitor-coverage; reverting the removal locally makes that check fail, so the guard is not vacuous.

Closing. The durable value of this change is the evaluation-time guard, since this class of drift is invisible on the ground.

## Live evidence on Vega (2026-10-07) `just test-remote vega` (action `test`) completed at 16:33: captured snapshot built on Nova, closure signed on Electra, copied to Vega, activated with `test`. Activation reported no errors. Post-activation state on Vega: - `systemctl list-units --type=service --state=failed` → 0 loaded units. - Monitored coverage unchanged for the intended units, all `loaded active running`: `atticd`, `docker-paseo-relay`, `docker-paseo-webui`, `paseo`, `trilium-server`. - `/run/current-system` and the numbered profile links are unchanged (newest is `system-552-link`, 16:01). The copied closure matched the running system, so the corrected configuration is **byte-identical at the closure level**. That last point is the finding, not a failure: the stale `opencode` name had no runtime footprint at all, so removing it produces no new generation and no observable delta. A persistent generation plus a no-op auto-update follow-up is therefore unachievable by design for this change; the no-op was observed directly instead. ## Acceptance criteria - [x] `opencode` absent from Vega's composed failure-monitor list — confirmed by evaluating the flake. - [x] Every remaining composed name maps to an intended unit — the new guard proves ownership (non-empty `description`, `serviceConfig`, or `script`) for every watched name on electra, lena, lyra and vega. - [x] AGENTS.md matches current coverage — the Paseo topology line no longer claims Vega monitors `opencode`. - [x] Evaluation/checks pass — `nix flake check` passes, including `checks.x86_64-linux.service-failure-monitor-coverage`; reverting the removal locally makes that check fail, so the guard is not vacuous. Closing. The durable value of this change is the evaluation-time guard, since this class of drift is invisible on the ground.
nimmo closed this issue 2026-10-07 16:40:22 +01:00
Author
Owner

Persistent deployment evidence (2026-10-07, after the earlier test activation)

Pushed from Electra, pulled on Vega, then just deploy on Vega completed at 16:44:

  • Vega's flake clone /home/nimmo/nixos-config is at 078daccf563eb957ae2af85078c388bd9148db73 — the pull landed, so the deployed generation carries this change.
  • New persistent generation created and activated: system-553-link -> /nix/store/mbdvws6gb4s5qmzfhj4fqll8i1chgc3f-nixos-system-vega-…, and /run/current-system now points to it.
  • systemctl list-units --type=service --state=failed → 0 units.
  • Monitored coverage unchanged and healthy: atticd, docker-paseo-relay, docker-paseo-webui, paseo, trilium-server all loaded active running.
  • Still no /etc/systemd/system/opencode.service, as expected.

Correction to the previous comment: the earlier test-remote activation produced no new generation, but that was specific to that build path. A direct just deploy on Vega does create a new generation, so "byte-identical closure" was not a general property of this change. What is stable and confirmed is narrower: the stale name produces no unit file and no runtime state change either way, so unit-file absence and systemctl status are not valid canary signals; the evaluation-time guard is the gate that catches this drift.

## Persistent deployment evidence (2026-10-07, after the earlier test activation) Pushed from Electra, pulled on Vega, then `just deploy` on Vega completed at 16:44: - Vega's flake clone `/home/nimmo/nixos-config` is at `078daccf563eb957ae2af85078c388bd9148db73` — the pull landed, so the deployed generation carries this change. - New persistent generation created and activated: `system-553-link -> /nix/store/mbdvws6gb4s5qmzfhj4fqll8i1chgc3f-nixos-system-vega-…`, and `/run/current-system` now points to it. - `systemctl list-units --type=service --state=failed` → 0 units. - Monitored coverage unchanged and healthy: `atticd`, `docker-paseo-relay`, `docker-paseo-webui`, `paseo`, `trilium-server` all `loaded active running`. - Still no `/etc/systemd/system/opencode.service`, as expected. **Correction to the previous comment:** the earlier `test-remote` activation produced no new generation, but that was specific to that build path. A direct `just deploy` on Vega does create a new generation, so "byte-identical closure" was not a general property of this change. What is stable and confirmed is narrower: the stale name produces **no unit file and no runtime state change either way**, so unit-file absence and `systemctl status` are not valid canary signals; the evaluation-time guard is the gate that catches this drift.
Sign in to join this conversation.
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.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#225
No description provided.