pub struct ToolMutationEffects(/* private fields */);Expand description
Typed mutation effects for one tool call.
ToolCallEffect deliberately remains the compact observation/mutation
summary used by older persisted events. This set carries the detail needed
by policy and completion accounting so an incidental build-cache write does
not satisfy a requested source edit, and a local write does not satisfy a
requested remote deployment.
Implementations§
Source§impl ToolMutationEffects
impl ToolMutationEffects
pub const PROTOCOL_NAMES: [&str; 13]
pub const NONE: Self
Sourcepub const LOCAL_SOURCE_WRITE: Self
pub const LOCAL_SOURCE_WRITE: Self
A write to user-authored files through a path-aware editing tool.
Sourcepub const LOCAL_WORKSPACE_WRITE: Self
pub const LOCAL_WORKSPACE_WRITE: Self
A local write whose target is not typed precisely (shell redirect, copy, generated file, and similar workspace activity).
Sourcepub const LOCAL_DERIVED_WRITE: Self
pub const LOCAL_DERIVED_WRITE: Self
Compiler caches, dependency directories, and other reproducible output.
Sourcepub const REPOSITORY_WRITE: Self
pub const REPOSITORY_WRITE: Self
Git refs, index state, commits, and related repository metadata.
Sourcepub const REMOTE_MUTATION: Self
pub const REMOTE_MUTATION: Self
A remote state change that is not specifically a deployment.
Sourcepub const REMOTE_DEPLOY: Self
pub const REMOTE_DEPLOY: Self
Publishing a new application/site deployment or version.
Sourcepub const EXTERNAL_DELIVERY: Self
pub const EXTERNAL_DELIVERY: Self
Sending, posting, uploading, or otherwise delivering content.
Sourcepub const PROCESS_STATE: Self
pub const PROCESS_STATE: Self
Starting, stopping, restarting, or killing a process/service.
Sourcepub const CONFIGURATION: Self
pub const CONFIGURATION: Self
Mutating configuration, permissions, packages, or runtime setup.
Sourcepub const DESTRUCTIVE: Self
pub const DESTRUCTIVE: Self
Deletion or another intentionally destructive local/remote operation.
Sourcepub const UNSPECIFIED: Self
pub const UNSPECIFIED: Self
A command can mutate, but static inspection cannot state how. This is intentionally not allowed to satisfy a more specific required outcome.
Sourcepub const SCHEDULED_WORK: Self
pub const SCHEDULED_WORK: Self
Creating or changing the daemon’s own goals, schedules and reminders. Nothing leaves the machine; the work it sets up is judged when it runs.
Sourcepub const MEMORY_WRITE: Self
pub const MEMORY_WRITE: Self
Saving to the daemon’s own long-term memory. Nothing leaves the machine and no workspace file changes.
Sourcepub const fn bits(self) -> u32
pub const fn bits(self) -> u32
Stable bit representation retained for durable telemetry and audits. Human-readable names are emitted alongside it; consumers must never interpret a raw bitset as a count.
Sourcepub const fn from_bits(bits: u32) -> Self
pub const fn from_bits(bits: u32) -> Self
Rehydrate a durable effect set without interpreting the bits as a
count. Unknown future bits remain visible to telemetry_value and do
not silently become a known effect.
Sourcepub fn protocol_names(self) -> Vec<&'static str>
pub fn protocol_names(self) -> Vec<&'static str>
Return the protocol names represented by this effect set. These names describe typed adapter effects, not natural-language task wording.
Sourcepub fn telemetry_value(self) -> Value
pub fn telemetry_value(self) -> Value
Machine-readable telemetry projection that keeps unknown future bits visible instead of silently dropping them.
pub const fn union(self, other: Self) -> Self
Sourcepub const fn intersect(self, other: Self) -> Self
pub const fn intersect(self, other: Self) -> Self
Keep only effects present in both sets. This is used when an adapter projects a task’s typed obligation onto the subset it can actually report; it never interprets the bitset as a count.
Sourcepub fn from_protocol_name(name: &str) -> Option<Self>
pub fn from_protocol_name(name: &str) -> Option<Self>
Parse a protocol enum value. These names are structured tool metadata, not natural-language routing keywords.
pub const fn is_empty(&self) -> bool
pub const fn contains(self, other: Self) -> bool
pub const fn intersects(self, other: Self) -> bool
pub const fn has_specific_effects(self) -> bool
Sourcepub const fn satisfies(self, required: Self) -> bool
pub const fn satisfies(self, required: Self) -> bool
Whether observed effects fulfill every typed requirement.
Known effects are checked strictly: cache output, repository metadata,
and directory scaffolding cannot masquerade as authored source. Opaque
execution surfaces report UNSPECIFIED, but unknown evidence is never
allowed to prove a more specific effect. A caller that requires a source
edit, deployment, or delivery must observe that exact typed effect.