Repository navigation
Conversation
* feat(bin): support rex as a remote secondmate backend
Remote second mates no longer require herdr: --backend rex launches the
mate on the remote account's own persistent `rex server start` server in
that home's per-home 2ndmate-<id>-<hash> session, where its endpoint
survives every SSH disconnection the route depends on. Herdr stays the
default and the only backend a pre-Rex remote can verify.
- fm-spawn accepts --backend rex, threads it through the readiness gate
and the remote control launch, and refuses a returned rex route that
does not pin a host-local unix:// server and a session-matched
<session-uuid>:<block-uuid> target; it records remote_backend,
remote_rex_session_id, and remote_rex_server.
- fm-remote-secondmate-control.sh accepts {herdr, rex} per verb: rex
endpoints require a host-local unix:// rex_server, state probes are
pinned to the recorded server through the endpoint absence recheck
(unproven reads stay unverified, never missing), route output reports
the rex identity trio, and launch refuses an endpoint recorded on a
different backend than the one requested.
- fm-remote-readiness-lib passes the selected backend to the doctor. A
pre-Rex remote exits 2 on --backend, so an explicit herdr request
retries bare while a rex request stays refused.
- fm-remote-doctor.sh gains --backend herdr|rex|any: rex verifies the
CLI, client and server API revisions against the verified floor, and
a persistent unix:// server (exit_empty=false); --fix may start or
restart that server but never installs the CLI.
- fm-secondmate-liveness-lib re-checks an alive remote route's backend
against the recorded remote_backend and reports drift instead of
migrating; records without remote_backend stay herdr.
- tests share a stateful fake rex fixture (version, whoami, server
lifecycle, sessions/windows/blocks, process/status/capture,
send/send-key, events, agent-on-send) across the adapter, doctor,
liveness, and lifecycle e2e suites.
Verified on disposable Linux (Apple container, Debian 12 aarch64, rex
0.1.0-preview.12, API rev 8): nested-shell foreground tracking and
input delivery, peer-vs-anonymous whoami, rex do/events, --exit-empty
vs persistent server durability, and session restore on identical
socket+state.
* fix(bin): keep rex on recovery, route keys, never stop rex
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: assert exact rex fake state in new regressions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test: request bootstrap relaunch facts in rex recovery check
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* no-mistakes(review): keep remote rex control plane from autostarting
* no-mistakes(document): Correct remote Rex documentation contracts
* no-mistakes(document): Point provisioning to remote backend contract
* no-mistakes(lint): Silence intentional deferred expansion lint warning
* no-mistakes(ci): Diagnosed Full suite failure as serial shard 9 exceeding its 30-minute cap. Updated the expanded remote lifecycle test’s measured scheduling weight and increased serial shards from 10 to 11, preserving timeouts and complete coverage. Coverage guard, runner and workflow contract tests, actionlint, source-aware ShellCheck, and diff checks passed. Hosted CI rerun remains for the outer executor
* no-mistakes(ci): Fixed fm-on’s stale Herdr-specific test assumptions by explicitly selecting Herdr in both fixtures, and refreshed the entrypoint’s stale doctor bootstrap hash. Reproduced both failures before fixing. fm-on and remote-doctor behavior suites and git diff --check pass locally. Full suite failure was downstream of the failing shard; hosted CI rerun remains for the outer executor
* no-mistakes(ci): Fixed both findings: Rex retirement now refuses block close and home deletion unless the answering server matches the recorded endpoint; readiness reads whoami once and requires explicit boolean exit_empty=false. Refreshed the doctor bootstrap digest. Reproduced both regressions before fixing. Doctor, full remote lifecycle, entrypoint tests, targeted ShellCheck, and diff checks pass
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…kunchenguid#8076) * docs(harness-adapters): correct claude --setting-sources worker claim * no-mistakes(review): Correct sibling setting-sources claim in fm-claude-trust.sh comment * no-mistakes(document): Rewrap corrected setting-sources comment in fm-claude-trust.sh
…henguid#8023) * fix(contributions): keep maintainer-comment polls inside the check timeout In a home with a few hundred contribution records, the contribution poll spent most of the watcher's 30-second check bound on local bookkeeping before its forge budget started: three jq processes per saved record file plus several per already-final URL. The watcher killed the poll before it read most open PRs, so a maintainer comment on an open PR could wait many hours, or never, for its wake. The PR health monitor had the same cost in its enrollment step: it re-enrolled every owned pair on each pass and saved nothing until the end, so a killed pass never converged and a PR on a later task branch was never enrolled. - read_saved validates every record in one jq process and keeps the per-file path only to count unreadable records. - poll skips final URLs that every owner already holds error-free, with one jq pass deciding settled, final and live URLs. - owned reports the tasks holding a durable record for each URL, and the PR health monitor skips enrolling pairs that already have one, so a pass cut short still makes durable progress. * no-mistakes(review): Isolate record validation errors per file in one jq * no-mistakes(review): Read each record file whole to avoid joining * no-mistakes(ci): Fixed ci-2: read_saved in bin/fm-contributions.sh now validates records in bounded jq batches (FM_CONTRIBUTIONS_READ_BATCH, default 100) instead of one jq with every record path, so a long-lived home cannot hit the argument-length limit. Batch results are merged; malformed-record, task-identity, no-trailing-newline behavior and the per-file unreadable count are unchanged. Added test_records_beyond_one_read_batch_are_all_read (5 records, batch 2, jq wrapper rejecting more than 2 record files); it fails on the old code and passes now. The full contributions suite passed before the wrapper was added. I re-ran only the new test afterwards. ci-1 (Full suite) is the maintainer full-ci label gate, so no change was made for it. I did not reply on the review thread * no-mistakes(review): Hard-code contributions read batch at 100 * no-mistakes(lint): Silence ShellCheck SC2016 in contributions test
…nd relaunches (kunchenguid#8069) * fix(pr-lib): preserve authenticated PR polls across updates and relaunches An armed merge poll binds to the hashes and file objects it was registered with, so a repository template update no longer invalidates it. Validation previously required the published check to be byte-identical to the current bin/fm-pr-poll.sh, which an update or a control relaunch silently broke even though the watcher executes the current repository poll with validated data and never executes the registered state-file bytes. Accept control_relaunch_tx among the metadata fields that may follow the PR identity, and pin both behaviours in the security suite: an older registered generation still detects its merge without executing sidecar code, and forged bytes or forged trailing metadata are refused. * no-mistakes(document): Align poll-registration docs with hash-bound validation * no-mistakes(ci): Addressed the selected Greptile finding (ci-2) in tests/fm-pr-check-security.test.sh:3474 (test_registered_poll_survives_template_update_and_relaunch). Problem: for the template-update and combined scenarios, the "historical generation" fixture was bin/fm-pr-poll.sh with a marker line appended after the poll's unconditional exit, so the marker was unreachable and the copy still performed the same gh call. Both the marker-absence and gh-call assertions could therefore pass even if the watcher had executed the registered bytes instead of dispatching the current repository poll. Invariant: the historical registered check bytes are never executed; only the current repository poll runs, and it must be the sole source of the merge result and the sole forge call. Places this must hold: the template-update scenario, the combined (template-update + control_relaunch_tx) scenario, and the relaunch-only scenario (which legitimately has byte-identical check bytes). Fix: for non-relaunch scenarios the fixture is now a self-contained stub whose whole body is reachable — it writes the sidecar marker file and prints the distinct line `historical-generation`, and never touches gh. The relaunch scenario keeps the unchanged cp of the current poll as before. No existing assertion was weakened or changed: marker absence, `task-a.check.sh: merged`, the `pr view ... --json state` gh log entry, poll retirement, and forged-check refusal all remain. Verification (FM_TEST_BASE_PATH=/run/current-system/sw/bin, required on this NixOS host because mkdir is not under /usr/bin): full `bash tests/fm-pr-check-security.test.sh` passes with no `not ok` lines, including the registered-generations case; `bash -n` and `shellcheck -S warning` pass on the file. Negative control: temporarily patching bin/fm-watch.sh to execute the registered check bytes made the same test fail, then the patch was reverted (git status shows only the test-file change). ci-1 (Full suite) was marked ignore by the human decision and its suite passes locally * no-mistakes(test): Prove live that template-update polls stay armed and keep their merge wake
…d#8060) * feat(hc): auto-detect the Herdr app signals for the hc backend Stage 3 of Herdr Core support: a Firstmate running inside the Herdr app now selects the hc backend automatically, while classic Herdr TUI, nested tmux, and bare hc terminals keep their existing verdicts. Two app-owned signals, checked after every other surface marker: - app-terminal: the process's own HC_TERMINAL_ID carries a non-empty herdr.space label in its core's record - the exact condition the app projects a terminal into its window. An app terminal's env is deliberately identical to any other hc terminal's (the core rewrites the app's TERM_PROGRAM=herdr claim to ghostty), so the claim is read from the record via `hc get`, gated by a live unix-connect probe because `hc` autostarts a core on contact with a missing socket. - app-window: a live herdr-app.sock under the resolved app home (HERDR_APP_HOME, else XDG_CONFIG_HOME/herdr-app, else ~/.config), probed by an actual unix connect - the app's own liveness rule. The app is never launched and the core is never contacted for it. Both require a usable hc toolchain (executable FM_HC_BIN or a self-identifying herdr-core/hc on PATH, plus jq); a live window without one records app-window-unusable and fm_backend_name prints a notice naming the missing piece instead of switching. Explicit --backend, FM_BACKEND, and config/backend always win; auto-detected hc prints a loud opt-out notice and meta records backend_detect=app-terminal or app-window alongside the existing herdr.space/herdr.tab presentation labels. Supervisor-endpoint discovery resolves an hc terminal to <session>:<address> and backend hc so the away daemon fails loudly at its supported-backend check instead of silently steering firstmate:0 tmux; full hc away support stays out of scope. Verified against herdr-app 0.1.11 source/binary and an isolated hc 0.1.14 lab session (docs/verification/runtime-backends.md); a real app window's socket and in-window label display remain unverified. * no-mistakes(review): Bind hc auto-detection to the live spawn core * no-mistakes(document): Correct hc selection and supervisor documentation * fix(hc): gate app auto-detection on the adapter's verified core version Greptile on PR kunchenguid#8060: fm_backend_detect_hc_usable accepted any self-identifying 'hc x.y.z', but the adapter's container gate requires FM_BACKEND_HC_MIN_VERSION (0.1.14). A live app window or terminal beside an older core would auto-select hc, then have the spawn abort at the version check - breaking an otherwise usable default spawn. Detection now runs the adapter's own fm_backend_hc_version_check through fm_backend_source (the same source path spawn and the bootstrap tool check use), so an auto-selection can never resolve a binary the spawn would refuse. The duplicated detection-side bin resolver is folded into the adapter's fm_backend_hc_bin, and the unusable notices name the verified minimum. A below-floor binary reports app-terminal-unusable or app-window-unusable, covered by new fake-version assertions. * no-mistakes(review): Make app-detect negative tests reject detection * no-mistakes(document): Point hc metadata guidance to its owner * fix: drop the app-window signal from hc auto-detection The live real-Herdr-app exercise proved app-window cannot distinguish "firstmate inside an app terminal" from "the app is open somewhere on this host": marker-less bare processes selected hc solely because a window existed, binding whatever core the spawn would reach. The app-terminal signal (this terminal's own herdr.space label on the spawn-reachable core) is the only claim that actually places the process inside the app, so it is now the sole auto-select signal. A marker-less process near a live window resolves the default backend silently; explicit --backend/FM_BACKEND/config selection is unchanged. * no-mistakes(document): Correct hc single-signal documentation
…sion (kunchenguid#7525) * Park verified native Codex supervision outside the model * Document native Codex park verification and fallback * no-mistakes(review): Extend Codex park startup grace to ten seconds * no-mistakes(review): Document ten-second Codex park startup grace rationale * no-mistakes(document): Name Codex native park in supervision host header * no-mistakes(document): Add native Codex park script to scripts inventory * Gate native Codex park behind config/codex-stop-park and cover it with behavioral tests The native Codex Stop park now runs only in a home that opts in with config/codex-stop-park; without it the session start, the synchronous guard, and the asynchronous Stop hook behave as before the park existed and the foreground checkpoint stays the default. A fixture-driven suite with a fake codex covers the opt-in and version gates, the single-flight claim, the fallback latch on a failed queue delivery or repeated arm failure, the owner-gone watcher exit, and the retained quiet boundary. * ci: add a tenth portable serial shard for the Codex stop-park suite * no-mistakes(document): Point Codex park verification record at behavioral suite * ci: retrigger checks * Revert the tenth portable serial shard (added by kunchenguid#7838) * no-mistakes(ci): I fixed both Greptile findings (ci-1, ci-2) with the small changes you asked for. No new state, subsystem or protocol change. The changes are not committed, so there is no Co-Authored-By trailer anywhere. **ci-1: a woken turn could lose its rearm (`bin/fm-codex-stop-park.sh`)** - Rule that must hold: when a registered session that still needs supervision hits Stop, a park must end up rearmed. A delivering park that still holds the claim must not make the next hook give up. - The only place that gives up is the claim acquisition in the async Stop hook. `--guard` already accepts a recent delivered record, so it needed no change. - Fix: if acquiring the claim fails, the hook reads the holder pid that the lock library reports. It checks that `.codex-park.json` shows this session, outcome `delivered` and that same pid, and that the pid is alive. Only then does it poll for up to 3 seconds (30 × 0.1 s) until `CLAIM` is gone, and retry the acquire once. Any other busy claim still does the old `exit 0`, so the single-flight case behaves as before. **ci-2: compaction skipped after a quiet boundary (`bin/fm-supervision-host.sh`)** - Rule that must hold: when the park clock restarts, every value measured on that clock restarts with it. `WARM_COMPACT_LAST_TICK` is the only such value. - Fix: one line, `WARM_COMPACT_LAST_TICK=-1`, in the Codex model-free quiet-boundary branch of `boundary_reached`. **Tests (`tests/fm-codex-stop-park.test.sh`)** - New case `test_stop_rearms_after_a_delivering_park_releases_its_claim`: a helper process holds the claim with a delivered record that names it, and releases it after 1 s. The Stop hook must wait, arm once, deliver one wake with no recovery notice, and leave a record that belongs to the new park. - Extended `test_host_quiet_boundary_retains_the_watcher` to use `config/warm-compact`, `FM_WARM_COMPACT_TICK=2` (equal to the 2 s park interval) and a stub engine that fails. The engine record is only written after the first quiet boundary, so compaction (`warm-compact engine failed` in the log, `/compact` passed to the stub) can only happen if the tick runs on the restarted clock. The watcher-retention checks still apply, now across three boundaries. - Mutation checks: with ci-1 reverted, the suite fails ("must rearm … expected '1', got '0'"). With ci-2 reverted, it fails with no warm-compact line in the log. I restored both fixes after each check. **Verification** - The whole suite passes (8 of 8). - `shellcheck -x` is clean on all three files. - `bin/fm-test-run.sh --check-coverage` passes: `FM_TEST_COVERAGE ok`, serial_max_ms=1140457 against a 1200000 budget, with 10 serial shards in the current tree. - Measured cost went up by about 3–4 s: three local runs took 25.6 s, 26.8 s and 24.8 s, against about 22 s recorded earlier. That is still under the 30000 ms hint, so I left the hint as it is * no-mistakes(ci): Fixed the remaining ci-1 gap: a woken turn that reaches Stop while the earlier park is still sending its wake now waits for that park to release the claim, then rearms. Before, it gave up and left no watcher. The changes are not committed. What had to hold: when a registered session that still needs supervision hits Stop, a park must end up rearmed. That depends on two places: the record the park writes while it sends a wake, and the check that decides whether to wait when the claim is busy. Changes in bin/fm-codex-stop-park.sh: 1. Timeout constant: the literal 20 in deliver's fm_run_timed is now DELIVERY_TIMEOUT=20. The busy-claim wait is derived from it: (DELIVERY_TIMEOUT + 5) * 10 polls of 0.1 s, about 25 s. A comment names the constant. 2. New outcome before sending: the wake path now writes `record delivering` just before deliver. Every way out of it already overwrites that: success writes delivered, failure writes delivery-failed, HUP/INT/TERM write interrupted. 3. Wait check: the busy-claim check now accepts delivering or delivered, still for the same session and holder pid, and still only if that pid is alive. 4. One addition not asked for: delivering is added to the outcomes that trigger the recovery notice (with waiting, arming and interrupted). Before this change, a park killed with SIGKILL mid-send left waiting behind and the next park sent a recovery notice. Without this word that notice would silently stop. --guard and the claim model are unchanged. Test: the existing case in tests/fm-codex-stop-park.test.sh now takes two arguments: the outcome the holder records and how long it holds the claim. The holder then records delivered and releases, as a real park does. The suite runs it as `delivered 1` (old case) and `delivering 4` (new case, over 3 s and under the 25 s bound). Both require the Stop hook to arm exactly once, send one wake with no recovery notice, and leave a record that belongs to the new park. Mutation checks: - With the wait check set back to delivered only, the new case fails ("must rearm ... expected '1', got '0'"); fix restored. - Removing the new `record delivering` line fails no test, because the test's holder writes its own record. The delivering recovery trigger also has no test. Verification: - shellcheck -x is clean on all three touched files. - One unexplained failure: the suite passed in 12 of 13 full runs (3 run in parallel). The failed run was a timing run with output discarded, so the failing case is unknown; it did not reproduce in 13 more runs. - Hint raised: measured runs took 29.8 s, 34.0 s and 34.7 s, over the 30000 ms hint, so the hint is now 35000 in bin/fm-test-run.sh. bin/fm-test-run.sh --check-coverage passes: serial_max_ms=1140951 against the 1200000 budget, 10 shards. - The commit-message and comment wording rules don't apply yet, since nothing is committed * no-mistakes(review): Gate latched fallback on supervision need; fix shard doc * no-mistakes(document): Align Codex Stop-guard docs with park behavior * no-mistakes(document): Document latched-fallback Stop block in turn-end guard doc * no-mistakes(ci): Fixed ci-2 and ci-3; ci-1 left untouched and no CI file changed. ci-2 (bin/fm-codex-stop-park.sh): added settle_idle, called at both idle decisions (top of arm loop and inner poll loop) when fm_supervision_needed turns false. If state/.wake-queue is non-empty it records delivering, calls the existing deliver path, then records delivered; on delivery failure it records delivery-failed, latches the fallback and exits 1. With an empty queue it records idle and exits as before. Away mode, lost session lock and unregistered session still exit idle without delivering. The single-flight claim, fallback latch and rearm path are unchanged. ci-3 (bin/fm-supervision-instructions.sh): the codex case of ordinary_wake_line now splits on CODEX_PARK. A parked session is told the Codex Stop hook owns watcher continuity (drain and handle the wake, do not arm another cycle). A non-park Codex session keeps the foreground-checkpoint line unchanged. The existing codex assertions are unchanged and still pass. Verification: tests/fm-codex-stop-park.test.sh and tests/fm-supervision-instructions.test.sh both exit 0. shellcheck -x -S warning is clean on both scripts. No new tests were added, because neither suite had a matching case. Neither the settle_idle delivery path nor the parked ordinary-wake line is exercised by those suites * test: cover the idle settle delivery and the parked ordinary-wake line * no-mistakes(document): Document final-result delivery when Codex park ends --------- Co-authored-by: crewmate <crewmate@localhost>
* fix(timeout): preserve stdin in background runners Explicitly inherit stdin before backgrounding the bounded command so Bash does not replace piped input with /dev/null. Cover inherited input and pipeline functions across timeout, gtimeout, perl, and bash. * chore(document): Document stdin preservation in timed runner
…unchenguid#8082) A dead local second mate was respawned through a fresh --secondmate spawn, which re-read config/backend. With config/backend=hc that spawn was refused, so a second mate whose Herdr pane died stayed down. The liveness respawn now passes the backend the mate's record names, so a changed config/backend only affects new spawns. Remote mates keep their host's routing. Tests: fm-secondmate-liveness passes, including a new pinned-backend case.
…kunchenguid#3701) * fix: stop a stale failed run outranking newer truth bin/fm-crew-state.sh matched a no-mistakes run against the worktree's current code identity, so it inherited whatever run last sat on that head. A terminal failed or cancelled run then outranked every newer record: a declared pause, a crew's own terminal done line, and even a run still in flight on the same branch. That was not merely a misleading state line - the stale failure was promoted into a durable terminal-outcome record and queued for captain presentation, naming a pull request the current run had never opened. Two independent fixes. The reader now proves a terminal failure is current before reporting it. A later run the pipeline's own ledger proves current answers instead; a later self-declared pause or done in the status log answers instead where the ledger's date proves the log was appended after the failed run began; and a later run that cannot be bound here reads as unknown - history, but no proof of the present. Nothing else may, so a stale working, needs-decision, or blocked line still cannot mask a real failure, and with no ordering evidence at all the failure stands. A terminal reading also publishes the pull request its own run opened, or none when it opened none. bin/fm-inactive-reconcile.sh no longer inherits either half of the claim. A terminal outcome is built only when the crew's own last self-declared word does not contradict it, in both directions, and its pull-request identity comes from the same record as its state rather than from a separately recorded task PR. bin/fm-nm-run-lib.sh keeps the one attribution owner: the supersession check reuses its existing rules and adds only the branch's newest ledger row and the one-directional reading of the ledger's date column. * no-mistakes(review): Captain: fix terminal run and PR provenance * no-mistakes(review): Captain: preserve newest terminal run provenance * no-mistakes(review): Captain: consolidate terminal provenance and status snapshots * no-mistakes(review): Captain: enforce precise terminal outcome provenance * no-mistakes(document): Consolidate terminal-state documentation ownership * test(crew-state): expect unknown for an unprovable live replacement f5d7f5f (kunchenguid#4476) raised the attribution bar: the runs ledger carries no run id, so a LIVE replacement cannot be proven current and the reader answers unknown. That moves three cases from rule 2b's case (a) to its case (c), which this branch already documents as the honest answer for a replacement that cannot be bound here. Only the state label changes. Every safety assertion is unchanged and still passing: no false failed state surfaces, and no stale pull request is published. * no-mistakes(review): gate status-log supersession off the attributed run's failure * no-mistakes(review): accept only ready-signal PRs from a status-log outcome * no-mistakes(review): report unknown for an unbindable live replacement run * no-mistakes(review): make ordering and gate regression tests non-vacuous * no-mistakes(review): restore current-run shape for ordering regression tests * no-mistakes(review): require ordered status line to be log's last line * no-mistakes(review): share ledger row validation, match run heads both ways * no-mistakes(review): require a terminal ledger row for status-log ordering * no-mistakes(document): name shared ledger-row validity owner in architecture * no-mistakes(review): let reader ordering evidence keep a failure reportable * no-mistakes(review): establish crew-word ordering from the log alone * no-mistakes(document): record proven-older crew word exception in architecture * no-mistakes(review): remove status-log ordering rules from crew-state reader * no-mistakes(review): let run-step terminal states outrank the crew's own word * no-mistakes(review): state the narrowed corroboration rule in architecture doc * no-mistakes(review): run rule 2b after the socket-down status-log override * no-mistakes(review): name the ledger verdict's own run, document applied precedence * no-mistakes(review): skip rule 2b on coarse path, restore scout PR guard * no-mistakes(document): note scout PR exception in reconcile header contract * no-mistakes(review): extend terminal-reading precedence to done readings * no-mistakes(review): derive ledger status from the run record's status field * no-mistakes(review): drop vacuous checks-passed test, record traced evidence * no-mistakes(review): name the unbindable ledger row, not an earlier run * no-mistakes(review): append run id as a field, keep PR without ledger row * no-mistakes(document): document run-id field and corrected terminal PR rule * no-mistakes(lint): quote keyword literals in terminal-state comparison (SC1010) * Preserve cancellation as unknown in ledger precedence * Align completed-run selection fixture PR identity * no-mistakes(document): Align crew-state rule 2b comment with cancelled-as-unknown * no-mistakes(ci): I fixed the Greptile finding (ci-1): crews in the main home that reported a GitLab or Gerrit review now keep the review link in their completion notice. I left the changes uncommitted in the worktree for no-mistakes to validate and publish to PR 3701. I made no other changes and did not rebase, push or touch history. The rule that was broken: a terminal outcome taken from the status log must carry the review URL that its own ready report names, for every forge the project supports. **What changed** - In `bin/fm-inactive-reconcile.sh`, `terminal_outcome_pr` no longer uses its own regex, which accepted only GitHub-style `/pull/<n>` URLs. It now takes the note, strips the leading `PR `, strips an optional ` checks green` or ` published for review` (the Gerrit ready shape), and passes what is left to the existing `fm_pr_url_parse` in `bin/fm-pr-lib.sh`. That library is already loaded through `fm-dod-lib.sh`. This means GitHub, GitLab merge requests, Forgejo and Gerrit URLs are all accepted. The function returns the parsed URL, still taken only from the state line itself. - The run-step path, the scout rule, the rule against claiming URLs that are only mentioned in prose, and the cancellation-as-unknown and terminal-identity rules are unchanged. - I updated the comment above the function, because it said the rule was the same as `pr_for_task`'s, which is no longer true. **One stricter result you should know about:** a GitHub URL must now pass the shared parser's host check. It must be `github.com` or a host listed in the `github-hosts` config, and it must use `https`. For this reason I changed one fixture in `test_status_log_sourced_outcome_keeps_its_own_pr` from `https://example.test/.../pull/7` to `https://github.com/.../pull/7`. No other test depended on the old pattern. **Test:** I added one regression test, `test_status_log_outcome_keeps_gitlab_and_gerrit_reviews`, in `tests/fm-inactive-reconcile.test.sh`. It uses `PR https://gitlab.example/group/sub/project/-/merge_requests/8 checks green` and `PR https://gerrit.example/c/group/project/+/4201 published for review`. **Verification** - With the old `bin/fm-inactive-reconcile.sh`, the new test fails ("the gitlab terminal outcome dropped its review link"). - With the fix, `bash tests/fm-inactive-reconcile.test.sh` passes completely ("all inactive reconciliation tests passed"). - `shellcheck -x` reports no problems in either file. **Not changed, as you instructed:** `pr_for_task`, the ledger-first fallback in the same file, also accepts only `/pull/` URLs. That is the same problem in a sibling function. If a reviewer reports it, you said to stop and report rather than run another repair round
… --resolve-key refuses (kunchenguid#3983) * fix(supervision): make the OPEN DECISIONS listing name the key that closes it An operator answering a listed decision runs the command the listing itself advises, and that command refused - discarding the steer with it. The two folds never disagreed. Both the whole-file fold and fm-send's resolver read the same status_open_decisions rule, and both correctly keyed `blocked: axi run hung ... [key=no-mistakes-start]` as `default`: the key grammar states a key before the colon or at the head of the note, so a token trailing a summary is prose. The reader that was wrong is the third one, the drain's OPEN DECISIONS renderer. It suppressed `[key=default]` and printed the note verbatim, so the only bracket token a reader could see on such an entry was the one that is NOT the key - and the entry named a key it had not folded. Every entry now states its folded key, `default` included, so the key the listing shows is the key its advised command closes. An unresolvable key still refuses rather than delivering: an answer this send cannot close would leave the decision open behind an answer the operator believes settled it. The refusal no longer costs the message instead - it diagnoses a key that is only mentioned inside an open decision's note, names the keys that are actually open, and prints the resend commands with the message quoted back verbatim. * no-mistakes(review): Remove automatic key selection from resend advice * no-mistakes(document): Clarify operator key selection in resend documentation * fix(send): carry the caller's routing context into every printed resend A refused --resolve-key preserves the operator's message by printing a resend command, but the command could not run: it reused $0 and dropped the routing environment. A one-shot "FM_HOME=<home> bin/fm-send.sh ..." exports nothing to the next command, and a relative $0 is valid only from the directory that invocation ran in, so a copied line resolved to another home's state, to no script at all, or refused with FM_HOME unset - and the preserved message still never reached the worker. The unconfirmed-remote retry path already solved this. Both printed resend paths now share that one statement of it: the absolute home always, the state override only when this invocation was given one, and this script's absolute path. Covered by a test that invokes fm-send through a relative path with a one-shot FM_HOME, then runs what it printed from a different directory with nothing supplied - what an operator copying the line actually does. * no-mistakes(review): remove unprovable decoy-key diagnosis, quote resend key placeholder * no-mistakes(review): scope empty open-set claim to status file, always offer keyed resend * no-mistakes(review): Keep already-accepted keys in the refused-key resend * no-mistakes(review): Check every resolve key before refusing, keep order * no-mistakes(document): Reflow fm-send resolve-key refusal header comment
…sweep (kunchenguid#8086) * fix(pr-check): record every PR a task reports in a done line Merge and health monitoring of a task's PR began only when the supervisor ran fm-pr-check.sh by hand on the ready signal. When that step was missed, for example on a rebase of an existing PR whose done line did not use the canonical wording, the task kept no pr= and no merge poll, so failing checks and maintainer requests on that PR went unnoticed. fm-pr-check.sh scan now records each task whose newest done line naming a supported PR URL ("PR <url>" anywhere in the note) has no pr= yet, through the ordinary registration path, so every refusal still applies. The watcher runs it at the start of each check sweep. A refusal is reported once per task and PR as a check: pr-register: wake and retried silently on later sweeps; teardown removes its marker. * no-mistakes(review): Scan new PR reports before refused retries * no-mistakes(review): Rotate scan start so hung PR registrations cannot starve * no-mistakes(review): Resume PR scan after last attempted task * no-mistakes(lint): Fix SC1007 in fm-pr-check.sh candidates declaration * no-mistakes(ci): Fixed ci-2 and ci-4 in bin/fm-pr-check.sh. ci-2: the scan now treats a task whose pr= equals the reported done-line URL but has no valid published poll as unregistered, so a later sweep republishes the poll. ci-4: scan-driven registrations run with FM_PR_CHECK_SCAN=1 and, under the metadata lock, exit 0 without writing if pr= is now set to a different URL; manual registration is unchanged. Added two tests in tests/fm-pr-check-security.test.sh (test_scan_publishes_a_missing_poll_for_a_recorded_pr, test_scan_does_not_overwrite_a_pr_recorded_meanwhile), and a configurable FM_TEST_GH_SLOW_SECONDS in the slow gh stub. Both new tests fail without the fix and pass with it; the four existing scan tests still pass; shellcheck shows only SC1091 info notes. The full test file aborts earlier on this machine at an unrelated test (GNU stat '%Lp' errors / flaky), so I ran the scan tests as a separate set. ci-1 and ci-3 are declined, with no code change; the ci-3 known-limit line (a refusal notice can be lost if the watcher stops between writing the refusal marker and queueing the wake) still needs to go into the PR description, which I cannot edit from here. Known tradeoff: a merged task whose poll was retired but whose pr= and done line still match would look unregistered and be re-armed until teardown * no-mistakes(ci): Part (1) is fixed. The scan in bin/fm-pr-check.sh now skips a task that has state/<id>.pr-poll-merge-notified or state/<id>.pr-poll-retirement. A merged task's retired poll is no longer re-armed. I added test_scan_does_not_rearm_a_retired_merged_poll to tests/fm-pr-check-security.test.sh. With the exclusion removed, the test fails ("the scan re-armed the poll of a merged task"). With it restored, the test passes. The existing missing-poll and concurrent-PR scan tests also pass. I ran only these three tests, because the full file is slow and was already known to abort early on this machine at an unrelated stat test. shellcheck -S warning is clean. Part (2) needed no change. The scan-only recheck already sits inside the META_LOCK section, right after the lock is taken and the metadata file is re-validated, before the meta rewrite. It exits 0 without writing or publishing when pr= is a different URL. The ci-4 test still passes * no-mistakes(ci): Fixed ci-2. The scan in bin/fm-pr-check.sh now skips a task only when its merge-notified marker or poll retirement receipt names the same PR as the recorded pr=. A new helper, pr_check_pr_retired, does the check. An older PR's marker no longer hides a newer recorded pr= whose poll is missing. Tests, in tests/fm-pr-check-security.test.sh: - Added test_scan_arms_a_replacement_pr_despite_an_old_merge_marker. It uses an old PR 7 merge marker and a recorded pr=9 with no poll. The scan must arm the poll. With the old unconditional skip restored, the test fails ("an older PR's merge marker hid the replacement PR's missing poll"). With the fix, it passes. - test_scan_does_not_rearm_a_retired_merged_poll now writes a valid marker for the same PR. The old marker was a bare version line, which the new check correctly rejects. This test still passes. - The other scan tests pass: publishes_a_missing_poll and does_not_overwrite_a_pr_recorded_meanwhile. - I ran only the four scan tests, because the full file is slow and aborts early on an unrelated stat test on this machine. shellcheck -S warning is clean. ci-1 is declined: only the maintainer full-ci label gate failed. I made no PR description edits, because I cannot edit the PR from here. The earlier requested statements still need to go in the description: the kunchenguid#8023 (comment-wake) coverage of the waiting-author comment case, and the refusal-notice known limit * feat(pr-check): run the done-line PR scan only with config/pr-register-scan The watcher check sweep runs bin/fm-pr-check.sh scan only when the home opts in with the config/pr-register-scan presence flag. With the flag absent, the sweep is unchanged from before the scan existed. The watcher test covers both settings.
…id#8066) Co-authored-by: yeti <yeti@alps>
…henguid#8017) * test: give anchored absence assertions a regex that can match assert_grep and assert_no_grep are fixed-string greps. An anchored pattern handed to them searches for a literal caret, which no line can contain, so every anchored assert_no_grep passed no matter what the file held. Eighteen call sites across six suites asserted their absence that way, so they were silently checking nothing: the merge-local readiness snapshot, the public-followup request and platform links, the secondmate backend and harness records, the restart literal-stop path, the delivery mode and yolo fields, and the remote-doctor launchctl calls. Add assert_regex and assert_no_regex for patterns that describe a line rather than a literal, and convert those sites. The remote-doctor alternation becomes a real ERE group instead of a fixed string containing backslash-pipes. The three suites that run on this host pass unchanged: merge-local 8, task-delivery 34, public-followup 90. The other three fail identically on unmodified main here because their fixtures pin a PATH without tr, sed, or head; that is environmental and unrelated. * no-mistakes(review): Fix regex absence errors and interactive label guard * test(assertions): name lib.sh for ShellCheck source following * no-mistakes(test): Fix vacuous anchored absence guard in fm-pr-merge help test * no-mistakes(review): Restore pre-existing help assertion exactly * no-mistakes(document): Document new assertion suite coverage in its header comment
This was referenced Nov 4, 2026
This was referenced Nov 11, 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
Nightly upstream sync of the PhillGray/firstmate fork: merge kunchenguid/firstmate main through 78c69df (2026-11-02) into the fork as a plain conflict-free merge commit, so the fork keeps tracking upstream. Constraints the owner set: keep the fork's mode-777 guards (bin/fm-x-lib.sh:96,109, bin/fm-procevent-lib.sh:482,1035,1338, bin/fm-bootstrap.sh:1011) and the fork's .agents/skills/aios-estate skill unchanged; add no agent co-author lines; keep the owner-role word the owner banned out of commit and PR text (upstream file contents that already hold it are fine). Do not rewrite upstream code: limit fixes to what the merged tree needs to pass the fork's tests and lint. Never weaken a test, CI workflow or gate. The upstream CI change in this window adds portable serial shard 11, which keeps every test and spreads them over one more shard.
What Changed
kunchenguid/firstmatemain through78c69df2. New behavior includes opt-in, model-free Codex supervision (bin/fm-codex-stop-park.sh, enabled byconfig/codex-stop-park, with the foreground checkpoint protocol kept as the fallback indocs/supervision-protocols/codex-checkpoint.md) and Herdr.app runtime auto-detection that letsbin/fm-spawn.shselect thehcbackend.bin/fm-pr-check.shrecording reported PRs from done lines during the check sweep and abin/fm-dispatch-resolve.shfix that parenthesises the openai answer check for jq 1.8.tests/rex-fake-fixture.sh, plus the CI change adding portable serial shard 11. The merge does not touch the fork's.agents/skills/aios-estateskill or the mode-777 guard files (bin/fm-x-lib.sh,bin/fm-procevent-lib.sh,bin/fm-bootstrap.sh).🤖 Generated with Claude Code
Risk Assessment
Testing
No scenario was driven live, and no test, product script, git command or lab ran, because every execution command still needs an approval nobody can give in this phase. Only read-only greps worked: the six mode-777 guards are at the lines the intent names, and the runner and CI both declare 11 serial shards. That is code reading, not proof of behaviour. No evidence files or artifacts could be written, and the worktree was not changed.
bin/fm-test-run.sh --helpandbin/fm-test-run.sh portable-serial-1of11; both returned 'requires approval'. Needs Bash permission for bin/fm-test-run.sh.bin/fm-test-run.shinvocations returned 'requires approval'. Needs Bash permission for bin/fm-test-run.sh.mktemp -dand repo scripts returned 'requires approval'. Needs Bash permission for mktemp and the repo's scripts and tests.git diff --stat af99028a 27a3158creturned 'requires approval', and reading the gate's bare repo is forbidden. Needs read-only git.git rev-parse HEAD,git statusandgit diffreturned 'requires approval'. Needs read-only git, includinggit logandgit merge-tree.jq --versionreturned 'requires approval', and the dispatch scripts cannot run without execute permission. Needs Bash permission for jq and the repo's scripts and tests.mktempreturned 'requires approval'. Needs Bash permission for the repo's scripts and tests, plus mktemp.mktemp,bin/fm-lab-home.shandtmux.mktempandtmux -Vreturned 'requires approval', so no lab could be created. Needs Bash permission for those plusclaude.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
gitcommand in this session (git status,log,diff,merge-tree,rev-parse) returned 'requires approval', and I did not work around that or read the gate's bare repo, which the task forbids. So these are UNVERIFIED: the changed-file list; that 27a3158 is a plain conflict-free merge (its tree matching a clean re-merge of af99028 and 78c69df, with no extra edits); that.agents/skills/aios-estateis byte-identical to base; that no test, CI or gate was weakened; and that the full commit message has no co-author line or banned word. The only checks I ran were reads and greps of the merged tree, not a comparison with base. Remedy: allow read-only git for this phase and rerun it, or have a human confirm withgit diff af99028a 27a3158candgit merge-tree --write-tree af99028a 78c69df2.🔧 No changes applied.
3 issues (2 warnings, 1 info) still open:
gitcommand in this session (git status,log,diff,merge-tree,rev-parse) returned 'requires approval', and I did not work around that or read the gate's bare repo, which the task forbids. So these are UNVERIFIED: the changed-file list; that 27a3158 is a plain conflict-free merge (its tree matching a clean re-merge of af99028 and 78c69df, with no extra edits); that.agents/skills/aios-estateis byte-identical to base; that no test, CI or gate was weakened; and that the full commit message has no co-author line or banned word. The only checks I ran were reads and greps of the merged tree, not a comparison with base. Remedy: allow read-only git for this phase and rerun it, or have a human confirm withgit diff af99028a 27a3158candgit merge-tree --write-tree af99028a 78c69df2.status,log,diff,merge-tree,rev-parse) still returned 'requires approval'. The session-start snapshot also shows a clean tree at 27a3158, the starting head, so that snapshot shows no fix-round commit. I did not work around the block or read the gate's bare repo, which the task forbids. STILL UNVERIFIED: the changed-file list; that 27a3158 is a plain conflict-free merge whose tree equals a clean re-merge of af99028 and 78c69df; that.agents/skills/aios-estateis byte-identical to base (I only confirmed SKILL.md exists and read its first 15 lines); that no test, CI workflow or gate was weakened outside the lines read; and that the full commit message has no co-author line or banned word (I only saw the subject). CHECKED IN THE MERGED TREE ONLY: all six mode-777 guards are at the lines the intent names;.github/workflows/ci.yml:220has shards 1-11,bin/fm-test-run.sh:203has PORTABLE_SERIAL_SHARDS=11, and the runner refuses a lane count that disagrees with it (lines 1060-1061);Full suiteneedstests-portable-serial(ci.yml:637). Remedy: allow read-only git for this phase and rerun it, or have a human rungit diff af99028a 27a3158c,git merge-tree --write-tree af99028a 78c69df2andgit log -1 --format=%B 27a3158c.CONTRIBUTING.md:56- The required-checks list stops atBehavior portable serial 10, but the merged CI now runs 11 serial shards (.github/workflows/ci.yml:220,bin/fm-test-run.sh:203), anddocs/fm-test-portable-shards.md:134already says eleven. A maintainer following this list would leaveBehavior portable serial 11out of the ruleset as an individual required context. The gate still holds ifFull suiteis required, as the same section instructs, because it needs the whole serial matrix and fails on any failed or cancelled lane (ci.yml:632-654). No change is proposed here: this is upstream text, and the intent limits fixes to what the fork's tests and lint need. The owner may want to add shard 11 to the fork's ruleset once the workflow lands; I could not read the ruleset, so I don't know its current state.ls,grepandsed.bin/fm-test-run.sh,tests/*.test.sh,mktemp,jq,claudeandgitall returned 'requires approval', and no approver is reachable in this phase. I did not retry throughbash -c, wrapper scripts or subagents, or read the gate's bare repo, because those would bypass the approval rather than satisfy it. To fix it, allow these for this phase and rerun:bin/fm-test-run.sh,bin/fm-lab-home.sh,mktemp,tmuxand read-onlygit. Otherwise decide whether remote CI alone is enough for this sync. Recorded decisions already declined the review-phase git comparison finding, so plain-merge status stays unverified here too.bin/fm-test-run.sh --check-coverageand--list-lanes; both returned 'requires approval'. Allowingbin/fm-test-run.shfor this phase would make this drivable.bin/fm-test-run.shwas already refused for the coverage and list-lanes runs. It needs the samebin/fm-test-run.shapproval.tests/fm-x-mode.test.shdirectly; it returned 'requires approval'. The lines are present in the merged tree, but their runtime behaviour was not exercised and they were not compared wi…git diff af99028a 27a3158c -- .agents/skills/aios-estate. Triedgit diff --stat af99028a 27a3158c,git rev-parse HEADandgit log; all returned 'requires approval'. Read-only git wo…git merge-tree --write-tree af99028a 78c69df2, would make this…jq --versionreturned 'requires approval'.bin/fm-test-run.shwas also refused, so I did not attempttests/fm-dispatch-resolve.test.sh. Running it needs approval forbin/fm-test-run.sh.mktemp -d, which returned 'requires approval'.bin/fm-test-run.shwas also refused. Allowingmktemp,bin/fm-lab-home.shandbin/fm-test-run.shwou…mktemp -d, returned 'requires approval', so no lab could be created and tmux was not attempted. Allowingmktemp,bin/fm-lab-home.sh,tmuxandclaudewould make this…Refused with 'requires approval' (not run):bin/fm-test-run.sh --check-coverage,bin/fm-test-run.sh --list-lanes,tests/fm-x-mode.test.shRefused with 'requires approval' (not run):mktemp -d /tmp/fm-lab.XXXXXX, the first step of the lab-home runbook, sobin/fm-lab-home.shand the lab tmux primary were not attemptedRefused with 'requires approval' (not run):jq --version,claude --version,git rev-parse HEAD,git diff --stat af99028a 27a3158c,git log -1 --format=%B 27a3158cRead-only, not live:grep -n '777' bin/fm-x-lib.sh bin/fm-procevent-lib.sh bin/fm-bootstrap.shRead-only, not live:ls -la .agents/skills/aios-estate, plus reads of the shard settings and refusal logic inbin/fm-test-run.sh, the serial matrix andFull suiteneeds in.github/workflows/ci.yml, the openai check inbin/fm-dispatch-resolve.sh:521-544, and a grep ofbin/fm-pr-check.sh🔧 No changes applied.
2 warnings still open:
git rev-parse HEAD,git status,git diff --stat af99028a 27a3158c,jq --version,tmux -V,mktemp -d,bin/fm-test-run.sh --helpandbin/fm-test-run.sh portable-serial-1of11. The Write tool was also refused for the evidence directory. No approver is reachable here. I did not usedangerouslyDisableSandbox, wrapper shells or subagents, or edit settings to grant myself permission, because each would bypass the approval, and the phase forbids changing tool configuration. Rerunning without changing permissions will give the same result. To fix it, allow these in this phase's permission mode, then rerun:Bash(bin/fm-test-run.sh:*),Bash(bin/fm-lab-home.sh:*),Bash(tests/*),Bash(mktemp:*),Bash(tmux:*),Bash(jq:*),Bash(claude:*), read-onlygit, and Write access to ~/.no-mistakes/evidence. Alternatively, decide that remote CI alone is enough for this sync.bin/fm-test-run.sh --helpandbin/fm-test-run.sh portable-serial-1of11; both returned 'requires approval'. Needs Bash permission for bin/fm-test-run.sh.bin/fm-test-run.shinvocations returned 'requires approval'. Needs Bash permission for bin/fm-test-run.sh.mktemp -dand repo scripts returned 'requires approval'. Needs Bash permission for mktemp and the repo's scripts and tests.git diff --stat af99028a 27a3158creturned 'requires approval', and reading the gate's bare repo is forbidden. Needs read-only git.git rev-parse HEAD,git statusandgit diffreturned 'requires approval'. Needs read-only git, includinggit logandgit merge-tree.jq --versionreturned 'requires approval', and the dispatch scripts cannot run without execute permission. Needs Bash permission for jq and the repo's scripts and tests.mktempreturned 'requires approval'. Needs Bash permission for the repo's scripts and tests, plus mktemp.mktemp,bin/fm-lab-home.shandtmux.mktempandtmux -Vreturned 'requires approval', so no lab could be created. Needs Bash permission for those plusclaude.Attempted, returned 'requires approval', not executed:git rev-parse HEAD,git status,git diff --stat af99028a 27a3158c,jq --version,tmux -V,mktemp -d /tmp/fm-probe.XXXXXX,bin/fm-test-run.sh --help,bin/fm-test-run.sh portable-serial-1of11Attempted, refused: Write of a blocked-command log to the evidence directory;lsof the evidence directoryStatic read of the merged tree only, not live:grep -n PORTABLE_SERIAL_SHARDS bin/fm-test-run.sh,grep -n 777 bin/fm-x-lib.sh bin/fm-procevent-lib.sh bin/fm-bootstrap.sh,grep -n 'shard:' .github/workflows/ci.ymlCONTRIBUTING.md:56- The required-checks list still ends atBehavior portable serial 10, while the merged tree has 11 serial shards (bin/fm-test-run.sh:203,docs/fm-test-portable-shards.md:134). This phase would normally fix a stale fact like this, but review round 2 declined this exact finding, so I left the line unchanged and am reporting the conflict. To fix it later, change10to11, or point tobin/fm-test-run.sh --list-lanesinstead of repeating the count.git diff --stat af99028a 27a3158c,git logandbin/fm-doc-audience-check.sheach returned 'requires approval', so I could not read the changed-file list or run the structural doc check. I worked only from the intent's description of the sync and from greps and reads of the merged tree. Any stale fact outside the shard-count, jq and PR-recording topics I searched could have been missed. To close this, allow read-only git and that script for this phase and rerun it, or have a human run them.🔧 No changes applied.
1 warning still open:
✅ **Push** - passed
✅ No issues found.