Skip to content

claimant mode file: guard the silent-deletion single point of failure #10332

Open

Description

@dezren39

Problem (five words: silent mode deletion shadows claimant)

The opencode claimant's mode file (~/.local/state/opencode-claimant/mode on the laptop) is an unguarded single point of failure: when the file is missing, the claimant silently defaults to shadow mode (discovery only, no launches) with no signal. This has now bitten twice:

Acceptance

  • Mode file deletion or unreadability produces a VISIBLE alert within one surfacing cycle (wire into the Silent-failure surfacing: claimant mode + pm-git-sync health must be visible #10141 silent-failure surfacing, now live) instead of a silent shadow fallback.
  • Claimant startup/heartbeat records the mode it read and where from, so a flip is attributable in the log after the fact.
  • Consider making the mode part of managed config (repo/systemd state) rather than a bare file any process can delete.
  • A missing file must never again present as 'summits just aren't launching' for hours.

Refs: #9106, #10141, #9103. Filed from the 2026-11-14 summit-pool investigation (Track B).

Activity

  1. developing-today commented on Nov 14, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    Third occurrence, 2026-11-15/16 (opencode-claimant scheduled fire, laptop).

    Evidence from ~/.local/state/opencode-claimant/fires.jsonl and the fire captures:

    • claimant-fire-exec-20261115T233030Z.out: starting in live mode.
    • fires.jsonl entries 2026-11-16T00:16:21Z / 00:16:25Z / 00:16:32Z: mode shadow -> live -> shadow within 11 s. These are off the 5-minute fire grid, so manual or test-harness invocations, not scheduler fires.
    • Every fire after 00:16:32Z read shadow; the scheduled fires at 04:30:42Z and 04:35:22Z read a MISSING file.
    • claimant-fire-exec-20261116T043039Z.err is the first capture carrying the Silent-failure surfacing: claimant mode + pm-git-sync health must be visible #10141 loud warning: mode file /home/user/.local/state/opencode-claimant/mode is MISSING - defaulting to shadow; dispatch will return mode_not_live and stall.

    So the deletion window is bounded: file present and live at 2026-11-16T00:15:27Z, three flips ending shadow by 00:16:32Z, gone by 04:30:42Z. The flips match the real-install mutation pattern in #8742 (tests can switch the real installation's mode); a harness that writes the mode file and removes it on teardown would produce exactly this sequence. No test in pm-stack/opencode-claimant/ references MODE_FILE or unlink, so attribution is still open from these logs alone.

    Impact: the opencode lane has been shadow-only for ~4 h. No candidates existed in any of the four queues during those fires (cap_room 32 of 36, 4 active roots), so nothing was lost this time; the next real candidate would have stalled exactly as in the #9106 case.

    The claimant did NOT recreate the file: restoring mode is an operator decision, and the fire recorded the state plus the warning instead. That covers the "record the mode it read and where from" acceptance item; the alerting half still depends on wiring #10141's warning into the health surface.

  3. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    Read-only live verification, Nov 16 ~05:00 UTC: mode path still absent; recent claimant fires report shadow. The host-health collector completed successfully at 04:55:02 UTC, snapshot generatedAt=2026-11-16T04:55:02.830612+00:00 and claimantMode.state=missing. The currently running packaged aggregator’s /api/attention.json returns item watchdog:claimant-mode with the explicit missing-file/shadow/dispatch-stall reason. This verifies the alert on the actual active service, not just HTTP 200 or a source blob. The tracked #8742 shell harness really does write shadow, write live, run the claimant, then rm -f the literal live mode path, but no event yet proves it caused this disappearance. Keep #8742 isolation and incident attribution separate; no mode restoration or service changes in this check.

  4. dezren39 commented on Nov 16, 2026

    @dezren39
    MemberAuthor

    Drew authorized restoration Nov 16. Rechecked missing state and created the mode file atomically without overwriting any operator update; regular fires at 05:21:26Z and 05:22:07Z reported live with zero candidates and zero launches (no forced run). The 05:20 host-health snapshot was live and the missing-mode attention card cleared. #10612 merged the offline replacements for both dangerous Slice 1 scripts and Make test targets after 113 unit and four safety checks; it prevents that deletion path on updated checkouts, not proof it caused this incident. Keep incident attribution and any managed-mode hardening separate; no restart or silent auto-restore was added.

  5. dezren39 commented on Nov 17, 2026

    @dezren39
    MemberAuthor

    Triage verdict (repo-queue task 19233, openchamber scheduled lane, 2026-11-17 UTC)

    Fresh state: issue is OPEN, no labels. Checked the comments through 2026-11-16 05:30Z.

    Status of the four acceptance items:

    1. Visible alert on missing/unreadable mode file: done in part. Comment 2026-11-16 04:58Z verifies the watchdog:claimant-mode attention item on the live aggregator. Remaining: the alert is only proven on the live host, not as a regression test.
    2. Record mode read and source at startup/heartbeat: partly done. The fire capture records the mode state (2026-11-16 04:37Z). Not yet confirmed that every startup logs the path it read.
    3. Managed config instead of a bare file: open. No decision recorded. This is the hardening item that needs a design choice.
    4. A missing file must not look like "summits just aren't launching": covered by item 1 on the live host.

    Other facts from the thread: mode restored 2026-11-16 05:21Z under Drew's authorization. #10612 blocks the test-harness rm -f on the real mode path, but attribution of the 2026-11-16 deletion is still open.

    Verdict: keep open. Not a closure candidate. The remaining work is items 2 and 3 plus attribution, and it belongs to the claimant owner (#9106/#10141 track). I did not route a new packet: item 3 needs a design decision first, and a worker packet now would duplicate work already in progress. Recommend the owner decide on managed config and add a regression check for the alert.

  6. dezren39 commented on Nov 18, 2026

    @dezren39
    MemberAuthor

    Triage — queue task 20565, openchamber scheduled lane (oc-code-03), 2026-11-18.

    Fresh GitHub state (08:52 UTC): #10332 OPEN, no labels, no native blockers. The 2026-11-17 verdict still applies: items 1 and 4 are covered on the live host. Item 2 (startup logging of the mode path) and item 3 (managed config, which needs a design decision) remain open, with attribution of the 2026-11-16 deletion.

    Verdict: triaged, keep open with the claimant owner (#9106/#10141 track). No follow-on packet enqueued, because item 3 needs a design choice before any worker packet makes sense.

  7. added a commit that references this issue on Nov 18, 2026
  8. removed their assignment
    on Nov 20, 2026
  9. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    Merged work, still open. Every pull request that references this issue has merged (#10612, #11794) and none is open, but the issue kept status:in-review. Tasks that name it as a blocker have been waiting on it.

    status:in-review is removed. Whoever takes this next: run the issue's done check against main. Close the issue if it passes; if not, list what is left here and carry on with it (AGENTS.md, "Finishing work").

    By: Claude, 2026-11-22 flow review.


    Generated by Claude Code

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions