Send the owner its outstanding mutation offer over v10

Session protocol v10 adds type 26: the life's earned offer with its unranked
candidates in operator order and each successor's capability value,
maintenance and total mass. The cellular bridge sends it when the offer or the
owner's session changes and clears a consumed offer; the client keeps the
latest one for the maintainer's choice UI (ADR-0121, 11.4d server half).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-13 23:07:50 -04:00
co-authored by Claude Opus 5.5
parent 187b1a7b98
commit f77956e579
16 changed files with 314 additions and 17 deletions
+22 -2
View File
@@ -66,7 +66,8 @@ enum class SessionMessageType : std::uint8_t {
cellular_intention = 22,
cellular_action = 23,
cellular_perception = 24,
cellular_mutation_action = 25
cellular_mutation_action = 25,
cellular_mutation_offer = 26 // Server -> owner, stream (v10).
};
// Admission answers for intentions and actions (wire 0..10).
enum class AdmitStatus : std::uint8_t {
@@ -195,6 +196,24 @@ struct CellularMutationAction {
std::uint16_t operator_id{};
friend bool operator==(const CellularMutationAction&, const CellularMutationAction&) = default;
};
// v10 server-to-owner offer (ADR-0121, 11.4d): the life's outstanding earned offer, its
// candidates in stable operator order (never ranked). Each candidate states the successor's
// actual tradeoffs: its capability value and its maintenance and total mass. No candidates
// (and zero event/offer) clears a consumed or absent offer.
struct CellularOfferedCandidate {
std::uint16_t operator_id{};
std::uint8_t capability{}, effect{}; // biology::Capability, biology::MutationEffect.
std::uint32_t parameter{}; // The successor's value; zero when shed.
std::uint64_t maintenance{}, total_mass{};
friend bool operator==(const CellularOfferedCandidate&,
const CellularOfferedCandidate&) = default;
};
inline constexpr std::size_t max_cellular_offered_candidates = 8;
struct CellularMutationOffer {
std::uint64_t tick{}, life_identity{}, event_index{}, offer_tick{};
std::vector<CellularOfferedCandidate> candidates;
friend bool operator==(const CellularMutationOffer&, const CellularMutationOffer&) = default;
};
// v8 server-to-owner view. Addresses and current inventory are already filtered by
// authoritative cell position/range; provenance and account identity are omitted.
struct CellularPerceivedPatch {
@@ -351,7 +370,8 @@ using SessionMessage =
SimulatedThrough, SessionAction, ActionReceipt, ActionOutcome, ActionQuery,
SessionInterest, SnapshotChunk, SnapshotAck, HandoffOffer, SessionRedirect,
PrimitiveLifeRequest, PrimitiveLifeReceipt, PrimitiveLifeOutcome,
PrimitiveLifeQuery, CellularPerception, CellularMutationAction>;
PrimitiveLifeQuery, CellularPerception, CellularMutationAction,
CellularMutationOffer>;
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message);
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message,