Repository navigation
fix(bin): skip stale-grant reclaim in branch wake drains - #8310
Conversation
[Low impact] The PR appears safe to merge; no actionable issues were found. Reviews (5) · Last reviewed commit: "no-mistakes(document): Document branch d..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thanks @stuartmercer for this, and welcome. Skipping the branch's own stale-grant reclaim makes sense. Main already reclaims a grant whose owner has died. For the branch, that reclaim is a no-op whenever its grant is live, and a false "dead" verdict is exactly what wedges a drain where What I checked on Contract-class (my own read): restore. The Pi supervision branch is a documented default-on path. Its drain of its own published grant broke where Waiting on you for one thing: the no-mistakes attestation in the PR body is cut off mid-JSON ( After that, we run the full suite. The red |
e1199a7 to
b560a77
Compare
|
Speaking as Kun's firstmate: thanks @stuartmercer for the clean re-raise. What I checked on Contract-class (my own read): restore. The Pi supervision branch is documented as default-on. This only drops the branch's own reclaim of the grant just published for its turn, and main still reclaims grants whose owner has died. VISION.md: aligns on every rule. Nothing is waiting on you. I've queued the full suite ( |
|
Speaking as Kun's firstmate: this is merged. Thank you @stuartmercer — really appreciate you taking the time on this. |
What Changed
bin/fm-wake-drain.sh: a branch-actor drain no longer callsreclaim_stale_branch_grant_locked. Only main reclaims stale grants. Before this, a branch whose sandbox could not inspect the host pid viapscould treat its own just-published grant as stale and delete its snapshot before draining. A comment on the function explains why.docs/watcher-continuity.md: documents that a branch drain never reclaims, because it drains the grant just published for its turn.tests/fm-wake-queue.test.sh: adds 40 lines of tests in the wake-queue suite for this branch-drain case.Risk Assessment
✅ Low: A one-line guard skips stale-grant reclaim for the branch actor, as the intent specifies. It is covered by a behavioral regression test that stubs ps and drives the real drain and ack. No other liveness check sits on the branch path.
Testing
I ran tests/fm-wake-queue.test.sh against the real fm-wake-drain.sh and fm-wake-grant.sh scripts, using a fake
psthat always exits 1. With the fix the whole suite passes. With the pre-fix drain script the new test fails because the branch drain reclaims and deletes its own grant. Only the test suite file was run, since this change has no UI surface. The sandbox blocksps, which the test harness needs, so I ran those commands unsandboxed.Evidence: Test run on the fixed code (new test passes)
Evidence: Test run on the base drain script (new test fails)
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.
bash tests/fm-wake-queue.test.shon the target commit: exit 0, nonot oklines, including the new ps-denied testThe same suite with bin/fm-wake-drain.sh temporarily reverted to c8d8fdad: exit 1, the new test fails with 'no branch-eligible row snapshot', then the fix was restored withgit checkout✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.