Add M10.5b snapshot wiring: sessions, evo-server, client and probe
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m54s
Foundation / checks (client) (push) Successful in 12m40s
Foundation / checks (network) (push) Successful in 11m27s
Foundation / checks (tsan) (push) Successful in 8m6s
Foundation / checks (checks) (push) Successful in 31m54s
Foundation / checks (postgres) (push) Successful in 40m43s
Foundation / server-image (push) Successful in 25s
Foundation / postgres-tools (push) Successful in 1m2s
Foundation / image (push) Successful in 2m32s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m54s
Foundation / checks (client) (push) Successful in 12m40s
Foundation / checks (network) (push) Successful in 11m27s
Foundation / checks (tsan) (push) Successful in 8m6s
Foundation / checks (checks) (push) Successful in 31m54s
Foundation / checks (postgres) (push) Successful in 40m43s
Foundation / server-image (push) Successful in 25s
Foundation / postgres-tools (push) Successful in 1m2s
Foundation / image (push) Successful in 2m32s
RegionSessions owns the replication server: interest and acks per session, a host-set default interest, and per-tick snapshots sized to each connection's datagram limit. evo-server builds each interest's view from the region's own habitat sites (default: the first site, radius 7). RegionSessionClient assembles, acknowledges and presents snapshots and can change its interest; the probe prints them. Loopback and real-process evidence. ADR-0093. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
#include "evo/network/intent_admission.hpp"
|
||||
#include "evo/network/quic_transport.hpp"
|
||||
#include "evo/network/replication.hpp"
|
||||
#include "evo/network/session_control.hpp"
|
||||
#include "evo/network/session_grant.hpp"
|
||||
#include "evo/network/session_protocol.hpp"
|
||||
@@ -25,6 +26,9 @@
|
||||
// IntentAdmission answers with receipts, simulated watermarks and final action outcomes.
|
||||
// The host reports its authority each poll, takes carried actions for its batches and
|
||||
// reports durable commits.
|
||||
// M10.5 (ADR-0093): every established session has a spatial interest (the default set by
|
||||
// the host until the client sends its own); the host calls replicate() once per simulated
|
||||
// tick and each session receives its snapshot chunks as datagrams sized to its path.
|
||||
// With a ControlLedger, control is durable and unique per world: a session that loses its
|
||||
// durable control (another region accepted a newer grant) closes with `superseded`, and
|
||||
// one whose control cannot be renewed in time closes with `shutdown`.
|
||||
@@ -48,6 +52,7 @@ struct RegionSessionsConfig {
|
||||
network::IntentLimits intents{}; // max_sessions follows control.max_sessions.
|
||||
// Durable action records (10.4b), owned by the host; null keeps outcomes in memory only.
|
||||
network::ActionLedger* actions{};
|
||||
network::ReplicationLimits replication{}; // max_sessions follows control.max_sessions.
|
||||
};
|
||||
// The region host's authority, read once per poll.
|
||||
struct HostFacts {
|
||||
@@ -83,6 +88,16 @@ class RegionSessions {
|
||||
// The host dropped these carried actions: final ones are reported not_committed; the
|
||||
// others await their durable record (their batch outcome was unknown).
|
||||
void dropped(std::span<const network::CarriedAction> actions, bool final);
|
||||
// Interest given to each new session until it sends its own (none: no snapshots until it
|
||||
// does). Sessions already open without an interest receive it too.
|
||||
void set_default_interest(network::SessionInterest interest);
|
||||
// Sends every interested session its snapshot for `tick` (call once per simulated tick).
|
||||
// `source` reads the host's state for one interest; `perceives` hides organisms.
|
||||
void replicate(
|
||||
std::uint64_t tick,
|
||||
const std::function<network::ReplicationSource(const network::SessionInterest&)>& source,
|
||||
const network::Perceives& perceives = {});
|
||||
[[nodiscard]] network::ReplicationStats replication_stats() const;
|
||||
// Closes every connection with `shutdown` (flushed by later polls).
|
||||
void shutdown(std::chrono::steady_clock::time_point now);
|
||||
[[nodiscard]] std::vector<RegionSessionEvent> take_events();
|
||||
|
||||
Reference in New Issue
Block a user