pub struct DelegationPlan {
pub schema_version: String,
pub protocol_version: String,
pub delegation_id: Uuid,
pub parent_session_id: Uuid,
pub parent_contract_id: Uuid,
pub child_contract: TaskContract,
pub delegated_criterion_ids: BTreeSet<String>,
pub authority: AgentAuthority,
pub lease: WorkspaceLease,
pub budget: AgentBudget,
pub allowed_action_classes: BTreeSet<ActionClass>,
pub parent_state_binding: String,
}Expand description
Proof-carrying plan for exactly one parent-to-child delegation.
Fields§
§schema_version: StringPublic schema identifier.
protocol_version: StringDelegation protocol version.
delegation_id: UuidUnique delegation identity.
parent_session_id: UuidParent session that owns the original contract.
parent_contract_id: UuidParent contract identifier.
child_contract: TaskContractDerived, confirmed child contract.
delegated_criterion_ids: BTreeSet<String>Exact parent criterion IDs delegated to the child.
Child execution authority.
lease: WorkspaceLeaseImmutable workspace lease.
budget: AgentBudgetHard child budget.
allowed_action_classes: BTreeSet<ActionClass>Runtime-owned action classes available in the child session.
parent_state_binding: StringParent proof/state binding at delegation time.
Implementations§
Source§impl DelegationPlan
impl DelegationPlan
Sourcepub fn derive(
parent_session_id: Uuid,
parent: &TaskContract,
delegated_criterion_ids: BTreeSet<String>,
added_constraints: Vec<String>,
authority: AgentAuthority,
lease: WorkspaceLease,
budget: AgentBudget,
allowed_action_classes: BTreeSet<ActionClass>,
parent_state_binding: impl Into<String>,
) -> Result<Self, AgentError>
pub fn derive( parent_session_id: Uuid, parent: &TaskContract, delegated_criterion_ids: BTreeSet<String>, added_constraints: Vec<String>, authority: AgentAuthority, lease: WorkspaceLease, budget: AgentBudget, allowed_action_classes: BTreeSet<ActionClass>, parent_state_binding: impl Into<String>, ) -> Result<Self, AgentError>
Builds a strict child contract from a criterion subset and additive constraints.
Sourcepub fn validate(&self, parent: &TaskContract) -> Result<(), AgentError>
pub fn validate(&self, parent: &TaskContract) -> Result<(), AgentError>
Validates version, subset, authority, lease, budget, and authority invariants.
Sourcepub fn digest(&self, parent: &TaskContract) -> Result<String, AgentError>
pub fn digest(&self, parent: &TaskContract) -> Result<String, AgentError>
Computes a canonical content digest over the validated plan.
Trait Implementations§
Source§impl Clone for DelegationPlan
impl Clone for DelegationPlan
Source§fn clone(&self) -> DelegationPlan
fn clone(&self) -> DelegationPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DelegationPlan
impl Debug for DelegationPlan
Source§impl<'de> Deserialize<'de> for DelegationPlan
impl<'de> Deserialize<'de> for DelegationPlan
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DelegationPlan
impl PartialEq for DelegationPlan
Source§impl Serialize for DelegationPlan
impl Serialize for DelegationPlan
impl StructuralPartialEq for DelegationPlan
Auto Trait Implementations§
impl Freeze for DelegationPlan
impl RefUnwindSafe for DelegationPlan
impl Send for DelegationPlan
impl Sync for DelegationPlan
impl Unpin for DelegationPlan
impl UnsafeUnpin for DelegationPlan
impl UnwindSafe for DelegationPlan
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
Mutably borrows from an owned value. Read more