Repository navigation
fix(bin): let the away session post requested news, start validation, and dispatch the queue - #17
Merged
Merged
Conversation
… and dispatch the queue On a home that runs the supervision host, an away window left finished fixes idle, never dispatched queued work, and held every requested "fyi" for the return brief: - bin/fm-branch-report.sh gains --tell-now true (captain verdict only). bin/fm-supervision-host.sh then exits to main with a "supervision-host: tell:" line plus one outcome line per row, so main posts the news while the captain stays away; the row still waits for the return brief. - bin/fm-branch-prompt.sh names the validation handoff: a no-mistakes ship whose worker reports its pre-validation done gets the harness's no-mistakes invocation once, in both postures. - bin/fm-watch.sh delivers every heartbeat while an away record exists, and the prompt makes each away heartbeat list the queue and dispatch ready items through the guarded resolve, skill-select, spawn path. - Docs and the afk skill describe the told outcomes, heartbeat delivery under an away record, and the validation handoff. - New opt-in live guard tests/fm-supervision-host-away-live-e2e.test.sh replays the away window against a real engine.
A bare "quota" in a paused reason, such as a vendor raising an API quota approval, held the away heartbeat backoff at its base cadence. The usage-reset vocabulary now needs "quota limit" or "quota reset".
When a failed away turn marked outcomes --tell-now but the host could not read them back, the handback to main fell through to the generic message, so the requested news was never posted. It now names the store rows and the lookup command, as the handled path already does.
…nfiguration reference
demy00
force-pushed
the
feature/fm-away-session-gaps
branch
from
October 30, 2026 04:50
82034c0 to
1b42bf5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Captain 2026-10-29, after a 1h27m away window (/afk words: "continue the queue, max 5 workers, stop at 95% and wait for the reset, do not merge, write me a short "fyi" message with the pr link when a pr is ready for my review"), asked "can we fix this?" about these two observed failures:
Evidence in this home: the archived away record state/afk-contracts/1793297115.afk-contract; branch outcomes seq 2495-2519 (bin/fm-branch-outcome.sh list); state/fe-chat-unread-pill-older.status and state/fe-e2e-dd27-seeding.status (each reported its pre-validation done around 18:40Z and sat idle until the captain returned at 19:32Z); queued items fe-e2e-ph13-flake, fe-e2e-mc01-flake, cp-switcher-org-workspaces had briefs at data//brief.md, no blockers, and free slots under the 5-worker cap, yet were never spawned. The home runs the Claude supervision host (docs/supervision-host.md).
What Changed
News posted while away:
fm-branch-report.shgains--tell-now true, which only a captain outcome can use. It adds atell-nowfield to the turn receipt. While the away record exists,fm-supervision-host.shwakes MAIN to post those outcomes to the captain right away (for example a "PR ready for review" FYI). The outcomes still wait for the return brief too. If a failed away turn's outcomes can't be read back, its handback names the store rows and the lookup command. The afk skill and the supervision-host docs describe this behavior.Validation and queue dispatch while away: the away-session engine prompt (
fm-branch-prompt.sh) now tells it to:done:, sending the harness's no-mistakes skill invocation once.Heartbeat delivery and backoff:
fm-watch.shnow delivers every heartbeat while an away record exists, instead of absorbing it. Its backoff stays at the base interval while:fm-classify-lib.shaddsstatus_is_usage_reset_wait(vocabulary can be overridden withFM_CLASSIFY_USAGE_RESET_RE), andfm-brief.shtells workers to writeusage limitin suchpaused:lines. Covered by new and updated tests, including a new away live e2e test.🤖 Generated with Claude Code
Risk Assessment
Testing
- Passing tests: the targeted tests for all three changes pass, along with the existing absorb test. - Watcher: away heartbeats are delivered when no daemon runs, and the backoff holds while work waits. - Supervision host: a tell-now outcome wakes MAIN with the FYI text and PR link. - Branch prompt: it carries the validation, queue-dispatch and tell-now rules. - Negative control: the same new tests fail on the base commit'sbin/files. - The away heartbeat gets absorbed. - The backoff is not held. ---tell-nowis rejected. - Evidence: the host's real handoff lines to MAIN, the emitted branch prompt, and a before/after transcript are saved in the evidence directory. - Not run: the opt-in live-LLM guardtests/fm-supervision-host-away-live-e2e.test.sh. It spends real engine turns, so the proof that a live model acts on the prompt rules comes from that guard, not from this phase. - No UI: none of these changes has a visual surface, so there are no screenshots. - Cleanup: the worktree is clean.Evidence: Host handoff to MAIN for an away tell-now outcome (handled, failed, and unreadable-lookup turns)
Source: Host handoff to MAIN for an away tell-now outcome (handled, failed, and unreadable-lookup turns)
supervision-host: tell: the away session handled this wake and recorded outcomes the captain's away words ask to hear as they happen (store rows 2); post each following outcome to the captain now as a short message; the captain is still away, and each outcome also waits for the return brief supervision-host: outcome 2 for demo [captain]: fyi: PR https://example.invalid/demo/pull/7 is ready for your reviewEvidence: Away heartbeat delivery and backoff hold: base vs target
Source: Away heartbeat delivery and backoff hold: base vs target
AFTER: ok - a no-change heartbeat reaches the away session when no daemon runs, and a quiet record still absorbs it AFTER: ok - while away, a worker paused for a usage-limit reset or a ready queued item holds the heartbeat backoff at the base cadence, and another external wait does not BEFORE: not ok - a no-change heartbeat was absorbed while the captain is away with no daemon BEFORE: not ok - [away-backoff-paused] waiting away work did not hold the heartbeat backoff at the base cadenceEvidence: Emitted branch prompt (validation handoff, away queue dispatch, tell-now rules)
Source: Emitted branch prompt (validation handoff, away queue dispatch, tell-now rules)
Root causes (from the home's host log, watcher triage log, and outcome store)
bin/fm-watch.shabsorbed every no-change heartbeat unless the legacystate/.afkdaemon flag existed; a host home (and Pi) has an away record but no daemon flag, so the away session got no periodic review at all once the workers went quiet. The host log shows no engine turn between 18:40:52Z and 19:23Z, while the watcher's triage log shows "absorbed heartbeat (no captain-relevant change)" throughout.Why one PR
All three fixes edit the same branch prompt section ("Postures") and its byte-stability test, the same owning docs (
docs/supervision-host.md, the afk skill), and are proven by one live guard that replays the incident. Splitting them would produce three PRs editing the same paragraphs.Regression evidence
Reverted means
bin/fm-branch-prompt.sh,bin/fm-branch-report.sh,bin/fm-supervision-host.sh, andbin/fm-watch.shrestored frommainin a copy of this branch, with the new tests kept.tests/fm-supervision-host.test.shandtests/fm-branch-supervision.test.shhave no single-test filter, so their single tests ran from a copy of the suite whose runner list holds only the named function.FM_TEST_ONLY=test_heartbeat_reaches_the_away_session_without_a_daemon bash tests/fm-watch-triage.test.shnot ok - a no-change heartbeat was absorbed while the captain is away with no daemonok - a no-change heartbeat reaches the away session when no daemon runs, and a quiet record still absorbs ittests/fm-branch-supervision.test.sh:test_branch_prompt_is_byte_stable_and_above_cache_floornot ok - branch prompt lost the no-mistakes validation handoff ruleok - branch prompt is byte-stable across homes, cwd, timezone, and time, above the cache floortests/fm-supervision-host.test.sh:test_report_surface_enforces_actor_turn_and_scopenot ok - the tell-now refusal must say why (missing: '--tell-now true requires the captain verdict')ok - report surface: only the branch actor's current turn may report, and only on the tasks its wake namesFM_TEST_ONLY=test_away_heartbeat_backoff_holds_while_work_waits bash tests/fm-watch-triage.test.sh(backoff fix reverted:bin/fm-watch.shandbin/fm-classify-lib.shfrom the first commit)not ok - [away-backoff-paused] waiting away work did not hold the heartbeat backoff at the base cadenceok - while away, a worker paused for a usage-limit reset or a ready queued item holds the heartbeat backoff at the base cadence, and another external wait does notFM_TEST_ONLY=test_usage_reset_wait_needs_a_limit_not_a_bare_quota bash tests/fm-watch-triage.test.sh(barequotain the vocabulary)not ok - an unrelated line counted as a usage-reset wait: paused: waiting on vendor to raise our API quota approvalok - a usage-reset wait needs a paused line naming a usage, rate, or quota limit or reset, never a bare quotatests/fm-supervision-host.test.sh:test_failed_away_turn_still_names_its_told_outcomes(handback without the read-back branch)not ok - the failed turn's handback must name told rows it could not read backok - host: a failed away turn's handback names its told outcomes, even when they cannot be read backtests/fm-supervision-host.test.sh:test_away_outcome_the_words_ask_to_hear_now_reaches_mainnot ok - the handoff must say main has an outcome to post nowok - host: an away outcome the words ask to hear now wakes main to post it, and every other captain outcome waits for the returnLive guard before and after
Live guard against a real engine (Claude Code 2.1.312), under the incident's away words, with a 60s heartbeat:
The pre-fix control reproduces the incident exactly: the engine records the fyi but holds it, says validation is still needed without starting it, and never sees a heartbeat. The fixed run passed twice in a row on the final code. An earlier fixed run without the explicit queue listing in the prompt skipped the queued item on two heartbeats, which is why the prompt now names
bin/fm-tasks-axi.sh list --state queued.Skills used
firstmate-coding-guidelines, diagnostic-reasoning, tdd, afk, away-quiet-supervision, operational-home-layout
Also tidied
tests/fm-supervision-host.test.sh: theappend_statushelper's comment now documents its optional state argument.Noticed
ubuntu-latestlabel moved to Ubuntu 26.04 during this PR and six portable and Herdr checks went red. Four of the failing tests also fail on unmodifiedmainunder 26.04 and pass under 24.04: the drain and public-followup tests no longer see a write to a closed stdout fail under bash 5.3, the Herdr process fixtures runsleepunder an agent name, which the Rust coreutilssleeprefuses, and the remote-lanes sequence test fails about half its runs. The image also has notsc.mainnow pins Linux jobs to ubuntu-24.04 (ci: pin Linux jobs to ubuntu-24.04 #18), and this PR is green on that pin; the 26.04 incompatibilities remain follow-ups before the pin is lifted.main:tests/fm-pi-watch-extension.test.sh(external healthy watcher, 5s window),tests/fm-omp-harness.test.sh(omp watch extension contract),tests/fm-watch-checkpoint.test.sh(signal checkpoint exit, 124),tests/fm-pi-branch-extension.test.sh(timed out waiting for branch wake prompt),tests/fm-watch-triage.test.shtest_gone_endpoint_reports_once_instead_of_escalating_forever, andtests/fm-supervision-host.test.shtest_attended_wake_carries_the_dialog_mirror. Each was confirmed against a pristine copy ofmain; they are follow-up candidates for load-tolerant waits, not regressions from this change.CHANGELOG.md, so no changelog entry was added.fm_branch_reporttool has no--tell-nowequivalent and needs none: Pi already shows every captain outcome in main's conversation as it is recorded.Better idea
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-branch-supervision.test.sh(byte-stable emitted branch prompt with the validation-handoff, away queue-dispatch and tell-now rules, plus the harness-adapters Skill-row check)FM_TEST_ONLY=test_heartbeat_reaches_the_away_session_without_a_daemon bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_away_heartbeat_backoff_holds_while_work_waits bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_usage_reset_wait_needs_a_limit_not_a_bare_quota bash tests/fm-watch-triage.test.shFM_TEST_ONLY=test_heartbeat_no_change_absorbed bash tests/fm-watch-triage.test.sh(existing absorb behavior still holds)fm-supervision-host.test.sh subset:test_report_surface_enforces_actor_turn_and_scope,test_away_wake_is_handled_on_the_engine_and_never_reaches_main,test_away_outcome_the_words_ask_to_hear_now_reaches_main,test_failed_away_turn_still_names_its_told_outcomes(run from a temporary filtered copy of the file, deleted afterwards)Negative control: temporarily checked out base 04e25dbbin/fm-watch.sh,bin/fm-supervision-host.sh,bin/fm-branch-report.sh,bin/fm-classify-lib.shand reran the new watcher and host tests. All failed as expected, thengit checkout HEAD -- bin/restored the filesCaptured the real host handoff output (host.out) and the receipts for the away tell, tell-fail and tell-fail-lookup homesbin/fm-branch-prompt.shcaptured as the emitted prompt artifact✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.