End dead lives durably so a player can start again
M11.6a (ADR-0127, schema v37): a published life is marked ended once, by a commit of its region, through the lease-fenced end_cellular_lives. One active life per account replaces one life per account, so after a death the account reserves and publishes a new primitive founder while the corpse, archive and descendants stay. The host records endings after the death's publication and again for every founder corpse on recovery. The cellular server now refuses only an unusable carried action, not the whole tick. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <expected>
|
||||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
namespace evo::persistence {
|
||||
@@ -94,6 +95,13 @@ reserve_cellular_mutation(
|
||||
std::uint64_t generation, std::uint64_t action_id,
|
||||
const std::array<std::uint8_t, cellular_mutation_reservation_input_bytes>& input,
|
||||
std::chrono::milliseconds timeout);
|
||||
// Schema v37, ADR-0127: records that these published lives of this region had ended by
|
||||
// `commit` (a commit of this region), so their accounts may start new lives. At most
|
||||
// 256 identities; repeats are no-ops. Returns how many were newly ended.
|
||||
inline constexpr std::size_t max_life_endings_per_call = 256;
|
||||
[[nodiscard]] std::expected<std::uint32_t, LifeReservationFailure>
|
||||
end_cellular_lives(Postgres& db, RegionKey key, const LeaseGrant& lease, const Uuid& commit,
|
||||
std::span<const std::uint64_t> identities, std::chrono::milliseconds timeout);
|
||||
// Pending selections are reloaded under the recovered region lease after restart.
|
||||
[[nodiscard]] std::expected<std::vector<CellularMutationReservation>, LifeReservationFailure>
|
||||
load_pending_cellular_mutations(Postgres& db, RegionKey key, const LeaseGrant& lease,
|
||||
|
||||
Reference in New Issue
Block a user