feat: durable liquid regions (bundle 14, schema 58), cellular-v9 and session v13
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m25s
Foundation / postgres-tools (push) Successful in 1m12s
Foundation / server-image (push) Successful in 4m20s
Foundation / image (push) Successful in 4m54s

ADR-0178. Bundle 14 (rules 12 on owner format 10) is admitted by schema 58
through parser-local normalization to bundle 13, with an exact fenced 13 -> 14
upgrade whose only input, the liquid rules, recovery reads from the target.
Schema 58 also widens the canonical action input: byte 13 bit 0 is brake.

evo-world-clone gains the cellular-v9 opening: cellular-v8 followed by the liquid
upgrade from --tuning FILE (region size must match) and an optional
--current-seed; resumable and idempotent at bundle 14.

Session v13 adds the owner's velocity, heading and the region's current
configuration to its perception, each deposit's world velocity, and a brake on
cellular actions; older sessions keep their layouts. A rules-12 server lists every
pool and the nearest 256 moving bubbles. The client speaks v13, brakes on Space
(rebindable; older controls files take the default), draws currents as drifting
streaks and carries bubbles along their velocities between perceptions.

Tests: protocol v13 round trips and refusals, action-input brake, controls files,
and a PostgreSQL cellular-v9 provisioning test whose player is born, swims and
brakes through the live host. Full local PostgreSQL qualification, the Linux debug
suite and the Windows client suite pass. Refreshes the DEV session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-21 18:08:59 -04:00
co-authored by Claude Opus 5.5
parent 3f82795c18
commit d2f603b582
39 changed files with 1106 additions and 103 deletions
+71 -7
View File
@@ -1,5 +1,6 @@
#include "cellular_scene.hpp"
#include "controls_flow.hpp"
#include "evo/biology/cellular_currents.hpp"
#include "evo/client/application.hpp"
#include "evo/client/auth.hpp"
#include "evo/client/launcher.hpp"
@@ -486,6 +487,12 @@ int main(int argc, char** argv) try {
std::uint64_t seen_deposit_tick{};
std::vector<LivePop> live_pops;
bool scene_active = false;
// Rules 12: the region's current field, regenerated when the perceived configuration
// changes, and when the latest perception arrived (to carry bubbles between views).
std::optional<evo::network::CellularCurrentsView> flow_config;
std::optional<evo::biology::CellularFlowField> flow_field;
std::uint64_t flow_view_tick = 0;
auto flow_view_at = std::chrono::steady_clock::now();
evo::client_app::PanelActions actions;
(*app)->set_overlay([&] {
evo::client_app::PanelView view;
@@ -741,6 +748,7 @@ int main(int argc, char** argv) try {
const double width = state.logical_width, height = state.logical_height;
// 2026-10-16 microscope view: in cellular play, patches and cells are a scene the
// panels draw as granules and living cells; elsewhere organisms stay rectangles.
scene.flows.clear();
scene.patches.clear();
scene.deposits.clear();
scene.pops.clear();
@@ -773,9 +781,65 @@ int main(int argc, char** argv) try {
p.seed = (static_cast<std::uint64_t>(patch.x_um) << 32U) ^ patch.y_um;
scene.patches.push_back(p);
}
// Rules 12 (v13): the current field from the perceived configuration, drawn
// as streaks across the visible area.
if (const auto* perception = cellular_remote->cellular_perception()) {
if (perception->currents != flow_config) {
flow_config = perception->currents;
flow_field.reset();
if (const auto& c = flow_config) {
auto made = evo::biology::CellularFlowField::generate(
{c->seed, c->width_um, c->height_um, c->pitch_um, c->min_count,
c->max_count, c->min_route_width_um, c->max_route_width_um,
c->min_speed_um_per_s, c->max_speed_um_per_s});
if (made)
flow_field = std::move(*made);
}
}
if (perception->tick != flow_view_tick) {
flow_view_tick = perception->tick;
flow_view_at = std::chrono::steady_clock::now();
}
const auto low = camera->screen_to_world({0, height});
const auto high = camera->screen_to_world({width, 0});
if (flow_field && low && high) {
const double span = std::max(high->x_mm - low->x_mm, 0.001);
const double step = std::max(0.4, span / 28);
for (double y = std::floor(low->y_mm / step) * step; y <= high->y_mm;
y += step)
for (double x = std::floor(low->x_mm / step) * step; x <= high->x_mm;
x += step) {
const auto flow =
flow_field->sample(static_cast<std::int64_t>(x * 1000),
static_cast<std::int64_t>(y * 1000));
const double vx = flow.x_q10 / 1024.0, vy = flow.y_q10 / 1024.0;
const double speed = std::hypot(vx, vy);
if (speed < 5)
continue;
const auto at = camera->world_to_screen({x, y});
const auto ahead = camera->world_to_screen(
{x + vx / speed * 0.001, y + vy / speed * 0.001});
if (!at || !ahead)
continue;
const double sx = ahead->x - at->x, sy = ahead->y - at->y;
const double norm = std::max(std::hypot(sx, sy), 1e-9);
const double length = 8 + std::min(speed, 300.0) / 300 * 16;
scene.flows.push_back(
{static_cast<float>(at->x), static_cast<float>(at->y),
static_cast<float>(sx / norm * length),
static_cast<float>(sy / norm * length),
static_cast<float>(std::min(speed, 300.0) / 300),
static_cast<std::uint32_t>(x * 7919 + y * 104729)});
}
}
}
// ADR-0136 (v11): pools and bubbles, centred; a vanished bubble pops.
if (const auto* perception = cellular_remote->cellular_perception()) {
const auto now_pop = std::chrono::steady_clock::now();
// Rules 12: carry each bubble along its perceived velocity since the view
// arrived (at most 300 ms), so moving food glides between perceptions.
const double carried = std::min(
std::chrono::duration<double>(now_pop - flow_view_at).count(), 0.3);
std::map<std::uint32_t, SeenDeposit> current;
for (const auto& d : perception->deposits) {
std::array<std::uint64_t, 5> stock{};
@@ -785,13 +849,13 @@ int main(int argc, char** argv) try {
for (std::size_t c = 1; c < stock.size(); ++c)
if (stock.at(c) > stock.at(static_cast<std::size_t>(channel)))
channel = static_cast<int>(c);
const SeenDeposit seen{static_cast<double>(d.x_um) / 1000,
static_cast<double>(d.y_um) / 1000,
d.radius_um,
channel,
d.drained,
d.shape ==
evo::network::CellularDepositShape::bubble};
const SeenDeposit seen{
(static_cast<double>(d.x_um) + d.velocity_x_um_s * carried) / 1000,
(static_cast<double>(d.y_um) + d.velocity_y_um_s * carried) / 1000,
d.radius_um,
channel,
d.drained,
d.shape == evo::network::CellularDepositShape::bubble};
current[d.id] = seen;
const auto centre = camera->world_to_screen({seen.x_mm, seen.y_mm});
const auto edge = camera->world_to_screen(
+14 -1
View File
@@ -89,7 +89,7 @@ std::string controls_hint(const client::Bindings& b) {
return "Click selects, wheel zooms. Move " + k(Action::move_up) + " " + k(Action::move_left) +
" " + k(Action::move_down) + " " + k(Action::move_right) + "; pan " + k(Action::pan_up) +
" " + k(Action::pan_left) + " " + k(Action::pan_down) + " " + k(Action::pan_right) +
"; UI capture " + k(Action::toggle_capture) + ".";
"; brake " + k(Action::brake) + "; UI capture " + k(Action::toggle_capture) + ".";
}
// Fixed wording only (never echoes paths or file bytes); wraps inside the launcher.
void error_text(client::LaunchError error) {
@@ -939,11 +939,24 @@ void inspect_cell(ImDrawList& list, const SceneCell& c) {
}
ImGui::EndTooltip();
}
// Rules 12: currents as faint drifting streaks under the food, so the flow is readable before
// a cell commits to it. Specks are thin lines, never discs, so they never read as food.
void draw_flows(ImDrawList& list, const std::vector<SceneFlow>& flows, float time) {
for (const auto& f : flows) {
const float phase = std::fmod(time * 0.5F + static_cast<float>(f.seed % 97U) / 97.0F, 1.0F);
const float fade = std::sin(phase * 3.14159265F);
const auto alpha = static_cast<unsigned>((24.0F + 80.0F * f.strength) * fade);
const ImVec2 from{f.x + f.dx * (phase - 0.5F), f.y + f.dy * (phase - 0.5F)};
const ImVec2 to{from.x + f.dx * 0.6F, from.y + f.dy * 0.6F};
list.AddLine(from, to, IM_COL32(140, 200, 235, alpha), 1.4F);
}
}
void draw_scene(const PanelView& v) {
if (!v.cellular_scene)
return;
auto& list = *ImGui::GetBackgroundDrawList();
const auto time = static_cast<float>(ImGui::GetTime());
draw_flows(list, v.cellular_scene->flows, time);
for (const auto& patch : v.cellular_scene->patches)
draw_patch(list, patch);
for (const auto& deposit : v.cellular_scene->deposits)
+6
View File
@@ -56,7 +56,13 @@ struct ScenePop {
float x{}, y{}, radius{}, age{}; // Age 0..1 over the pop's life.
int channel{};
};
// Rules 12: one streak of the local current; dx/dy in pixels, strength 0..1 by speed.
struct SceneFlow {
float x{}, y{}, dx{}, dy{}, strength{};
std::uint32_t seed{};
};
struct CellularScene {
std::vector<SceneFlow> flows;
std::vector<ScenePatch> patches;
std::vector<SceneDeposit> deposits;
std::vector<ScenePop> pops;
+5 -5
View File
@@ -501,8 +501,8 @@ class RemoteSession {
return false;
client::RegionSessionClientConfig config;
if (cellular_trial_)
// ADR-0176: v12 is v11 (deposits) plus captured light and visible producers.
config.protocol_version = network::session_protocol_v12;
// Rules 12: v13 is v12 (deposits, light, producers) plus liquid motion and brake.
config.protocol_version = network::session_protocol_v13;
const auto route = routes_.find(target_region_);
config.transport = route != routes_.end() ? route->second : transport_;
if (ticket_) { // A handoff: the ticket replaces a grant, once.
@@ -632,9 +632,9 @@ class RemoteSession {
organisms_.current(), cellular_feed_target_);
cellular_feed_target_ = steering.patch;
const auto id = cellular_play_.allocate_id();
if (id == 0 ||
!client_->send_cellular_action(id, tick, steering.intention.move_x,
steering.intention.move_y, cellular_feed_target_))
if (id == 0 || !client_->send_cellular_action(
id, tick, steering.intention.move_x, steering.intention.move_y,
cellular_feed_target_, false, false, steering.intention.brake))
return;
sent_tick_ = server_tick_;
cellular_sent_tick_ = tick;
+60 -5
View File
@@ -27,6 +27,9 @@
#include <vector>
namespace evo::server_app {
// Rules 12: moving bubbles listed per perception, nearest first (the tuning file's trial
// food.visible_moving_bubbles). Pools are always listed.
inline constexpr std::size_t cellular_visible_moving_bubbles = 256;
// Profile-4 network boundary. Biology and persistence remain owned by the cellular host;
// this bridge handles admission, v7-v9 action receipts, public cell replication and
// owner-filtered v8/v9 perception.
@@ -257,6 +260,25 @@ class CellularBridge {
diagnostics.bud = feedback->bud ? bud_outcome(*feedback->bud)
: network::CellularBudOutcome::not_requested;
}
// Rules 12 (v13): the authoritative motion state and the region's currents, from
// which the client regenerates the identical flow field.
const auto* field = state.flow_field();
if (field) {
diagnostics.velocity_x_q10 = life.motion.velocity_x_q10;
diagnostics.velocity_y_q10 = life.motion.velocity_y_q10;
diagnostics.heading = life.motion.heading;
const auto& c = state.liquid_rules().currents;
view.currents = network::CellularCurrentsView{c.seed,
c.width_um,
c.height_um,
c.pitch_um,
c.min_count,
c.max_count,
c.min_route_width_um,
c.max_route_width_um,
c.min_speed_um_per_s,
c.max_speed_um_per_s};
}
view.diagnostics = diagnostics;
view.patches.reserve(perceived->size());
// ADR-0136 (rules 8): pools and bubbles go out as v11 deposits, the nearest 512 to
@@ -284,16 +306,49 @@ class CellularBridge {
const auto before = deposit_stock_.find(patch.id);
deposit.drained = before != deposit_stock_.end() &&
(patch.available.energy.value < before->second.energy.value ||
std::ranges::any_of(std::array{0, 1, 2, 3}, [&](int c) {
const auto i = static_cast<std::size_t>(c);
return patch.available.matter.at(i).value <
before->second.matter.at(i).value;
}));
std::ranges::any_of(
std::array{0, 1, 2, 3},
[&](int c) {
const auto i = static_cast<std::size_t>(c);
return patch.available.matter.at(i).value <
before->second.matter.at(i).value;
}));
seen_stock_[patch.id] = patch.available;
// Rules 12 (v13): a bubble's world velocity, current plus induced drift, so the
// client can carry it between perceptions.
if (field && patch.kind == biology::CellularDepositKind::mote) {
const auto flow = field->sample(patch.address.x_um, patch.address.y_um);
std::int64_t drift_x{}, drift_y{};
if (const auto index = state.habitat().find(patch.address)) {
drift_x = state.habitat().patches()[*index].drift_x_q10;
drift_y = state.habitat().patches()[*index].drift_y_q10;
}
const auto um_s = [](std::int64_t q10) {
return static_cast<std::int16_t>(std::clamp<std::int64_t>(
q10 / biology::cellular_velocity_q10_per_um_s, -32'767, 32'767));
};
deposit.velocity_x_um_s = um_s(flow.x_q10 + drift_x);
deposit.velocity_y_um_s = um_s(flow.y_q10 + drift_y);
}
const auto dx = std::int64_t{patch.address.x_um} - centre_x;
const auto dy = std::int64_t{patch.address.y_um} - centre_y;
near.emplace_back(static_cast<std::uint64_t>(dx * dx + dy * dy), deposit);
}
// Rules 12: every pool, but only the nearest moving bubbles (the tuning file's
// trial 256); the client carries the rest with the current.
if (field) {
const auto bubbles = std::ranges::partition(near, [](const auto& entry) {
return entry.second.shape == network::CellularDepositShape::pool;
});
const auto keep = std::min<std::size_t>(cellular_visible_moving_bubbles,
static_cast<std::size_t>(bubbles.size()));
std::ranges::nth_element(
bubbles, bubbles.begin() + static_cast<std::ptrdiff_t>(keep),
[](const auto& a, const auto& b) {
return std::pair{a.first, a.second.id} < std::pair{b.first, b.second.id};
});
near.erase(bubbles.begin() + static_cast<std::ptrdiff_t>(keep), near.end());
}
if (near.size() > network::max_cellular_perceived_deposits) {
std::ranges::nth_element(
near,
+87 -22
View File
@@ -10,7 +10,7 @@
// evo-world-clone check-store --world W --region R --pg-* ... --objects DIR
// [--reserve-mib N]
// evo-world-clone provision --world W --region R --opening
// development-v1|primitive-v1|cellular-v1 to cellular-v8
// development-v1|primitive-v1|cellular-v1 to cellular-v9
// --pg-* ... --objects DIR --build HEX [--commit HEX32] [--retain-build]
// primitive-v1 also requires --frame N --source-id N, every --funding-*-* channel,
// and one or more ordered --site X,Y values.
@@ -25,6 +25,10 @@
// --patch: one or more --pool X,Y,RADIUS,SOURCE,ENERGY,C,N,P,O (centres, any micrometre)
// and/or --motes COUNT,SOURCE,ENERGY,C,N,P,O (bubbles per channel amount, scattered
// from the --commit bytes, so a genesis is reproducible).
// cellular-v8 (ADR-0176) also requires --light-pj N. cellular-v9 (rules 12, ADR-0177)
// is cellular-v8 followed by the liquid upgrade: it also requires --tuning FILE (the Git
// tuning file, whose region size must match --width-um/--height-um) and accepts
// --current-seed N (default: derived from the --commit bytes).
// primitive-v1 and cellular-v1/v2/v3 accept --life-allocator-start N
// (ADR-0123): the world's life-identity allocator is created once at the operator-audited
// start N; a later run leaves it untouched and refuses one that is below N.
@@ -84,6 +88,8 @@
#include <csignal>
#include <cstdio>
#include <filesystem>
#include <fstream>
#include <iterator>
#include <limits>
#include <optional>
#include <span>
@@ -118,13 +124,20 @@ struct Options {
std::vector<biology::CellularPatch> cellular_patches;
std::vector<biology::CellularPatch> cellular_pools; // cellular-v7
std::optional<biology::CellularMoteField> cellular_motes; // cellular-v7 and v8
std::optional<std::uint64_t> light_pj; // cellular-v8: pJ per square um per tick
std::optional<std::uint64_t> light_pj; // cellular-v8/v9: pJ per square um per tick
std::optional<std::string> tuning_path; // cellular-v9: the Git tuning file
std::optional<std::uint64_t> current_seed;
std::optional<biology::CellularTuning> tuning; // Parsed from tuning_path.
std::optional<std::uint64_t> life_allocator_start;
std::optional<persistence::Sha256Digest> build;
bool retain_build{};
bool crash{};
};
// The openings that declare light: cellular-v8, and cellular-v9 which adds the liquid upgrade.
bool lit_opening(std::string_view opening) {
return opening == "cellular-v8" || opening == "cellular-v9";
}
std::optional<std::uint64_t> number(std::string_view text) {
std::uint64_t value{};
const auto [end, error] = std::from_chars(text.data(), text.data() + text.size(), value);
@@ -336,10 +349,14 @@ std::optional<Options> parse(int argc, char** argv) {
(value == "development-v1" || value == "primitive-v1" || value == "cellular-v1" ||
value == "cellular-v2" || value == "cellular-v3" || value == "cellular-v4" ||
value == "cellular-v5" || value == "cellular-v6" || value == "cellular-v7" ||
value == "cellular-v8"))
value == "cellular-v8" || value == "cellular-v9"))
o.opening = value;
else if (o.command == "provision" && flag == "--light-pj" && n && *n > 0)
o.light_pj = n;
else if (o.command == "provision" && flag == "--tuning" && !value.empty())
o.tuning_path = std::string{value};
else if (o.command == "provision" && flag == "--current-seed" && n)
o.current_seed = n;
else if (o.command == "provision" && flag == "--frame" && n)
o.primitive_frame = n;
else if (o.command == "provision" && flag == "--source-id" && n)
@@ -423,11 +440,36 @@ std::optional<Options> parse(int argc, char** argv) {
return std::nullopt;
if (cellular_options)
return std::nullopt;
} else if (o.opening == "cellular-v7" || o.opening == "cellular-v8") {
} else if (o.opening == "cellular-v7" || lit_opening(o.opening)) {
// Pools and bubbles only: square patches belong to the earlier openings. Only
// cellular-v8 (ADR-0176) declares light.
if ((o.opening == "cellular-v8") != o.light_pj.has_value())
// cellular-v8 and v9 (ADR-0176) declare light; only v9 takes a tuning file.
if (lit_opening(o.opening) != o.light_pj.has_value() ||
(o.opening == "cellular-v9") != o.tuning_path.has_value() ||
(o.current_seed && o.opening != "cellular-v9"))
return std::nullopt;
if (o.tuning_path) {
std::ifstream file(*o.tuning_path, std::ios::binary);
const std::string text{std::istreambuf_iterator<char>(file),
std::istreambuf_iterator<char>()};
auto parsed = biology::parse_cellular_tuning(text);
if (!file.good() && !file.eof()) {
std::printf("tuning file unreadable: %s\n", o.tuning_path->c_str());
return std::nullopt;
}
if (!parsed) {
std::printf("tuning file refused at line %zu (%s): %s\n", parsed.error().line,
parsed.error().key.c_str(),
std::string{biology::describe(parsed.error().kind)}.c_str());
return std::nullopt;
}
if (!o.cellular_width_um || !o.cellular_height_um ||
parsed->region_width_um != *o.cellular_width_um ||
parsed->region_height_um != *o.cellular_height_um) {
std::puts("tuning region size differs from --width-um/--height-um");
return std::nullopt;
}
o.tuning = *parsed;
}
if (!o.primitive_frame || *o.primitive_frame == 0 || !o.primitive_source ||
*o.primitive_source == 0 || o.primitive_sites.empty() ||
!std::ranges::all_of(o.primitive_funding,
@@ -548,21 +590,39 @@ std::vector<std::uint8_t> probe_bytes() {
return out;
}
// cellular-v9 (rules 12): the liquid rules from the tuning file, for the opening's area and
// a current seed (given, or derived from the genesis commit's bytes 8-15).
std::optional<server::CellularLiquidRules> liquid_rules(const Options& o) {
if (o.opening != "cellular-v9" || !o.tuning || !o.cellular_width_um || !o.cellular_height_um)
return std::nullopt;
std::uint64_t seed = o.current_seed.value_or(0);
if (!o.current_seed) {
const auto commit = o.commit.value_or(persistence::Uuid{});
for (std::size_t i = 8; i < 16; ++i)
seed = (seed << 8U) | commit.at(i);
}
return server::cellular_liquid_rules(*o.tuning, {*o.cellular_width_um, *o.cellular_height_um},
seed);
}
// ADR-0176 cellular-v8: a cellular-v7 genesis taken through one empty tick and the durable
// bundle 9 -> 10 -> 11 -> 12 -> 13 upgrades, declaring the region's light. Resumable: it
// continues from whichever bundle the head has reached, and does nothing at bundle 13.
// bundle 9 -> 10 -> 11 -> 12 -> 13 upgrades, declaring the region's light. cellular-v9 adds the
// 13 -> 14 liquid upgrade. Resumable: it continues from whichever bundle the head has reached,
// and does nothing at its target bundle.
int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
const persistence::FilesystemObjectStore& store,
std::uint64_t frame, const persistence::Sha256Digest& build,
std::uint64_t light_pj) {
std::uint64_t light_pj,
const std::optional<server::CellularLiquidRules>& liquid) {
const auto& key = o.source.key;
const auto target =
liquid ? persistence::cellular_v14_versions : persistence::cellular_v13_versions;
// A finished opening needs no lease: a rerun (every Argo sync's provision hook) runs
// while the region server holds it, and must report the region rather than fail.
if (const auto current = persistence::load_region_checkpoint(db, key, timeout); current) {
const auto manifest = persistence::decode_manifest(current->manifest);
if (manifest && manifest->profile == persistence::CheckpointProfile::cellular_lives_v1 &&
manifest->frame == frame &&
manifest->cellular_versions == persistence::cellular_v13_versions)
manifest->frame == frame && manifest->cellular_versions == target)
return 0;
}
auto lease =
@@ -580,13 +640,13 @@ int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
auto head = persistence::load_region_checkpoint(db, key, timeout);
if (!head)
return finish(3);
for (unsigned step = 0; step < 6; ++step) {
for (unsigned step = 0; step < 7; ++step) {
const auto manifest = persistence::decode_manifest(head->manifest);
if (!manifest || manifest->profile != persistence::CheckpointProfile::cellular_lives_v1 ||
manifest->frame != frame)
return finish(4);
const auto& versions = manifest->cellular_versions;
if (versions == persistence::cellular_v13_versions)
if (versions == target)
return finish(0);
const auto id = [&] {
persistence::Uuid made{};
@@ -637,6 +697,9 @@ int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
upgraded = persistence::migrate_cellular_photosynthesis_profile(
db, store, *lease, *head, id, build,
{light_pj, 1, {std::numeric_limits<std::uint64_t>::max() / 2}}, timeout);
else if (versions == persistence::cellular_v13_versions && liquid)
upgraded = persistence::migrate_cellular_liquid_profile(db, store, *lease, *head, id,
build, *liquid, timeout);
else
return finish(4);
if (!upgraded) {
@@ -654,7 +717,7 @@ int provision(const Options& o) {
const bool cellular = o.opening == "cellular-v1" || o.opening == "cellular-v2" ||
o.opening == "cellular-v3" || o.opening == "cellular-v4" ||
o.opening == "cellular-v5" || o.opening == "cellular-v6" ||
o.opening == "cellular-v7" || o.opening == "cellular-v8";
o.opening == "cellular-v7" || lit_opening(o.opening);
const auto primitive_frame = o.primitive_frame.value_or(0);
if ((primitive || cellular) && primitive_frame == 0)
return 2;
@@ -749,7 +812,7 @@ int provision(const Options& o) {
habitat_config.width_um = cellular_width_um;
habitat_config.height_um = cellular_height_um;
habitat_config.patches = o.cellular_patches;
if (o.opening == "cellular-v7" || o.opening == "cellular-v8") {
if (o.opening == "cellular-v7" || lit_opening(o.opening)) {
// ADR-0136 step A: pools and bubbles scattered from the genesis commit's bytes.
auto field = o.cellular_motes.value_or(biology::CellularMoteField{0, 1, {}, 0});
const auto commit = o.commit.value_or(persistence::Uuid{});
@@ -771,7 +834,7 @@ int provision(const Options& o) {
auto opening = server::CellularLives::create(
*primitive_opening, std::move(*habitat),
{{cellular_width_um, cellular_height_um}, 0, cellular_temperature_mk},
o.opening == "cellular-v7" || o.opening == "cellular-v8"
o.opening == "cellular-v7" || lit_opening(o.opening)
? server::CellularLivesProfile::foraging
: o.opening == "cellular-v6" ? server::CellularLivesProfile::reproduction
: o.opening == "cellular-v5" ? server::CellularLivesProfile::balance
@@ -815,7 +878,7 @@ int provision(const Options& o) {
std::puts("provision refused existing profile/frame mismatch");
return 4;
}
if (o.opening == "cellular-v8") {
if (lit_opening(o.opening)) {
if (manifest->sequence == 0 &&
!persistence::provision_cellular_region(*db, *store, o.source.key,
primitive_frame, *cellular_opening,
@@ -824,8 +887,9 @@ int provision(const Options& o) {
"--commit to resolve genesis");
return 4;
}
if (const auto finished = finish_photosynthesis_opening(
o, *db, *store, primitive_frame, build, o.light_pj.value_or(0));
if (const auto finished =
finish_photosynthesis_opening(o, *db, *store, primitive_frame, build,
o.light_pj.value_or(0), liquid_rules(o));
finished != 0)
return finished;
auto head = persistence::load_region_checkpoint(*db, o.source.key, timeout);
@@ -877,9 +941,10 @@ int provision(const Options& o) {
static_cast<unsigned>(made.error().kind));
return 4;
}
if (o.opening == "cellular-v8") {
if (const auto finished = finish_photosynthesis_opening(o, *db, *store, primitive_frame,
build, o.light_pj.value_or(0));
if (lit_opening(o.opening)) {
if (const auto finished =
finish_photosynthesis_opening(o, *db, *store, primitive_frame, build,
o.light_pj.value_or(0), liquid_rules(o));
finished != 0)
return finished;
auto head = persistence::load_region_checkpoint(*db, o.source.key, timeout);