From a820ff0984b7d6f58ffc941f66a506207d6f593a Mon Sep 17 00:00:00 2001 From: dingo Date: Fri, 16 Oct 2026 09:11:41 -0400 Subject: [PATCH] M11-PT-001: read v10 perceptions from servers built before the bud cost The bud cost (d98d71e) grew the v10 cellular perception prefix from 82 to 122 bytes without a version bump. A rebuilt client connected to the live DEV region (server 3e5b8cef, older) refused every perception as wrong_length, closed the session as a protocol error and reconnected; each reconnect's birth request answered existing_life and no view ever arrived ("Existing cell is already bound to this account"). The decoder now also accepts the earlier v10 layout, with no bud cost. The two lengths never coincide (40 bytes is not a whole 48-byte patch). The client already hides a zero bud cost. Co-Authored-By: Claude Opus 5.5 --- .../region/dev-session-route/listener.yaml | 2 +- .../2026-10-16_M11_9_SOLO_FEEDBACK.md | 22 ++++++++++++++++ src/network/protocol/session_protocol.cpp | 25 +++++++++++++------ tests/cellular_intent_protocol_tests.cpp | 18 +++++++++++++ 4 files changed, 58 insertions(+), 9 deletions(-) diff --git a/deploy/kubernetes/region/dev-session-route/listener.yaml b/deploy/kubernetes/region/dev-session-route/listener.yaml index 086140d..d5ffb63 100644 --- a/deploy/kubernetes/region/dev-session-route/listener.yaml +++ b/deploy/kubernetes/region/dev-session-route/listener.yaml @@ -12,7 +12,7 @@ spec: env: - {name: REGION_SESSION, value: "dev"} - {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"} - - {name: REGION_SESSION_WINDOW, value: "dev-20261016T125355-89029:1792166035"} + - {name: REGION_SESSION_WINDOW, value: "dev-20261016T131141-14531:1792167101"} - {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"} ports: # QUIC (ADR-0090): UDP only; nothing listens on TCP 7400. diff --git a/docs/playtests/2026-10-16_M11_9_SOLO_FEEDBACK.md b/docs/playtests/2026-10-16_M11_9_SOLO_FEEDBACK.md index 0868e05..90d7edb 100644 --- a/docs/playtests/2026-10-16_M11_9_SOLO_FEEDBACK.md +++ b/docs/playtests/2026-10-16_M11_9_SOLO_FEEDBACK.md @@ -60,6 +60,28 @@ No deployment, database mutation or runtime fix was performed for this note. `kubectl config current-context` reports that no current context is set in this workspace, so live DEV logs/state were unavailable for confirming these candidates. +### Follow-up diagnosis (2026-10-16, region 5) + +The retest reproduced the message against live region 5. Read-only checks showed: + +- The life was born and active: `living owned=1`, `lingering=0`, `suspended=0`, and the + reservation was open, born at tick 1. +- Later relaunches only added refused birth requests. + +So neither placement nor resume was blocking. The cause was a wire mismatch: + +- The live server image (`3e5b8cef…`) predates the bud-cost change (d98d71e). That change + grew the v10 perception prefix from 82 to 122 bytes without a version bump. +- A rebuilt client therefore refused every perception as `wrong_length`, closed the + session as a protocol error and reconnected. +- On each reconnect the birth request got `existing_life` again, and no view ever arrived. + +The decoder now also accepts the earlier v10 layout, which carries no bud cost. The two +lengths can never coincide, because 40 bytes is not a whole 48-byte patch. + +This explains the reproduced case only. The first report predates d98d71e, and its +cause remains unconfirmed. + ## Retest backlog | Local issue | Priority / scope | Acceptance evidence | diff --git a/src/network/protocol/session_protocol.cpp b/src/network/protocol/session_protocol.cpp index d210510..5887bfa 100644 --- a/src/network/protocol/session_protocol.cpp +++ b/src/network/protocol/session_protocol.cpp @@ -704,13 +704,20 @@ std::expected decode_session(std::span(get(payload, 16, 2)); + // A v10 server built before the bud cost (ADR-0129 amendment) sends the v9-sized + // prefix; the lengths never coincide (40 bytes is not a whole patch), so a rebuilt + // client still reads its views, with no bud cost (M11-PT-001). + const bool without_bud_cost = wire_version == session_protocol_v10 && + payload.size() == cellular_perception_v9_prefix_bytes + + count * cellular_perceived_patch_bytes; + const auto prefix = wire_version == session_protocol_v10 && !without_bud_cost + ? cellular_perception_v10_prefix_bytes + : wire_version == session_protocol_v9 || without_bud_cost + ? cellular_perception_v9_prefix_bytes + : cellular_perception_prefix_bytes; if (count > max_cellular_perceived_patches || payload.size() != prefix + count * cellular_perceived_patch_bytes) return std::unexpected(SessionCodecError::wrong_length); @@ -739,9 +746,11 @@ std::expected decode_session(std::span(payload[77]); d.bud = static_cast(payload[78]); - d.bud_cost_energy_pj = get(payload, 82, 8); - for (std::size_t channel = 0; channel < d.bud_cost_matter_fg.size(); ++channel) - d.bud_cost_matter_fg[channel] = get(payload, 90 + channel * 8, 8); + if (!without_bud_cost) { + d.bud_cost_energy_pj = get(payload, 82, 8); + for (std::size_t channel = 0; channel < d.bud_cost_matter_fg.size(); ++channel) + d.bud_cost_matter_fg[channel] = get(payload, 90 + channel * 8, 8); + } } d.movement = static_cast(payload[74]); d.intake = static_cast(payload[75]); diff --git a/tests/cellular_intent_protocol_tests.cpp b/tests/cellular_intent_protocol_tests.cpp index ce5abf7..92fac67 100644 --- a/tests/cellular_intent_protocol_tests.cpp +++ b/tests/cellular_intent_protocol_tests.cpp @@ -354,6 +354,24 @@ void v10_effects_and_life_end_are_owner_only() { CHECK(!cleared.empty() && decode_session(cleared)); cleared[session_header_bytes + 90] = 1; // A cleared view with a bud cost. CHECK(!decode_session(cleared)); + // M11-PT-001: a v10 server built before the bud cost sends the 82-byte prefix. A + // rebuilt client still reads those views (no bud cost) instead of closing on them. + auto patched = costed; + patched.patches.push_back({5, 6, 70, {1, 2, 3, 4}}); + auto legacy = encode_session(SessionMessage{patched}, session_protocol_v10); + legacy.erase(legacy.begin() + session_header_bytes + 82, + legacy.begin() + session_header_bytes + 122); + auto expected = patched; + expected.diagnostics->bud_cost_energy_pj = 0; + expected.diagnostics->bud_cost_matter_fg = {}; + const auto legacy_decoded = decode_session(legacy); + CHECK(legacy_decoded && std::get(*legacy_decoded) == expected); + auto legacy_cleared = encode_session( + SessionMessage{CellularPerception{40, 0, {}, std::nullopt}}, session_protocol_v10); + legacy_cleared.resize(session_header_bytes + 82); + CHECK(decode_session(legacy_cleared)); + legacy.pop_back(); // Neither layout's length. + CHECK(!decode_session(legacy)); const CellularLifeEnded ended{41, 7, CellularDeathReason::engulfed}; const auto ended_bytes = encode_session(SessionMessage{ended});