Files
aevolution/schemas/cellular-lives-v7.md
T
dingo a5307c768b
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (network) (push) Successful in 21m0s
Foundation / checks (client) (push) Successful in 22m13s
Foundation / checks (tsan) (push) Successful in 26m35s
Foundation / checks (postgres) (push) Successful in 1h1m27s
Foundation / checks (checks) (push) Successful in 1h14m29s
Foundation / postgres-tools (push) Successful in 1m19s
Foundation / server-image (push) Successful in 3m46s
Foundation / image (push) Successful in 4m57s
feat(lifecycle): add opt-in funded cellular maturation
2026-10-18 21:48:27 -04:00

76 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Cellular owner format 7: exact boundary accounting
Authority: ADR-0144, with opt-in maturation in ADR-0157. Rules 8 retain their
meaning; the additional rules-9 interpretation is portable only. Durable bundle
10 still admits rules 8 exclusively; no live worker opts into maturation.
Formats 1–6 and their canonical bytes remain unchanged. Explicit no-tick upgrade
from rules-8 format 6 preserves biology and opening stock and adds zero flows
and no nonresident references. No downgrade may discard a nonzero ledger.
Little-endian, no native padding. Magic `AEVCLV07`, format 7, rules 8 or 9. The first
220 bytes have the format-6 layout except magic/format/rules. The additional fields are:
| Offset | Bytes | Field |
|---:|---:|---|
| 220 | 40 | Cumulative incoming inventory: energy, C, N, P, other; five u64s |
| 260 | 40 | Cumulative outgoing inventory in the same order |
| 300 | 4 | Nonresident organism count, at most 65,536 |
| 304 | 4 | Reserved zero |
| 308 | 8 each | Existing sorted spawn-site records |
| after sites | 504 each | Existing format-6 living records |
| after lives | 124 each | Existing format-5/6 corpse records |
| after corpses | declared lengths | Complete canonical habitat and lineage archive |
| after archive | 8 each | Sorted unique nonresident organism IDs |
| final | 8 | FNV-1a64 of all preceding bytes |
The exact length is `308 + 8*sites + 504*lives + 124*corpses + habitat_bytes +
archive_bytes + 8*nonresidents + 8`, bounded by the existing 16 MiB limit. Require
all existing nested closure, trusted identity/tick and canonical re-encoding.
The checksum is corruption detection, not provenance or authority.
Per channel, `opening + incoming = current + outgoing`. Validate the net flow
using checked addition/subtraction, without overflowing an intermediate sum of
large equal flows. Each cumulative counter itself may never wrap. `current`
counts nursery, habitat, bodies, reserves, corpses and heat exactly once. Flow
metadata and nonresident history own no material and provide no funding.
Every archived organism must be exactly one local life, local corpse or
nonresident reference. Nonresidents retain immutable birth/revision/death facts;
an alive fact is only the last known cut, not a current owned census. Known facts
cannot be in the future. Duplicate residency and terminal resurrection are refused.
Foreign bud IDs retain `2^63 + origin_region*2^32 + sequence`, with nonzero bounded
origin/sequence; local-origin IDs must still lie below the local next-bud counter.
Imported cells have zero accounts and preserve organism/event IDs, parent-life,
source, age, genome, growth, damage, position, body and reserve. New buds consume
the destination namespace and are inserted in identity order even when their IDs
are smaller than imported parents. The existing twin roll remains keyed by world,
current owner region, parent life and tick; a transfer promises an exact cut,
not identical future ecology in a different regional environment.
Portable paired preparation moves a complete wildlife genome group between
distinct compatible owners at one tick, preserving numeric local coordinates.
Both owners' controlled cells must be fully suspended. Bounds, destination
body conflicts, capacity, ancestry merge and both budgets must pass. Rejection
leaves both originals unchanged. Clamped arena geometry remains ADR-0102;
automatic spatial crossings and linked environmental fields are unimplemented.
Durability must bind both candidates to one fenced atomic pair publication. This
format alone supplies no freeze, escrow, receipt, activation or retry guarantee.
## Rules 9: funded maturation
ADR-0157's explicit no-tick upgrade from rules 8 changes only the rules field and
checksum, preserving this entire layout and all stocks/flows/history. The retained
growth, body, reserve and world heat fields encode every maturation effect. At
most 5 realized thousandths per 50 ms active tick are constructed after old-size
actions, budding and presence changes. Newborn/frozen/suspended cells do not grow;
a suspended resume begins growth next tick. Expanded squares retain their corner
and must fit every present neighbor/boundary, in ascending life-ID order. A blocked
expansion spends nothing. Damage and immutable genomes are preserved.
Saved mutation offers retain their original draw/context; rules 9 fund the chosen
successor at current growth. No context/body reset is encoded. Unknown rules fail
closed; rules 9 in owner format 6 are refused. Biological migration and durable
rules-9 admission remain unsupported pending their separate qualification.