Repository navigation
feat(bin): add durable timed dispatch wakes at a time or quota reset - #320
Merged
Merged
Conversation
sKeLe100
force-pushed
the
fm/timed-dispatch-at-reset
branch
from
November 23, 2026 06:52
6c4160d to
38910e0
Compare
…hint-drift step. `tests/fm-self-repo-role.test.sh` measured 12589 ms against a hint of 7363 ms (1.71x) on two consecutive runs. Nothing in this PR's code caused it; the timing hint was stale. The invariant is that a portable-serial hint must stay within 1.5x of the measured duration. That script has one hint entry, in `bin/fm-test-run.sh`, so I raised it to 12589. I also added a dated refresh note to `docs/fm-test-portable-shards.md`, matching earlier refreshes. Only `bin/fm-test-run.sh` and the doc changed. I confirmed `bash -n bin/fm-test-run.sh` passes. I started `tests/fm-test-run.test.sh` but stopped it after it ran past two minutes, so the check has not been re-run in CI
sKeLe100
force-pushed
the
fm/timed-dispatch-at-reset
branch
from
November 23, 2026 08:44
e443a43 to
d7f79a5
Compare
sKeLe100
added a commit
that referenced
this pull request
Nov 23, 2026
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
Gap filed 2026-11-21 under the standing order "We should be filing any tasks in relation to the gaps mentioned this session as priority 0 on pc01 and within resources". The gap: the captain chose to launch a queued task on Claude account #2 at that account's 3:09 PM ET quota reset, and firstmate had no durable way to arm that (CronCreate is blocked as harness delegation; captain holds only take a date, not a time). Firstmate needs a durable way to dispatch, or be woken to dispatch, a named queued task when a named account's quota window resets.
What Changed
bin/fm-timed-dispatch.shwitharm,listandcancelcommands.arm <task-id>takes either--at <time>(epoch or UTC ISO-8601) or--account <dir|ordinary>with an optional--window. The--accountform reads the Claude account's quota reset once throughquota-axi --provider claude --profile-only --json. It registers awhenwatch (viafm-procevent-when.sh) whose wake names the queued task. The watch survives a firstmate restart and only wakes firstmate. It never spawns the task itself.tests/fm-timed-dispatch.test.shas the regression test for the new script. Raised the portable-serial timing hint fortests/fm-self-repo-role.test.shinbin/fm-test-run.shand noted the refresh indocs/fm-test-portable-shards.md.docs/scripts.md,docs/configuration.md, and theoperational-home-layoutandprocess-event-sourcesskill docs.Risk Assessment
✅ Low: The change adds a new, self-contained script that delegates to the existing when adapter, the arm, list and cancel paths and their refusal cases are covered by behavior tests, and I found no concrete defect.
Testing
I ran
tests/fm-timed-dispatch.test.sh. It drives the realbin/fm-timed-dispatch.shagainst real process-event runners, with a fake clock and a fake quota-axi standing in for the external boundaries. All six scenarios passed. I did not drive the account scenario against a real Claude account's quota; the quota-axi reading was faked. No live Herdr or Claude session was started, and the worktree was left clean.Evidence: timed-dispatch test log
Source: timed-dispatch test log
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
bin/fm-test-run.sh:1148- bin/fm-test-run.sh raises the timing hint for the unrelated tests/fm-self-repo-role.test.sh from 11958 to 12589 (the diff context shows 11958; the commit message says the previous hint was 7363). That is a raised tolerance on an unrelated test. The commit message and a dated note in docs/fm-test-portable-shards.md state why: hint drift of 1.71x against the 1.5x invariant. No action is needed beyond making sure the PR description repeats the reason. The new fm-timed-dispatch hint of 35556 is an estimate and will need a refresh once CI measures it.tests/fm-timed-dispatch.test.sh:73- tests/fm-timed-dispatch.test.sh does not cover cancelling a watch that has already fired, which is the usual lifecycle after a wake. The script's cancel path callsretire, which warns when no outcome was captured and removes the fired marker. Theordinaryaccount path is also untested. In addition,assert_contains ... kind ... atat line 73 is a weak substring check; use an exact equality check instead.✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --exclude-quarantined --pc02-if-idlebin/fm-timed-dispatch.sh arm/list/cancel/_condition driven in a disposable FM_HOMEbash tests/fm-timed-dispatch.test.sh (real process-event runners, fake quota-axi)✅ No issues found.
bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --exclude-quarantined --pc02-if-idlebash tests/fm-timed-dispatch.test.shBaselinebin/fm-test-run.sh --changed ...(already run)✅ **Document** - passed
✅ No issues found.
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
✅ No issues found.