Exercise cellular action result recovery
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (checks) (push) Failing after 41s
Foundation / checks (postgres) (push) Failing after 50s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-10 23:24:20 -04:00
parent 13273b46f4
commit 4930fd7159
3 changed files with 23 additions and 9 deletions
+3 -2
View File
@@ -247,8 +247,9 @@ scoped change before starting the next segment.
current tail trace and predecessor link, loads the immutable action block under
the lease, replays the batch and checks every action's persisted kind, result,
tick, sequence and canonical input bytes. A PostgreSQL integration test covers
empty-cell genesis through publish and restart-style recovery. CI execution is
pending; populated-life action-result cases and process fault recovery remain.
funded-founder genesis, one committed neutral action, publication and
restart-style recovery. CI execution is pending; action conflicts and process
fault recovery remain.
## Exit boundary
+3 -2
View File
@@ -6277,8 +6277,9 @@ Added lease-fenced cellular checkpoint recovery. It verifies the head payload,
trace/header and predecessor digest, replays the complete batch, and checks each
action row against the action block's account/action identity, cellular kind,
committed result, intended tick, head sequence and exact canonical input. The
PostgreSQL integration suite now exercises profile-4 genesis, a two-tick
publication, and recovery of that committed head.
PostgreSQL integration suite now exercises profile-4 genesis with a funded
founder, a two-tick batch carrying one canonical neutral action, atomic
publication, and recovery including its durable result row.
`git diff --check` and GCC 13.2 C++23 syntax checks with warnings as errors pass
for the changed adapter and integration test. Full build, PostgreSQL execution,
+17 -5
View File
@@ -57,14 +57,18 @@ void run_cellular_publication_tests() {
CHECK(endowed);
auto funding = endowed->body;
funding.energy.value = endowed->reserve.energy.value + endowed->construction.value;
auto primitive = PrimitiveLives::create({key.world, key.region, 1, 1, funding, {{0, 0}}});
auto primitive = PrimitiveLives::create({key.world, key.region, 1, 17, funding, {{0, 0}}});
CHECK(primitive);
LifeRequest founder;
founder.account = filled<16>(0x43);
founder.action = 7;
CHECK((*primitive)->spawn(founder, {1, 101, 201, 301, {0}}));
auto habitat = evo::biology::CellularHabitat::create(
{key.world, key.region, 1, 1'000, 1'000, {}});
CHECK(habitat);
auto opening = CellularLives::create(**primitive, std::move(*habitat),
{{1'000, 1'000}, 0, 293'150});
CHECK(opening && (*opening)->lives().empty());
CHECK(opening && (*opening)->lives().size() == 1);
const auto payload = (*opening)->snapshot();
const auto payload_digest = sha256(payload);
@@ -88,17 +92,25 @@ void run_cellular_publication_tests() {
CHECK(predecessor_digest);
CellularBatch batch;
batch.header = {key.world, key.region, 1, predecessor->head.commit, *predecessor_digest, 0, 2};
batch.ticks.resize(2); // The funded genesis has no player-controlled lives.
batch.ticks.resize(2);
for (auto& tick : batch.ticks)
tick.lives.push_back({(*opening)->lives()[0].identity.life, {}});
const auto replay = replay_cellular_batch(**opening, batch);
CHECK(replay);
CellularActionRecord action;
action.account = founder.account;
action.action_id = 77;
action.input[0] = 1; // Tick 1, neutral movement, no patch target.
const std::array actions{action};
auto published = publish_cellular_batch(*db, **objects, *lease, *predecessor, batch,
**replay, filled<16>(0x22), build, 5s);
**replay, filled<16>(0x22), build, 5s, {}, actions);
CHECK(published && published->committed.head.sequence == 1 &&
published->committed.head.end_tick == 2);
auto recovered = recover_cellular_checkpoint(*db, **objects, key, *lease,
std::span{&build, 1}, 5s);
CHECK(recovered && recovered->manifest.sequence == 1 && recovered->state->tick() == 2 &&
recovered->state->snapshot() == (**replay).snapshot() && recovered->actions.empty());
recovered->state->snapshot() == (**replay).snapshot() &&
recovered->actions == std::vector<CellularActionRecord>{action});
CHECK(release_region_lease(*db, key, *lease, 5s));
}