Skip to main content

LoopPersisted

Struct LoopPersisted 

Source
pub struct LoopPersisted {
    pub schema_version: u32,
    pub config: BTreeMap<String, AnalyzerConfig>,
    pub state: LoopState,
    pub status_index: BTreeMap<String, RecStatus>,
    pub audit_heads: BTreeMap<String, String>,
    pub creators: BTreeMap<String, String>,
    pub co_creators: BTreeMap<String, String>,
    pub cooldowns: BTreeMap<String, i64>,
    pub cooldown_strikes: BTreeMap<String, u32>,
    pub applied: BTreeMap<String, AppliedRecord>,
    pub measured: BTreeMap<String, Vec<Checkpoint>>,
    pub outcomes: BTreeMap<String, Vec<OutcomeResult>>,
}
Expand description

The whole loop persisted blob.

Fields§

§schema_version: u32§config: BTreeMap<String, AnalyzerConfig>

Per-analyzer config, keyed by full analyzer id.

§state: LoopState§status_index: BTreeMap<String, RecStatus>

Rebuildable lifecycle cache: recommendation hash → status.

§audit_heads: BTreeMap<String, String>

Per-recommendation latest audit hash, for hash-chaining.

§creators: BTreeMap<String, String>

The creating actor per recommendation (for the self-approval block).

§co_creators: BTreeMap<String, String>

The principal that triggered the run which stored an LLM or external-command recommendation — the self-approval block fires against these too (the trigger must not approve their own model’s output). Omitted when empty: deterministic-only histories never carry the key.

§cooldowns: BTreeMap<String, i64>

Rejection cooldowns keyed by dedup_key → cooldown-until epoch-ms.

§cooldown_strikes: BTreeMap<String, u32>

How many times each dedup_key has been rejected — drives the exponential backoff of cooldowns (7d, 14d, 28d, …) so a repeatedly-rejected finding stops re-surfacing on a fixed cadence. Omitted when empty (no churn for states without a rejection).

§applied: BTreeMap<String, AppliedRecord>

Applied-recommendation records (inverse plan, metric, timing).

§measured: BTreeMap<String, Vec<Checkpoint>>

Per-recommendation set of checkpoints already measured, so each is measured exactly once. A time checkpoint serializes as its bare ms value, which is what this field held before checkpoints had units — so a state blob from then reads back as the same schedule.

§outcomes: BTreeMap<String, Vec<OutcomeResult>>

Measured outcome time series (the Verify gate’s output), keyed by recommendation — one entry per horizon checkpoint.

Implementations§

Source§

impl LoopPersisted

Source

pub fn from_value(v: Value) -> Result<Self>

Decode from the substrate state blob; Value::Null (nothing stored) → defaults.

Source

pub fn to_value(&self) -> Result<Value>

Trait Implementations§

Source§

impl Clone for LoopPersisted

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LoopPersisted

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LoopPersisted

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for LoopPersisted

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for LoopPersisted

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.