pub struct PlanVerifier<P>where
P: LlmProvider,{ /* private fields */ }Expand description
LLM-backed post-task completeness verifier.
Uses a cheap provider for verification (configured via verify_provider).
All failures are fail-open — verification never blocks task graph execution.
Implementations§
Source§impl<P> PlanVerifier<P>where
P: LlmProvider,
impl<P> PlanVerifier<P>where
P: LlmProvider,
Sourcepub fn new(
provider: P,
max_tokens: u32,
sanitizer: ContentSanitizer,
) -> PlanVerifier<P>
pub fn new( provider: P, max_tokens: u32, sanitizer: ContentSanitizer, ) -> PlanVerifier<P>
Create a new PlanVerifier.
Sourcepub async fn verify(
&mut self,
task: &TaskNode,
output: &str,
) -> VerificationResult
pub async fn verify( &mut self, task: &TaskNode, output: &str, ) -> VerificationResult
Verify that a completed task’s output satisfies its description.
Returns VerificationResult { complete: true, gaps: [], confidence: 0.0 } on
any LLM failure (fail-open). Logs ERROR after 3+ consecutive failures to
surface systematic misconfiguration (critic S4).
The task stays Completed regardless of verification outcome. Downstream tasks
are unblocked immediately on completion — verification does not gate dispatch.
Sourcepub async fn replan(
&mut self,
task: &TaskNode,
gaps: &[Gap],
graph: &TaskGraph,
max_tasks: u32,
) -> Result<Vec<TaskNode>, OrchestrationError>
pub async fn replan( &mut self, task: &TaskNode, gaps: &[Gap], graph: &TaskGraph, max_tasks: u32, ) -> Result<Vec<TaskNode>, OrchestrationError>
Generate new TaskNodes for critical and important gaps only.
Minor gaps are logged and skipped. New tasks depend on verified_task_id
and are assigned IDs starting from next_id. Returns empty Vec on any
LLM failure (fail-open).
§Errors
Returns OrchestrationError::VerificationFailed only for hard invariant
violations (e.g. too many tasks would exceed the graph limit). LLM errors
are fail-open and never returned.
Auto Trait Implementations§
impl<P> Freeze for PlanVerifier<P>where
P: Freeze,
impl<P> RefUnwindSafe for PlanVerifier<P>where
P: RefUnwindSafe,
impl<P> Send for PlanVerifier<P>
impl<P> Sync for PlanVerifier<P>
impl<P> Unpin for PlanVerifier<P>where
P: Unpin,
impl<P> UnsafeUnpin for PlanVerifier<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for PlanVerifier<P>where
P: UnwindSafe,
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request