feat(ecology): make photosynthesis regions playable on DEV
Foundation / checks (ecs) (push) Successful in 2m19s
Foundation / checks (deploy) (push) Successful in 4m47s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 16m48s
Foundation / checks (network) (push) Canceled after 16m46s
Foundation / checks (postgres) (push) Canceled after 16m47s
Foundation / checks (client) (push) Canceled after 16m53s
Foundation / checks (tsan) (push) Canceled after 14m33s
Foundation / checks (ecs) (push) Successful in 2m19s
Foundation / checks (deploy) (push) Successful in 4m47s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 16m48s
Foundation / checks (network) (push) Canceled after 16m46s
Foundation / checks (postgres) (push) Canceled after 16m47s
Foundation / checks (client) (push) Canceled after 16m53s
Foundation / checks (tsan) (push) Canceled after 14m33s
ADR-0176 and schema 57 admit raw cellular bundle 13 (rules 11 on owner format 9) through parser-local normalization to bundle 12, and a fenced no-tick 12 -> 13 upgrade that declares the region's light; recovery reads the light from the target and re-derives the whole target from the source. The resumable cellular-v8 opening provisions a cellular-v7 genesis, one empty tick and the durable upgrades to bundle 13. Session v12 adds the owner's captured light and the producers it can see to its perception, and lets offers name photosynthesis; older sessions keep their layouts and never receive photosynthesis candidates. The client draws chloroplasts by efficiency, shows sunlight in the HUD and offers photosynthesis cards. DEV now provisions and serves region 9 with the trial light; region 8 stays stored but unserved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -435,59 +435,62 @@ void provisioning_creates_the_life_allocator_once() {
|
||||
std::vector<std::string> provision_cellular(const ServerRegion& r, const std::string& world,
|
||||
const std::string& opening, const std::string& build,
|
||||
const std::string& commit, const std::string& patch,
|
||||
int& code, const std::string& food = "--patch") {
|
||||
int& code, const std::string& food = "--patch",
|
||||
const std::vector<std::string>& extra = {}) {
|
||||
const auto endowed = evo::biology::primitive_endowment();
|
||||
CHECK(endowed);
|
||||
evo::accounting::Inventory funding = endowed->body;
|
||||
funding.energy.value += endowed->reserve.energy.value + endowed->construction.value;
|
||||
Child tool{{env("EVO_WORLD_CLONE_BIN"),
|
||||
"provision",
|
||||
"--world",
|
||||
world,
|
||||
"--region",
|
||||
"1",
|
||||
"--opening",
|
||||
opening,
|
||||
"--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",
|
||||
food,
|
||||
patch}};
|
||||
std::vector<std::string> arguments{env("EVO_WORLD_CLONE_BIN"),
|
||||
"provision",
|
||||
"--world",
|
||||
world,
|
||||
"--region",
|
||||
"1",
|
||||
"--opening",
|
||||
opening,
|
||||
"--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",
|
||||
food,
|
||||
patch};
|
||||
arguments.insert(arguments.end(), extra.begin(), extra.end());
|
||||
Child tool{arguments};
|
||||
code = tool.wait_exit(30s);
|
||||
return tool.lines();
|
||||
}
|
||||
@@ -624,6 +627,32 @@ void cellular_v7_provisioning_scatters_bubbles() {
|
||||
manifest->history_profile == cellular_revision_history_profile);
|
||||
}
|
||||
|
||||
// ADR-0176: cellular-v8 is the cellular-v7 opening taken through one empty tick and the
|
||||
// durable upgrades to bundle 13 with declared light; it is resumable and idempotent.
|
||||
void cellular_v8_provisioning_declares_light() {
|
||||
const ServerRegion r{{9775, 1}, fresh("cellular-v8-provision-9775")};
|
||||
const std::string build(64, 'e');
|
||||
const std::string commit = "b0b81e5c0f7e1d2ba1a0ce5c0f7e1d2d"; // Unique to this test.
|
||||
int code = -1;
|
||||
const auto dark = provision_cellular(r, "9775", "cellular-v8", build, commit,
|
||||
"40,1,2000000,50000,20000,0,0", code, "--motes");
|
||||
CHECK(code != 0); // cellular-v8 requires --light-pj.
|
||||
const auto first =
|
||||
provision_cellular(r, "9775", "cellular-v8", build, commit, "40,1,2000000,50000,20000,0,0",
|
||||
code, "--motes", {"--light-pj", "40"});
|
||||
CHECK(code == 0 && has(first, "provisioned world=9775 region=1 sequence=5 tick=1"));
|
||||
const auto again =
|
||||
provision_cellular(r, "9775", "cellular-v8", build, commit, "40,1,2000000,50000,20000,0,0",
|
||||
code, "--motes", {"--light-pj", "40"});
|
||||
CHECK(code == 0 && has(again, "already-provisioned world=9775 region=1 sequence=5 tick=1"));
|
||||
auto db = owner();
|
||||
const auto head = load_region_checkpoint(*db, r.key, 5s);
|
||||
CHECK(head);
|
||||
const auto manifest = decode_manifest(head->manifest);
|
||||
CHECK(manifest && manifest->cellular_versions == cellular_v13_versions &&
|
||||
manifest->history_profile == cellular_revision_history_profile);
|
||||
}
|
||||
|
||||
void cellular_provisioning_survives_a_build_promotion() {
|
||||
const ServerRegion r{{9761, 1}, fresh("cellular-provision-9761")};
|
||||
const auto run = [&](const std::string& build, const std::string& commit,
|
||||
@@ -660,6 +689,7 @@ void run_region_store_tests() {
|
||||
cellular_v5_provisioning_uses_the_balance_bundle();
|
||||
cellular_v6_provisioning_uses_the_reproduction_bundle();
|
||||
cellular_v7_provisioning_scatters_bubbles();
|
||||
cellular_v8_provisioning_declares_light();
|
||||
full_volumes_publish_nothing();
|
||||
failing_writes_leave_nothing();
|
||||
check_store_qualifies_the_stores();
|
||||
|
||||
Reference in New Issue
Block a user