pub struct PlanNode {
pub id: StepId,
pub capability: Capability,
pub depends_on: Vec<StepId>,
pub args: BTreeMap<String, ArgSource>,
pub terminal: bool,
pub verifies: bool,
}Expand description
One unit of work in a plan.
§A panel is several nodes, not a field on one
There is deliberately no quorum here. A panel is k judgements of one
piece of work and an aggregator that tallies them — a shape the graph
already expresses exactly: k nodes depending on the subject, each
verifies, and a terminal node depending on all of them
that decides with Quorum. A field would be a second
spelling of it, and one the runtime cannot execute: there is no way to hand
a node a lens, so the declaration would ride inside the plan digest with
its behaviour living nowhere.
Fields§
§id: StepId§capability: CapabilityWhat this node needs done. Resolved against registered skills.
depends_on: Vec<StepId>Nodes that must complete first.
Structural, not conversational: a node cannot run before its predecessors’ outputs are bound to its inputs, which is how “one agent ignored another’s result” stops being possible rather than discouraged.
args: BTreeMap<String, ArgSource>Each argument and where it comes from.
terminal: boolWhether the plan is complete once this node is done.
verifies: boolWhether this node checks another’s work.
Named so the contract can require one: nothing checking the work is a
fifth of observed multi-agent failures. Structural rather than
advisory — a node claiming it verifies must depend on what it checks,
and RuntimeBuilder::require_verifier makes “every plan carries one”
a condition of admission, on a replanner’s successor as much as on the
plan an embedder wrote.
Implementations§
Source§impl PlanNode
impl PlanNode
pub fn new(id: u32, capability: impl Into<Capability>) -> Self
Sourcepub fn arg(self, name: impl Into<String>, source: ArgSource) -> Self
pub fn arg(self, name: impl Into<String>, source: ArgSource) -> Self
Bind an argument, recording the dependency it implies.
pub fn after(self, step: u32) -> Self
pub fn terminal(self) -> Self
pub fn verifies(self) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PlanNode
impl<'de> Deserialize<'de> for PlanNode
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 StructuralPartialEq for PlanNode
Auto Trait Implementations§
impl Freeze for PlanNode
impl RefUnwindSafe for PlanNode
impl Send for PlanNode
impl Sync for PlanNode
impl Unpin for PlanNode
impl UnsafeUnpin for PlanNode
impl UnwindSafe for PlanNode
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more