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
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:
@@ -43,8 +43,11 @@ inline constexpr std::uint32_t cellular_lives_reproduction_rules = 7;
|
||||
// carries the new state, so they keep owner format 6.
|
||||
inline constexpr std::uint32_t cellular_lives_foraging_rules = 8;
|
||||
// ADR-0144: opt-in boundary accounting and retained nonresident history. Biology
|
||||
// remains rules 8; every earlier envelope retains its original meaning.
|
||||
// starts on rules 8; every earlier envelope retains its original meaning.
|
||||
inline constexpr std::uint32_t cellular_lives_migration_format = 7;
|
||||
// ADR-0157: opt-in funded maturation, using the unchanged format-7 fields.
|
||||
inline constexpr std::uint32_t cellular_lives_maturation_rules = 9;
|
||||
inline constexpr std::uint32_t cellular_growth_per_tick = 5; // Per 50 ms; trial rate.
|
||||
// The founder a region of these rules creates.
|
||||
[[nodiscard]] constexpr biology::FounderVersion
|
||||
cellular_founder_version(std::uint32_t rules) noexcept {
|
||||
@@ -158,10 +161,17 @@ struct CellularBudExecution {
|
||||
CellularBudResult result{};
|
||||
auto operator<=>(const CellularBudExecution&) const = default;
|
||||
};
|
||||
struct CellularGrowthExecution {
|
||||
std::uint64_t life_id{};
|
||||
biology::GrowthState before{}, after{};
|
||||
accounting::Inventory intake{}, release{};
|
||||
auto operator<=>(const CellularGrowthExecution&) const = default;
|
||||
};
|
||||
struct CellularTickExecution {
|
||||
biology::CellularRegionStepCandidate step;
|
||||
std::vector<CellularMutationExecution> mutations;
|
||||
std::vector<CellularBudExecution> buds; // Rules 4, in parent life order.
|
||||
std::vector<CellularBudExecution> buds; // Rules 4, in parent life order.
|
||||
std::vector<CellularGrowthExecution> growth; // Rules 9: funded expansions only, life order.
|
||||
};
|
||||
struct CellularLifeTickFeedback {
|
||||
std::uint64_t life_id{}, tick{};
|
||||
@@ -253,6 +263,9 @@ class CellularLives {
|
||||
// Explicit detached format-6/rules-8 -> format-7 upgrade. No biology advances.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularLives>, CellularLivesError>
|
||||
migration_upgrade_candidate() const;
|
||||
// ADR-0157: detached no-tick rules-8/format-7 -> rules-9 candidate. No grant.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularLives>, CellularLivesError>
|
||||
maturation_upgrade_candidate() const;
|
||||
// Latest successful in-memory step report; omitted from snapshots and empty after restore.
|
||||
[[nodiscard]] std::span<const CellularLifeTickFeedback> last_tick_feedback() const noexcept;
|
||||
[[nodiscard]] std::vector<std::uint8_t> snapshot() const;
|
||||
|
||||
@@ -53,6 +53,9 @@ class CellularPopulation {
|
||||
// Explicit no-tick envelope-1 -> envelope-2 upgrade, retaining all cohort tags.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularPopulation>, CellularPopulationError>
|
||||
migration_upgrade_candidate() const;
|
||||
// ADR-0157: preserve exact membership while upgrading nested biology to rules 9.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularPopulation>, CellularPopulationError>
|
||||
maturation_upgrade_candidate() const;
|
||||
[[nodiscard]] std::vector<std::uint8_t> snapshot() const;
|
||||
[[nodiscard]] static std::expected<std::unique_ptr<CellularPopulation>, CellularPopulationError>
|
||||
restore(std::span<const std::uint8_t> bytes, std::uint64_t world, std::uint64_t region,
|
||||
|
||||
Reference in New Issue
Block a user