pub struct Witness {
pub observer: String,
pub observation: String,
pub observed_at: Option<String>,
pub signature: Option<String>,
}Expand description
An independent observation of an action’s effect, made by someone other
than the actor. A witness is the raw material of effect verification: the
actor’s own effect_confidence is a claim it can mint, but a witness
whose key is NOT the actor’s, whose signature verifies against a trusted
root, and whose observation matches the effect is a signal the actor
could not have forged. Multiple independent witnesses are how a Verified
confidence earns its evidence beyond a single self-reported readback.
This struct is only the record. It carries NO independent weight on its
own: an unsigned witness, or one signed by the actor’s own key, proves
nothing. The reconciliation – does observer resolve to a trusted,
non-actor key? does signature verify over the canonical tuple? does
observation match the effect? – happens in verify, never here. Do not
treat the mere presence of a witness as evidence.
Fields§
§observer: StringURI or key id of the observer, e.g. “agent://auditor”, “key_9f2c”. Verify resolves this to a trust root and requires it to differ from the action’s actor.
observation: Stringsha256:<hex> of what the observer independently saw. Verify checks
this equals the effect’s own observed post-state (readback /
output_hash); a witness that observed something else corroborates
nothing.
observed_at: Option<String>RFC 3339 instant the observation was made.
signature: Option<String>The observer’s signature over its own (observer, observation,
observed_at) tuple, verifiable against observer’s key. Absent means
unsigned: verify gives it zero independent weight.
Implementations§
Source§impl Witness
impl Witness
Sourcepub fn is_signed(&self) -> bool
pub fn is_signed(&self) -> bool
True when the witness at least carries a signature to check. This is a
necessary-not-sufficient precondition: verify still has to confirm the
signature verifies, the observer is a trusted non-actor key, and the
observation matches. A true here is NOT evidence by itself.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Witness
impl<'de> Deserialize<'de> for Witness
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 Witness
impl StructuralPartialEq for Witness
Auto Trait Implementations§
impl Freeze for Witness
impl RefUnwindSafe for Witness
impl Send for Witness
impl Sync for Witness
impl Unpin for Witness
impl UnsafeUnpin for Witness
impl UnwindSafe for Witness
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.