feat(ecology): make photosynthesis regions playable on DEV
Foundation / checks (ecs) (push) Successful in 2m19s
Foundation / checks (deploy) (push) Successful in 4m47s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 16m48s
Foundation / checks (network) (push) Canceled after 16m46s
Foundation / checks (postgres) (push) Canceled after 16m47s
Foundation / checks (client) (push) Canceled after 16m53s
Foundation / checks (tsan) (push) Canceled after 14m33s

ADR-0176 and schema 57 admit raw cellular bundle 13 (rules 11 on owner
format 9) through parser-local normalization to bundle 12, and a fenced
no-tick 12 -> 13 upgrade that declares the region's light; recovery reads
the light from the target and re-derives the whole target from the source.
The resumable cellular-v8 opening provisions a cellular-v7 genesis, one
empty tick and the durable upgrades to bundle 13.

Session v12 adds the owner's captured light and the producers it can see
to its perception, and lets offers name photosynthesis; older sessions keep
their layouts and never receive photosynthesis candidates. The client
draws chloroplasts by efficiency, shows sunlight in the HUD and offers
photosynthesis cards. DEV now provisions and serves region 9 with the
trial light; region 8 stays stored but unserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-19 23:04:34 -04:00
co-authored by Claude Opus 5.5
parent 108f29eda5
commit b73ccbae9a
38 changed files with 1106 additions and 140 deletions
@@ -279,6 +279,13 @@ migrate_cellular_inheritance_profile(Postgres&, const FilesystemObjectStore&, co
const CommittedCheckpoint&, Uuid commit,
const Sha256Digest& build, std::chrono::milliseconds timeout,
const PublishHooks& hooks = {});
// ADR-0176: explicit raw-only bundle 12 -> 13, declaring the region's light.
[[nodiscard]] std::expected<CommittedCheckpoint, CellularProfileMigrationFailure>
migrate_cellular_photosynthesis_profile(Postgres&, const FilesystemObjectStore&, const LeaseGrant&,
const CommittedCheckpoint&, Uuid commit,
const Sha256Digest& build, server::CellularLight light,
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.
+19 -1
View File
@@ -85,6 +85,12 @@ inline constexpr CellularVersionBundle cellular_v10_versions{8, 7, 2, 1, 1, 4, 3
inline constexpr CellularVersionBundle cellular_v11_versions{9, 7, 2, 1, 1, 4, 3, 2, 1};
// ADR-0167: portable raw-only retained plans. SQL/publication admission is separate.
inline constexpr CellularVersionBundle cellular_v12_versions{10, 8, 2, 1, 1, 4, 3, 2, 1};
// ADR-0175/0176: rules 11 on owner format 9 (declared light), development 5, founder 4.
inline constexpr CellularVersionBundle cellular_v13_versions{11, 9, 2, 1, 1, 5, 4, 2, 1};
// Raw-only retained-plan bundles, which use trace 4 and their own SQL admission.
[[nodiscard]] constexpr bool cellular_plan_bundle(const CellularVersionBundle& b) noexcept {
return b == cellular_v12_versions || b == cellular_v13_versions;
}
// Zero means this bundle has no population representation.
[[nodiscard]] constexpr std::uint32_t
population_envelope_version(const CellularVersionBundle& b) noexcept {
@@ -102,7 +108,7 @@ population_envelope_version(const CellularVersionBundle& b) noexcept {
// Exact raw trace version for admitted cellular tuples; bundle 12 has its own semantics.
[[nodiscard]] constexpr std::uint32_t
cellular_checkpoint_trace_format(const CellularVersionBundle& b) noexcept {
return b == cellular_v12_versions ? server::cellular_batch_inheritance_format
return cellular_plan_bundle(b) ? server::cellular_batch_inheritance_format
: cellular_revision_bundle(b) ? server::cellular_batch_format
: server::cellular_batch_v2_format;
}
@@ -275,6 +281,18 @@ cellular_inheritance_upgrade_manifest(const CheckpointManifest& predecessor,
[[nodiscard]] std::expected<std::vector<std::uint8_t>, CheckpointError>
cellular_inheritance_upgrade_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& predecessor);
// ADR-0176: explicit raw-only bundle 12 -> 13 upgrade declaring the region's light. The
// light is an input; recovery reads it from the target and re-derives everything else.
[[nodiscard]] std::expected<CheckpointManifest, CheckpointError>
cellular_photosynthesis_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_photosynthesis_upgrade_payload(std::span<const std::uint8_t> payload,
const CheckpointManifest& predecessor,
const server::CellularLight& light);
// ADR-0174: explicit one-way, no-tick profile 5 -> 6 transition. The payload wraps the
// identical population with its declared environment; bundle and policy are unchanged.
[[nodiscard]] std::expected<CheckpointManifest, CheckpointError>