Skip to content
This repository was archived by the owner on Aug 25, 2026. It is now read-only.

fix: stop repeated wakes from merged PR polls - #79

Merged
JTInventory merged 6 commits into
mainfrom
fm/firstmate-adopt-phase1-932-0726
Jul 26, 2026
Merged

JTInventory merged 6 commits into
mainfrom
fm/firstmate-adopt-phase1-932-0726

Conversation

@JTInventory

Copy link
Copy Markdown
Owner

Intent

Port kunchenguid/firstmate PR kunchenguid#932 onto JTInventory/firstmate from current fork/main without merging origin/main. Stop repeated merged-PR wakes by queuing the exact merged notification durably before retiring only the validated canonical poll through an identity-bound, crash-recoverable receipt. Preserve task metadata, persistent secondmate lifecycle state, concurrent replacement polls, nonterminal/error/custom-check behavior, JT Herdr labels, the fork's task/PR branch identity checks, and the #77 Herdr lifecycle/event loop. Keep Herdr rewrites, secondmate relaunch kunchenguid#950, AFK kunchenguid#758, and quota dispatch out of scope. Validate the focused watcher/PR-check retirement matrix, teardown, task identity, and JT Herdr watcher behavior, then push and open a PR to JTInventory/firstmate.

What Changed

  • Queue merged-PR notifications durably, then retire only the identity-validated canonical poll through a crash-recoverable receipt while preserving task metadata and concurrent replacement polls.
  • Replace executable PR poll shims with validated static poll data, authenticate custom checks, migrate eligible legacy checks, and quarantine unsafe or reserved checks without executing them.
  • Update teardown, watcher locking, documentation, and behavior/security coverage for poll retirement and migration.

Risk Assessment

✅ Low: Captain, the prior custom-check and reserved X-watcher regressions are resolved, and the complete change now satisfies the stated preservation and retirement contracts without another substantiated issue.

Testing

The supplied full baseline, focused retirement and watcher-lock matrix, hermetic teardown/task-identity checks, JT Herdr event behavior, backend cleanup checks, and direct merged-PR lifecycle scenario all passed; the evidence shows durable exactly-once notification, identity-bound poll retirement, preserved metadata, and safe nonterminal behavior.

Evidence: Merged-PR retirement end-to-end evidence

Exact MERGED emitted one watcher wake, left zero poll artifacts, preserved task metadata, and created exactly one durable merged row. Open, closed-unmerged, malformed, and forge-error states remained armed.

USER_SURFACE first_watcher=check: /tmp/fm-pr-check-security.FZViyP/merged-retirement-once/home/state/task-a.check.sh: merged
USER_SURFACE poll_artifacts_after_merge=0
USER_SURFACE metadata_after_merge=window=fm-task-a;pr=https://github.com/o/r/pull/1;
USER_SURFACE second_watcher=check: /tmp/fm-pr-check-security.FZViyP/merged-retirement-once/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE durable_merged_rows=1
ok - validated merged polls notify once and retire before the next watcher cycle
USER_SURFACE open-green      poll_state=armed output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE open-red        poll_state=armed output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE closed-unmerged poll_state=armed output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE forge-error     poll_state=armed output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE malformed       poll_state=armed output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/z-stop.check.sh: stop-cycle
USER_SURFACE merged          poll_state=retired output=check: /tmp/fm-pr-check-security.FZViyP/external-merge-transition/home/state/task-a.check.sh: merged
ok - open/red, closed-unmerged, malformed, and forge errors remain armed until an exact merged transition
Evidence: Focused retirement, watcher-lock, and Herdr tests
FM_TEST_BEGIN 2026-07-26T15:12:42Z tests/fm-pr-check-security.test.sh family=pr-forge expected_gate_skip=none
ok - raw-byte parser accepts canonical URLs and rejects the complete adversarial matrix
ok - legacy custom checks stay armed without claiming the reserved X shim
ok - GitLab merge requests are followed on any instance and never wake falsely
ok - validated merged polls notify once and retire before the next watcher cycle
ok - merged poll retirement preserves every persistent secondmate lifecycle artifact
ok - queue, receipt, and every fixed-path removal crash point recover without loss or repeated execution
ok - open/red, closed-unmerged, malformed, and forge errors remain armed until an exact merged transition
ok - replacement, nonterminal, tampered, and custom results receive no deletion authority
ok - queue failure and untrusted receipts preserve canonical poll evidence
ok - GitHub and GitLab exact merged results share one retirement path
FM_TEST_END 2026-07-26T15:13:29Z tests/fm-pr-check-security.test.sh exit=0 duration_ms=46541 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:13:29Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - second watcher preserves an established live singleton
ok - killed watcher stale lock is reclaimed
ok - live watcher lock with stale heartbeat is actionable
ok - guard banner leads when down with pending wakes (re-arm-after-drain) and stays silent when fresh+live
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - live steal mutex is not reclaimed
ok - live-held lock is not stolen
ok - live-held lock with matching pid identity is not stolen
ok - live-held lock with mismatched pid identity is reclaimed
ok - live-held legacy identity remains protected during migration
ok - expired live-held legacy identity is reclaimed
ok - matching expired legacy watcher identity is migrated before expiry recovery
ok - live-held lock without pid identity remains live-held
ok - zombie follower lock is reclaimed using its stored process identity
ok - legacy zombie follower lock is reclaimed without new metadata
ok - fallback process identity includes stable process-group and command data
ok - fallback start identity accepts and distinguishes prior formats
ok - detach cleanup rejects legacy start tokens
ok - detached spawn waits for the target after exec
ok - detached spawn cleans the launcher after pid-file timeout
ok - detached spawn cleans the target after exec timeout
ok - legacy follower locks without home scope fail closed
ok - watcher health rejects a zombie lock owner
ok - watcher health rejects an unpinned legacy lock
ok - empty mid-acquire lock keeps a minimum grace
ok - late original claimant cannot claim a recreated lock
ok - paused mid-acquire claimant backs off to active stealer
ok - watch restart refuses to signal a reused pid
ok - plain arm fails closed on a reused-pid lock before PR-check migration
ok - watcher self-evicts when the lock pid no longer names it
ok - arm attaches to a live fresh watcher and exits only when that cycle ends
ok - arm migrates and attaches to a live legacy watcher lock
ok - arm rejects an unverified legacy watcher lock
ok - arm starts+confirms a fresh watcher on a clean lock and self-heals a dead-pid lock (never healthy off a dead pid)
ok - arm stands down on HUP while the detached watcher keeps its lock and beacon
ok - watcher survives SIGTERM of the arm's entire process group
ok - a healthy cycle keeps one attach waiter and duplicate arms exit without stacking
ok - restart hands off the follower slot without stacking waiters
ok - process start identity distinguishes same-second processes
ok - arm propagates an immediate watcher wake before confirmation
ok - arm attaches to a peer watcher after child stands down and exits when peer dies
ok - arm reports FAILED and exits non-zero when no fresh watcher can be confirmed
FM_TEST_END 2026-07-26T15:15:10Z tests/fm-watcher-lock.test.sh exit=0 duration_ms=101336 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:15:10Z tests/fm-task-identity.test.sh family=unclassified expected_gate_skip=none
ok - fm-pr-check refuses stale task metadata before recording a PR
ok - fm-pr-check records a PR when task id, branch, and PR head match
ok - fm-review-diff refuses stale task metadata instead of reviewing the wrong branch
not ok - teardown should refuse stale task metadata: expected exit 1, got 3
FM_TEST_END 2026-07-26T15:15:11Z tests/fm-task-identity.test.sh exit=1 duration_ms=953 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:15:11Z tests/fm-teardown.test.sh family=pr-forge expected_gate_skip=none
not ok - fork-allow: teardown should succeed when HEAD is on a fork remote: expected exit 0, got 3
FM_TEST_END 2026-07-26T15:15:11Z tests/fm-teardown.test.sh exit=1 duration_ms=161 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:15:11Z tests/fm-backend-herdr.test.sh family=backend-dispatch expected_gate_skip=none
ok - fm_backend_herdr_version_check: accepts the current protocol (14)
ok - fm_backend_herdr_version_check: refuses an old protocol loudly
ok - fm_backend_herdr_version_check: refuses loudly when herdr is not installed
ok - fm_backend_herdr_workspace_label: a primary home (no marker) resolves to 'firstmate'
ok - fm_backend_herdr_workspace_label: a secondmate home (.fm-secondmate-home) resolves to '2ndmate-<id>'
ok - fm_backend_herdr_workspace_label: trims whitespace around the marker's secondmate id
ok - fm_backend_herdr_workspace_label: an empty marker file falls back to the primary label 'firstmate'
ok - fm_backend_herdr_workspace_label: two different secondmate homes get two different, non-colliding labels
ok - fm_backend_herdr_cli: sets HERDR_SESSION AND appends a trailing --session flag on every call
ok - fm_backend_herdr_container_ensure: version-gates, starts the server, ensures the firstmate workspace, echoes session:workspace_id + the seeded default tab id
ok - fm_backend_herdr_container_ensure: reuses an existing firstmate workspace without recreating it, and reports no seeded default tab (adopted, not created)
ok - fm_backend_herdr_container_ensure: workspace create passes --no-focus
ok - fm_backend_herdr_container_ensure: creates the workspace under the SECONDMATE home's own label, not 'firstmate'
ok - fm_backend_herdr_create_task: prunes exactly the seeded default tab container_ensure identified, once the first real task tab exists
ok - herdr repeated spawn/teardown: one persistent firstmate workspace reused, zero orphans, default tab pruned, create ran once
ok - fm_backend_herdr_create_task: an ADOPTED workspace's pre-existing tab is never pruned (the created-vs-adopted gate)
ok - fm_backend_herdr_create_task: the label-collision startup-workspace scenario (2026-07-02 incident) leaves the captain's live tab untouched
ok - fm_backend_herdr_workspace_prune_seeded_default_tab: refuses to close the seeded default tab when its pane reports a working agent (defense in depth)
ok - no bin/ jq filter names a --arg/--argjson variable after a jq reserved keyword
ok - fm_backend_herdr_create_task: refuses a duplicate tab label (herdr's own tab create has no uniqueness check)
ok - fm_backend_herdr_create_task: a same-labeled tab with a live (even idle) registered agent still refuses exactly as before
ok - fm_backend_herdr_create_task: scans every same-labeled tab and refuses if any duplicate is live
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is dead (pane_not_found)
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is alive but hosts no registered agent (a restored plain shell)
ok - fm_backend_herdr_create_task: closes every confirmed same-labeled husk only after creating the replacement
ok - fm_backend_herdr_create_task: refuses success when a preexisting husk tab remains after replacement
ok - fm_backend_herdr_create_task: refuses (fail-safe) rather than guessing when the duplicate's agent state cannot be classified confidently
ok - fm_backend_herdr_create_task: creates the replacement tab BEFORE closing the husk t

... [5818 bytes truncated] ...

backend_herdr_composer_state: reports unknown when the pane cannot be captured
ok - fm_backend_herdr_composer_state: reports unknown for bare shell prompts with no composer row
ok - fm_backend_herdr_composer_state: a native idle Pi separator composer reads empty
ok - fm_backend_herdr_composer_state: real Pi composer text remains pending
ok - fm_backend_herdr_composer_state: an incomplete lower Pi separator cannot inherit a stale empty row
ok - fm_backend_herdr_composer_state: Pi separators never authorize working, non-Pi, unreadable, or over-tall targets
ok - fm_backend_herdr_composer_state: a real-claude unbordered '❯' prompt row (no border box in view) reads empty
ok - fm_backend_herdr_composer_state: a real-claude unbordered '❯ <text>' prompt row reads pending
ok - fm_backend_herdr_composer_state: a live unbordered prompt row below a stale bordered decorative box still wins (not misread as the box's own row)
ok - fm_backend_herdr_composer_state: claude's dim prompt-suggestion ghost (the overnight wedge shape) reads empty
ok - fm_backend_herdr_composer_state: real typed text on the same claude prompt row still reads pending
ok - fm_backend_herdr_composer_state: grok's dark-truecolor placeholder (the TRUECOLOR gap) reads empty
ok - fm_backend_herdr_composer_state: grok's real bright typed input still reads pending
ok - fm_backend_herdr_composer_state: a real-codex unbordered '›' prompt row reads empty
ok - fm_backend_herdr_composer_state: a faint real-codex ghost suggestion reads empty
ok - fm_backend_herdr_composer_state: non-faint codex prompt text still reads pending
ok - fm_backend_herdr_wait_for_working: reports 'busy' immediately on the first poll, without spending the rest of the budget
ok - fm_backend_herdr_wait_for_working: a slow transition landing on a later sample within one window is still caught (robust against the 'slow transition' failure direction)
ok - fm_backend_herdr_wait_for_working: spreads six samples across the full budget endpoint without a final trailing sleep
ok - fm_backend_herdr_send_text_submit: applies the herdr minimum confirmation budget before polling agent-state
ok - fm_backend_herdr_wait_for_working: reports 'idle' (readable, genuinely not yet working) when 'busy' never appears
ok - fm_backend_herdr_wait_for_working: reports 'unknown' (a hard read failure, not a timing race) only when EVERY poll in the window fails
ok - fm_backend_herdr_wait_for_working: treats blocked as submit-active for confirmation without changing watcher busy-state semantics
ok - fm_backend_herdr_send_text_submit: reports 'empty' once agent_status reports working after one Enter, without ever reading the composer
ok - fm_backend_herdr_send_text_submit: reports 'pending' when agent_status never reports working after retried Enters (swallowed)
ok - fm_backend_herdr_send_text_submit: a slash-command popup's placeholder fill on Enter #1 never flips agent_status to working, so it does not short-circuit as submitted; Enter #2 is retried and lands it
ok - fm_backend_herdr_send_text_submit: a post-Enter blocked state confirms delivery without retrying into the prompt
ok - fm_backend_herdr_send_text_submit: preexisting busy plus pending composer confirms accepted queue delivery
ok - fm_backend_herdr_send_text_submit: busy autocomplete retries before accepting exact queued text
ok - fm_backend_herdr_send_text_submit: idle pending text is never acknowledged as sent
ok - fm_backend_herdr_send_text_submit: failed Enter transport is never accepted as queued
ok - fm_backend_herdr_send_text_submit: confirms submission via native agent-state alone, immune to a codex-style dynamic idle-tip composer that would have misread as 'pending' under the old composer-based confirmation
ok - fm_backend_herdr_composer_state: a faint real-codex dynamic idle-tip composer row reads empty
ok - fm_backend_composer_state (herdr): the pre-injection empty-box guard still refuses a genuinely non-empty composer, unaffected by the submit-confirmation change
ok - fm_backend_herdr_send_text_submit: a slow transition landing on a later sample within one Enter's budget is confirmed WITHOUT sending a needless extra Enter
ok - fm_backend_herdr_send_text_submit: reports 'send-failed' when the literal send-text call itself errors
ok - fm_backend_herdr_send_text_submit: reports 'unknown' when the post-Enter agent-get read fails (never retries past an unreadable target)
ok - fm_backend_herdr_send_text_submit: unknown baseline verifies composer and retries autocomplete safely
ok - fm_backend_herdr_send_text_submit: pending unknown state never retries Enter
ok - fm_backend_submit_enter: Herdr final Enter submits idle pending text and returns a confirmed verdict
ok - fm_backend_herdr_submit_enter: idle swallowed text is never falsely acknowledged
ok - fm_backend_herdr_submit_enter: failed final Enter is never acknowledged
ok - fm_backend_herdr_submit_enter: mismatched and unreadable composer content is never submitted
ok - fm_backend_herdr_submit_enter: an idle empty composer is unconfirmed and never submitted
ok - fm_backend_herdr_submit_enter: empty composer needs submit-active proof
ok - fm_backend_herdr_submit_enter: pending text requires current idle proof
ok - fm_backend_herdr_submit_enter: unreadable final confirmation is never promoted to success
ok - fm_backend_validate: herdr is a known backend (P2)
ok - fm_backend_busy_state: tmux (no native primitive) always reports unknown, preserving the P1 regex-only path
error: unknown backend 'bogus' (known: tmux herdr)
ok - fm_backend_composer_state dispatches tmux/herdr to their named classifiers and reports unknown for unrecognized backends
ok - fm-peek/fm-send: explicit stale targets matching metadata use the recorded backend
ok - fm_backend_herdr_normalize_event routes through the shared record with an empty from_status
ok - fm_backend_herdr_escalation_marker keys the dedupe marker exactly like the watcher's .stale-<key>
ok - fm_backend_herdr_apply_transition: blocked dedupe starts only after explicit commit
ok - fm_backend_herdr_apply_transition: a working edge clears the marker so the next ->blocked re-escalates
ok - fm_backend_herdr_clear_transition removes task-owned dedupe state
ok - fm_backend_herdr_apply_transition: idle/done (defer) and unknown/empty (fallback) take no fast action
ok - fm_backend_herdr_wait_transition: a home with no herdr panes falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: below-capability protocol/schema falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: reconnect level-reconcile returns an uncommitted blocked pane
ok - fm_backend_herdr_wait_transition: subscribes before reconnect level-reconcile
ok - fm_backend_herdr_wait_transition: a still-blocked, already-escalated pane is not re-delivered on reconnect
ok - fm_backend_herdr_wait_transition: a streamed ->blocked edge returns the record sub-poll
ok - fm_backend_herdr_wait_transition: streamed working clears the marker, idle/done are deferred (clean timeout)
ok - fm_backend_herdr_wait_transition: a reader/subscribe failure falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: Bash 3.2-safe bad-ack path closes fd 9 and removes its FIFO
ok - fm_backend_herdr_wait_transition: stock macOS Bash clean timeout closes fd 9 and returns 1
FM_TEST_END 2026-07-26T15:15:26Z tests/fm-backend-herdr.test.sh exit=0 duration_ms=15124 gate_skip=false
FM_TEST_SUMMARY total=5 failed=2 skipped_gate=0 duration_ms=164295
FM_TEST_SUMMARY_FAMILY family=backend-dispatch count=1 duration_ms=15124 failed=0
FM_TEST_SUMMARY_FAMILY family=pr-forge count=2 duration_ms=46702 failed=1
FM_TEST_SUMMARY_FAMILY family=unclassified count=1 duration_ms=953 failed=1
FM_TEST_SUMMARY_FAMILY family=watcher-wake-lock count=1 duration_ms=101336 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-watcher-lock.test.sh duration_ms=101336
FM_TEST_SLOWEST rank=2 script=tests/fm-pr-check-security.test.sh duration_ms=46541
FM_TEST_SLOWEST rank=3 script=tests/fm-backend-herdr.test.sh duration_ms=15124
FM_TEST_SLOWEST rank=4 script=tests/fm-task-identity.test.sh duration_ms=953
FM_TEST_SLOWEST rank=5 script=tests/fm-teardown.test.sh duration_ms=161
Evidence: Hermetic teardown and task-identity retry
FM_TEST_BEGIN 2026-07-26T15:16:13Z tests/fm-task-identity.test.sh family=unclassified expected_gate_skip=none
ok - fm-pr-check refuses stale task metadata before recording a PR
ok - fm-pr-check records a PR when task id, branch, and PR head match
ok - fm-review-diff refuses stale task metadata instead of reviewing the wrong branch
ok - fm-teardown refuses stale task metadata before returning a reused worktree
FM_TEST_END 2026-07-26T15:16:14Z tests/fm-task-identity.test.sh exit=0 duration_ms=1110 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:16:14Z tests/fm-teardown.test.sh family=pr-forge expected_gate_skip=none
ok - local-only worktree with HEAD on a fork remote is torn down (fix holds)
ok - teardown prompts tasks-axi backlog refresh when compatible
ok - teardown honors config/backlog-backend=manual even when tasks-axi is compatible
ok - teardown refuses arbitrary tasktmp cleanup targets from meta
ok - local-only worktree with truly unpushed work is refused (safety preserved)
ok - local-only worktree with work merged into local main is torn down (no regression)
ok - no-mistakes worktree with HEAD on origin is torn down (no regression)
ok - no-mistakes worktree with genuinely unlanded work is refused (safety preserved)
ok - local-only worktree with unpushed work is torn down under --force (escape hatch)
ok - squash-merged + deleted-branch worktree (PR merged) is torn down (the fix)
ok - squash-merged PR accepts a local HEAD that is an ancestor of the final PR head
ok - squash-merged PR accepts replayed unpushed local patches contained in the PR head
ok - merged PR does not allow teardown after a later local commit
ok - fm-pr-check does not refresh PR head after HEAD moves
ok - fm-pr-check records the remote PR head when the local worktree lags
ok - worktree whose content already landed in the default branch is torn down (content fallback)
ok - content fallback refreshes origin default before comparing trees
ok - dirty worktree is refused even when its committed work has landed (dirty always wins)
ok - gh lookup error with content not in default refuses (fail-safe)
ok - teardown retries a transient index lock without weakening landed-work checks
ok - forced secondmate teardown retries a transient child worktree index lock
ok - forced and recursive secondmate teardown propagate child close failures
ok - Herdr teardown serializes every exact endpoint close through focus-safe verification
ok - confirmed projection journals retire before return failure and child teardown shares safe closure
FM_TEST_END 2026-07-26T15:16:24Z tests/fm-teardown.test.sh exit=0 duration_ms=9800 gate_skip=false
FM_TEST_SUMMARY total=2 failed=0 skipped_gate=0 duration_ms=11013
FM_TEST_SUMMARY_FAMILY family=pr-forge count=1 duration_ms=9800 failed=0
FM_TEST_SUMMARY_FAMILY family=unclassified count=1 duration_ms=1110 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-teardown.test.sh duration_ms=9800
FM_TEST_SLOWEST rank=2 script=tests/fm-task-identity.test.sh duration_ms=1110
Evidence: Backend and task-temp teardown tests
FM_TEST_BEGIN 2026-07-26T15:17:39Z tests/fm-backend.test.sh family=backend-dispatch expected_gate_skip=none
ok - backend selection precedence, metadata default, and known/unknown validation
ok - fm-spawn refuses unknown backends from FM_BACKEND, config/backend, and --backend
ok - selector resolution and capture/key/readability/kill dispatch use tmux adapter
ok - selector recovery retains Herdr routing and persisted workspace identity
ok - tmux adapter propagates kill and container-creation failures
ok - teardown preserves task state when backend kill fails
FM_TEST_END 2026-07-26T15:17:40Z tests/fm-backend.test.sh exit=0 duration_ms=522 gate_skip=false
FM_TEST_BEGIN 2026-07-26T15:17:40Z tests/fm-gotmp.test.sh family=session-bootstrap expected_gate_skip=none
ok - fm-spawn creates gotmp dir and records tasktmp in meta
ok - fm-teardown removes the dir pointed to by tasktmp= in meta
ok - fm-teardown skips gracefully when tasktmp= is absent (backward compat)
ok - fm-teardown skips gracefully when tasktmp= points to a nonexistent dir
FM_TEST_END 2026-07-26T15:17:40Z tests/fm-gotmp.test.sh exit=0 duration_ms=268 gate_skip=false
FM_TEST_SUMMARY total=2 failed=0 skipped_gate=0 duration_ms=860
FM_TEST_SUMMARY_FAMILY family=backend-dispatch count=1 duration_ms=522 failed=0
FM_TEST_SUMMARY_FAMILY family=session-bootstrap count=1 duration_ms=268 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-backend.test.sh duration_ms=522
FM_TEST_SLOWEST rank=2 script=tests/fm-gotmp.test.sh duration_ms=268
- Outcome: 🔧 1 issue found → auto-fixed (2) ✅ across 3 runs (1h20m16s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed (2) ✅
  • 🚨 bin/fm-watch.sh:608 - Intent requires preserving “custom-check behavior,” but the new elif fm_custom_check_snapshot_prepare ... else ... rejected_checks path rejects existing state/&lt;id&gt;.check.sh files unless separately registered. The documented contract still says writing the check file is sufficient, so deployed custom checks will be quarantined and stop waking Firstmate. Either migrate/grandfather existing checks or explicitly approve this breaking behavior and update the operator contract.

🔧 Fix: Preserve legacy custom checks through secure migration
1 error still open:

  • 🚨 bin/fm-pr-check-migrate.sh:1059 - The new legacy-custom fallback also accepts the reserved x-watch.check.sh name. A forged or invalid X shim is therefore registered as a custom check instead of quarantined; migration then considers it authenticated, but the watcher’s dedicated X branch still rejects it every cycle. This leaves a persistent rejected check and breaks the existing invalid-X-shim cleanup invariant. Exclude id=x-watch from legacy custom registration.

🔧 Fix: Protect reserved X watcher identity during migration
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → auto-fixed (2) ✅
  • 🚨 tests failed with exit code 1
  • bash bin/fm-run-behavior-tests.sh

🔧 Fix: Captain, fix watcher migration lock diagnostics
1 error still open:

  • 🚨 tests failed with exit code 1
  • bash bin/fm-run-behavior-tests.sh

🔧 Fix: Synchronize watcher singleton test on heartbeat
✅ Re-checked - no issues remain.

  • bash bin/fm-run-behavior-tests.sh
  • Baseline supplied as already passing: bash bin/fm-run-behavior-tests.sh
  • bash bin/fm-test-run.sh tests/fm-pr-check-security.test.sh tests/fm-watcher-lock.test.sh tests/fm-task-identity.test.sh tests/fm-teardown.test.sh tests/fm-backend-herdr.test.sh (two teardown scripts encountered the expected gate-agent setup refusal; all other selected behavior passed)
  • Hermetic disposable-clone retry: env -u NO_MISTAKES_GATE bash bin/fm-test-run.sh tests/fm-task-identity.test.sh tests/fm-teardown.test.sh
  • Evidence scenario: env -u NO_MISTAKES_GATE bash tests/fm-pr-retirement-evidence.test.sh in a disposable clone
  • Hermetic support checks: env -u NO_MISTAKES_GATE bash bin/fm-test-run.sh tests/fm-backend.test.sh tests/fm-gotmp.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 6 commits July 26, 2026 02:08
…nguid#932)

* fix: retire merged PR polls after notification

* no-mistakes(review): Decouple PR retirement recovery from template updates

* no-mistakes(review): Recover pending PR retirements before poll migration

* no-mistakes(document): Document merged PR poll retirement contracts
@JTInventory
JTInventory merged commit 9c6a4d8 into main Jul 26, 2026
6 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants