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
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:
@@ -197,4 +197,31 @@ cellular_inheritance_upgrade_payload(std::span<const std::uint8_t> payload,
|
||||
return std::unexpected(CheckpointError::payload);
|
||||
return (*upgraded)->snapshot();
|
||||
}
|
||||
std::expected<CheckpointManifest, CheckpointError>
|
||||
cellular_photosynthesis_upgrade_manifest(const CheckpointManifest& previous,
|
||||
const Sha256Digest& previous_digest, Uuid commit,
|
||||
const LeaseGrant& lease, const Sha256Digest& build,
|
||||
std::uint64_t bytes, const Sha256Digest& digest) {
|
||||
if (previous.profile != CheckpointProfile::cellular_lives_v1)
|
||||
return std::unexpected(CheckpointError::unsupported);
|
||||
return upgrade_manifest(previous, previous_digest, commit, lease, build, bytes, digest,
|
||||
cellular_v12_versions, cellular_v13_versions);
|
||||
}
|
||||
std::expected<std::vector<std::uint8_t>, CheckpointError>
|
||||
cellular_photosynthesis_upgrade_payload(std::span<const std::uint8_t> payload,
|
||||
const CheckpointManifest& previous,
|
||||
const server::CellularLight& light) {
|
||||
if (!supported(previous) || previous.profile != CheckpointProfile::cellular_lives_v1 ||
|
||||
previous.cellular_versions != cellular_v12_versions)
|
||||
return std::unexpected(CheckpointError::unsupported);
|
||||
if (!encode_manifest(previous) || previous.sequence == 0 || previous.end_tick == 0)
|
||||
return std::unexpected(CheckpointError::chain);
|
||||
auto state = restore_cellular_payload(payload, previous);
|
||||
if (!state)
|
||||
return std::unexpected(state.error());
|
||||
auto upgraded = (*state)->photosynthesis_upgrade_candidate(light);
|
||||
if (!upgraded)
|
||||
return std::unexpected(CheckpointError::payload);
|
||||
return (*upgraded)->snapshot();
|
||||
}
|
||||
} // namespace evo::persistence
|
||||
|
||||
Reference in New Issue
Block a user