Bind durable mutation reservations to cellular ticks
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (checks) (push) Failing after 3m58s
Foundation / checks (tsan) (push) Canceled after 0s
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 6m18s
Foundation / checks (postgres) (push) Canceled after 2m23s
Foundation / checks (network) (push) Canceled after 4m19s

This commit is contained in:
dingo
2026-10-11 08:54:50 -04:00
parent b0cd2b7704
commit de4bbec94c
5 changed files with 206 additions and 20 deletions
+17 -5
View File
@@ -1,6 +1,7 @@
#pragma once
#include "evo/network/intent_admission.hpp"
#include "evo/persistence/life_reservation_store.hpp"
#include "evo/persistence/region_lease.hpp"
#include "evo/server/lifecycle/cellular_batch.hpp"
@@ -20,6 +21,8 @@ enum class CellularSessionBatchError : std::uint8_t {
duplicate_action,
duplicate_birth,
invalid_birth,
mutation,
duplicate_mutation,
unperceived_target,
head,
batch_full,
@@ -30,15 +33,19 @@ enum class CellularSessionBatchError : std::uint8_t {
struct CellularSessionTick {
CellularTickIntents intents;
std::vector<CellularActionRecord> actions;
std::vector<CellularMutationActionRecord> mutation_actions;
};
// Overlays authenticated v7 actions onto the scheduler's complete per-life input set.
// The scheduler owns all non-player and no-message behavior; this adapter only binds a
// durable action to the one live account-owned life and preserves its canonical bytes.
// Overlays authenticated v7 actions and v10 durable mutation reservations onto the
// scheduler's complete per-life input set. The scheduler owns non-player and no-message
// behavior; this adapter binds each action to the one live account-owned life and preserves
// the canonical input needed for publication and replay.
[[nodiscard]] std::expected<CellularSessionTick, CellularSessionBatchError>
prepare_cellular_session_tick(const CellularLives& state, std::uint64_t tick,
std::span<const CellularLifeIntent> baseline,
std::span<const network::CarriedAction> actions);
std::span<const network::CarriedAction> actions,
std::span<const persistence::CellularMutationReservation>
mutations = {});
// Builds one bounded publication from the last durable head. Its working copy is private;
// only the host may publish, and callers must discard it after uncertainty until the host
@@ -50,13 +57,17 @@ class CellularSessionBatchBuilder {
[[nodiscard]] std::expected<void, CellularSessionBatchError>
append(std::uint64_t tick, std::span<const CellularLifeIntent> baseline,
std::span<const network::CarriedAction> actions,
std::span<const CellularTickIntents::Birth> births = {});
std::span<const CellularTickIntents::Birth> births = {},
std::span<const persistence::CellularMutationReservation> mutations = {});
[[nodiscard]] const CellularBatch& batch() const noexcept {
return batch_;
}
[[nodiscard]] std::span<const CellularActionRecord> actions() const noexcept {
return actions_;
}
[[nodiscard]] std::span<const CellularMutationActionRecord> mutation_actions() const noexcept {
return mutation_actions_;
}
[[nodiscard]] const CellularLives& candidate() const noexcept {
return *working_;
}
@@ -67,5 +78,6 @@ class CellularSessionBatchBuilder {
std::unique_ptr<CellularLives> working_;
CellularBatch batch_;
std::vector<CellularActionRecord> actions_;
std::vector<CellularMutationActionRecord> mutation_actions_;
};
} // namespace evo::server