Files
aevolution/docs/adr/0055-environmental-process-contract.md
T
2026-10-08 12:08:53 -04:00

86 lines
5.0 KiB
Markdown

[Reviewed]
# ADR-0055: Bounded environmental producer/consumer contract
## Status
Accepted for the M6.5b design segment, 2026-09-27. Rules version 1 is a synthetic
fixture, not gameplay chemistry, a species classification or live-world founder policy.
Runtime implementation and complete process persistence are M6.5c; qualification is
M6.5d. No existing M2/M3 implementation or simulation version changes here.
## Context
ADR-0053 moves identical compartments only. Producer capture needs an explicit
incident-energy conversion, growth incorporates dissolved nutrients, and feeding
moves owned biomass between organisms. Merely copying balances into M2's Ledger
would duplicate spendable inventory. Its untagged `other` also cannot distinguish
water from food. ADR-0054 requires the entire process state to be restorable before
rate-driven execution. M6.5a resource snapshots provide a foundation, not that state.
## Decision
Adopt [ENVIRONMENTAL_PROCESS.md](../biology/ENVIRONMENTAL_PROCESS.md). Add a separate
bounded process owner in evo::processes, depending on evo::world and existing biology
contracts. The world library must not depend on process, genome or lifecycle types.
Retain one authoritative set of resources, with detached candidates only while a
whole tick is prepared. Expose read-only resource views, never a mutable owner.
Use one habitat, one configured producer capability and one configured consumer
capability for this fixture. All opening inventory and source identity are explicit.
Use prepaid organic carbon/other and dissolved N/P for a synthetic growth recipe;
this is not complete photosynthesis. Water is taken up and retained separately.
Capture converts finite incident energy into organic reserve and heat. Feeding
consumes only organic compartments, with M2's declared assimilation/waste split.
The source's rate is area-bounded, rational and immutable. A positive quota that
cannot be fully funded does not change its residual or last funded interval. The
outer tick may still commit other work and a source-unfunded report; it never
catches up the rejected source interval. This explicitly scoped rate policy differs
from M2's min(quota, stock) capture; M2 remains unchanged.
No maintenance debit, starvation mortality, reproduction, mutation, decomposition,
thermal injury or player logout policy is added in M6.5. Preserve existing budget
helpers as pure proposals. Source starvation means measured lack of capture/growth,
not an invented terminal transition. The fixture is autonomous experimental biology,
not a host for offline player organisms. M6.6 adds terminal events and corpse decay.
## Alternatives Considered
A public generic retag operation could turn water into food or recycle heat.
Independent field and process commits risk double-spending. Reusing M2's ledger as
a cache creates two authoritative inventories. Adding dissolved carbon or complete
redox chemistry is premature for this integration gate. Using preallocated organic
carbon is explicit and testable, with its biological limitation clearly named.
M6.4 transfer history cannot generally be reversed through subsequent conversions.
Keep process retry history in a versioned outer envelope and use private resource
checkpoints without claiming that old transfer-only receipts describe process ticks.
Do not weaken the M6.5a history validator to accept impossible transfer histories.
## Benefits
Finite, conserved, tagged flows; exact rounding; clear persistence and ownership;
existing producer/feeding behavior remains independently reproducible.
## Costs
A new restricted process transaction and outer codec are necessary. Synthetic
prepaid carbon is not a self-sustaining autotrophic carbon cycle. One habitat and
two actors cannot establish scalable ecology or fairness.
## Risks
Conservation does not imply chemical plausibility. Coefficients, temperature bounds
and area choices could be mistaken for game laws. Every fixture stores a rules
version and explicit config; no default wildlife or hidden resource supply.
## Consequences
M6.5c must implement and test the full envelope before exposing advance. M6.5d must
check source-off, resource limits, temperature boundaries, retries, rollback and
restored seeded continuation. Durable publication remains M7. No dependency or
schema implementation is introduced merely to make the repository appear complete.
M6.5c implemented 2026-09-27. One-site staged scalars replace full terrain cloning;
the private checkpoint validates accounting before nonthrowing publication. The
complete envelope includes an audit anchor that permits deterministic replay of the
retained process receipts on restore. See schemas/environmental-community.md and
the process contract for bounds. M6.5d remains the broader qualification gate.
M6.5d native qualification completed 2026-09-27; see
[the qualification report](../engineering/ENVIRONMENTAL_QUALIFICATION.md).
No fixture rules changed. Linux CI and deployment performance remain separately
verified gates; this does not claim persistent ecology or live-player readiness.