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
+34 -1
View File
@@ -137,7 +137,8 @@ void only_legitimate_operators_are_offered() {
CHECK(offered);
for (const auto& candidate : offered->candidates) {
// A required capability can never be shed, however it is drawn.
const auto& limits = capability_schema[static_cast<std::size_t>(candidate.target)];
const auto& limits = (*capability_schema_for(
genome.schema_version()))[static_cast<std::size_t>(candidate.target)];
CHECK(!(candidate.effect == MutationEffect::shed && limits.required));
// Acquiring only ever applies to something the parent lacks, and
// adjusting only to something it carries.
@@ -320,6 +321,37 @@ void invalid_contexts_are_refused() {
CHECK(mutation_catalog().size() == 4 * capability_count);
}
} // namespace
// ADR-0099: a successor keeps its parent's schema and that schema's adjustment step, so
// a schema 1 lineage is never migrated by mutating, and a schema 2 one steps per second.
void successors_keep_their_parents_schema() {
for (const auto schema : {genome_schema_v1, genome_schema_version}) {
auto source = draft();
source.schema_version = schema;
source.capabilities.push_back(
{Capability::movement, schema == genome_schema_v1 ? 50'000U : 1'000'000U, 0});
const auto parent = build(source);
const auto step = schema == genome_schema_v1 ? 1'000U : 20'000U; // 1/100 of the range.
bool adjusted = false;
// Offers are seeded; search seeds (deterministically) for the movement adjustment.
for (std::uint64_t seed = 1; seed <= 200 && !adjusted; ++seed) {
const auto offered = mutation_candidates(parent, context(seed, 8));
CHECK(offered);
for (const auto& candidate : offered->candidates) {
const auto successor = select_mutation(parent, context(seed, 8), *offered,
candidate.operator_id, 99, 42);
CHECK(successor && successor->schema_version() == schema);
if (candidate.target == Capability::movement &&
candidate.effect == MutationEffect::adjust_up) {
CHECK(*successor->parameter(Capability::movement) ==
*parent.parameter(Capability::movement) + step);
adjusted = true;
}
}
}
CHECK(adjusted);
}
}
int main() try {
the_same_context_always_offers_the_same_candidates();
offers_are_canonical_and_unranked();
@@ -330,6 +362,7 @@ int main() try {
reported_cost_is_what_the_budget_charges();
invalid_contexts_are_refused();
every_eligible_operator_is_offered_and_none_is_favoured();
successors_keep_their_parents_schema();
std::cout << "PASS mutation catalog, uniform seeded offers and guarded selection\n";
return 0;
} catch (...) {