Skip to main content

StubTools

Struct StubTools 

Source
pub struct StubTools;
Expand description

Placeholder executor: advertises no tools and reports any call it receives as unhandled (the model shouldn’t call anything without specs, but the guard keeps the loop progressing if it does).

Trait Implementations§

Source§

impl Clone for StubTools

Source§

fn clone(&self) -> StubTools

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for StubTools

Source§

impl Default for StubTools

Source§

fn default() -> StubTools

Returns the “default value” for a type. Read more
Source§

impl ToolExecutor for StubTools

Source§

fn execute<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, name: &'life1 str, args_json: &'life2 str, ) -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Run name with JSON args_json; return a JSON result.
Source§

fn specs(&self) -> Vec<ToolSpec>

Specs for the tools this executor knows how to run. The default returns an empty list — the model won’t be told about any tools, so it won’t emit tool_calls. Real registries override this.
Source§

fn owns(&self, name: &str) -> bool

Whether this executor advertises a tool named name. Read more
Source§

fn needs_approval(&self, _name: &str) -> bool

Whether name requires explicit human approval before Self::execute may run. The default is false — pure / read-only tools shouldn’t trigger an approval gate. Override for sensitive tools (writes, code execution, network reach, anything with side effects). Read more
Source§

fn pre_dispatch(&self, name: &str, _args_json: &str) -> ToolDecision

The dispatch-time policy decision for a call, seeing BOTH the tool name AND its arguments (#67). This is the argument-aware gate the turn loop consults before every execution — richer than the name-only Self::needs_approval, so a policy can allow read foo.txt but deny read /etc/shadow. Read more
Source§

fn post_dispatch( &self, _name: &str, _args_json: &str, _result_json: &str, ) -> Option<String>

Optionally rewrite a tool’s RESULT before it re-enters the model’s context (#67, #540) — the place to redact a secret from output or enrich it. Some(new) replaces the result; None (the default) leaves it unchanged. A redaction is recorded as a distinct signed event, so the substitution is transparent in the audit log, never silent.
Source§

fn cacheable_approval(&self, name: &str) -> bool

Whether a single human approval for name may be remembered for the rest of a conversation session (per-caller) and reused for later calls of the tool. This is the authoritative gate for session-scoped approval (run_turn only honors a remembered approval when this returns true), so a non-idempotent tool can never have its approval cached. Read more
Source§

fn sandbox_would_deny(&self, _name: &str, _args_json: &str) -> bool

Whether running name with args_json would be DENIED by the sandbox before any side effect, so the call should ESCALATE to a human approval (an unsandboxed retry) instead of executing and returning a flat denial (graduated approval, #301). Read more
Source§

fn required_capabilities(&self, _name: &str) -> CapabilitySet

The capabilities a call to name requires (#592) — the executor’s one gate-facing classification surface, derived from the tool’s spec annotations plus what the executor knows about the tool’s registry provenance (see polyc_capability::required_capabilities). Read more
Source§

fn ingests_untrusted_content(&self, name: &str) -> bool

Whether name’s RESULT carries untrusted-provenance content — the taint SOURCE predicate: “did content of open-world, attacker-influenceable provenance enter the transcript”. NOT the dual of the required-capability surface — that asks what a call may do outbound; this asks what its result brings in. Read more
Source§

fn recover_unadvertised(&self, _name: &str, _args_json: &str) -> Vec<ToolSpec>

Attempts in-turn recovery for a tool call that named no advertised tool — the fuzzy-match escape hatch (#582, invariant 9). The inputs are the raw facts of the failed call, mirroring Self::execute: the called (hallucinated) name and its args_json. How they become a retrieval query is the implementor’s business — the executor owns the ranking pipeline. Returns full specs for the closest not-yet-advertised tools in the executor’s catalog, matched FUZZILY — never by exact-name lookup, because a model that needs an unoffered capability hallucinates a plausible name rather than abstaining — for run_turn_with to append to the turn’s advertised set. Read more
Source§

fn for_worker( &self, _scope: &WorkerScope<'_>, ) -> Option<Result<WorkerHandoff, ShareInError>>

Re-root this executor for a delegated worker’s own nested turn (#2286) and seed it with the parent files _scope requests (#2295), both keyed by that worker’s delegate call id. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsOut<T> for T
where T: Copy,

Source§

fn as_out(&mut self) -> Out<'_, T>

Returns an out reference to self.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more