pub struct ProofReplayStateStore { /* private fields */ }Expand description
Append-only, dedup-by-intent_id, corruption-tolerant proof-replay-state
store. Mirrors crate::proof_intent::ProofIntentStore: put is O(1) on the
hot path (latest-wins is resolved on read).
Implementations§
Source§impl ProofReplayStateStore
impl ProofReplayStateStore
pub fn with_path(path: impl Into<PathBuf>) -> Self
pub fn path(&self) -> &Path
Sourcepub fn put(&self, record: &ProofReplayRecord) -> Result<()>
pub fn put(&self, record: &ProofReplayRecord) -> Result<()>
Append a state record. Duplicate intent_ids are tolerated on write
(latest-wins resolved on read).
Sourcepub fn all(&self) -> Vec<ProofReplayRecord>
pub fn all(&self) -> Vec<ProofReplayRecord>
All current records, deduplicated by intent_id (latest write wins), in
first-seen order. Corrupt lines are skipped.
Sourcepub fn get(&self, intent_id: &str) -> Option<ProofReplayRecord>
pub fn get(&self, intent_id: &str) -> Option<ProofReplayRecord>
Fetch a single record by intent id (latest wins).
Sourcepub fn by_state(&self, state: ProofState) -> Vec<ProofReplayRecord>
pub fn by_state(&self, state: ProofState) -> Vec<ProofReplayRecord>
Records currently in a given state.
Sourcepub fn census(&self) -> BTreeMap<String, usize>
pub fn census(&self) -> BTreeMap<String, usize>
A state -> count census of every tracked intent (for rch proof status).
Sourcepub fn advance(
&self,
signals_by_intent: &BTreeMap<String, ConveyorSignals>,
max_concurrent_replays: usize,
now_unix_ms: u64,
) -> Result<Vec<ConveyorScanResult>>
pub fn advance( &self, signals_by_intent: &BTreeMap<String, ConveyorSignals>, max_concurrent_replays: usize, now_unix_ms: u64, ) -> Result<Vec<ConveyorScanResult>>
Run one conveyor scan over every tracked, non-terminal intent and
persist the resulting transitions. This is the conveyor’s loop body: the
caller supplies the freshly-observed ConveyorSignals per intent (which
require live state — readiness, source revalidation — and so are computed
at the impure boundary), and this method handles the deterministic part:
fair, starvation-bounded planning (plan_scan) and durable persistence.
Intents with no entry in signals_by_intent are left untouched (the caller
could not observe them this tick). Terminal intents are never revisited.
Returns the per-intent scan results (for the intents that were evaluated).
now_unix_ms stamps every transition deterministically.