From 3548f2eacf6359ac34879ed21ba4430d01b4bc0d Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 11 Oct 2026 04:40:44 -0400 Subject: [PATCH] Fix run 252 static and session checks --- docs/engineering/VALIDATION.md | 10 ++++++++++ src/server/session/region_sessions.cpp | 2 +- tests/cellular_intent_protocol_tests.cpp | 2 +- tests/cellular_step_tests.cpp | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 91d7307..0fba7c9 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6753,3 +6753,13 @@ executables, and the negative test uses unsupported version 10. Run 250's network test job failed on the stale expectation; the two omitted tests were not run because their executables were absent. Follow-up CI is required to confirm the corrected gate. + +Run 252 exercised the repaired network preset, then found three compiler gates +outside the earlier test: clang-tidy reported an optional dereference in the +cellular-step test and a signed-width multiplication in the cellular-perception +protocol assertion; GCC 14 reported a missing diagnostics-field initializer in +the session server's cleared-perception record. The test accesses now use an +explicit optional value accessor after the checked guard, the size expression +widens before multiplication, and the cleared record initializes all fields. +Windows Debug owner/step tests, protocol test, session-server target build and +format check passed locally. Full CI follow-up is pending. diff --git a/src/server/session/region_sessions.cpp b/src/server/session/region_sessions.cpp index b71cc42..ff0fdb1 100644 --- a/src/server/session/region_sessions.cpp +++ b/src/server/session/region_sessions.cpp @@ -902,7 +902,7 @@ void RegionSessions::clear_cellular_perceptions(std::uint64_t tick) { if (tick == 0) return; auto& m = *impl_; - const network::CellularPerception cleared{tick, 0, {}}; + const network::CellularPerception cleared{tick, 0, {}, {}}; for (const auto& c : m.connections) if (c.state == Impl::State::established && (c.protocol_version == network::session_protocol_v8 || diff --git a/tests/cellular_intent_protocol_tests.cpp b/tests/cellular_intent_protocol_tests.cpp index a03f4ed..9411f36 100644 --- a/tests/cellular_intent_protocol_tests.cpp +++ b/tests/cellular_intent_protocol_tests.cpp @@ -120,7 +120,7 @@ void v8_perception_is_bounded_and_canonical() { const CellularPerception perception{ 19, 42, {{1'000, 2'000, 3, {4, 5, 6, 7}}, {1'000, 3'000, 8, {9, 10, 11, 12}}}}; const auto bytes = encode_session(SessionMessage{perception}); - CHECK(!bytes.empty() && bytes.size() == session_header_bytes + 18 + 2 * 48); + CHECK(!bytes.empty() && bytes.size() == session_header_bytes + 18 + std::size_t{2} * 48); std::uint16_t version{}; const auto decoded = decode_session(bytes, &version); CHECK(decoded && version == session_protocol_v8); diff --git a/tests/cellular_step_tests.cpp b/tests/cellular_step_tests.cpp index 3758876..a485c8e 100644 --- a/tests/cellular_step_tests.cpp +++ b/tests/cellular_step_tests.cpp @@ -50,7 +50,7 @@ void maintenance_motion_and_intake_conserve_one_tick() { CHECK(step->reserve_after == Inventory{{195}, {{{5}, {2}, {1}, {0}}}}); if (step->intake_status != CellularIntakeStatus::acquired || !step->intake) throw std::runtime_error("cellular step intake missing"); - const auto& intake = *step->intake; + const auto& intake = step->intake.value(); CHECK(intake.transfer.patch_after == Inventory{{950}, {{{15}, {8}, {4}, {2}}}}); CHECK(reserve.energy.value == 200 && heat.energy.value == 0); CHECK(map->patches()[0].stock == Inventory{{1'000}, {{{20}, {10}, {5}, {2}}}});