Wire M10.8c-1 region handoff: protocol v4, durable probes, crossing, ghosts
Foundation / checks (deploy) (push) Successful in 3m29s
Foundation / checks (ecs) (push) Successful in 2m0s
Foundation / checks (client) (push) Successful in 12m51s
Foundation / checks (network) (push) Successful in 13m0s
Foundation / checks (tsan) (push) Successful in 7m50s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 32m4s
Foundation / checks (postgres) (push) Canceled after 19m13s

ADR-0096. Session protocol v4 (v3 is deployed and frozen) adds HandoffOffer,
SessionRedirect, close reasons handed_off and moved, and ghost marker records.
Sessions use the durable probe record: logins open it where it was saved
(redirected when it lives elsewhere), and session ends save it. A marker
crossing into a neighbour's area is frozen, prepared, its control released
and a signed ticket offered; uncommitted transfers are aborted after the
ticket's lifetime. The destination shows arriving probes as ghosts (schema
v13 incoming_probe_transfers) and opens the marker where it crossed.

Refreshes the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 21:24:42 -04:00
co-authored by Claude Opus 5.5
parent 97a3756e46
commit a7a3d12283
39 changed files with 1315 additions and 68 deletions
+44
View File
@@ -143,3 +143,47 @@ controllable before M11.
`capacity`.
- Not yet: the source side (freeze at the edge, prepare, release control, offer the ticket),
the client switch, keys in evo-server and the dev tool (10.8c).
## M10.8c-1 region wiring (2026-10-06)
- **Session protocol v4** ([session-v4](../../schemas/network/session-v4.md); v3 was deployed
and is frozen) adds:
- `HandoffOffer` (transfer id, destination address, ticket);
- `SessionRedirect` (where the probe is, before Welcome);
- close reasons `handed_off` and `moved`;
- marker kind 2 (ghost).
- **Durable probes in sessions** (`ProbeLedger`, `include/evo/server/probe_ledger.hpp`).
- A grant login opens the account's probe record after the durable control claim.
- Owned here and active: the marker opens at its saved position, clamped into this
region's area, so a probe left beyond the edge by an aborted handoff does not cross
again at once.
- Owned elsewhere: Redirect (when that region is a known neighbour), then `moved`.
- Frozen: `capacity` (retry once the transfer is decided).
- The position is saved at session end, but not after a handoff.
- **Neighbours.** A region owns its area; markers move within the bounding box of its area
and its neighbours'. Every poll, a marker that left the area into a neighbour's area is
frozen and its transfer prepared. Then the session's control is released, a ticket is
signed (lifetime 30 s; its session expiry is the session's), the HandoffOffer sent, and
the session closed with `handed_off`. Anywhere else, the marker is put back at the edge.
An outgoing transfer not committed within its ticket's lifetime plus 5 s is aborted (the
probe resumes here); undecided aborts retry.
- **Destination.** The ticket admission now returns the probe's state after the switch
(`HandoffAdmission`), and the marker opens there. Every second (configurable) the region
reads the open transfers addressed to it (schema v13 `incoming_probe_transfers`) and shows
them as ghosts: stable ids per transfer, read-only, replicated to sessions whose square
holds them, and gone once decided.
- **Configuration.** Handoffs need probe records, this region's handoff key and neighbours. A
handoff key without probe records is a configuration error.
- **Evidence.** `two_region_handoff` (`tests/quic_sessions.cpp`): two regions with adjacent
areas in one process, over a fake world database with the v12 state machine. It covers:
- a crossing at the border;
- a ghost seen by another client at the destination before the switch;
- the ticket login (owner and generation moved, marker where it crossed);
- the ghost giving way;
- a redirect at the old region;
- a crossing back;
- an abandoned handoff aborted after its deadline, with the probe resumed at the edge and
the late ticket refused as expired.
It passed 3 times in a row on Linux and also passes on Windows.
- Not yet: the engineering client's switch (offer, redirect, multi-region grants),
evo-server and probe configuration (10.8c-2), and real processes on PostgreSQL (10.8d).