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: StringUnique receipt ID.
schema: StringSchema version.
started_at: u64Unix timestamp when the workflow started.
completed_at: u64Unix timestamp when the workflow completed.
skill_id: StringSkill ID from the manifest.
skill_version: StringSkill version from the manifest.
agent_id: StringAgent that executed the workflow.
session_id: Option<String>Session the workflow ran under.
capability_id: StringCapability ID that authorized the workflow.
outcome: WorkflowOutcomeOverall workflow outcome.
steps: Vec<StepRecord>Per-step execution records.
total_cost: Option<MonetaryAmount>Total cost of the workflow.
duration_ms: u64Total wall-clock duration in milliseconds.
kernel_key: PublicKeyKernel public key.
signature: SignatureSignature over the receipt body.
vendor_signatures: Vec<WorkflowVendorSignature>Detached vendor co-signatures over the canonical workflow body.
Implementations§
Source§impl WorkflowReceipt
impl WorkflowReceipt
Sourcepub fn sign(body: WorkflowReceiptBody, keypair: &Keypair) -> Result<Self, Error>
pub fn sign(body: WorkflowReceiptBody, keypair: &Keypair) -> Result<Self, Error>
Sign a workflow receipt body.
Sourcepub fn body(&self) -> WorkflowReceiptBody
pub fn body(&self) -> WorkflowReceiptBody
Reconstruct the canonical body signed by the kernel and vendors.
Sourcepub fn add_vendor_signature(
&mut self,
vendor_id: impl Into<String>,
keypair: &Keypair,
) -> Result<(), WorkflowReceiptError>
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.
Sourcepub fn verify_vendor_signatures(
&self,
required: &[VendorSignatureRequirement],
) -> Result<bool, WorkflowReceiptError>
pub fn verify_vendor_signatures( &self, required: &[VendorSignatureRequirement], ) -> Result<bool, WorkflowReceiptError>
Verify that every required vendor co-signed this workflow body.
Sourcepub fn successful_steps(&self) -> usize
pub fn successful_steps(&self) -> usize
Count how many steps completed successfully.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Check whether the workflow completed successfully.
Trait Implementations§
Source§impl Clone for WorkflowReceipt
impl Clone for WorkflowReceipt
Source§fn clone(&self) -> WorkflowReceipt
fn clone(&self) -> WorkflowReceipt
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more