pub struct ToolEvent {
pub tool: String,
pub args_digest: String,
pub ok: bool,
pub duration_ms: Option<u64>,
}Expand description
One tool invocation recorded during a turn (Step 17.6, issue #246).
Serialized (as an array element) into the store’s turns.events JSON
column. The field names tool and args_digest are load-bearing:
the FTS5 recall index derives its tool_names / tool_args_digest
columns by extracting exactly $.tool and $.args_digest from each
element (see store.rs — events_extract_sql, the 17.3 seam) — rename
either and tool recall goes dark. Unknown extra fields are ignored on
load, so the shape can grow additively without a migration.
Fields§
§tool: StringTool name exactly as the model invoked it (read_file,
run_command, an MCP server__tool, or a hallucinated name —
recorded as called, ok = false tells the story).
args_digest: StringPrivacy-preserving argument digest: the argument key names
(searchable) plus a truncated BLAKE3 of the canonical args JSON
(correlatable). Never raw argument values — args carry file
contents and can carry secrets. Built by ToolEvent::from_call.
ok: boolWhether the tool result read as success. Best-effort: the loop’s
tool results are plain strings, so this mirrors the error: /
capability denied: / unknown tool prefixes execute_tool emits.
duration_ms: Option<u64>Wall-clock duration of the tool call in milliseconds. A display claim only (§6): never an ordering key — order within the turn is the events array position.
Implementations§
Source§impl ToolEvent
impl ToolEvent
Sourcepub fn from_call(
tool: impl Into<String>,
args: &Value,
ok: bool,
duration_ms: Option<u64>,
) -> Self
pub fn from_call( tool: impl Into<String>, args: &Value, ok: bool, duration_ms: Option<u64>, ) -> Self
Record one tool call. args are digested, never stored raw: the
digest is the object’s key names (space-joined — useful FTS terms
that cannot leak values) plus b3: + the first 16 hex chars of
BLAKE3 over the canonical JSON, so two turns calling the same tool
with identical args correlate without exposing what the args were.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolEvent
impl<'de> Deserialize<'de> for ToolEvent
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 Eq for ToolEvent
impl StructuralPartialEq for ToolEvent
Auto Trait Implementations§
impl Freeze for ToolEvent
impl RefUnwindSafe for ToolEvent
impl Send for ToolEvent
impl Sync for ToolEvent
impl Unpin for ToolEvent
impl UnsafeUnpin for ToolEvent
impl UnwindSafe for ToolEvent
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<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.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
impl<T> ErasedDestructor for Twhere
T: 'static,
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