Skip to content

fix(bin): wake a handling-successor watcher for undelivered queued check rows - #5981

Open
mcka wants to merge 11 commits into
kunchenguid:mainfrom
mcka:fm/fm-inbox-note-wakes-idle-primary-w1
Open

mcka wants to merge 11 commits into
kunchenguid:mainfrom
mcka:fm/fm-inbox-note-wakes-idle-primary-w1

Conversation

@mcka

@mcka mcka commented Sep 28, 2026 •

Copy link
Copy Markdown

Intent

Captain inbox notes (bin/fm-inbox.sh note) are saved and announced by appending one check row to the home's durable wake queue; nothing else tells the primary the row exists.
A plain watcher notices such an append, because every queue append republishes the recovery marker as pending downtime and resurface_after_downtime turns that into a check: rearm-resurface exit.
A handling successor does not: it is the watcher the Claude Stop hook and the Pi/omp/OpenCode adapters start before delivering an actionable wake, and it deliberately skips resurface_after_downtime so a lost handshake cannot become an unbounded re-announcement loop.
Nothing else in its cycle looks at its own home's queue, so on an idle primary a note waited until an unrelated event (a crew signal, a heartbeat, a stale pane) made the watcher exit, or until the operator typed again.
In a live home, four notes queued over four minutes sat unread while the watcher beacon stayed fresh.
The same gap applies to every other writer that appends to the home's own queue from outside the watcher: mail and contributions checks, the deferred startup network stage, merge outcomes, process-event results.

Reproduction, in a scratch home with FM_POLL=1: start bin/fm-watch.sh, wait for its poll loop, run bin/fm-inbox.sh note "hello" against the same FM_HOME, and watch for six seconds.
A plain watcher exits with check: rearm-resurface; a handling successor (FM_WATCH_HANDLING_SUCCESSOR=1) keeps blocking with the note queued, whatever the recovery marker's state.

Requirements: while the watcher blocks, an undelivered row another writer appends to its own home's queue makes it exit within one poll; the same row never causes a second exit; drain and acknowledgement semantics, the recovery marker, the handling successor's no-re-announcement rule, secondmate foreign-queue observation, away/quiet daemon mode, and other harnesses stay unchanged; the per-poll cost stays trivial.

Design: a forward-only record, state/.watch-queue-handed, of the queue sequence already handed over.
Only a check: close advances it, because a check trigger always reaches main while the captain is attended and main's drain presents every row it can claim (in the away posture the supervision branch takes check rows itself).
A signal, stale, or heartbeat close may be taken by a supervision branch that presents only its granted rows, so it leaves the record alone.
Each poll surfaces only check rows above the record, the only kind other writers append, leaving out rows a live branch grant holds or main's last drain already claimed; the watcher's own signal, stale, and heartbeat rows reach their actor through their own close.
So a note queued just before a branch-taken close still reaches main once, a branch's own signal row is never announced to main, and no row is surfaced twice.
An earlier revision of this PR coupled the record to branch grants through bin/fm-wake-grant.sh, the supervision host, and the Pi branch extension; each review round found a new edge case in that coupling, so it was replaced by this narrower rule, and those files are unchanged from main.

Alternatives rejected: having fm-inbox.sh touch an input the watcher already scans would fix only notes, and extending recovery re-announcement to handling successors would reopen the loop successors exist to avoid.
Accepted cost: if a note races a close that main takes, the next successor can surface it once more before main's drain claims it, one extra main turn per row at most.

What Changed

  • bin/fm-watch.sh adds queue_handover_surface, run once per poll right after resurface_after_downtime. It surfaces one check: undelivered queued wake: <keys> wake for check rows that another writer (such as a captain inbox note) appended to the home's own queue and that no actor has picked up yet. Before this, a handling successor that never re-announced recovery left those rows waiting unread. It does nothing while the away-mode daemon owns triage, and when no append has happened it costs two builtin reads.
  • bin/fm-wake-lib.sh adds fm_wake_seq_read, the forward-only state/.watch-queue-handed record (watch_queue_handed_read / watch_queue_handed_write) and fm_wake_keys_after_locked. Rows above the record count unless a live branch grant holds them or main's last drain claimed them. A counter read of 0 means "unknown", so it never lowers the record. The record only resets when a positive counter falls below it.
  • wake() in bin/fm-push-transition-lib.sh now advances the handover record only on check: closes. Signal, stale and heartbeat closes leave it alone. The new record is documented in docs/watcher-continuity.md and the operational-home-layout skill. tests/fm-watch-recovery-loop.test.sh gets regression cases for: one surface per row, the away-mode exclusion, a note queued just before a signal close, rows main already claimed, and torn counter reads.

Risk Assessment

✅ Low: The change is a small addition that stays within the stated scope. I found no reachable path that loses or double-delivers a row. Every watcher close that appends a check row is prefixed check:, so it advances the record; acks re-claim only rows at or below their cutoff, so the main-claimed exclusion cannot hide an unpresented note; drain/ack, the recovery marker, the successor no-re-announce rule, and away mode are unchanged; and the new tests drive the real watcher, inbox and drain scripts instead of grepping source.

Testing

I ran the focused watcher recovery-loop suite on the branch and all 7 cases passed. I also ran it against the base watcher code: the new foreign-append test fails there, which confirms the regression tests catch the missed wake. The wake-queue, supervision-events and inbox suites all passed, so drain/ack, grant and inbox behavior are unchanged. A manual run of the real watcher and the real bin/fm-inbox.sh note showed the successor exiting within 1s with check: undelivered queued wake: inbox:&lt;id&gt;. A restarted successor kept blocking for the same unacknowledged note, the durable queue stayed untouched, and the away-mode watcher left the note to the daemon. One leftover: the /tmp/fm-base-repro.X49AUa scratch copy from the reproduction run is still there because my rm -rf was denied. It is outside the worktree, and the worktree is clean.

Evidence: End-to-end CLI transcript: an inbox note wakes a handling successor once

Source: End-to-end CLI transcript: an inbox note wakes a handling successor once

### 2. captain runs: bin/fm-inbox.sh note 'please look at the release notes' queue rows now: 1 check inbox:1791199376-teGNw1 watcher exited after 1s with wake line: > check: undelivered queued wake: inbox:1791199376-teGNw1 state/.watch-queue-handed = 1 state/.wake-queue.seq = 1 ### 3. restart a handling successor with the same note still queued (unacknowledged) watcher pid 80323 still blocking after 4s: the same row did NOT cause a second exit ### 4. away mode (state/.afk present): a new note is left to the daemon away-mode watcher still blocking 4s after the note: left to daemon

### 1. start a handling-successor watcher (FM_WATCH_HANDLING_SUCCESSOR=1, FM_POLL=1) on an empty home
watcher pid 75795 still blocking after 3s (expected: nothing to report)

### 2. captain runs: bin/fm-inbox.sh note 'please look at the release notes'
queued 1791199376-teGNw1
  please look at the release notes
  firstmate will pick this up at its next check.
queue rows now:
  1	check	inbox:1791199376-teGNw1
watcher exited after 1s with wake line:
  > check: undelivered queued wake: inbox:1791199376-teGNw1
state/.watch-queue-handed = 1   state/.wake-queue.seq = 1

### 3. restart a handling successor with the same note still queued (unacknowledged)
watcher pid 80323 still blocking after 4s: the same row did NOT cause a second exit
durable queue unchanged (drain/ack untouched):
  1	check	inbox:1791199376-teGNw1

### 4. away mode (state/.afk present): a new note is left to the daemon
away-mode watcher still blocking 4s after the note: left to daemon
Evidence: Demo driver script used for the transcript

Source: Demo driver script used for the transcript

#!/usr/bin/env bash
# Manual end-to-end demo: a handling-successor watcher must exit within one poll
# when a captain inbox note lands in its home queue, and only once per note.
set -u
REPO=${1:?repo root}
. "$REPO/tests/wake-helpers.sh"
TMP_ROOT=$(fm_test_tmproot fm-inbox-demo)
dir=$(make_case demo); dir=$(cd "$dir" && pwd -P); state="$dir/state"; mkdir -p "$dir/data" "$dir/config"
run_watch() {
  env PATH="$dir/fakebin:$PATH" FM_HOME="$dir" FM_STATE_OVERRIDE="$state" \
    FM_POLL=1 FM_SIGNAL_GRACE=0 FM_CHECK_INTERVAL=999999 FM_HEARTBEAT=999999 \
    FM_SECONDMATE_LIVENESS_SECS=99999999 FM_WATCH_HANDLING_SUCCESSOR=1 \
    "$REPO/bin/fm-watch.sh" > "$dir/out" 2>&1 &
  W=$!
}
note() { FM_HOME="$dir" FM_STATE_OVERRIDE="$state" FM_DATA_OVERRIDE="$dir/data" FM_CONFIG_OVERRIDE="$dir/config" "$REPO/bin/fm-inbox.sh" note "$1"; }
waitexit() { local i=0; while kill -0 "$W" 2>/dev/null && [ $i -lt "$1" ]; do sleep 0.1; i=$((i+1)); done; ! kill -0 "$W" 2>/dev/null; }
echo "### 1. start a handling-successor watcher (FM_WATCH_HANDLING_SUCCESSOR=1, FM_POLL=1) on an empty home"
run_watch; sleep 3; kill -0 $W && echo "watcher pid $W still blocking after 3s (expected: nothing to report)"
echo; echo "### 2. captain runs: bin/fm-inbox.sh note 'please look at the release notes'"
t0=$(date +%s); note "please look at the release notes"
echo "queue rows now:"; cut -f2-4 "$state/.wake-queue" | sed 's/^/  /'
if waitexit 50; then echo "watcher exited after $(( $(date +%s) - t0 ))s with wake line:"; sed 's/^/  > /' "$dir/out"; else echo "FAIL: watcher still blocking"; fi
echo "state/.watch-queue-handed = $(cat "$state/.watch-queue-handed")   state/.wake-queue.seq = $(cat "$state/.wake-queue.seq")"
echo; echo "### 3. restart a handling successor with the same note still queued (unacknowledged)"
run_watch; sleep 4
if kill -0 $W; then echo "watcher pid $W still blocking after 4s: the same row did NOT cause a second exit"; kill -TERM $W; wait $W 2>/dev/null; else echo "FAIL: second exit:"; cat "$dir/out"; fi
echo "durable queue unchanged (drain/ack untouched):"; cut -f2-4 "$state/.wake-queue" | sed 's/^/  /'
echo; echo "### 4. away mode (state/.afk present): a new note is left to the daemon"
: > "$state/.afk"; run_watch; sleep 2; note "away note" >/dev/null; sleep 4
if kill -0 $W; then echo "away-mode watcher still blocking 4s after the note: left to daemon"; kill -TERM $W; wait $W 2>/dev/null; else echo "FAIL: exited:"; cat "$dir/out"; fi
Evidence: Recovery-loop suite on the branch (all pass)

Source: Recovery-loop suite on the branch (all pass)

ok - a resurfacing handling successor stays alive and supervises instead of going blind
ok - unacknowledged recovery is announced at most once per generation and the successor stays alive
ok - a handling successor surfaces a foreign queue append once, tied to its row sequence
ok - the away-mode watcher leaves a foreign queue append to the daemon
ok - a note queued just before a signal close reaches main once through the next successor, without the signal row
ok - a note main's drain already claimed is not surfaced again before acknowledgement
ok - a torn queue counter read never lowers the handover record
Evidence: Recovery-loop suite against base watcher code (reproduces the missed wake)

Source: Recovery-loop suite against base watcher code (reproduces the missed wake)

not ok - a handling successor kept blocking after an inbox note was queued:

ok - a resurfacing handling successor stays alive and supervises instead of going blind
ok - unacknowledged recovery is announced at most once per generation and the successor stays alive
wait_for_exit: owned pid 28380 exceeded 50 polls; sending TERM
28380 81618 S    bash /tmp/fm-base-repro.X49AUa/bin/fm-watch.sh
not ok - a handling successor kept blocking after an inbox note was queued: 

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped

Step was skipped.

⚠️ **Review** - 2 infos
  • ℹ️ bin/fm-watch.sh:2104 - Accepted design tradeoff, noted for awareness. A captain note can be queued after the predecessor's last queue check and before a signal/stale/heartbeat close. If main (not a branch) takes that close, the handling successor is armed right away by fm-watch-arm.sh and its first poll usually runs before main's fm-wake-drain.sh claims the note into .main-eligible-rows. The successor then exits with check: undelivered queued wake: inbox:&lt;id&gt; for a row main's drain is about to present anyway, which costs one extra handling turn. The window is a single poll, the outcome is an extra wake rather than a lost one, and the reviewed design deliberately leaves non-check closes alone (T5 encodes this). No change needed.
  • ℹ️ bin/fm-watch.sh:2107 - queue_handover_surface reads .wake-queue.seq into last, then calls watch_queue_handed_read handed with no counter argument, so the counter is read a second time. The quiet path is three builtin reads, not the 'two builtin reads' its comment claims. Passing the value already read (watch_queue_handed_read handed &#34;$last&#34;) drops the extra read and makes the comment accurate. Behavior is the same: a 0 counter still skips the reset check and returns early.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-watch-recovery-loop.test.sh on the branch: all 7 cases pass, including the 5 new ones (foreign append surfaced once, away mode leaves it to the daemon, a note that races a signal close, a note already claimed by main's drain, and a torn counter read)
  • Bug reproduction: ran bash tests/fm-watch-recovery-loop.test.sh in a /tmp export of HEAD with the base (f470a01) versions of bin/fm-watch.sh, bin/fm-wake-lib.sh and bin/fm-push-transition-lib.sh. It fails with 'a handling successor kept blocking after an inbox note was queued'
  • bash tests/fm-wake-queue.test.sh (drain/ack semantics): passes
  • bash tests/fm-supervision-events.test.sh (supervision branch and grant interplay): all assertions pass
  • bash tests/fm-inbox.test.sh: passes
  • Manual end-to-end transcript (inbox-note-wakes-successor-demo.sh) using the real bin/fm-watch.sh with FM_WATCH_HANDLING_SUCCESSOR=1 and the real bin/fm-inbox.sh note. Checked: exit within 1s carrying the inbox key, no second exit while the note is still unacknowledged, durable queue unchanged, and no exit in away mode
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 1)
✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[High risk] Adds queue handover tracking to the watcher polling loop.

The PR appears safe to merge based on the changes reviewed.

Reviews (8) · Last reviewed commit: "Merge branch 'main' into fm/fm-inbox-not..."

Comment thread bin/fm-push-transition-lib.sh Resolved
Comment thread bin/fm-wake-grant.sh Resolved
Comment thread bin/fm-wake-grant.sh Resolved
Comment thread tests/fm-watch-recovery-loop.test.sh Resolved
…ssor blocks

A handling successor skips recovery re-announcement, so a row another
writer appends to the home's own wake queue while it blocks (a captain
inbox note, a mail or contributions check) waited for an unrelated event
before the primary saw it.

Every actionable exit now records the queue sequence it handed over, and
each poll surfaces a still-queued row above that record once as
"check: undelivered queued wake: <keys>". Drain and acknowledgement
semantics, the recovery marker, and away-mode one-shot behaviour are
unchanged.
Replace the grant-coupled handover record with a narrower rule. Only a
check: close advances the record, because a check trigger always reaches
main while attended and main's drain presents every row it can claim. A
signal, stale, or heartbeat close may be taken by a supervision branch
that presents only its granted rows, so it leaves the record alone, and
the watcher surfaces only check rows, the only kind other writers append.

A note queued just before a branch-taken close therefore still reaches
main once, the branch's own signal row is never announced to main, and
the record only moves forward, so no row is surfaced twice. The grant
script, the supervision host, and the Pi branch extension return to their
main versions.
@mcka
mcka force-pushed the fm/fm-inbox-note-wakes-idle-primary-w1 branch from 76ad24f to acbe866 Compare September 28, 2026 10:53
@mcka mcka changed the title fix(bin): deliver inbox notes queued while a handling successor watcher blocks fix(bin): wake an idle primary when an inbox note is queued behind a handling successor Sep 28, 2026
@mcka

mcka commented Sep 29, 2026

Copy link
Copy Markdown
Author

This PR fixes #5967 (inbox notes waiting in the wake queue until the watcher cycle closes for another reason). Could a maintainer approve the fork workflow runs? CI and Require no-mistakes are both at action_required, so the required checks have not run yet. No check waiver is requested.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: First stamp this fetch vs tip 1f2c9548f4680efeda76fabe9f057b4021b97272.

HEAD acbe86669ec79b8615c968d208036ada433fb62e. MERGEABLE/UNSTABLE. Fixes #5967 verified (inbox note appends check row; handling successor skips resurface_after_downtime, so note waited for an unrelated close). Diff reviewed: queue_handover_surface once-per-sequence for undelivered check rows; away-mode left to daemon; signal close does not advance handed record. No workflow/secrets risk.

contract-class: restore — concrete existing inbox-note→check-row→primary-attention path broken for idle primary behind a handling successor; not a new always-on observer class.

VISION: restart/queue durability (obligations closed by durable events); scripts own mechanics; peace of mind (notes do not sit silent); away-mode one-shot unchanged (afk gate).

Fork CI + Require no-mistakes runs on tip approved this pass (36412416414, 36557306469, and other tip action_required runs). Waiting green CI + NM attestation MATCH before merge. Firstmate flag no (not otherwise-ready).

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: Correction vs tip 1f2c9548f4680efeda76fabe9f057b4021b97272.

Attestation MATCH (body head_sha = tip acbe86669ec79b8615c968d208036ada433fb62e). NM 36557306469 SUCCESS after fork approval this pass. CI 36412416414 IN_PROGRESS (serial-9 already red early — will restamp waiting-author if the run ends FAILURE). Contract-class restore unchanged. Firstmate flag no.

@mcka mcka changed the title fix(bin): wake an idle primary when an inbox note is queued behind a handling successor fix(bin): surface inbox notes queued while a handling successor watcher polls Sep 29, 2026
@alexputici

Copy link
Copy Markdown

Independent before/after check of this change, in case it helps review. Disposable scratch homes only, synthetic fixtures (one empty task record so the home needs supervision, crew events appended to a status file, notes filed with bin/fm-inbox.sh note "synthetic note"). Before = main at f470a01, after = this PR at 5e516ea, plus this PR merged onto that main (clean merge).

Reproduces on main. Idle primary whose live watcher is a handling successor (any idle period after the first wake of a session):

Path main this PR
Claude Stop hook, host off, FM_POLL=1 no wake in 20s; note seen only after an unrelated crew event wake after 12.7-13.9s with check: undelivered queued wake: inbox:<id>
Claude Stop hook, default cadence (15s poll) still unseen after 25 minutes; the 10-minute heartbeat fired once and was absorbed wake after 27.4s; no repeat in the next 90s
Real Claude Code session, default cadence not seen within 150s (two runs) seen after 28.8s; no repeat in the next 60s
Pi extension (real extension, stand-in session object), FM_POLL=1 no follow-up in 20s follow-up after 1.4-1.6s; no repeat

On the Claude path about 11s of each figure is the attached arm's confirmation wait after the watcher exits, which is the same on main for every wake kind.

Other cases, same on both unless noted:

  • Plain watcher: note wakes in 2-3s as check: rearm-resurface (unchanged).
  • Codex checkpoint: note returns the checkpoint in about 1.5s (unchanged, plain watcher).
  • Two notes back to back, and two notes 2.5s apart: main 0 wakes; this PR exactly 1 wake, and the one drain presents both.
  • Note during the handling turn before its drain: no extra wake on either (Claude).
  • Note during the handling turn after its drain: main never wakes for it; this PR wakes once after the turn ends (check: rearm-resurface from the fresh plain watcher).
  • Restart and SIGKILL of the watcher with a note pending: 1 wake on both.
  • Quiet control (no note): 0 wakes on both. A later ordinary crew event after a handled note: 1 wake, note not re-presented.

Two small costs observed, both consistent with the accepted cost in the description:

  • Pi: a note that lands during a busy handling turn yields one redundant follow-up after that turn's drain already handled it.
  • Claude: a note that lands mid-turn now ends the successor mid-turn (as a crew event already does), so the rest of that turn has no watcher until the turn-end hook arms one. If that turn then outlasts FM_GUARD_GRACE, guarded commands print the watcher-down banner once.

Adjacent, not caused by this PR: in a home with nothing in flight the Stop hook arms no watcher (fm_supervision_needed is false), so a note filed there is not surfaced by monitoring before or after this change. Possibly worth a separate issue.

Tests: 73 behaviour scripts (the runner's --changed selection for this diff plus the inbox, Stop hook, wake drain and away-mode suites; live-harness and real-Herdr families excluded) pass on main, on this head and on the merge, with 0 non-zero exits and 0 not ok lines in the raw output. The merge's passing cases are main's plus exactly the five new ones. tests/fm-watch-triage.test.sh does finish (about 17 minutes on this machine). The new "surfaces a foreign queue append once" case fails against main's bin/, as it should. bin/fm-lint.sh is clean on the four changed shell files. One macOS machine, not a substitute for CI on the current head.

Not exercised: host-on supervision, OpenCode/omp adapters, away and quiet modes, real Pi and Codex binaries.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate (an automated assistant, posting publicly). This is waiting on you, the author. It is not a captain hold.

What changed since my last stamp (2026-09-29): the head moved from acbe8666 to 5e516eade (a merge of main plus two no-mistakes review/document commits), and the title and design narrowed. The handover record is no longer coupled to branch grants, so fm-wake-grant.sh, the supervision host and the Pi extension are untouched. @alexputici also posted an independent before/after check, which was helpful. Thank you.

What the tip does (my reading vs main f470a01c): a captain inbox note (and any other outside writer, such as mail or contributions checks) is announced only by appending one check row to the home's own wake queue. A plain watcher already notices that append via resurface_after_downtime. A handling successor deliberately skips that step, so the note sat until something unrelated closed the watcher. The tip adds queue_handover_surface to the poll loop, right after resurface_after_downtime. It reads the queue counter and a new forward-only state/.watch-queue-handed record. When a check row sits above the record and is not held by a live branch grant or already claimed by main's last drain, the watcher exits once with check: undelivered queued wake: <keys>. Only a check: close advances the record (wake() in fm-push-transition-lib.sh). The step is off while the away-mode daemon owns triage. With no new appends it costs two builtin reads. The durable queue, drain and ack are not changed. Five new tests cover once-only surfacing, away mode, a note raced into a signal close, a note main already claimed, and a torn counter read.

contract-class: restore. This is my own reading, not the PR's label. On main, fm-inbox.sh note appends exactly one wake "so firstmate picks the note up at its next drain" and tells the captain "firstmate will pick this up at its next check". That queued-wake path is the specified default, and it is broken whenever the live watcher is a handling successor. The tip adds no new wake kind or source. It reuses the existing check: kind for rows already in this home's queue, and every row still reaches main at most once. It is not a new always-on observer of anything the product did not already promise to deliver.

VISION (per rule):

  • One captain, one interface: aligns. Notes the captain already sent now reach the first mate. There is no new captain-facing surface and nothing repeats.
  • Authority is explicit and never inferred: aligns. Nothing new is authorized. It only delivers what the captain wrote.
  • Scripts own the mechanics, agents own the judgment: aligns. The handover is a deterministic counter record. The per-poll cost is trivial and no tokens are spent until there is a real row.
  • A restart is a non-event: aligns. "A queued wake is retired only by the durable event that answers it" now holds for handling successors too. The record is on disk and forward-only.
  • Delegation with a spine: aligns. No change to task contracts.
  • The fleet outlives any vendor: aligns. This is watcher-level, so it covers Claude, Pi, omp and OpenCode successors alike.
  • Scope: aligns. Command-layer wake delivery only, plus field-incident regression coverage.

Gates on this head (5e516eade):

  • Attestation MATCH: the body's head_sha equals the head.
  • Fork runs for this head had been waiting for approval since 2026-09-29. I'm sorry about that. I reviewed the diff (no workflow, secret or pull_request_target changes) and approved them this pass: CI 36618207961, plus the three Require no-mistakes runs 36618208157, 36618254910 and 36618318197, which are all SUCCESS.
  • CI 36618207961 is red. Three jobs failed: serial 4 (fm-pi-branch-extension.test.sh, "Calm-off ToolExecutionComponent rendering differs from Pi stock"), serial 2 (fm-calm-pi-extension.test.sh, "grep disappeared from /export calm.html") and serial 9 (fm-spawn-compact-adviser-disable-remote.test.sh, "remote seed did not provision the route under test"). None of those touch this PR's files. The run checked out Merge 5e516ea into 1f2c9548, which is the old main from 2026-09-28. All three are the drift that main fixed in fix: restore portable CI behavior across Pi rendering and remote provisioning #6162 (2026-09-30, "restore portable CI behavior across Pi rendering and remote provisioning"). Serial 5 was cancelled at the 30-minute job limit, with no failing test before that. Re-running would test the same stale merge, so it won't help.
  • Greptile 5/5 on 5e516ea, and all four earlier P1 threads are resolved. The state is MERGEABLE/UNSTABLE, 32 commits behind main. No .github/workflows changes.
  • Closes Inbox notes wait in the wake queue until the watcher cycle closes for another reason #5967: yes. That issue is the same gap the tip fixes.

What unblocks it: bring the branch up to current main (merge or rebase) and re-raise it with git push no-mistakes, so the attestation binds the new head and CI runs against a main that includes #6162. If CI then comes back green, with attestation MATCH and no new P1s, this restore is otherwise ready to merge.

@s3onghyun

Copy link
Copy Markdown

Tested this locally on macOS ARM in isolated scratch homes, without touching the live primary or Herdr lifecycle (context: #5967, where I reported 15–20 min delays for phone-bridged inbox notes on a Pi + Herdr primary).

I started the real bin/fm-watch.sh as a handling successor (FM_WATCH_HANDLING_SUCCESSOR=1, FM_POLL=1) with no workers, then ran the real bin/fm-inbox.sh note against the same throwaway FM_HOME.

Results over three runs each:

  • current upstream main (0397cb2b): the watcher was still blocking after about 6.8–7.1s; the inbox check row remained queued.
  • this PR head (0fe9524): the watcher exited in 1.16–1.28s with check: undelivered queued wake: inbox:<id>, and the handover record advanced to 1.

I also ran the focused suites on the PR head — tests/fm-watch-recovery-loop.test.sh (7/7), tests/fm-wake-queue.test.sh, tests/fm-supervision-events.test.sh, tests/fm-inbox.test.sh — all passed.

I did not find an issue in the tested watcher/inbox layer. This is not a full live Pi-primary or Herdr lifecycle test, but it directly reproduces the handling-successor mechanism behind the delayed queued-note behavior. The PR base is behind main, so a rebase plus a fresh CI run is probably the next step.

Thanks, @mcka.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants