Skip to content

id-worlds: native transport for the lease-handoff path (#17519, #13938 item 3) - #17652

Merged
developing-today-fleet[bot] merged 3 commits into
mainfrom
lane/1437L-17519-native-transport
Dec 1, 2026
Merged

developing-today-fleet[bot] merged 3 commits into
mainfrom
lane/1437L-17519-native-transport

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #17519. Slice of #13938 item 3; refs #17197, #2819.

What

Native transport for the world-actor lease-handoff path in pkgs/id (id-worlds), new module world::native_handoff:

  • Handoff initiation/completion travel as length-prefixed JSON frames over a Unix domain socket (NativeLink / NativeListener / initiate_native_handoff / serve_native_peer / NativeHandoffPeer).
  • A peer crash holding the lease is a real transport failure: socket EOF surfaces as NativeTransportError::PeerGone.
  • A DO/node partition with both sides alive is a real transport partition: NativeLink::partition shuts the socket down while both endpoints keep running; sends fail with NativeTransportError::Partitioned.
  • The journal prefix, mirror position receipt, and replay-barrier verdict cross the wire as the production JournalEntry / MirrorPositionReceipt values, so the AppendStamp chain (item 1) and the replay barrier + mirror receipts (item 2) operate unchanged — no invariant weakened to fit the transport.
  • Production discipline matches the actor's rule: the local handoff is journaled only after the peer replays the prefix and answers Complete; a transport failure, stale-epoch refusal, or standing barrier aborts with nothing journaled. The in-process seam remains only as a test seam for the pre-existing walkthroughs.

Oracle

Model: in every #17197 scenario run over the native transport, the journal contains appends from exactly one writer per epoch and no append crosses the replay barrier.

The four walkthroughs re-run at native fidelity in world::native_handoff::tests:

  1. Crash — native_crash_holding_the_lease_surfaces_as_peer_gone: peer is a real child process holding the lease; SIGKILL mid-lease; the initiator learns of it from the transport (PeerGone).
  2. Partition — native_partition_with_both_sides_alive_refuses_and_heals: socket shutdown with both sides alive refuses the initiate as Partitioned with nothing completed; after heal (fresh link) the same handoff completes.
  3. Expiry / stale epoch — native_stale_epoch_completion_is_refused: a completion/initiation under a dead epoch is refused StaleEpoch over the transport.
  4. Mirror lag — native_mirror_lag_at_handoff_keeps_barrier_until_replay_catches_up: replay at 3 against a mirror-confirmed position of 5 refuses BarrierPending; replay at 5 completes; exactly-one-writer asserted over the resulting journal.

Reduced fidelity, named (never silent)

Scenarios 2–4 run their peers as threads of the test process over the production socket/framing/partition code; scenario 1's peer is a separate OS process. The peer WorldCore is restored from the journal prefix received over the wire in every case.

Verification

Fleet queue dispatch run 46513229272 (developing-today-forks/fleet) running cargo test -p id-worlds native_handoff on this branch — result cited on #17519 before merge. CI is not a gate; merge judgment is the full diff against the issue's acceptance criteria plus that test evidence.

— lane 1437-L (alpha DRIVE 2026-11-30)

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-30T21:08:16Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…item 3)

Unix-socket transport (length-prefixed JSON frames) for handoff
initiation/completion between the DO writer and a native writer:
peer crash surfaces as transport EOF (PeerGone), a partition with
both sides alive as a real socket shutdown (Partitioned), and the
journal prefix / mirror receipt / replay-barrier verdict cross the
wire as the production JournalEntry values, so the AppendStamp
chain (item 1) and replay barrier + mirror receipts (item 2)
operate unchanged.

The four #17197 walkthroughs re-run at native fidelity in
world::native_handoff::tests: crash (real child process, SIGKILL),
partition (socket shutdown + heal), stale-epoch refusal, and
mirror lag (barrier pending until replay reaches the
mirror-confirmed position), each asserting exactly one writer per
epoch over the journal.

Named reduced fidelity: scenarios 2-4 peers are threads of the
test process over the production socket code; scenario 1's peer
is a separate OS process. Named here, on #17519, #17197, #13938.

Refs #17519, #13938, #17197
@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4c029a39-9a6d-47f3-8fe4-5e99ac9e4dc2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Shepherd fix by lane 0900-HT: verification run 46538886529 at the
previous head failed to compile with E0432 (no Shutdown in
os::unix::net); the earlier run 46513229272 that reported success
never compiled anything (cargo cache permission error masked by a
trailing pipe). Refs #17519.
Shepherd fix by lane 0900-HT: verification run 46540921917 at the
previous head compiled and ran the full id-worlds suite — 1383
passed, 1 failed. The partition test's heal-reconnect could land
in the stale listener's backlog (kernel completes the connect,
nobody accepts), so the retried handoff read timed out (EAGAIN).
The healed listener now binds a new socket path that only it
serves. Test-only; production transport unchanged. Refs #17519.
@developing-today-fleet
developing-today-fleet Bot merged commit b8d15c6 into main Dec 1, 2026
2 checks passed
@developing-today-fleet
developing-today-fleet Bot deleted the lane/1437L-17519-native-transport branch December 1, 2026 00:26
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.

[audit7] #13938 slice: native transport for the lease-handoff path (item 3)

1 participant