Repository navigation
feat(bin): sync upstream kunchenguid/firstmate through b936f040 into the fork - #52
Merged
Merged
Conversation
…guid#5404) * fix(bin): parse Lavish list-form results and refuse unparsed blocks Lavish emits its queued prompts in TOON list form instead of table form as soon as the items stop being uniform, for example when some annotations carry a nested target object or a message carries an attachments table. The adapter only recognized the table header, so read reported a complete, empty result and answers closed nothing. Move the result parsing into one shared reader used by read, answers, and reconciles that accepts both forms, keeps only column-zero headers, skips nested structures only beneath the field that opened them, and counts anything it cannot account for as malformed. An unrecognized header naming the block is now malformed rather than an empty result, answers and reconciles exit nonzero when the result is not fully accounted for, and the queued-content check treats a list header as content. Refs kunchenguid#4726 * no-mistakes(document): Document Lavish capture formats and incomplete-result handling * test: expect captain_message_count for the open-board list-form capture
…uid#5835) * fix(pi): let the supervision branch claim Orca stale wakes The watcher keys Orca endpoints by terminal=, but the branch dispatcher only indexed window=, so every Orca stale row vetoed the wake scan and went to main. Index both endpoint fields. Local hotfix ahead of upstream; refs kunchenguid#5623. * test(pi): cover terminal-keyed Orca stale rows in branch dispatch Pins the terminal= endpoint lookup: a terminal-keyed stale row queued with another eligible row must resolve to its task in both routine and heartbeat scans, instead of vetoing the wake to main. * no-mistakes(document): Update supervision dispatch doc for Orca terminal-keyed stale rows * fix(pi): reject conflicting wake endpoint ownership Index task keys and window/terminal aliases through one ownership check. Ambiguous records must leave the wake on MAIN instead of selecting the last task and possibly bypassing another owner's open decision. Cover duplicate terminals and collisions with window and task keys in both record orders while preserving unique terminal routing. * no-mistakes(document): Document conflicting alias ownership as scope corruption * fix(pi): retain ownership claims from incomplete task records Check endpoint and task alias ownership before project eligibility so a projectless record cannot lose its open decision to another terminal owner. Require project context before decision filtering can grant routing scope. Cover missing and empty project fields in both record orders, and preserve refusal for a uniquely mapped terminal without project context. * no-mistakes(review): Fix canonical routing ownership and custom SDK event handling * no-mistakes(review): Preserve dedicated custom processing run ownership * no-mistakes(document): Clarify Pi event handling and fail-closed routing documentation
…anches (kunchenguid#7368) * feat(bin): add a forge=external review rail that never pushes task branches A project whose review tool uploads its own snapshot of the worker's local commits can now be registered [direct-PR forge=external]. Workers on such a project never need to push a branch to publish, and must never push a task branch to the shared origin. - fm-project-mode.sh: external joins the closed forge set; never detected, refused on local-only, and +yolo reports yolo=off with a refusal. - fm-dod-lib.sh: external ships direct-PR only; its first rule forbids origin and task-prefixed pushes, its Definition of done renders the home's config/external-review.md adapter verbatim, and the ready-report gate accepts `done: review <url> uploaded for review` on the URL alone or, with a recorded backup remote, once HEAD is on the backup namespace. - fm-git-push-guard.sh (new): per-task pre-push guard refusing pushes to origin or a URL matching origin's, task-branch and task-prefixed refs on any remote, and refs outside the backup prefix on the backup remote. - fm-git-strip-ai-trailers.sh: install gains --push-guard and --no-strip. - fm-spawn.sh: refuses yolo, a missing adapter, and an unusable backup remote before launch; installs the guard even under keep-ai-trailers; and records forge=external, backup_remote=, and backup_prefix=. - fm-review-check.sh (new): records review= and review_head= with no merge watch, and publishes the child's ready line in a secondmate home. - fm-promote.sh refuses promotion onto forge=external, because a scout launches without the guard. - Docs: docs/external-review-forge.md (design), configuration.md's new "External review tool" section, scripts.md, and the ship-landing and project-management skills. * no-mistakes(review): Drop string-grep hook assertion from external-review spawn test * no-mistakes(document): Note forge=external contract token and direct-PR-only composition
…uid#7387) Ein Lauf, den sendCustomMessage startet, traegt eine Custom-Nachricht und keinen prompt. Das Lesen des prompt an dieser Stelle warf, womit jeder solche Lauf mit einem Fehler auftauchte statt zu starten. Die Verengung dagegen steht seit 8c9c67d im Zweig, ein Test, der sie benennt, fehlte: die einzige Abdeckung lag beilaeufig in einem Abbruch-Fall der Abwesenheits-Haltung und verschwindet mit ihm. Der neue Fall erweitert den bestehenden Mirror-Test und prueft, dass ein solcher Lauf weder wirft noch als Dialog gespiegelt wird. Gegenprobe: ohne die Verengung wirft genau dieser Fall mit "Cannot read properties of undefined (reading 'trim')". Co-authored-by: thelad-dev <[email protected]>
…nchenguid#7409) * fix(tmux): verify exact endpoint membership * fix(tmux): preserve exact target forms * test(tmux): align endpoint fixture lifecycles * test(tmux): guard isolated cleanup and shell reader * no-mistakes(review): Limit tmux .pane target split to window indexes
… plain row (kunchenguid#7395) * fix(bin): stop misreading opencode's own footer as pending composer text An idle OpenCode composer classified as `pending`, and that verdict gates every typed-plane action firstmate owns: fm-send skips the doorbell, and fm-control refuses both relaunch and exit. A firstmate operator lost a full session to it and had to type into worker panes by hand three times. Root cause: opencode 1.19 draws the mode/model footer's identifying cells de-emphasised (mode word RGB 67;133;190, middle-dot separators 111;110;105, luminances ~119.8 and ~109.7, both under fm_composer_strip_ghost's 128 threshold). That helper exists to answer "what did the human type?", so it deleted exactly the cells that identify the footer. The `^(Build|Plan)` anchor then became unreachable on every styled backend - tmux, Herdr, and Zellij - not just one pane, because the unstyled row keeps its styling bytes everywhere. The fix proves the footer from both forms of that row: the ghost-stripped content and the ANSI-stripped plain row. Proving it on the form ghost stripping cannot reach is the whole repair. What makes that safe, and why the previous argument was not: the earlier draft argued safety by noting that on a plain capture the two forms collapse to one string, so the verdict is unchanged. That is true and carries no weight, because styled=0 is the only configuration where the new proof does nothing. The exemption is safe because a row reaches the plain form only when the ghost-stripped row still fails the pattern, which means the stripped content is non-empty while its own leading Build/Plan cell was deleted as ghost. Nothing opencode draws de-emphasises a typed row's leading cells - only its furniture is drawn dimmed - so the only rows the plain form admits beyond the stripped one are de-emphasised furniture, and the mode footer is the only furniture opencode draws that opens with a mode word. That is self-confirming rather than asserted, and it is the argument to recheck when a new opencode release moves a colour. A review also caught a second change riding along in the same diff: the footer pattern had been widened from `[[:space:]]+` to `[[:space:]]*`, admitting `Build ·x` and a bare `Build ·`. Both read as more typeable than the footer, so they moved the verdict in exactly the direction this rule exists to prevent. No recorded opencode footer ends at the dot, so the original `+` matches every real capture and the widening is reverted. Verification: - fm-lint.sh exit 0 on pinned shellcheck 0.11.0 and actionlint 1.7.12. - fm-doc-audience-check.sh ok across 119 surfaces and 757 local links. - tests/fm-composer-lib.test.sh green via bin/fm-test-run.sh. - The new regression case fails on exactly one assertion when this change is reverted: "opencode 1.19.0 de-emphasised footer row: expected empty, got 'pending'", which is the reported symptom. - Confirmed end to end against live panes rather than only fixtures: a real idle opencode 1.19.0 worker classified empty after the change and pending before, and firstmate reached the worker over the steer channel afterwards. * no-mistakes(review): fix(bin): apply leftbar footer rule in content extractor; correct cursorless claim * no-mistakes(document): document opencode 1.19 footer furniture and extractor coverage * no-mistakes(document): document ghost-luma knob coupling to opencode footer furniture * no-mistakes(document): document opencode de-emphasised footer recognition invariant * no-mistakes(review): fix(docs,bin): correct ghost-luma knob direction, gate plain-row extraction * no-mistakes(review): fix(docs,bin,tests): correct ghost-luma knob wording, share plain-content helper, cover Herdr/Zellij idle * no-mistakes(document): narrow overstated backend coverage claim in runtime-backends.md * no-mistakes(document): document leftbar footer override and opencode 1.19 pointer
…7406) Der Kopf des Tests sagt, jedes Programm werde so gestartet, wie bin/fm-spawn.sh es startet. Im codex-Zweig von launch_cmd fehlte dabei --disable hooks, das fm-spawn im crewmate- und scout-Pfad setzt. Ohne den Schalter parkt codex auf dem Hook-Vertrauensdialog ("N hooks are new or changed"), dessen Auswahl auf "Review hooks" aufsetzt und der mit der Tastenebene dieses Werkzeugs nicht beantwortbar ist. Der Lauf meldet dann die Tuerklingel als nicht befolgt, obwohl er ueber die Tuerklingel gar nichts ausgesagt hat - und das auf jedem Checkout, weil schon die projekteigene .codex/hooks.json den Dialog aufzieht. Dazu eine knappe Zusicherung am Startrezept, damit der Schalter beim naechsten Umbau nicht wieder still ausfaellt. Co-authored-by: ladwein <[email protected]>
…kunchenguid#7096) * fix(bin): store only classified review fields in contribution records A pull observation stored GitHub's raw reviews payload, so a PR with a few hundred reviews wrote a record past the 1 MiB read cap and every pending, verdict and ack read then refused the whole home. Project each stored review to id, state, submitted_at, commit_id and user.login, the only fields the classifier reads, and add a many-review regression. * no-mistakes(document): clarify contribution record read cap in script header
…7216) * fix(pi): retain custom-event handling and processing cancellation * fix(pi): identify custom triggers before legacy prompt narrowing * no-mistakes(test): Correct branch fixture retirement and verify real notification ownership * no-mistakes(document): Clarify Pi event boundaries and verification scope * fix(pi): retain custom-event handling and processing cancellation * fix(pi): identify custom triggers before legacy prompt narrowing * no-mistakes(test): Correct branch fixture retirement and verify real notification ownership * no-mistakes(document): Clarify Pi event boundaries and verification scope * no-mistakes(review): Fix SDK1.1 prompt staging and verify branch context * no-mistakes(document): Clarify SDK prompt compatibility and branch-context verification * no-mistakes(test): Require dual-SDK compiler checks; execution remains pending * no-mistakes(document): Correct SDK typecheck documentation and stale dependency claims * no-mistakes(document): Correct stale Pi typecheck documentation and ownership pointers * no-mistakes(ci): Fixed SC2329 in tests/fm-pi-primary-types.test.sh by inlining EXIT cleanup. Also fixed a reproduced macOS npm-prefix/lockfile path failure without changing dependency pins or assertions. Canonical targeted lint, strict TypeScript 5.9.3 checks against Pi 1.1.0 and 1.2.0, and success/failure cleanup checks pass. Both behavior-shard failures were upstream npm ETARGET errors in workflow steps unchanged from base; no workflow/runtime changes warranted. Hosted CI remains for the outer executor * fix(test): reconcile queued processing probes after rebase * no-mistakes(document): Correct Pi compiler-phase documentation and stale CI comments
…guid#6380) * fix(cursor): verify cursor-agent by running it, not by name Cursor's installer writes its `cursor` IDE shim through the ~/.local/bin/cursor -> cursor-agent symlink, which can replace a versioned cursor-agent with a script that only prints "No Cursor IDE installation found" and exits non-zero. That file keeps Cursor's own name and install-tree path, so the name shortcut (and the structural check alone) accepted it and every Cursor spawn launched the broken file instead of the working agent alias. A launch candidate now has to print Cursor's CLI identity under the bounded probe, or carry the structural evidence and run --help successfully. Hosts without a bounded runner keep the structural verdict, as before. * no-mistakes(document): Align cursor launch-verify docs with runtime * no-mistakes: apply CI fixes * test: restore fm-watch-triage ack_stopped_cycle assertion The CI fix round loosened ack_stopped_cycle so a drain that prints no acknowledgement command and exits zero counts as success. That test is unrelated to the Cursor executable verification this branch changes, so restore its original assertion rather than mask a watcher failure here. * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * fix(bin): restore fm-afk-contract clock sampling A CI fix round changed how fm_afk_contract_cmd_enter samples its epoch. That away-mode behavior is unrelated to the Cursor executable verification this branch changes, so restore it here and leave any fix to its own change. * fix(cursor): load the timeout library only when a probe runs Sourcing bin/fm-timeout-lib.sh at load time made every consumer of fm-cursor-lib.sh, including the session-lock and turn-end hook paths that never probe, depend on that file being next to it. Load it lazily from the probe instead. * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * no-mistakes: apply CI fixes * test: restore herdr focus-flash e2e test A CI fix round edited this Herdr end-to-end test, which is unrelated to the Cursor executable verification this branch changes. Restore it here and leave any fix to its own change. --------- Co-authored-by: ladwein <[email protected]>
…#7422) * fix(dod): require a PR reference in CI-ready notes * no-mistakes(review): Recognize Forgejo plural pull request URLs
…ts view (kunchenguid#7434) * feat(herdr): opt-in project groups with status tags and a sorted agents view Add config/herdr-project-groups (absent or off: unchanged behavior). When on, Firstmate tags each Herdr task pane, and its own projected workspace, with display-only fm_group/fm_state/fm_task/fm_sort tokens, sets a Herdr agents view sorted by group then status (needs-captain, problem, running, done), and places a new projected task at the end of its own group inside the parent block with the same single verified move as before. The watcher reconciles tags once per poll and a spawn tags its task at once; bin/fm-herdr-groups.sh also previews (plan), clears, and prints or appends suggested sidebar rows with a backup. The agents view helper needs python3. The only test-runner change is the serial weight hint for the new suite. * docs(herdr): record the live lab check of project groups The four hand checks for tags, the sorted agents view, placement at the end of the group, and clear passed against a real Herdr 0.9.5 server (protocol 22) in a guarded lab session. * docs(herdr): align project group verification notes with the live check
…guid#7410) ps -o lstart= renders in the caller's locale, so a lock or claim owner recorded under one locale (de_DE renders "Di Okt 13 ...") failed identity verification under another, was declared dead, and a second worker split the queue: two serve loops reclaimed and reaped each other's live jobs, which vanished mid-claim and failed staged jobs with exit 125 and no output. Pin LC_ALL=C in fm_remote_job_process_start and pin the cross-locale invariant with a regression test. Co-authored-by: researchworldwide2026 <[email protected]>
* Guard fm-crew-state overrides by task-name basename bin/fm-crew-state.sh honours FM_CREW_STATE_META_OVERRIDE and FM_CREW_STATE_STATUS_OVERRIDE only when the override's basename is the requested task's own .meta or .status file name. An override naming a different task, for example one inherited through a server started inside another task's snapshot child, falls through to the task's own records under the state directory. A snapshot's own override, which names the task it was captured for, is still honoured. This is complementary to kunchenguid#5622, which keeps the overrides out of the Herdr server launch: whatever path leaks an override, the reader never trusts one that names a different task. Regression tests cover a mismatched override being ignored and a matching one being honoured. * no-mistakes(review): Make metadata override tests behaviorally distinct
…kunchenguid#7415) * fix(bin): re-anchor a Claude session's lock so /clear keeps ownership A same-session confirmation over a live lock line 1 outside the current harness ancestry now rewrites line 1 to the session's CLAUDE_PID anchor under the claim lock, so a later /clear re-key in the same process is still proven by ancestry instead of being refused as a foreign owner. Fixes kunchenguid#6820 * fix(bin): move task leases with a session-lock re-anchor A same-session re-anchor rewrote lock line 1 off a live pid while task leases still named that pid, so a lease held by main or the supervision branch read as stale and the other actor could claim the task. The re-anchor now takes the lease-command lock after the claim lock and, in the same critical section as the line-1 write, rewrites leases recorded against the old pid to the new anchor (fm_lease_rekey_holder). If the lease-command lock stays busy past a short bound, the confirmation keeps line 1 as before and a later acquisition re-anchors. The foreign-owner reproduction now asserts the re-anchor contract: the same trusted id from a live process outside the owner's ancestry moves line 1 onto that process's CLAUDE_PID, and a different id is refused against it afterwards. The ancestry membership loop is shared through one session-lock lib helper. The earlier commit dropped the ancestry suite's dead-front-end reclaim phase; that coverage lives in the existing reclaim tests (test_verified_reclaim_keeps_new_sidecar and the Stop auto-arm's test_reclaims_stale_session_lock_before_arming). * fix(bin): record the lock holder for a lease pinned before a re-anchor The supervision host pins FM_LEASE_HOLDER_PID to lock line 1 at the start of each engine turn. A same-session re-anchor inside that turn moved line 1 to a new pid while the pinned holder stayed alive, so a later claim or same-actor refresh in the turn recorded the old pid and the lease read stale, letting main claim the branch's task. A claim now records the live line 1 when the pinned holder is alive but is no longer line 1. Another session takes the lock only from a dead owner, so that state comes from a re-anchor; a dead pin is still recorded as before and its lease stays stale. * no-mistakes(review): Move auto-arm rewake session pid with lock re-anchor * no-mistakes(review): Align startup-network downgrade test and lock-rewrite comment * no-mistakes(review): Correct lock takeover and re-anchor signal-window comments * no-mistakes(review): Record re-anchor rewake and pinned-claim verification evidence * no-mistakes(document): Update network-checks diagnostic for re-anchored lock holder
* feat(bin): watch a tool's published version through version_url A watched tool whose CLI never announces its own updates can name a version_url; the document is fetched read-only inside the probe bound, its first dotted number is the published version, and an update is reported when that is newer than the version PATH resolves. Claude Code is the shipped example entry. * no-mistakes(review): Compare published versions against newest installed tool copy * no-mistakes(document): Clarify watched-tool version URL documentation
…mand loads them (kunchenguid#7287) * fix(pi): keep a live session's extension markers when a nested Pi command loads them A short-lived Pi command started from inside a live session, such as the `pi --help` capability probe, auto-loads the two primary extensions. Both treated the session lock as owned because an ancestor holds it, so the child rewrote `.pi-watch-extension-loaded` and `.pi-turnend-extension-loaded` with its own pid and exited. Session start then rejected the markers and printed a false `PI_WATCH_EXTENSION: not loaded` alarm. Before writing, each extension now reads the marker's pid and leaves the marker untouched when that pid is a live strict ancestor of the current process. A missing marker, a dead pid, the current pid, or a live pid outside the ancestry still writes as before, so a fresh start and a relaunch over a dead session bind unchanged. Lock ownership and the reader are untouched. Fixes kunchenguid#5202. * fix(tests): drop apostrophes from the nested-load marker heredocs so stock Bash 3.2 parses them
* fix(bin): supersede an orphaned Claude auto-arm claim after a session restart
An auto-arm claim is open only while its owner still descends from the session-lock pid.
A hook whose session exited mid-cycle stays alive with no parent to receive its exit 2, so deferring to its claim left the home unsupervised until the next session turn.
The replacement session's first Stop now takes the next generation, attaches to the running watcher, and delivers the wake itself, while the orphan goes silent.
A claim with no readable numeric session lock is never open.
* no-mistakes(review): accept pid-1 ancestor and session-id-matched autoarm claims
* no-mistakes(review): pin autoarm session-id claim signal to lock holder pid
* no-mistakes(review): exercise real lock recovery in orphan supersession tests
* no-mistakes(review): record lock-holder pid-identity instead of bare pid
* no-mistakes(document): complete autoarm claim-open coverage list
* no-mistakes(ci): Greptile finding ci-1 (hidden session-lock dependency in bin/fm-wake-lib.sh) fixed. Invariant: every function fm-wake-lib.sh calls must either be defined in that file or explicitly loaded by it before the call, so a caller sourcing only the wake library cannot silently degrade. Violating sites in the changed area: fm_autoarm_claim_open's fm_session_lock_recorded_session_id call, and the sibling writer fm_autoarm_claim_next's fm_session_lock_trusted_session_id call (which would otherwise silently omit the two new ledger fields). Both fixed at one shared boundary: a new lazy loader _fm_wake_require_session_lock (bin/fm-wake-lib.sh:38), matching the file's existing _fm_wake_require_classify/_fm_wake_require_timeout idiom, invoked immediately before each call. Lazy rather than top-level source so the ~40 scripts sourcing the wake library pay no harness-identity machinery cost; no circularity (fm-session-lock-lib.sh sources only fm-cursor-lib.sh). No new behaviour, state, or fallback. Verification: sourcing only fm-wake-lib.sh, a claim with broken ancestry plus matching sidecar id and matching recorded lock-holder identity now reads OPEN and the session-lock library is loaded on demand; ordinary descent path unaffected. Suites tests/fm-claude-stop-autoarm.test.sh, tests/fm-turnend-guard.test.sh, tests/fm-wake-queue.test.sh all pass; shellcheck -S warning reports only the pre-existing SC2034 present on HEAD. tests/fm-session-lock-ancestry.test.sh fails its final case ("the pty-host was not reparented to init after the daemon ended") identically with the change reverted, so that failure is a pre-existing WSL environment behaviour, not caused by this fix
* no-mistakes(document): Clarify auto-arm claim documentation
) * wip: polytoken worker adapter (detection, launch, wiring, control, composer; tests mid-iteration) * feat: verify the polytoken worker adapter (crewmate + scout) Add polytoken 0.8.19 as a verified crewmate/scout adapter on the captain-approved TUI-pane-plus-REST hybrid: the pane keeps inspection and backend parity while the control verbs ride the session daemon's typed REST API. Detection is ancestry alone on the anchored polytoken comm (a tool subprocess's parent is the session daemon, verified live), with the launch boundary clearing every foreign ORCA_/FM_ marker plus the fixed harness-identity set. The launch generates the per-task worker config dir (mirrored operator config with the unattended permission posture enforced, because a project config.yaml fully replaces the global config), the worker role-contract facet (no model pin, delegation and facet switching denied at the tool registry), and the worktree hook layer binding the verified busy pair - pre_user_prompt and pre_model_turn open, stop closes - to a no-argv generated writer. The readiness gate binds the session id, port, and credential into task metadata through sessions --format json and fails loudly on any first-start dialog, because the license terms are a blocker by captain decision and --accept-license-terms is never passed. Interrupt is POST /turn/cancel with its typed settle (the TUI has no interrupt chord, so no key is ever improvised), exit is /quit, and a cancelled turn's busy close is written by the control plane because no stop hook fires. The composer is the verified separated shape with polytoken as its second owner, and Enter mid-turn queues, so the busy-queued conversion applies. Crewmate and scout only: a secondmate launch is refused, and a project's own .polytoken/hooks.json is refused rather than clobbered. * no-mistakes(review): Fix polytoken launch flag order, token argv, live guard * no-mistakes(document): Correct polytoken REST doc comment and token-on-stdin invariant * no-mistakes(lint): Silence intentional SC2016 in polytoken live guard treehouse shim * no-mistakes(review): Retire polytoken pool wiring, drop FIFO config, test env clearing * no-mistakes(review): Scope polytoken teardown wiring removal to untracked polytoken files * no-mistakes(review): Refuse existing polytoken hook layer before writing any wiring * no-mistakes(document): Note teardown as consumer of harness wiring-path table * no-mistakes(review): Retire only firstmate-generated polytoken worktree wiring * no-mistakes(review): Guard polytoken hook layer before relaunch cleanup arms * no-mistakes(document): Note relaunch also skips git-tracked wiring paths * test: stub polytoken in the refused-relaunch fixture The refused relaunch onto polytoken resolves the polytoken binary before its hook-layer refusal, so the case failed on CI hosts without the real CLI installed. A no-op stub on the fixture PATH stands in; it is never launched. * no-mistakes(review): Guard polytoken interrupt close; refuse whitespace hook paths * no-mistakes(review): Snapshot busy record after cancel settles before idle close * no-mistakes(review): Guard interrupt close with pre-cancel snapshot and sync recheck * no-mistakes(test): Clear inherited AGENT at the polytoken launch boundary * no-mistakes(document): Document guarded polytoken interrupt close and whitespace refusal * test: preserve Polytoken hook refusal coverage with explicit pins * no-mistakes(review): Refuse invalid Polytoken relaunch profiles before stopping the worker * no-mistakes(document): Document Polytoken relaunch refusals before stopping the worker * fix: scope worker wiring cleanup to Polytoken * fix(bin): point Polytoken workers away from tool_flow for the task directory Polytoken 0.9.0 offers no launch-time path grant: tool_flow's file_read refuses the Firstmate task directory while the direct file tools reach it under the generated bypass matcher. The worker facet now says so, and the verification record carries the live evidence. * fix(bin): leave the pool as found when a fresh spawn fails A fresh spawn that fails and leaves no task record now closes the endpoint it opened before its launch was delivered, so the shell whose treehouse get leases the slot ends and the pool gets the slot back. It also removes the harness wiring, task temp root, and staged launch file it wrote, and drops its slot claim under a retaken project lock after metadata publication. * no-mistakes(review): Stop pre-launch refusals pointing at windows abort cleanup closes * fix(bin): scope failed-spawn cleanup and the Running-for busy row to Polytoken The failed-spawn pool cleanup and the Running-for busy row now apply only to Polytoken, so every other harness keeps main's abort behavior, header text, operator messages, and harness-less busy union. Tests prove the Polytoken path cleans up and a non-Polytoken refused launch behaves as on main. * no-mistakes(review): Scope submit-core busy reads to Polytoken pane identity * no-mistakes(review): Stop polytoken treehouse isolation refusal pointing at closed window * test: track the spawned window in the Polytoken harness tmux stand-in Main now requires exact tmux window membership before sending keys (aa9ab04), and the Polytoken harness stand-in listed no windows, so the merged spawn could never deliver Enter. Record the created window, list it, and forget it on kill, as tests/fixtures.sh does. * no-mistakes(document): Scope fresh-endpoint abort comment to Polytoken spawns * no-mistakes(ci): Lint 1 (ci-3) was caused by this PR, and I fixed it. Commit d18014e added the in_polytoken_submit_pane() subshell helper to tests/fm-polytoken-harness.test.sh. That helper sources bin/fm-tmux-lib.sh without the `# shellcheck source=/dev/null` line that every other source in the file carries (lines 55-63 and 200). With --external-sources, ShellCheck followed the library into the subshell and flagged `local pid=$!` at line 690 as SC2031. The fix is that one missing line, added above the source at line 318. After the fix, `shellcheck -x` reports nothing on the file, `bin/fm-lint.sh tests/fm-polytoken-harness.test.sh` passes with full extended analysis, and the Polytoken harness test passes. Behavior portable serial 2 (ci-1) and serial 5 (ci-2) failed in timing-sensitive tests this PR does not touch, so I made no code change for them. I reran both test files in full on this branch on macOS, and both passed (rc=0, no failures). tests/fm-supervision-host.test.sh passed, including the 'host-only transition veto changed Pi's existing offer rule' check that failed in CI. tests/fm-remote-secondmate-lifecycle-e2e.test.sh passed, including 'watch liveness: a dead remote secondmate is auto-relaunched on its own host with one wake'. Main's own recent CI runs (38950070853, 38719784765) also failed on different timing assertions in these serial shards. Together that points to runner flakes rather than a defect in this change * no-mistakes(review): Retake per-id spawn lock before Polytoken abort deletions * no-mistakes(document): Document per-id lock guard on Polytoken abort cleanup --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ne (kunchenguid#7450) Port the reported-check fallback and regressions from df60538. Preserve required-only reporting when required checks exist and refuse failed fallback reads.
* fix(tests): clean read-only relaunch fixtures Use the shared fixture cleanup so generated read-only Git hook directories do not leave permission errors and temporary trees behind. * fix(accounts): support durable per-secondmate account pins Resolve optional primary-home secondmate account files through the worker pin parser and checks. Preserve existing defaults when no override exists and re-read the selected pin on spawn, relaunch, and recovery. * no-mistakes(review): Name the rejected pin file in account refusals * no-mistakes(document): Document per-secondmate account pins in relaunch and layout docs
…unchenguid#6958) * feat(watch): consult opt-in operator guards before a wedge escalation Add config/wedge-evidence-guards, an opt-in list of operator-owned guard executables that the watcher's at-threshold wedge branch consults after the wait evidence, worktree-write probe and dead-endpoint probe. A CRITICAL answer defers one window at a time, capped by FM_WEDGE_GUARD_DEFER_MAX consecutive deferrals recorded beside the other wedge-window records, and the escalation that ends a capped run names the guard and its reason. Timeouts, failures, malformed output, UNKNOWN and WARNING fail open, and an untrusted config or guard is never run. With the config absent the ladder is unchanged. Refs kunchenguid#6919 * no-mistakes(document): Document wedge-evidence-guards in home layout index * no-mistakes(document): Align jev-guards CRITICAL verdict with bounded deferral
…guid#7460) * fix(bin): make the brief's inbox listing succeed on an empty inbox The worker brief told crewmates to list the inbox with a bare *.msg glob. On an empty inbox that glob fails: bash ls exits 2 and zsh aborts with 'no matches found'. Use find piped to sort -V so the listing is silent on an empty or absent inbox and keeps numeric order past 999. Refs kunchenguid#7244 * no-mistakes(review): Make relaunch note inbox listing safe when empty
…unchenguid#7394) * fix(bin): fit remote second-mate convergence inside the startup network bound The deferred startup network stage (120s) timed out once four second mates were remote: the mates already converge concurrently, but each mate's inheritance push sent its fifteen allowlisted items one SSH round trip after another, so a single mate's convergence took 64-76s after a ~16s liveness pass. - fm-remote-inherit-push.sh validates and snapshots every item locally first, so a local refusal now sends nothing, then sends the items up to FM_REMOTE_INHERIT_PUSH_JOBS (default 4) at a time and replays their output in allowlist order. A failed item still fails the push with its own error, and no further item is started after it. The receiver is unchanged: each item is its own file and generation record, and the host's job worker still runs one home's commands one at a time. - fm-bootstrap.sh gives each remote mate's convergence its own budget, FM_SECONDMATE_CONVERGENCE_TIMEOUT (default 75s). A mate whose sync or push hits it is reported as that mate's SECONDMATE_SYNC skip and keeps its retry marker, instead of holding the whole stage past its bound. * fix(bin): nudge a remote second mate to re-read only when something changed Each remote convergence attempt records its retry marker before it starts, so a sweep cut off by the startup network bound or failing before any change left a marker that made the next session start nudge every remote mate even though its instructions and inherited files were unchanged. The marker now records whether a re-read is owed, set only once an attempt actually changed the home, and a tracked-file sync that moved nothing under AGENTS.md, bin/, or .agents/skills/ no longer counts as a change. * fix(bin): keep a remote mate's re-read owed when its convergence is cut short A convergence step stopped by the per-mate budget loses its output, so a push that had already applied an item reported nothing and left the retry marker with no re-read owed; the next start then saw every item unchanged and never told the mate to re-read. A step cut off by the budget now marks the re-read owed, and so does a failed push whose output shows items it had already pushed or removed. The lifecycle e2e suite runs every remote leg through the real entrypoint and job worker on the test machine, so it now gives convergence ample time; the budget's own behavior is pinned in fm-bootstrap-network-parallel, whose budget and failure cases are also made independent of machine load. * no-mistakes(review): Keep re-read owed on partial or unknown completion * no-mistakes(review): Persist owed re-read when killed mid-mutation * no-mistakes(document): Fix stale remote re-read owed docs * test: send inherited items one at a time in the remote lifecycle e2e fixture Behavior portable serial 5 failed on the watcher auto-relaunch leg of tests/fm-remote-secondmate-lifecycle-e2e.test.sh after the inheritance push started overlapping its sends. Across 14 recent main CI runs that suite's remote-spawn leg took 30.8-35.6s and the watcher leg 27.3-34.5s, already close to its 30s wait; on the PR run remote spawn took 42.1s, well outside that range, while legs that push nothing were only 5-10% slower. The watcher relaunch is a remote spawn, and the only changed code on that path is the inheritance push. This fixture's transport has no network latency and its job worker runs one home's commands one at a time, so overlapping sends cannot hide any round trip there and only add submission overhead to every remote spawn. The suite now sends one item at a time, as it did before; the overlapped scheduler stays covered by tests/fm-bootstrap-network-parallel.test.sh, and the production default of four is unchanged. The watcher leg's failure now also prints the watcher's output. * no-mistakes(document): Clarify remote re-read obligations and consolidate documentation * fix(bin): record a remote mate's re-read as owed before convergence can change its home A live run against a real remote second-mate home showed the owed re-read still lost when the startup network bound stopped the stage. That bound stops it the way `timeout -k 1` does: TERM to the stage's process group, then KILL one second later. Bash defers a TERM trap while the convergence worker waits in a command substitution, and the remote call runs in its own timed process group, so the KILL landed before the trap could record the re-read. The remote home had already applied the change, the next start saw every item unchanged, sent nothing, and deleted the marker, so the mate was never told to re-read. Bootstrap convergence and config-push now write the record owed before any remote step can change the home, and write it back only after the attempt has reported: removed after confirmed unchanged convergence or a successful send, and back to owed=0 when a failed attempt's outcome proves nothing changed. A kill at any point therefore leaves the re-read owed. The TERM/INT traps are gone. The kill regression now sends TERM and then KILL one second later, as the startup bound does; it fails on the previous head and passes here. * no-mistakes(document): Clarify convergence timeout scope and consolidate reread documentation
…d#6987) * fix(bin): refuse spawn into a project with an unborn HEAD Spawn into a repository with no commit waited 60s for treehouse and then reported that the worktree was the spawning project itself, never naming the cause. Refuse before the wait and name the unborn HEAD and the remedy. The project-management skill now states that a new local repository needs a first commit. * docs(skills): tell the captain a new project needs a first commit The Create a project step no longer reads as firstmate committing into the project. It states that spawn refuses an unborn HEAD and that the captain is told the project needs a first commit. * test: give spawn fixtures a first commit for the unborn-HEAD refusal * no-mistakes(review): Commit foreign consent fixture so spawn guard passes
…log items for GitLab MRs (kunchenguid#7462) * feat(bin): add an attended GitLab --allow-no-pipeline merge waiver A GitLab repository that deliberately runs no merge request pipeline could never be merged through fm-pr-merge.sh: the guard requires a successful head pipeline at the current head, and GitLab has no per-check waiver. --allow-no-pipeline waives only the pipeline condition, and only when GitLab reports head_pipeline as present and null. A failed, running, canceled, or stale pipeline still refuses, every other condition (open, mergeable detailed_merge_status, no conflicts, discussions resolved) still holds, and the verified head is still passed to glab as --sha. The flag is attended-only (refused while the away-posture record exists), GitLab-only, and takes no value; without it the default refusal is unchanged. * fix(bin): close a GitLab merge request task's backlog item with a note tasks-axi accepts a --pr link only as a GitHub or Forgejo pull request, so after a GitLab merge request landed, teardown could never complete the backlog Done transition and left the close pending forever. Extend the existing Gerrit carve-out in fm_backlog_done and fm_backlog_retain, and the captain-hold answer replay that shares it, to record a GitLab merge request URL as a "GitLab merge request <url>" note, until tasks-axi accepts GitLab merge request URLs. GitHub and Forgejo pull requests are still recorded as pr links. * no-mistakes(document): Note GitLab --allow-no-pipeline waiver in merge-watch record
… work (kunchenguid#7352) * feat(bin): add opt-in config/spawn-base-primary-checkout for local landings A fresh pooled task worktree is reset to origin/<default>. A local-only project lands work on the primary checkout's default branch through fm-merge-local.sh and never pushes, so that ref stays frozen at the last push and every fresh task starts behind work already landed, loading the project's instruction files from the stale tree. The always-on fix proposed in kunchenguid#3812 replaced the specified origin-only refresh for every home; this rework keeps that rule as the default and moves the new base behind an explicit, default-off presence flag, following the existing config/<flag> pattern. With config/spawn-base-primary-checkout present: - fm-spawn.sh starts a fresh local-only ship, or a scout without --base-branch, from the primary checkout's <default> when it strictly contains origin's tip. Publishing modes and named base branches keep origin's tip, because that work is delivered against origin. A diverged primary keeps origin's tip and prints a note counting both sides. The commit is read from the local object store, so nothing extra is fetched, and the clean-slot refusal still runs first. - fm-review-diff.sh anchors a remote-backed task without base_branch= on the branch it delivers to: publishing modes stay on origin/<default>, while a local-only ship or a scout is compared against whichever of the local <default> and origin/<default> meets the branch later, so the review shows the task's own work instead of every locally landed commit. - fm-promote.sh tells a scout promoted to a publishing mode to return to origin's default branch, because in this home the scout may have started from the primary checkout's branch, whose unpushed commits would otherwise be published with the work. fm-dod-lib.sh gains fm_mode_publishes as the one predicate those three readers share. Without the flag every path is unchanged: the spawn resets to origin's tip, the review anchors on origin/<default>, and promotion keeps its wording; the existing tests run unmodified. Treehouse 3 (verified on 3.1.3) already hands a slot out at whichever of the local and remote default branch is further ahead, so with the flag the refresh keeps that slot where Treehouse put it for a local landing instead of rewinding it, and a project without origin is untouched as before. Supersedes kunchenguid#3812. * no-mistakes(document): Drop change-relative wording from spawn-base config docs * no-mistakes(ci): The Greptile Review check failed on two review findings, not on a broken build or test. I fixed both as the user directed, and the tests and lint pass. ci-1 (bin/fm-promote.sh): promotion must name origin's default branch only when spawn could actually have started the scout from the primary checkout. Spawn does that only when the project has an origin remote and is recorded on the task. Before this fix, the opt-in flag alone made promotion to no-mistakes or direct-PR say "copy of origin's default branch...", even on a project with no origin. - The new wording now also requires a recorded project (`[ -n "$PROMOTE_PROJECT" ]`) whose `git remote get-url origin` succeeds. That is the same check bin/fm-review-diff.sh already makes. The empty-project guard is needed because `git -C ""` would run in the current directory. Otherwise the existing "default-branch base" wording stays. - The three places that read the flag now agree: spawn, review-diff and promote. - I updated the header and inline comments in fm-promote.sh, and the promote line in docs/configuration.md, to say this applies only to a project with an origin remote. - Test: `test_promote_names_origin_for_a_publishing_mode_in_an_opted_in_home` in tests/fm-task-delivery.test.sh now records a real `project=` with a registry entry, and covers flag on/off × origin/none × direct-PR/no-mistakes/local-only. Only flag on + origin + a publishing mode gets the new wording. The named-base case is unchanged. - Before the fix, the test fails with "not ok - flag on, remote none, direct-PR: the promotion changed the default-branch wording". With the fix, it passes. ci-2 (tests/fm-spawn-pool-base-freshen.test.sh): with the flag set, both publishing modes must start from origin's tip and print no divergence note. - The opted-in spawn test now covers no-mistakes as well as direct-PR, local-only and scout. - The expectations no longer single out direct-PR. Both publishing modes now expect origin's tip, no "note: pooled worktree", and a review anchored at the slot's start, in the leading, diverged and trailing cases. Verification: - `bash tests/fm-task-delivery.test.sh`: exit 0. - `bash tests/fm-spawn-pool-base-freshen.test.sh`: exit 0. - `bin/fm-lint.sh` on the three changed shell files: exit 0 (ShellCheck 0.11.0, pinned, with extended analysis)
…enguid#7915) * fix(teardown): distinguish unavailable content-landed proof * no-mistakes(document): Clarify teardown proof failure documentation * no-mistakes(ci): Captain, CI failed in unchanged watcher recovery code, independent of this PR. The focused failing case passed locally with exit 0. The full suite stalled earlier and was stopped. No tracked changes. Command guard rejected cleanup; scratch remains at .ci-7915/ and tests/.ci-7915-cycle.sh * chore: untrack CI validation scratch
…kunchenguid#7876) * feat(dispatch): prefer configured provider family * no-mistakes(review): drop policy_why field and dead auth fixture from preference tests * no-mistakes(document): docs: record preferred_provider in schema, diagnostics, verification
) * fix: pin local-only landing to its accepted done head Persist the accepted local-only commit in task metadata and refuse landing when the branch or the recorded head changes. Merge the full commit ID under the task control and metadata locks. Closes kunchenguid#7782 * no-mistakes(test): Refuse local landing races with atomic ref transactions * no-mistakes(document): Document pinned local landing and recovery contracts * no-mistakes(ci): Applied only the verified incremental patch and preserved existing repairs. Complete diff matches the supplied candidate hash. Both focused test files, default lint, and source-aware lint passed with exit 0. Evidence retained at /tmp/up7782-local-repair/ci-phase-fresh-*. No commits, pushes, or pipeline-control actions performed; publication remains with the outer executor * no-mistakes(ci): Fixed both SC2031 false positives in tests/fm-merge-local.test.sh with narrowly scoped suppressions. Tier 2 lint correction; runtime changes were unnecessary. Default lint, source-aware lint, all 8 focused tests, and git diff --check passed. No commits, pushes, or pipeline-control actions performed
…henguid#7928) * fix(procevent): coalesce unhandled extension host errors * no-mistakes(document): Document host-error coalescing and recovery semantics
…uid#7912) * fix: stop wake grants when lock acquisition fails * no-mistakes(document): Document wake grant lock acquisition failure behavior
* fix: send remote steers over stdin * fix: version remote stdin send protocol * no-mistakes(document): document stdin transport for remote steer in fm-send header * no-mistakes(ci): Two tests failed in CI. One is caused by this PR; the other is not. 1. Behavior portable serial 5: `tests/fm-secondmate-reconcile.test.sh` failed with "supervision did not deliver the durable reconcile request later". This PR caused it. The PR now sends a remote steer's body on stdin, using `fm-on.sh --stdin` with the `send-stdin` verb. This test's fake ssh started with `cat > /dev/null`, so it threw the body away before it ran the real `fm-remote-secondmate-control.sh`. `cmd_send_stdin` then read an empty message, died with "remote steer message must be nonempty", and no inbox record was written. Rule that broke: a fake ssh that runs the real remote leg must pass the caller's stdin through, as real ssh does. I checked every fake ssh that runs the real leg. `fm-send-remote-delivery.test.sh` already passes stdin through. `fm-secondmate-sync.test.sh` (`make_remote_leg_ssh_stub`) had the same discard line. The stub in `fm-send-resolve-key.test.sh` never runs the leg, so it is fine. The fix deletes the `cat > /dev/null` line in the reconcile and sync stubs. Calls made without `--stdin` still get /dev/null from fm-on, so nothing else changes. Checks run locally: the reconcile test fails before the fix with the same CI message. After the fix, the reconcile test passes (rc=0) and the sync test passes (rc=0). 2. Behavior portable serial 3: `tests/fm-wake-queue.test.sh` failed in `test_concurrent_append_and_drain` with "wake drain: queue lock could not be acquired safely". This PR did not cause it. The PR does not touch `bin/fm-wake-drain.sh`, the wake tests or the wake helpers. The failure is lock contention: 40 appenders run at the same time as a drain, on a loaded CI runner. Locally the whole test passed (70 ok, rc=0). I made no change for it. It is an existing flake in wake-queue lock acquisition and needs its own fix outside this PR. Open PR kunchenguid#7912 ("preserve wake grants when queue-lock acquisition fails") works in the same area
…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
…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 <[email protected]>
…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 <[email protected]>
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 <[email protected]>
…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 <[email protected]>
* 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 <[email protected]> Co-authored-by: Pitch Perfekt Collective <[email protected]>
… 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
…squash-synced into the fork (#15)
Reconciles 91 new upstream commits with the fork's 52; see PR body for conflict resolutions.
The upstream merge reintroduced upstream behavior over several fork designs and dropped fork-only fixture pieces, failing the portable behavior jobs on the sync branch. - lease and session-lock libs: restore the fork pin contract and tagged win: holder handling instead of kill -0 liveness. - spawn: restore the fork's generic Kimi trust-dialog wording. - watch: keep the upstream handling-successor resurface, but bound its wake-queue waits and defer on a live holder like the other branch. - watch-arm: release the snapshot locks on every poll while an interrupted take-over waits for its watcher, so a late bounded-helper handoff cannot strand the watcher's cleanup. - tests: restore dropped fixture helpers and libs, match the fork's quiet checkpoint exit, queue a row for the silent takeover case, and let the interrupted take-over fixture tolerate the successor winning the queue lock.
… local checks pass on the final code. The five changed files are uncommitted in the worktree; I did not commit or push them. This replaces my earlier result, which reported the final lint run as unknown. Changes: - `bin/fm-lint.sh`: `--partition` accepts KofN for N >= 1 and 1 <= K <= N. It refuses 0ofN, K>N, N<1, leading zeros, malformed values and integers past the shell range, with exit 2. Packing uses N bins with the same greedy least-loaded rule, and ties go to the lowest bin. Error and help text are updated. - `tests/fm-lint.test.sh`: the 1of3 refusal is replaced with runs of 1of3, 2of3 and 3of3. It also checks that the N parts cover every canonical root exactly once for N=2 and N=3, and adds more refusal cases. - `.github/workflows/ci.yml`: lint matrix is `[1, 2, 3]`; timeout-minutes stays 30. - `CONTRIBUTING.md`: adds the `Lint 3` context. - `docs/fm-test-portable-shards.md`: now says three lint partitions and twenty-one jobs. One addition goes beyond the literal scope. A partition with no roots (K above the root count, such as 9999of10000) crashed on an unbound `ROOTS`. Accepting any N makes that input reachable, so I fixed it: it now prints a note, runs the non-ShellCheck checks and exits by their result. The test file covers this case. Evidence on the final code: - `/bin/bash tests/fm-lint.test.sh`: rc 0, 50 ok, no `not ok`. - `/bin/bash tests/fm-ci-workflow.test.sh`: rc 0. - `bin/fm-lint.sh`: rc 0, in changed-file mode, so this is not a full canonical lint. - Assignment for 1of2 and 2of2: identical to the old two-bin formula, compared over the same current weights. This was a local check and is not a committed test. The edit changed byte weights, so the lists can differ from those taken before the edit. - Split at 3 bins: 195, 195 and 196 roots. Not verified: - CI on the new head, so whether three partitions finish under 30m is unproven. - The `Full suite` log. Its failure is attributed to the cancelled `Lint 2` from timing only. Decisions for you: - If a branch ruleset on the fork lists `Lint 1` and `Lint 2`, add `Lint 3`, or the new job is not enforced. I did not inspect the ruleset. - PR #50 has the same Lint 2 timeout and gets this fix only after it picks up this change
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 run, in-flight Firstmate open PRs: get the other open fork PRs #49/#50/#51/#52 moving, branches and PRs only, no merges. PR #52 (branch sync/upstream-2026-10-29, "Sync upstream kunchenguid/firstmate (b936f04, 91 commits) into fork") has 13 failed CI checks (Behavior portable parallel/serial jobs). PR #50 (branch fm/fm-pr-published-head-resync-2) has one failed check, Lint 2, after 30m. #49 and #51 are green and need nothing. Spend no Codex tonight.
What Changed
kunchenguid/firstmatemain throughb936f040(about 140 commits). New runtime backends: Rex, T3 Code and tern. New harnesses and adapters: Cortex Code, agy as a full primary and secondmate harness, OpenCode 2 plugins, and Pi repeated-read containment. New opt-in tools:fm-capacity.sh,fm-pr-health.sh,fm-usage-warner.sh,fm-record-export,fm-approval-failover.shand warm-cache compaction for the supervision host. The merge also brings dispatch-resolution provider options, wedge-escalation deferral and caps infm-watch, and the docs, skills and tests that go with these changes.b0c2bea8). Fork tests now send grouped-viewer tmux calls through the private socket.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The fix-round delta is a one-line control-flow change: on a second queue-lock timeout (124) after a committed
recoververdict, it records the deferral and still emits the rearm-resurface wake. This closes the lost-announcement path. The bounded lock wait stays, andwaketakes no wake-queue lock, so this adds no new unbounded wait.Testing
I ran the four targeted suites under stock macOS /bin/bash; each one starts the real bin/fm-watch.sh watcher against disposable state directories. watcher-lock, watch-arm and watch-recovery-loop passed in full, including the stand-down fix, the adversarial torn-down-directory exit, and the bash 3.2 re-append. I then ran the supervision-bounds cases one at a time. All passed, including the adversarial held-wake-queue-lock deferral. The exception was the doorbell 3s ring-bound check: it failed and passed the same way on base and head at load average 200-280. This is a CLI and shell change, so the evidence is the suite transcripts and there are no screenshots. Result: go. Remote CI is still the arbiter for the Behavior portable lanes on Linux.
Evidence: watcher-lock suite transcript (stand-down after successor exit; torn-down dir exits 1)
Source: watcher-lock suite transcript (stand-down after successor exit; torn-down dir exits 1)
Evidence: watch-arm suite transcript (handling successor / identical re-append under bash 3.2)
Source: watch-arm suite transcript (handling successor / identical re-append under bash 3.2)
Evidence: supervision-bounds per-case transcript (held wake-queue lock deferral and delivery)
Source: supervision-bounds per-case transcript (held wake-queue lock deferral and delivery)
Evidence: watch-recovery-loop transcript
Source: watch-recovery-loop transcript
Evidence: doorbell bound base-vs-head comparison
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 1 issue found → auto-fixed ✅
bin/fm-watch.sh:4148- In the handling-successor branch of resurface_after_downtime, fm_recovery_marker_arm_check has already durably rewritten the marker toannouncedand set action=recover (bin/fm-wake-lib.sh:1051/1103/1113) before handling_successor_has_queued_row runs. This change bounds that second queue-lock wait (fm_wake_queue_lock_acquire, which returns 124 after FM_WAKE_QUEUE_LOCK_WAIT). On 124 the code defers and returns 0 without callingwake. Concrete sequence: cycle N, arm-check marks the episode announced; a live process keeps .wake-queue.lock for more than 30s; the queued-row check returns 124; no wake is sent. Cycle N+1: arm-check readsannounced:downtime:*and sets action=wait (fm-wake-lib.sh:1083-1088), so this watcher never announces the episode. Only fm_recovery_marker_reopen_announced at the next watcher startup (fm-watch.sh:3979) reopens it, so the queued rows stay buried for the watcher's lifetime. Upstream waited without a bound here, so it always woke eventually. The deferral is safe only for the first arm-check, because nothing is committed before that lock is held. Fix: when handling_successor_has_queued_row returns 124 after arecoververdict, still callwake "check: rearm-resurface", which keeps the conservative upstream outcome. Another option is to drop the second check, because arm-check already confirmed a non-empty queue under the same lock in its non-quarantine branches.🔧 Fix applied.
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed (2) → no changes applied ✅
🔧 No changes applied.
2 issues (1 error, 1 warning) still open:
tests/fm-supervision-bounds.test.sh- Locally, several targeted suites still fail on timing bounds or concurrency checks: fm-supervision-bounds (doorbell ring bound), fm-wake-queue, fm-watcher-lock, fm-watch-checkpoint (timeout), fm-watch-arm and fm-supervision-host-hook. The failing check changes from run to run. The PR feat(bin): sync upstream kunchenguid/firstmate through b936f040 into the fork #52 CI run before the fix did not report these checks. The host load average was 55–125 with 209 users, so this run cannot tell flakes from a real regression. The 124 path from the review fix in resurface_after_downtime was not reached, because fm-supervision-bounds stops at its earlier doorbell check. Rely on remote CI for the Behavior portable lanes on head 4a3eed5. You can also rerun the suites listed above on a quieter host.bash tests/fm-agy-primary.test.sh(pass)bash tests/fm-approval-failover.test.sh(pass)bash tests/fm-merge-local.test.sh(pass)bash tests/fm-pr-health.test.sh(pass)bash tests/fm-session-lock-ancestry.test.sh(pass, 41 ok)bash tests/fm-backend-tmux-smoke.test.sh(pass)bash tests/fm-watch-recovery-loop.test.sh(failed in the parallel run, passed when run alone)bash tests/fm-supervision-bounds.test.sh(failed in both runs on the doorbell ring bound: 24s, then 10s, against a 3s bound)bash tests/fm-watch-checkpoint.test.sh(failed in the parallel run; run alone, 29 ok and 0 fail before the 300s timeout cut it off)bash tests/fm-watcher-lock.test.sh(a different check failed in each run)bash tests/fm-wake-queue.test.sh(a different timing or concurrency check failed in each run)bash tests/fm-watch-arm.test.sh(9 ok, 1 fail: re-append not byte-identical; parallel run only)bash tests/fm-supervision-host-hook.test.sh(17 ok, 1 fixture fail; parallel run only)bash tests/fm-backend-orca.test.sh(6 ok, 0 fail, then hit the 1500s timeout; parallel run only)gh run view 40955412637 --log-failedto compare with the PR #52 CI failures from before the fix (head 905cd290)🔧 Fix applied.
3 issues (2 warnings, 1 info) still open:
bin/fm-watch.sh:4202- This bug came in with the upstream merge (cf577c7), and only macOS is affected. The teardown check[ ! /dev/fd/6 -ef "$STATE" ]is always true on macOS, because stat of /dev/fd/N returns the devfs device number, not the directory's device. A replaced watcher whose successor already exited therefore logs 'state directory was torn down' and exits 1, instead of standing down with exit 0. tests/fm-watcher-lock.test.shtest_watch_replaced_holder_stands_down_after_successor_exitsfails in 4 of 4 runs on this Mac, even at low load. The watcher was confirmed live to hold fd 6 on its state directory. Ubuntu CI is not affected. Decision: fix it in the fork (for example, compare inode and device withstat -Lor perl, not/dev/fd/6 -ef), or leave it for upstream.tests/fm-watch-arm.test.sh:1145- This bug came in with the upstream merge, and only stock macOS bash 3.2 is affected. The test'sdatestub writes${inherited_row%%$'\t'*}inside an unquoted heredoc. bash 3.2 does not expand$'\t'there, so the stub prints the whole row instead of the epoch, and the check 're-append was not byte-identical to the inherited row' fails every run (2 of 2). Ubuntu CI (bash 5) is not affected. Decision: patch the fixture in the fork (compute the epoch in a variable before the heredoc), or leave it for upstream.FM_SUPERVISION_BOUNDS_ONLY=test_watcher_defers_work_behind_a_held_wake_queue_lock bash tests/fm-supervision-bounds.test.sh(run twice, both ok)bash tests/fm-watch-recovery-loop.test.sh(all ok)Live race driver (race-driver.sh): real fm-watch.sh handling successor; a live holder takes .wake-queue.lock just after arm-check marks the episode announced, with FM_WAKE_QUEUE_LOCK_WAIT=2. Run twice on the fixed bin/ and once on a bin/ copy holding the pre-fix fm-watch.sh from 4a3eed59~1Reconcile-touched suites three at a time: fm-supervision-bounds, fm-watcher-lock, fm-wake-queue, fm-watch-checkpoint, fm-watch-arm, fm-supervision-host-hook, fm-session-lock-ancestry, fm-approval-failover, fm-merge-localReruns alone: fm-watch-checkpoint (earlier failure passed; 47 ok before the 540s cap), fm-wake-queue, fm-watcher-lock, fm-watch-armRantest_watch_replaced_holder_stands_down_after_successor_exitsalone twice with extra diagnostics (fails every time)Ran a disposable live watcher and checked withlsofthat fd 6 holds the state directory; ran[ /dev/fd/6 -ef DIR ]and the bash 3.2 heredoc$'\t'probegh pr view 52 --json headRefOid,statusCheckRollup(CI head is still 905cd290)🔧 Fix applied.
✅ Re-checked - no issues remain.
/bin/bash tests/fm-watcher-lock.test.sh(exit 0, all cases)/bin/bash tests/fm-watch-arm.test.sh(exit 0, 47 ok)/bin/bash tests/fm-watch-recovery-loop.test.sh(exit 0)/bin/bash tests/fm-supervision-bounds.test.sh(full run stopped at the doorbell timing check)FM_SUPERVISION_BOUNDS_ONLY=<case> /bin/bash tests/fm-supervision-bounds.test.shfor each of the 6 casesRan the doorbell case twice each on base 12f37598 and head 3e08d7f0 fromgit archiveexports, interleaved under the same load✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.