#pragma once #include #include #include // M9.8c bounded intention history for the session panel (toolkit-independent). It is // the inspectable record; notifications may expire, this keeps the latest entries. // Values are copied from session events; nothing here is authority. namespace evo::client { enum class OutcomeState : std::uint8_t { sent, // Queued to the server; no reply yet. admitted, // Accepted for scheduling; not yet simulated or durable. rejected, // IntentResult other than admitted (final). durable, // Committed with no biological effect (final). not_committed, // The carrying input was dropped (final). unknown, // The connection ended first; the outcome is not known (final). simulated // M10 realtime intention: the region simulated its tick (final; never // durable, ADR-0092). }; struct OutcomeEntry { std::uint64_t sequence{}; OutcomeState state{}; std::uint8_t detail{}; // IntentStatus code for rejections. std::uint64_t tick{}, commit_sequence{}; // Intended/simulated tick; commit when durable. }; class OutcomeLog { public: static constexpr std::size_t capacity = 64; // Updates the entry for `sequence` (newest match) or appends one, evicting the oldest. void record(OutcomeEntry entry); [[nodiscard]] const std::deque& entries() const noexcept { return entries_; } [[nodiscard]] std::uint64_t evicted() const noexcept { return evicted_; } private: std::deque entries_; std::uint64_t evicted_{}; }; } // namespace evo::client