Deliver cellular tick diagnostics to owners
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (postgres) (push) Failing after 52s
Foundation / checks (tsan) (push) Failing after 33s
Foundation / checks (network) (push) Failing after 3m1s
Foundation / checks (client) (push) Failing after 4m30s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-11 02:04:55 -04:00
parent fe03a0f8e4
commit ab9fbdec8f
16 changed files with 408 additions and 188 deletions
+44 -2
View File
@@ -25,8 +25,8 @@
namespace evo::server_app {
// Profile-4 network boundary. Biology and persistence remain owned by the cellular host;
// this bridge handles admission, v7/v8 action receipts, public cell replication and
// owner-filtered v8 perception.
// this bridge handles admission, v7-v9 action receipts, public cell replication and
// owner-filtered v8/v9 perception.
class CellularBridge {
public:
static std::optional<CellularBridge> open(const M10Options& options,
@@ -177,6 +177,48 @@ class CellularBridge {
network::CellularPerception view;
view.tick = tick;
view.life_identity = life.identity.life;
network::CellularLifeDiagnostics diagnostics;
diagnostics.reserve_energy_pj = life.reserve.energy.value;
for (std::size_t i = 0; i < diagnostics.reserve_matter_fg.size(); ++i)
diagnostics.reserve_matter_fg[i] = life.reserve.matter[i].value;
const auto feedback =
std::ranges::lower_bound(state.last_tick_feedback(), life.identity.life, {},
&server::CellularLifeTickFeedback::life_id);
if (feedback != state.last_tick_feedback().end() &&
feedback->life_id == life.identity.life && feedback->tick == tick) {
diagnostics.has_tick_effects = true;
diagnostics.maintenance_cost_pj = feedback->maintenance_cost.value;
diagnostics.movement_cost_pj = feedback->movement_cost.value;
switch (feedback->movement) {
case biology::CellularMovementStatus::not_requested:
diagnostics.movement = network::CellularMovementResult::no_movement;
break;
case biology::CellularMovementStatus::moved:
diagnostics.movement = network::CellularMovementResult::moved;
break;
case biology::CellularMovementStatus::blocked:
diagnostics.movement = network::CellularMovementResult::blocked;
break;
case biology::CellularMovementStatus::insufficient_reserve:
diagnostics.movement = network::CellularMovementResult::insufficient_energy;
break;
}
switch (feedback->intake) {
case biology::CellularIntakeStatus::not_requested:
diagnostics.intake = network::CellularIntakeResult::not_requested;
break;
case biology::CellularIntakeStatus::acquired:
diagnostics.intake = network::CellularIntakeResult::acquired;
break;
case biology::CellularIntakeStatus::missing:
diagnostics.intake = network::CellularIntakeResult::missing_patch;
break;
case biology::CellularIntakeStatus::out_of_contact:
diagnostics.intake = network::CellularIntakeResult::out_of_contact;
break;
}
}
view.diagnostics = diagnostics;
view.patches.reserve(perceived->size());
for (const auto& patch : *perceived) {
network::CellularPerceivedPatch visible;