Repository navigation
Description
Summary
pm-stack/opencode-claimant/claimant.py at HEAD (b5ddb39744) reads the mode in main() and then only uses it for one thing: whether to run supervision_step(). It is never consulted before a launch.
# claimant.py:512-550
mode = read_mode()
if mode == "live":
supervision_step(mode)
...
launched, skips = launch_step(mode, cap_room) # mode is passed and ignoredlaunch_step(mode, cap_room) takes mode as a parameter and never reads it. The body goes straight from the cap check to POST /api/session and repo-queue bind.
The task packet (pm-stack/opencode-claimant/prompt.md, §MODE) is explicit: "In shadow mode ... Never claim, bind, launch, or mutate a task in shadow mode." The living fire instruction is equally explicit that shadow is the default when ~/.local/state/opencode-claimant/mode is absent.
Reproduction (verified 2026-11-08, laptop)
Patched read_mode → "shadow", run_poll → one valid handed_off candidate, and stubbed subprocess.run to record argv:
$ python3 <stub harness invoking claimant.main()>
OpenCode claimant starting in shadow mode
Running gate step...
Running cap step...
Cap room: 36 sessions available
Running launch step...
Fire complete. Launched 1 sessions.
subprocess calls:
curl -s -m 10 -X POST ... -d {"location": {"directory": "/home/user/git/code"}, ...} http://127.0.0.1:13420/api/session
repo-queue bind 999999 --worker opencode-claimant --session-id ses_FAKE --launched-by opencode-claimant
main() returns 0 having created and bound a session while mode == "shadow".
Why it is invisible today
Shadow is currently safe by accident, not by design: gate_step() → run_poll() → poll.py → repo-queue list, which prints a human table (#7325), so every queue reads empty and the fire exits before launch_step. The moment #7325 lands — or any caller passes a candidate list, or the mode file is written live and later reverted while a fire is in flight — the guard that should have stopped it does not exist.
This is the same class as the shadow-vs-live boundary the packet relies on for the parallel-run gate: the gate is supposed to be "mode file says shadow ⇒ nothing is mutated", and that property is presently unenforced.
Suggested acceptance
launch_steprefuses to create/bind whenmode != "live"(early return([], [{"reason": "shadow_mode"}])), andmain()does not call it in shadow mode at all — belt and braces, since the packet describes shadow as read-only by construction.supervision_step's recovery path is likewise unreachable in shadow mode (it already returns early — pin it with a test that asserts nosubprocess.runargv containsbindorDELETE).- Test that fails today: with
read_mode→"shadow", one candidate, and a recording subprocess stub, assert zero calls whose argv containsbind,DELETE, or aPOSTto/api/session. - Test the inverse:
read_mode→"live"still launches, so the gate is not a silent kill switch.
Found by the laptop opencode-lane claimant fire 2026-11-08 (shadow), while working #3026 slice 1. Related: #7356 (launch_step's other missing steps), #7325 (the gate that currently masks this), #6257.
Acceptance criteria
- In shadow mode,
launch_stepperforms no session create, norepo-queue bind, and no other mutation — the mode argument is consulted before any launch action, per the packet's §MODE rule ('Never claim, bind, launch, or mutate a task in shadow mode'). - In live mode, launches proceed as today.
- The filer's stub harness (patched
read_mode→ shadow, one validhanded_offcandidate, recorded argv) shows zero mutating subprocess calls after the fix.
Activity
developing-today commentedon Nov 8, 2026
CODE-2268
dezren39 commentedon Nov 8, 2026
Shadow-fire evidence, 2026-11-08T13:03:42Z (laptop OpenChamber scheduled task, route
opencode-route/workhorse):~/.local/state/opencode-claimant/modeabsent → shadow (fail-safe default). Fire log line appended tofires.jsonl; reportshadow-fire-20261108T130342Z.json.progress.stage=handed_off, unbound, attempts 8/24). No bound opencode-lane task anywhere,stuck_bound0.cap_room7 of 36 (poll.py); shadow-report independently read 27/36 active at 13:02Z.claimant.pynot executed. At HEAD (54f6bee)launch_step()still takesmodeand ignores it, so a shadow run is safe only by accident: discovery is currently blind (opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325/opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375), and if that were fixed the same fire would create and bind. That is a fail-open guard, not a guard. The other live blockers also still stand: unauthenticated server calls (opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367) and no prompt send (opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356).~/.local/state/opencode-claimant/shadow-report.py(broker/list rich=true), matching prior fires. Nothing was claimed, bound, launched, prompted or deleted.An unmerged fix already exists at
36dfeed100(worktree7c7733/opencode-claimant-shadow:run_shadow_fire()ahead of every mutation,launch_stepguard,test_shadow.py), based on65beb42c1a; it predatesf52007d116/54f6bee9dfand needs a rebase onto HEAD rather than a straight merge.dezren39 commentedon Nov 8, 2026
🤖 Agent note · design-architect pass 74 — adopted as a phase of design #7770
files/designs/code-claimant-seam-contract.mdin the keep-the-four-repos-healthy goal workspace. Audit at origin/mainb64288a567.dezren39 commentedon Nov 8, 2026
Intake review
Related: packet rule:
pm-stack/opencode-claimant/prompt.md§MODE; siblings #7356 (same function's missing prompt send) and #7367 (same function's unauthenticated calls); #7325 is the discovery bug currently masking this one.Live check: verified today on the laptop with the stub harness at HEAD
b5ddb39744; no merged fix in this run's scan. Currently masked because discovery returns no candidates — once #7325/#7375 lands, an unpatched shadow fire would create and bind real sessions.Notes / risks: shadow is the DEFAULT when the mode file is absent, so the unsafe path is the default path. The fix is small; the regression test (the filer's harness, committed) is what keeps it fixed.
Suggested approach: gate the top of
launch_stepon mode, return the shadow skip explicitly, and commit the stub-harness test.— fleet monitor (repo-fleet-monitor), 2026-11-08 12:12 CST run: acceptance criteria appended to the body, labels normalized,
meta/enrichedapplied.dezren39 commentedon Nov 8, 2026
🤖 Agent note · done (already done)
dezren39 commentedon Nov 11, 2026
🤖 Agent note · Phase 4 evidence (design #7770 closing audit, issue #7772, task 14782)
pm-stack/opencode-claimant/README.md(PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367): shadow mode mutates nothing (gate insidelaunch_step); the landed launch order is create → verify location → bind → verified prompt (the opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356 resolution — a prompt that cannot be landed leaves the binding standing for supervision, superseding the design text's create → prompt → bind order, recorded in the README contract statement).-1sentinel ascap_room— nownull; a failed candidate discovery was logged identically to a verified empty queue —gate_stepnow returnsNoneon discovery failure and the fire logscandidates_seen: nullwith reasongate_unknown. Two new tests pin both (TestCapUnknownFireLog,TestGateUnknownFireLog); the full claimant suites pass (80 + 5 + 50 tests).