Skip to content

mawsd spine: an event's load wakes no engine host nobody wants - #409

Merged
SSFSKIM merged 2 commits into
masterfrom
spine-event-wake
Oct 31, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
spine-event-wake

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

The race

On the daemon shape, with no app attached, mawsd asks the engine host to exit when idle and the spine releases on its own quiet clock (MAWS_SPINE_QUIET_MS, 10 s). A session's idle release that lands just after sends events that load the spine again (spine-seam.ts, wake → ensure('event')). That load's parts talk to the engine host as it exits. A request that lands between the host's close and its park is held by the supervisor core, and the park then launches a successor for it: a pointless engine-host respawn and another idle period. P5 O16's M2b found it in e2e:supervisor-daemon case (e) (runs 41214627305 and 41217185059). Under the new unit test on master, the held request is the index source's fs.state: its sync() chains fs.bind/fs.scan/fs.state whatever each answers.

The fix

The invariant is stated in spine-seam.ts, where the spine decides: a load that only the engine host's events caused never wakes or respawns an engine host nobody wants.

  • The seam. It marks each load wanted from its trigger, and marks it wanted once a need reaches it, which is any ensure for a command or the endpoint.

  • The adapter. The spine's single path to the engine host, SpineHostsAdapter.dispatch, refuses an engine-host request at once (host_unavailable) when the load is not wanted and the host is not ready. Such a request is then never held for an exiting host, and never launches a parked one. A ready host is still sent everything.

  • Nothing is lost. A newly welcomed host already gets its configuration from each part at its welcome:

    • the configure relays (engine.configure, engine.policy.set, host.configure, artifacts.setDefaults) push at every ready;
    • the index source syncs at every streaming;
    • the session source's resync runs at each barrier.

    So the next host that is wanted is configured then, by the same path.

  • A real need still wakes the host as today. That covers a command-caused load, or a client's or the endpoint's command reaching an event-caused one.

Tests

  • src/mawsd/spine-event-wake.test.ts (new) runs the real services root over the real supervisor core, with mawsd's on-demand detached engine host on test/support/fake-supervisor.ts. It replays case (e)'s timeline:
    • No respawn. No second engine host is spawned and the host parks. This fails on master, with mawsd's log showing the spawn.
    • Configuration. The next wanted host gets engine.configure, engine.policy.set, host.configure and fs.scan at its welcome, under the same event load.
  • src/mawsd/spine-seam.test.ts has one new case for the gate's semantics. An event load sends a host that is not ready nothing, a ready host everything, and after a need everything. A command load sends everything.
  • Local runs: spine-seam, spine-event-wake, daemon-spine, daemon, daemon-permanent, front, daemon-lock and host-supervisor passed (168 tests). eslint is clean on the touched files, and tsc -p tsconfig.node.json is clean.

Review

One doperpowers:reviewer-medium pass found one issue, and I deferred it. A spine command whose handler waits on the session service's boot (session.intent.list, for example) does not answer while the engine host is parked and no app attaches. The boot waits for the host's first streaming. On master the race's pointless respawn happened to leave the host up after the race, so such a command answered. With this PR the post-race state is the same as the end of every other idle cycle (the spine cold and the host parked), where master already hangs on that command: a command load with the host parked answered no session.intent.list within 4 s on master's seam. Fixing it means deciding which commands are a need for the engine host (a product call next to the discovery wake), so it is logged in docs/tech-debt-tracker.md rather than patched here.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)

…o engine host until a need reaches it; its adapter sends a host that is not ready nothing, so the release's events no longer respawn an engine host exiting when idle (P5 O16 M2b's daemon (e) race: the index's fs.state was held across the host's close and launched a successor at its park); every part configures the next wanted host at its welcome; unit-tested over the supervisor core, failing on master

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-31T16:36:59.566985Z a287c43 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

…oot never answers while the engine host is parked and no app attaches (pre-existing on master's idle end state; PR #409's review)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit d3b3ea2 into master Oct 31, 2026
SSFSKIM added a commit that referenced this pull request Oct 31, 2026
…ents no longer wakes an engine host no one wants (PR #409, master d3b3ea2), with a follow-up for a command waiting on a parked host; a machine that another paired app watches stays loaded (item 5's cold reading needs no other app's channel open); the tracker gains e2e:discover's catalog-backed 5 s assertions

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 31, 2026
… conversation over the RL2 link and lane B placement reading the spine's record first, its merge gated onto master after #409 and #411; unit-daemon e2e groups never on the mini's home runner; O5 M4's two departures accepted; the wave 2 ledger gains O5 M4's names and shared files

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
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