You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Silent-failure surfacing: claimant mode + pm-git-sync health must be visible #10141
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.
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 saysshadow 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:
Baseline (real mode file): no claimant item.
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.
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.
Activity
developing-today commentedon Nov 14, 2026
CODE-3568
Merge pull request #10309 from developing-today/pm-stack/close-author…
dezren39 commentedon Nov 14, 2026
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 thepm-git-sync/pm-projector-reconcile/pm-kaneo-sync-guard/pm-dashboard-backupunit + timer states to~/.local/state/pm-aggregator/host-health.json. Live now (timer enabled; first snapshots written; claimant currently readslive).src/host-health.ts+ watchdog derivation +cfg.hostHealthFile(envPM_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-reconcilestuck inactivating>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 loudCLAIMANT-MODE-WARNINGline to stderr. Live now: the claimant runs from the primary checkout, which pm-git-sync pulled to the merge commit.shadowis 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-aggregatorbuilt 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:--mode-filepointed 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.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);tscclean in all touched files.Today's real pm-git-sync failure illustrates the channel: it sat
failedthis 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.servicestill runs the pre-merge package because a fullnixos-rebuild switchfrom current main fails in unrelatedpkgs/id(zig 0.16OptimizeMode.smallremoval) — filed as #10313. pm-aggregator itself builds clean (above). Onenixos-rebuild switchafter #10313 lands completes the production deploy; every other part of this slice is already live.