feat(lifecycle): rules 13 mutation splits, stay-or-become and litter
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m22s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m21s
Foundation / image (push) Successful in 5m6s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m22s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m21s
Foundation / image (push) Successful in 5m6s
Phase 4 of the cellular revamp build plan (ADR-0179), server half. - A chosen mutation now splits the cell (Cellular_reproduction_plan.md section 4): split_cell divides body and reserve per channel by the tuned share, each cell develops the largest body its own genome builds from its part, and the rest joins its reserve, conserving every channel. Both plans carry the mutation; only the offspring expresses it. A split is refused, spending nothing and keeping the offer, below the tuned growth, without room beside the cell or at the region's organism cap. - Stay or become: a choice (trace mutation byte 34) or a bud (step intent bit 2 of byte 13) can hand control to the offspring; the parent becomes wildlife. Ownership now follows the account under rules 13, so validation and plan history accept a founder that became wildlife (ADR-0163 succession). - Buds under rules 13: litter replaces the 25% twin (whole hundreds plus a chance, up to the tuned maximum, sharing one investment), the tuned bud fee is charged once and reclaimed, and births stop at the organism cap. - New results split_applied and split_refused; owners below rules 13 refuse a become. The revamp tuning file gains the reproduction keys. Tests cover the split's conservation and refusals, stay and become splits with exact restore, a refused second split, the cap, become validation and the litter count. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,22 @@ fund_offspring(const Genome& parent, const Genome& offspring, GrowthState parent
|
||||
[[nodiscard]] std::optional<accounting::Inventory>
|
||||
offspring_cost(const Genome& parent, const Genome& offspring, std::uint32_t temperature_millikelvin,
|
||||
std::uint32_t share = 1);
|
||||
// Rules 13 (ADR-0179; Cellular_reproduction_plan.md section 4): a mutation split. The parent's
|
||||
// body and reserve divide per channel, the offspring taking `share_per_thousand` (rounded
|
||||
// down); each cell then develops the largest growth its own genome builds from its part of the
|
||||
// body, and matter beyond that joins its reserve. Nothing is built, burned or lost: on every
|
||||
// channel the two bodies and reserves sum to the parent's. Refused, changing nothing, when
|
||||
// the parent is below `min_growth` or damaged, or either part builds no cell at all.
|
||||
struct SplitTransition {
|
||||
GrowthState parent_growth{}, child_growth{};
|
||||
accounting::Inventory parent_body{}, parent_reserve{}, child_body{}, child_reserve{};
|
||||
auto operator<=>(const SplitTransition&) const = default;
|
||||
};
|
||||
[[nodiscard]] std::expected<SplitTransition, BuddingError>
|
||||
split_cell(const Genome& parent, const Genome& child, GrowthState growth,
|
||||
const accounting::Inventory& body, const accounting::Inventory& reserve,
|
||||
std::uint32_t temperature_millikelvin, std::uint32_t share_per_thousand,
|
||||
std::uint32_t min_growth, const BodyTuning& tuning = default_body_tuning);
|
||||
// What one bud takes from a fully grown, undamaged parent of this genome at this temperature
|
||||
// (ADR-0129 amendment): investment matter per channel, and construction energy plus the
|
||||
// bud's provision; exactly what `fund_bud` charges such a parent. Nullopt when the genome
|
||||
|
||||
Reference in New Issue
Block a user