Add input-aware durable action lookup
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 40s
Foundation / checks (ecs) (push) Successful in 1m50s
Foundation / checks (postgres) (push) Failing after 50s
Foundation / checks (tsan) (push) Failing after 31s
Foundation / checks (network) (push) Failing after 3m5s
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 4m22s

This commit is contained in:
dingo
2026-10-10 23:00:42 -04:00
parent a2e5cd5f68
commit c607c032b9
5 changed files with 62 additions and 0 deletions
+15
View File
@@ -68,6 +68,13 @@ struct ActionKey {
AccountId account;
std::uint64_t action_id{};
};
struct DurableActionRecord {
ActionOutcome outcome;
// Present only for cellular actions. This is the canonical 24-byte biological
// input, independent of the session and epoch used to deliver a retry.
std::optional<std::array<std::uint8_t, cellular_action_input_bytes>> cellular_input;
friend bool operator==(const DurableActionRecord&, const DurableActionRecord&) = default;
};
class ActionLedger {
public:
ActionLedger() = default;
@@ -79,6 +86,14 @@ class ActionLedger {
[[nodiscard]] virtual std::expected<std::vector<std::optional<ActionOutcome>>,
ActionLedgerError>
find_all(std::span<const ActionKey> keys);
// Input-aware queries are used by v7 cellular actions. The compatibility
// default preserves legacy ledgers; absence of cellular_input cannot prove
// an exact cellular retry and must be treated as an identity conflict.
[[nodiscard]] virtual std::expected<std::optional<DurableActionRecord>, ActionLedgerError>
find_record(const AccountId& account, std::uint64_t action_id);
[[nodiscard]] virtual std::expected<std::vector<std::optional<DurableActionRecord>>,
ActionLedgerError>
find_all_records(std::span<const ActionKey> keys);
protected:
ActionLedger(ActionLedger&&) = default;