mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 16:03:26 +00:00
Follow-up to the STA-1513 guard: the mechanism is now reproduced rather than
inferred, and the fix is verified against it.
Electron's app.quit() before the ready event terminates the process on macOS
but is deferred on Linux. So a lock-losing launch reaches app.whenReady() on
Linux only, runs the full startup path, and republishes orca-runtime.json with
its own pid before exiting. A minimal two-process Electron probe reproduces it
exactly, and an A/B against the same build confirms the guard:
without guard: final record = LOSER pid=119 (owner alive at pid 25)
with guard: final record = OWNER pid=183 ("GUARD: bailing out")
That matches the reported artifact — a runtime record naming a nonexistent pid
while the live app is bound to a different socket — and explains why the
reporter who captured it was on Linux.
Changes:
- Correct the guard comment: name Linux's deferred quit as the reason, and note
the branch is a no-op on macOS, which quits before ready.
- Assert the guard body actually returns, not merely that it is positioned
first; ordering alone would still pass if the body were emptied.
- Assert in the headless-serve E2E that the on-disk runtime record still names
the owner after the lock-losing launch exits. status.get answers from the
owner's live server, so it cannot observe a clobbered file and would have
stayed green through this bug. That suite runs on ubuntu-latest, which is
where the clobber is reachable.