Files
aevolution/include/evo/server/lifecycle/cellular_migration.hpp
T
dingo 1e207b5ee4
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m30s
Foundation / checks (client) (push) Failing after 18m38s
Foundation / checks (network) (push) Successful in 22m21s
Foundation / checks (tsan) (push) Failing after 22m17s
Foundation / checks (postgres) (push) Successful in 51m32s
Foundation / checks (checks) (push) Failing after 59m20s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
M12.4: record and replay exact biological transfer pairs
2026-10-17 18:23:33 -04:00

44 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,
format,
checksum
};
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