Repository navigation
fix: preserve literal ampersands in spawn and supervision rendering - #7906
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. Reviews (1) · Last reviewed commit: "fix: preserve literal ampersands in spaw..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thanks @WTF-Am-ID. This is a nice small fix. What I checked (tip Contract-class: restore. Templated paths are supposed to render literally, and that's how they behave on Bash 3.2. Bash 5.2's default broke it, and nothing new runs. One ask before merge: the live table leaves the scenario this PR exists for, Bash 5.2+ with FYI, older #3708 adds the same shopt to Waiting on you for the Bash 5.2 live evidence. |
|
I ran the missing scenario on unchanged head The option is enabled on interpreter entry, and each product script disables it internally as intended. No source changes or new pipeline run were needed. |
|
Speaking as Kun's firstmate: this is merged. Thank you @WTF-Am-ID — really appreciate you taking the time on this. The Bash 5.2 transcript ( |
…m commits on the branch (e.g. kunchenguid#7906, kunchenguid#7969, kunchenguid#7939) that don't fit this repo's base c12c102. The base's `fm-spawn.sh` already requires a backlog item to record its repo, and the upstream tests don't set one. That caused the failures across spawn, hooks and project capacity, plus lint and Full suite. I reset the working tree to c12c102 and re-applied only the herdr diff, so the staged change is now just `bin/backends/herdr.sh`, `docs/herdr-backend.md` and `tests/fm-backend-herdr.test.sh`. `fm-backend-herdr` and `fm-ci-workflow` pass locally. `fm-project-capacity` still fails on the base too, so it is not caused by this PR. I did not re-run the other failing shards or the lint jobs locally. Nothing is committed or pushed; the pipeline must commit this tree and push, because the branch history still contains the upstream commits
* fix(bin): keep failed or non-schema remote reply reads out of captures (#7874) * Keep malformed remote reply captures from wedging * no-mistakes(document): Fix garbled remote reply source failure comment * no-mistakes(document): Document remote reply failure handling --------- Co-authored-by: Pitch Perfekt Collective <[email protected]> * feat(bin): add per-project pr=manual registry token for worker-written PR text (#7937) * feat(bin): per-project pr=manual registry token for hand-written PR text A no-mistakes ship on a project where an outside maintainer reviews the PR let the pipeline's pr step rewrite the hand-written title and body on every validated push. The registry now records pr=manual, resolved by fm-project-mode.sh --pr and carried by fm-brief.sh --pr, fm-spawn.sh and fm-promote.sh like forge=. The generated brief skips pr and ci, and the worker writes and publishes the PR text itself. * no-mistakes(review): Drop pr_text key; fix manual-PR checks wait and base * no-mistakes(review): Remove dead PR_TEXT and timeout example * no-mistakes(document): Fix README pr=manual sentence grammar * test(bin): restore the displaced placeholder comment and rename the spawn agreement test The comment for the leftover-placeholder test sat above the new pr=manual tests. The spawn test said it recorded the PR text, but it only checks that a launch happens. * fix: refuse teardown when Git hides untracked files (#7909) * fix(teardown): detect untracked work regardless of Git status config * test(watcher): avoid blocking FIFO contention handshakes * no-mistakes(document): Document hidden-untracked teardown safety --------- Co-authored-by: Kun Chen <[email protected]> * fix(bin): keep newest run attribution in crew-state (#5954) * fix: prefer current run over stale overview row * fix: preserve newest run precedence over stale status * no-mistakes(document): Document live-run precedence in crew-state attribution * fix: use ledger order for same-minute run precedence * test: cover both overview orders for same-minute run attribution Document and pin newer-first (recorded AXI) and historical-first overview orders. Same-minute ledger timestamps use row order as the tie-break so an older live bare status cannot hide a newer completed run. * no-mistakes(review): Treat failed as overridable terminal overview status * no-mistakes(review): Fix equal-head live run precedence with identity ordering * no-mistakes(document): Updated run identity ordering documentation * no-mistakes(lint): Fix ShellCheck export warning * no-mistakes(review): Prove same-head ordering or report unknown * no-mistakes(review): Guard failed selected-run reads and drop dead same-head ordering * no-mistakes(ci): I fixed both Greptile findings (ci-1, ci-2) in bin/fm-crew-state.sh. The change is in the working tree. I did not commit it, push it, or reply to the Greptile threads, because those steps belong to the outer pipeline. ci-1. Invariant: a live run from bare `axi status` may replace a terminal overview selection only when it is proven newer than every other run on the same branch. Previously the code compared it only against the selected run. Now crew-state reads each other candidate with `axi status --run <id>` and compares the live run against each one: - If another candidate is also live, it reports `unknown`, "competing live runs". This keeps the competing-live-runs check. - If two runs share a head and a ULID timestamp, it reports `unknown`, "same-head run ordering unverified", as before. - It promotes the live run only when it is proven newer than all other candidates. - If the live run is newer than the selected run but not proven newer than some other candidate, it reports `unknown`, "run ordering unverified", and names every run id. This means neither the stale selected run nor the live run can hide a newer failed run. This branch is the one judgement call: without it, the stale "done" row A would still hide C's failure. - In all other cases the overview's selection stands. The lib helper is now a pairwise compare called `fm_nm_run_is_newer_than` (it was `fm_nm_run_is_newer_than_selected`). The selected run's detail from the loop is reused when the read succeeded, as in the round-1 fix. I updated the sentence in docs/architecture.md to match. ci-2. Invariant: the `no-mistakes runs` ledger is read only to order runs with different heads. It is now fetched lazily, at most once, and only when a candidate's head differs from the live run's head. Same-head ULID comparisons never call it. Regression test: `test_live_run_newer_than_selection_does_not_hide_newer_failed_run` covers A (stale completed, listed first), C (newer failed) and B (live, created between them). All three share one head and use ULID ids. It expects `state: unknown`, C's id in the output, and no `state: working`. Before the fix it fails: with the fixed code stashed it printed `state: working ... run: 01M1...` (run B). On the original base 3fbace9f the overview would select A, so the output would be `done`, which also fails the `unknown` check. I did not run that base case. Verification: `bash tests/fm-crew-state.test.sh` passes in full ("all fm-crew-state tests passed", the new test included). `shellcheck` on the three changed shell files reports only the existing info-level SC1091 "not following sourced file" notes. No end-to-end run against a live no-mistakes daemon was possible here. I checked the change with the crew-state test harness and its fake `no-mistakes` CLI --------- Co-authored-by: mehulbhagwani <[email protected]> Co-authored-by: Pitch Perfekt Collective <[email protected]> * chore(ci): run the full suite on outside pull requests only after the full-ci label Outside pull requests run only the coverage guard and repo invariants until the full-ci label is added; lint and every test lane wait. A new Full suite check fails naming the full-ci label until it is added, and fails whenever a lane fails or is cancelled. The label starts the full suite, and later pushes run it again; main pushes, own branches and write-access authors run everything as before. Other labels run no job at all: their skipped checks take a 'Not run for label - ' prefix, so they cannot hide an earlier failure or a later pass. Close main pushes keep only the newest run; CONTRIBUTING.md explains the label, and the full-ci label now exists. * feat(bin): add opt-in systemone and openai decision providers to dispatch resolution (#7664) * feat(bin): add opt-in systemone and openai providers to typed dispatch resolution Extend the FM_DISPATCH_PROVIDER/FM_DISPATCH_MODEL seam with a generic systemone provider (any System One-compatible host at FM_DISPATCH_BASE_URL, optional FM_DISPATCH_API_KEY) and an openai provider that maps the Choice request to OpenAI's Decisions API and its answer back. No provider set keeps the original off line; the never-send check runs on the endpoint and the final per-provider body. Live provider captures are recorded as pending. Refs #7643, builds on #7149. * docs(verification): record the live OpenAI Decisions capture for dispatch resolution Add a dated 2026-10-23 section for the openai provider: 25 hand-labeled synthetic briefs against gpt-6-luna, outcome and latency tables, the usage and header fields actually returned, a calibration note, and one verbatim request and response pair. The systemone live check stays pending. Refs #7643. * docs(verification): record the live Clef capture for the systemone provider Replace the pending systemone section with a dated 2026-10-23 run against Cloudflare Workers AI's @cf/cloudflare/clef, reached through a local test-only relay because Workers AI serves System One at /ai/run/<model> in a {result, success} envelope. Adds the outcome and latency tables, a calibration note compared with the gpt-6-luna run, and one verbatim request and envelope pair. A direct Workers AI option stays out of scope. Refs #7643. * feat(bin): promote agy to a full primary and secondmate harness (#7941) * feat(agy): promote Antigravity CLI to full primary and secondmate harness Add tracked .agents/hooks.json, bin/fm-sessionstart-agy.sh, bin/fm-turnend-guard-agy.sh, PreToolUse --agy seatbelt flags, session-lock agy ancestry, autoarm supervision model, and --secondmate agy workspace trust pre-registration and spawn support. * no-mistakes(review): Fix agy Stop-hook park, hooks.json shape, and live coverage * no-mistakes(review): Unbound agy Stop park, raise ceiling, prove live deny * no-mistakes(review): Correct agy verification doc park-bound wording * no-mistakes(document): Document agy as verified primary and secondmate harness * no-mistakes(ci): I fixed all three selected findings, and every check I ran passed, including the live agy end-to-end run. **ci-1 (`tests/fm-agy-primary-live-e2e.test.sh`):** The invariant is that the live Stop-hook test passes only if a real watcher starts and its wake reaches a follow-up turn. The old test passed as soon as `.agy-park-owner` existed. I replaced the Stop-hook park block with the one the user specified. It waits until both `.agy-park-owner` and `.last-watcher-beat` exist, wakes the watcher with a `done:` status line, and asserts that the park owner was recorded, the watcher started, and `DONE` appears in the agy output. **ci-2 (agy away daemon):** The invariant is that `/afk` must not launch a separate away daemon on any primary whose home runs the supervision host. The agy Stop-hook guard already runs the host when it is enabled, but `fm_afk_launch_host_primary` left agy out. I added `agy` there, which is the one shared check all three callers use. I also added agy to: - the header comment in `bin/fm-afk-launch.sh`; - the three harness loops and the pass message in `tests/fm-afk-launch.test.sh`; - the primary lists and counts in `docs/supervision-host.md`, the matching lines in its engine-selection section, and a new Antigravity (`agy`) row in its Arm owners table; - the header comment in `bin/fm-supervision-instructions.sh`. **user-1 (`.agents/hooks.json`):** The invariant is that each hook command stays one script under Windows `cmd /c` and exits 0 when `sh` is missing. All 5 commands now use `sh -c "..." || cd .`. This does not change behaviour on Linux or macOS, because the `--agy` hooks report deny or continue as JSON on stdout and exit 0. The file keeps its live-verified `{"firstmate":{...}}` shape, matchers and 28800s Stop timeout. **Verification:** - `tests/fm-agy-primary.test.sh` passes, including running the SessionStart hook command from both `.agents/` and the repo root. - `tests/fm-afk-launch.test.sh` has no failures, and the new agy check passes. Its rex end-to-end cases were skipped because the rex CLI is not installed. - `tests/fm-supervision-instructions.test.sh` has no failures. - `bin/fm-lint.sh` and `bin/fm-doc-audience-check.sh` pass. - `FM_AGY_PRIMARY_LIVE=1 tests/fm-agy-primary-live-e2e.test.sh` printed all four `ok` lines and no failures, including "Stop hook parks on a real watcher and delivers its wake to a follow-up turn". The output went through `tail`, so the exit code shown is `tail`'s, not the test script's * feat(bin): add shared_quota opt-out from quota-based dispatch ranking (#7894) * feat(dispatch): add shared_quota home opt-out from quota-based ranking A home whose Claude and other provider usage draws on one combined AI budget has no meaningful per-provider quota rows, so spendPriority ranking and runway gates pick the wrong candidate. An optional top-level "shared_quota": true in config/crew-dispatch.json now opts the home out: the typed resolver makes no quota-axi call, applies no quota floor or runway gate, ranks nothing by spendPriority, and resolves the matched rule's use profiles in declared order, printing every candidate line with quota ranking off by home declaration. Firstmate's quota-array-dispatch intake honors the same declaration. Without the setting, behavior is unchanged. Non-boolean values are actionable configuration errors in both the resolver and bootstrap. * test(dispatch): cover shared-quota bypass of unmet rule and profile floors The shared_quota opt-out test picked a rule with no quota floor, so the separate rule-floor and profile-floor bypass paths stayed untested. Two cases now run against the same fixture: a rule whose model:fable floor (20%) exceeds the snapshot's 15%, and a profile whose all_models floor (50%) exceeds codex's 31%, each asserting the declared-order pick still wins with no quota-axi invocation. * no-mistakes(review): Narrow shared-quota skill opt-out to quota-only gates * no-mistakes(review): Document preferred_provider under shared_quota opt-out and test it * no-mistakes(document): Document shared_quota in schema example and verification inventory * fix(bin): distinguish recycled reaper PIDs in tombstone cleanup (#7958) * fix(bin): distinguish recycled reaper PIDs in tombstone cleanup * no-mistakes(ci): ci-2 fixed in tests/fm-watcher-lock.test.sh (test_lock_tombstone_tracks_reaper_start_time). Invariant: no fixture child may outlive a SIGKILLed runner without a bound. (1) The paused reaper's wait loop now also stops when FM_TEST_SUITE_PID is no longer alive or when SECONDS reaches FM_TEST_STUB_MAX_BLOCK_SECONDS. (2) The one sibling child in the same test, the unrelated `sleep 300`, now sleeps for FM_TEST_STUB_MAX_BLOCK_SECONDS so it uses the same bound. Verification, run serially: bash tests/fm-watcher-lock.test.sh. The new test passed on 4 of 4 runs. Red-before still holds: with the base bin/fm-wake-lib.sh from c9da5523, the test fails with 'not ok - recycled reaper pid kept an abandoned tombstone alive'. Separately, the known stand-down flake ('the replaced watcher did not stand down on its own', watch-legacy-local-time-identity) failed on every run on this host and also fails on base c9da5523 without this change, so the test file still exits 1; left unfixed as instructed. ci-1 (Full suite waiting on the full-ci maintainer label) was ignored per the user's decision * feat(bin): allow omp as a remote secondmate harness (#7939) * feat: allow omp as a remote secondmate harness * test: cover omp on the remote secondmate gates * fix: retire a remote secondmate whose busy state left with its home * docs: record omp remote retirement evidence * review: Refresh pinned remote doctor bootstrap checksum * fix(bin): name a consumed branch grant instead of a wiring bug (#7969) * fix(bin): name a consumed branch grant instead of a wiring bug When a supervision branch's own acknowledgement consumes every granted row, the drain removes the branch-eligible row snapshot while the owner record stays live. A repeat drain or acknowledgement in the same turn then refused with a message implying a broken handoff. Say instead that the grant was already consumed; the refusal and its exit status are unchanged. * no-mistakes(document): Document consumed-grant refusal in watcher continuity doc --------- Co-authored-by: c-c6aw <[email protected]> * fix: preserve literal ampersands in spawn and supervision paths (#7906) * feat(bin): read dispatch provider keys from a declared credential source (#5409) * feat(dispatch): read Typesafe key from Keychain * no-mistakes(review): Share Keychain key lookup with bootstrap; hard-code service name * no-mistakes(review): Use one readable-secret Keychain check for bootstrap and resolver * no-mistakes(document): Point AGENTS key row to owner; record Keychain bootstrap evidence * feat(dispatch): read provider keys from a declared credential source bin/fm-dispatch-resolve.sh took the typesafe.ai and OpenRouter keys only from the environment or $FM_HOME/.env, so a home that keeps its key in the macOS Keychain needed a wrapper to supply it, and the documented direct call reported off. Let the resolver consume an optional, provider
Closes #7786
Review was single-family (Codex) by the owner's temporary choice.
The no-mistakes Test step did not drive the Bash 5.2+ literal-path scenario or the additional raw supervision-output capture because execution guards refused those operations. The approved exception is retained in the pipeline evidence below.
tests/fm-spawn-compact-adviser-disable.test.shcovers exact inbox and encoded-brief delivery for normal paths and paths containing ampersands, quotes and spaces.tests/fm-supervision-instructions.test.shcovers the corresponding rendered extension and config paths. Before submission, both focused suites passed on Bash 3.2.57 and Bash 5.2.37 at1dd10d753fc8f34c1dbe22bda72494266c1f68bc; the new Bash 5.2 regressions failed before the fix.Intent
ok same instructions i gave you before pick high value issues from scan, in all the repos you scanning and use codex only to close them
Context: this task is scan pick P2: upstream issue #7786 in kunchenguid/firstmate. Bash 5.2+ substitutes the matched placeholder for an ampersand inside a brief or home path. Triage contract class: restore. Scan notes for this pick:
Issue: #7786
Bash 5.2+ substitutes the matched placeholder for an ampersand inside a brief or home path.
The maintainer explicitly welcomes a standalone fix covering both spawn and supervision rendering.
Size S.
Contract class: restore.
Maintainer triage.
Evidence: No patsub_replacement normalization in
bin/fm-spawn.sh.bin/fm-supervision-instructions.sh:167-175still interpolates unquoted replacement variables.Competing work: No exact issue reference or complete fix found. #3708 already repairs spawn as part of a larger writable-roots change, but does not change fm-supervision-instructions.sh. The issue's maintainer explicitly says that partial overlap does not cover the issue and invites the standalone correction.
Closure test: Using only fake launch tools, render and capture a launch under a path containing R&D and verify the exact brief/home bytes. Exercise the supervision renderer under the same path. Run stock /bin/bash 3.2 and an installed Bash 5.2+ with its default patsub_replacement enabled. Both scripts must retain literal ampersands, quotes and spaces. Extend an existing spawn fixture plus tests/fm-supervision-instructions.test.sh, with normal-path controls.
The owner approved fixing the scan's high-value picks upstream through PRs, written and reviewed by Codex only.
What Changed
patsub_replacementinbin/fm-spawn.shandbin/fm-supervision-instructions.shso Bash 5.2+ preserves literal ampersands during template rendering.Risk Assessment
✅ Low: The bounded change restores literal template substitution in both scripts, with behavioral regression coverage and no substantiated correctness or scope issues.
Testing
Bash 3.2 spawn path cases and the supervision script passed. The combined run later stopped at an unrelated secondmate fixture’s refusal of a home inside the repository; the issue-specific spawn rerun passed with receiver receipts. Bash 5.2 checks and additional supervision-output capture were guard-blocked. No baseline execution or visual UI check ran. Scratch files were removed.
Evidence: Bash 3.2 focused test results
Source: Bash 3.2 focused test results
Evidence: Exact inbox and brief received by fake Codex
Source: Exact inbox and brief received by fake Codex
Evidence: Generated launch containing literal special characters
Source: Generated launch containing literal special characters
Evidence: Repeatable spawn receipt driver
Source: Repeatable spawn receipt driver
Evidence: Execution guard refusals and fixture limitation
Source: Execution guard refusals and fixture limitation
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
/bin/bash --versionand/tmp/upfm7786.oxSHob/bash-bin/bash --versionbin/fm-test-run.sh tests/fm-spawn-compact-adviser-disable.test.sh tests/fm-supervision-instructions.test.shunder Bash 3.2 with isolated FM_HOME and worktree-local TMPDIR/bin/bash .test-7786/spawn-receipt.shselecting the new spawn cases and capturing generated launches and fake-receiver bytesAttempted Bash 5.2 focused checks and separate supervision-output capture; both refused by PreToolUseRemoved owned test scratch files and verified the candidate remained unchanged at1dd10d753fc8f34c1dbe22bda72494266c1f68bc✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.