Skip to content

mawsd spine: a command that waits on the engine host wakes it from its park - #411

Merged
SSFSKIM merged 2 commits into
masterfrom
parked-host-need
Oct 31, 2026
Merged

SSFSKIM merged 2 commits into
masterfrom
parked-host-need

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

The hang

The setup: the daemon shape, the spine cold, the engine host parked and no app attached. That is the end state of every idle cycle. In that state, a command whose handler waits on the session service's boot never answered: session.intent.list, session.create, session.acquire.

  • Why it hangs. The boot waits for the engine host's first streaming in its load (engineHostSettled). On the daemon shape only two things wake a parked host: an app's attachment, and the discovery wake, which covers DISCOVERY_READS only.
  • Who hits it.
    • P5's core scene: the MacBook's app is quit, and the mini's app asks the MacBook's endpoint to create or acquire a session.
    • The same on machine.sock, from the maws CLI or a sminos bridge.

PR #409's review found it, and #409 logged it as a tracker row. This PR fixes it and removes that row.

The fix: the wait is the need

  • The service. Every service command waits in SessionService.ready(). While the boot has not passed its wait for the host, that wait now tells its host dependency need().
  • The root and the adapter. The spine root passes need() to the spine's hosts adapter. SpineHostsAdapter.need() forwards it only for a load the seam counts as wanted (a client's or the endpoint's command). An event's load still wakes nothing; that is mawsd spine: an event's load wakes no engine host nobody wants #409's invariant.
  • The daemon. It receives the need as needEngine and does two things:
    • Restarts the park clock from the need (DaemonClocks.engineNeeded). Without this, after an idle period the clock's ask is overdue the moment the woken host is ready, and the host exits before the boot. The unit test shows that without the restart the second idle cycle's command never answers. A need that comes during a discovery wake also leaves that wake's park to the clock.
    • Pings a host that is not streaming (engine.ping). The supervisor holds the ping while the host starts or closes, and launches a parked host for it. That is the supervisor's existing hold-and-launch; the supervisor and its link are unchanged.
  • No command list. Any service command that waits on the boot counts, so no list has to be kept in step with the handlers.
  • What still wakes nothing:
    • a command that never waits on the boot (attention.list, for example);
    • an event's load.
  • The idle cycle still ends parked and cold. The woken host is asked to park once the idle time has passed from the need, the spine releases once quiet, and a private mawsd exits once idle.

Tests

  • src/mawsd/daemon-parked-need.test.ts (new). It runs the real daemon in process with the product's options, the services entry as its spine, and a stand-in engine host on the real socket layer.

    • Two idle cycles, each with the spine cold and the host parked. A machine.sock client's session.intent.list and the endpoint's session.create and session.acquire answer within DISCOVERY_WAKE_BOUND_MS (8 s). That is the bound a discovery read keeps for the same callers: the tightest caller deadline, 10 s, less the answer's way back.
    • The woken host is not asked to park at once. Each cycle ends with the host parked and the spine cold.
    • A second case: attention.list loads the spine and wakes nothing.
    • On master the command gets no answer.
  • src/mawsd/spine-event-wake.test.ts. Three cases run over the real root and the supervisor core:

    On master the boot-waiting cases fail. mawsd spine: an event's load wakes no engine host nobody wants #409's cases stay green.

  • src/mawsd/clocks.test.ts. Two cases: a need restarts the park clock, and a need during a discovery wake leaves its park to the clock.

  • e2e/supervisor.spec.ts case (n), daemon shape only.

    • The app quits unbusy, the spine releases, and a CLI link is held open while mawsd's idle clock parks the host.
    • session.intent.list over machine.sock then wakes a new engine host and answers within the bound.
    • The woken host is asked to park at least the idle time after the need, and mawsd then exits by itself.
  • unit:darwin is not reached. No file in scripts/darwin-unit-files.sh imports, directly or transitively, a file this PR changes.

Review

One doperpowers:reviewer-medium pass. Its one finding (P2) is fixed in c6dbe964f.

  • The finding: a need told while the link streams but the load's barrier has not passed asked nothing of the supervisor. A host already asked to exit when idle could then go, park, and strand the boot.
  • The fix: SpineHostsAdapter keeps the need until its load streams, and tells it again when the link leaves ready. The daemon's ping is then held across the close, and the successor launches for it.
  • Its test: spine-event-wake.test.ts covers the overlap (the barrier's resync unanswered, the host armed, the command, then the host's idle exit). It fails without the fix.

The same commit lists case (n)'s bound in gate-plan.test.mjs's LIVENESS_BOUNDS, with its reason. The static gate's raw-time-bound check requires it.

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

…s park; the session service's boot waits for the host's first streaming, so a command waiting on the boot (session.intent.list, session.create, session.acquire) is the need: a wanted load's adapter tells the daemon, which restarts the park clock from the need and pings the host through the supervisor's hold-and-launch; a command that never waits on the boot, and an event's load, wake nothing; unit-tested over the supervisor core and through the daemon (both fail on master), e2e:supervisor-daemon case (n); the tracker row PR #409 added is closed

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-31T17:28:00.692683Z 5ac05bf 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.

…exit when idle that goes after the need was told (the link streaming, the load's barrier not passed) has its successor woken for it (PR #411's review); e2e case (n)'s bound listed as a liveness bound with its reason (the static gate's raw-time-bound check)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
@SSFSKIM
SSFSKIM merged commit 4118fa6 into master Oct 31, 2026
SSFSKIM added a commit that referenced this pull request Oct 31, 2026
…parked one (PR #411, master 4118fa6); O4 M2 accepted at its first stop, with dashboard-live-data's long case (red on master since UX2-L) fixed on its branch; the wave 2 ledger gains the spine's wanted and need names, O4's delivery log line and the shared cross-build samples file

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)
SSFSKIM added a commit that referenced this pull request Oct 31, 2026
…for landing 1

O7 M2 (#410), CI-opt's #412 (LAUNCHD_E2E, the sweep before gate-peer.sh stop) and #416 (e2e:remote on the hosted Macs),
#411, #414, #415. Conflicts reconciled side by side: the render and remote namespaces in names, grades, schema and
its test, and the link surface's client rules; the router's host binding keeps daemonRenders under master's routeLaneB;
the default-spec count is 103 (render-host and remote); gate.yml's comment keeps both groups' notes. #410's
host-supervisor forward and StandIn.clients hunks merged to master's text (no duplicate). The wire minor and the
generated snapshots follow in their own commits.

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Oct 31, 2026
…est is never sent to a host leaving under it

On the merged tree a request right after a discovery wake's park still failed (process-park-race.test.ts, RED:
artifacts.create answered host_unavailable "engine-host disconnected before answering"). Its path is the front's
forward to hosts.forward (a bare client's, the render host's reads for another machine's Export), which #411's need
does not cover. engine-requests.ts now carries every client request to the engine host through mawsd (the front's,
the endpoint's, the artifact endpoint's lookups, the render seam's answers): each is a need (the park clock restarts
from it), no park is asked while any is in flight (DaemonClocks.engineRequests), and one that arrives after the ask
waits for that host's exit (then the supervisor starts the next for it), or takes the ask back from a host still
serving after EXIT_SETTLE_MS (live rows). e2e:machines' machine-side scene no longer waits for the park.

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