From 0b9ed185034ac14b1638f7f6e4012edb664e21a0 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 27 Sep 2026 19:06:36 -0400 Subject: [PATCH] Define M7.1 region durability and state closure contract --- README.md | 1 + docs/ROADMAP.md | 9 + docs/STATUS.md | 10 +- .../0016-persistence-and-region-ownership.md | 5 +- docs/adr/0058-region-durability-contract.md | 67 ++++++++ docs/adr/README.md | 2 + docs/architecture/PERSISTENCE_ARCHITECTURE.md | 8 + docs/architecture/REGION_DURABILITY.md | 161 ++++++++++++++++++ docs/engineering/VALIDATION.md | 21 +++ schemas/region-commit.md | 73 ++++++++ 10 files changed, 354 insertions(+), 3 deletions(-) create mode 100644 docs/adr/0058-region-durability-contract.md create mode 100644 docs/architecture/REGION_DURABILITY.md create mode 100644 schemas/region-commit.md diff --git a/README.md b/README.md index 5477b45..a8003f9 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ network service. Dev verification manifests are separate from the simulation. - [Versioned abiotic base generation](docs/world/BASE_GENERATION.md) - [Actual validation results](docs/engineering/VALIDATION.md) - [Current delivery status and next steps](docs/STATUS.md) +- [Region durability and state-closure contract](docs/architecture/REGION_DURABILITY.md) - [Bounded environmental intervals and resume](docs/architecture/ENVIRONMENTAL_SCHEDULING.md) - [Opt-in ECS evaluation and measurements](docs/engineering/ECS_EVALUATION.md) - [Sequential command scheduling and recovery](docs/architecture/SCHEDULER_CONTRACT.md) diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index d1a26e3..8e51668 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -486,3 +486,12 @@ Direct execution matches scheduled restore/retry continuation. Extended run: 5120 episodes, 655360 logical ticks, exact inventories and stable residency. See engineering/ENVIRONMENTAL_SLICE_QUALIFICATION.md for costs and scope limits. Next: M7.1 region durability contract; M6 does not claim durable worker recovery. + +M7.1 design complete (2026-09-27): ADR-0058 chooses full checkpoint batches and +publishes REGION_DURABILITY.md plus schemas/region-commit.md. State closure, +watermarks, bounds, immutable candidate publication, exact retry reconciliation, +permanent ACKs and the crash-point matrix are explicit. This is a contract gate, +not a running database/server. M6 environmental state is complete only within its +profile; M7.4 must add archive serialization and organism/genome binding before +M7.9 can claim retained ancestry. The M7 exit criteria remain unchanged. +Next: M7.2 evaluate/pin storage dependencies and implement/test migrations. diff --git a/docs/STATUS.md b/docs/STATUS.md index ee2269f..81cc792 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -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 57 ADRs (including the accepted M6.7 interval scheduling contract). + diagrams, biological contracts, engineering constitution and 58 ADRs (including the accepted M7.1 durability contract). 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,7 +61,7 @@ for the bounded proof; the general production ECS remains a later measured choic | Priority | Work | Completion evidence | |---|---|---| -| 1 | M7.1 define region durability contract | Complete state inventory, commit/ACK semantics, bounded persistence batches and crash-point matrix | +| 1 | M7.2 adopt storage dependencies and migrations | Pinned PostgreSQL client/server evaluation, guarded schema, real migration and error-path tests | | Research | Improve aggregate fidelity and measure Linux/target-host costs | M4.6 found no qualifying width; see the aggregate budget report | | 2 | Revisit the ADR-0031/0032 reproduction cost model | Reproduction is affordable only at the genome schema's floor; decide whether that is intended before M4 builds cohorts on it | | 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 | @@ -740,3 +740,9 @@ conservation and direct-versus-restored equivalence. See engineering/ENVIRONMENTAL_SLICE_QUALIFICATION.md for actual measurements and limitations. M6 is natively qualified; Linux CI confirmation remains separate. Next is M7.1: define complete region state, durable ACKs and the crash-point matrix. + +M7.1 durability design is complete. ADR-0058 chooses full checkpoint batches, +atomic permanent outcomes and exact reconciliation after ambiguous commits. +REGION_DURABILITY.md inventories included/missing state and the crash-point tests. +No PostgreSQL connection, persistence adapter or region pod exists yet. M7.2 is +next; lineage closure remains an explicit M7.4/M7.9 prerequisite, not waived scope. diff --git a/docs/adr/0016-persistence-and-region-ownership.md b/docs/adr/0016-persistence-and-region-ownership.md index 7f1a0f2..1bdcaf8 100644 --- a/docs/adr/0016-persistence-and-region-ownership.md +++ b/docs/adr/0016-persistence-and-region-ownership.md @@ -4,6 +4,10 @@ Proposed; no persistent services in M0. +M7.1 scope accepted via ADR-0058: full checkpoint batches and atomic permanent +outcomes under fenced ownership. General replay segments and cross-region handoff +remain proposed; no storage implementation is claimed by the design gate. + ## Context Semantic history alone cannot recover physical state; timeout-only ownership permits stale writes. @@ -31,4 +35,3 @@ Incomplete recovery, stale gateway output, partitions and host disaster loss. ## Consequences Fault-test every upload/commit/ACK/handoff boundary before M7. Same lease-row lock guards acquire/renew/commit/release. PostgreSQL time decides expiry; local deadlines fail conservatively. Resolve independent disaster durability before World0. [PostgreSQL locks](https://www.postgresql.org/docs/current/explicit-locking.html). - diff --git a/docs/adr/0058-region-durability-contract.md b/docs/adr/0058-region-durability-contract.md new file mode 100644 index 0000000..778522e --- /dev/null +++ b/docs/adr/0058-region-durability-contract.md @@ -0,0 +1,67 @@ +# ADR-0058: Region durability through full checkpoint batches + +## Status +Accepted for M7.1 design, 2026-09-27. Implementation belongs to M7.2-7.9. +This scopes ADR-0016's proposed production architecture; it does not accept +ADR-0013's client recommendation or select a database/object-store release. + +## Context +M6 proves complete buffer restore for one environmental fixture. Domain events +alone omit source residuals, finite resources, lifecycle and retry history. No +production host exists to record all exogenous inputs. LineageArchive has no +whole-archive codec or enumeration interface, and is not owned by the M6 fixture. +Calling its envelope a complete biological region would discard independent state. + +## Decision +Use immutable **full checkpoint batches** first. Each successful batch replaces +the region head with an exact, validated state at its end tick. Publish its object +reference, permanent outcomes, request receipts and outbox in one fenced database +transaction. Recovery loads the latest committed full checkpoint, not a semantic +event tail. Preserve the predecessor chain for audit and conflict detection. +No event replay codec is implied; complete replay batches remain a future ADR. + +Adopt [REGION_DURABILITY.md](../architecture/REGION_DURABILITY.md) and the +[logical manifest schema](../../schemas/region-commit.md). PostgreSQL is authority; +object storage contains immutable payloads. Candidate bytes may be uploaded before +commit but have no published authority. The transaction atomically makes the +candidate a committed checkpoint and advances committed_tick. This refines the +architecture's rule that published snapshots cannot represent speculative state. + +Start with one in-flight batch per region, at most 64 ticks, explicit state/receipt +byte limits, and a whole-region barrier at any irreversible outcome. Storage I/O +never runs inside the headless process library. Failed or ambiguous commits do not +authorize another batch, final ACK or outcome rollback; reconcile exact commit ID. + +The initial environmental profile admits only the state it actually owns. Missing +genome/ancestry/session/population state is unsupported, never implicitly empty. +M7's ancestry acceptance remains open until a separately versioned closure/profile +and archive codec/binding are implemented. No automatic migration or founder seeding. + +## Alternatives Considered +Semantic events cannot reconstruct arbitrary intermediate state. Full deterministic +input journals are attractive later but need complete input capture and retained +executable versions. Per-tick SQL is unnecessary. An object manifest alone cannot +atomically enforce leases, decisions, history and head changes. A broker is not +the commit authority. Embedding payloads in PostgreSQL is deferred to measured need. + +## Benefits +An explicit recoverable consistency cut; bounded speculative work; no hidden state +reconstruction. Strict terminal outcomes share the same commit as physical state. + +## Costs +Full payload writes per batch, retained orphan objects and a stop during I/O. +These are intentional correctness baselines, to be measured at M7.9. At the M6 +50ms quantum a full 64-tick batch spans 3.2 simulation seconds; hosts should flush +earlier for latency, shutdown or irreversible outcomes. This is not a player SLA. + +## Risks +Object/database durability can differ; final ACK needs both. Same-host backups do +not prove host-loss recovery. A checksum cannot prove a compromised worker's state +is a legitimate simulation result; process isolation and validation remain required. +Durable deduplication/history retention must outlive the 64-tick process cache. + +## Consequences +No deployable pod or database is created by this gate. M7.2 selects/pins adapters +and migrations; M7.3 implements fencing; M7.4 adds codecs/state closure, immutable +publication and necessary history integration; M7.5 implements atomic outcomes; +M7.6-7.9 exercise real worker failures. World0 needs independent durability evidence. diff --git a/docs/adr/README.md b/docs/adr/README.md index 9e8fe19..842f9af 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -1,5 +1,7 @@ # Architecture decision records +- [ADR-0058: Region durability contract](0058-region-durability-contract.md) - accepted M7.1 full checkpoint batches and explicit state closure; storage implementation follows. + - [ADR-0057: Environmental interval scheduling](0057-environmental-interval-scheduling.md) - accepted M6.7 bounded explicit intervals and committed-prefix results. - [ADR-0056: Environmental terminal decay](0056-environmental-terminal-decay.md) - accepted for M6.6 retained corpses, bounded decay and rules/envelope v2. diff --git a/docs/architecture/PERSISTENCE_ARCHITECTURE.md b/docs/architecture/PERSISTENCE_ARCHITECTURE.md index 6b7ec7b..793fab3 100644 --- a/docs/architecture/PERSISTENCE_ARCHITECTURE.md +++ b/docs/architecture/PERSISTENCE_ARCHITECTURE.md @@ -1,5 +1,13 @@ # Persistence and region authority +M7.1 now scopes the first implementation in [ADR-0058](../adr/0058-region-durability-contract.md) +and [REGION_DURABILITY.md](REGION_DURABILITY.md): full checkpoint batches, not +recovery from semantic events or an unimplemented input journal. Candidate uploads +become published committed snapshots only in the fenced head/outcome transaction. +The broader replay and cross-region design below remains a production direction. +The state audit explicitly identifies missing lineage/population integration; +environmental fixture recovery cannot satisfy those acceptance criteria alone. + Status: proposed production contract; source-of-truth PostgreSQL and disposable workers follow locked requirements. M0 implements only an in-memory local proof snapshot. It has no durable journal, database, lease or crash-consistent file writer. diff --git a/docs/architecture/REGION_DURABILITY.md b/docs/architecture/REGION_DURABILITY.md new file mode 100644 index 0000000..2f25a97 --- /dev/null +++ b/docs/architecture/REGION_DURABILITY.md @@ -0,0 +1,161 @@ +# M7 region durability contract + +Design accepted by ADR-0058; no storage/host implementation yet. Locked invariants: +one committed authority, no lost acknowledged permanent outcome under the declared +failure model, no fallback empty world, and no database dependency in headless code. + +## State closure audit + +| State | Existing evidence | M7 treatment / missing work | +|---|---|---| +| M6 environment, two accounts/capacities, terrain and debris | EnvironmentalCommunity envelope v2 and nested codecs | Required exact payload for environmental profile | +| Config, source/growth/efficiency residuals, lifecycle, tick, last funded interval | Same envelope | Restore all; never infer from tick or defaults | +| Process retries/audit anchor, resource revisions | Same envelope, 64 records | Preserve; not a durable command deduplication service | +| Interval scheduler | Stateless M6.7 adapter | No clock/debt to serialize; host queues are separate | +| Genome | Individual Genome v1 codec | No M6 account binding; unsupported in initial profile | +| LineageArchive and dead organisms | Separate append-only API/tests, no complete codec | Add bounded export/restore and binding before ancestry recovery is claimed; retain extinct genomes | +| Population/cohorts | Separate M4 state/codecs | No integration with M6; profile must explicitly add complete ownership before admission | +| Particle entities/positions/RNG | Independent proof snapshot | Not part of M6; never concatenate and imply unified ownership | +| Environmental randomness | None in rules 1/2 | Test-driver RNG is not simulation state; future runtime RNG needs versioned streams | +| Pending host commands | Not implemented | Bounded host queue; uncommitted receipt is provisional; durable decisions stored separately | +| Durable decisions/history/outbox | Not implemented | Required transactional records with commit references and immutable request bytes | +| Player accounts, logout, network sessions, cross-region transfers | Not implemented | Unsupported capabilities; initial profile cannot host players | +| Lease/routing readiness | Not simulation state | Live database authority, never resumed from a saved lease | + +M7.4 must enumerate any newly attached state and extend its schema and tests before +admitting it. For a history-capable profile, validate all organism-to-genome bindings, +parent closure, lifecycle agreement, identity high-waters and archived dead members. +Both checkpoint and durable history must agree. Empty/unrecognized sections cannot +stand in for missing history. M7.9's retained-ancestry criterion is not waived by +the narrower environmental profile. M7.1 completes the audit, not those codecs. + +## Identity, authority and watermarks + +World/region/frame are nonzero durable IDs. No ID is a Pod name. The host records +its unique holder ID and monotonically increasing nonzero lease epoch. Exhaustion +of IDs, epochs, commit sequences or ticks fails closed; never wrap/reuse them. +Simulation tick is local to the fixed versioned region rules. `simulated_tick` +may lead `committed_tick` only within the current bounded pending batch. +`commit_sequence` counts publications, not ticks or field commands. Genesis has +sequence 0, tick 0, no predecessor and an explicit authorized opening payload. +Only provisioning can create genesis; recovery cannot do so. + +The database arbitrates acquire/renew/commit/release under the same region lease +row lock, using database expiry and matching holder/epoch. Commit additionally +compares expected predecessor sequence, digest and tick. No direct worker table +writes may bypass this guard. Renewal never revives expired authority. A stale +process may retain memory but cannot publish a head or originate current output. +The gateway must have bounded-validity registration, not just an epoch number. +M7 has no gateway implementation; readiness alone does not prove remote fencing. + +Lease duration, renewal cadence, local safety margin and store deadlines must be +selected/measured at M7.3 together; no arbitrary timing values are locked here. +Any uncertain lease stops admission, simulation and final output. A commit that +already linearized can remain durable after its writer expires; query can return +its receipt, but does not grant that writer authority to resume. + +## Batch and I/O boundary + +Profile limits: one pending batch, 1..64 contiguous ticks, payload <=1MiB for the +environmental envelope, <=64 durable requests/outcomes and <=64KiB total canonical +request/result bytes per batch. +The batch additionally carries <=64KiB of ordered input/report validation trace; +charge it separately from decision bytes. The full canonical commit request is +bounded by 160KiB including trace, decisions and metadata. One host backlog holds <=64 future inputs and +<=64KiB encoded input bytes. Overflow backpressures/rejects before admission; no +dropping acknowledged inputs. Implementations must charge payload/output buffers, +one upload buffer and the process budget separately. Compression is initially off. +No additional queue may silently defeat these bounds. + +The host drives **one tick at a time** when permanent outcomes are possible. M6.7 +committed-prefix results describe in-memory ticks, not database commits. The host +cannot blindly execute 64 ticks and discover a death afterward: after each tick, +detect terminal transitions, include the immutable outcome, seal the current batch +and pause the whole region before any dependent next tick. The terminal tick's +ordered phases commit together, including decay. No subsequent tick runs until +durable confirmation. Normal flush occurs by 64 ticks or an earlier host deadline; +there is no SQL call from the tick itself. Exceptionally a death can force a +one-tick batch; this is not a per-tick persistence loop. + +```mermaid +sequenceDiagram + participant H as Single-owner region host + participant O as Immutable payload store + participant D as Fenced database authority + H->>H: Execute bounded prefix; seal exact end state and outcomes + H->>O: Put immutable candidate; verify length and SHA-256 + H->>D: Commit expected head + epoch + candidate + decisions/outbox + D-->>H: Confirmed receipt / rejected / unknown + alt unknown + H->>D: Resolve same commit ID and canonical request + Note over H: Remain paused; never assume rollback + end + Note over H: Only confirmed durable receipt permits final outcome and next tick +``` + +Interface sketches (not compiled stubs): `put_immutable(bytes)->VerifiedObject`, +`commit_region_batch(lease, expected_head, batch)->Confirmed|Rejected|Unknown`, +`resolve_commit(world,region,commit_id,canonical_request)->Committed|Absent|Conflict|Unavailable`, +`load_head(world,region)->CommittedManifest`. Adapter errors carry categories and +bounded diagnostic context, never credentials. M7.2 chooses concrete C++ types. + +Candidate state is untrusted to the durable validator: check closure, versions, +identities, end tick, resource invariants and outcome consistency before publishing. +Reject changed terminal histories and impossible outcomes. This does not establish +general anti-cheat against a fully compromised simulation process; database roles +limit its authority and M7 tests verify the selected transition validators. + +## Acknowledgments, retries and recovery + +Received input and simulated input ACKs are explicitly provisional. Only a receipt +for the database transaction that references durably stored bytes can finalize +death/reproduction or another permanent decision. Durable request IDs are scoped +by world/region and are never reused. Retain canonical request and result, compare +exact bytes on retry; changed contents conflict. A process's 64-entry retry cache +cannot authorize pruning the durable record. Permanent history/decision IDs remain +retained for the world lifetime in this initial contract, with archival later. + +On timeout/disconnect, freeze and query the same commit ID. If committed, reconcile +exact digest/predecessor/outcomes and adopt the receipt. If absent, retry the same +request only while still authorized; concurrent delayed originals converge under +the unique ID and head guard. Absence does not prove a request can never arrive. +If fenced, abandon mutation and let the current owner recover; do not undo a death +or ACK speculation. Conflicting bytes or unavailable reconciliation fail closed. + +Recovery acquires fresh authority, reads the committed head, verifies object length +and strong digest, checks the explicit version/profile allowlist, restores the full +payload and reconciles durable outcomes/history to the commit. Missing/corrupt +objects quarantine the region; never select an older head and silently undo ACKs. +Unpublished uploads and uncommitted memory are not recovery inputs. No replay tail +exists in this profile. Required historical binaries/generators remain available. +Readiness requires successful closure checks and a still-valid lease. + +No orphan collection in initial M7. Retention/GC must prove reachability across +heads, commit/decision records, clones and backups before deleting anything. A +clone gets a new identity/authority domain; references cannot permit source writes. +Database plus referenced-object backups need a verified common consistency cut. +Worker/pod loss with surviving durable stores is M7's test model. Host/storage loss +requires separate M8 replication/restore evidence; old backups cannot silently +resurrect acknowledged deaths. World0 stays gated. + +## Crash-point acceptance matrix (required later, not executed by M7.1) + +| Interruption | Required durable result / recovery | Gate | +|---|---|---| +| Before/within a tick | Previous committed head; no permanent ACK | 7.6/7.7 | +| After simulation, before upload | Previous head; pending outcomes not final | 7.5/7.7 | +| During upload or failed verification | No manifest; partial/orphan object unreachable | 7.4 | +| After verified upload, before transaction | Previous head; immutable orphan retained | 7.4/7.7 | +| Lease expires / new owner before transaction | Old writer rejected; new owner loads committed head | 7.3 | +| After manifest insert before transaction commit | Entire transaction rolls back, including outcomes/outbox | 7.5 | +| Commit succeeds, response lost | Resolve same ID returns exact receipt, no second death/birth | 7.5/7.7 | +| Timeout while original request still running | Retry converges or conflicts safely; never infer rollback | 7.5 | +| After final ACK, pod killed | Latest head reconstructs ACKed state and history | 7.7 | +| Outbox delivered twice / broker down | Idempotent projection or queued delivery; no second simulation mutation | 7.5 | +| Payload missing/corrupt, unknown versions | Quarantine/not ready, no fallback genesis or older world | 7.4/7.7 | +| Paused stale worker resumes | Renew/commit/output rejected; cannot skip recovery | 7.3/7.6 | +| Shutdown with pending/unknown commit | Drain boundedly or leave unavailable; next owner reconciles | 7.6/7.7 | +| Clone/migration fails mid-publication | Source untouched; target not ready, no partial version switch | 7.9 | + +M7.1 verification is a source/state inventory and contract review. Real database, +object-store, process-kill and network partition tests are still required. diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index fb55ba0..7b08de4 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -1996,3 +1996,24 @@ changed. Complete evidence and reproduction commands are in M6 is natively qualified for the bounded synthetic scope. Linux CI/UBSan/TSan, R730xd measurements and persistent server recovery are not claimed. The local Linux toolchain/Docker engine remains unavailable. Next: M7.1 durability contract. + +## M7.1 region durability contract - 2026-09-27 + +Documentation-only gate: ADR-0058, REGION_DURABILITY.md and logical region-commit +schema. Reviewed existing M6 process/resource codecs and scheduling contracts, +LineageArchive public API and retention tests, individual genome codec, separate +population/particle interfaces, persistence architecture and ADRs 0013/0016. +The audit identifies complete M6 state and missing archive/binding/host state. +Full checkpoint batches are selected; semantic events alone are not recovery. + +Verified new contract relative links (2 resolved) and all eight ADR sections; +git diff --check passed. Reviewed the crash matrix against upload, fenced DB +publication, ambiguous commit, ACK, recovery and clone boundaries. Those rows +are future executable acceptance tests, not fault-injection results from this gate. +No C++/CMake/schema codec implementation changed, so build/sanitizer suites were +not rerun. M6.8's recorded native checks remain the latest executable evidence. +No database, object storage, Kubernetes access or deployment was performed. + +M7.1 design gate is complete. M7.2 must evaluate/pin dependencies and exercise real +migrations; M7.4 must implement additional ancestry state closure before M7.9 can +claim lineage recovery. No retained-history or World0 requirement was relaxed. diff --git a/schemas/region-commit.md b/schemas/region-commit.md new file mode 100644 index 0000000..387515b --- /dev/null +++ b/schemas/region-commit.md @@ -0,0 +1,73 @@ +# Region commit manifest contract v1 (M7.1 design) + +Authority: ADR-0058 and docs/architecture/REGION_DURABILITY.md. Logical schema, +not an implemented wire codec, SQL migration or permission to serialize structs. +M7.2 chooses concrete storage types preserving these domains; M7.4 specifies +canonical byte encoding and tests before publication. No format may silently +truncate u64 to a signed database integer. No credentials or executable URLs. + +| Field | Domain / invariant | +|---|---| +| manifest_version | Exactly 1 | +| world_id, region_id, frame_id | Nonzero u64; durable provisioned identities | +| profile | Explicit enum: environmental-v1 initially; unknown values reject | +| commit_id | Opaque globally unique 128-bit request identity, immutable across retries | +| commit_sequence | u64; genesis 0, otherwise predecessor+1 without wrap | +| predecessor_commit_id / digest | Absent only for genesis; otherwise exact committed head | +| begin_tick / end_tick | u64; begin equals predecessor end; 1..64 tick delta except genesis 0/0 | +| holder / epoch | Unique holder identity and nonzero u64 acquisition epoch; checked in DB | +| tick_microseconds | Positive u64 matching nested immutable config | +| version_bundle | Exact required rule/schema/generator/coordinate/material versions plus retained build artifact identity | +| payload_key | Opaque immutable store key resolved only in configured namespace | +| payload_bytes / sha256 | Positive length <=1MiB for environmental-v1; 32-byte strong content digest | +| canonical_request / request_sha256 | <=160KiB canonical publication metadata, trace and ordered decisions; binds payload digest and predecessor; SHA-256 is not authentication | +| validation_trace | Complete ordered EnvironmentalInput/Report pairs for each tick in this batch, <=64; included in canonical request identity; <=64KiB separately from decision bytes | +| decisions | <=64, sorted unique durable request IDs, canonical input/result and outcome type; combined request/result <=64KiB | +| history/outbox rows | Deterministically derived from decisions; same transaction and commit reference, stable event IDs | +| durability_policy | Explicit configured profile verified at deployment; no assumed host-loss guarantee | + +The commit digest is SHA-256 of canonical publication metadata and ordered +decisions (excluding the digest itself and DB timestamps). Payload SHA-256 covers +the exact uncompressed payload bytes. It is distinct from nested FNV checksums. +Use a vetted digest provider selected/pinned in M7.2, never implement crypto here. +The build identity refers to an immutable retained artifact and is part of the +allowlist; a semver string alone cannot authorize recovery. + +Initial payload: complete M6 environmental envelope, rules=2/format=2; nested +coupled resources/fields/terrain formats=1 and coordinate/generator/material=1; +interval adapter=1 has no payload state. Outer world/frame/end tick must equal +nested identity/tick/field revision. Region mapping is manifest-owned and immutable +within the provisioned region. Both organism account IDs remain local to that +region; a future globally bound profile requires explicit ownership mapping. + +environmental-v1 refuses player sessions, reproduction, genome/lineage bindings, +population ownership and external transfers. Its permanent outcomes are only +the two fixture terminal transitions, identified by region+actor, and recorded +atomically with checkpoint state. Ordered accepted host input identifies the +cause/request; depletion-derived death uses a deterministic region/tick/actor +event identity. The committed predecessor's terminal state cannot become active. +Every new terminal transition in the admitted batch requires exactly one outcome; +no unchanged/dead actor may yield a new death event. Verify the batch input/report +trace against the predecessor during staging and compare its resulting bytes to +the uploaded candidate. At <=64 ticks this trace is bounded; this is commit +validation, not a retained recovery replay tail. Opaque caller-supplied events +alone cannot validate a checkpoint. Persist canonical causal requests in receipts. + +Lineage-capable profiles remain unassigned: they require a complete archive codec, +organism/genome mappings, allocator state, all phenotype/development progress and +random streams actually used. Their durable history includes extinct genomes; +they cannot reuse environmental-v1 with missing sections. Implement this extension +before claiming the M7 retained-ancestry exit criterion. + +Database commit operation: lock lease row; validate holder/epoch/unexpired authority; +check commit-ID deduplication and exact canonical bytes; validate expected head; +insert manifest + decisions/history/outbox and advance head atomically. For exact +previously committed IDs, resolution can return the original immutable receipt +without new mutation even under a later epoch. A stale writer cannot use that +receipt to obtain current readiness. Changed bytes conflict. No decision may +reference a future or uncommitted manifest. + +One in-flight commit and fixed metadata/input bounds avoid unbounded ambiguity +queues. Genesis uses a distinct provisioning operation, never ordinary recovery. +Objects cannot be collected merely because they precede the current head; decision +records, archives, clones and backups may still reference them. No GC in initial M7.