M11.1: genome schema 2 with per-second rates (ADR-0099, segment 2)
Foundation / checks (deploy) (push) Successful in 3m32s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (client) (push) Successful in 12m56s
Foundation / checks (network) (push) Successful in 13m46s
Foundation / checks (tsan) (push) Successful in 7m59s
Foundation / checks (checks) (push) Successful in 33m36s
Foundation / checks (postgres) (push) Successful in 45m30s
Foundation / postgres-tools (push) Successful in 20s
Foundation / server-image (push) Successful in 25s
Foundation / image (push) Successful in 2m36s

Movement and ingestion are stored per second in schema 2 (ranges x20). Schema 1 records
stay valid, are never rewritten, and read as exactly x20 via Genome::per_second; drafts
default to schema 1 so existing literals keep their meaning. Development version 1
converts genome rates at its own 50 ms quantum (round down), so phenotypes are
unchanged. Mutation keeps the parent's schema and step; the lineage archive header names
exactly the highest schema held (all-schema-1 archives keep their bytes); the
development-v1 opening names schema 1. No golden changed; two tests that used 2 as an
unknown schema now use the next one. Refresh the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-09 13:16:55 -04:00
co-authored by Claude Opus 5.5
parent a4c6181540
commit 17fe23e5f0
17 changed files with 385 additions and 56 deletions
+11 -5
View File
@@ -28,8 +28,10 @@ constexpr std::array<MutationOperator, 4 * capability_count> catalog = [] {
// One rule rather than a constant per capability: a hundredth of the declared
// range, at least one. Granularity follows the range, which is a stated model
// choice and not a claim about biology.
constexpr std::uint32_t adjustment_step(Capability kind) noexcept {
const auto& limits = capability_schema[static_cast<std::size_t>(kind)];
// The step comes from the genome's own schema, so a schema 1 lineage keeps its steps.
constexpr std::uint32_t adjustment_step(const std::array<CapabilitySpec, capability_count>& table,
Capability kind) noexcept {
const auto& limits = table[static_cast<std::size_t>(kind)];
const auto span = limits.maximum - limits.minimum;
return span / 100 == 0 ? 1 : span / 100;
}
@@ -72,12 +74,16 @@ std::uint64_t bounded(Random& stream, std::uint64_t bound) noexcept {
std::optional<GenomeDraft> apply(const Genome& genome, const MutationOperator& entry,
std::uint64_t id, std::uint64_t origin_event) {
GenomeDraft draft;
// A successor keeps its parent's schema: its parameters are the parent's, in the
// parent's units (ADR-0099), and a lineage's offers never shift by migration.
draft.schema_version = genome.schema_version();
draft.id = id;
draft.origin_event = origin_event;
draft.development_version = genome.development_version();
draft.parents = {genome.id()};
draft.capabilities.assign(genome.capabilities().begin(), genome.capabilities().end());
const auto& limits = capability_schema[static_cast<std::size_t>(entry.target)];
const auto& table = *capability_schema_for(genome.schema_version());
const auto& limits = table[static_cast<std::size_t>(entry.target)];
const auto carried =
std::ranges::find(draft.capabilities, entry.target, &CapabilityRecord::kind);
const auto present = carried != draft.capabilities.end();
@@ -86,7 +92,7 @@ std::optional<GenomeDraft> apply(const Genome& genome, const MutationOperator& e
if (!present) {
return std::nullopt;
}
const auto step = adjustment_step(entry.target);
const auto step = adjustment_step(table, entry.target);
// Refused rather than clamped: a clamp would make two operators agree
// and would offer a no-op as a real choice.
if (carried->parameter > limits.maximum - step) {
@@ -99,7 +105,7 @@ std::optional<GenomeDraft> apply(const Genome& genome, const MutationOperator& e
if (!present) {
return std::nullopt;
}
const auto step = adjustment_step(entry.target);
const auto step = adjustment_step(table, entry.target);
if (carried->parameter < limits.minimum + step) {
return std::nullopt;
}