pub struct ExperienceStore { /* private fields */ }Expand description
Replayable, target-scoped outcome experience.
Observation order is represented by a monotonic integer rather than wall clock time. Recording an identical outcome is idempotent. Passive inconclusive results do not count as completed attempts; a later active result for the same case replaces them during assessment.
This store is action-outcome learning history. It does not receive or
preserve crate::VerificationCase transition authorization, so an
ExperienceDisposition::ConfirmedPositive is not evidence that a
hypothesis state changed. The KnowledgeBase and
complete VerificationReport remain
authoritative for hypothesis state and transition audit.
§Example
use termivar_scanner::{ExperiencePolicy, ExperienceStore};
let store = ExperienceStore::new();
assert_eq!(store.len(), 0);
assert_eq!(ExperiencePolicy::default().consecutive_failure_limit(), 10);Implementations§
Source§impl ExperienceStore
impl ExperienceStore
Sourcepub fn observe(
&mut self,
outcome: Outcome,
) -> Result<ExperienceWrite, ExperienceStoreError>
pub fn observe( &mut self, outcome: Outcome, ) -> Result<ExperienceWrite, ExperienceStoreError>
Records one immutable outcome in deterministic call order.
Sourcepub fn observe_with_disposition(
&mut self,
outcome: Outcome,
disposition: ExperienceDisposition,
) -> Result<ExperienceWrite, ExperienceStoreError>
pub fn observe_with_disposition( &mut self, outcome: Outcome, disposition: ExperienceDisposition, ) -> Result<ExperienceWrite, ExperienceStoreError>
Records an outcome with an explicit, status-compatible disposition.
Callers should use this only when structured policy or an audited
verifier can distinguish the conservative classification produced by
Self::observe. Operational failures should not be converted into a
synthetic successful or negative verifier result.
Sourcepub fn records(&self) -> &[ExperienceRecord]
pub fn records(&self) -> &[ExperienceRecord]
Returns all records in stable global observation order.
Sourcepub fn history<'a>(
&'a self,
subject: &'a EntityId,
action_id: &'a str,
) -> impl Iterator<Item = &'a ExperienceRecord> + 'a
pub fn history<'a>( &'a self, subject: &'a EntityId, action_id: &'a str, ) -> impl Iterator<Item = &'a ExperienceRecord> + 'a
Returns records for one subject and action in observation order.
Sourcepub fn assess(
&self,
subject: &EntityId,
action_id: &str,
policy: ExperiencePolicy,
) -> ExperienceAssessment
pub fn assess( &self, subject: &EntityId, action_id: &str, policy: ExperiencePolicy, ) -> ExperienceAssessment
Assesses the latest completed result for each distinct verification case.
Sourcepub fn suppressed_actions(
&self,
subject: &EntityId,
policy: ExperiencePolicy,
) -> BTreeSet<String>
pub fn suppressed_actions( &self, subject: &EntityId, policy: ExperiencePolicy, ) -> BTreeSet<String>
Returns policy-suppressed action IDs for one subject in stable order.
Trait Implementations§
Source§impl Clone for ExperienceStore
impl Clone for ExperienceStore
Source§fn clone(&self) -> ExperienceStore
fn clone(&self) -> ExperienceStore
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExperienceStore
impl Debug for ExperienceStore
Source§impl Default for ExperienceStore
impl Default for ExperienceStore
Source§fn default() -> ExperienceStore
fn default() -> ExperienceStore
Source§impl<'de> Deserialize<'de> for ExperienceStore
impl<'de> Deserialize<'de> for ExperienceStore
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl Eq for ExperienceStore
Source§impl PartialEq for ExperienceStore
impl PartialEq for ExperienceStore
Source§impl Serialize for ExperienceStore
impl Serialize for ExperienceStore
impl StructuralPartialEq for ExperienceStore
Auto Trait Implementations§
impl Freeze for ExperienceStore
impl RefUnwindSafe for ExperienceStore
impl Send for ExperienceStore
impl Sync for ExperienceStore
impl Unpin for ExperienceStore
impl UnsafeUnpin for ExperienceStore
impl UnwindSafe for ExperienceStore
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.