Files
aevolution/docs/adr/0124-cellular-engulfment-and-detritus.md
T
dingoandClaude Opus 5.5 0fb67c3257
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
Resolve cellular engulfment and detritus in the region step
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>
2026-10-13 18:47:48 -04:00

5.3 KiB
Raw Blame History

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 §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.