Repository navigation
feat: add scout task lifecycle - #7
Conversation
* feat: scout tasks - delegate investigations and repros with report deliverables * no-mistakes(review): Require clean promotion handoff * no-mistakes(document): Sync scout task documentation
|
Resolved. The middleman's surface settled as its four calls - greet, send, sendImage, press - plus the held /updates WebSocket stream carrying the fleet and a watched pane, with every failure surfaced as a typed Trouble. That shape was specced in #12 and is built and running on main. Closing as answered and superseded by #12. |
…unchenguid#7) * fix(pi): match Pi 1.0 stock tool-call header and export renderer deps in Calm tests Pi 1.0 shows call arguments in the stock fallback tool-call header and renamed the export renderer's getToolDefinition dependency to getToolRenderers. The outcomes tool now probes the installed stock row and mirrors the header, and the Calm export fixtures pass both dependency names so they run on old and new Pi. * no-mistakes(document): Document probed Pi 1.0 call header in Calm docs * no-mistakes(ci): Shard 2 failure was a real test incompatibility with Pi 1.0.x, which CI installs from npm latest. I reproduced it locally against Pi 1.0.2 and fixed it in tests/fm-calm-pi-extension.test.sh. The Pi-1.0 tests in the file now pass, along with the rendered-export-DOM guard. Two causes: 1. Pi 1.0 runs the TUI fullscreen by default. The tmux `capture-pane` only saw the visible viewport, so earlier tool rows were missing and "calm mode was not off by default (missing CALM_E2E_OUTPUT)" fired. I added `"tuiMode":"regular"` to the three tmux Pi `settings.json` fixtures. Older Pi ignores the key. 2. Pi 1.0 now keeps `display:false` custom messages in the exported HTML as `hook-message hook-message-hidden`, hidden by CSS and shown only by the H toggle. The DOM assertion rejected any hook-message text. It now requires every hook-message element to carry the hidden class. Older Pi, which emits none, still passes. Lint 1 isn't caused by this PR. Its ShellCheck run was killed with exit 143 after about 7.5 minutes, with no diagnostics, so it looks like a runner cancellation or timeout. I ran the pinned `bin/fm-lint.sh --fast` on the changed file locally and it is clean. I did not run the full-rigor lint that CI uses. Not run: the other test scripts in the shard, or the full CI shard. The earlier 'Calm-off ToolExecutionComponent' (shard 4) failure was already handled by the preceding commits * no-mistakes(ci): Changed only tests/fm-calm-pi-extension.test.sh. No production code, secondmate tests or Lint 1 were touched. I could not verify the fix against Pi 1.0.2. Locally the installed Pi is 0.83.0 and the global npm Pi package isn't found, so most Pi-dependent tests skip. Changes: (a) New `wait_for_all_text` helper re-captures the pane on every poll and succeeds only when every token is in the same snapshot. The first startup wait (restored transcript) now waits for all six tokens that the Calm-off assertions check: the completion line, `CALM_E2E_OUTPUT`, `fm_watch_arm_pi`, the probe wake row, `Thinking...` and `fm-calm.ts`. The restart wait waits for both the prompt and response tokens. The second `/calm` restore wait waits for the output, watcher tool, wake row and active-probe tokens together. I only added tokens to waits; every assertion is unchanged. The negative assertions can't be waited on. (b) `wait_for_text` now delegates to the helper with a bounded 30 s budget (600 × 0.05 s, up from 6 s). The commit message should state the measured local restore times of about 1.6-2.5 s. (c) New `kill_session_and_wait` kills the session and polls `list-sessions` (bounded 10 s) until the old tmux server has exited. It replaces every `kill-session` in the file, so each kill-then-new-session pair on the same socket is covered. Verification: - `bash -n` passes. - `bin/fm-lint.sh --fast` ran on the file with no diagnostics shown in the tail I viewed. I did not run the full-rigor lint. - A full local run printed `not ok - Pi Calm hidden-block geometry E2E did not complete the /reload viewport transition`. That wait is `wait_for_geometry_transition`, which I did not change, but my `kill_session_and_wait` is used in that geometry path. I tried to run the original file as a baseline to see whether it also fails. I killed that run to restore my edited file, so I don't know whether the failure predates my change. Treat it as an open question and check it against CI on Pi 1.0.2
What and whySlice 01 ( Acceptance
Spec changes for the owner to confirmThe slice asks the reviewer "whether any behavior in the code isn't stated in the domain model". Two fresh-context reviews ran: the first found about 35 such behaviors, the second checked the fixes. The domain model is now v2.3. It states every rule below, and Followed the reference where the model is silent (the slice makes the reference the tiebreaker):
Rules the model and reference now state (
A scratch differential fuzz of core against the updated reference agrees across thousands of random inputs for every function. The one difference is a Product questions for the ownerImplemented as described above; each is easy to change if the answer is different.
Vectors v4 (follow-up)The README asks for a Notes for later slices
Test evidenceThere is no UI in this slice, so there are no screenshots or preview e2e. Risks
|
) * fix(spawn): refuse missing harness binaries before launch Resolve and probe verified launch executables before creating task endpoints, preventing absent CLIs from leaving dead worker shells. Co-authored-by: Cursor <[email protected]> * no-mistakes(review): add stdin-closed timeout-bounded version probe with override knob * no-mistakes(review): escalate timed-out version probe to SIGKILL after grace * no-mistakes(review): kill probe process group so timed-out wrapper descendants die --------- Co-authored-by: Cursor <[email protected]>
…colliding with fork-side code or test fixtures. I made one small fix per check, all in the working tree on top of the merge commit fd2aaaf, which stays as it is. The changes are not committed yet; the outer pipeline commits them as new commits. Fixes, one per finding: - **Serial 1 (explicit-target send).** Rule: an explicit `sess:<window>` target must be a live window. Upstream fm-send now checks that, but the fake tmux in `tests/fm-send-steer-count.test.sh` listed no windows. Its `list-windows` now prints `fm-build` and `win`. `tests/fm-send-inbox.test.sh` already listed its target. - **Serial 11 (push-skip).** Rule: every CI job skips on push when `FM_CI_SKIP_PUSH=1`. The fork's `fork-surface` and `leak-guard` jobs in `.github/workflows/ci.yml` now have the same `if:` as upstream's jobs. `tests/fm-ci-workflow.test.sh` passes. - **Leak guard.** Rule: vendor bot noreply addresses are allowlisted, people's addresses are not. `[email protected]` now sits next to the other bot addresses in `bin/fm-leak-lib.sh`. The new `test_vendor_bot_emails_pass` in `tests/fm-leak-guard.test.sh` checks that all four bot addresses pass and that a person's address still fails and is named. `bin/fm-leak-guard.sh` passes on the whole repo. - **Serial 8 and 12 (cursor).** Rule: any fake cursor-agent a test expects to be accepted must answer upstream's `--help` probe with Cursor's identity. Fixed the stubs in `tests/fm-home-port.test.sh` and `tests/fm-control-relaunch.test.sh`. Both suites pass with an empty HOME, so the real cursor-agent on this Mac cannot hide a failure. - **Serial 2 (unconfigured --secondmate spawn).** The fork's own spawn check (kunchenguid#7) refuses a missing harness binary, and it runs before upstream's home check. Upstream's test in `tests/fm-backend-paseo.test.sh` pins `claude` as the harness but had no `claude` on its fake PATH, and the CI runner has none either. The test now provides a fake `claude` in its fakebin, so the spawn gets past the fork's check and reaches the home check. I reproduced the CI failure first: the old test fails with `claude` off PATH. The fixed test passes under that same restricted PATH. **Call-companion race left alone.** The previous timed-out round had also edited `bin/fm-call-companion.sh` and its test for the "a call whose notes failed was archived" stamp race. It was not the only red left (cursor also failed in serial 12), so per your instruction I reverted both files. If it is still the only red after this push, the fix goes in the stamp-minting helper as you described. **Verification:** - **Pass:** `fm-ci-workflow`, `fm-leak-guard`, `fm-send-steer-count`, `fm-home-port`, `fm-control-relaunch` (empty HOME), `fm-fork-surface`, `bin/fm-fork-surface.sh check`, `bin/fm-lint.sh` (ShellCheck, actionlint, leak guard), and the paseo secondmate case run on its own. - **Still failing on macOS:** the full `fm-backend-paseo` suite fails one earlier, unrelated case: "kill should archive the emptied firstmate workspace". It runs before the function I edited. That suite's other failure on CI was the secondmate case fixed above
…ING required checks (kunchenguid#7) * docs: add one contribution page for teams, add-ons and homes; correct CONTRIBUTING branch protection and questions * no-mistakes(review): Match the contribution page's leak-check wording to the configuration docs
… and "Full suite" only fails because those lanes did. I reproduced each failure locally and fixed it with a test-only change. No production code changed. 1. Serial 16, tests/fm-lane-capacity-integration.test.sh (new from upstream). Invariant: a spawn fixture must give the harness it configures a launch binary, because this fork's fm-spawn.sh refuses a missing harness binary before launch (kunchenguid#7). The test sets crew-harness=codex but had no fake codex. Fixed by adding codex to the fake bin directory, and to the copied subset the live-load case uses (the second place the same rule applies). Reproduced first, then passes locally. 2. Serial 13, tests/fm-spawn-account.test.sh (fork-only). Invariant: a launch line normalized for comparison must not contain a case-specific path. Upstream now adds `export FM_HOME='<case home>'` to every ship/scout launch line, and the fork's helper that compares launch lines across two different case homes did not replace the bare home path. Fixed by replacing the bare home with `<HOME>` after the more specific state and config replacements. Reproduced first, then passes locally. 3. Serial 11, tests/fm-calm-pi-extension.test.sh. Not caused by this PR: CI installs Pi without pinning, and Pi 1.5.1/1.5.2 came out after main's last green run, which used Pi 1.5.0. Pi 1.5.x reads a new `pendingBashComponents` field in `updatePendingMessagesDisplay`. Real Pi sets that field when it builds the object, so the extension itself works; only the test's `Object.create(InteractiveMode.prototype)` host lacked it, and that is the only fixture built this way that calls this method. Fixed by adding `pendingBashComponents: []` to that host. Reproduced with Pi 1.5.2 on Node 22.23.4, the same as CI. The whole file now passes on both Pi 1.5.2 and 1.5.0 (16 ok, run under a UTF-8 locale; without one, an unrelated resize check fails on this Mac because the shell counts bytes, not characters). 4. Serial 10, tests/fm-extension-binding.test.sh (identical to upstream). Invariant: every lane in the aggregate run must finish within the coordinator's 34-second limit. The `lifecycle-flow` lane ran its own block and then the self-contained ownerless-readiness block one after the other, about 34 s in total. CI timings for this test were 24.6 s, 27 s and 33.5 s on earlier green runs, and 37.3 s here, when the lane was killed. Locally, the base commit and this branch take about the same (35 s vs 34 s), so the catch-up did not slow it down; the lane was simply at its limit. Fixed by running the existing `lifecycle-orphan-readiness` segment as its own concurrent lane in the aggregate and taking it out of `lifecycle-flow`. Coverage is unchanged, and docs/verification/process-event-sources.md already names that segment. The `lifecycle-flow` lane now takes about 14 s, orphan-readiness about 21 s, and the full test about 25 s, all passing. shellcheck is clean on all four changed test files
…uling and module splits' (kunchenguid#7) from fm/lint-memory-bound into main
Intent
Extend firstmate so crewmates handle ALL project-specific work, not just coding that ends in a PR. The captain asked for this and approved the proposed design including the rule-3 carve-out and promotion. New task shape 'scout' (investigations, planning, bug reproductions, audits): deliverable is a standalone report at data//report.md instead of a PR; the worktree is declared scratch from the start. Changes: (1) AGENTS.md - identity broadened from coding tasks to all project work, intake now classifies shape (ship vs scout) before readiness, scout flow documented (no validate/PR/merge stages; report -> relay to captain -> immediate teardown), promotion documented, hard rule 3 gets the deliberate scout carve-out, backlog format gains a report-link Done variant, brief section mentions --scout; (2) bin/fm-brief.sh - --scout flag writes a scout contract scaffold (never push, report definition of done, worktree-is-scratch framing); (3) bin/fm-spawn.sh - --scout flag records kind=scout in the task meta, default kind=ship for backward compatibility (absent kind in old meta files is treated as ship by teardown); (4) bin/fm-teardown.sh - scout tasks skip the unpushed-work refusal once data//report.md exists, refuse with a clear message when the report is missing, ship tasks keep the full protection unchanged; (5) new bin/fm-promote.sh - flips kind=scout to ship in meta so a scout crewmate can be promoted in place (keeping worktree and context) when its findings reveal shippable work, restoring full teardown protection. Deliberate decisions: --scout flags are parsed positionally-tolerant (filtered from args) on both fm-brief and fm-spawn; scout briefs forbid pushing to ANY remote (stronger than ship's never-push-to-default) because nothing from a scout worktree should ever leave the machine; the report-missing teardown refusal deliberately mirrors the existing refusal wording style; all scripts were smoke-tested locally (both scaffolds, promote happy/error paths, teardown refusal and carve-out paths).
What Changed
data/<id>/report.mdinstead of PR validation.--scout, persisted taskkindmetadata, and documented scout intake, supervision, teardown, and Done backlog entries.bin/fm-promote.shand updated teardown protections so scout scratch work can only be discarded after a report exists while ship tasks retain unpushed-work safeguards.Risk Assessment
✅ Low: The change is well-bounded to firstmate task orchestration scripts and documentation, and the previously flagged promotion handoff risk is addressed with explicit cleanup-before-branch guidance.
Testing
Exercised the scout flow through the actual firstmate shell scripts and treehouse-backed spawn/teardown path, captured reviewer-visible CLI transcripts, verified documented edge cases, and confirmed no transient test files remained in the working tree; all tested behavior passed.
Evidence: Scout lifecycle transcript
Shows scout brief scaffolding,fm-spawnrecordingkind=scout, teardown refusing beforedata/e2e-scout/report.md, teardown succeeding after the report despite an unpushed scratch commit, andfm-promotechanging meta tokind=shipwith ship teardown protection restored.Evidence: Scout edge-case transcript
Showsfm-brief.shaccepting--scoutbefore positional args andfm-teardown.shtreating legacy meta withoutkind=as ship-protected.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-promote.sh:22- The promoted task instructions tell firstmate to have the crewmate createfm/<id>from the current scout worktree state. Scout briefs explicitly allow arbitrary scratch edits and commits, so this can put exploratory work on the shipping branch unless promotion first requires an inventory/cleanup step or a reset/cherry-pick of only intended changes.🔧 Fix: Require clean promotion handoff
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
Inspected changed files withgit diff --name-only 8b6f11ad5518e345fd84e022d4caa0dbbabcbdee..45d4b1666643557641983374db58d046cad1c248and readAGENTS.md,bin/fm-brief.sh,bin/fm-spawn.sh,bin/fm-teardown.sh, andbin/fm-promote.sh.Ran an end-to-end scout lifecycle smoke using./bin/fm-brief.sh e2e-scout .tmp-scout-lifecycle/project --scout,./bin/fm-spawn.sh e2e-scout .tmp-scout-lifecycle/project "sh -c 'sleep 300'" --scout, scratch commit creation in the treehouse worktree, missing-report teardown refusal, report creation, successful scout teardown, and./bin/fm-promote.sh e2e-promote.Ran edge-case smoke checks for./bin/fm-brief.sh --scout e2e-edge-brief .tmp-scout-edge-cases/projectand./bin/fm-teardown.sh e2e-legacywith a legacy meta file lackingkind=.Checked for leftover working-tree artifacts withgit status --shortplus glob checks for.tmp-scout-*,data/e2e-*, andstate/e2e-*.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.