pub struct ToolInvocationHistoryVerifier { /* private fields */ }Expand description
Streaming validator for one complete ascending invocation history.
Rejections are transactional: Self::verify_next never advances the last
accepted record on failure. A store may therefore page immutable revisions
without buffering the whole history while still proving every transition.
Implementations§
Source§impl ToolInvocationHistoryVerifier
impl ToolInvocationHistoryVerifier
Sourcepub fn after(record: ToolInvocation) -> Self
pub fn after(record: ToolInvocation) -> Self
Continues after one already trusted, fully restored record.
A paged store must first reload the cursor by exact identity and compare its canonical record before using this constructor. This preserves the predecessor failure payload needed to authorize a retry transition.
Sourcepub fn head(&self) -> Option<ToolInvocationHead>
pub fn head(&self) -> Option<ToolInvocationHead>
Returns the last verified head, if any.
Sourcepub const fn has_records(&self) -> bool
pub const fn has_records(&self) -> bool
Returns whether at least one revision has been verified.
Sourcepub fn verify_next(
&mut self,
record: &ToolInvocation,
) -> Result<(), ToolInvocationHistoryError>
pub fn verify_next( &mut self, record: &ToolInvocation, ) -> Result<(), ToolInvocationHistoryError>
Verifies and then advances to the next ascending revision.
§Errors
Returns ToolInvocationHistoryError for a non-initial first record,
intent substitution, head mismatch, unsafe retry, or any other state
transition failure.