Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m27s
Foundation / postgres-tools (push) Successful in 33s
Foundation / server-image (push) Successful in 4m14s
Foundation / image (push) Successful in 4m41s
Phase 1 of the cellular revamp build plan (ADR-0179). Genome schema 7 carries twenty 16-bit cellular traits after the movement arrangement: density, upkeep efficiency, growth speed, collection per channel (E/C/N/P/O), burn efficiency per matter channel, engulf capacity, kill absorption, litter, the body recipe (C/N/P/O per thousand, summing to 1000) and adhesion. Its membrane is held in nanometres so it can change in 5% steps of the founder's 1 um. The largest record still fits the 256-byte bound. Development 7 and founder 6 serve rules 13: density sets how large a body is for its mass, the recipe sets the body's composition (intake keeps the founder shares), upkeep is an essential share no trait reduces plus the rest over upkeep efficiency (region-declared BodyTuning, trial 25%), the producer speed penalty is dropped, and the reproduction value is the bud's share of the body with the construction discount fixed at the founder's level. Founder 6 builds exactly founder 5's cell. Earlier schemas and development versions are unchanged. The development and metabolism test mains now print the failing line. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
70 lines
3.9 KiB
C++
70 lines
3.9 KiB
C++
#pragma once
|
|
|
|
#include "evo/biology/metabolism.hpp"
|
|
|
|
#include <cstdint>
|
|
#include <expected>
|
|
|
|
// The primitive founder (ADR-0098): every new life starts from this same genome, so no
|
|
// account carries a biological advantage into a new life. Genome schema 2 and development
|
|
// version 2 (rates per second, ADR-0099). Its parameters are tunable playtest values, not
|
|
// locked rules: with development version 2 a full-grown founder funds its first bud in
|
|
// about 5 minutes feeding all of the time, 10 minutes feeding half of it and 15 minutes
|
|
// feeding a third of it, while moving at full speed throughout (ADR-0098 decision 7).
|
|
namespace evo::biology {
|
|
// Per-second rates and sizes of the founder, reviewable as a unit.
|
|
struct FounderParameters {
|
|
std::uint32_t energy_conversion; // per thousand
|
|
std::uint32_t membrane; // micrometres
|
|
std::uint32_t target_size; // femtograms
|
|
std::uint32_t movement; // micrometres per second
|
|
std::uint32_t ingestion; // femtograms per second at the reference surface
|
|
std::uint32_t reproduction; // per thousand of the body invested in a bud
|
|
};
|
|
inline constexpr FounderParameters primitive_founder_parameters{400, 1, 8'000'000,
|
|
200, 574'000, 500};
|
|
// The genome schema and development version a founder is created with (the version
|
|
// bundle's `founder`). Founder 1 serves rules 1-5; founder 2 serves rules 6 (2026-10-15
|
|
// balance: a third of the mutation step and a third of the construction energy).
|
|
struct FounderVersion {
|
|
std::uint32_t genome_schema, development_version;
|
|
auto operator<=>(const FounderVersion&) const = default;
|
|
};
|
|
inline constexpr FounderVersion primitive_founder_v1{genome_schema_v2, 2};
|
|
inline constexpr FounderVersion primitive_founder_v2{genome_schema_v3, 3};
|
|
// Founder 3 serves rules 7 (ADR-0137): percentage mutation steps and skilled reproduction.
|
|
inline constexpr FounderVersion primitive_founder_v3{genome_schema_v4, 4};
|
|
// Founder 4 serves rules 11 (ADR-0175): founder 3 that can evolve photosynthesis. Founders
|
|
// start without it; the capability is only ever earned through mutation.
|
|
inline constexpr FounderVersion primitive_founder_v4{genome_schema_v5, 5};
|
|
// Founder 5 serves rules 12 (Cellular_Region_Movement_Plan.md): founder 4 with the founder
|
|
// movement arrangement (every index at the 100-point reference).
|
|
inline constexpr FounderVersion primitive_founder_v5{genome_schema_v6, 6};
|
|
// Founder 6 serves rules 13 (ADR-0179): founder 5 on genome schema 7 and development 7, with
|
|
// the membrane in nanometres (1,000 nm, the same 1 um) and the founder's cellular traits.
|
|
inline constexpr FounderVersion primitive_founder_v6{genome_schema_v7, 7};
|
|
inline constexpr std::uint32_t founder_membrane_nanometres = 1'000;
|
|
inline constexpr std::uint32_t primitive_founder_development_version =
|
|
primitive_founder_v1.development_version;
|
|
// The founder genome under a world-scoped identity and its origin event. Fails only on
|
|
// an invalid identity (zero).
|
|
[[nodiscard]] std::expected<Genome, GenomeError>
|
|
primitive_founder(std::uint64_t id, std::uint64_t origin_event,
|
|
FounderVersion version = primitive_founder_v1);
|
|
|
|
// M11.2 founder rules 1 (ADR-0100): fully grown, no damage or spare matter;
|
|
// 30 seconds of full-speed demand as usable energy. Construction energy is paid
|
|
// separately into heat. Tunable and versioned; not an account reward.
|
|
inline constexpr std::uint32_t founder_life_rules = 1;
|
|
inline constexpr std::uint64_t founder_reserve_seconds = 30;
|
|
struct FounderEndowment {
|
|
GrowthState growth{1000, 0};
|
|
accounting::Inventory body{};
|
|
accounting::Inventory reserve{};
|
|
accounting::Picojoules construction{};
|
|
auto operator<=>(const FounderEndowment&) const = default;
|
|
};
|
|
[[nodiscard]] std::expected<FounderEndowment, DevelopmentError>
|
|
primitive_endowment(FounderVersion version = primitive_founder_v1);
|
|
} // namespace evo::biology
|