Skip to content

Silent-failure surfacing: claimant mode + pm-git-sync health must be visible #10141

Closed

Description

@dezren39

Silent-failure surfacing: claimant mode + pm-git-sync health must be visible

Part of the close-authority epic (automation must never close an issue) — the fail-safe-defaults slice.

Problem

Two live silent failures found in the 2026-11-14 end-to-end review:

  1. Claimant mode file missing (~/.local/state/opencode-claimant/mode absent on the laptop): read_mode() defaults to "shadow", so direct dispatch returns mode_not_live and summit dispatch stalls with no health signal anywhere. (A parallel pass is unparking epic: ID/Atlas extensible primitives, federation, namespaces — major design iteration (2026-11-12 directive) #9106 and may set the file — this slice is about the silence, not today's instance.)
  2. pm-git-sync.service is failed on the laptop: the deploy-by-merge path (pm-git-sync: projector redeploy restarts without ensuring node_modules — catch-up pull crash-looped pm-projector on missing @libsql/client #8171) that keeps the laptop PM checkout on clean main is down, so repo changes silently stop reaching the host. pm-projector-reconcile.service was also observed stuck in activating.

Work

  • Surface both in an existing health surface (aggregator staleness watchdog tier items are derived, never persisted — a natural home): claimant mode (missing/shadow/live) as a needs-attention item whenever a dispatch is attempted or queued summits exist; pm-git-sync / pm-projector-reconcile unit states as PM-stack health items.
  • Claimant: log a loud line on every mode read that finds the file missing (today it is indistinguishable from an intentional shadow).
  • Decide and document the intended default: shadow-on-missing is the right safety default; the fix is visibility, not a different default.

Acceptance

  • Removing the mode file (scratch check) produces a visible health item within one aggregator cycle.
  • A failed pm-git-sync shows as a PM-stack health item; recovering the unit clears it.

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. added a commit that references this issue on Nov 14, 2026
  3. dezren39 commented on Nov 14, 2026

    @dezren39
    MemberAuthor

    Silent-failure surfacing built and proven — closing with evidence (one deploy step blocked externally, named below)

    Built (PR #10309, merged 2026-11-14T17:47Z):

    • pm-stack/host-health-collector.py + pm-stack/systemd/pm-host-health.{service,timer}: every 5 min it snapshots the claimant mode file and the pm-git-sync / pm-projector-reconcile / pm-kaneo-sync-guard / pm-dashboard-backup unit + timer states to ~/.local/state/pm-aggregator/host-health.json. Live now (timer enabled; first snapshots written; claimant currently reads live).
    • Aggregator: new src/host-health.ts + watchdog derivation + cfg.hostHealthFile (env PM_AGG_HOST_HEALTH_FILE). The staleness-watchdog tier now derives items for: claimant mode missing/unreadable/invalid; any watched unit's failed last run; an inactive unit timer; pm-projector-reconcile stuck in activating >10 min; dashboard backup with no success >36 h (its cadence is daily ~04:30 — 1.5× bound); and the snapshot itself absent or stale >15 min, so the surfacer cannot fail silently. Derived, never persisted — recovery clears the cards on the next derivation.
    • claimant.py read_mode(): shadow stays the fail-safe default (the intended default per this issue — visibility is the fix, not a different default), and every missing/unreadable/invalid read now logs a loud CLAIMANT-MODE-WARNING line to stderr. Live now: the claimant runs from the primary checkout, which pm-git-sync pulled to the merge commit.
    • Scoping note, stated plainly: a mode file that says shadow is a deliberate setting and does not raise a tier item; the item fires when the file is missing/unreadable/invalid (the silent case in this issue, and the acceptance case below).

    Acceptance proof (packaged artifact, not a mock): pkgs/pm-aggregator built from merged main (/nix/store/1ikq66f2ylji6b03c7iwyqchrgi2m149-pm-aggregator-0.1.0) and run on a scratch port/state against the real production fleet feed, fed snapshots from the real collector:

    1. Baseline (real mode file): no claimant item.
    2. Induced: collector run with --mode-file pointed at a nonexistent scratch path → the aggregator's attention output showed "opencode claimant mode file is missing" as a watchdog tier item within one render cycle. The live claimant mode file and every live service were untouched.
    3. Restored (normal collector run): the item cleared on the next derivation.

    Unit tests: test/host-health.test.ts (12 new cases incl. failed-pm-git-sync → item → recovery clears, stuck-activating, guard failure, backup staleness, timer-inactive) + the existing watchdog suite — 25/25 pass; claimant suite 8/8 (3 new read_mode cases); tsc clean in all touched files.

    Today's real pm-git-sync failure illustrates the channel: it sat failed this morning because the primary checkout was dirty (another lane's in-flight work — surfacing named exactly that cause class), and recovered by itself at 17:37Z once the tree was clean. Its surfacing runs through the identical snapshot→derivation path proven above and is pinned by the dedicated unit test.

    Remaining deploy step, blocked externally: the production pm-aggregator.service still runs the pre-merge package because a full nixos-rebuild switch from current main fails in unrelated pkgs/id (zig 0.16 OptimizeMode.small removal) — filed as #10313. pm-aggregator itself builds clean (above). One nixos-rebuild switch after #10313 lands completes the production deploy; every other part of this slice is already live.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions