Files
aevolution/schemas/environmental-community.md
dingoandClaude Opus 5.5 4319da2750
Foundation / checks (deploy) (push) Successful in 3m27s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (client) (push) Successful in 12m20s
Foundation / checks (network) (push) Successful in 13m53s
Foundation / checks (tsan) (push) Successful in 8m9s
Foundation / checks (checks) (push) Successful in 33m4s
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 21m43s
M11.1: environmental rules 3 with per-second rates (ADR-0099, segment 3)
Rules 3 is rules 2 with irradiance, growth, intake and decay per second. The community
derives its per-tick form once at creation and restore (rationals exact via the tick in
numerator and denominator, caps rounded down); steps and the snapshot layout are rules
2's; the codec reads formats 1-3. At 50 ms a x20 per-second twin steps identically
through feeding, death and decay and across a snapshot; at 25 ms caps halve. Rules 1/2
and the development-v1 opening are unchanged. Development version 1 outputs stay tied
to their 50 ms quantum and the tick-abstract M2 fixtures are not migrated (recorded).
environmental-qualification's "unknown rules" case moves from 3 to 4.
Refresh the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:55:45 -04:00

4.6 KiB

Environmental community envelope v1 (M6.5c)

Version 3: rates per second (M11.1, ADR-0099)

Format 3 requires rules 3 and has format 2's layout byte for byte. Only the units of five rates change:

  • irradiance: irradiance_numerator / irradiance_denominator, in pJ per um^2 per second;
  • growth: growth_numerator / growth_denominator, in units per second;
  • intake[5] and decay[10]: whole fg or pJ per second.

At creation and restore, the community derives a per-tick rules 2 form at tick_microseconds (1 us to 1 s).

  • The rationals become numerator * tick / (denominator * 10^6), which is exact. Their remainders are stored at that scale.
  • The caps round down, never exceeding the per-second rate.
  • A rate that overflows at the tick is a configuration error.

Formats 1 and 2 are unchanged and replay their own rules.

Version 2 extension (M6.6, ADR-0056)

Format 2 requires rules 2; format 1 requires rules 1. The v1 layout below is unchanged. In v2 append decay[10] to config (39 u64 total), consumer_terminal to each progress (7 u64; anchor 37 u64), terminal[2] after each input's bite, and consumer_transition plus decomposed[10] after each report's terminal_transition. Each v2 receipt is 38 u64 (304 bytes). Fixed overhead is 712 bytes plus receipts and nested resource bytes. Lifecycle flags are 0/1; decomposed uses source field order. Both versions replay their own rules. V1 rejects nonzero extension fields at creation/input validation; they are not silently omitted. No conversion API. Terminal accounts may retain balances in v2; v1 retains its empty-terminal rule. Caps are whole fg/pJ per tick, not rates requiring fractional carry. Remaining corpse inventory resides in nested resource accounts, never duplicated here.

Version 1 layout

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.