Skip to main content

Effect

Struct Effect 

Source
pub struct Effect {
    pub input_hash: Option<String>,
    pub output_hash: Option<String>,
    pub readback: Option<String>,
    pub bytes_moved: Option<u64>,
    pub cost: Option<Cost>,
    pub side_effects: Vec<String>,
    pub context_snapshot: Option<String>,
    pub effect_confidence: Option<EffectConfidence>,
    pub witnesses: Vec<Witness>,
    pub finality: Option<EffectFinality>,
    pub resolution: Option<Resolution>,
}
Expand description

What the action actually touched. Descriptive; every field is optional because not every action has cheap external ground truth. readback is the strongest claim: a hash of externally-observed post-state the actor did not author.

Fields§

§input_hash: Option<String>§output_hash: Option<String>§readback: Option<String>

Hash of externally-observed post-state (DB readback, provider-API state fetch, on-chain balance, second-runtime observation) – a signal the actor cannot mint.

§bytes_moved: Option<u64>§cost: Option<Cost>§side_effects: Vec<String>§context_snapshot: Option<String>

Hash of the state the agent acted from (produced by ZMEM). Lets a verifier detect action on stale/poisoned context.

§effect_confidence: Option<EffectConfidence>

The actor’s honest self-declaration of whether the effect actually happened (“the ack is not the act”). This is a CLAIM, not proof: the verifier cross-checks it against the independent evidence above (a readback the actor could not mint), and a Verified claim carrying no such evidence is downgraded, never taken on faith. Absent means the actor made no effect claim at all.

§witnesses: Vec<Witness>

Independent observers who corroborate this effect. Each is a claim the actor bundled in; verify decides which (if any) are trustworthy signals the actor could not mint. An empty list – the common case – means the only effect evidence is the actor’s own readback.

§finality: Option<EffectFinality>

How far the state change got, as distinct from how well it is evidenced. Optional and skipped when absent so existing v2 receipts keep byte-identical canonical bytes.

A Finalized claim is capped by verify_effect the same way EffectConfidence::Verified is: both assert something definite, so both can be inflated, so both require evidence the actor could not mint.

§resolution: Option<Resolution>

When an unresolved effect must resolve by, and what fires if it does not. Absent means no obligation was declared – which check_resolution reports as Indefinite rather than passing over, because an unresolved effect with no deadline is the failure shape, not the safe default.

Implementations§

Source§

impl Effect

Source

pub fn has_independent_evidence(&self) -> bool

True when the effect carries a signal the actor could not have minted itself (an external read-back). This is what lets a verifier honor a Verified confidence claim; without it, Verified is downgraded.

Deliberately gated on readback alone, NOT on witnesses: a witness only becomes evidence once verify confirms its signature against a trusted non-actor key, which this pure-data check cannot do. Counting an unverified witness here would let the actor inflate its own ceiling with a fabricated observer – exactly the “ok for the wrong reason” we refuse.

Source

pub fn signed_witnesses(&self) -> impl Iterator<Item = &Witness>

The witnesses that at least carry a signature verify can attempt to check. Callers must still run that check; a non-empty result is a precondition for witness-backed evidence, never evidence itself.

Source

pub fn evidence_ceiling(&self) -> EffectConfidence

The strongest effect confidence the evidence supports, independent of what the actor claimed. Verified requires independent evidence; otherwise the honest ceiling is NotVerified. Callers reconcile this with effect_confidence (the claim): the effective verdict is the weaker of the two, so an actor can honestly downgrade but never inflate.

Trait Implementations§

Source§

impl Clone for Effect

Source§

fn clone(&self) -> Effect

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 Effect

Source§

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

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

impl Default for Effect

Source§

fn default() -> Effect

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

impl<'de> Deserialize<'de> for Effect

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 Eq for Effect

Source§

impl PartialEq for Effect

Source§

fn eq(&self, other: &Effect) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Effect

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
Source§

impl StructuralPartialEq for Effect

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V