Resolve cellular engulfment and detritus in the region step
Foundation / checks (ecs) (push) Successful in 2m17s
Foundation / checks (deploy) (push) Successful in 3m57s
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 6m13s
Foundation / checks (checks) (push) Canceled after 6m19s
Foundation / checks (tsan) (push) Canceled after 3m58s
Foundation / checks (client) (push) Canceled after 6m17s
Foundation / checks (network) (push) Canceled after 6m18s

ADR-0124 implements ADR-0098's predation and corpse rules for the
cellular trial. Under rules 3 the pure region step adds an engulf phase
after every life's step: in ascending life id, a predator takes the
lowest-id contacted survivor whose total mass, times 1.5 per micrometre
of its membrane, is at most the predator's. The prey's whole inventory
moves once; the predator keeps what its remaining per-tick intake allows
and the rest, like every starvation corpse, becomes detritus in the
patch at the dead cell's 1 mm cell. Corpse candidates report their cause.
Rules 2 is unchanged and ignores engulf intents.

Owner, protocol v11, persistence and recovery wiring follow in the next
11.3f steps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-13 18:47:48 -04:00
co-authored by Claude Opus 5.5
parent 4751b23857
commit 0fb67c3257
9 changed files with 502 additions and 9 deletions
@@ -0,0 +1,104 @@
# ADR-0124: Cellular engulfment and detritus
## Status
Accepted M11.3 engineering contract (2026-10-13), under the maintainer's standing
direction to proceed through M11 with recommendations. It implements the
predation and corpse rules already ratified in
[ADR-0098](0098-m11-first-cellular-loop-decisions.md) §6. Values marked
**tunable** are versioned trial inputs for the 11.9 playtests, not final rules.
## Context
The cellular trial resolves movement, maintenance, patch intake and starvation
(ADR-0101 to ADR-0107). ADR-0098 also requires engulfment of a sufficiently
smaller contacted cell, contested by the prey's membrane, with the prey's whole
inventory moving to the predator once and any excess left as detritus, and it
requires that a corpse can be absorbed by any cell. ADR-0107 kept starvation
corpses as inert records, and nothing can engulf yet.
The 2026-10-13 probe showed that a player's only feedback is patch intake and
reserve, and that founders are identical in size. Engulfment therefore becomes
possible only once mutation or later growth changes relative size; until then it
must still be resolved correctly.
## Decision
### Intent
- A cellular action names one target **kind**, replacing the intake flag in
byte 12 of the 24-byte canonical input: 0 none, 1 patch intake at the given
patch address, 2 engulf. An engulf intent carries zero coordinates; the server
chooses the prey. Clients still send only intentions.
- Kind 2 is accepted only on session protocol v11, which otherwise equals v10.
Earlier sessions keep refusing it, and their bytes are unchanged.
### Tick order (rules 3)
Each tick keeps the ADR-0104 single-life order and ADR-0106 patch arbitration,
then adds two phases, all in ascending stable life id:
1. **Step:** movement, maintenance and patch intake exactly as under rules 2.
A life that cannot pay maintenance starves (ADR-0107).
2. **Engulf:** each life that survived step 1 and holds an engulf intent takes at
most one prey: the lowest-id surviving life in contact (ADR-0102 footprint
contact) for which
`predator_total_mass × 1000 ≥ required × prey_total_mass`, where
`required = 1500 × prey_membrane_um` (**tunable**; 1.5 for the 1 µm founder
membrane, per ADR-0098). Total mass is the phenotype's structural plus
membrane mass. A life engulfed earlier in the phase can neither act nor be
taken twice. A predator cannot engulf itself.
3. **Death and detritus:** every life that died this tick (starved or engulfed)
becomes a corpse record. Its accumulated heat goes to the world heat owner.
### Transfer
- The prey's body and reserve, every channel, move out exactly once.
- The predator's reserve receives at most its per-tick intake limit in each
channel (the same capacity that bounds absorption). The remainder is detritus.
- Detritus, and the whole inventory of a starved cell, is deposited into the
habitat at the 1 mm patch cell containing the corpse's position:
- If a patch exists there, the inventory is added to its stock. The patch keeps
its provenance; the corpse record and lineage archive keep the dead organism's.
- Otherwise a new patch is created there with the dead life's source as
provenance.
- If the habitat is at its 4,096-patch bound, the nearest existing patch
(lowest address on a tie) receives it.
- Corpse records keep identity, position, growth, extent, death tick and a new
**cause** (starved or engulfed). Their inventory is zero under rules 3.
- Any cell absorbs detritus with ordinary patch intake. Nothing decays or
replenishes; every channel is conserved region-wide.
### Versions and persistence
- Cellular rules 3 and owner envelope 4 (the corpse cause) form a new version
bundle `{rules 3, envelope 4, habitat 1, coordinate 1, genome 1, development 2,
founder 1, archive 2, mutation_state 1}`.
- New regions are provisioned on it. Existing v2 and v3 regions keep rules 2 and
replay byte-for-byte; no in-place migration is provided in this step.
- Schema migration 34 admits the new bundle and canonical input kind 2 with
zero coordinates. Batch traces record the kind with each intent.
- Client presentation of an engulf control and of corpse causes belongs to
11.8 (maintainer-owned client UI).
## Alternatives
- **Explicit prey id in the action:** rejected for this step. It needs a new
message layout and lets a client name an unseen cell; contact already bounds
the choice, and the server picks deterministically.
- **Engulf without a capacity bound:** rejected. ADR-0098 bounds the transfer by
the predator's capacity, and per-tick intake is the only capacity cells have.
- **Keep corpses as separate food objects:** rejected for now. A second food
type needs its own perception, contact and client view; depositing into the
patch grid reuses all three.
- **Migrate existing regions in place:** deferred. Only DEV regions exist, and a
fresh region is cheaper to qualify than a no-tick rules migration.
## Consequences
- Biology gains a pure engulf/detritus resolution; the cellular owner, snapshot,
manifest bundle, SQL admission, protocol v11, batch trace and recovery change.
- Founders are equal in size, so live engulfment needs mutation (11.4) or
later growth before it is observable in play.
- Size may dominate predation (ADR-0098 risk); 11.9 watches for it, and the
required ratio stays tunable.
+1
View File
@@ -24,6 +24,7 @@
- [ADR-0121: Durable cellular mutation selection](0121-durable-cellular-mutation-selection.md) - specifies a distinct reliable action, allocator identity, tick-bound replay and atomic publication for M11.4c.
- [ADR-0122: Append-only cellular genome revisions](0122-append-only-cellular-genome-revisions.md) - preserves immutable birth-genome links while adding a versioned revision chain and no-tick cellular-v3 migration.
- [ADR-0123: Dev cellular region and life-allocator provisioning](0123-dev-cellular-region-and-life-allocator-provisioning.md) - moves DEV to cellular region 100/2 at schema v33 and has the owner provisioner create a world's life allocator once at an audited start.
- [ADR-0124: Cellular engulfment and detritus](0124-cellular-engulfment-and-detritus.md) - resolves engulfment of a sufficiently smaller contacted cell and deposits every corpse's inventory into the patch grid as absorbable detritus, under cellular rules 3.
- [ADR-0058: Region durability contract](0058-region-durability-contract.md) - accepted M7.1 full checkpoint batches and explicit state closure; storage implementation follows.
+12
View File
@@ -408,6 +408,18 @@ scoped change before starting the next segment.
evidence is green for the pushed M11.3 implementation. Only the live human
probe remains before 11.3 closes and 11.4 can begin.
- 11.3e probe (2026-10-13): the exploratory playtest ran in DEV region 100/3;
steering and feeding work end to end. Notes:
[probe notes](../playtests/M11_3_PROBE_NOTES_2026-10-13.md); session and
deployment fixes are recorded in ADR-0123.
- 11.3f-1 (ADR-0124): the pure region step gains rules 3. An engulf intent
takes the lowest-id contacted survivor at least 1.5x lighter per micrometre
of prey membrane; the prey's whole inventory moves once, bounded by the
predator's remaining per-tick intake, and the rest, like every starvation
corpse, is deposited as patch detritus (a new patch at an empty cell). Rules 2
is unchanged and ignores engulf. Owner, protocol, persistence and recovery
wiring remain.
## Exit boundary
11.3 closes only when the documented segments have evidence and the player-facing
+16 -1
View File
@@ -7206,4 +7206,19 @@ an identity only with `born`. The session layer now clears identity and commit
on every other result. `quic_sessions` adds an `existing_life` refusal that
must arrive valid while the session stays established. Locally (MSVC, client
preset) the case failed with the same 33-byte decode error before the fix and
passed after it.
passed after it.
## 2026-10-13 — M11.3f-1 cellular engulfment and detritus resolver (CI pending)
ADR-0124. `propose_cellular_region_step` takes `CellularRegionRules`; rules 3
adds an engulf phase after every life's step (ascending life id, one prey per
predator, contact plus `predator_mass × 1000 ≥ 1500 × prey_membrane_um ×
prey_mass`), bounds the predator's gain by its remaining per-tick intake, and
deposits detritus and starvation corpses into the patch at the dead cell's
1 mm cell (a new patch at an empty cell, the nearest patch when full). Corpse
candidates report a cause and predator. Rules 2 results are unchanged.
Executed locally: MSVC Debug full build and `ctest -R cellular` (6/6, with five
new region-step cases: capacity split and region-wide conservation, size,
membrane and contact refusal, one prey per predator per tick, empty-cell
detritus, rules-2 no-op and invalid rules-3 intents); g++-14 `-Werror`,
clang-tidy-19 and clang-format 19.1.5 on the changed files.