feat(lifecycle): add opt-in funded cellular maturation
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (network) (push) Successful in 21m0s
Foundation / checks (client) (push) Successful in 22m13s
Foundation / checks (tsan) (push) Successful in 26m35s
Foundation / checks (postgres) (push) Successful in 1h1m27s
Foundation / checks (checks) (push) Successful in 1h14m29s
Foundation / postgres-tools (push) Successful in 1m19s
Foundation / server-image (push) Successful in 3m46s
Foundation / image (push) Successful in 4m57s

This commit is contained in:
dingo
2026-10-18 21:48:27 -04:00
parent 27ec5729bf
commit a5307c768b
22 changed files with 889 additions and 19 deletions
+16 -1
View File
@@ -14,7 +14,10 @@ CellularPopulation::CellularPopulation(std::unique_ptr<CellularLives> state,
std::expected<std::unique_ptr<CellularPopulation>, CellularPopulationError>
CellularPopulation::create(std::unique_ptr<CellularLives> state, CellularTierPolicy policy) {
if (!state || state->rules_version() != cellular_lives_foraging_rules ||
if (!state ||
(state->rules_version() != cellular_lives_foraging_rules &&
!(state->rules_version() == cellular_lives_maturation_rules &&
state->format_version() == cellular_lives_migration_format)) ||
(state->format_version() != cellular_lives_presence_format &&
state->format_version() != cellular_lives_migration_format) ||
policy.materialize_radius_um == 0 ||
@@ -53,6 +56,18 @@ CellularPopulation::migration_upgrade_candidate() const {
(*candidate)->conversion_sequence_ = conversion_sequence_;
return candidate;
}
std::expected<std::unique_ptr<CellularPopulation>, CellularPopulationError>
CellularPopulation::maturation_upgrade_candidate() const {
auto biological = state_->maturation_upgrade_candidate();
if (!biological)
return std::unexpected(CellularPopulationError::unsupported);
auto candidate = create(std::move(*biological), policy_);
if (!candidate)
return std::unexpected(candidate.error());
(*candidate)->members_ = members_;
(*candidate)->conversion_sequence_ = conversion_sequence_;
return candidate;
}
std::expected<std::size_t, CellularPopulationError>
CellularPopulation::collapse(std::uint64_t genome) {
auto candidate = members_;