Tell the owner what its engulf and bud did, and why its cell died
M11.8 server half (ADR-0129): v10 diagnostics report the tick's engulf and bud results in two reserved bytes, and v10 type 27 tells the owner its life ended with the cause (starved or engulfed). The bridge fills both from the owner's tick feedback and corpses; v9 views are unchanged. Client presentation stays with the maintainer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -98,6 +98,8 @@ class RegionSessionClient {
|
||||
// The owned life's outstanding mutation offer (v10), cleared when consumed or absent.
|
||||
[[nodiscard]] const std::optional<network::CellularMutationOffer>&
|
||||
mutation_offer() const noexcept;
|
||||
// The most recent end of the owned life (v10, ADR-0129): its tick and cause.
|
||||
[[nodiscard]] const std::optional<network::CellularLifeEnded>& life_ended() const noexcept;
|
||||
[[nodiscard]] std::expected<client::EnvironmentPresentation, client::ViewError>
|
||||
environment() const;
|
||||
[[nodiscard]] std::expected<client::OrganismPresentation, client::ViewError> organisms() const;
|
||||
|
||||
@@ -67,7 +67,8 @@ enum class SessionMessageType : std::uint8_t {
|
||||
cellular_action = 23,
|
||||
cellular_perception = 24,
|
||||
cellular_mutation_action = 25,
|
||||
cellular_mutation_offer = 26 // Server -> owner, stream (v10).
|
||||
cellular_mutation_offer = 26, // Server -> owner, stream (v10).
|
||||
cellular_life_ended = 27 // Server -> owner, stream (v10).
|
||||
};
|
||||
// Admission answers for intentions and actions (wire 0..10).
|
||||
enum class AdmitStatus : std::uint8_t {
|
||||
@@ -217,6 +218,14 @@ struct CellularMutationOffer {
|
||||
std::vector<CellularOfferedCandidate> candidates;
|
||||
friend bool operator==(const CellularMutationOffer&, const CellularMutationOffer&) = default;
|
||||
};
|
||||
// v10 (ADR-0129): the owner's life ended in ick. Cause 1 starved, 2 engulfed, 0 not
|
||||
// recorded (rules below 3). Death is final; a new life is a new request.
|
||||
enum class CellularDeathReason : std::uint8_t { unrecorded, starved, engulfed };
|
||||
struct CellularLifeEnded {
|
||||
std::uint64_t tick{}, life_identity{};
|
||||
CellularDeathReason cause{};
|
||||
friend bool operator==(const CellularLifeEnded&, const CellularLifeEnded&) = 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 {
|
||||
@@ -239,6 +248,22 @@ enum class CellularIntakeResult : std::uint8_t {
|
||||
missing_patch,
|
||||
out_of_contact
|
||||
};
|
||||
// v10 tick effects (ADR-0129): what an engulf or bud intention did. v9 never reports them.
|
||||
enum class CellularEngulfResult : std::uint8_t {
|
||||
not_reported,
|
||||
not_requested,
|
||||
engulfed,
|
||||
no_eligible_prey,
|
||||
unsupported
|
||||
};
|
||||
enum class CellularBudOutcome : std::uint8_t {
|
||||
not_reported,
|
||||
not_requested,
|
||||
budded,
|
||||
not_able, // No reproduction capability, not fully grown, damaged, or suspended.
|
||||
insufficient_funding,
|
||||
no_placement
|
||||
};
|
||||
struct CellularLifeDiagnostics {
|
||||
std::uint64_t reserve_energy_pj{};
|
||||
std::array<std::uint64_t, 4> reserve_matter_fg{};
|
||||
@@ -246,6 +271,8 @@ struct CellularLifeDiagnostics {
|
||||
CellularMovementResult movement{CellularMovementResult::not_reported};
|
||||
CellularIntakeResult intake{CellularIntakeResult::not_reported};
|
||||
bool has_tick_effects{};
|
||||
CellularEngulfResult engulf{CellularEngulfResult::not_reported}; // v10 only.
|
||||
CellularBudOutcome bud{CellularBudOutcome::not_reported}; // v10 only.
|
||||
friend bool operator==(const CellularLifeDiagnostics&,
|
||||
const CellularLifeDiagnostics&) = default;
|
||||
};
|
||||
@@ -374,7 +401,7 @@ using SessionMessage =
|
||||
SessionInterest, SnapshotChunk, SnapshotAck, HandoffOffer, SessionRedirect,
|
||||
PrimitiveLifeRequest, PrimitiveLifeReceipt, PrimitiveLifeOutcome,
|
||||
PrimitiveLifeQuery, CellularPerception, CellularMutationAction,
|
||||
CellularMutationOffer>;
|
||||
CellularMutationOffer, CellularLifeEnded>;
|
||||
|
||||
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message);
|
||||
[[nodiscard]] std::vector<std::uint8_t> encode_session(const SessionMessage& message,
|
||||
|
||||
@@ -186,6 +186,9 @@ class RegionSessions {
|
||||
// The owner's outstanding offer (11.4d), to the account's current v10 session if any.
|
||||
[[nodiscard]] bool send_mutation_offer(const network::AccountId& account,
|
||||
const network::CellularMutationOffer& offer);
|
||||
// 11.8 (ADR-0129): the owner's life ended, with its cause, to its v10 session if any.
|
||||
[[nodiscard]] bool send_life_ended(const network::AccountId& account,
|
||||
const network::CellularLifeEnded& ended);
|
||||
[[nodiscard]] network::ReplicationStats replication_stats() const;
|
||||
// M10.9a (ADR-0097): the host's load governor output. While `refuse_logins`, a Hello
|
||||
// carrying a grant is closed with `capacity` before signature work (handoff tickets are
|
||||
|
||||
Reference in New Issue
Block a user