Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m47s
Foundation / checks (network) (push) Successful in 9m30s
Foundation / checks (client) (push) Successful in 12m19s
Foundation / checks (tsan) (push) Successful in 7m43s
Foundation / checks (checks) (push) Successful in 31m29s
Foundation / checks (postgres) (push) Successful in 36m39s
Foundation / postgres-tools (push) Successful in 19s
Foundation / image (push) Successful in 2m15s
Foundation / server-image (push) Successful in 20m37s
Each batch's actions are recorded in the same statement as its checkpoint: one region_actions row per (world, account, action id) and the block in an append-only table, compared on exact retries and resolution. The region host attaches actions to the ticks they ride and reports acknowledgements and drops, keeping unknown-outcome batches unresolved. Outcomes come from the durable record via ActionLedger, so crashes before or after a commit, unknown publications and cross-region moves all resolve to one answer; a repeated id keeps its first record instead of stalling a region. ADR-0092. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
92 lines
6.6 KiB
Markdown
92 lines
6.6 KiB
Markdown
# ADR-0092: M10 intentions, actions and durable outcomes
|
|
|
|
## Status
|
|
Accepted for M10.4 (2026-10-03). Decisions confirmed with the maintainer on 2026-10-03:
|
|
intentions and actions have no biological effect yet (durable no-effect); stable action
|
|
ids and final outcomes are made durable in PostgreSQL in the same transaction as the
|
|
checkpoint; 10.4 wires M10 sessions into evo-server with a headless client (the GUI
|
|
client switches later). Delivery: 10.4a protocol and admission (this text), 10.4b durable
|
|
action records (migration v11) and host integration, 10.4c evo-server listener, headless
|
|
client and process kill tests. Each segment amends this ADR.
|
|
|
|
## Context
|
|
ADR-0089 fixed the scheduling window (server_tick + 1 ..= + 8), one intention per tick,
|
|
per-session u64 sequences, at most 256 unresolved intentions and 1.5 s final outcomes.
|
|
ADR-0090 put superseding intentions on QUIC DATAGRAMs and reliable actions on the stream.
|
|
ADR-0091 binds sessions to accounts. No controllable organism or movement rule exists
|
|
(10.6 movement experiment, M11 organisms), so nothing an intention names can change
|
|
authoritative state yet. Committed batch traces record host inputs only, not request ids.
|
|
|
|
## Decision (10.4a)
|
|
**Two kinds of client input, three distinct answers.**
|
|
- *Intentions* (datagram): session, epoch, sequence, tick, bounded move vector; never any
|
|
state claim (position, energy): the message has no such fields and any extra bytes make
|
|
it invalid. Answers: an `IntentionReceipt` (admitted = scheduled for its tick, or a
|
|
refusal) and a cumulative `SimulatedThrough` watermark (every admitted intention up to a
|
|
sequence whose tick has been simulated in the epoch), repeated every 20 ticks so a lost
|
|
datagram is covered. Intentions are superseding: there is no per-intention durable record.
|
|
- *Actions* (stream): a client-chosen action id, unique per account and stable across
|
|
retries and reconnects, a kind and a tick. Answers: an `ActionReceipt` (scheduled, or a
|
|
refusal) and a final `ActionOutcome`: `committed_no_effect` with its commit sequence once
|
|
the commit covering its tick is durable, or `not_committed`. `ActionQuery` resolves an id
|
|
at any time (`pending`, `unknown`, or the final outcome). The only kind is `probe`.
|
|
- A receipt is never a final outcome, and the watermark is never durability.
|
|
|
|
**Admission** (`IntentAdmission`, transport-neutral, single owner), in order: the message
|
|
must name the connection's own session; rate (every attempt counts: 8 intentions and 4
|
|
actions per 8-tick window); authority ready; epoch; vector norm <= 1000 or a known action
|
|
kind and nonzero id; strictly increasing sequence; tick inside the window and, for
|
|
intentions, after the previous admitted intention's tick; duplicates (an action id already
|
|
pending or final for the account is never admitted again: `duplicate`, followed by its
|
|
outcome when final); at most 256 unresolved intentions plus actions per session.
|
|
Actions belong to the account: a takeover or reconnect sees the same pending and final
|
|
actions. The host takes scheduled actions with `carry(tick)` for the batch that simulates
|
|
that tick and reports durable commits with `committed(end_tick, sequence)`. When the epoch
|
|
advances, actions never carried are final `not_committed`; carried ones stay pending until
|
|
their durable record decides them (10.4b). Recent final outcomes (2,048) are kept for
|
|
duplicates and queries; older ones are resolved from the durable record (10.4b).
|
|
|
|
**Protocol.** Session protocol v1 gains message types 6-12 and Welcome gains the server
|
|
tick (schemas/network/session-v1.md). v1 has never been deployed, so it is amended in
|
|
place, as ADR-0083 did for M9 v1; after its first deployment, changes need a new version.
|
|
The action kind is a raw u16 on the wire and validated by admission (an enum narrower than
|
|
the wire field must never be cast from it).
|
|
|
|
## Consequences and limits (10.4a)
|
|
- Durable resolution of carried actions after a crash, and of final outcomes evicted from
|
|
memory, needs the v11 records (10.4b). Until then a carried action of a lost epoch
|
|
answers `pending`.
|
|
- The simulated watermark says the targeted tick ran while the intention was scheduled;
|
|
with no movement rule it changed nothing. 10.6 gives intentions an effect.
|
|
- Nothing is wired into evo-server yet (10.4c); nothing deploys M10 sessions.
|
|
|
|
## M10.4b durable action records (2026-10-03)
|
|
Schema v11 (`migrations/0011_region_actions.sql`, [region-actions-v1](../../schemas/region-actions-v1.md)):
|
|
- **Same transaction as the checkpoint.** The region host attaches each submitted action to
|
|
the first simulated tick at or after its scheduled tick and publishes the batch's action
|
|
block with the three-argument `publish_region_checkpoint`; the records exist exactly when
|
|
the checkpoint does. Committed history stays immutable: blocks live in their own
|
|
append-only table, and an exact retry or resolution must repeat the block.
|
|
- **Outcomes come from the record.** `find_region_action` (under the caller's exact region
|
|
lease) returns the committed record of (world, account, action id). Found: final
|
|
`committed_no_effect` with that record's tick and commit. Absent once this authority is
|
|
recovered and ready: never committed by any earlier epoch (its commits are final).
|
|
- **One record per id, without stalling a region.** Found during testing: an account that
|
|
moves regions while its action is pending in the old one can have the same id admitted by
|
|
the new region (the record does not exist yet). Refusing the second commit would have
|
|
quarantined a healthy region. The database instead keeps the first record and lets the
|
|
later batch commit; `IntentAdmission::committed` reports each outcome from the record, so
|
|
every region answers the same tick and commit for an id.
|
|
- **Host semantics.** `submit_action` (bounded: 256 queued plus riding), `ActionAck` per
|
|
committed action, `DroppedAction` with `final` = certainly never committed. Actions of a
|
|
batch whose publication outcome was unknown when authority was lost are not final; the
|
|
session layer keeps them pending until the record decides.
|
|
- **Session layer.** `ActionLedger` (interface) with `PostgresActionLedger`; admission
|
|
checks the record before admitting an id not in memory (`duplicate` with its outcome, or
|
|
`not_ready` when the record cannot be read); queries resolve unknown-outcome and evicted
|
|
actions from the record once ready. `RegionSessions::committed/dropped` take the host's
|
|
reports.
|
|
- Limits: action rows are retained (no pruning policy yet); clones (ADR-0067) do not copy
|
|
them; the two-argument publication of a commit that has an action block would still
|
|
return its receipt (the adapter never does this).
|