feat(cellular): session v14, bundle 15 and rules-13 wildlife
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m29s
Foundation / postgres-tools (push) Successful in 24s
Foundation / server-image (push) Successful in 4m33s
Foundation / image (push) Successful in 4m59s

Session v14 carries the rules-13 revamp: a body block in the owner's view
(members, emergence threshold, exclusions, Emerge open, payable energy,
mass and the 20 traits), become, emerge and channel exclusions on actions,
become on mutation choices, catalog offers (id, chance, cost) and the
emerged ending. Older sessions never see a v14 field. The client shows
Stay / Become offspring offers named from the shared catalog, continuing
as a bud, the organism and its Emerge button, kept channels, the body and
the emerged end screen.

Bundle 15 (rules 13 on owner format 11) is durable: schema 60 admits it
raw-only, stores become as bit 15 of the choice's operator, widens the
action input and mutation results, and publishes the 14 -> 15 revamp
profile migration. evo-world-clone opens cellular-v10 (cellular-v9 plus the
revamp upgrade from --revamp-tuning), resumable and recoverable.

Wildlife counts reserve matter as energy, waits for the bud fee, grows
organisms one short of emerging, and hunts by the region step's rules-13
engulf test. The play summary adds organisms, offers and the spent pool.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-26 07:31:32 -04:00
co-authored by Claude Opus 5.5
parent f454e038a1
commit 4bc5d5eee7
48 changed files with 1602 additions and 174 deletions
+38 -6
View File
@@ -45,19 +45,30 @@ inline constexpr std::uint16_t session_protocol_v12 = 12;
// region's current configuration in its perception, each deposit's world velocity, and a brake
// flag on cellular actions.
inline constexpr std::uint16_t session_protocol_v13 = 13;
// v10 to v13 share every cellular message but the perception's contents and v13's brake.
// v14 (rules 13, ADR-0179) is v13 plus the cellular revamp: the body block in the perception,
// become, emerge and channel exclusions on actions, become on mutation choices, catalog offers
// and the emerged ending.
inline constexpr std::uint16_t session_protocol_v14 = 14;
// v10 to v14 share every cellular message but the perception's contents, v13's brake and v14's
// revamp fields.
[[nodiscard]] constexpr bool cellular_v10_family(std::uint16_t version) noexcept {
return version == session_protocol_v10 || version == session_protocol_v11 ||
version == session_protocol_v12 || version == session_protocol_v13;
version == session_protocol_v12 || version == session_protocol_v13 ||
version == session_protocol_v14;
}
// Versions whose perception lists pools and bubbles (ADR-0136) instead of square patches.
[[nodiscard]] constexpr bool cellular_deposit_version(std::uint16_t version) noexcept {
return version == session_protocol_v11 || version == session_protocol_v12 ||
version == session_protocol_v13;
version == session_protocol_v13 || version == session_protocol_v14;
}
// Versions that carry captured light and producers (ADR-0176).
[[nodiscard]] constexpr bool cellular_light_version(std::uint16_t version) noexcept {
return version == session_protocol_v12 || version == session_protocol_v13;
return version == session_protocol_v12 || version == session_protocol_v13 ||
version == session_protocol_v14;
}
// Versions that carry liquid motion (rules 12).
[[nodiscard]] constexpr bool cellular_liquid_version(std::uint16_t version) noexcept {
return version == session_protocol_v13 || version == session_protocol_v14;
}
// The highest capability a version's mutation offers may name.
[[nodiscard]] constexpr std::uint8_t
@@ -208,6 +219,10 @@ struct CellularActionInput {
bool engulf{};
bool bud{}; // Kind 3 (ADR-0125): fund one wildlife bud, zero coordinates, v10 only.
bool brake{}; // Byte 13 bit 0 (schema 58, rules 12): oppose relative velocity.
// Schema 60 (rules 13): byte 13 bit 1 become the bud, bit 2 emerge; byte 14 the channels
// excluded from burning (bits 0-3: C, N, P, other).
bool become{}, emerge{};
std::uint8_t exclude{};
friend bool operator==(const CellularActionInput&, const CellularActionInput&) = default;
};
inline constexpr std::size_t cellular_action_input_bytes = 24;
@@ -224,6 +239,10 @@ struct CellularAction {
bool bud{};
// v13 (rules 12): brake against relative velocity instead of following the movement.
bool brake{};
// v14 (rules 13): with `bud`, continue as the bud; leave the region as an organism at the
// threshold (no target); matter channels excluded from burning (bits 0-3).
bool become{}, emerge{};
std::uint8_t exclude{};
friend bool operator==(const CellularAction&, const CellularAction&) = default;
};
// v10 reliable choice. The server binds these values to the authenticated account and
@@ -232,12 +251,16 @@ struct CellularMutationAction {
std::uint64_t session{}, epoch{}, action_id{}, tick{};
std::uint64_t life_identity{}, event_index{}, offer_tick{};
std::uint16_t operator_id{};
bool become{}; // v14: continue as the offspring the choice splits off.
friend bool operator==(const CellularMutationAction&, const CellularMutationAction&) = default;
};
// v10 server-to-owner offer (ADR-0121, 11.4d): the life's outstanding earned offer, its
// candidates in stable operator order (never ranked). Each candidate states the successor's
// actual tradeoffs: its capability value and its maintenance and total mass. No candidates
// (and zero event/offer) clears a consumed or absent offer.
// v14 (rules 13) keeps the layout for a named catalog mutation: `operator_id` is its catalog
// id, `parameter` its chance of appearing in parts per million, capability, effect,
// maintenance and mass zero, and the cost its tuned cost. The client names it from the catalog.
struct CellularOfferedCandidate {
std::uint16_t operator_id{};
std::uint8_t capability{}, effect{}; // biology::Capability, biology::MutationEffect.
@@ -257,8 +280,9 @@ struct CellularMutationOffer {
friend bool operator==(const CellularMutationOffer&, const CellularMutationOffer&) = default;
};
// v10 (ADR-0129): the owner's life ended in `tick`. Cause 1 starved, 2 engulfed, 0 not
// recorded (rules below 3). Death is final; a new life is a new request.
enum class CellularDeathReason : std::uint8_t { unrecorded, starved, engulfed };
// recorded (rules below 3); v14 adds 3, the organism emerged. Death is final; a new life is a
// new request.
enum class CellularDeathReason : std::uint8_t { unrecorded, starved, engulfed, emerged };
struct CellularLifeEnded {
std::uint64_t tick{}, life_identity{};
CellularDeathReason cause{};
@@ -357,6 +381,14 @@ struct CellularLifeDiagnostics {
// turn), the authoritative motion state the client predictor reconciles against.
std::int32_t velocity_x_q10{}, velocity_y_q10{};
std::uint16_t heading{};
// v14 only (rules 13): cells in the organism and the emergence threshold, the exclusions
// in effect, whether Emerge is open, what the reserve can pay as energy with matter standing
// in, total mass, and the heritable body traits (biology::CellularTraits field order).
std::uint16_t members{}, emerge_members{};
std::uint8_t exclude{};
bool can_emerge{};
std::uint64_t payable_energy_pj{}, total_mass_fg{};
std::array<std::uint16_t, 20> traits{};
friend bool operator==(const CellularLifeDiagnostics&,
const CellularLifeDiagnostics&) = default;
};