Skip to content

P5 O12 M11: the spawner as owner (MAWS's half: the launch's MAWS_LAUNCHED_BY and proof file, the endpoint's bridge and handed-off mark, the endpoint ledger's orphanAtOpen) - #431

Merged
SSFSKIM merged 10 commits into
masterfrom
p5-o12-m11
Nov 1, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is MAWS's half of P5 O12 M11, "the spawner as owner" (docs/doperpowers/plans/2026-10-27-p5-o12-sminos-owners.md, M11 and Interfaces §H). sminos's half landed first, as doperpowers #450 (sminos 1.28.0).

A lane B session that a member spawns on another machine through session.spawn is now that member's from its first second, without waiting for that machine's sminos to list it. Once this lands, O7 can drop its main-side wait of up to 60 s.

  • The launch.
    • LaunchSpec.launchedBy carries the session's own launchedBy. The start reads it from the intent; every resume reads it from the record, through session.start, session.acquire and the acquisition's no-output retry. A fork and the trust bootstrap get none.
    • Before each such launch, the spine writes a proof file, <userData>/sessions/launched-by/<appSessionId>.json, mode 0600, atomically. It holds the canonical {member, device, opId, action}, and a write that fails fails the launch.
    • session.delete removes the file, as do a setup's rollback and the recovery when they remove a provisional record.
    • buildEnvironment sets MAWS_LAUNCHED_BY ({appSessionId, member, device, opId, proofFile}) beside MAWS_LANE. A captured value never passes to a session without a spawner (EXCLUDED_KEYS).
    • WIRE_MINOR is 16.
  • The endpoint's bridge.
    • Placement (laneB) returns the spine record's spawner beside the target.
    • Reads.record answers {owners: [spawner], access: 'private'} for a lane B target that sminos holds no record for, while its app session isn't handed off. Every reader in one decision sees that answer, and the bridge's standing is part of recordsMoved.
    • A query takes the spawner from its own placement.
    • During an index lag, unavailable goes only to a caller standing on the recorded engine session, the bridge counting; everyone else hears grade. This is P5 O7 M4: diff, files, uploads and spawn on another machine; history over the channel #427's order.
  • The handed-off mark (handed-off.json in the endpoint's state directory).
    • It records each lane B app session a sminos record was seen for, durably, before the record is used. After that, a missing record fails closed with grade: across an endpoint restart, a /clear and a gone.
    • A record the join hasn't placed yet is marked by its engine session, and that mark passes to its app session once placed.
    • A mark that can't be written withholds the record.
    • The mark is pruned once a process, against session.list.
  • The endpoint's op ledger opens with orphanAtOpen. Its actions are idempotent, so a claim the last process left unfinished answers expired.

The plan's corrections (the lag order, a query's placement, the proof file's place, sminos's binding file name) and the residue are in O12's Decision Log entry "M11's MAWS half as built". The tech-debt tracker gains three rows; the wave 2 ledger gets M11's names as built.

Residue

Each item is accepted in the Decision Log.

  • (a) Unwritable state directory. If the state directory refuses writes and the endpoint restarts before a write holds, the sight is lost.
  • (b) A record the join can't place. This happens when a /clear replaced the record's engine session before the record arrived, or while the join was in flight. The bridge then holds on the new engine session until that session's record arrives. It matters only once O8 can move owners in the first seconds. The fix, mapping the record to its app session by ownersProof[0].opId, is a tracker row due before O8's record actions.
  • (c) Unpruned engine-session marks.
  • (d) Diagnostics' dev "Resume live" launches without the spawner. Dev builds only.

Tests

Acceptance 10 (MAWS side):

  • The launch (src/services/sessions/spawn.test.ts): through machine.op, with a genuinely sealed action (signStepUp, isAction). The proof is canonical and 0600 when session.launch runs, and its envelope passes sminos's check.
    • A resume rewrites a lost proof.
    • A fork, the trust bootstrap and a session nobody spawned get no variable.
    • session.delete removes the proof.
    • Every launch is passed through buildEnvironment.
  • An acquisition and its retry (service.test.ts).
  • Unit cases in launch.test.ts, launch-mapping.test.ts and file-session-state-store.test.ts.
  • The bridge (test/endpoint/targets.test.ts, "the spawner as owner", 13 cases):
    • every reader;
    • the record deciding on arrival, including re-deciding mid-decision;
    • the gap before the index has an engine session;
    • the lag;
    • no launchedBy;
    • never again after a gone, a /clear, a restart, and a restart with the join outstanding;
    • pruning, and a failing write.
  • The ledger (test/endpoint/actions.test.ts): an unfinished endpoint claim reopened answers a query expired and a new act in-progress. It fails without the option.

Gate: static,unit GREEN on 85c1a90, run 41289857321. The head 4f908f8 (master merged and the docs) is GREEN too, run 41291960996. The merge gate's --gates all then failed e2e:remote, whose first spawn step pinned the wait from before M11, so that step now pins M11's end state (d10985d). --gates all on d10985d, run 41299237023: 55 green including e2e:remote; one red, unit 2/4's src/engine-host/documents/search.test.ts ("never extracts a large artifact in the background … a search still catches it up"), which M11 doesn't touch and which passed on 4f908f8. --gates unit on the same head is GREEN, run 41303512172.

Review

Built by an executor (opus) on O7 M4's head, then master merged in.

  • doperpowers:reviewer-high, two rounds. Every code finding was fixed:

    • the mark made durable before any record is used;
    • an unplaced record marked by its engine session;
    • a bridged subscription held at the first record;
    • the engine session marked before the join awaits;
    • an engine-session mark passed to its app session once placed.

    Two design findings were accepted as residue (a) and (b).

  • doperpowers:reviewer-medium on the merged branch.

    • One P1, (b)'s race variant (a /clear during the join), folded into (b).
    • One P2, (d), logged.

The review stopped there: the last round found only residue.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)

…proof file and MAWS_LAUNCHED_BY

A session a remote member spawned (its record's launchedBy, written once by
session.spawn) launches with its spawner named, at its start (from the intent)
and at every resume (from the record): LaunchSpec.launchedBy is the record's
launchedBy less the sealed action, which the spine writes to
<userData>/sessions/launched-by/<appSessionId>.json (0600, canonical JSON of
{member, device, opId, action}, temp file, fsync, rename) before each launch
that names it, so a resume after the file was lost writes it again. A fork, the
trust bootstrap and every session without launchedBy name nobody. The proof goes
with the record (session.delete, and the setup's and the recovery's removal of a
provisional record).

The engine host sets MAWS_LAUNCHED_BY (canonical JSON) beside MAWS_LANE=B and
SMNS_MEMBER when the spec names a spawner, over any captured value, and never
passes a captured one. The stored launch spec leaves launchedBy out, as it does
P2-C's keys. session.launch's spec gains an optional property: WIRE_MINOR 16.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…cord arrives

Lane B placement (targets.ts's laneB) answers the spine record's launchedBy
beside the placed target, never inside SessionTarget, and a query carries the
spawner its placement read. In a decision, Reads.record bridges: for a lane B
target the record source holds nothing for, whose app session it has never
seen a record for, and whose spine record names a spawner, the record read is
{owners: [the spawner], access: 'private'}. Every reader in one decision sees
that one answer, and recordsMoved compares the bridge's standing, so a record
arriving mid-decision (or one that came and went) takes the decision again. A
lagging index stays unavailable to the spawner and grade to everyone else, as
the placement rule says; no spine launchedBy, no bridge.

The first sight of a record is kept on disk per appSessionId, handed-off.json
in the endpoint's state directory (rl10/members.ts): marked at the lane B join
and at any read of a lane B record placed under its appSessionId, before the
read answers; pruned once a process of the app sessions the spine no longer
holds (session.list). Once marked, a missing record is grade for everyone,
after an endpoint restart, a /clear and a gone alike. An unenroll leaves the
file. A record source that does not say (handedOff absent) bridges nothing.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
endpoint.grant and endpoint.state are idempotent, so a claim the last process
left unfinished answers a query expired, with no read-back, and a new act under
its id stays in-progress, running nothing. The engine host's host.op keeps the
old rule (O16 M3c's); op-ledger.ts's header says so.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ach launch; launch.test's spawner typed with its branded id

spawn.test's start, resume, fork, bootstrap and unspawned launches each pass
through buildEnvironment over a capture holding another MAWS_LAUNCHED_BY: the
spawned session's carry its spec's, the rest none. launch.test's spawner
fixtures take AppSessionId, which tsc requires and vitest does not check.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…By.appSessionId

The launch spec's spawner names its app session as an AppSessionId, which the
codec addresses as it does spec.appSessionId; the coverage snapshot is rewritten
with MAWS_ADDRESS_PATHS_WRITE=1 (CI's unit 1/4 caught it).

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…nplaced record marked by its engine session, a bridged subscription held at the first record

From the branch's independent review (reviewer-high, three P1s and a P2):
- A mark that can't be written yet no longer counts as written: the record is
  withheld (Members.record answers none) and the session reads as handed off,
  closed to everyone, until a later write holds; nothing is decided on a sight
  a restart would forget.
- A lane B record the join can't place under its app session (the engine host
  away, or not listing it) is marked by its engine session; handedOff takes the
  target, so a placement on that engine session after a restart finds it. The
  engine session's mark goes once its record is joined.
- A member frame tells the record's listeners before the join awaits the engine
  host, by its engine session, and again once joined: a subscription the bridge
  granted is held at once by a first record that grants its spawner nothing.
- An acquisition's resume and its no-output retry are pinned to find the proof
  before each launch (service.test).

handed-off.json gains engineSessionIds beside appSessionIds.

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ngine session's mark passed to its app session once placed

From the review's second round:
- A lane B record not yet joined is marked by its engine session before the join
  awaits the engine host, so a restart while the join is outstanding loses
  nothing.
- A placement that lands on a marked engine session (handedOff) marks its app
  session in its stead, as the join and a record read do, in one write that
  drops the engine session's mark, so a /clear after it stays covered.
- The held-subscription test captures the inbox before the first record goes
  (on CI the subscription ended before the old capture, unit 2/4).

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…he lag order and a query's placement corrected, Interfaces §H's proof file, sminos binding file and handed-off mark as built, the Decision Log entry (residue, review); three tech-debt rows; the wave 2 ledger's M11 names

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
…ane opens B's spawned session with nothing listed on B, never says it can't place it, and no waiting line stays; B's sminos lists it afterwards (the merge gate's red, run 41293457305)

Sminos-Session: p5-desk-track-owner#b4948247 (doperpowers on macbook)
@SSFSKIM
SSFSKIM merged commit 15c8f02 into master Nov 1, 2026
@SSFSKIM
SSFSKIM deleted the p5-o12-m11 branch November 1, 2026 12:00
SSFSKIM added a commit that referenced this pull request Nov 1, 2026
…17 (M3's entry after M11's 16, the manifest regenerated from master's); QueryBinding's launchedBy beside StreamBinding; a pty-host query's binding placed nowhere (M3) with M11's spawner read for the others; the endpoint ledger's orphanAtOpen note naming forward.open

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 1, 2026
…), WIRE 16; the spawner as owner from a session's first second; residue (b) an edge on O8's record actions; O17 corrected to cua #251's pins; two flake rows and the worktrees signature

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 1, 2026
… fallback, the #431 merge at WIRE 17 with the listing wait removed, the in-app browser's tabs for a remote session as an allow-list)

Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM added a commit that referenced this pull request Nov 1, 2026
…432, O12 M11 #431, O7 M3 #433, O17's document #430, O7 M5 re-plan #434 and #436, #437, #438) into p5-o16

The WIRE retake: master is at WIRE_MINOR 19, so O16 takes 20. The comment keeps master's entries through (19); O16's
additions (M2, M5, M3b, M3c fix wave 2), named under (16) on the branch, now follow under (20). WIRE_CAPABILITIES is
master's list plus host.holder. The manifest is master's (minor 19) regenerated with pnpm wire:manifest at 20: against
master it adds commands.daemon.restartEngineHost, commands.host.handover and events.daemon.engineHandover, changes
O16's additive status and supervisor fields, and lists host.holder. routes.json auto-merged and its pin holds.

Conflicts, each resolved keeping both sides:
- src/shared/ipc/wire.ts: WIRE_MINOR 20 as above.
- src/shared/ipc/wire-manifest.json: master's, regenerated (above).
- src/shared/host/detached-transport.ts: O16's report() (the status ask before the link is reported) keeps its shape;
  O5 M5's socketFd joins the port it reports.
- src/shared/host/op-ledger.ts: the orphanAtOpen comment names the services', the endpoint's (O12 M11) and the engine
  host's (O16 M3c) ledgers; none opens without it now.
- src/mawsd/daemon.ts: O5 M5's session.removed listener and O16's tellEngineHandover side by side; at the stop, O5's
  cua socket close and cache watch end, then engineHandover.stop().
- src/mawsd/front.ts: FRONT_COMMANDS holds daemon.restartEngineHost and session.capabilities.
- src/mawsd/cli.ts: O16's sessionHostsLine and O5 M6's renderText.
- src/engine-host/launch.ts: O12 M11's MAWS_LAUNCHED_BY and O16's MAWS_HOLDER_SOCKET.
- src/services/spine-root.test.ts: FRONT_EVENTS holds session.capabilitiesChanged and daemon.engineHandover.
- test/support/mawsd-scene.ts: the stand-in's events hold O5 M5's session.status and O16's maws.pane.show and
  host.supervisorStatus.
- scripts/mawsd-pack.test.mjs: O16's two session host pack tests and O5 M6's two --render tests.
- devenv/validate.sh: the header names the session host check and the render runtime check; both run.

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