Repository navigation
feat(bin): add steering-inbox read receipts so read steers stop unread alarms - #7453
tiago-peixoto wants to merge 12 commits into
Conversation
|
Speaking as Kun's firstmate: thank you @tiago-peixoto for this, and for the live labs. The base-commit repro of #7280 next to the fixed run is exactly the evidence that helps here. Checked head Contract-class: restore. This is my own read, not the PR's "opt-in" label. The worker brief gets a new step, so it is not opt-in. It restores the stated meaning of an existing default alarm ("unread … stays unhandled"), and it only stops that alarm for a message the worker has provably read. That matches the bar set on #7280. Note for reviewers: the receipt also takes a read message out of the idle-pane ladder and out of the dead-endpoint "unread" escalation. That is consistent with "unread", but those two paths are not covered by the live runs. VISION.md: One captain: aligns (removes a false recovery turn per long steer). Authority: aligns (no new grant; the worker still has to move the message to handled/). Scripts own mechanics: aligns (receipt and policy live in Status: waiting on CI, nothing needed from you right now. The only red was |
bf2932f to
ad31aa0
Compare
|
Speaking as Kun's firstmate (OSS triage): thanks @tiago-peixoto for rebasing onto current main and re-raising through no-mistakes. Re-checked head Contract-class (my own read): restore. VISION.md: all seven sections align (no captain-facing surface; refusal path kept for never-read steers; script mechanics; durable per-message receipts; no vendor coupling). CI: everything is green except Behavior portable serial 5, which failed in |
|
Speaking as Kun's firstmate: thanks @tiago-peixoto for merging main in again and re-raising through no-mistakes. I re-read head What changed since my 10-18 look ( A correction on contract-class (my mistake earlier): new-default, not restore. I'm sorry for the back-and-forth. I called this restore on 10-17 and 10-18 because it keeps the meaning of the "unread" alarm. On a closer tip-vs-main read, it changes the default path for every unconfigured home:
All of that is well-motivated, but it's new unconfigured behavior, not a broken default being restored. So once it's otherwise ready, Kun makes the merge-or-leave call himself. VISION.md (per rule): one captain aligns (removes a false recovery turn per long steer) · authority aligns (no new grant; a never-read steer still escalates) · scripts aligns (receipt and policy live in One thing needed from you before this is ready: no-mistakes' Document step flagged that Rovo's bash tool is confined to the worktree ( CI: everything was green except Behavior portable serial 2, cancelled at the 30-minute ceiling (known #7255). I've re-run it once. Status: waiting on you for the Rovo point. After that, plus green CI, this goes to Kun as a new-default decision. |
d7bf037 to
89d2ebd
Compare
|
Speaking as Kun's firstmate: thank you @tiago-peixoto. The file-tool fallback is exactly what I asked for on the Rovo point, and the review round's follow-up was a good catch: the fallback sentence now hands file tools an unquoted literal path ( Re-checked head Contract-class (my own read): new-default, unchanged from 10-22. Every unconfigured home's briefs gain a mandatory receipt step, and a receipt takes a message out of three default escalations. VISION.md per rule: One captain aligns · Authority aligns (no new grant; never-read steers still escalate) · Scripts aligns · Restart aligns (durable receipts, cleared on relaunch) · Delegation aligns · Vendor now aligns (file-tool fallback for harnesses confined to the worktree) · Scope aligns. Status: with Kun, not waiting on you. Because this changes the default path, the merge-or-leave call is Kun's. Nothing more is needed from you unless he asks. |
89d2ebd to
9297018
Compare
|
Speaking as Kun's firstmate: thanks @tiago-peixoto for bringing this up to current main. I compared the new head Contract-class (my own read, unchanged): new-default. Every unconfigured home's briefs gain a mandatory receipt step. VISION.md per rule: every rule still aligns, as on 10-22. Status: standing captain-decision hold, with Kun, not waiting on you. Nothing more is needed from you unless he asks. |
9297018 to
9ad47ec
Compare
|
Speaking as Kun's firstmate: thanks @tiago-peixoto. I compared the new head CI: 18 of 19 checks are green. Behavior portable serial 1 hit the 30-minute cap cancel that main also hits, so I've rerun it (run Contract-class (my own read, unchanged): new-default. VISION.md aligns on every rule, as before. Status: standing captain-decision hold, with Kun, not waiting on you. |
…ith read receipts
9ad47ec to
01bba08
Compare
…ex must not keep an abandoned claim unrecoverable` in tests/fm-claude-stop-autoarm.test.sh has a racy fixture, not a product defect, and nothing in this PR's diff reaches it (the PR touches no file the fixture copies; the same case passed on this branch's five earlier CI runs and the one failing main run today failed a different case). Mechanism: the fixture starts a holder that runs fm_lock_try_create on the steal mutex, polls for the owner's pid file, then SIGKILLs the holder. But fm_lock_prepare_owner writes the pid before the symlink appears, and fm_lock_claim then rewrites the same pid file with a truncating redirect right after the link appears. A KILL that lands between truncate and write leaves an empty pid file. fm_lock_mid_acquire_is_fresh treats a fresh pid-less lock as a mid-acquire claim for 2 s, so fm_lock_reap_dead_link refuses, fm_autoarm_release_abandoned fails, and the hook exits 0 instead of 2. Reproduced locally by constructing that end state: empty pid -> exit 0, no arm, mutex left (exactly the CI symptom); dead numeric pid -> exit 2. Invariant: a fixture must kill a lock holder only after the holder itself reports the claim complete, never on a side effect that appears mid-acquisition. Sibling site with the identical pattern: leave_dead_link_locks in tests/fm-watcher-lock.test.sh (polls the last lock's pid file, then KILLs); three of its four callers are exposed (the fourth pins a dead pid afterwards). Other holder fixtures in tests/fm-wake-queue.test.sh already use the correct ready-marker shape. Fix (tests only): in both fixtures the holder now creates a ready marker after fm_lock_try_create returns; the test waits for that marker (up to ~5 s, matching the watcher-lock file's existing child-startup bound), fails explicitly if the holder never claims, kills, then removes the marker. Removed the now-unused `last` variable in the watcher-lock helper. Comments explain the ordering hazard. Verification: bin/fm-lint.sh on both files passes (full ShellCheck extended analysis, rc=0). bash tests/fm-claude-stop-autoarm.test.sh passes (63 ok, rc=0) and bash tests/fm-watcher-lock.test.sh passes (42 ok, rc=0), both including the dead-steal reclaim cases. A 60-iteration CPU-loaded stress of the original fixture was started but I stopped it before completion, so it provided no evidence either way; the mechanism rests on the code trace plus the end-state reproduction. Not addressed: the separate ci-2 cancelled-without-verdict check (Behavior portable serial 1) was left unselected and needs a human decision
|
Speaking as Kun's firstmate: thanks @tiago-peixoto for the new push. Short update for the head change. I compared
CI on Contract-class: new-default (unchanged). VISION: unchanged, every rule aligns. Status: still a standing captain-decision hold. This isn't waiting on you. Kun decides whether it lands, and this update doesn't change that. |
Fixes #7280.
Commit
ff43e3cafixes a pre-existing test-fixture race intests/fm-watcher-lock.test.shandtests/fm-claude-stop-autoarm.test.sh.Behavior portable serial 1was cancelled at the 30-minute limit, as on main run 40101665463.What Changed
bin/fm-task-inbox-read.shandfm_task_inbox_record_read/fm_task_inbox_is_read/fm_task_inbox_clear_readsinbin/fm-task-inbox-lib.sh: a worker writes an empty<task>.inbox/.read/NNN.msgreceipt right after reading a steer, andfm-spawn.shclears all receipts on every worker launch (refusing to launch if it cannot).fm-task-inbox-lib.shandfm-watch.shnow tracks the oldest unread record instead of the oldest unhandled one, so a read-but-still-pending message no longer re-rings, counts toward the busy budget, or escalates to a stuck-crewmate wake; thehandled/move remains the completed-handling acknowledgement.fm-remote-home-seed.shmaps the receipt command to the remote code root) now instruct the read-receipt step with a file-tool fallback; the Rovo grant comment, skills, docs, test-family routing, and tests for brief, relaunch, inbox ladder, and remote lifecycle are updated accordingly.Risk Assessment
✅ Low: The read receipt only removes a provably read record from unread detection while leaving defaults, the handled/ move, and every other liveness alarm unchanged; I traced the busy, ring, escalate, retry, dead-endpoint, relaunch, and remote-seed paths and found no sequence that silences a never-read message or re-alarms a read one, and the new tests exercise the real watcher for both halves of the intent.
Testing
Ran the four targeted test files (inbox, brief, relaunch, remote secondmate end-to-end), each of which starts real fm-watch.sh, fm-control.sh, fm-spawn.sh, fm-brief.sh or fm-remote-home-seed.sh processes. Inbox, brief and relaunch files passed fully; the relaunch file first failed on the known host trap where a redirected HOME breaks the mise python3 shim and passed once the real interpreter directories were placed ahead on PATH. The remote end-to-end file passed its new read-receipt check and then failed at the pre-existing, already-declined "remote spawn never reached its blocked inheritance write" step. Beyond the test files, hand-driven transcripts against the real watcher at default thresholds show unread steers escalating with the stuck-busy and dead-pane reasons, read steers staying quiet across many busy polls and an idle poll without being retired, an unread successor escalating by name, and a removed receipt restoring the alarm. A scaffolded brief's receipt command, file-tool fallback path and handled move were executed verbatim against a real inbox record. Defaults confirmed unchanged at grace 90, ring max 3, busy max 2. No visual surface exists for this change, so no screenshots were taken. A real Claude worker interpreting the brief was not spawned.
claudeworker spawned in a disposable lab home and a model turn interpreting the brief; the previous test round was cut at the 30-minute budget attempting long liv…Evidence: Real watcher at default thresholds: unread vs read vs successor vs deleted receipt
Source: Real watcher at default thresholds: unread vs read vs successor vs deleted receipt
Evidence: Driver script for the default-threshold watcher transcript
Source: Driver script for the default-threshold watcher transcript
Evidence: Dead pane: unread record escalates, read record does not
Source: Dead pane: unread record escalates, read record does not
Evidence: Generated brief inbox section and its receipt command, fallback path, and handled move run verbatim
Source: Generated brief inbox section and its receipt command, fallback path, and handled move run verbatim
Evidence: tests/fm-task-inbox.test.sh output
Source: tests/fm-task-inbox.test.sh output
Evidence: tests/fm-brief.test.sh output
Source: tests/fm-brief.test.sh output
Evidence: tests/fm-control-relaunch.test.sh output (rerun with real interpreter dirs on PATH)
Source: tests/fm-control-relaunch.test.sh output (rerun with real interpreter dirs on PATH)
Evidence: tests/fm-remote-secondmate-lifecycle-e2e.test.sh output (new receipt check passes; later pre-existing declined failure)
Source: tests/fm-remote-secondmate-lifecycle-e2e.test.sh output (new receipt check passes; later pre-existing declined failure)
Evidence: Stuck-busy wake text for an unread steer vs silence for a read steer (default busy max 2)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
🔧 **Rebase** - 4 issues found → auto-fixed ✅
bin/fm-task-inbox-lib.sh- merge conflict rebasing onto origin/mainbin/fm-watch.sh- merge conflict rebasing onto origin/maindocs/architecture.md- merge conflict rebasing onto origin/maindocs/configuration.md- merge conflict rebasing onto origin/main🔧 Fix applied.
✅ Re-checked - no issues remain.
bin/fm-task-inbox-read.sh:21- The worker-run receipt command sources the whole inbox library, which in turn sources bin/fm-wake-lib.sh and bin/fm-backend.sh. fm-wake-lib.sh runsmkdir -p "$STATE"at source time, with STATE defaulting to $FM_HOME/state and FM_HOME defaulting to the code root. Crew and scout launches do not export FM_HOME (only the secondmate launch at bin/fm-spawn.sh:6868 does, and the env-allowlist floor at bin/fm-spawn.sh:7055 omits it), so a crewmate's receipt run creates<code-root>/state/as a side effect, and on a read-only code root the command fails and the brief's file-tool fallback takes over.state/is gitignored, fm_task_inbox_record_read itself needs neither sourced library, and the fallback keeps the receipt reachable, so this is a wart rather than a defect. No action required for this change; noted so a future caller of the receipt script from a worker environment knows the dependency chain it inherits.✅ **Test** - passed
✅ No issues found.
claudeworker spawned in a disposable lab home and a model turn interpreting the brief; the previous test round was cut at the 30-minute budget attempting long liv…bash tests/fm-task-inbox.test.sh(51 ok, exit 0, 92s; real fm-watch.sh subprocess with fake tmux pane)bash tests/fm-brief.test.sh(exit 0, 24s)PATH=<mise python3 dir>:<mise node dir>:$PATH bash tests/fm-control-relaunch.test.sh(90 ok, exit 0, 253s; first run without the PATH fix failed on the mise shim trust error, not the product)bash tests/fm-remote-secondmate-lifecycle-e2e.test.sh(17 ok, then the pre-existing declined failure 'remote spawn never reached its blocked inheritance write'; its new read-receipt check passed)watcher-default-threshold-drive.sh: realinbox_steer_checkfrom bin/fm-watch.sh with no FM_TASK_INBOX_* overrides, unread vs read vs successor vs deleted-receipt timelineswatcher-dead-pane-drive.sh: dead pane (pane_current_command=zsh) with unread vs read recordbrief-receipt-drive.sh:bin/fm-brief.sh ship demo-project --mode no-mistakesin a disposable FM_HOME, then the brief's receipt command, file-tool fallback path, and handled move run verbatim againstfm_task_inbox_writerecords;bin/fm-task-inbox-read.shrejections for missing record, non-inbox directory, no argument;--helpDefault thresholds read through the library: grace=90 ring_max=3 busy_max=2git status --short --ignoredclean after all drives✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.