Skip to content

feat(bin): sync upstream harness, dispatch, and reliability updates - #251

Merged
jazz127 merged 16 commits into
housefrom
fm/firstmate-house-upstream-sync-1030
Oct 30, 2026
Merged

jazz127 merged 16 commits into
housefrom
fm/firstmate-house-upstream-sync-1030

Conversation

@jazz127

@jazz127 jazz127 commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Upstream merge report

Merge inputs: fork house at 702d6668fa831d202c6d5efa4d79642fad5a8986, upstream main pinned at b936f04076b1822fceaace5dad08c8682329235d.
Both match the supplied brief; fetched from origin and upstream on 2026-10-29 UTC (2026-10-30 Brisbane).
Merge commit: 237c8008ccfd1173b3d5fa2b0bcf1141979369d3.
The branch uses a two-parent merge, without a rebase or squash.
Publication target is jazz127/firstmate:house; no upstream-facing publication is authorized.

Upstream changes

Commit Change
b936f04 Promote agy to a full primary and secondmate harness
0f2cf78 Add opt-in System One and OpenAI decision providers
c9da552 Gate full CI on outside pull requests behind the full-ci label; supersede older main-push runs
7bbf71b Keep newest no-mistakes run attribution in crew-state
2363b71 Refuse teardown when Git hides untracked files
e13d23f Add the per-project pr=manual token for worker-written PR text
51a501d Exclude failed or non-schema remote replies from captures
0adf422 Recover ownerless extension readiness records
a95a227 Fall back to Perl for non-GNU timeout implementations
cf577c7 Reclaim live watcher locks whose recorded identity no longer recomputes
6613c3e Reset idle backoff on actionable heartbeat wakes
46b8fa9 Respect externally owned Herdr servers

Conflict resolutions

File Resolution
CONTRIBUTING.md Add upstream Full suite required-check documentation and retain the house matrix-based serial-shard reference.
README.md Combine manual PR-text support with house forge documentation and its Forgejo/Gitea support.
bin/backends/herdr.sh Apply upstream external-owner and replacement-marker checks before startup; retain house session-leader launch and environment cleanup for Firstmate-owned servers.
bin/fm-brief.sh Carry manual PR text as an additional delivery argument while retaining durable house-feature PR bases and Bosun instructions.
bin/fm-dod-lib.sh Preserve the seventh house-feature argument and add PR text as the eighth; compose manual PR delivery with scratch/body preflights, guarded upstream publication, integration handoff, and shared validation-evidence rules; retain forge-aware event waits.
bin/fm-project-mode.sh Add the PR-text field and query while retaining literal project names, malformed-annotation defaults, conflicting-forge refusals, and Forgejo/external support. Correct the clean-merged malformed-annotation branch to emit the additional field too.
bin/fm-promote.sh Read and render the manual PR setting while retaining house branch-prefix notices and feature-base/integration contracts.
bin/fm-push-transition-lib.sh Use upstream's optional cadence argument with the house bounded, decimal-safe heartbeat streak helper.
bin/fm-spawn.sh Retain seated Codex launch/account validation and remove agy from the worker-only restriction; retain registry agreement checks for manual PR text.
bin/fm-test-run.sh Include both the house Claude context-restart live guard and upstream agy primary live guard, retaining house lane sizing and scheduling.
bin/fm-wake-lib.sh Apply upstream full-identity recovery only to watcher locks, through the house shared stable-start ownership predicate and portable identity reader; retain exec-safe start identities, missing-evidence tolerance, and daemon non-reclamation.
bin/fm-watch.sh Combine actionable-heartbeat accounting with house validated decimal arithmetic; retain upstream held-directory teardown distinction.
docs/architecture.md Retain the precise house daemon-status predicate and add upstream newest-run attribution rules.
docs/configuration.md Keep published-path safety policy, add manual PR-text configuration, and describe watch-only identity reclamation alongside house start-identity ownership.
docs/fm-test-portable-shards.md Keep house idle-policy and current timing caveats instead of restoring obsolete upstream per-file measurements; incorporate upstream agy hints and CI policy changes.
docs/turnend-guard.md Keep house Pi/context-detector hook details, add agy Stop-hook parking, and update watcher upgrade-recovery documentation.
tests/fm-project-mode.test.sh Keep both suites; extend malformed-annotation defaults to the new --pr query.
tests/fm-watch-checkpoint.test.sh Keep house signal/path tests and use upstream timeout-selection fixtures, with one shared cleanup-bound test rather than duplicate implementations.
tests/fm-watcher-lock.test.sh Keep house zero-padded grace/start-identity tests and upstream legacy-identity takeover tests; adapt the legacy fixture to the house lock-owner-start record.

Semantic reconciliation

Reviewed the upstream additions in all 49 files modified on both sides, including clean merges, against the preserved house integrations.
Added a generated-brief regression for manual PR text combined with a house-feature target, integration handoff, scratch/body checks, guarded publication, and validation evidence.
No house behavior was dropped or replaced by upstream.
No release bookkeeping files changed in this round.

Validation

Canonical lint, its final delivery-library rerun, documentation audience/link validation, and inventory coverage pass.
The main targeted offline selection completed: 24 scripts, 21 passed, 3 non-green (the two failed suites and the deliberately interrupted runner suite described below).
The supplemental supervision suite and all six focused heartbeat cases passed.
The separately run remote-reply suite has the fourth inherited/environment exception described below; its new transport rejection cases passed before that existing capture path failed.
The broader supplemental selection was cancelled before the away-daemon suite started because that suite includes terminal lifecycle operations outside this non-lab brief; its completed supervision result is retained, and remote-reply was then run separately.
The spawn-profile suite could not exercise the optional fish pane-launch case because fish is absent; it reported only its static syntax check for that case.
Private fixture-worker cleanup completed through the host-appropriate identity-checked helper; no shared daemon was managed.

Inherited failures observed:

  • tests/fm-test-run.test.sh: interrupted with exit 143 after its nested fm-session-lock-ancestry Windows mock waited indefinitely in fm-lock.sh. The mock rejects ps -o; a focused probe using the pinned house wake library and the merged library returns identity_exit=1 and acquire_exit=1 with both. This is a focused library comparison, not a full baseline suite run.

  • tests/fm-watcher-lock.test.sh: fails the new legacy-identity takeover test on macOS because upstream's unchanged [ /dev/fd/6 -ef "$STATE" ] predicate returns false even for an open existing directory. inherited-failures.sh reads the exact predicate from pinned upstream and reproduces that false result locally; matching inode output is retained. This is an isolated predicate reproduction, not a full upstream suite run.

  • tests/fm-dispatch-resolve.test.sh: fails the new OpenAI clear-response case with response is not a rule Choice answer. Extracting the validator directly from pinned upstream and the merged script and feeding the same valid response to jq 1.8.2 produces exit 5 and boolean (true) has no length in both. The upstream predicate is unchanged; the focused two-case probe is retained in openai-validator-probe.py and openai-validator-probe.log. This is offline validator evidence, not an OpenAI account/API check.

  • tests/fm-remote-reply.test.sh: new transport-error/non-schema rejection cases pass, then the existing end-to-end capture fails because remote-job startup returns exit 64. The fm-on.sh, fm-remote-entrypoint.sh, and fm-remote-job-lib.sh blobs are identical to pinned house. A focused public fm-on probe returns exit 64 with both the current entrypoint/library and exact pinned-house copies, before delta reading; remote-startup-comparison.log records the hashes and matching startup diagnostic. This is a local fake-SSH fixture, not a real remote-account check.

The unmodified evidence commands and output are in inherited-failures.sh, inherited-failures.log, and targeted-tests.log alongside this report.
The full suite is reserved for the authorized post-landing follow-up.
No installed-tool rebuild, daemon restart, or real Herdr lifecycle operation was performed.

No-mistakes follow-up

Review corrected durable pending-wake handling so an empty fleet or final source retirement cannot suppress an actionable AGY wake. A follow-up correction retained daemon-owned quiet/away stand-down at all three hook boundaries while host-owned away contracts continue parking. Final review reported no remaining material findings; the original merge remains in the history.

The Test agent reached its 30-minute invocation budget before returning a final result. Firstmate approved that timeout exception after focused offline checks on pipeline head aef9f128: 28 test functions passed (the full 17-case AGY suite, eight selected launch-policy functions, two selected host functions, and one quiet-record hook function). One additional host assertion, test_quiet_record_without_its_daemon_is_a_present_captain, expects two outcome rows but observes one. It fails identically on pinned house at 702d6668; the host implementation, suite, and helper are unchanged there. This inherited assertion is deferred to the post-landing full-suite follow-up, rather than reported as passing.

The Test agent also reproduced a monitor-replacement cleanup error on pinned upstream. Its broader cleanup and remote-reply rechecks reached seven-minute limits and remain incomplete. Those limits are separate from the earlier targeted results above. The actual AGY executable was unavailable, so AGY harness/host checks use explicit fixture substitutes and make no UI or external-account claim. Focused follow-up commands, source provenance, raw logs, and baseline comparison are retained in the task's focused-r3-report.md and focused-r3-*.json/.log artifacts.

evidence-artifact: /evidence.txt
evidence-command: bash /capture-evidence.sh
evidence-captured: 2026-10-30T00:25:33Z

Pipeline

Review, documentation, and lint completed. Test completed with the approved exception described above. The rebase step was deliberately skipped to preserve the required merge history. CI is pending.

rchristensen and others added 16 commits October 28, 2026 23:18
…owner manages (kunchenguid#7357)

* fix(herdr): never start a server an external owner manages or is replacing

fm_backend_herdr_server_ensure started a detached herdr server whenever
status reported the session not running. When a service manager owns the
server, that races a unit restart or a server live-handoff and splits panes
across two servers.

The session directory reported by herdr session list can now carry a
firstmate-server-owner marker (persistent, naming the owner) and a
firstmate-server-replacing marker (for the duration of a restart or handoff).
While either exists and the server is not running, server_ensure never starts
a server: it waits a bounded time (FM_BACKEND_HERDR_EXTERNAL_SERVER_POLLS,
default 30s) for the server to report running, and otherwise fails naming the
owner or the replacement. A running server is still used at once, and a
session with no marker keeps the Firstmate-owned autostart unchanged.

Fixes kunchenguid#7320

* no-mistakes(review): Enforce herdr replacement marker on fast path; fixed wait bound

* no-mistakes(ci): Both CI failures had one cause in this PR, and I fixed it in code; no test assertions changed. `fm_backend_herdr_server_ensure` had started running `herdr session list --json` on every call to find the session directory for the ownership markers. Two existing tests treat that call as a sign of something else: - `tests/fm-control-relaunch.test.sh` failed with "a herdr reclaim touched a session the record does not name: session list --json", because it allows only `--session fmlab` calls and `status --json`. - `tests/fm-backend-herdr-presentation-e2e.test.sh` failed with "opted-out spawn added presentation-ordering capability or socket calls", because there `session list` means presentation ordering ran. Invariant: `server_ensure` must not make Herdr calls beyond its own `status` read, so ordinary spawns and reclaims stay free of `session list` and only touch the session they name. Every caller goes through `server_ensure`, so fixing it there covers all of them. Fix (`bin/backends/herdr.sh`): the session directory now comes from the `status --json` read `server_ensure` already makes. It is the directory containing `.server.socket`. I removed the `fm_backend_herdr_session_dir` helper. On a running server, the only added work is one check for the replacement marker, which is what the user asked for. I checked this against real Herdr 0.9.5: - `status` reports the socket even when the server is stopped, for both the default and named sessions. - The socket's directory is the same `session_dir` that `session list` reports, and it follows `XDG_CONFIG_HOME`. - With `--session`, an inherited `HERDR_SOCKET_PATH` does not change it. - The read creates nothing on disk. If a Herdr version omits the socket, `server_ensure` keeps the old Firstmate-owned behavior, as the docs already said for a missing `session_dir`. Other changes: the marker-test fakes now report the socket under the session directory, and I removed the `session list` stub this PR had added to the shared fake. `docs/herdr-backend.md` and `docs/verification/runtime-backends.md` ("Session directory") now describe and record the `status`-socket measurement. Verification: - `tests/fm-backend-herdr.test.sh` passes: 239 ok, 0 not ok, including all the externally-managed and replacement-marker tests. - `tests/fm-control-relaunch.test.sh` passes; it was the shard 3 failure. - shellcheck shows only existing info-level notes. Not verified locally: the real-Herdr presentation test. Here it stopped earlier, at an unrelated Treehouse timeout ("treehouse get did not enter an isolated worktree within 60s"). After the fix `server_ensure` no longer runs `session list`, which is the call that assertion caught. No lab session was left running, and I removed the test's temp directory
)

* fix: classify actionable heartbeat backstop as a check

* no-mistakes(document): Correct heartbeat routing docs and remove stale test count

* fix: preserve heartbeat routing when resetting actionable backoff
…mputes (kunchenguid#7931)

* fix(bin): reclaim a lock whose recorded pid-identity no longer recomputes

kunchenguid#7886 made fm_lock_holder_alive reject a live pid whose start time no
longer matches the lock's recorded pid-start. A holder that predates that
record still falls back to pid liveness, which leaves issue kunchenguid#7801 open: on
a /proc-less host outside UTC, a watcher started before fm_pid_identity
pinned TZ=UTC0 recorded a local-time pid-identity. After the update that
live holder no longer matches its own identity, so the health predicate
rejects it, yet every new watcher stands down beside it and the home stays
unsupervised.

fm_lock_holder_alive now also requires a recorded pid-identity, when
present, to still recompute for the pid, after the existing start-time
check and with the same missing-evidence fallbacks: no record, a pid
rewritten mid-read, or an unreadable value keeps the pid-liveness answer.
Both records go through one helper, _fm_lock_record_matches. Only
long-lived holders that never exec write a pid-identity (the watcher, the
supervise daemon), so a genuine holder still matches. A watcher replaced
this way stands down unsignalled at its next poll through the existing
self-eviction. The fm_pid_identity comment and docs/turnend-guard.md
claimed the upgrade-window residual is cleared by the post-update restart,
which never reaches a primary home's own watcher; they now say the next
lock claim clears it.

Verification:
- Drove: real bin/fm-watch.sh processes with /proc hidden through
  FM_PROC_ROOT_OVERRIDE and TZ=America/Los_Angeles: a live genuine watcher
  whose lock record was rewritten to its own local-time ps lstart identity
  with no pid-start, as a pre-pin build wrote it, then a fresh watcher;
  plus fm_lock_try_acquire against a live pid with a mismatched, matching,
  and unrecorded pid-identity and no pid-start.
- Observed: on the unchanged library the fresh watcher exits "lock held by
  live pid ... but heartbeat is stale" and fm_lock_try_acquire returns
  held for the mismatch. With this change the fresh watcher takes the
  lock, the legacy holder exits 0 by standing down, the live pid is never
  signalled, and matching or unrecorded identities stay held.
- Re-check: tests/fm-watcher-lock.test.sh cases
  test_watch_replaces_live_holder_with_legacy_local_time_identity and
  test_lock_reclaims_holder_whose_identity_no_longer_recomputes.

* no-mistakes(review): Limit pid-identity lock reclaim to the watch lock

* no-mistakes(document): Correct fm_lock_holder_alive comment on non-watch identity locks

* no-mistakes(ci): I made two small fixes. CI and "Require no-mistakes" never ran: GitHub shows both as `action_required`, waiting for approval to run workflows from a fork, so the code didn't cause those. Greptile failed because it scored the PR 4/5 against a required 5/5, with one P2 comment. 1. **Greptile P2, test children left running (`tests/fm-watcher-lock.test.sh`).** The two new lock tests start a `sleep 300` holder that only gets killed after every assertion passes, and the suite's cleanup only reaps processes whose command line contains the fixture root. Each holder now starts as `(exec -a "$dir/holder" sleep 300)`, so cleanup reaps it if the test fails early. To check, I forced a `fail` right after the child starts: on HEAD the `sleep 300` was still running afterwards, and with the fix it was reaped. Both tests pass normally. 2. **Flaky takeover test (`bin/fm-watch.sh`).** This edit was already uncommitted in the worktree. Twelve isolated runs passed without it, so I first dropped it as out of scope, but the full suite then failed on exactly this race. When a successor takes over a live watcher's lock, it deletes the lock and recreates it while holding `.watch.lock.steal`. If the old watcher checks during that gap, it sees no lock `pid` and exits as "state directory was torn down", not by standing down cleanly as the PR intends. That race only happens once this PR lets a healthy, live watcher's lock be taken. The guard treats a missing `pid` as teardown only when no `.steal` marker exists, with a comment explaining why. With it restored, 15 runs of the takeover test (three at a time, to add load) all passed, and all three PR tests passed in the full suite. **Remaining failures:** with the guard restored, I ran the full suite three times and it failed each time, but always on tests this change doesn't touch: "bounded child cleanup regression" twice and "bounded ledger cycle 2 did not start" once. The host's load average was about 100, and these tests depend on timing; one of them runs before any watcher starts. I didn't confirm they also fail on the base commit. shellcheck reports nothing in the test file beyond info notes about files it didn't follow, and one existing warning in `fm-watch.sh` at line 2598, not from this change. I deleted the leftover temporary runner `tests/.tmp-one.sh`. Nothing is committed or pushed

* fix(bin): re-read the watch lock holder after the steal check

The steal-gap guard read the lock pid, then the steal mutex. A successor
that removed and relinked the lock between those reads let the old
watcher see no pid and then no steal mutex, so it exited as "state
directory was torn down" instead of standing down. Upstream CI hit this
in tests/fm-watcher-lock.test.sh
(test_watch_replaces_live_holder_with_legacy_local_time_identity).

The teardown branch now re-reads the pid after the steal mutex. The
steal mutex is held for the whole remove-and-relink, so a steal that
finished between the first two reads has already relinked the lock by
the third read, and the self-eviction below stands the watcher down.

Verification:
- Drove: the takeover test (real bin/fm-watch.sh processes) 48 times,
  six at a time, with and without this change, plus the whole
  tests/fm-watcher-lock.test.sh file.
- Observed: the interleaving is too narrow to hit locally (48 of 48
  passed either way); the whole file passes with this change. The
  failing CI run shows the old watcher's exit 1 teardown message.
- Re-check: Behavior portable serial 6 on this PR's CI.

* no-mistakes(review): Scope fm_pid_identity residual comment to the watch lock

* no-mistakes(review): Align fm_pid_identity residual comment with autoarm reclaim behaviour

* no-mistakes(document): Note watch-lock identity mismatch skips lock stale grace

* fix(bin): tell a released watch lock from a torn-down state directory

A watcher replaced by a successor still exited 1 as "state directory was
torn down" on upstream CI. The successor that reclaims the lock delivers
its recovery wake and exits, releasing the lock, and on a fast runner
that happens before the old watcher's next poll. The old watcher then
found no lock holder and no steal in progress, which the teardown check
read as a recreated state directory.

The watcher now holds its state directory open (fd 6) from startup, and
a lock with no holder is a teardown only when the directory at that path
is no longer the one it holds; otherwise the lock was released by a
successor and the self-eviction stands the watcher down with exit 0. The
held descriptor keeps the inode from being reused by a recreated
directory. A host that cannot open a directory keeps the old reading.
This replaces the steal-marker check and pid re-read, which only covered
a successor still relinking the lock.

Verification:
- Drove: real bin/fm-watch.sh processes. A new regression,
  test_watch_replaced_holder_stands_down_after_successor_exits, pauses
  the old holder (SIGSTOP, only while it holds no other state lock) until
  the successor has delivered its wake and exited, then resumes it. Also
  a standalone run with the old watcher polling every 5s.
- Observed: on the previous head the old watcher exits 1 "state
  directory was torn down (singleton lock removed)", the CI failure,
  every time; with this change it exits 0 by standing down. Both
  takeover tests passed 20 of 20 runs four at a time on one loaded CPU.
  The teardown tests in tests/fm-watch-arm.test.sh (state directory and
  home removed) still pass.
- Re-check: tests/fm-watcher-lock.test.sh and Behavior portable serial 6.

* no-mistakes(test): Hold the watcher's state directory open before claiming the lock

* no-mistakes(document): Docs already match watch-lock identity reclaim change

---------

Co-authored-by: mangocabs2025 <250559406+mangocabs2025@users.noreply.github.com>
…nguid#7911)

* Fix non-GNU timeout fallback

* no-mistakes(review): Assert INT reaches watcher in non-GNU timeout fallback test

* no-mistakes(document): Document GNU-only timeout selection in watch checkpoint

* no-mistakes(ci): Greptile flagged that only the non-GNU-timeout-to-Perl path had an isolated test. I added two isolated tests in tests/fm-watch-checkpoint.test.sh, as you asked. The production code is unchanged. The rule being tested: run_bounded must run GNU `timeout` first, then GNU `gtimeout`, then Perl. Whichever GNU command it runs must receive `--signal=INT --kill-after=<bound>s <seconds> <watcher>`. What changed: - **Shared setup:** a new helper, `make_isolated_checkpoint`, copies the checkpoint into a temporary root. It also builds a PATH that holds only the named host tools, so the stubs decide which timeout is found. The existing Perl-fallback test now uses this helper too. Its assertions are the same. - **Stubs:** a non-GNU stub reports `uutils` for `--version` and exits 137 if it is ever used. A GNU stub reports `GNU coreutils` and writes its own name and arguments to `$FM_HOME/timeout-calls`, then exits 124. - **`test_gnu_timeout_runs_the_watcher_bound`:** GNU `timeout` and GNU `gtimeout` are both on PATH. The test asserts exit 124, the quiet checkpoint line, and exactly one call: `timeout --signal=INT --kill-after=5s 1 <root>/bin/fm-watch.sh`. - **`test_non_gnu_timeout_uses_gnu_gtimeout`:** a non-GNU `timeout` is next to a GNU `gtimeout`. The test asserts the same exact call, made by `gtimeout`. - In both new tests, Perl is not on PATH. So if the code picked Perl by mistake, the run would fail with 127. How I checked it: - The full test file passes: all 14 tests. - I broke the code on purpose twice. When I swapped the order to try `gtimeout` first, the GNU timeout test failed. When the code always picked Perl, the run exited 127 instead of 124. I then put the production file back; `git status` shows only the test file changed. - `shellcheck -x` passes on the test file. This is a change to tests only, so there is nothing a user would see to check by hand
* fix: recover ownerless extension readiness and announce cleanup refusals

* no-mistakes(review): Reset cleanup failure episodes and classify failure wakes

* no-mistakes(document): Document ownerless readiness recovery and cleanup failure wakes

* no-mistakes(document): Clarify cleanup failure documentation ownership

---------

Co-authored-by: Kun Chen <3233006+kunchenguid@users.noreply.github.com>
kunchenguid#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 <pitchperfekt@Pitchs-Mac-Studio.local>
…n PR text (kunchenguid#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(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 <3233006+kunchenguid@users.noreply.github.com>
* 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 3fbace9 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 <mehulbhagwani@users.noreply.github.com>
Co-authored-by: Pitch Perfekt Collective <pitchperfekt@Pitchs-Mac-Studio.local>
… 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.
…atch resolution (kunchenguid#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 kunchenguid#7643, builds on kunchenguid#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 kunchenguid#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 kunchenguid#7643.
…henguid#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
Merge b936f04 while retaining house delivery, account, watcher, and
publication safeguards. Combine manual PR text with house-feature
handoffs and preserve both sides of the conflicted test coverage.
@jazz127
jazz127 merged commit bb25897 into house Oct 30, 2026
1 check passed
@jazz127
jazz127 deleted the fm/firstmate-house-upstream-sync-1030 branch October 30, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants