Add M10.8a probe handoff schema v12 and store
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (client) (push) Successful in 12m32s
Foundation / checks (network) (push) Successful in 12m17s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 2m2s
Foundation / checks (postgres) (push) Canceled after 3m48s
Foundation / checks (checks) (push) Canceled after 16m29s

ADR-0096, the persistence handoff ADR (EXPERIMENT probes, ADR-0094). Durable
probe records hold one owning region per account, so ownership is unique and
the test inventory is conserved by construction. A fenced transfer state
machine (prepared, staged, committed, aborted) under each caller's exact
region lease returns the recorded outcome on every retry; a commit requires
staging by the destination's current epoch; aborts are durable and only
before commit. handoff_account_control moves account control on a committed
transfer.

A PostgreSQL fault matrix covers restarts at each transition, stale epochs,
failed destinations, partitions and commit/abort races, checking one owner and
the conserved inventory after every scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 18:15:49 -04:00
co-authored by Claude Opus 5.5
parent 5728e7682e
commit 6a645ef7e4
18 changed files with 1355 additions and 16 deletions
+46
View File
@@ -0,0 +1,46 @@
# Probe records and handoff, version 1
EXPERIMENT (ADR-0094, ADR-0096; schema v12, migrations/0012_probe_handoff.sql). Durable
state of the non-biological probes and their cross-region transfers. It is reached only
through the fenced functions, and C++ callers use include/evo/persistence/probe_store.hpp.
## Probe record (`evolution.probe_records`, one per world and account)
| Field | Type | Rule |
|---|---|---|
| region_id | u64 | The single owning region |
| generation | u64 | > 0; + 1 at each committed transfer |
| x, y | bigint | Micrometres |
| z | bigint | Cell slice |
| inventory | u64 | EXPERIMENT test inventory; never copied, only moved with ownership |
| transfer_id | uuid or NULL | The open transfer while frozen |
## Transfer (`evolution.probe_transfers`)
States:
- **prepared:** source froze the record.
- **staged:** destination accepted it under `destination_epoch`.
- **committed:** ownership switched.
- **aborted:** before commit only; the source resumes.
Each transfer keeps the record's generation at preparation, the source and destination
regions, the source epoch and the final state (x, y, z, inventory). At most one transfer is
open (prepared or staged) per record.
## Calls
Each call is made under the caller's exact unexpired region lease.
| Call | By | Effect |
|---|---|---|
| open_probe | any region | Creates the record owned by the caller if none exists; returns it |
| save_probe | owner | Position of the active (not frozen) record at its generation |
| prepare_probe_transfer | owner | Freezes the record and records the transfer (prepared) |
| stage_probe_transfer | destination | prepared or staged becomes staged under the caller's epoch |
| commit_probe_transfer | destination | staged by the caller's current epoch becomes committed: owner = destination, generation + 1, final state |
| abort_probe_transfer | source or destination | prepared or staged becomes aborted; the record is active at the source |
| find_probe_transfer | any region | The transfer as recorded |
| handoff_account_control | destination | Account control (v10) for a transfer committed to the caller |
A retry with the same transfer id returns the recorded outcome. SQLSTATE: EVL13 fenced,
EVL14 unknown transfer, EVL15 not staged by this epoch, EVL12 control handoff refused.