Repository navigation
feat(skills): add the /updatethecaptain repeating worker report loop - #2724
Open
EternalTime wants to merge 4 commits into
Open
EternalTime wants to merge 4 commits into
EternalTime wants to merge 4 commits into
Conversation
…ge range, document timer
This was referenced Aug 22, 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
Let the captain ask to be kept posted on the workers and get a plain-English update covering every worker straight away and then every ten minutes - what each has finished, what it is doing now, what is left, and how long it needs - with any question a worker has for the captain surfaced at the top of the message, running until no worker is left or the captain stops the updates.
What Changed
updatethecaptainskill (.agents/skills/updatethecaptain/SKILL.md): it builds the in-flight worker list frombin/fm-bearings-snapshot.sh --all-in-flightplusbin/fm-crew-state.sh, reports every worker in plain English across four parts - finished, working on now, still to do, how long it needs - places any worker question for the captain at the top of the message, reports once immediately, repeats on each timer wake, and ends when the list is empty. The companionupdatethecaptain-stopskill disarms the loop and is a no-op when nothing is armed.bin/fm-captain-report-timer.shwitharm/status/disarm, which generates a trust-bound custom watcher check (state/captain-report.check.shplus its trust binding and a privatestate/.captain-report-timerstamp) so the ten-minute repeat rides the existing authenticated check dispatch rather than a background process. Default interval 600s, accepted range 60-86400, idempotent arm and disarm, and the armed check plus its stamp and trust binding are rolled back if registration or verification fails./updatethecaptainand/updatethecaptain-stopto the skills and section 3 documents the new stamp artifact, the README built-in-skills table anddocs/scripts.mdgained the new entries,docs/documentation-audiences.jsonclassifies both SKILL.md files, andtests/fm-captain-report-timer.test.shadds 13 cases covering cadence, idempotence, rollback, and a realbin/fm-watch.shdispatch drained throughbin/fm-wake-drain.sh.Risk Assessment
✅ Low: The change is purely additive, rides the existing authenticated custom-check dispatch rather than introducing a new execution path, carries a focused test suite, and every round-1 concern the user chose to fix is now resolved with correctly scoped, minimal edits.
Testing
I ran the change's own suite (tests/fm-captain-report-timer.test.sh, 13 cases green), the doc/AGENTS.md suites its non-code edits touch, and the runner's coverage guard, then drove the captain's actual experience end-to-end against the real binaries: the skill's fleet read listing three live workers, an unadorned arm landing on the ten-minute cadence, a nine-minute sweep staying quiet, two consecutive ticks each dispatched by a real bin/fm-watch.sh and durably queued by fm-wake-drain.sh (the committed suite only proves one, so this is where the repeat is demonstrated), the loop ending by itself once the rebuilt worker list is empty, and /updatethecaptain-stop disarming cleanly and staying harmless when nothing is running. I also re-probed the round-1 timing flake with 14 concurrent copies of the suite - 182/182 cases ok, no failures. No screenshot applies: the change ships no rendered UI, only a skill contract and a shell timer, and the captain-facing surface is a chat message, which I captured as the three markdown report files. Those report bodies are prose the skill instructs the agent to write rather than code output, so I authored them by following SKILL.md against the fleet state stage 1 really produced, which lets a reviewer check the four-part-per-worker format, the question pinned at the top, the closing line for a finished worker, and an overrun stated plainly before the new estimate. Everything passed and I found nothing actionable.
Evidence: Captain-visible E2E transcript of the whole report loop
Evidence: Ten-minute cadence and two consecutive watcher-dispatched ticks (excerpt)
Evidence: Immediate report - worker question at the top, four parts for all three workers
Evidence: Ten-minute repeat - overrun stated plainly, finished worker's closing line, new question surfaced
Evidence: Closing report when no worker is left running
Evidence: E2E driver that produced the transcript
Evidence: Flake re-probe: 14 concurrent runs of the timer suite
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 6 issues found → auto-fixed ✅
.agents/skills/updatethecaptain/SKILL.md:33- The skill declares its no-change-tick exception only against AGENTS.md section 8 ("That is a deliberate exception to section 8's rule that no-change updates are not captain-facing progress"), while line 23 says section 9 "owns how to talk to the captain" and "Write every line of every report through that contract." Section 9 (AGENTS.md:472-473) still says "Do not surface automatic fixes, retries, routine progress, or internal supervision mechanics" and "When a routine operational update's specific event requires no action but a response must be sent, reply exactlyCaptain, shipshape.". A ten-minute tick where nothing changed is precisely a routine operational update requiring no action, so as written section 9 directs the exact-string reply and contradicts the required behavior "get a plain-English update covering every worker straight away and then every ten minutes". Consider extending the exception paragraph to name section 9's routine-progress prohibition and theCaptain, shipshape.rule explicitly, or adding the carve-out to the two new AGENTS.md section 9 lines (AGENTS.md:478-479).bin/fm-captain-report-timer.sh:192-fm_custom_check_registered "$STATE" "$ID" || die "the timer check did not register"exits without removing the artifacts it just published, unlike thefm-check-register.shfailure branch immediately above (lines 185-191), which removes CHECK, STAMP, and TRUST. If this assertion fails (a concurrent write or a TOCTOU race between register.sh's own final verify and this one),state/captain-report.check.shis left behind mode 0700 with a trust binding that no longer matches its bytes. bin/fm-watch.sh:938-947 then failsfm_custom_check_snapshot_preparefor it, appends it torejected_checks, and lines 962-967 append a wake and callwakefor "rejected unauthenticated state checks" - which exits the watcher and burns a firstmate turn on every check sweep (FM_CHECK_INTERVAL, default 300s) indefinitely, since nothing ever removes the orphan. Mirror the rollback: remove CHECK, STAMP, and TRUST before dying here too.README.md:178- The "Built-in skills" section states "Firstmate ships these user-invocable built-in skills" and its table enumerates all five existing skills carryinguser-invocable: true(/afk, /ahoy, /bearings, /updatefirstmate, /stow). Both new skills also carryuser-invocable: true(.agents/skills/updatethecaptain/SKILL.md:7, .agents/skills/updatethecaptain-stop/SKILL.md:7) but neither is added to the table, so the documented captain-facing command set is now incomplete for a feature the captain is expected to invoke by name. Add/updatethecaptainand/updatethecaptain-stoprows.AGENTS.md:99- Thestate/inventory in section 3 enumerates every artifact class the runtime writes, including private dot-files such as.pr-check-quarantine/,.pr-check-migration.log, and.pr-check-migration-scan-v1. The timer's new stampstate/.captain-report-timer(bin/fm-captain-report-timer.sh:53, mode 0600, one epoch-seconds line) is a new artifact class and is not listed, so the inventory no longer describes everything a home can contain.captain-report.check.shandcaptain-report.check-trustare already covered by the generic<id>.check.sh/<id>.check-trustentries.bin/fm-captain-report-timer.sh:62-usage() { sed -n '2,20p' ... }prints header lines 2-20, but the usage block ends at line 18 (status ... Exits 0 either way.). Line 19 is a bare#and line 20 is the first line of the rationale paragraph, so--helpand every argument error end with the dangling fragment "The timer rides the watcher's existing authenticated custom-check dispatch". Use2,18p, or print the whole header the way bin/fm-procevent.sh:123 does.bin/fm-captain-report-timer.sh:53- The fixedID=captain-reportoccupies the samestate/<id>.check.shnamespace as task ids, andfm_task_id_path_safe(bin/fm-pr-lib.sh:93-99) has no reserved-name list. A task literally namedcaptain-reportwould letbin/fm-pr-check.shoverwrite the armed timer check with a PR poll, andbin/fm-teardown.sh:746would silently delete it, ending the report loop with no notice to the captain. The probability is very low andx-watchalready shares this namespace by the same convention, so this is noted rather than actionable.🔧 Fix: roll back armed check on verify failure, fix usage range, document timer
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed ✅
tests/fm-captain-report-timer.test.sh:47- tests/fm-captain-report-timer.test.sh shipped a timing flake: age_stamp backdated the stamp from the value arm wrote, but the generated check measures against the CURRENT time, so any delay between arm and a "not yet due" probe eats its 1-second margin and fires the timer. It failed on an ordinary local run ("not ok - the timer printed one second early") and reproduced in 1 of 14 concurrent runs of the committed version. Fixed by anchoring the helper (now set_elapsed) to the current time and giving early probes a 3-second margin; 14 concurrent runs of the fixed suite are clean.bash tests/fm-captain-report-timer.test.sh- all 13 cases pass, including the real-watcher case that drivesbin/fm-watch.shandbin/fm-wake-drain.shNew focused casetest_default_cadence_is_ten_minutes-armwith no--intervalruns at 600s, stays silent just short of ten minutes, and wakes once past itFlake probe: 14 concurrent runs of the test file as committed at a4df23d (1 failure) versus 14 concurrent runs of the fixed file (0 failures, 13 ok each)bash tests/fm-documentation-audiences.test.sh- covers the two new SKILL.md entries added to docs/documentation-audiences.jsonManual end-to-end walk of the skill procedure over a sandbox home:bin/fm-bearings-snapshot.sh --all-in-flight,bin/fm-crew-state.sh <id>,bin/fm-captain-report-timer.sh arm|status|disarm, a realbin/fm-watch.shdispatching the due check, andbin/fm-wake-drain.shshowing the durable check wakeVerified every command the skill's procedure names exists and accepts the flags it uses (fm-session-start.sh,fm-bearings-snapshot.sh --all-in-flight,fm-crew-state.sh,fm-captain-report-timer.sh)🔧 Fix: fix timing flake in captain-report timer test
✅ Re-checked - no issues remain.
bash tests/fm-captain-report-timer.test.sh- all 13 cases pass, including the case driving a real bin/fm-watch.sh and draining the durable wake queue14 concurrent copies oftests/fm-captain-report-timer.test.sh- 182/182 cases ok, confirming the round-1 timing flake fix holds under loadbash tests/fm-documentation-audiences.test.sh- docs/documentation-audiences.json gained both new SKILL.md entriesbash tests/fm-ensure-agents-md.test.shandbash tests/fm-supervision-instructions.test.sh- the AGENTS.md surfaces the change editsbash bin/fm-test-run.sh --check-coverage- the new suite is mapped into a lane (total=152)Manual E2E:bash captain-loop-e2e.sh- fm-bearings-snapshot.sh --all-in-flight over a 3-worker home,fm-captain-report-timer.sh arm(interval=600s, due-in=600s), a 9-minute sweep staying silent, two consecutive realbin/fm-watch.shticks each queued bybin/fm-wake-drain.shas a check wake, an emptied fleet ending the loop viadisarm, and/updatethecaptain-stopon both an armed and an unarmed home✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.