pub struct SqlitePendingStore { /* private fields */ }Expand description
SQLite-backed PendingAdjudicationPort implementation.
Shares the same connection mutex as SqlitePersistenceStore but operates OUTSIDE
the claim transaction — reads and writes go directly on the connection (no BEGIN/COMMIT
wrapping). The per-agent write lock held by EngineHandle ensures these writes are
serialized with the claim txn commit.
Construct via SqlitePendingStore::new(conn_arc) sharing the same connection Arc
as the SqlitePersistenceStore.
Implementations§
Trait Implementations§
Source§impl PendingAdjudicationPort for SqlitePendingStore
impl PendingAdjudicationPort for SqlitePendingStore
Source§fn list_queued_orphan_claims(
&self,
) -> Result<Vec<OrphanedQueuedClaim>, SqliteStoreError>
fn list_queued_orphan_claims( &self, ) -> Result<Vec<OrphanedQueuedClaim>, SqliteStoreError>
Detect QueuedForAdjudication claims (by latest ledger disposition) with no matching pending row (status = ‘pending’).
Approach: find claim_ids whose most-recent ledger entry has disposition = ‘QueuedForAdjudication’ via a subquery on max(recorded_at), then check for absence of a matching pending_adjudications row. Returns orphaned claim refs with agent_id, subject, predicate, and best-guess incumbent.
NOTE: The schema uses claim_id (not claim_ref) in ledger_entries and claims.
type Error = SqliteStoreError
Source§fn insert_pending(
&self,
row: &PendingAdjudicationRow,
) -> Result<(), SqliteStoreError>
fn insert_pending( &self, row: &PendingAdjudicationRow, ) -> Result<(), SqliteStoreError>
Source§fn get_pending(
&self,
handle_id: Uuid,
) -> Result<Option<PendingAdjudicationRow>, SqliteStoreError>
fn get_pending( &self, handle_id: Uuid, ) -> Result<Option<PendingAdjudicationRow>, SqliteStoreError>
handle_id. Returns None if not found.Source§fn list_pending(
&self,
agent_id: Option<&AgentId>,
) -> Result<Vec<PendingAdjudicationRow>, SqliteStoreError>
fn list_pending( &self, agent_id: Option<&AgentId>, ) -> Result<Vec<PendingAdjudicationRow>, SqliteStoreError>
agent_id is None).
Ordered by queued_at ASC.Source§fn list_expired(
&self,
now: DateTime<Utc>,
) -> Result<Vec<PendingAdjudicationRow>, SqliteStoreError>
fn list_expired( &self, now: DateTime<Utc>, ) -> Result<Vec<PendingAdjudicationRow>, SqliteStoreError>
expires_at is not NULL, expires_at <= now, and status = 'pending'.
Used by the sweep use-case. Ordered by expires_at ASC.