feat: durable liquid regions (bundle 14, schema 58), cellular-v9 and session v13
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m25s
Foundation / postgres-tools (push) Successful in 1m12s
Foundation / server-image (push) Successful in 4m20s
Foundation / image (push) Successful in 4m54s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m25s
Foundation / postgres-tools (push) Successful in 1m12s
Foundation / server-image (push) Successful in 4m20s
Foundation / image (push) Successful in 4m54s
ADR-0178. Bundle 14 (rules 12 on owner format 10) is admitted by schema 58 through parser-local normalization to bundle 13, with an exact fenced 13 -> 14 upgrade whose only input, the liquid rules, recovery reads from the target. Schema 58 also widens the canonical action input: byte 13 bit 0 is brake. evo-world-clone gains the cellular-v9 opening: cellular-v8 followed by the liquid upgrade from --tuning FILE (region size must match) and an optional --current-seed; resumable and idempotent at bundle 14. Session v13 adds the owner's velocity, heading and the region's current configuration to its perception, each deposit's world velocity, and a brake on cellular actions; older sessions keep their layouts. A rules-12 server lists every pool and the nearest 256 moving bubbles. The client speaks v13, brakes on Space (rebindable; older controls files take the default), draws currents as drifting streaks and carries bubbles along their velocities between perceptions. Tests: protocol v13 round trips and refusals, action-input brake, controls files, and a PostgreSQL cellular-v9 provisioning test whose player is born, swims and brakes through the live host. Full local PostgreSQL qualification, the Linux debug suite and the Windows client suite pass. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -362,6 +362,17 @@ migrate_cellular_photosynthesis_profile(Postgres& db, const FilesystemObjectStor
|
||||
},
|
||||
cellular_photosynthesis_upgrade_manifest);
|
||||
}
|
||||
std::expected<CommittedCheckpoint, CellularProfileMigrationFailure> migrate_cellular_liquid_profile(
|
||||
Postgres& db, const FilesystemObjectStore& objects, const LeaseGrant& lease,
|
||||
const CommittedCheckpoint& predecessor, Uuid commit, const Sha256Digest& build,
|
||||
const server::CellularLiquidRules& rules, milliseconds timeout, const PublishHooks& hooks) {
|
||||
return migrate_rules_profile(
|
||||
db, objects, lease, predecessor, commit, build, timeout, hooks,
|
||||
[rules](std::span<const std::uint8_t> payload, const CheckpointManifest& previous) {
|
||||
return cellular_liquid_upgrade_payload(payload, previous, rules);
|
||||
},
|
||||
cellular_liquid_upgrade_manifest);
|
||||
}
|
||||
|
||||
std::expected<CommittedCheckpoint, CellularProfileMigrationFailure>
|
||||
migrate_cellular_profile_to_v2(Postgres& db, const FilesystemObjectStore& objects,
|
||||
@@ -650,11 +661,13 @@ verify_cellular_no_tick_checkpoint(Postgres& db, const FilesystemObjectStore& ob
|
||||
const bool maturation = m.cellular_versions == cellular_v11_versions;
|
||||
const bool inheritance = m.cellular_versions == cellular_v12_versions;
|
||||
const bool photosynthesis = m.cellular_versions == cellular_v13_versions;
|
||||
const auto derive = photosynthesis ? cellular_photosynthesis_upgrade_manifest
|
||||
: inheritance ? cellular_inheritance_upgrade_manifest
|
||||
: maturation ? cellular_maturation_upgrade_manifest
|
||||
: boundary ? cellular_boundary_upgrade_manifest
|
||||
: cellular_profile_migration_manifest;
|
||||
const bool liquid = m.cellular_versions == cellular_v14_versions;
|
||||
const auto derive = liquid ? cellular_liquid_upgrade_manifest
|
||||
: photosynthesis ? cellular_photosynthesis_upgrade_manifest
|
||||
: inheritance ? cellular_inheritance_upgrade_manifest
|
||||
: maturation ? cellular_maturation_upgrade_manifest
|
||||
: boundary ? cellular_boundary_upgrade_manifest
|
||||
: cellular_profile_migration_manifest;
|
||||
auto expected = derive(*source, *source_digest, m.commit, recorded, m.build, m.payload_bytes,
|
||||
m.payload_sha256);
|
||||
if (!expected || *expected != m)
|
||||
@@ -662,7 +675,16 @@ verify_cellular_no_tick_checkpoint(Postgres& db, const FilesystemObjectStore& ob
|
||||
auto bytes = objects.get({source->payload_sha256, source->payload_bytes});
|
||||
if (!bytes)
|
||||
return fail(RecoveryError::tail);
|
||||
if (photosynthesis) {
|
||||
if (liquid) {
|
||||
// The declared liquid rules are the upgrade's only input: read them from the target,
|
||||
// then require the source to re-derive the exact target bytes with them.
|
||||
auto target = restore_cellular_payload(payload, m);
|
||||
if (!target)
|
||||
return fail(RecoveryError::payload);
|
||||
auto upgraded = cellular_liquid_upgrade_payload(*bytes, *source, (*target)->liquid_rules());
|
||||
if (!upgraded || !std::ranges::equal(*upgraded, payload))
|
||||
return fail(RecoveryError::history);
|
||||
} else if (photosynthesis) {
|
||||
// The declared light is the upgrade's only input: read it from the target, then
|
||||
// require the source to re-derive the exact target bytes with it.
|
||||
auto target = restore_cellular_payload(payload, m);
|
||||
|
||||
@@ -224,4 +224,31 @@ cellular_photosynthesis_upgrade_payload(std::span<const std::uint8_t> payload,
|
||||
return std::unexpected(CheckpointError::payload);
|
||||
return (*upgraded)->snapshot();
|
||||
}
|
||||
std::expected<CheckpointManifest, CheckpointError>
|
||||
cellular_liquid_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_v13_versions, cellular_v14_versions);
|
||||
}
|
||||
std::expected<std::vector<std::uint8_t>, CheckpointError>
|
||||
cellular_liquid_upgrade_payload(std::span<const std::uint8_t> payload,
|
||||
const CheckpointManifest& previous,
|
||||
const server::CellularLiquidRules& rules) {
|
||||
if (!supported(previous) || previous.profile != CheckpointProfile::cellular_lives_v1 ||
|
||||
previous.cellular_versions != cellular_v13_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)->liquid_upgrade_candidate(rules);
|
||||
if (!upgraded)
|
||||
return std::unexpected(CheckpointError::payload);
|
||||
return (*upgraded)->snapshot();
|
||||
}
|
||||
} // namespace evo::persistence
|
||||
|
||||
Reference in New Issue
Block a user