Skip to content

fix(bin): keep armed merge polls valid across remounts, respawns and relaunches - #6249

Open
AgardnerAU wants to merge 9 commits into
kunchenguid:mainfrom
AgardnerAU:fm/fm-pr-poll-identity-stdev
Open

AgardnerAU wants to merge 9 commits into
kunchenguid:mainfrom
AgardnerAU:fm/fm-pr-poll-identity-stdev

Conversation

@AgardnerAU

@AgardnerAU AgardnerAU commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Intent

The developer (acting as captain through Firstmate steering messages) wanted the no-mistakes validation run for upstream firstmate PR 6249 to validate the commit already published on that PR, head 9c38f659 (test: reject allowed metadata key after PR line). The PR is about keeping merge polls verifiable when they survive remounts and respawns. The no-mistakes gate mirror still pointed at an older local commit, 1d1b6906, which is not on origin, so a normal rerun would have validated the wrong head. After the agent reported that no supported sync action existed, the captain authorised one action: force-update only the no-mistakes gate ref to the published 9c38 head, with a lease check, while keeping a backup of the old ref. Then the run was to proceed on the existing PR branch. The constraints were to rewrite or lose no commit, to start no other pipeline, and to process each steering inbox message in numeric order and then move it into handled/.

What Changed

  • PR poll registrations and retirement receipts now compare recorded file identities by inode only, so a state volume remount that renumbers the device no longer invalidates an armed merge poll. The device-shift re-record path (fm_pr_poll_registration_device_shifted / rerecord_device_shifted_pr_poll) is removed. Status-file identity checks in the classify, wake, branch-outcome and Pi branch-dispatch code also ignore the device field (_fm_status_ident_same / statusIdentitySame).
  • fm-spawn.sh now carries the existing pr= / pr_head= block from the task record (or the relaunch record) into the newly written record, and keeps it as the last block. A respawn or relaunch therefore keeps the poll's task record verifiable. The task-record parser rejects any key that comes after the pr= block.
  • When fm-watch.sh rejects a check, it now gives the reason. Poll validation sets FM_PR_POLL_REJECTION, task-record parsing sets FM_PR_META_REJECTION and custom-check validation sets FM_CUSTOM_CHECK_REJECTION, so the log tells a failing merge poll from a failing custom check. docs/architecture.md and the regression tests are updated to match.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The inode-only identity match is safe because every caller (fm_pr_poll_artifacts_valid via content_valid, the three retirement validators, remove_exact and discard_obsolete) runs fm_pr_private_file_valid first, which binds the file to the state directory's live device. Recorded-to-recorded comparisons stay exact and consistent, because snapshot and receipt identities come from the registration. Status identity comparisons all go through one device-blind helper, mirrored in TypeScript. The spawn pr= block carry-forward and the rejection-cause messages behave as the commit message states.

Testing

I ran each of the PR's new or changed behaviour tests on its own. Each was a selective copy of its test file with only the chosen test calls at the end, or used FM_TEST_ONLY where the file supports it. These tests drive the real fm-pr-check, fm-watch, fm-wake-drain, fm-control, fm-captain-hold and fm-spawn scripts against fixture state. All of them passed with exit 0. They show three things. A poll armed before a device renumber keeps authenticating and detects merges. A tampered, replaced, hardlinked or foreign-device artifact is still refused. A respawn, relaunch, traced relaunch or completion attestation keeps the pr= block last, so the poll stays verifiable. I also checked the parser and identity helpers by hand against a throwaway directory, and kept the transcript. An allowed tail is accepted. A foreign key after pr= is rejected with the cause named (model after the pr= block, as in the latest commit). A renumbered device is tolerated. A byte-identical replacement with a new inode is refused. The full suite was not run, as instructed. There is no UI surface, so I captured no screenshots.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
A merge poll armed before a volume device renumber keeps authenticating and detects the merge, with no registration rewrite ✅ pass live fm-pr-check-security.log: test_device_renumbered_poll_stays_armed ok
A retirement receipt published before a renumber still completes ✅ pass live fm-pr-check-security.log: test_device_renumbered_retirement_completes ok
Adversarial: after a renumber, a swapped or altered check or sidecar, a wrong mode, a hardlink or a foreign device is still refused ✅ pass live fm-pr-check-security.log: test_renumbered_poll_still_refuses_tampered_artifacts ok; manual-parser-identity.txt shows a byte-identical replacement refused
A rejected poll check names its cause, for example a foreign key after the pr= block ✅ pass live fm-pr-check-security.log: test_rejection_names_its_cause ok; manual-parser-identity.txt
A respawn, relaunch, traced relaunch or completion attestation keeps the pr= block last, so an armed poll still authenticates ✅ pass live fm-backlog-atomicity.log, fm-control-relaunch.log and fm-captain-hold-lifecycle.log: all ok
A device renumber neither replays presented wake history nor makes an unchanged reported status read as new ✅ pass live fm-wake-drain-unread-status.log and fm-watch-triage.log: ok
Direct re-arm waits for an in-progress poll publication and does not replace the armed poll ✅ pass live fm-pr-check-security.log: test_direct_rearm_waits_for_poll_publication ok
Evidence: fm-pr-check-security targeted run

Source: fm-pr-check-security targeted run

ok - a poll armed before a volume renumber keeps authenticating and detecting merges without any rewrite
ok - a retirement receipt published before a volume renumber still completes
ok - a renumbered registration still refuses a tampered artifact: swapped-check altered-check swapped-sidecar altered-sidecar altered-template-hash wrong-mode hardlinked-check foreign-device
ok - a rejected state check names the cause of its rejection
ok - direct re-arm publication waits without replacing an armed poll
ok - registered generations survive template updates and relaunch metadata without executing sidecar code or trusting forged bytes
exit=0
Evidence: fm-control-relaunch targeted run

Source: fm-control-relaunch targeted run

ok - fm-control relaunch: lifecycle keys land ahead of the pr= block, so an armed merge poll still authenticates
ok - fm-control relaunch: the trace carrier lands ahead of the pr= block, so an armed merge poll still authenticates
exit=0
Evidence: fm-captain-hold-lifecycle targeted run

Source: fm-captain-hold-lifecycle targeted run

ok - completion attestation lands ahead of the pr= block and keeps the record private, so an armed merge poll still authenticates
exit=0
Evidence: fm-backlog-atomicity respawn run

Source: fm-backlog-atomicity respawn run

ok - a respawn keeps the task's pr= block, so its armed merge poll still authenticates
exit=0
Evidence: fm-wake-drain renumber run

Source: fm-wake-drain renumber run

ok - a volume renumber keeps the presentation cursor while a replaced file still starts unread
exit=0
Evidence: fm-watch-triage renumber run

Source: fm-watch-triage renumber run

ok - an unchanged reported status survives device renumbering while a replaced file reads as new
exit=0
Evidence: Manual parser and identity transcript

Source: Manual parser and identity transcript

allowed-tail: accepted url=https://github.com/o/r/pull/7
foreign-key-after-pr: rejected - task record has key model after its pr= block two-pr-lines: rejected - task record has more than one pr= line no-pr: rejected - task record has no pr= line live identity 66306:947252: match renumbered device 67305:947252: match (remount tolerated) byte-identical replacement (new inode 947253): refused malformed recorded identity: refused

allowed-tail: accepted url=https://github.com/o/r/pull/7
foreign-key-after-pr: rejected - task record has key model after its pr= block
two-pr-lines: rejected - task record has more than one pr= line
no-pr: rejected - task record has no pr= line
live identity 66306:947252: match
renumbered device 67305:947252: match (remount tolerated)
byte-identical replacement (new inode 947253): refused
malformed recorded identity: refused

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
A merge poll armed before a volume device renumber keeps authenticating and detects the merge, with no registration rewrite ✅ pass live fm-pr-check-security.log: test_device_renumbered_poll_stays_armed ok
A retirement receipt published before a renumber still completes ✅ pass live fm-pr-check-security.log: test_device_renumbered_retirement_completes ok
Adversarial: after a renumber, a swapped or altered check or sidecar, a wrong mode, a hardlink or a foreign device is still refused ✅ pass live fm-pr-check-security.log: test_renumbered_poll_still_refuses_tampered_artifacts ok; manual-parser-identity.txt shows a byte-identical replacement refused
A rejected poll check names its cause, for example a foreign key after the pr= block ✅ pass live fm-pr-check-security.log: test_rejection_names_its_cause ok; manual-parser-identity.txt
A respawn, relaunch, traced relaunch or completion attestation keeps the pr= block last, so an armed poll still authenticates ✅ pass live fm-backlog-atomicity.log, fm-control-relaunch.log and fm-captain-hold-lifecycle.log: all ok
A device renumber neither replays presented wake history nor makes an unchanged reported status read as new ✅ pass live fm-wake-drain-unread-status.log and fm-watch-triage.log: ok
Direct re-arm waits for an in-progress poll publication and does not replace the armed poll ✅ pass live fm-pr-check-security.log: test_direct_rearm_waits_for_poll_publication ok
  • bash <selective copy of tests/fm-pr-check-security.test.sh> running test_device_renumbered_poll_stays_armed, test_device_renumbered_retirement_completes, test_renumbered_poll_still_refuses_tampered_artifacts, test_rejection_names_its_cause, test_direct_rearm_waits_for_poll_publication and test_registered_poll_survives_template_update_and_relaunch
  • bash <selective copy of tests/fm-control-relaunch.test.sh> running test_relaunch_keeps_an_armed_merge_poll_verifiable and test_traced_relaunch_keeps_an_armed_merge_poll_verifiable
  • bash <selective copy of tests/fm-captain-hold-lifecycle.test.sh> running test_completion_attestation_keeps_an_armed_merge_poll_verifiable
  • bash <selective copy of tests/fm-backlog-atomicity.test.sh> running test_respawn_keeps_an_armed_merge_poll_verifiable
  • bash <selective copy of tests/fm-wake-drain-unread-status.test.sh> running test_volume_renumber_does_not_replay_presented_history
  • FM_TEST_ONLY=test_reported_status_survives_device_renumbering bash tests/fm-watch-triage.test.sh
  • Manual: sourced bin/fm-pr-lib.sh and ran fm_pr_metadata_identity_parse and fm_pr_recorded_identity_matches on a throwaway /tmp state directory
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues remain.

Reviews (7) · Last reviewed commit: "no-mistakes(ci): ci-1 (Behavior portable..." · Reviewed by Greptile

Comment thread bin/fm-captain-hold.sh Resolved
Comment thread bin/fm-classify-lib.sh Resolved
@AgardnerAU
AgardnerAU force-pushed the fm/fm-pr-poll-identity-stdev branch from 2c4a65a to 12a4fea Compare October 3, 2026 11:03
@AgardnerAU AgardnerAU changed the title fix(bin): keep armed merge watches alive across remounts, respawns, and relaunches fix(bin): keep armed PR merge watches alive across reboots, respawns, and relaunches Oct 3, 2026
@AgardnerAU

Copy link
Copy Markdown
Contributor Author

Merged current main into this branch (one conflict in bin/fm-spawn.sh, resolved by keeping both the new base_branch key and this PR's pr/pr_head keys). The branch is up to date with current main and ready for CI.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @AgardnerAU — keeping armed PR merge watches alive across APFS st_dev renumbers (reboot/remount) while still refusing a replaced sidecar is the durability restart promised. Thanks for the conflict resolve on fm-spawn.sh today.

VISION (each rule):

  • One captain, one interface: aligns (merge watches do not silently die after reboot).
  • Authority is explicit: aligns (unauthenticated checks still refuse execution).
  • Scripts own the mechanics: aligns (identity match stays in fm-pr-lib.sh).
  • A restart is a non-event: aligns (core purpose of this PR).
  • Delegation with a spine: aligns.
  • The fleet outlives any vendor: neutral.
  • Scope: aligns.

Contract-class: restore. Armed PR poll authentication already promised to survive process death and relaunch; APFS device renumber was falsely rejecting unchanged files. Recorded identity now matches on inode (device still proven live via private-file checks on the state volume). Replaced files (new inode) still refuse.

Security FYI (not a captain card): this touches the PR-poll authentication surface (fm_pr_recorded_identity_matches). Covered by tests/fm-pr-check-security.test.sh. Cron FYI only — PR is not otherwise merge-ready while main is red.

Where it stands: attestation MATCH b493b413, live go 7/7. Diff reviewed; approved fork CI for this tip. Main is red; no merge this wake. Overlap: fm-spawn.sh / fm-watch.sh / fm-classify-lib.sh with #5435 — serial land when green. Waiting on CI.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU. 41e0da20 adds the repo's usual SC2034 shellcheck disables for the two rejection variables that bin/fm-watch.sh reads. That's fine. The no-mistakes attestation matches 41e0da20. I approved the held fork runs: CI 38422781594 and Require no-mistakes 38422781515.

Main has moved: #7172 landed and touched bin/fm-spawn.sh, so this PR is now CONFLICTING. When you have a moment, could you merge main and re-raise through git push no-mistakes?

Contract-class: restore (unchanged). A restart is supposed to be a non-event, and here an armed merge watch survives a volume renumber or a relaunch instead of dying. One note for whoever reviews this later, with no change asked: a fresh spawn over an existing ship or scout record now also carries the record's pr= block forward, which keeps that task's armed poll verifiable. VISION.md: every rule aligns. Security FYI (carried, informational only): the PR-poll identity now matches on inode and birth time and checks the device live. The security tests cover it.

Status: waiting on you for the conflict only. After that, if CI is green on a green main, this can auto-merge. It overlaps #5435, #6245 and #6760 in bin/fm-spawn.sh and bin/fm-watch.sh, so those land one at a time.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU — tip ff4ffb97 merges main after the #7172 conflict on bin/fm-spawn.sh; mergeable again. Attestation MATCH. Diff re-reviewed (inode poll identity, pr= tail writers, device-blind status identity, rejection causes). Workflow-zero. Approved fork runs: CI 38478119986, Require no-mistakes 38478119951.

Contract-class: restore (unchanged). Armed merge watches surviving APFS st_dev renumber / relaunch is the restart-is-a-non-event promise; replaced sidecars (new inode) still refuse.

VISION: all seven rules align. Security FYI (cron only, not a captain card): recorded PR-poll identity is inode-based with live device proof; covered by tests/fm-pr-check-security.test.sh.

Outcome: waiting-ci. Main is red; no merge this wake. Live on this tip notes 2/7 (suites cover the rest; prior tips had fuller live). Once CI is green on a green main, this is on the auto-merge path. Overlaps fm-spawn/fm-watch with #5435 / #6245 / #6760 — serial land. Nothing needed from you unless CI fails.

@AgardnerAU

Copy link
Copy Markdown
Contributor Author

Merged current main into this branch (head bcddb56f) and resolved the one conflict in bin/fm-spawn.sh. The new polytoken session binding from main now writes through the same pr=-block-preserving helper as traceparent, with a regression test. The earlier red jobs (Pi primary types, fixed upstream in #7248; remote-reply NUL capture) pass locally. Up to date with main and ready for CI; the workflow runs are awaiting maintainer approval.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU for keeping this current.

What changed since my 14 Oct stamp (ff4ffb97): you merged main 1aa2a21e, so the head is now bcddb56f. You resolved the bin/fm-spawn.sh conflict, and the new polytoken session binding from main now writes through the same pr=-block-preserving helper (fm_pr_metadata_print_with) as traceparent. A new regression test covers it (test_polytoken_session_binding_keeps_an_armed_merge_poll_verifiable). Apart from that and the merged-in relaunch key list, the PR's own diff is unchanged.

No-mistakes and live validation: the attestation matches bcddb56f, and live validation is go, 6 of 6.

Review and CI: I re-read the tip diff against main. It touches no workflows and no secrets, and it adds no new network targets. I approved the held fork runs on this head: CI 39132538561 and Require no-mistakes 39132538662. Main has since moved to 69f9d09e (#6987, which also touches bin/fm-spawn.sh). GitHub still reports this PR as mergeable.

Contract-class: restore (unchanged). A restart is supposed to be a non-event. Here an armed merge watch survives a volume renumber, respawn or relaunch instead of silently dying, and a replaced sidecar (new inode) is still refused.

VISION.md (each rule):

  • One captain, one interface: aligns. Merge watches no longer die without a word after a reboot.
  • Authority is explicit: aligns. Unauthenticated or tampered poll artifacts still refuse to run.
  • Scripts own the mechanics: aligns. The identity match and the record tail stay in fm-pr-lib.sh and fm-spawn.sh.
  • A restart is a non-event: aligns. This is the core purpose of the PR.
  • Delegation with a spine: aligns.
  • The fleet outlives any vendor: aligns. The change is harness-neutral, and the polytoken binding follows the same rule.
  • Scope: aligns.

Security FYI (carried, informational only): the PR-poll identity now matches on inode with a live device check. tests/fm-pr-check-security.test.sh covers it.

Outcome: waiting-ci. If CI and no-mistakes are green on this head, this is on the auto-merge path. It overlaps your #6245 in bin/fm-spawn.sh, so those land one at a time. Nothing is needed from you unless CI fails.

@AgardnerAU AgardnerAU changed the title fix(bin): keep armed PR merge watches alive across reboots, respawns, and relaunches fix(bin): keep armed merge watches alive across remounts, respawns, and relaunches Oct 26, 2026
@AgardnerAU

Copy link
Copy Markdown
Contributor Author

Merged current main into this branch (head d25d33a5) and resolved the one conflict in bin/fm-spawn.sh, keeping the pr= block preserved. It is up to date with main and ready for CI; the workflow runs are waiting for maintainer approval.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU for keeping this current. The new head d25d33a5 merges main 127f0f30. I compared the PR's own patch with bcddb56f: the only change is the preserve_relaunch_meta key list in bin/fm-spawn.sh, now the union of main's new backend/approval keys and your pr pr_head, plus a test-list line. There are no workflow, network or secret changes, so I approved this head's fork runs: CI 40308068383, Require no-mistakes 40308068387 and 40308142720. The no-mistakes attestation binds d25d33a5 (live 9/9 go).

A correction to my earlier classification. I re-read the tip against current main rather than relying on my 14/18 Oct stamps. Main already has a device-shift path: fm_pr_poll_registration_device_shifted plus a locked re-record in bin/fm-pr-lib.sh. This PR removes that path and replaces it with device-blind identity (inode plus a live device check) for poll registrations and status cursors. Replacing an existing default path, especially a security-relevant identity check, is new-default, not restore, so this should go to the captain rather than auto-merge. The pr=-block-last fixes on their own would read as restore, but they ship together with the identity change. I'm sorry for the change of course. Nothing about the PR is wrong; it just needs Kun's word.

VISION.md: one captain aligns · authority aligns (tampered/replaced artifacts still refused), but the identity relaxation is security-sensitive and is the captain's call · scripts own mechanics aligns · restart non-event aligns (the core purpose) · delegation aligns · vendor aligns · scope aligns.

CI: main's own Linux portable serial jobs are red right now because the hosted ubuntu runner moved to 26.04. If the same serials go red here, that's on our side, not yours. This is not waiting on you. Once this head runs green, it goes to Kun as a merge-or-leave decision. It still overlaps your #6245 in bin/fm-spawn.sh, and any conflict is ours to fix.

@AgardnerAU

Copy link
Copy Markdown
Contributor Author

Merged current main (including the runner-image pin from #7798) into this branch; head is now d7b0d5ae. It is up to date with main and ready for CI; the workflow runs are waiting for maintainer approval.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @AgardnerAU for bringing this up to date again. Head 6bc0316d contains main b329c275 and merges cleanly. The pipeline's review commit drops the last of main's device re-record code (rerecord_device_shifted_pr_poll in bin/fm-watch.sh), and rejected checks are now named with their cause. The attestation binds this head with every step completed, live validation is go 8 of 8, Greptile is 5/5 on this head, and Repo invariants, the coverage guard and the no-mistakes check all pass. There are no workflow, network or secret changes. The red Full suite is only waiting on the full-ci label, which is ours to add, so it doesn't count against you.

Waiting on you for one thing: Greptile's P2 thread on bin/fm-classify-lib.sh ("Remount still triggers status wakes") is still open, and I'm sorry I missed it in earlier stamps. I checked it on this head and it still applies. Cursors now compare through _fm_status_ident_same, but status_observed_signature still puts the full identity, device included, into the reported signature. status_presentation_marker_reported_matches compares that exactly. So after a remount, an unchanged, already-reported status file reads as new and can wake once more. Could you either make the reported-state comparison device-blind too, or reply on the thread saying why one extra wake per file after a remount is acceptable, and then resolve it? If you change code, please push it through git push no-mistakes.

Contract-class: new-default (unchanged since my 26 Oct correction). The PR replaces main's device-shift re-record path with device-blind identity, and that's a security-relevant identity check. VISION: one captain aligns; authority aligns (replaced or tampered artifacts are still refused), but relaxing the identity check is Kun's call; scripts own the mechanics aligns; a restart is a non-event aligns (that's the core purpose); delegation, vendor and scope align. Once that thread is settled, we'll run the Full suite, and if it's green this goes to Kun as a merge-or-leave decision. Your #6245 still overlaps in bin/fm-spawn.sh, and any conflict is ours to fix.

AgardnerAU and others added 8 commits November 5, 2026 08:47
…nd relaunches

A merge poll registration recorded each file as device:inode, and APFS
renumbers the device at every reboot, so every armed poll failed validation
at once. Recorded identities now match by inode, with the file proven live on
the state directory's own filesystem first. This replaces the watcher's
locked re-record step, which is no longer needed, and also covers pending
retirement receipts.

The status presentation cursor, the open-decisions cursor, the seen markers,
and the home-append ledger compared status file identities including the
device, so a reboot replayed every task's whole history. Every status identity
comparison now goes through one device-blind helper, mirrored in the Pi
branch dispatcher. The custom check trust binding records only a content hash
and needed no change.

fm-spawn now ends every republished task record with the pr= block that the
metadata parser requires as the tail: a relaunch writes its lifecycle keys
ahead of it, and a fresh spawn over a ship or scout's existing record keeps
the block, so the armed poll keeps naming the task's still-open PR.

A rejected state check now names its cause in the wake, such as a task record
with no pr= line, a key after the pr= block, a replaced file, or an
unregistered custom check.
…d permissions). Rule that was broken: a published task record must keep owner-only mode (0600), whatever umask the caller inherits. In this file, `complete` (bin/fm-captain-hold.sh:1679) is the only path that stages and publishes a replacement for state/<id>.meta. The other staged files in that script already use `umask 077`. Fix: the staging redirection now runs in a subshell under `umask 077`, so $meta_tmp is created with 0600 before fm_backlog_atomic_transition publishes it. Test: I extended test_completion_attestation_keeps_an_armed_merge_poll_verifiable in tests/fm-captain-hold-lifecycle.test.sh. It sets the record to 0600, runs `complete --none` under `umask 022`, and asserts that the record is still exactly 0600 (`find -perm 0600`). The existing checks still pass: the pr= block stays last and the armed poll still authenticates. Before the fix, this test failed with the record at -rw-r--r--. After the fix it passes, and the full tests/fm-captain-hold-lifecycle.test.sh passes (54 ok, 0 not ok). `shellcheck -x` is clean on both files. As the user decided, I did not change ci-2
…34) that FM_PR_POLL_REJECTION in bin/fm-pr-lib.sh and FM_CUSTOM_CHECK_REJECTION in bin/fm-check-lib.sh are set but never read. Both are output variables that bin/fm-watch.sh reads after it sources the library, which shellcheck cannot see. I added the repository's usual `# shellcheck disable=SC2034 # Read by the sourcing watcher (bin/fm-watch.sh) on rejection.` comment above the flagged line in each file. FM_PR_META_REJECTION, the other new variable, is read inside its own library and needs no comment. Before the change, shellcheck 0.11.0 showed the same two warnings locally. After it, `shellcheck -x bin/fm-pr-lib.sh bin/fm-check-lib.sh bin/fm-watch.sh` passes with no warnings. Behavior portable parallel 1 is not caused by this PR, and I made no code change for it. Its only failing test is tests/fm-pi-primary-types.test.sh, with TS2339 errors ('prompt' does not exist on BeforeAgentStartEvent) in fm-branch-supervision.ts and fm-primary-pi-watch.ts. This PR does not change those files. The upstream main CI run at the base commit 6407052 (run 38316792015, job 115035229020) fails this same test with the same two errors. I did not run the behaviour tests locally; the change only adds the two comments
@AgardnerAU
AgardnerAU force-pushed the fm/fm-pr-poll-identity-stdev branch from 9c38f65 to 1a9c157 Compare November 5, 2026 00:55
@AgardnerAU AgardnerAU changed the title fix(bin): keep armed merge watches alive across remounts, respawns, and relaunches fix(bin): keep armed merge polls valid across remounts, respawns and relaunches Nov 5, 2026
@kunchenguid kunchenguid added the full-ci Maintainer go-ahead: run the full CI suite on this outside pull request label Nov 5, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @AgardnerAU for folding #8150 back in and settling the last thread. On 1a9c157d, reported status signatures now ignore device renumbering too, so a remount no longer re-fires an unchanged status, and the key-after-pr= test uses a key that's really refused. The attestation binds this head with every step completed, live is 7 of 7, the quick checks pass and both Greptile threads are resolved. I've added the full-ci label so the full suite runs. If it comes back green, this goes to Kun as a merge-or-leave decision, because it replaces main's device re-record path with device-blind identity. That decision is waiting on Kun, not on you. Any conflict with #6245 is ours to fix.

…was tests/fm-watch-wedge-cap-unconfigured-parity.test.sh, and I reproduced it locally. In the upstream run, busy-rung1 showed `esc=-` where the branch showed `esc=1`. Cause: the test helper `mark_status_seen` always wrote the status "seen" marker with this branch's bin/fm-wake-lib.sh, including in the run that drives upstream main's watcher. Commit e64a0bf made `status_observed_signature` device-blind, so the branch now encodes the reported snapshot differently from upstream. Upstream's watcher therefore did not recognise the marker the branch had written. It raised a status-signal wake, and that wake hid the first busy rung, so the two traces diverged. Production code is not at fault. The rule that was broken: the fixture's seen marker must be written by the same bin/ tree as the watcher that reads it. `mark_status_seen` is the only place in the test that writes it, and `run_scenario` is its only caller. Fix (test only): `mark_status_seen` now takes a bin directory as its first argument. `run_scenario` passes `$(dirname "$watch")`, which is the upstream archive's bin/ for the baseline run and this branch's bin/ for the other runs. The device-blind remount behaviour and test_reported_status_survives_device_renumbering are unchanged. Verification: `bash tests/fm-watch-wedge-cap-unconfigured-parity.test.sh` failed before the change with the reported diff. After the change all 3 cases pass: the upstream parity, the value shapes and the configured cap. `shellcheck -x` on the test file is clean. ci-2 (Full suite) is only the aggregate gate. It failed because a lane job failed (`FM_CI_LANES_FAILED=true`), so the ci-1 fix also addresses it
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @AgardnerAU for the quick ci fix. The parity test now writes its seen marker with the same bin/ as the watcher it drives, and it's a test-only change. On 87393f71 the Full suite is green (run 42013847399). The attestation binds this head with every step completed, live is 7 of 7, Greptile is 5/5 and both threads are resolved. This now goes to Kun as a merge-or-leave decision, because it replaces main's device-shift re-record path with device-blind identity for armed merge polls, retirement receipts and status cursors. That decision is waiting on Kun, not on you. Any conflict with #6245 is ours to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Maintainer go-ahead: run the full CI suite on this outside pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants