Skip to content

fix(omp): keep supervision outcome delivery responsive - #107

Merged
dnth merged 2 commits into
mainfrom
fm/port-3767-supervision-outcome-delivery
Sep 5, 2026
Merged

fix(omp): keep supervision outcome delivery responsive#107
dnth merged 2 commits into
mainfrom
fm/port-3767-supervision-outcome-delivery

Conversation

@dnth

@dnth dnth commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Intent

Port upstream firstmate PR kunchenguid#3767 (fix(pi): keep supervision outcome delivery responsive) into this fork (dnth/firstmate).

The persistent supervision branch delivers wake outcomes to the main session: routine verdicts merge back with no turn and captain verdicts open one follow-up turn. Keep that outcome DELIVERY responsive so main receives supervision outcomes promptly and supervision does not silently fall behind.

This is a bounded PORT-ADAPT, not a clean cherry-pick. The upstream Pi diff was inspected at f09de8a. This fork runs an OMP-adapted supervision branch in bin/fm-supervise-daemon.sh plus .omp/extensions, landed as fork PR #63, not the Pi extension. Adapt the shared bash-layer implications directly where applicable, re-express Pi-extension behavior against the OMP branch, and reconcile with the fork's multibrain delivery path and watcher-continuity fix PR #99 in bin/fm-primary-watch-core.ts. If a Pi piece has no OMP equivalent, record the deliberate omission rather than force-fitting it.

Acceptance criteria:

Current implementation decisions: use an awaited OMP async subprocess executor and awaitable OMP grant helpers; serialize OMP ownership checks, outcome append/handoff, and visible report delivery in a delivery queue; retain synchronous ownership checks only for OMP's synchronous offer handshake and shell spawn hook; include the helper in the OMP branch marker hash; leave bin/fm-supervise-daemon.sh process-isolated and preserve bin/fm-primary-watch-core.ts watcher continuity; omit Pi-only processed-outcome reconciliation and Pi renderer/live-TUI guards because OMP has no equivalent path.

Do not merge the PR. Do not push the default branch. Keep the change on the feature branch and deliver a PR against main.

Firstmate-Validation-Generation: e9df3a5a6b498b4627d9afdb25c224dc

What Changed

  • Added awaited subprocess execution and a serialized OMP delivery queue so supervision outcome append, cursor handoff, ownership checks, and visible reports stay ordered without blocking the event loop.
  • Updated OMP branch helper/version hashing and propagated the async executor through fixtures, live/type checks, primary/secondmate coverage, and a regression for responsive ordered delivery.
  • Documented the upstream fix(pi): keep supervision outcome delivery responsive kunchenguid/firstmate#3767 reconciliation, including OMP-specific adaptations, preserved watcher continuity, and deliberate Pi-only omissions.

Risk Assessment

✅ Low: The port is internally consistent: delivery-side subprocesses are awaited and serialized, synchronous checks remain only at required handshake hooks, marker hashing includes the new helper, and the added regression exercises event-loop responsiveness and ordering without source-content-only assertions.

Testing

Ran the focused supervision regression (including the event-loop responsiveness/order scenario), wake routing and primary/session tests, and strict no-emit OMP typecheck successfully; no UI surface exists for screenshot evidence. The real-SDK live guard was also attempted but failed because the broken-branch degrade path did not deliver the expected watcher-wake steer to main.

Evidence: Async delivery regression evidence
ok - OMP outcome delivery yields to the event loop while preserving routine/captain order
TICKS=24
DELIVERIES=routine,captain
Evidence: Live OMP guard failure
not ok - degrade-to-main guard failed: DRIVER_FAIL: a broken branch did not fall the wake back to main via a watcher-wake steer
- Outcome: ⚠️ 1 error across 1 run (8m30s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 1 error
  • 🚨 tests/fm-omp-branch-live-e2e.test.sh - The real-SDK live guard failed in its degrade-to-main scenario: after an intentionally invalid branch model, no watcher-wake steer reached main within the 120-second wait. Portable regression and targeted routing tests pass, but end-to-end fallback behavior remains unproven and may indicate an OMP SDK/environment incompatibility or a product regression.
  • bash tests/fm-omp-branch-supervision.test.sh
  • bash tests/fm-omp-primary.test.sh
  • bash tests/fm-send-turn-start.test.sh
  • bash tests/fm-session-start.test.sh
  • bash tests/fm-wake-queue.test.sh
  • bash tests/fm-omp-branch-types.test.sh
  • FM_OMP_BRANCH_LIVE_E2E=1 bash tests/fm-omp-branch-live-e2e.test.sh
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@dnth
dnth merged commit bcbcb24 into main Sep 5, 2026
15 checks passed
@dnth
dnth deleted the fm/port-3767-supervision-outcome-delivery branch September 5, 2026 11:36
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