Route cellular perception to its owner
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 53s
Foundation / checks (tsan) (push) Failing after 34s
Foundation / checks (network) (push) Failing after 3m0s
Foundation / checks (client) (push) Failing after 4m27s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-11 01:08:03 -04:00
parent 5419a579e8
commit 27778def2c
8 changed files with 124 additions and 16 deletions
+22 -1
View File
@@ -25,7 +25,8 @@
namespace evo::server_app {
// Profile-4 network boundary. Biology and persistence remain owned by the cellular host;
// this bridge handles admission, v7 action receipts and read-only replicated cell views.
// this bridge handles admission, v7/v8 action receipts, public cell replication and
// owner-filtered v8 perception.
class CellularBridge {
public:
static std::optional<CellularBridge>
@@ -167,6 +168,26 @@ class CellularBridge {
return result;
};
sessions_->replicate(tick, source);
sessions_->clear_cellular_perceptions(tick);
for (const auto& life : state.lives()) {
const auto perceived = state.perceive(life.identity.life);
if (!perceived)
continue;
network::CellularPerception view;
view.tick = tick;
view.life_identity = life.identity.life;
view.patches.reserve(perceived->size());
for (const auto& patch : *perceived) {
network::CellularPerceivedPatch visible;
visible.x_um = patch.address.x_um;
visible.y_um = patch.address.y_um;
visible.energy_pj = patch.available.energy.value;
for (std::size_t i = 0; i < visible.matter_fg.size(); ++i)
visible.matter_fg[i] = patch.available.matter[i].value;
view.patches.push_back(visible);
}
(void)sessions_->send_cellular_perception(network::AccountId{life.account}, view);
}
replicated_tick_ = tick;
}
void shutdown() {