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
impl Effect
Sourcepub fn has_independent_evidence(&self) -> bool
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.
Sourcepub fn signed_witnesses(&self) -> impl Iterator<Item = &Witness>
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.
Sourcepub fn evidence_ceiling(&self) -> EffectConfidence
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<'de> Deserialize<'de> for Effect
impl<'de> Deserialize<'de> for Effect
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 Effect
impl StructuralPartialEq for Effect
Auto Trait Implementations§
impl Freeze for Effect
impl RefUnwindSafe for Effect
impl Send for Effect
impl Sync for Effect
impl Unpin for Effect
impl UnsafeUnpin for Effect
impl UnwindSafe for Effect
Blanket Implementations§
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.