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
+4 -2
View File
@@ -117,7 +117,8 @@ metabolic_rules_for(std::uint32_t development_version) {
}
std::expected<MetabolicBudget, DevelopmentError>
metabolic_budget(const Genome& genome, GrowthState growth, EnvironmentState environment) {
metabolic_budget(const Genome& genome, GrowthState growth, EnvironmentState environment,
std::uint32_t max_growth_per_thousand) {
const auto phenotype = derive_phenotype(genome, growth, environment);
if (!phenotype) {
return std::unexpected{phenotype.error()};
@@ -164,7 +165,8 @@ metabolic_budget(const Genome& genome, GrowthState growth, EnvironmentState envi
// intake fits channel by channel.
budget.construction.after = growth;
const auto proposed = plan->after.realized_per_thousand - growth.realized_per_thousand;
for (std::uint32_t attempt = proposed; attempt > 0; --attempt) {
for (std::uint32_t attempt = std::min(proposed, max_growth_per_thousand); attempt > 0;
--attempt) {
const GrowthState candidate{growth.realized_per_thousand + attempt,
growth.damage_per_thousand};
const auto grown = derive_phenotype(genome, candidate, environment);