Repository navigation
fix(bin): bound stale wakes for scouts parked on origin-held captain calls - #7983
jrzimmerman wants to merge 6 commits into
Conversation
…an origin-linked task A parked scout's captain call is held on a separate task recorded with 'Captain hold origin: <scout>', so the watcher's captain-call stale bound, which only read the scout's own row, never matched and every pane tick re-alarmed. Add a read-only 'fm-captain-hold.sh open-origin' lookup and have the watcher fold its lifecycle identity beside the task's own hold. Refs kunchenguid#6069
[Medium impact] The PR appears safe to merge; no actionable issues were established. Reviews (1) · Last reviewed commit: "no-mistakes(lint): Rewrite origin match ..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @jrzimmerman. The write-up is careful, and the base vs. fix lab runs with both controls make the mechanism easy to follow. I read the full diff at head
The quick checks (coverage guard, repo invariants, no-mistakes) have since passed. The red "Full suite" check is just the gate for outside PRs. It needs a maintainer label, and that part is on us. Nothing is needed from you. After the full suite passes, this goes to the captain for the merge-or-leave call. |
# Conflicts: # tests/fm-watch-open-decisions.test.sh
Intent
lets continue with the firstmate issues and "Captain, shipshape." research investigation and fixes
Approved delivery: a PR to kunchenguid/firstmate from the jrzimmerman/firstmate fork, like the #7324 and #7325 fixes.
Context: firstmate's main session receives a repeated
stale: <pane>wake every one to three minutes for a parked scout (plan-ytq-filters on pane default:w4:p1J, plan-autopopulate on default:w4:p1K) whose newest status line is an openneeds-decision [key=board-review], and each wake forces a no-opCaptain, shipshape.reply. Two finished investigations agree on the mechanism:5h ... (in 4h32m)countdown), so each new pane hash on a pane whose last status is captain-relevant produces a bare stale wake. The only bound on that path,task_captain_call_openin bin/fm-watch.sh, looks up the scout's own task id, but captain-hold-lifecycle requires the scout's calls to be held on a separate task recorded withCaptain hold origin: <scout>(ytq-filters-design,ytq-subs-autopopulate), so the bound never matches a scout. Before 2026-10-25 the panes' newest line waspaused:and was absorbed on the declared-pause cadence.paused:line, its pane was absorbed (absorbed stale (paused, awaiting external ...)in state/.watch-triage.log) and the per-minute wakes stopped, matching the Claude report's prediction.What Changed
fm-captain-hold.sh open-origin <origin-id> [--identity]predicate. It reports whether any open captain call is held on another task whoseCaptain hold origin:line names the origin, either as given or as its backend identity. The origin's own row is never counted. Exit codes are 0 yes, 1 no or no backlog file, 2 cannot tell. With--identityit prints the matching calls as<task-id>@<hold-set stamp>#<answer count>, sorted. The backlog resolution and call-identity code thatopenalready had is now shared throughopen_backlog_resolveandopen_call_identity.task_captain_call_openinbin/fm-watch.shnow also asksopen-origin, but only when the task's newest status line is an openneeds-decisionorblockedwait. Previously the bound only matched a call held on the task's own row. A scout parked on a call held for it on a separate task now gets the captain-call cadence for stale alarms, wedge escalations and open-decision reminders, so it no longer wakes the main session on every pane-hash change. A task still working beside such a call keeps its alarms. Both answers are combined into one identity (own=…;origin=…), so a new, released or re-held call on either side still alarms the first time it is seen.open-originindocs/captain-hold-lifecycle.md(command table, exit codes, watcher use) and linked to it from the stale-pane bound indocs/architecture.md. Extendedtests/fm-watch-open-decisions.test.shandtests/fm-watch-triage-pause.test.shto cover the origin-held case.Risk Assessment
✅ Low: The change adds one read-only predicate,
open-origin, and the watcher consults it only when the task's newest line is an open captain-relevant wait, as the recorded decisions require. Every failure path falls back to the alarms that fire today, the bound's identity now includes the origin-linked calls so a re-held call still alarms, and the new tests run the real watcher and tasks-axi for both the parked case and the working, other-origin and no-origin cases.Testing
I ran the real fm-watch.sh and fm-captain-hold.sh against disposable homes using the real tasks-axi, in two ways: through the focused open-decision suite and the stale-churn suite, and by hand from the CLI. A parked needs-decision scout whose call is held on an origin-linked task surfaces once and then absorbs pane churn. A working scout, a call held for another origin, and a call with no origin all keep alarming on each new hash. A released and re-held call alarms again on first sight. An invalid origin slug or an unreadable backend gives exit 2 ("cannot tell"), never "no call". The new origin-linked test fails against the base commit's scripts, which confirms it reproduces the reported bug. I did not drive a Claude primary or a Herdr lab: this change only touches watcher and captain-hold CLI logic, which the real scripts exercise directly. Everything passed.
Evidence: open-origin CLI transcript (hold --origin, open vs open-origin, release, re-hold identity, adversarial)
Source: open-origin CLI transcript (hold --origin, open vs open-origin, release, re-hold identity, adversarial)
Evidence: Stale-churn watcher scenarios (targeted triage-pause tests)
Source: Stale-churn watcher scenarios (targeted triage-pause tests)
Evidence: Open-decision reminder / wedge evidence suite on the change
Source: Open-decision reminder / wedge evidence suite on the change
Evidence: Same suite against base commit scripts: fails on the parked-scout case (reproduces the bug)
Source: Same suite against base commit scripts: fails on the parked-scout case (reproduces the bug)
not ok - a scout parked on its decision was not bounded by its origin-linked callPipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-watch-open-decisions.test.sh(all 17 tests, including test_origin_linked_captain_call)Filtered copy of tests/fm-watch-triage-pause.test.sh running test_open_captain_call_bounds_stale_churn, test_stale_churn_without_a_captain_call_still_alarms, test_reheld_captain_call_starts_its_own_resurface_window, test_secondmate_captain_held_resurfaces_in_normal_modeManual CLI drive offm-captain-hold.sh hold --origin / open / open-origin --identity / answer --release / re-holdagainst a disposable markdown backlog with real tasks-axiAdversarial:open-originwith an invalid slug, and with a corrupt .tasks.toml backendRegression: new tests/fm-watch-open-decisions.test.sh run against base commit 427056c4 scripts (git archive into a temp dir)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.