Publish mutation choices atomically with their checkpoint

ADR-0121, schema v35. A checkpoint whose trace carries mutation
selections publishes with its canonical mutation block and one result
byte per choice. SQL checks the block's order, matches each record to
one reserved choice of this region and to its trace selection (tick,
life, offer, operator, successor identity), binds it to the commit with
its result, refuses a choice already bound elsewhere and checks exact
retries. The four-argument publisher becomes an internal helper behind
a wrapper that refuses traces with selections.

C++ publication takes the results from its own replay rather than a
caller, prepared commits carry block and results through retry and
resolution, and recovery rebuilds the bound choices and requires the
replay's results to match. A PostgreSQL test feeds a v4 cell to its
first offer, publishes a reserved choice, recovers it and restarts a
host. Host and session admission follow in 11.4c-2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-13 19:23:39 -04:00
co-authored by Claude Opus 5.5
parent bf5c626f19
commit 1bbac48543
14 changed files with 897 additions and 28 deletions
+10
View File
@@ -74,3 +74,13 @@ pending; no gameplay balance is treated as final by this plan.
biology/archive publication and crash recovery remain. No 11.4c or live
mutation path is claimed complete until those pieces pass CI (see
[validation log](VALIDATION.md)).
- 11.4c-1 (ADR-0121, schema v35): a checkpoint whose trace carries mutation
selections publishes through `publish_cellular_mutation_checkpoint` with its
canonical 64-byte mutation block and one result byte per choice. SQL checks
block order, one reserved choice of this region per trace selection (same
tick, life, offer, operator and successor identity), binds each to the commit
with its result, refuses another commit's binding and checks exact retries;
the four-argument publisher now refuses traces with selections. C++
publication takes its results from its own replay, and recovery reloads the
bound choices and requires the replay's results to equal them. Host and
session admission (11.4c-2) remain.
+19 -1
View File
@@ -7275,4 +7275,22 @@ contracts for the v4 genesis (round trip, restore, wrong history, v3 bundle
refusal, successor); g++-14 `-Werror` and clang-tidy-19 on the persistence,
provisioner and PostgreSQL test sources; `bash -n` on both scripts. The SQL
migration, `region_migration_tests` (v34 history, kind-2 input validation) and
`region_store_tests` (cellular-v2 provisioning under v4) run only in CI.
`region_store_tests` (cellular-v2 provisioning under v4) run only in CI.
## 2026-10-13 — M11.4c-1 durable mutation publication (CI pending)
Migration 35 lets birth binding read format-3 traces that carry mutation
records, adds `cellular_mutation_selections`, `check_cellular_mutation_block`
and `publish_cellular_mutation_checkpoint` (binding each reserved choice to
the commit with its result), a matching resolver and a lease-fenced recovery
loader, and turns the old four-argument publisher into an internal helper
behind a wrapper that refuses traces with selections. The runtime privilege
audit lists the three new functions. `publish_cellular_batch` accepts mutation
actions, matches them to the trace, and takes their results from its replay;
prepared commits carry the block and results through retry and resolution;
recovery rebuilds the choices from the publication rows and compares results.
`cellular_publication_tests` adds a v4 region that feeds a cell to its first
offer, reserves and publishes a choice, recovers it, and restarts a host.
Executed locally: MSVC Debug `ctest` 68/68; g++-14 `-Werror`, clang-tidy-19
and clang-format 19.1.5 on the persistence, batch, host and test sources. The
migration and PostgreSQL tests run only in CI.