Skip to main content

WorkflowReceipt

Struct WorkflowReceipt 

Source
pub struct WorkflowReceipt {
Show 16 fields pub id: String, pub schema: String, pub started_at: u64, pub completed_at: u64, pub skill_id: String, pub skill_version: String, pub agent_id: String, pub session_id: Option<String>, pub capability_id: String, pub outcome: WorkflowOutcome, pub steps: Vec<StepRecord>, pub total_cost: Option<MonetaryAmount>, pub duration_ms: u64, pub kernel_key: PublicKey, pub signature: Signature, pub vendor_signatures: Vec<WorkflowVendorSignature>,
}
Expand description

A signed receipt for a complete skill/workflow execution.

Fields§

§id: String

Unique receipt ID.

§schema: String

Schema version.

§started_at: u64

Unix timestamp when the workflow started.

§completed_at: u64

Unix timestamp when the workflow completed.

§skill_id: String

Skill ID from the manifest.

§skill_version: String

Skill version from the manifest.

§agent_id: String

Agent that executed the workflow.

§session_id: Option<String>

Session the workflow ran under.

§capability_id: String

Capability ID that authorized the workflow.

§outcome: WorkflowOutcome

Overall workflow outcome.

§steps: Vec<StepRecord>

Per-step execution records.

§total_cost: Option<MonetaryAmount>

Total cost of the workflow.

§duration_ms: u64

Total wall-clock duration in milliseconds.

§kernel_key: PublicKey

Kernel public key.

§signature: Signature

Signature over the receipt body.

§vendor_signatures: Vec<WorkflowVendorSignature>

Detached vendor co-signatures over the canonical workflow body.

Implementations§

Source§

impl WorkflowReceipt

Source

pub fn sign(body: WorkflowReceiptBody, keypair: &Keypair) -> Result<Self, Error>

Sign a workflow receipt body.

Source

pub fn body(&self) -> WorkflowReceiptBody

Reconstruct the canonical body signed by the kernel and vendors.

Source

pub fn verify(&self) -> Result<bool, Error>

Verify the receipt signature.

Source

pub fn add_vendor_signature( &mut self, vendor_id: impl Into<String>, keypair: &Keypair, ) -> Result<(), WorkflowReceiptError>

Add a detached vendor co-signature over the canonical workflow body.

Source

pub fn verify_vendor_signatures( &self, required: &[VendorSignatureRequirement], ) -> Result<bool, WorkflowReceiptError>

Verify that every required vendor co-signed this workflow body.

Source

pub fn successful_steps(&self) -> usize

Count how many steps completed successfully.

Source

pub fn is_complete(&self) -> bool

Check whether the workflow completed successfully.

Trait Implementations§

Source§

impl Clone for WorkflowReceipt

Source§

fn clone(&self) -> WorkflowReceipt

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 WorkflowReceipt

Source§

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

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

impl<'de> Deserialize<'de> for WorkflowReceipt

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 WorkflowReceipt

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more