#[non_exhaustive]pub enum SideEffectClass {
Pure,
ReadOnly,
MutatesLocal,
MutatesExternal,
Indeterminate,
}Expand description
Side-effect classification — controls whether a tool is safe to run speculatively (i.e. before the LLM asks for it).
Speculative pre-fetch is the killer feature of Paper 3, but it is only safe when re-issuing the call has no observable consequence beyond what the LLM was going to do anyway. Anything that mutates state (local files, remote APIs, user-visible objects) must never be speculated — otherwise we double-execute writes.
The default is the most conservative reading: Indeterminate. New
tools are non-speculatable until a provider explicitly opts in.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Pure
Deterministic + idempotent: same input → same output, no
state. Safe to speculate freely. Examples: Read of an
unchanged file, hash computations, pure functions over args.
ReadOnly
No external mutation, but the result can change between
calls (TTL applies). Safe to speculate when freshness_ttl_s
has not expired. Examples: get_issues, WebFetch, Glob,
Grep, list-style endpoints. The bulk of the planner’s wins.
MutatesLocal
Mutates host-local state (files, in-memory caches). Never
speculate — re-running would duplicate the edit. Examples:
Edit, Write, MultiEdit, NotebookEdit.
MutatesExternal
Mutates remote state (creates issues, sends messages, runs
pipelines, git push). Never speculate — the consequence is
visible to other actors. Examples: create_issue,
create_merge_request, add_issue_comment, Bash for
destructive commands.
Indeterminate
Outcome cannot be classified statically (most prominently
Bash — its effect depends on the command string). Default
for any tool that has not been annotated. Treated as
non-speculatable; the planner only emits a hint to the LLM.
Implementations§
Source§impl SideEffectClass
impl SideEffectClass
Sourcepub fn is_speculatable(&self) -> bool
pub fn is_speculatable(&self) -> bool
true iff the planner is allowed to issue this tool ahead of
the LLM asking for it. Currently Pure and ReadOnly only;
the other variants are bypassed even if enrichment.enabled
is on.
Trait Implementations§
Source§impl Clone for SideEffectClass
impl Clone for SideEffectClass
Source§fn clone(&self) -> SideEffectClass
fn clone(&self) -> SideEffectClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SideEffectClass
impl Debug for SideEffectClass
Source§impl Default for SideEffectClass
impl Default for SideEffectClass
Source§fn default() -> SideEffectClass
fn default() -> SideEffectClass
Source§impl<'de> Deserialize<'de> for SideEffectClass
impl<'de> Deserialize<'de> for SideEffectClass
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>,
Source§impl PartialEq for SideEffectClass
impl PartialEq for SideEffectClass
Source§fn eq(&self, other: &SideEffectClass) -> bool
fn eq(&self, other: &SideEffectClass) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SideEffectClass
impl Serialize for SideEffectClass
impl Copy for SideEffectClass
impl Eq for SideEffectClass
impl StructuralPartialEq for SideEffectClass
Auto Trait Implementations§
impl Freeze for SideEffectClass
impl RefUnwindSafe for SideEffectClass
impl Send for SideEffectClass
impl Sync for SideEffectClass
impl Unpin for SideEffectClass
impl UnsafeUnpin for SideEffectClass
impl UnwindSafe for SideEffectClass
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.