Files
aevolution/docs/adr/0114-cellular-first-life-publication.md
T
dingo 703758c45c
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (checks) (push) Failing after 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 7m42s
Foundation / checks (tsan) (push) Canceled after 7m44s
Allow cellular births to bind published commits
2026-10-11 21:28:21 -04:00

110 lines
6.3 KiB
Markdown

# ADR-0114: First player life in cellular profile 4
## Status
Accepted M11.3 engineering direction under the maintainer's standing
authorization to proceed with recommendations and revisit decisions after
implementation. It adds no gameplay constant. Implementation, PostgreSQL
qualification and CI remain open. This resolves the gap between empty profile-4
genesis and the 11.3e requirement that a player can enter the cellular stage.
## Context
ADR-0100 requires owner-provisioned primitive genesis to start with no
organisms, and requires life, organism, genome, and event identities to come
from the durable world allocator. ADR-0108 gives cellular state its own
immutable profile and says profile-4 cloning is unsupported until identity and
source-total remapping are specified. `CellularLives::create` can wrap a
profile-3 opening in memory, but the existing owner provisioner creates only
profile-3 genesis and the cellular publisher accepts only profile-4 successors.
There is no supported transition that can turn a profile-3 life into a
profile-4 founder.
The early 11.3e probe requires a player to spawn, then perceive, steer, seek,
and feed. Directly putting a cell in profile-4 genesis would contradict the
empty-genesis rule and bypass the ordinary world-scoped identity allocator.
Copying a profile-3 checkpoint into profile 4 would violate profile immutability
and the unresolved clone remapping contract.
## Decision
- Keep profile-4 genesis empty. Do not seed a founder, import profile-3 lives,
accept client-chosen identities, or infer an opening from defaults.
- Extend the existing reliable v5 new-life request to the profile-4 owner
without changing its wire encoding. The authenticated account and stable
request identity remain authoritative; the host obtains identity allocation,
control generation, finite nursery funding, and the first free provisioned
site from the existing server-side contracts.
- Extend the profile-4 per-tick replay trace with a bounded birth set after the
tick's existing-life intentions. Each record binds the authenticated account,
stable v5 request ID, durable control generation and allocator-issued life
identity. Organism, genome and event identities use that same reserved value
in their distinct namespaces, as in the existing primitive-life path. Source,
site, body, reserve and construction heat are re-derived by deterministic
replay from the committed predecessor and are not client claims.
- Publish the birth record, account/life binding, immutable request outcome,
archive update, source debit, heat, and complete profile-4 checkpoint
atomically under the current region lease and account-control generation.
Failed funding, placement, allocation, stale control, or uncertain publication
must leave no acknowledged partial birth. Exact retries return the durable
original result; changed reuse is refused.
- Birth is applied after the existing lives' normal tick. It shares that tick's
checkpoint commit, is born at its end tick, and first acts on the following
tick. When the region is empty, the first empty tick creates the first life;
no organism advances or accrues offline time. Do not add a second birth-only
tick or use spawn to progress an existing life.
- Recovery replays each tick's existing-life intentions, then its canonically
ordered births, and compares the complete recovered state and durable request
outcomes. For the first single-player probe, the scheduler does not advance
the region while its only living player's session is absent. Multi-life
disconnect behavior remains governed by later M11 gates.
- This contract enables the single-region 11.3e probe only. It does not claim
cross-region owner routing, resume, death/re-entry, reproduction, or completion
of M11.2. Those remain separately gated.
## Alternatives considered
- **Put a cell directly in profile-4 genesis:** rejected because genesis is
explicitly empty and this bypasses the durable allocator and birth operation.
- **Convert or clone a profile-3 checkpoint:** rejected because region profiles
are immutable and profile-4 cloning/remapping is explicitly unresolved.
- **Let the client supply IDs or a position:** rejected because identity
allocation and placement are server-owned.
- **Run birth as a separate biological tick:** rejected because a new life must
not make existing lives lose an action opportunity or receive hidden offline
progress.
- **Add another wire layout for the same request:** not preferred; the accepted
v5 request already carries the authenticated account-scoped new-life
operation. A new layout is justified only if implementation finds a missing
semantic field that cannot be supplied by authoritative server state.
## Benefits and costs
The direction preserves empty genesis, profile immutability, allocator
ownership, finite funding, and exact retry semantics while providing an
ordinary player entry path into the cellular owner. It requires an extended
canonical birth trace, atomic life-binding publication, server admission
wiring, and concurrent/restart tests before the 11.3e probe can run.
The profile-4 publisher now carries the canonical trace to PostgreSQL. Its
birth rows must match the current control generation and reserved identity;
the account/life binding is inserted in the same transaction as the checkpoint.
Recovery compares those bindings to the tail trace. The previous action-only
profile-4 SQL entry point is revoked from the runtime role, so deployments must
run a publisher version that supplies the trace before cellular commits resume.
The shared life-binding table accepts commits from either primitive profile 3
or cellular profile 4. Its commit foreign key is deferred to the common region
commit record, and a deferred constraint trigger requires matching, private
profile-specific publication evidence and an un-rejected reservation in the
same region. This lets the cellular publisher insert its binding before its
checkpoint core inserts publication evidence while preserving transaction
atomicity.
## Consequences
`evo-world-clone` creates empty profile-4 genesis only. The M11.3e gate remains
unplayable until this birth operation and the tick/view path are implemented and
qualified. The work belongs to the profile-4 owner/session path; it must not
change the headless simulation boundary or M10 probe behavior.