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
+27 -1
View File
@@ -20,8 +20,10 @@ void check(bool condition, std::source_location location = std::source_location:
}
}
#define CHECK(expression) check(static_cast<bool>(expression))
Genome descend(std::uint64_t id, std::uint64_t parent, std::uint32_t conversion = 400) {
Genome descend(std::uint64_t id, std::uint64_t parent, std::uint32_t conversion = 400,
std::uint32_t schema = genome_schema_v1) {
GenomeDraft source;
source.schema_version = schema;
source.id = id;
source.origin_event = id;
source.development_version = 1;
@@ -380,6 +382,29 @@ void the_archive_decoder_refuses_damage_and_disorder() {
CHECK(!LineageArchive::decode(std::span{bytes}.first(39)));
}
// ADR-0099: the header names the highest genome schema held, so an archive of schema 1
// records keeps its exact bytes, and a mixed archive round-trips.
void schemas_mix_without_rewriting() {
const auto old = with_history().encode();
CHECK(field(old, 12, 4) == genome_schema_v1);
auto archive = branching();
CHECK(archive.admit(descend(6, 4, 400, genome_schema_version)));
const auto bytes = archive.encode();
CHECK(field(bytes, 12, 4) == genome_schema_version);
const auto decoded = LineageArchive::decode(bytes);
CHECK(decoded && decoded->encode() == bytes);
CHECK(decoded->find(6)->schema_version() == 2 && decoded->find(4)->schema_version() == 1);
// A header that understates its records is refused.
auto understated = bytes;
set(understated, 12, genome_schema_v1, 4);
reseal(understated);
CHECK(!LineageArchive::decode(understated));
auto unknown = old;
set(unknown, 12, 3, 4);
reseal(unknown);
CHECK(!LineageArchive::decode(unknown));
}
void a_full_archive_round_trips() {
LineageArchive archive;
CHECK(archive.admit(descend(1, 0)));
@@ -411,6 +436,7 @@ int main() try {
the_archive_round_trips_canonically();
the_archive_decoder_refuses_damage_and_disorder();
a_full_archive_round_trips();
schemas_mix_without_rewriting();
std::cout << "PASS lineage retention, branching ancestry and provisional absence\n";
return 0;
} catch (...) {