From 9c84c8f5b459e9527c0db54acfca91e8d6c46f55 Mon Sep 17 00:00:00 2001 From: dingo Date: Sun, 11 Oct 2026 00:52:51 -0400 Subject: [PATCH] Allow cellular spawn and actions together --- docs/engineering/M11_3_DELIVERY_PLAN.md | 5 +++ docs/engineering/VALIDATION.md | 12 +++++++ include/evo/server/region_sessions.hpp | 2 ++ src/server/session/region_sessions.cpp | 5 ++- tests/quic_sessions.cpp | 44 +++++++++++++++++++++++++ 5 files changed, 65 insertions(+), 3 deletions(-) diff --git a/docs/engineering/M11_3_DELIVERY_PLAN.md b/docs/engineering/M11_3_DELIVERY_PLAN.md index fd90d4c..dfae171 100644 --- a/docs/engineering/M11_3_DELIVERY_PLAN.md +++ b/docs/engineering/M11_3_DELIVERY_PLAN.md @@ -333,6 +333,11 @@ scoped change before starting the next segment. leaves the builder unchanged. Tests cover empty-region birth replay and duplicate request refusal. The server still needs to route v5 requests into this queue and run/publish the scheduler tick. +- 11.3d-7k: region sessions can now enable the reliable v5 life-request + callbacks and v7 cellular action ledger together. Admission remains per + negotiated connection; unsupported v5/v6/v7 modes still fail closed. QUIC + coverage opens v5 and v7 clients against one configured region session host. + The callbacks are not yet wired to `CellularRegionHost` or the scheduler. ## Exit boundary diff --git a/docs/engineering/VALIDATION.md b/docs/engineering/VALIDATION.md index 0fa0c6c..b1d66cd 100644 --- a/docs/engineering/VALIDATION.md +++ b/docs/engineering/VALIDATION.md @@ -6452,3 +6452,15 @@ The focused session-batch executable was manually compiled and run with GCC sanitizers and CI are pending. The existing unrelated initializer warning in `cellular_region_step.cpp:29` is demoted for these manual builds. This builder is not yet wired into an `evo-server` cellular tick loop. + +## 2026-10-11 — M11.3d-7k v5/v7 session admission + +The region session host can now admit v5 life requests and v7 cellular actions +in the same configuration. A v5 connection remains v5; a v7 connection carries +reliable cellular actions. The QUIC session test covers both clients logged in +at one host and confirms a spawn response plus a carried cellular action. + +GCC 13.2 strict-warning syntax checks pass for `region_sessions.cpp` and +`tests/quic_sessions.cpp`; `git diff --check` passes. QUIC runtime tests, the +full network preset, and CI remain pending. No wire layout changed in this +subsection. diff --git a/include/evo/server/region_sessions.hpp b/include/evo/server/region_sessions.hpp index 6cfbcf1..4ea1bcb 100644 --- a/include/evo/server/region_sessions.hpp +++ b/include/evo/server/region_sessions.hpp @@ -94,6 +94,8 @@ struct RegionSessionsConfig { std::chrono::milliseconds overdue_poll{5000}; // v5 is accepted only when both primitive-life handlers are supplied. Callbacks // receive the authenticated account and durable control generation for this session. + // A cellular host may enable v5 together with the v7 cellular action path; each + // connection remains fixed to its negotiated protocol. std::function create_primitive_life; diff --git a/src/server/session/region_sessions.cpp b/src/server/session/region_sessions.cpp index 274c7a0..70ae210 100644 --- a/src/server/session/region_sessions.cpp +++ b/src/server/session/region_sessions.cpp @@ -562,7 +562,7 @@ struct RegionSessions::Impl { const bool primitive_v5 = static_cast(config.create_primitive_life); const bool cellular_v6 = config.accept_cellular_intentions; const bool cellular_v7 = config.accept_cellular_actions; - if ((primitive_v5 && wire_version != network::session_protocol_v5) || + if ((primitive_v5 && wire_version < network::session_protocol_v5) || (wire_version == network::session_protocol_v5 && !primitive_v5) || (wire_version == network::session_protocol_v6 && !cellular_v6) || (wire_version == network::session_protocol_v7 && !cellular_v7) || @@ -649,8 +649,7 @@ RegionSessions::create(RegionSessionsConfig config) { (!config.create_primitive_life || !config.query_primitive_life || !config.ledger)) || (config.accept_cellular_intentions && config.create_primitive_life) || (config.accept_cellular_actions && - (!config.actions || !config.ledger || config.create_primitive_life || - config.accept_cellular_intentions)) || + (!config.actions || !config.ledger || config.accept_cellular_intentions)) || config.transport.limits.max_connections < config.control.max_sessions || config.hello_deadline.count() <= 0 || config.close_flush.count() <= 0 || config.renew_interval.count() <= 0 || config.safety_margin.count() <= 0 || diff --git a/tests/quic_sessions.cpp b/tests/quic_sessions.cpp index c941356..976e7b0 100644 --- a/tests/quic_sessions.cpp +++ b/tests/quic_sessions.cpp @@ -563,6 +563,49 @@ void cellular_v7_action_session(const Files& f) { unsupported->close_reason() == SessionCloseReason::unsupported_version); } +void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) { + struct Actions final : ActionLedger { + std::expected, ActionLedgerError> + find(const AccountId&, std::uint64_t) override { + return std::optional{}; + } + std::expected, ActionLedgerError> + find_record(const AccountId&, std::uint64_t) override { + return std::optional{}; + } + } actions; + FakeLedger control; + Harness h{f, 4, 64, &control, [&](server::RegionSessionsConfig& c) { + c.actions = &actions; + c.accept_cellular_actions = true; + c.create_primitive_life = [](const AccountId&, std::uint64_t, + std::uint64_t request) { + return PrimitiveLifeOutcome{request, PrimitiveLifeResult::born, 901, 5}; + }; + c.query_primitive_life = [](const AccountId&, std::uint64_t, + std::uint64_t request) { + return PrimitiveLifeOutcome{request, PrimitiveLifeResult::pending, 0, 0}; + }; + }}; + auto spawn_client = h.connect(h.issuer.grant(account(0xB5), 1), session_protocol_v5); + auto action_client = h.connect(h.issuer.grant(account(0xB7), 1), session_protocol_v7); + CHECK(h.settled(*spawn_client) && spawn_client->state() == RegionSessionState::established); + CHECK(h.settled(*action_client) && action_client->state() == RegionSessionState::established); + + CHECK(spawn_client->request_primitive_life(44)); + std::vector birth_outcomes; + CHECK(h.until([&] { return !(birth_outcomes = spawn_client->take_primitive_life_outcomes()).empty(); })); + CHECK(birth_outcomes.front() == PrimitiveLifeOutcome{44, PrimitiveLifeResult::born, 901, 5}); + + CHECK(action_client->send_cellular_action(55, 101, 0, 0)); + std::vector receipts; + CHECK(h.until([&] { return !(receipts = action_client->take_action_receipts()).empty(); })); + CHECK(receipts.front().status == AdmitStatus::admitted); + const auto carried = h.server->carry(101); + CHECK(carried.size() == 1 && carried.front().account == account(0xB7) && + carried.front().kind == ActionKind::cellular); +} + // M10.4: intentions, actions and their distinct answers against a simulated host. void intentions_and_actions(const Files& f) { Harness h{f}; @@ -1388,6 +1431,7 @@ int main() try { primitive_v5_session(files); cellular_v6_session(files); cellular_v7_action_session(files); + cellular_v5_spawn_and_v7_action_share_region_sessions(files); limits(files); durable_control(files); intentions_and_actions(files);