Add cellular checkpoint manifest profile
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 40s
Foundation / checks (ecs) (push) Successful in 1m49s
Foundation / checks (postgres) (push) Failing after 51s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m42s
Foundation / checks (network) (push) Canceled after 3m4s

This commit is contained in:
dingo
2026-10-10 22:45:29 -04:00
parent 181b9aeec2
commit 3931fcfbe6
7 changed files with 163 additions and 19 deletions
@@ -3,6 +3,7 @@
#include "evo/persistence/region_lease.hpp"
#include "evo/processes/environmental_community.hpp"
#include "evo/processes/lineage_region.hpp"
#include "evo/server/lifecycle/cellular_lives.hpp"
#include "evo/server/lifecycle/primitive_batch.hpp"
#include <cstddef>
#include <cstdint>
@@ -22,11 +23,13 @@ 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.
};
// history_profile 1: lineage archive format 1 with genome schema 1.
inline constexpr std::uint32_t lineage_history_profile = 1;
// Archive format 1, genome schema 2, development 2, founder-life rules 1.
inline constexpr std::uint32_t primitive_history_profile = 2;
inline constexpr std::uint32_t cellular_history_profile = 3;
// Declared durability, verified at deployment. Development: one volume, no host-loss claim.
enum class DurabilityPolicy : std::uint8_t { unknown = 0, single_volume_development = 1 };
@@ -40,6 +43,12 @@ struct VersionBundle {
inline constexpr VersionBundle environmental_v1_versions{};
// No field or terrain state in this explicitly provisioned nursery profile.
inline constexpr VersionBundle primitive_v1_versions{1, 1, 1, 0, 0, 1, 1, 1, 1};
struct CellularVersionBundle {
std::uint32_t rules{1}, envelope{1}, habitat{1}, coordinate{1}, genome{1}, development{2},
founder{1}, archive{1};
friend bool operator==(const CellularVersionBundle&, const CellularVersionBundle&) = default;
};
inline constexpr CellularVersionBundle cellular_v1_versions{};
// Batch evidence bound by manifest v2 (ADR-0063); all zero at genesis.
struct BatchDigests {
@@ -67,6 +76,7 @@ struct CheckpointManifest {
std::uint64_t epoch{};
std::uint64_t tick_microseconds{};
VersionBundle versions{};
CellularVersionBundle cellular_versions{};
Sha256Digest build{}; // Retained immutable build artifact identity.
std::uint32_t rng_streams{}; // These rules use no randomness: 0.
std::uint32_t history_profile{}; // 0 environmental; 1 lineage; 2 primitive lives.
@@ -86,6 +96,7 @@ inline constexpr std::size_t max_lineage_payload_bytes = processes::max_lineage_
return profile == CheckpointProfile::environmental_v1 ? max_environmental_payload_bytes
: profile == CheckpointProfile::environmental_lineage_v1 ? max_lineage_payload_bytes
: profile == CheckpointProfile::primitive_lives_v1 ? server::max_primitive_lives_bytes
: profile == CheckpointProfile::cellular_lives_v1 ? server::max_cellular_lives_bytes
: 0;
}
inline constexpr std::uint64_t max_checkpoint_ticks = 64;
@@ -146,4 +157,7 @@ restore_lineage_payload(std::span<const std::uint8_t> payload, const CheckpointM
[[nodiscard]] std::expected<std::unique_ptr<server::PrimitiveLives>, CheckpointError>
restore_primitive_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& manifest);
[[nodiscard]] std::expected<std::unique_ptr<server::CellularLives>, CheckpointError>
restore_cellular_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& manifest);
} // namespace evo::persistence