Repository navigation
feat(spawn): support batch task dispatch - #33
Merged
Merged
Conversation
fm-spawn.sh now accepts multiple id=repo pairs in one call, looping internally (in bash) and re-execing the proven single-task path per pair. This removes the need to hand-write multi-task dispatch loops in the tool shell (zsh), which does not word-split unquoted $vars and silently mangles ad-hoc loops. A shared --scout applies to all pairs; single-task invocations are unchanged. Adds behavior tests.
This was referenced Aug 7, 2026
Closed
Closed
This was referenced Aug 11, 2026
NewAiCoder
added a commit
to NewAiCoder/firstmate
that referenced
this pull request
Sep 26, 2026
… watch arming (kunchenguid#33) * fix(supervision): notice stalled, failed, or gate-parked pipelines within minutes - bin/fm-nm-watch.sh owns the pipeline-state watch: arm re-arms idempotently so a relaunch converges, an arm failure queues a durable check wake, and register-clone records where an out-of-worktree pipeline runs (nm_clone=). - fm-crew-state.sh reads the run from the registered clone, and a paused: line claiming a no-mistakes run reads unknown when no run is found. - The watcher and away-mode daemon honor a claimed-run pause only while crew state confirms a working run, rechecking it on the stale cadence. * no-mistakes(review): {"summary": "Fix source-content test assertion and scope daemon locals"} * no-mistakes(document): docs(configuration): sync ownership of nm watch with fm-nm-watch.sh * no-mistakes(lint): Silence SC2016 false positive on literal sed pattern in test * no-mistakes(ci): Fixed docs/architecture.md:57 — replaced the broken fragment link `configuration.md#pipeline-state-watch-when-nm-state-task-id` (unresolvable because fm-doc-audience-check.sh's slugifier strips `<task-id>` as HTML, so it never matches the actual heading anchor) with `[configuration.md](configuration.md) "Pipeline-state watch"`. Verified with `bin/fm-doc-audience-check.sh` (ok, 99 surfaces, 398 local links) and `bash tests/fm-documentation-audiences.test.sh` (all 4 assertions pass). No heading renamed, no other files touched --------- Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
NewAiCoder
added a commit
to NewAiCoder/firstmate
that referenced
this pull request
Sep 26, 2026
… watch arming (kunchenguid#33) * fix(supervision): notice stalled, failed, or gate-parked pipelines within minutes - bin/fm-nm-watch.sh owns the pipeline-state watch: arm re-arms idempotently so a relaunch converges, an arm failure queues a durable check wake, and register-clone records where an out-of-worktree pipeline runs (nm_clone=). - fm-crew-state.sh reads the run from the registered clone, and a paused: line claiming a no-mistakes run reads unknown when no run is found. - The watcher and away-mode daemon honor a claimed-run pause only while crew state confirms a working run, rechecking it on the stale cadence. * no-mistakes(review): {"summary": "Fix source-content test assertion and scope daemon locals"} * no-mistakes(document): docs(configuration): sync ownership of nm watch with fm-nm-watch.sh * no-mistakes(lint): Silence SC2016 false positive on literal sed pattern in test * no-mistakes(ci): Fixed docs/architecture.md:57 — replaced the broken fragment link `configuration.md#pipeline-state-watch-when-nm-state-task-id` (unresolvable because fm-doc-audience-check.sh's slugifier strips `<task-id>` as HTML, so it never matches the actual heading anchor) with `[configuration.md](configuration.md) "Pipeline-state watch"`. Verified with `bin/fm-doc-audience-check.sh` (ok, 99 surfaces, 398 local links) and `bash tests/fm-documentation-audiences.test.sh` (all 4 assertions pass). No heading renamed, no other files touched --------- Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
NewAiCoder
added a commit
to NewAiCoder/firstmate
that referenced
this pull request
Oct 1, 2026
… watch arming (kunchenguid#33) * fix(supervision): notice stalled, failed, or gate-parked pipelines within minutes - bin/fm-nm-watch.sh owns the pipeline-state watch: arm re-arms idempotently so a relaunch converges, an arm failure queues a durable check wake, and register-clone records where an out-of-worktree pipeline runs (nm_clone=). - fm-crew-state.sh reads the run from the registered clone, and a paused: line claiming a no-mistakes run reads unknown when no run is found. - The watcher and away-mode daemon honor a claimed-run pause only while crew state confirms a working run, rechecking it on the stale cadence. * no-mistakes(review): {"summary": "Fix source-content test assertion and scope daemon locals"} * no-mistakes(document): docs(configuration): sync ownership of nm watch with fm-nm-watch.sh * no-mistakes(lint): Silence SC2016 false positive on literal sed pattern in test * no-mistakes(ci): Fixed docs/architecture.md:57 — replaced the broken fragment link `configuration.md#pipeline-state-watch-when-nm-state-task-id` (unresolvable because fm-doc-audience-check.sh's slugifier strips `<task-id>` as HTML, so it never matches the actual heading anchor) with `[configuration.md](configuration.md) "Pipeline-state watch"`. Verified with `bin/fm-doc-audience-check.sh` (ok, 99 surfaces, 398 local links) and `bash tests/fm-documentation-audiences.test.sh` (all 4 assertions pass). No heading renamed, no other files touched --------- Co-authored-by: NewAiCoder <170579485+NewAiCoder@users.noreply.github.com>
This was referenced Oct 7, 2026
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
* fix: block primary-session delegation outside the fleet Port upstream 50cc24a (kunchenguid/firstmate kunchenguid#854): a primary-home PreToolUse guard that denies delegation-shaped harness tools so fleet metadata and supervision stay intact. Merge the hook into this fork's .claude/settings.json without dropping statusLine or Bash seatbelts. Document Cursor primary as wired-via-shared-settings but live-unverified. * fix: make fm-subagent-pretool-check test executable CI runs tests/*.test.sh directly; without the executable bit the suite fails with exit 126 before the assertions run.
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 18, 2026
…ne (kunchenguid#33) * feat(bin): add the Starship bridge strip, a read-only Herdr plugin pane A slim strip across the top of a Herdr workspace with the STARSHIP wordmark in the flight deck colours, three crew lamps (busy, waiting for you, ready to merge) and the Mac's battery, which turns amber below 25% and red below 10% on battery. bin/fm-bridge-strip.sh renders it from the status bar's cached fleet reading and pmset, and installs, shows and removes the Herdr plugin in herdr-plugins/starship-bridge. fm-fleet-status-lib.sh can now report the decisions inside its ready figure, so the strip can split waiting for you from ready to merge; the status bar's nine fields are unchanged. * no-mistakes(review): Rename decision lamp, fix 5s redraw, tighten strip pid match * no-mistakes(review): Drop extra strip tier and fix stale lamp label comments * no-mistakes(test): Return keyboard focus to the owner's pane after strip opens * no-mistakes(test): Key bridge strip records on Herdr session as well as tab * no-mistakes(ci): ci-2 (Declared fork surface): CI requires every changed source path to map to an owning test, and the new herdr-plugins/starship-bridge/herdr-plugin.toml had none. The fix is one row in tests/fork-test-registry.conf: `covers herdr-plugins/starship-bridge/herdr-plugin.toml tests/fm-bridge-strip.test.sh`, plus a comment in the same style as the desk-floater rows. The previous attempt had already written it. The row is accurate: the strip suite runs install, checks the plugin link to that directory, and runs the open and run commands the manifest names. With the row in place, the CI command `bin/fm-test-run.sh --list --changed --base 11666f6` exits 0. All the other new paths map too: bin/fm-bridge-strip.sh, docs/bridge-strip.md, tests/fm-bridge-strip.test.sh, bin/fm-fleet-status-lib.sh and fork-surface.conf. bin/fm-fork-surface.sh check prints OK, and tests/fm-bridge-strip.test.sh and tests/fm-fork-surface.test.sh both pass. ci-1 (Behavior portable serial 13): this branch does not cause it, so there is no code change. No bin/fm-watch* script and not tests/fm-watch-arm.test.sh source or call bin/fm-fleet-status-lib.sh or anything else this branch changes. The only link is a comment in bin/fm-classify-lib.sh, which is why the changed-test list pulls in the watch suites. Locally, tests/fm-watch-arm.test.sh failed twice on this branch with "re-append was not byte-identical to the inherited row". It fails the same way on an untouched copy of the PR base commit 11666f6, so that failure was already there before this branch. The CI failure, "successor did not notify about new work", is a different case and depends on timing. Re-running the lane should clear it. ci-3 (Full suite): this check only gathers the lanes above and fails because they failed. It needs no change of its own. ci-fix-agent-timeout: as instructed, I ran only the strip suite, the fork-surface suite, the surface check and the --list --changed command, plus the watch-arm re-runs on this branch and on the base. I did not run tests/fm-test-run.test.sh. The only file changed is tests/fork-test-registry.conf, and it is not committed yet
|
GitHub Actions does not run on this account: every check on this PR stopped before starting because of an Actions billing or spending limit. None of them ran any code. This change was checked locally instead, at head 847bee0b:
|
|
Local test results for this PR, run with
The suites cover every file the PR changes: the status script, the fleet snapshot, the answer page server, the fleet panel model and the inbox path behind the refresh button. |
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
The captain asked to make bin/fm-spawn.sh support spawning several tasks in one call by accepting multiple id=repo pairs, removing the recurring need to hand-write multi-task dispatch loops in the tool shell. Motivation: the interactive tool shell is zsh, which (unlike bash) does not word-split an unquoted $var, so ad-hoc 'for ... in $pairs' / 'set -- $pair' loops silently mangled arguments and repeatedly broke multi-task dispatch. Decisions/tradeoffs: (1) chose unambiguous id=repo pair syntax so single-task invocations ( [harness|--scout|raw-cmd]) are detected as NOT batch and stay byte-for-byte unchanged - detection requires the first positional to contain '=' with a slash-free id part; (2) implemented batch as a re-exec of this same script in single-task mode per pair (via the FM_ROOT path, not $0) so the single-task path stays the one source of truth instead of duplicating spawn logic; (3) a shared --scout applies to every pair; (4) continue-on-failure - a failed pair is reported ('batch: FAILED to spawn ...') and skipped while the rest still launch, non-zero exit if any failed; (5) the watcher guard runs once per batch (not per pair) via an FM_SPAWN_NO_GUARD env flag on the re-execed children. Scope deliberately limited to this batch helper: the captain explicitly chose NOT to add a broader zsh word-splitting convention note elsewhere. Added tests/fm-spawn-batch.test.sh (behavior tests exercising arg routing only - each spawn fails fast at the missing-brief check before any tmux/treehouse side effect, so no real worktrees/windows are created) and documented the batch form in AGENTS.md section 7.
What Changed
bin/fm-spawn.shusingid=repopairs, with shared--scout, continue-on-failure behavior, and a single watcher guard for the batch.AGENTS.mdandREADME.md.Risk Assessment
✅ Low: Captain, the change is narrow, keeps single-task spawning as the source of truth, and the earlier CI coverage gap is now addressed.
Testing
Inspected the changed files, ran the targeted batch-spawn test and full behavior-test loop without lint/static analysis, captured CLI success and failure transcripts in the evidence directory, cleaned temporary
data,state, andprojectsfixtures from the worktree, and ended with no actionable test failures.Evidence: Targeted batch-spawn test output
ok - batch dispatch re-execs and reports every id=repo pair ok - a single id=repo pair routes through batch dispatch ok - single-task invocation (no '=') is untouched by batch detection ok - batch dispatch rejects an argument that is not id=repo ok - an arg whose id part contains '/' is not treated as a batch pairEvidence: All behavior tests output
Behavior test loop covering batch spawn and wake queue tests passed.Evidence: CLI batch spawn success transcript
$ PATH=<fake-tmux>:$PATH bin/fm-spawn.sh batch-a=projects/demo-a batch-b=projects/demo-b --scout spawned batch-a harness=codex kind=scout mode=direct-PR yolo=off window=firstmate:fm-batch-a worktree=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVNX6QWGFN889JRHRQTH6A1Z/fake-worktrees/firstmate_fm-batch-a spawned batch-b harness=codex kind=scout mode=local-only yolo=on window=firstmate:fm-batch-b worktree=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KVNX6QWGFN889JRHRQTH6A1Z/fake-worktrees/firstmate_fm-batch-b exit=0Evidence: CLI batch failure transcript
$ FM_SPAWN_NO_GUARD=1 bin/fm-spawn.sh missing-a=projects/no-a missing-b=projects/no-b error: no brief at /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KVNX6QWGFN889JRHRQTH6A1Z/data/missing-a/brief.md batch: FAILED to spawn missing-a (projects/no-a) error: no brief at /Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KVNX6QWGFN889JRHRQTH6A1Z/data/missing-b/brief.md batch: FAILED to spawn missing-b (projects/no-b) exit=1Evidence: Fake tmux calls from CLI success check
Fake tmux call log showing two batch children created windows, senttreehouse get, and launched codex from the normal single-spawn path.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
tests/fm-spawn-batch.test.sh:1- The new batch-dispatch behavior test is not wired into the existing Behavior tests job, which still only runstests/fm-wake-queue.test.sh; this means the branch's main regression coverage will be skipped by CI and can silently rot. Addtests/fm-spawn-batch.test.shto the CI test step, or change the job to run all intended behavior tests.🔧 Fix: Wire batch behavior tests into CI
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
tests/fm-spawn-batch.test.shfor test_script in tests/*.test.sh; do "$test_script"; donebin/fm-harness.sh crewPATH=<fake-tmux>:$PATH bin/fm-spawn.sh batch-a=projects/demo-a batch-b=projects/demo-b --scoutwith temporary briefs/projects and capturedstate/*.metaplus fake tmux callsFM_SPAWN_NO_GUARD=1 bin/fm-spawn.sh missing-a=projects/no-a missing-b=projects/no-bFM_SPAWN_NO_GUARD=1 bin/fm-spawn.sh mixed-a=projects/no-a bogus-no-equalsgit status --short && find data state projects config -maxdepth 1 -type e 2>/dev/null | sort✅ **Document** - passed
✅ No issues found.
.github/workflows/ci.yml:18- Configured ShellCheck lint could not be run because shellcheck is not installed in PATH or common local locations; unresolved ShellCheck findings may remain.✅ **Push** - passed
✅ No issues found.