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
+18 -9
View File
@@ -148,6 +148,18 @@ struct RegionSessions::Impl {
(void)endpoint->send_message(c.id, network::encode_session(m, c.protocol_version))
.has_value();
}
// Reliable owner-only v10 messages, to the account's established v10 session.
bool send_to_v10_owner(const network::AccountId& account,
const network::SessionMessage& message) {
for (const auto& c : connections) {
if (c.state != State::established ||
c.protocol_version != network::session_protocol_v10 || c.account_id != account)
continue;
const auto bytes = network::encode_session(message, c.protocol_version);
return !bytes.empty() && endpoint->send_message(c.id, bytes).has_value();
}
return false;
}
// Realtime answers: a refused datagram is dropped; cumulative watermarks cover it.
void send_datagram(const Connection& c, const network::SessionMessage& m) {
(void)endpoint->send_datagram(c.id, network::encode_session(m, c.protocol_version))
@@ -937,15 +949,12 @@ bool RegionSessions::send_cellular_perception(const network::AccountId& account,
bool RegionSessions::send_mutation_outcome(const network::AccountId& account,
const network::ActionOutcome& outcome) {
auto& m = *impl_;
for (const auto& c : m.connections) {
if (c.state != Impl::State::established ||
c.protocol_version != network::session_protocol_v10 || c.account_id != account)
continue;
return m.endpoint->send_message(c.id, network::encode_session(outcome, c.protocol_version))
.has_value();
}
return false;
return impl_->send_to_v10_owner(account, outcome);
}
bool RegionSessions::send_mutation_offer(const network::AccountId& account,
const network::CellularMutationOffer& offer) {
return impl_->send_to_v10_owner(account, offer);
}
void RegionSessions::clear_cellular_perceptions(std::uint64_t tick) {