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
+14
View File
@@ -29,6 +29,7 @@ struct RegionSessionClient::Impl {
std::vector<network::PrimitiveLifeOutcome> primitive_life_outcomes;
std::optional<network::SnapshotAssembler> snapshots;
std::optional<network::CellularPerception> cellular_perception;
std::optional<network::CellularMutationOffer> mutation_offer;
std::uint64_t snapshot_chunks{}, snapshot_bytes{};
std::optional<network::HandoffOffer> handoff; // v4: continue at another region.
std::optional<network::RegionAddress> redirect; // v4: the probe is owned elsewhere.
@@ -146,6 +147,14 @@ struct RegionSessionClient::Impl {
cellular_perception = *m;
return;
}
if (const auto* m = std::get_if<network::CellularMutationOffer>(&*decoded)) {
seen_tick(m->tick);
if (m->candidates.empty())
mutation_offer.reset();
else
mutation_offer = *m;
return;
}
if (const auto* m = std::get_if<network::PrimitiveLifeReceipt>(&*decoded)) {
seen_tick(m->server_tick);
return keep(primitive_life_receipts, *m);
@@ -381,6 +390,11 @@ RegionSessionClient::cellular_perception() const noexcept {
return impl_->cellular_perception;
}
const std::optional<network::CellularMutationOffer>&
RegionSessionClient::mutation_offer() const noexcept {
return impl_->mutation_offer;
}
std::expected<client::EnvironmentPresentation, client::ViewError>
RegionSessionClient::environment() const {
const auto& snapshots = impl_->snapshots;