Preserve terminal inventories and add bounded decomposition
This commit is contained in:
+3
-1
@@ -46,7 +46,7 @@ this proof. Production indexing awaits actual interaction workloads.
|
||||
| 2.1 Ratify accounting units and ledger | accounting/ledger.*, ENERGY_MODEL, ADR-0024 | M1, units ADR | Exact local units/ranges, finite inventories and atomic ordered transfers | Unit-type separation, rollback/overflow/replay, million-transaction independent balance checks | Mistaking conservation for valid biology |
|
||||
| 2.2 Add abiotic source and producer | processes/producer.*, ADR-0025 | 2.1 | Finite source capture, whole growth recipes, carried rate remainders and atomic owned ledger | Closed-box audit, independent fractional reference, finite-resource and arithmetic limits | Confusing synthetic process with organism biology |
|
||||
| 2.3 Add consumer intentions and ingestion | processes/feeding.*, ADR-0026 | 2.2 | Shared ledger and atomic tick; capped ordered feeding with heat/waste outputs | Predation, contention, rollback, terminal depletion, replay/conservation | Fixture rules becoming gameplay; spatial validation remains separate |
|
||||
| 2.4 Death and decomposition | biology/lifecycle, ecology | 2.3 | Active capability ends; corpse pool transfers conserved nutrients | Death terminality, decomposition limits, ledger audit | Nutrients double counted |
|
||||
| 2.4 Death and decomposition | processes/feeding.*, ADR-0027 | 2.3 | Terminal events preserve corpse inventory; corpses/waste share decay budget | Terminality, rollback, cap sharing, mixed channels, nutrient regrowth and conservation | Confusing fixture transfer rules with microbial chemistry |
|
||||
| 2.5 Reproduction and wildlife identity | biology/reproduction, genome identity | 2.4, reproduction contract | Sufficient resources required; child consumes parent budget | Insufficient investment, unique ID and ancestry tests | Free offspring or implicit player ownership |
|
||||
| 2.6 Long-run ecosystem fixture | apps/evo-sim, tests/ecosystem, metrics | 2.2–2.5 | Producer→consumer→death→nutrients cycle; report over million ticks | Many seeds, nonnegative balances, measured extinction/diversity | Passing invariants despite uninteresting ecology |
|
||||
|
||||
@@ -62,6 +62,8 @@ the existing fixture is not itself a complete ecosystem or an organism model.
|
||||
M2.3 now supplies this bounded shared ownership and ingestion fixture. M2.4 must
|
||||
retain remaining inventory on death and implement explicit corpse/decomposition
|
||||
flows, rather than relying on M2.3's zero-inventory depletion trigger.
|
||||
M2.4 now implements that terminal-inventory and bounded-return contract. M2.5
|
||||
must settle offspring identity and funding before adding reproductive operations.
|
||||
|
||||
## M3 — Genome v0.1
|
||||
|
||||
|
||||
+12
-5
@@ -7,7 +7,7 @@ persistent simulation server. The founding vision remains unchanged.
|
||||
## Completed implementation
|
||||
|
||||
- Vision, architectural pillars, risks, open-question register, architecture
|
||||
diagrams, biological contracts, engineering constitution and 26 ADRs.
|
||||
diagrams, biological contracts, engineering constitution and 27 ADRs.
|
||||
Proposed/deferred choices remain distinct from accepted proof decisions.
|
||||
- M0–M4 task breakdowns with dependencies, acceptance evidence and risks,
|
||||
plus M5–M14 gates in [ROADMAP.md](ROADMAP.md).
|
||||
@@ -61,8 +61,8 @@ for the bounded proof; the general production ECS remains a later measured choic
|
||||
|
||||
| Priority | Work | Completion evidence |
|
||||
|---|---|---|
|
||||
| 1 | M2.4 death and decomposition contract | Terminal activity with remaining inventory, corpse ownership, bounded decomposition and nutrient return |
|
||||
| 2 | M2.5–2.6 first headless energy cycle | Funded reproduction and complete producer/consumer/decomposition cycle; seeded million-tick ecosystem evidence |
|
||||
| 1 | M2.5 funded reproduction contract | Atomic parent/offspring investment, non-reused identity and explicit ancestry without inherited account power |
|
||||
| 2 | M2.6 headless energy-cycle fixture | Complete capture/feeding/reproduction/decomposition cycle, seeded million-tick ecosystem runs and diagnostics |
|
||||
| Delivery gate | Add/update the dev workload when a deployable increment needs it; Argo is ready | Observe Job/pod completion separately from image publication; no World0 changes |
|
||||
|
||||
M1.6 now implements [the sequential scheduler contract](architecture/SCHEDULER_CONTRACT.md):
|
||||
@@ -115,8 +115,15 @@ predation, resource contention, terminal actors, batch order/replay and conserva
|
||||
No spatial/perception validation,
|
||||
organism biology, persistent checkpoint or deployment is included in this fixture.
|
||||
Native Release, analysis, ASan and formatting passed; all four Gitea run 1415
|
||||
jobs passed. The next increment is M2.4 death with remaining inventory and
|
||||
bounded decomposition into nutrients.
|
||||
jobs passed.
|
||||
|
||||
M2.4 adds terminal events with preserved corpse inventory, followed by a shared
|
||||
bounded decomposition phase. Energy moves to heat, elemental matter returns to
|
||||
nutrients, and next-tick producer growth can use those nutrients. Corpses retain
|
||||
their process ID and cannot resume activity. Invalid ticks roll back death and
|
||||
decomposition with all earlier phases. Default zero decay preserves earlier
|
||||
fixture behavior. This is not death-cause biology, microbial chemistry, corpse
|
||||
scavenging, persistent lineage history or a database-backed world.
|
||||
|
||||
Before biology, resolve the relevant heredity and energetic contracts rather
|
||||
than treating proof particles as organisms. Exact game tick rate, NPC mutation,
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
# ADR-0027: Terminal inventory ownership and bounded decomposition
|
||||
|
||||
## Status
|
||||
|
||||
Adopted for the M2.4 synthetic community fixture. No biological death cause,
|
||||
decomposer organism, biochemical reaction or live-world identity is selected.
|
||||
|
||||
## Context
|
||||
|
||||
M2.3 only deactivates targets completely consumed by feeding. Real terminal
|
||||
events can leave reserve and structure behind; removing that inventory would
|
||||
violate conservation. Nutrient return must have a finite per-tick bound.
|
||||
|
||||
## Decision
|
||||
|
||||
Extend `FeedingCommunity::advance` with an optional bounded list of trusted
|
||||
`TerminalEvent` facts (process ID only). They are host/system decisions, never
|
||||
client kill commands. Admit at most one per process, reject zero/unknown/duplicate
|
||||
or already inactive IDs, and apply them before producer activity. A terminated
|
||||
producer does not capture or grow in that tick. Existing feeding still rejects
|
||||
inactive actors and targets; scavenging is not added in this increment.
|
||||
|
||||
A dead process's existing ledger reservoir becomes its corpse compartment. There
|
||||
is no duplicate corpse inventory and no account ownership; the immutable process
|
||||
ID identifies the residual material. `corpse(id)` returns its current inventory
|
||||
by value, rejects active/unknown IDs, and returns zero after decomposition. IDs and
|
||||
terminal flags remain even when inventory is empty. There is no resurrection API.
|
||||
|
||||
Tick phases: terminal facts → producer activity → ordered feeding → decomposition
|
||||
→ atomic publish. Decomposition drains inactive process reservoirs in ascending
|
||||
process ID, then the waste reservoir. Each community has one configured inventory
|
||||
budget per tick, shared across all corpses and waste, independently per channel.
|
||||
Take min(remaining budget, available inventory). Energy goes only to heat;
|
||||
C/N/P/other matter goes unchanged to nutrients. No yield, energy reuse, reactants,
|
||||
fractional kinetics or invisible sink is claimed. Nutrients can fund growth next
|
||||
tick, not earlier in this same tick. Zero budgets disable the corresponding channel.
|
||||
|
||||
The cap defaults to zero to preserve M2.3 fixture behavior. Empty corpses do not
|
||||
consume budget or ledger actions. Unused budget expires; no backlog accumulates.
|
||||
Expose `last_decomposed()` as the committed inventory moved in that tick; it is
|
||||
diagnostic state, not an additional owned resource. It resets on each successful
|
||||
tick and remains unchanged on failed ticks.
|
||||
|
||||
All phases run on the existing private candidate. Invalid feeding after a death
|
||||
fact rolls back death, producer progress, transfers and diagnostics. Death facts
|
||||
are not idempotent acknowledgments: replay of a committed tick or a repeated death
|
||||
is rejected. Durable exactly-once history and snapshots remain separate work.
|
||||
|
||||
## Alternatives Considered
|
||||
|
||||
Copying into a corpse object risks double counting; moving into a new reservoir
|
||||
requires unnecessary allocation/identity lifecycle for this bounded fixture.
|
||||
Unbounded instant decay hides the ecological rate constraint. Per-corpse budgets
|
||||
scale throughput with corpse count; one shared budget makes this proof's bound
|
||||
explicit. A reaction solver requires reactants/stoichiometry not yet defined.
|
||||
|
||||
## Benefits
|
||||
|
||||
One owner for every residual quantity, terminal activity, exact conservation and
|
||||
a measurable upper bound on nutrient return. A complete return-to-producer path
|
||||
can now be tested without implementing reproduction.
|
||||
|
||||
## Costs
|
||||
|
||||
Dead process slots are retained. Oldest-ID priority may starve later corpses/waste;
|
||||
it is an experimental scheduling rule, not an ecological fairness decision.
|
||||
Per-element caps can change residual composition; they are not physical kinetics.
|
||||
|
||||
## Risks
|
||||
|
||||
Do not label this as microbial decomposition or use host terminal facts as a
|
||||
client-authorized action. Actual death, lineage history, corpse scavenging and
|
||||
decomposer capabilities need their own contracts. No synthetic actors seed World0.
|
||||
|
||||
## Consequences
|
||||
|
||||
Test death before producer activity, preserved corpse inventories, no dead actions,
|
||||
duplicate/stale events, rollback, budget sharing, zero/full caps, exact u64 limits,
|
||||
waste decay, returned nutrients funding later growth and repeated conservation.
|
||||
No state codec, PostgreSQL connection, renderer or deployment change.
|
||||
@@ -19,6 +19,7 @@ Each record has the eight required sections.
|
||||
0024 adopts finite, typed energy/matter inventory transfers for M2.1.
|
||||
0025 scopes finite capture, growth recipes and residual accounting for M2.2.
|
||||
0026 adds shared community ownership and bounded synthetic feeding for M2.3.
|
||||
0027 adds terminal inventory ownership and budgeted nutrient return for M2.4.
|
||||
|
||||
Every dependency adoption records exact version/commit and integrity hash,
|
||||
transitive license obligations, maintenance/security review, owner and removal
|
||||
|
||||
@@ -174,3 +174,31 @@ flowchart LR
|
||||
P -->|unassimilated energy| H[Heat]
|
||||
P -->|unassimilated matter| W[Waste inventory]
|
||||
```
|
||||
|
||||
## Implemented M2.4 terminal inventory and decomposition
|
||||
|
||||
[ADR-0027](../adr/0027-terminal-inventory-and-decomposition.md) extends community
|
||||
ticks with trusted terminal facts before producer activity. The dead process's
|
||||
existing inventory becomes its corpse; no extra copy is created or discarded.
|
||||
`corpse(id)` exposes a value only for inactive process IDs. Dead actors never
|
||||
capture, grow or feed again, and their identity remains after decomposition.
|
||||
|
||||
After feeding, inactive reservoirs in ID order and then waste share one configured
|
||||
per-tick inventory budget. Drained energy goes to heat and each elemental mass
|
||||
goes unchanged to nutrients. Zero caps disable channels. This is a synthetic
|
||||
transport model, not decomposition chemistry or an autonomous microbial lineage.
|
||||
Returned nutrients can fund producer growth next tick. Default caps are zero,
|
||||
preserving earlier fixture behavior; all new state participates in tick rollback.
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
A[Active process inventory] -->|terminal state, same owner| C[Corpse inventory]
|
||||
C -->|bounded energy release| H[Heat]
|
||||
C -->|bounded elemental return| N[Nutrients]
|
||||
W[Waste] -->|remaining shared budget| N
|
||||
N -->|next tick growth| P[Living producer structure]
|
||||
```
|
||||
|
||||
Host terminal events do not define health, starvation, combat, age or player death
|
||||
causes. Corpse scavenging, live-world lineage history, persistence and reproduction
|
||||
remain outside this increment. No physical inventory disappears on death.
|
||||
|
||||
@@ -254,3 +254,20 @@ implemented. These are co-located synthetic process fixtures.
|
||||
passed all four jobs for source `b7dd466f57f385d6a8ffccfaa69f639077545587`:
|
||||
Linux checks, ECS regression, separate TSan and image smoke/publication.
|
||||
No deployment image pin was changed.
|
||||
|
||||
## M2.4 terminal inventory and decomposition (2026-09-20)
|
||||
|
||||
Native Release, analysis and MSVC ASan passed 8/8 CTests; formatting passed.
|
||||
Commands: `tools/windows-check.ps1 -Preset <release|analysis|asan> -Action check`
|
||||
and Release `-Action format`. Tests preserve corpse inventories on death, suppress
|
||||
producer activity immediately, reject repeated/invalid terminal events and roll
|
||||
back death with later invalid feeding. Sixteen seeds × 256 ticks compare a
|
||||
closed-form depletion reference, reversed terminal-event order, per-tick budgets,
|
||||
inventories and conservation. Additional cases cover shared corpse/waste limits,
|
||||
mixed and zero channel caps, u64-maximum inventories, diagnostic rollback, and
|
||||
returned nutrients funding producer structure on the next tick.
|
||||
|
||||
The existing feeding, standalone producer, ledger and particle tests pass unchanged.
|
||||
This does not validate reaction chemistry, actual death causes, corpse scavenging,
|
||||
serialized recovery, allocation-failure injection or persistent history. There is
|
||||
no deployment change. Linux CI is pending source push.
|
||||
|
||||
Reference in New Issue
Block a user