Skip to content

fix(pi): close routine stale wake acknowledgment gap - #98

Merged
withally merged 2 commits into
mainfrom
fm/fm-branch-routine-ack-gap-b1
Aug 31, 2026
Merged

withally merged 2 commits into
mainfrom
fm/fm-branch-routine-ack-gap-b1

Conversation

@withally

Copy link
Copy Markdown
Owner

Intent

Fix the Pi supervision branch so routine identical stale wake offers are never accepted and forgotten: preserve bounded coalescing, defer one normal durable-queue recheck after the active eligible-row snapshot settles, acknowledge any remaining branch-owned row, leave already-consumed rows as an empty no-op, and cover both boundaries without changing wake-drain, wake-grant, parent stall detection, or fm_branch_report.

What Changed

  • Track identical stale: offers received while a branch turn’s eligible-row snapshot is in flight, then perform one normal durable-queue recheck after the turn settles, with generation and shutdown cleanup.
  • Extend Pi supervision documentation and regressions to cover stale rows arriving before and after the snapshot, including remaining-row acknowledgment and already-consumed empty no-op behavior.

Risk Assessment

✅ Low: The patch is narrowly scoped to serialized stale-wake bookkeeping and covers both pre- and post-snapshot boundaries without changing the owned drain, grant, watcher, or report paths.

Testing

The target passes bounded coalescing, post-snapshot durable recheck, branch acknowledgement, consumed-row no-op, wake-drain, wake-grant, parent-stall, fm_branch_report, and real-Pi-SDK checks. The worktree is clean and reviewer-visible CLI evidence is captured.

Evidence: Pi branch routine stale-wake evidence

Source: Pi branch routine stale-wake evidence

Target boundary passed; base reproduced timeout at deferred acknowledgement; real Pi SDK 0.84.2 passed; preserved contract files unchanged.

Pi supervision routine stale-wake boundary evidence
target=8494a17dd4fc9b90bdba248132c45136e6de3f6a
base=95b76889d0f4497251f6a5896de370ba6d604e88
target_boundary_status=0
ok - Pi branch coalesces routine floods, bypasses urgent delay, and rechecks post-snapshot stale rows
base_boundary_status=1 (expected non-zero regression)
not ok - Pi branch must recheck an accepted identical stale row after the current snapshot settles: <anonymous_script>:214
  throw new Error(`timed out waiting for ${label}`);
        ^

Error: timed out waiting for deferred acknowledgement for the post-snapshot duplicate
    at settle (eval at <anonymous> �[90m(file://~/.no-mistakes/worktrees/37852af5566c/01M1BY8767NGWFHAZHAD7GE982/�[39m[eval1]:2:7), <anonymous>:214:9�[90m)�[39m
    at async �[90mfile://~/.no-mistakes/worktrees/37852af5566c/01M1BY8767NGWFHAZHAD7GE982/�[39m[eval1]:92:1

Node.js v24.20.0: expected exit 0, got 1
real_sdk_status=0
ok - real Pi SDK 0.84.2 accepts the branch session construction and preserves an unpromptable wake
ok - real Pi SDK 0.84.2 applies an explicit branch model on create and over a reopened session's recorded model
ok - real Pi SDK 0.84.2 reports its own supported effort levels and applies an explicit branch effort over a reopened session's recorded level
ok - real Pi SDK 0.84.2 delivers a custom message to the provider as user text carrying only content, so the captain outcome's typed envelope is what reaches the model
preserved_contract_files=unchanged

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-pi-branch-extension.test.sh
  • bash tests/fm-wake-queue.test.sh
  • FM_PI_BRANCH_LIVE_E2E=1 bash tests/fm-pi-branch-live-e2e.test.sh
  • bash tests/fm-branch-supervision.test.sh
  • Focused test_branch_coalesces_repeat_wakes_and_bypasses_for_urgent_work against target and base extension implementations
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@withally
withally merged commit 9802c61 into main Aug 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant