feat(lifecycle): rules 13 owner on format 11 with the revamp tuning file
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (checks) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 3s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m30s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m12s
Foundation / image (push) Successful in 4m40s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (checks) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 3s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m30s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m12s
Foundation / image (push) Successful in 4m40s
Phase 1 of the cellular revamp build plan (ADR-0179). The cellular owner gains rules 13 on owner format 11: an explicit no-tick format-10/rules-12 upgrade declares the region's revamp rules (so far the body's essential upkeep share), existing lives keep their genomes, and founders born afterwards are founder 6 (genome schema 7, development 7). Format 11 is format 10 plus the revamp rules block; it stays undeployed while later phases extend it. The tick, perception and wildlife controller derive budgets with the declared body tuning, which earlier development versions ignore. Revamp tunables live in their own Git file, deploy/kubernetes/region/dev/tuning/cellular-revamp.tuning, parsed by parse_cellular_revamp_tuning with the same format and refusals as the rules-12 file, so images from before rules 13 never meet keys they do not know. Both parsers now share read_tuning_lines; the rules-12 file's behaviour is unchanged. The revamp file is not yet mounted into the region (build plan, phase 6). Tests cover the upgrade and its refusals, mixed founder 5 and founder 6 lives ticking with closure, exact restore and continuation, trace replay, and the new tuning file including the checked-in DEV copy. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include "evo/biology/mutation.hpp"
|
||||
#include "evo/server/lifecycle/cellular_light.hpp"
|
||||
#include "evo/server/lifecycle/cellular_liquid.hpp"
|
||||
#include "evo/server/lifecycle/cellular_revamp.hpp"
|
||||
#include "evo/server/lifecycle/primitive_lives.hpp"
|
||||
|
||||
#include <compare>
|
||||
@@ -61,16 +62,23 @@ inline constexpr std::uint32_t cellular_lives_photosynthesis_rules = 11;
|
||||
// liquid rules and each life's motion state, on a format-3 habitat whose food moves.
|
||||
inline constexpr std::uint32_t cellular_lives_liquid_format = 10;
|
||||
inline constexpr std::uint32_t cellular_lives_liquid_rules = 12;
|
||||
// Rules that retain offspring plans (formats 8 to 10): 10 to 12.
|
||||
// Rules 13 (ADR-0179, Cellular_Revamp_Build_Plan.md): rules 12 with founder 6 (genome schema 7,
|
||||
// development 7) and the region's declared revamp rules. Format 11 is format 10 with those
|
||||
// rules; later build phases extend it before it is first deployed.
|
||||
inline constexpr std::uint32_t cellular_lives_revamp_format = 11;
|
||||
inline constexpr std::uint32_t cellular_lives_revamp_rules = 13;
|
||||
// Rules that retain offspring plans (formats 8 to 11): 10 to 13.
|
||||
[[nodiscard]] constexpr bool cellular_retained_plans(std::uint32_t rules) noexcept {
|
||||
return rules == cellular_lives_inheritance_rules ||
|
||||
rules == cellular_lives_photosynthesis_rules || rules == cellular_lives_liquid_rules;
|
||||
rules == cellular_lives_photosynthesis_rules || rules == cellular_lives_liquid_rules ||
|
||||
rules == cellular_lives_revamp_rules;
|
||||
}
|
||||
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 {
|
||||
return rules >= cellular_lives_liquid_rules ? biology::primitive_founder_v5
|
||||
return rules >= cellular_lives_revamp_rules ? biology::primitive_founder_v6
|
||||
: rules >= cellular_lives_liquid_rules ? biology::primitive_founder_v5
|
||||
: rules >= cellular_lives_photosynthesis_rules ? biology::primitive_founder_v4
|
||||
: rules >= cellular_lives_reproduction_rules ? biology::primitive_founder_v3
|
||||
: rules >= cellular_lives_balance_rules ? biology::primitive_founder_v2
|
||||
@@ -313,6 +321,13 @@ class CellularLives {
|
||||
// bubble) and lives start at rest. Founders born afterwards are founder 5.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularLives>, CellularLivesError>
|
||||
liquid_upgrade_candidate(const CellularLiquidRules& rules) const;
|
||||
// Rules 13: explicit no-tick format-10/rules-12 -> format-11/rules-13 upgrade declaring the
|
||||
// region's revamp rules. Existing lives keep their genomes; founders born afterwards are
|
||||
// founder 6.
|
||||
[[nodiscard]] std::expected<std::unique_ptr<CellularLives>, CellularLivesError>
|
||||
revamp_upgrade_candidate(const CellularRevampRules& rules) const;
|
||||
// Format 11: the declared revamp rules (defaults before).
|
||||
[[nodiscard]] const CellularRevampRules& revamp_rules() const noexcept;
|
||||
// Format 10: the declared liquid rules and the current field they generate (null before).
|
||||
[[nodiscard]] const CellularLiquidRules& liquid_rules() const noexcept;
|
||||
[[nodiscard]] const biology::CellularFlowField* flow_field() const noexcept;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "evo/biology/cellular_revamp_tuning.hpp"
|
||||
#include "evo/biology/development.hpp"
|
||||
|
||||
#include <compare>
|
||||
|
||||
// Rules 13 (ADR-0179, Cellular_Revamp_Build_Plan.md): what a cellular owner declares when it
|
||||
// upgrades to owner format 11. Taken from the Git tuning file when the region opens and
|
||||
// persisted with the owner, so replay and restore never read the file. Later build phases add
|
||||
// the feeding, mutation and reproduction tunables here.
|
||||
namespace evo::server {
|
||||
struct CellularRevampRules {
|
||||
biology::BodyTuning body{};
|
||||
auto operator<=>(const CellularRevampRules&) const = default;
|
||||
};
|
||||
|
||||
[[nodiscard]] bool cellular_revamp_valid(const CellularRevampRules& rules) noexcept;
|
||||
// Rules from the revamp tuning file.
|
||||
[[nodiscard]] CellularRevampRules
|
||||
cellular_revamp_rules(const biology::CellularRevampTuning& tuning);
|
||||
} // namespace evo::server
|
||||
Reference in New Issue
Block a user