Schedule v7 cellular actions with exact retries
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 38s
Foundation / checks (ecs) (push) Successful in 1m54s
Foundation / checks (postgres) (push) Failing after 52s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / checks (network) (push) Failing after 3m3s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 3m59s

This commit is contained in:
dingo
2026-10-10 23:07:34 -04:00
parent 08519b66af
commit db466618a6
6 changed files with 198 additions and 42 deletions
+21 -4
View File
@@ -45,11 +45,14 @@ struct CarriedAction {
AccountId account;
std::uint64_t action_id{}, tick{};
ActionKind kind{};
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input;
friend bool operator==(const CarriedAction&, const CarriedAction&) = default;
};
struct AccountOutcome {
AccountId account;
ActionOutcome outcome;
ActionKind kind{ActionKind::probe};
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input;
};
struct ScheduledCellularIntention {
AccountId account;
@@ -123,11 +126,17 @@ class IntentAdmission {
scheduled_cellular_intentions(std::uint64_t tick) const;
[[nodiscard]] ActionReceipt action(std::uint64_t session, const SessionAction& m,
const AdmissionFacts& facts);
// v7 path retains canonical biological bytes through scheduling and refuses a reused
// account/action id whose input differs, including a final action still in memory.
[[nodiscard]] ActionReceipt action(std::uint64_t session, const CellularAction& m,
const AdmissionFacts& facts);
// The same admission with the durable uniqueness check deferred (M10.9d): nothing when the
// action awaits `verify`, which confirms every waiting action with one ledger request and
// returns their receipts by session. Without a ledger, `admit` always answers at once.
[[nodiscard]] std::optional<ActionReceipt> admit(std::uint64_t session, const SessionAction& m,
const AdmissionFacts& facts);
[[nodiscard]] std::optional<ActionReceipt> admit(std::uint64_t session, const CellularAction& m,
const AdmissionFacts& facts);
[[nodiscard]] std::vector<std::pair<std::uint64_t, ActionReceipt>>
verify(const AdmissionFacts& facts);
// An action of the session's account: final, pending or unknown. With a ledger, an action
@@ -188,19 +197,27 @@ class IntentAdmission {
struct Found {
Record state{Record::unavailable};
ActionOutcome outcome;
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input;
};
[[nodiscard]] Found lookup(const AccountId& account, std::uint64_t action_id) const;
// The in-memory checks of an action; `check` is set when only the ledger can still
// refuse it.
[[nodiscard]] ActionReceipt screen(Session& s, const SessionAction& m,
const AdmissionFacts& facts, bool& check);
[[nodiscard]] ActionReceipt screen(
Session& s, const SessionAction& m, const AdmissionFacts& facts, bool& check,
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input =
std::nullopt);
// Applies a durable answer to a receipt that passed `screen`.
void decide(const AccountId& account, ActionReceipt& r, const Found& found);
void decide(const AccountId& account, ActionReceipt& r, const Found& found,
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input =
std::nullopt);
Session* find(std::uint64_t session);
const Session* find(std::uint64_t session) const;
void count_window(Session& s, std::uint64_t server_tick) const;
[[nodiscard]] std::size_t unresolved_of(const Session& s) const;
void remember(const AccountId& account, const ActionOutcome& outcome);
void remember(const AccountId& account, const ActionOutcome& outcome,
ActionKind kind = ActionKind::probe,
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>>
cellular_input = std::nullopt);
IntentLimits limits_;
std::vector<Session> sessions_;
std::vector<Action> actions_;