Skip to main content

chio_workflow/
lib.rs

1//! Skill and Workflow Authority for Chio.
2//!
3//! This crate extends the Chio capability model with multi-step skill
4//! composition. A *skill* is an ordered sequence of tool invocations with
5//! declared I/O contracts, dependency relationships, and budget envelopes.
6//!
7//! # Core concepts
8//!
9//! - [`SkillGrant`] -- extends capability model for ordered tool sequences
10//! - [`SkillManifest`] -- describes tool dependencies, I/O contracts, budget
11//! - [`WorkflowReceipt`] -- captures complete execution trace as single artifact
12//! - [`WorkflowAuthority`] -- validates each step against declared scope and budget
13//!
14//! # Example
15//!
16//! ```ignore
17//! let manifest = SkillManifest { ... };
18//! let authority = WorkflowAuthority::new(signing_key);
19//! let execution = authority.begin(&manifest, &capability)?;
20//!
21//! for step in &manifest.steps {
22//!     authority.validate_step(&execution, step, &arguments)?;
23//!     // ... invoke tool ...
24//!     authority.record_step_result(&mut execution, step, result)?;
25//! }
26//!
27//! let receipt = authority.finalize(execution)?;
28//! ```
29
30#![forbid(unsafe_code)]
31#![cfg_attr(test, allow(clippy::expect_used, clippy::unwrap_used))]
32
33pub mod authority;
34pub mod grant;
35pub mod manifest;
36pub mod receipt;
37
38pub mod preflight {
39    pub use chio_workflow_preflight::*;
40}
41
42pub use authority::{WorkflowAuthority, WorkflowError, WorkflowExecution};
43pub use grant::SkillGrant;
44pub use manifest::{IoContract, SkillManifest, SkillStep};
45pub use preflight::{
46    evaluate_workflow_preflight, WorkflowPreflightError, WorkflowPreflightPlan,
47    WorkflowPreflightReport, WorkflowPreflightVerdict,
48};
49pub use receipt::{
50    StepRecord, VendorSignatureRequirement, WorkflowReceipt, WorkflowReceiptBody,
51    WorkflowReceiptError, WorkflowVendorSignature,
52};