feat(persistence): admit durable funded maturation upgrades
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 2m24s
Foundation / checks (network) (push) Successful in 20m40s
Foundation / checks (client) (push) Successful in 21m57s
Foundation / checks (tsan) (push) Successful in 26m32s
Foundation / checks (postgres) (push) Successful in 1h3m17s
Foundation / checks (checks) (push) Successful in 1h14m29s
Foundation / postgres-tools (push) Successful in 34s
Foundation / server-image (push) Successful in 4m6s
Foundation / image (push) Successful in 4m52s

This commit is contained in:
dingo
2026-10-19 06:23:51 -04:00
parent a5307c768b
commit 463b091056
25 changed files with 799 additions and 74 deletions
@@ -267,6 +267,12 @@ migrate_cellular_boundary_profile(Postgres&, const FilesystemObjectStore&, const
const CommittedCheckpoint&, Uuid commit,
const Sha256Digest& build, std::chrono::milliseconds timeout,
const PublishHooks& hooks = {});
// ADR-0158: explicit bundle 10 -> 11 maturation, same journal and exact retry contract.
[[nodiscard]] std::expected<CommittedCheckpoint, CellularProfileMigrationFailure>
migrate_cellular_maturation_profile(Postgres&, const FilesystemObjectStore&, const LeaseGrant&,
const CommittedCheckpoint&, Uuid commit,
const Sha256Digest& build, std::chrono::milliseconds timeout,
const PublishHooks& hooks = {});
// Verify the recorded no-tick operation under current authority, replaying its
// entire source/target payload. Version upgrades and profile transitions retain
// separate evidence; neither is inferred solely from the target tuple.
+20 -5
View File
@@ -25,8 +25,8 @@ enum class CheckpointProfile : std::uint8_t {
environmental_v1 = 1, // Environmental envelope only; history_profile 0.
environmental_lineage_v1 = 2, // LineageRegion container; history_profile 1.
primitive_lives_v1 = 3, // Funded creation state; history_profile 2.
cellular_lives_v1 = 4, // Complete cellular state; history_profile 3.
cellular_population_v1 = 5, // Exact population envelope; nested cellular bundle 9 or 10.
cellular_lives_v1 = 4, // Complete cellular state; history_profile 3 or 4.
cellular_population_v1 = 5, // Exact populations; cellular bundle 9, 10 or 11.
};
// history_profile 1: lineage archive format 1 with genome schema 1.
inline constexpr std::uint32_t lineage_history_profile = 1;
@@ -71,16 +71,20 @@ inline constexpr CellularVersionBundle cellular_v9_versions{8, 6, 2, 1, 1, 4, 3,
// ADR-0145: portable boundary accounting, unchanged rules 8 on owner envelope 7.
// Database publication requires its own explicit schema admission.
inline constexpr CellularVersionBundle cellular_v10_versions{8, 7, 2, 1, 1, 4, 3, 2, 1};
// ADR-0158: explicit funded maturation, retaining owner 7 and population envelope 2.
inline constexpr CellularVersionBundle cellular_v11_versions{9, 7, 2, 1, 1, 4, 3, 2, 1};
// Zero means this bundle has no population representation.
[[nodiscard]] constexpr std::uint32_t
population_envelope_version(const CellularVersionBundle& b) noexcept {
return b == cellular_v9_versions ? 1 : b == cellular_v10_versions ? 2 : 0;
return b == cellular_v9_versions ? 1
: (b == cellular_v10_versions || b == cellular_v11_versions) ? 2
: 0;
}
// Bundles with genome revisions: the revision history profile and format-3 traces.
[[nodiscard]] constexpr bool cellular_revision_bundle(const CellularVersionBundle& b) noexcept {
return b == cellular_v3_versions || b == cellular_v4_versions || b == cellular_v5_versions ||
b == cellular_v6_versions || b == cellular_v7_versions || b == cellular_v8_versions ||
b == cellular_v9_versions || b == cellular_v10_versions;
b == cellular_v9_versions || b == cellular_v10_versions || b == cellular_v11_versions;
}
// Batch evidence bound by manifest v2 (ADR-0063); all zero at genesis.
@@ -206,7 +210,7 @@ restore_cellular_payload(std::span<const std::uint8_t> payload, const Checkpoint
[[nodiscard]] std::expected<std::unique_ptr<server::CellularPopulation>, CheckpointError>
restore_population_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& manifest);
// Dedicated profile 4 <-> profile 5 transition, preserving bundle 9 or 10 exactly.
// Dedicated profile 4 <-> profile 5 transition, preserving bundle 9, 10 or 11 exactly.
[[nodiscard]] std::expected<CheckpointManifest, CheckpointError>
population_profile_transition_manifest(const CheckpointManifest& predecessor,
const Sha256Digest& predecessor_digest, Uuid commit,
@@ -227,6 +231,17 @@ cellular_boundary_upgrade_manifest(const CheckpointManifest& predecessor,
[[nodiscard]] std::expected<std::vector<std::uint8_t>, CheckpointError>
cellular_boundary_upgrade_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& predecessor);
// ADR-0158: exact same-profile, no-tick bundle 10 -> 11 maturation upgrade.
// The caller independently binds source SHA-256 and fenced publication authority.
[[nodiscard]] std::expected<CheckpointManifest, CheckpointError>
cellular_maturation_upgrade_manifest(const CheckpointManifest& predecessor,
const Sha256Digest& predecessor_digest, Uuid commit,
const LeaseGrant& lease, const Sha256Digest& build,
std::uint64_t payload_bytes,
const Sha256Digest& payload_sha256);
[[nodiscard]] std::expected<std::vector<std::uint8_t>, CheckpointError>
cellular_maturation_upgrade_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& predecessor);
// Population manual conversion may publish at the same tick with a nonempty trace.
[[nodiscard]] std::expected<CheckpointManifest, CheckpointError> population_successor_manifest(
const CheckpointManifest& predecessor, const Sha256Digest& predecessor_digest, Uuid commit,