Files
aevolution/schemas/environmental-community.md
T

44 lines
2.9 KiB
Markdown

# Environmental community envelope v1 (M6.5c)
Authority ADR-0055. All integers little-endian, no native struct serialization.
Header u64 magic 0x3150434f564541, u64 format=1, u64 total bytes. Maximum 1 MiB.
Then config, current progress, audit anchor, u64 receipt count, chronological
receipts, u64 coupled resource payload length, resource v1 bytes, trailing FNV-1a64
checksum of all previous bytes. FNV detects corruption, not hostile forgery.
Config fields are u64 in public declaration order: rules, world, frame, producer,
consumer, source, tick_microseconds, area_um2, irradiance_numerator/denominator,
efficiency, growth_numerator/denominator, growth_cost, recipe[5] (W/C/N/P/O),
intake[5] (C/N/P/O/E), assimilation, producer_min/max_mK, consumer_min/max_mK.
Site is the unique nested field site; it is not independently defaulted on restore.
Progress: tick, source_remainder, last_funded, efficiency_remainder,
growth_remainder, producer_terminal (0/1). Consumer has no terminal transition in
v1; its sole supported state is active, encoded by rules v1 rather than an unused flag.
Anchor: environment[10], producer[10], consumer[10], then progress.
Each receipt: input (temperature_mK, source_enabled 0/1, bite[5]), report
(tick,captured,retained,capture_heat,grown,unmet,source_status 0/1/2,
assimilated[5],waste[5],terminal_transition 0/1).
Require receipt count=min(tick,64), ticks contiguous ending at current tick, anchor
tick=current tick-count. Validate anchor capacities, per-element totals, source and
growth residuals, source interval watermark, lifecycle bounds. Replay retained inputs
from the audit anchor with immutable config and current capacities; every report
must match and final balances/progress must equal the nested checkpoint/current
progress. This audit copy is historical state, never another spendable inventory.
At tick0, progress and history are empty. No missing rate data is defaulted.
Only a pristine resource owner with one field site, one resident terrain chunk,
all ten fields, two ordered accounts and zero command history is admitted. Process
restore separately requires checkpoint command/adoption=tick and empty transfer
history. Bare resource snapshots are not process envelopes. No live migration API.
One-site staging uses fixed scalar arrays; replacing scalar field baselines allocates
nothing. Charge sizeof(process owner), owned resource resident bytes and 64KiB
process scratch plus the resource owner's separate 64KiB scratch before admission/restore. Query/snapshot caller buffers and allocator headers
are excluded. Snapshot construction temporarily holds nested bytes plus output,
bounded by 2MiB; host must provide that additional output allowance. No terrain clone
or codec buffer is allocated by advance. Restore replay is bounded to 64 steps.
Codec and transitions are single-owner, in-memory operations. No disk publication,
region lease, external energy import, player login or offline progression exists.