Add M10.4a intentions, actions and admission
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m45s
Foundation / checks (network) (push) Successful in 9m37s
Foundation / checks (client) (push) Successful in 12m14s
Foundation / checks (tsan) (push) Successful in 7m39s
Foundation / checks (checks) (push) Successful in 31m15s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 32m59s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m45s
Foundation / checks (network) (push) Successful in 9m37s
Foundation / checks (client) (push) Successful in 12m14s
Foundation / checks (tsan) (push) Successful in 7m39s
Foundation / checks (checks) (push) Successful in 31m15s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 32m59s
Session protocol v1 (not yet deployed, amended in place) gains realtime intentions on datagrams with receipts and a cumulative simulated watermark, and account-scoped actions with stable ids, receipts, final outcomes and queries. IntentAdmission enforces session binding, rate, authority, epoch, vector, sequence, tick window, duplicates and the unresolved bound; RegionSessions and the client carry it over QUIC. Intentions and actions have no biological effect yet. ADR-0092. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,13 +6,16 @@
|
||||
#include <expected>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <vector>
|
||||
|
||||
// M10.3b client-side session login over QUIC (ADR-0091, schemas/network/session-v1.md).
|
||||
// Owned by one thread, which calls poll(). Sends Hello with the grant once the pinned
|
||||
// connection is up (then forgets the grant), waits for Welcome or Close, and can renew
|
||||
// the session in place with a newer grant. A Close from the server, a malformed message,
|
||||
// the Welcome deadline or a lost transport ends the session; reconnecting needs a new
|
||||
// client and a fresh grant (ADR-0089). Intentions and views are later segments.
|
||||
// client and a fresh grant (ADR-0089). M10.4 (ADR-0092): intentions as datagrams with
|
||||
// receipts and a simulated watermark; actions with stable ids, receipts and final outcomes.
|
||||
// The client never treats a receipt or the watermark as a final outcome. Views are 10.5.
|
||||
namespace evo::client {
|
||||
struct RegionSessionClientConfig {
|
||||
network::quic::ClientConfig transport;
|
||||
@@ -36,6 +39,22 @@ class RegionSessionClient {
|
||||
[[nodiscard]] std::optional<network::SessionRefreshResult> take_refresh_result();
|
||||
// Sends Close{client_closed} and closes the connection.
|
||||
void close();
|
||||
// Realtime intention for `tick` (server_tick + 1 ..= + 8); returns its sequence, or
|
||||
// nothing unless established and sent. Datagrams may be lost: no receipt is not a refusal.
|
||||
[[nodiscard]] std::optional<std::uint64_t>
|
||||
send_intention(std::uint64_t tick, std::int16_t move_x, std::int16_t move_y);
|
||||
// A discrete action with a caller-chosen id, unique for the account (stable across
|
||||
// retries and reconnects). False unless established and sent.
|
||||
[[nodiscard]] bool send_action(std::uint64_t action_id, network::ActionKind kind,
|
||||
std::uint64_t tick);
|
||||
[[nodiscard]] bool query_action(std::uint64_t action_id);
|
||||
[[nodiscard]] std::vector<network::IntentionReceipt> take_intention_receipts();
|
||||
[[nodiscard]] std::vector<network::ActionReceipt> take_action_receipts();
|
||||
[[nodiscard]] std::vector<network::ActionOutcome> take_action_outcomes();
|
||||
// Newest simulated watermark of this session's epoch.
|
||||
[[nodiscard]] std::optional<network::SimulatedThrough> simulated() const noexcept;
|
||||
// Latest server tick seen (Welcome, receipts, watermarks); 0 before Welcome.
|
||||
[[nodiscard]] std::uint64_t server_tick() const noexcept;
|
||||
[[nodiscard]] RegionSessionState state() const noexcept;
|
||||
[[nodiscard]] const std::optional<network::SessionWelcome>& welcome() const noexcept;
|
||||
[[nodiscard]] std::optional<network::SessionCloseReason> close_reason() const noexcept;
|
||||
|
||||
Reference in New Issue
Block a user