Resolve a cellular genesis under the build that wrote it
Foundation / checks (checks) (push) Successful in 40m17s
Foundation / checks (deploy) (push) Successful in 3m54s
Foundation / checks (ecs) (push) Successful in 2m24s
Foundation / checks (network) (push) Successful in 18m40s
Foundation / checks (postgres) (push) Successful in 42m11s
Foundation / checks (tsan) (push) Successful in 9m39s
Foundation / checks (client) (push) Successful in 13m33s
Foundation / postgres-tools (push) Successful in 1m13s
Foundation / image (push) Successful in 3m10s
Foundation / server-image (push) Successful in 3m16s
Foundation / checks (checks) (push) Successful in 40m17s
Foundation / checks (deploy) (push) Successful in 3m54s
Foundation / checks (ecs) (push) Successful in 2m24s
Foundation / checks (network) (push) Successful in 18m40s
Foundation / checks (postgres) (push) Successful in 42m11s
Foundation / checks (tsan) (push) Successful in 9m39s
Foundation / checks (client) (push) Successful in 13m33s
Foundation / postgres-tools (push) Successful in 1m13s
Foundation / image (push) Successful in 3m10s
Foundation / server-image (push) Successful in 3m16s
Promoting the dev server image changed --build, and the cellular provision rerun re-encoded the genesis manifest with the new build, so it refused region 100/2 as a different genesis. The check could also never pass once the head moved past genesis. Match an unadvanced cellular genesis under its recorded build, and accept profile and frame past genesis as the other openings do. A different commit or opening is still refused. Add a PostgreSQL process test and record the finding in ADR-0123. Also refresh the dev session window (3 h). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -427,12 +427,94 @@ void provisioning_creates_the_life_allocator_once() {
|
||||
CHECK(code == 4 && has(higher, "life-allocator refused existing below start"));
|
||||
CHECK(next_identity() == "5000");
|
||||
}
|
||||
|
||||
// ADR-0123: an image promotion changes --build, but a cellular genesis records the
|
||||
// build that wrote it. A rerun under a new build still resolves the same genesis,
|
||||
// while a different commit or opening is refused.
|
||||
void cellular_provisioning_survives_a_build_promotion() {
|
||||
using evo::biology::primitive_endowment;
|
||||
const ServerRegion r{{9761, 1}, fresh("cellular-provision-9761")};
|
||||
const auto endowed = primitive_endowment();
|
||||
CHECK(endowed);
|
||||
evo::accounting::Inventory funding = endowed->body;
|
||||
funding.energy.value += endowed->reserve.energy.value + endowed->construction.value;
|
||||
const auto run = [&](const std::string& build, const std::string& commit,
|
||||
const std::string& patch, int& code) {
|
||||
Child tool{{env("EVO_WORLD_CLONE_BIN"),
|
||||
"provision",
|
||||
"--world",
|
||||
"9761",
|
||||
"--region",
|
||||
"1",
|
||||
"--opening",
|
||||
"cellular-v1",
|
||||
"--pg-host",
|
||||
env("PGHOST"),
|
||||
"--pg-port",
|
||||
env("PGPORT"),
|
||||
"--pg-database",
|
||||
env("PGDATABASE"),
|
||||
"--pg-user",
|
||||
env("PGUSER"),
|
||||
"--objects",
|
||||
r.root.string(),
|
||||
"--build",
|
||||
build,
|
||||
"--retain-build",
|
||||
"true",
|
||||
"--commit",
|
||||
commit,
|
||||
"--frame",
|
||||
"9",
|
||||
"--source-id",
|
||||
"1",
|
||||
"--funding-energy-pj",
|
||||
std::to_string(funding.energy.value),
|
||||
"--funding-carbon-fg",
|
||||
std::to_string(funding.matter[0].value),
|
||||
"--funding-nitrogen-fg",
|
||||
std::to_string(funding.matter[1].value),
|
||||
"--funding-phosphorus-fg",
|
||||
std::to_string(funding.matter[2].value),
|
||||
"--funding-other-fg",
|
||||
std::to_string(funding.matter[3].value),
|
||||
"--site",
|
||||
"2500,2500",
|
||||
"--width-um",
|
||||
"10000",
|
||||
"--height-um",
|
||||
"10000",
|
||||
"--ambient-temperature-mk",
|
||||
"293150",
|
||||
"--patch",
|
||||
patch}};
|
||||
code = tool.wait_exit(30s);
|
||||
return tool.lines();
|
||||
};
|
||||
const std::string first_build(64, 'c');
|
||||
const std::string second_build = std::string(63, 'c') + "d";
|
||||
const std::string commit(32, 'a');
|
||||
const std::string patch = "3000,3000,2,1000,1000,1000,1000,1000";
|
||||
int code = -1;
|
||||
const auto first = run(first_build, commit, patch, code);
|
||||
CHECK(code == 0 && has(first, "provisioned world=9761 region=1 sequence=0 tick=0"));
|
||||
const auto promoted = run(second_build, commit, patch, code);
|
||||
CHECK(code == 0 && has(promoted, "already-provisioned world=9761 region=1 sequence=0 tick=0"));
|
||||
const auto other_commit = run(second_build, std::string(32, 'b'), patch, code);
|
||||
CHECK(code == 4 && has(other_commit, "provision refused existing cellular region; use its "
|
||||
"original --commit to resolve genesis"));
|
||||
const auto other_opening =
|
||||
run(second_build, commit, "4000,4000,2,1000,1000,1000,1000,1000", code);
|
||||
CHECK(code == 4 && has(other_opening, "provision refused existing cellular region; use its "
|
||||
"original --commit to resolve genesis"));
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void run_region_store_tests() {
|
||||
provisioning_is_idempotent();
|
||||
primitive_provisioning_is_explicit_and_profile_safe();
|
||||
provisioning_creates_the_life_allocator_once();
|
||||
cellular_provisioning_survives_a_build_promotion();
|
||||
full_volumes_publish_nothing();
|
||||
failing_writes_leave_nothing();
|
||||
check_store_qualifies_the_stores();
|
||||
|
||||
Reference in New Issue
Block a user