Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m18s
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 5m33s
Foundation / checks (postgres) (push) Canceled after 5m29s
Foundation / checks (tsan) (push) Canceled after 5m28s
Foundation / checks (client) (push) Canceled after 5m37s
Foundation / checks (network) (push) Canceled after 5m39s
42 lines
1.5 KiB
C++
42 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include "evo/server/lifecycle/cellular_population.hpp"
|
|
|
|
namespace evo::server {
|
|
enum class CellularMigrationError : std::uint8_t {
|
|
version,
|
|
identity,
|
|
tick,
|
|
ineligible,
|
|
capacity,
|
|
placement,
|
|
archive,
|
|
overflow,
|
|
conservation
|
|
};
|
|
struct CellularMigrationExecution {
|
|
std::uint64_t genome{};
|
|
std::vector<std::uint64_t> members;
|
|
accounting::Inventory transferred;
|
|
std::unique_ptr<CellularLives> source, destination;
|
|
};
|
|
struct CellularPopulationMigrationExecution {
|
|
std::uint64_t genome{};
|
|
std::vector<std::uint64_t> members;
|
|
accounting::Inventory transferred;
|
|
std::unique_ptr<CellularPopulation> source, destination;
|
|
};
|
|
// ADR-0144: exact no-tick ownership candidates at an explicitly compatible cut.
|
|
// This chooses neither a route nor a movement. It preserves every coordinate and
|
|
// biological field, imports the complete genome ancestry and moves actual stock.
|
|
// Publication must commit the pair under both current fences before activation.
|
|
class CellularMigration {
|
|
public:
|
|
[[nodiscard]] static std::expected<CellularMigrationExecution, CellularMigrationError>
|
|
prepare(const CellularLives& source, const CellularLives& destination, std::uint64_t genome);
|
|
[[nodiscard]] static std::expected<CellularPopulationMigrationExecution, CellularMigrationError>
|
|
prepare(const CellularPopulation& source, const CellularPopulation& destination,
|
|
std::uint64_t genome);
|
|
};
|
|
} // namespace evo::server
|