Define cellular intention session protocol v6
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m54s
Foundation / checks (client) (push) Failing after 4m23s
Foundation / checks (network) (push) Failing after 3m5s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 11s
Foundation / checks (postgres) (push) Canceled after 57s
Foundation / checks (checks) (push) Canceled after 5m23s

This commit is contained in:
dingo
2026-10-10 21:29:59 -04:00
parent 1ccc0ce476
commit ae0a3cdae5
10 changed files with 245 additions and 11 deletions
+16 -5
View File
@@ -24,6 +24,7 @@ inline constexpr std::uint32_t session_magic = 0x4E535645; // Bytes "EVSN".
// are frozen; v4 remains the default. v5 adds reliable primitive-life operations.
inline constexpr std::uint16_t session_protocol_version = 4;
inline constexpr std::uint16_t session_protocol_v5 = 5;
inline constexpr std::uint16_t session_protocol_v6 = 6;
inline constexpr std::size_t session_address_bytes = 64; // Endpoint or server name field.
inline constexpr std::size_t session_datagram_bytes = 1200; // Whole message, ADR-0089.
inline constexpr std::size_t session_header_bytes = 8;
@@ -50,7 +51,8 @@ enum class SessionMessageType : std::uint8_t {
primitive_life_request = 18,
primitive_life_receipt,
primitive_life_outcome,
primitive_life_query
primitive_life_query,
cellular_intention = 22
};
// Admission answers for intentions and actions (wire 0..10).
enum class AdmitStatus : std::uint8_t {
@@ -136,6 +138,15 @@ struct SessionIntention {
std::int16_t move_x{}, move_y{};
friend bool operator==(const SessionIntention&, const SessionIntention&) = default;
};
// v6 biological input only: movement intent plus an optional address of a patch
// the client wants to feed from. The server checks range, contact and costs.
struct CellularIntention {
std::uint64_t session{}, epoch{}, sequence{}, tick{};
std::int16_t move_x{}, move_y{};
bool has_intake_target{};
std::uint32_t intake_x_um{}, intake_y_um{};
friend bool operator==(const CellularIntention&, const CellularIntention&) = default;
};
struct IntentionReceipt {
std::uint64_t sequence{};
AdmitStatus status{};
@@ -248,10 +259,10 @@ struct SessionRedirect {
};
using SessionMessage =
std::variant<SessionHello, SessionWelcome, SessionRefresh, SessionRefreshResult, SessionClose,
SessionIntention, IntentionReceipt, SimulatedThrough, SessionAction, ActionReceipt,
ActionOutcome, ActionQuery, SessionInterest, SnapshotChunk, SnapshotAck,
HandoffOffer, SessionRedirect, PrimitiveLifeRequest, PrimitiveLifeReceipt,
PrimitiveLifeOutcome, PrimitiveLifeQuery>;
SessionIntention, CellularIntention, IntentionReceipt, SimulatedThrough,
SessionAction, ActionReceipt, ActionOutcome, ActionQuery, SessionInterest,
SnapshotChunk, SnapshotAck, HandoffOffer, SessionRedirect, PrimitiveLifeRequest,
PrimitiveLifeReceipt, PrimitiveLifeOutcome, PrimitiveLifeQuery>;
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message);
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message,