Freeze offline cells, linger, suspend and resume them
Foundation / checks (ecs) (push) Successful in 2m15s
Foundation / checks (deploy) (push) Successful in 3m53s
Foundation / checks (tsan) (push) Successful in 9m46s
Foundation / checks (client) (push) Failing after 13m47s
Foundation / checks (network) (push) Successful in 19m5s
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 19m34s
Foundation / checks (postgres) (push) Canceled after 19m28s
Foundation / checks (ecs) (push) Successful in 2m15s
Foundation / checks (deploy) (push) Successful in 3m53s
Foundation / checks (tsan) (push) Successful in 9m46s
Foundation / checks (client) (push) Failing after 13m47s
Foundation / checks (network) (push) Successful in 19m5s
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 19m34s
Foundation / checks (postgres) (push) Canceled after 19m28s
M11.7 (ADR-0128): a frozen step intent, set by the server for every owned life whose account holds no session, leaves the cell unchanged but engulfable. Owner format 6 / rules 5 track presence: lingering for 200 ticks, then suspended out of the world without aging; an unfrozen intent resumes it in place or at the nearest clear spot within three extents. Bundle v6, schema v38 and the cellular-v4 opening carry it. The server refuses an offline account's carried actions, ticks while anyone lingers, and skips suspended cells in replication and perception. Also fixes the TSan failure of CI run 374: the rules-4 owner test read the bud through a reference into a replaced state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,80 @@
|
||||
# ADR-0128: Cellular offline freeze, linger and resume
|
||||
|
||||
## Status
|
||||
|
||||
Accepted engineering contract for M11.7 (2026-10-14), implementing ADR-0098
|
||||
decisions 4 and 5. Linger time and resume radius are **trial** values for 11.9.
|
||||
|
||||
## Context
|
||||
|
||||
A cellular region simulates while any player is present (M11.3). A player who
|
||||
disconnects leaves an owned cell that keeps paying maintenance, and can starve or
|
||||
be eaten, while others keep the region ticking: offline progress, which ADR-0098
|
||||
forbids. ADR-0098 decides the boundary: on logout or a detected disconnect the
|
||||
organism freezes at once, lingers perceivable and vulnerable for a tunable time
|
||||
(starting at 10 s), then is suspended out of the world; a reconnect during the
|
||||
linger resumes in place, and a later resume uses the same spot or the nearest
|
||||
valid one within a small radius, else the life stays suspended.
|
||||
|
||||
## Decision
|
||||
|
||||
### The frozen intention
|
||||
|
||||
- `CellularStepIntent::frozen` (trace intent byte 13, bit 0) says the life does
|
||||
nothing this tick. It is exclusive with movement, a target, engulfment and a bud.
|
||||
Only owned lives may be frozen; wildlife never is.
|
||||
- The server sets it for every owned life whose account holds no established
|
||||
session, so the trace records the boundary and replay never consults sessions.
|
||||
Carried actions of such an account are refused before the tick is built.
|
||||
- The region step leaves a frozen cell exactly unchanged: no maintenance, movement,
|
||||
intake, growth or heat. It cannot engulf, but it can be engulfed, and it occupies
|
||||
space for contact and placement.
|
||||
|
||||
### Presence (owner format 6, rules 5)
|
||||
|
||||
Each life has a presence and the tick its freeze began:
|
||||
|
||||
- **Active**: ordinary. A frozen intent makes it **lingering** from that tick.
|
||||
- **Lingering**: frozen in place, perceivable and vulnerable. An unfrozen intent
|
||||
(the player is back) makes it active again in place. After 200 ticks (10 s,
|
||||
trial) of linger it becomes **suspended** at the end of that tick.
|
||||
- **Suspended**: out of the world. It keeps its inventory (counted in the region's
|
||||
conserved totals) but takes no part in the step, perception, replication, contact
|
||||
or placement, and may hold any intent value only as `frozen`. An unfrozen intent
|
||||
resumes it: at its own position if that is clear of every cell in the world, else
|
||||
at the first clear spot found by trying the eight fixed directions at one, two and
|
||||
three of its own extents from that position (trial radius). With none clear it
|
||||
stays suspended and the tick reports `resume_blocked`.
|
||||
- Wildlife is always active. A death decided in a tick is committed before a
|
||||
presence change in that tick; a dead life never resumes. A mutation choice
|
||||
reserved before the freeze still publishes at its tick (it was decided before the
|
||||
boundary); the host admits no choice for a life that is not active.
|
||||
|
||||
### Server loop
|
||||
|
||||
- The region also ticks while any owned life is lingering, so a linger always
|
||||
completes and nobody farms safety by leaving others' region empty.
|
||||
- Suspended lives are skipped by replication and perception.
|
||||
|
||||
### Versions
|
||||
|
||||
- Owner format 6 adds presence (u8, 7 zero bytes) and the freeze tick (u64) to each
|
||||
life record; rules 5 are rules 4 plus presence. Openings: `cellular-v4`.
|
||||
- Version bundle v6 (`{5,6,1,1,1,2,1,2,1}`), normalized like v4 and v5 by schema
|
||||
v38, which also admits it for format-3 birth traces. The trace format is
|
||||
unchanged: the flag lives in a byte SQL does not parse.
|
||||
|
||||
## Alternatives
|
||||
|
||||
- **Remove a suspended life from the owner state:** rejected. A separate list
|
||||
would need a new trace record for resumes and a second recovery path; keeping it
|
||||
in the life set with a presence costs 24 trace bytes per tick per suspended life
|
||||
and keeps one closure.
|
||||
- **Let sessions drive presence directly in the owner:** rejected; replay must not
|
||||
depend on live sessions.
|
||||
|
||||
## Consequences
|
||||
|
||||
Logging out is neither an escape nor a farm: the cell freezes, can still be eaten
|
||||
for 10 seconds, then leaves the world without aging. Wildlife keeps living while a
|
||||
region ticks. A region with only suspended players stops ticking, as before.
|
||||
@@ -28,6 +28,7 @@
|
||||
- [ADR-0125: Cellular budding and wildlife descendants](0125-cellular-budding-and-wildlife-descendants.md) - M11.5: a bud is v10 action kind 3, paid from the parent's reserve (ADR-0032 investment plus a 30 s provision), placed touching the parent, identified in a region namespace above 2^63, carrying the parent's genome; unowned wildlife driven by a pure deterministic controller whose intentions ride the trace.
|
||||
- [ADR-0126: PostgreSQL parameter bound for cellular traces](0126-postgres-parameter-bound-for-cellular-traces.md) - each query parameter may hold 4 MiB of text (was 4 KiB, ADR-0059), so every admitted cellular trace (64 ticks of 256 lives as hex bytea) reaches the database in one atomic publication.
|
||||
- [ADR-0127: Cellular permadeath and restart](0127-cellular-permadeath-and-restart.md) - M11.6: schema v37 marks a published life ended once (`end_cellular_lives`, recorded by the host after the death and again on recovery); one active life per account replaces one life per account, so a dead player starts a new primitive founder; a dead account's stale action no longer refuses the whole tick.
|
||||
- [ADR-0128: Cellular offline freeze, linger and resume](0128-cellular-offline-freeze-and-resume.md) - M11.7: a frozen step intent (set for owned lives without a session) freezes biology; owner format 6 / rules 5 track presence: lingering for 200 ticks (10 s, trial) perceivable and vulnerable, then suspended out of the world without aging; an unfrozen intent resumes in place or at the nearest clear spot within three extents; bundle v6, schema v38.
|
||||
|
||||
- [ADR-0058: Region durability contract](0058-region-durability-contract.md) - accepted M7.1 full checkpoint batches and explicit state closure; storage implementation follows.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user