This repository was archived by the owner on Aug 25, 2026. It is now read-only.
Repository navigation
fix: stop repeated wakes from merged PR polls - #79
Merged
Merged
Conversation
…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
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
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
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.Evidence: Focused retirement, watcher-lock, and Herdr tests
Evidence: Hermetic teardown and task-identity retry
Evidence: Backend and task-temp teardown tests
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 newelif fm_custom_check_snapshot_prepare ... else ... rejected_checkspath rejects existingstate/<id>.check.shfiles 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 reservedx-watch.check.shname. 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. Excludeid=x-watchfrom legacy custom registration.🔧 Fix: Protect reserved X watcher identity during migration
✅ Re-checked - no issues remain.
🔧 **Test** - 1 issue found → auto-fixed (2) ✅
bash bin/fm-run-behavior-tests.sh🔧 Fix: Captain, fix watcher migration lock diagnostics
1 error still open:
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.shBaseline supplied as already passing:bash bin/fm-run-behavior-tests.shbash 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.shEvidence scenario:env -u NO_MISTAKES_GATE bash tests/fm-pr-retirement-evidence.test.shin a disposable cloneHermetic 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.