From 44e748f055363a83bd3aaa1bc96807e032c47dd0 Mon Sep 17 00:00:00 2001 From: dingo Date: Fri, 16 Oct 2026 13:36:35 -0400 Subject: [PATCH] M11-PT-001: name the owner's refusal when a cellular tick stalls The session batch builder reported every refusal of the owner's own step or restore as "biology", which cannot tell a resume problem from any other. It now keeps the CellularLivesError behind that, and the stall line prints it as lives=N (-1 when the refusal was not the owner's). Co-Authored-By: Claude Opus 5.5 --- apps/evo-server/main.cpp | 10 ++++++---- .../kubernetes/region/dev-session-route/listener.yaml | 2 +- include/evo/server/cellular_session_batch.hpp | 6 ++++++ src/server/session/cellular_session_batch.cpp | 11 +++++++++-- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/apps/evo-server/main.cpp b/apps/evo-server/main.cpp index 9f4a60b..ecd295e 100644 --- a/apps/evo-server/main.cpp +++ b/apps/evo-server/main.cpp @@ -932,13 +932,13 @@ int serve_cellular(Options& o) { // A tick that cannot be built is retried every 50 ms; name each distinct cause once. std::optional> stalled; const auto report_stall = [&](std::string_view where, server::CellularSessionBatchError error, - std::uint64_t tick) { + std::uint64_t tick, int lives_error = -1) { if (stalled && stalled->first == where && stalled->second == error) return; stalled.emplace(where, error); - std::printf("cellular tick stalled tick=%llu at=%.*s error=%u\n", + std::printf("cellular tick stalled tick=%llu at=%.*s error=%u lives=%d\n", static_cast(tick), static_cast(where.size()), - where.data(), static_cast(error)); + where.data(), static_cast(error), lives_error); }; const auto set_ready = [&](bool now) { if (ready != now) { @@ -1129,7 +1129,9 @@ int serve_cellular(Options& o) { tick, baseline, actions, held_births, host.queued_mutations()); } if (!appended) { - report_stall("append", appended.error(), tick); + const auto lives = builder->last_lives_error(); + report_stall("append", appended.error(), tick, + lives ? static_cast(*lives) : -1); bridge->dropped(actions, true); } else { stalled.reset(); diff --git a/deploy/kubernetes/region/dev-session-route/listener.yaml b/deploy/kubernetes/region/dev-session-route/listener.yaml index 2039429..b11a582 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-20261016T153552-98691:1792175752"} + - {name: REGION_SESSION_WINDOW, value: "dev-20261016T173635-64851:1792182995"} - {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"} ports: # QUIC (ADR-0090): UDP only; nothing listens on TCP 7400. diff --git a/include/evo/server/cellular_session_batch.hpp b/include/evo/server/cellular_session_batch.hpp index a7b9ad8..2a5c2be 100644 --- a/include/evo/server/cellular_session_batch.hpp +++ b/include/evo/server/cellular_session_batch.hpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,10 @@ class CellularSessionBatchBuilder { [[nodiscard]] const CellularLives& candidate() const noexcept { return *working_; } + // The owner's own refusal behind the last `biology` error, for operator logs. + [[nodiscard]] std::optional last_lives_error() const noexcept { + return last_lives_error_; + } private: [[nodiscard]] std::expected @@ -96,5 +101,6 @@ class CellularSessionBatchBuilder { std::vector actions_; std::vector mutation_actions_; std::vector refused_births_; + std::optional last_lives_error_; }; } // namespace evo::server diff --git a/src/server/session/cellular_session_batch.cpp b/src/server/session/cellular_session_batch.cpp index 594d055..189ce8d 100644 --- a/src/server/session/cellular_session_batch.cpp +++ b/src/server/session/cellular_session_batch.cpp @@ -234,9 +234,16 @@ std::expected CellularSessionBatchBuilder::appe auto next = CellularLives::restore(working_->snapshot(), working_->world(), working_->region(), working_->frame(), working_->tick()); - if (!next || - !(*next)->advance_tick_with_mutations(prepared->intents.lives, prepared->intents.mutations)) + if (!next) { + last_lives_error_ = next.error(); return std::unexpected{CellularSessionBatchError::biology}; + } + if (const auto advanced = (*next)->advance_tick_with_mutations(prepared->intents.lives, + prepared->intents.mutations); + !advanced) { + last_lives_error_ = advanced.error(); + return std::unexpected{CellularSessionBatchError::biology}; + } std::vector accepted_births; std::vector refused_births;