From 890b41faaf82a3a3d5b4d827497ed2e9e2549ba8 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 22 Oct 2026 12:58:35 -0700 Subject: [PATCH] Trim the public API of the Engine Shrink the public API of the Engine by removing public items and narrowing others to `pub(crate)`. The change spans the parser, types, vfs, lua, and engine crates and the `runvil` facade. `crates/runvil/public-api.txt` loses 52 lines to match. - Remove `Prompt::strip_h1_prose`, the `description_text` field, `RunContext::cancel_handle`, `RunContext::current_model`, `RunContext::depth`, `RunContext::name`, `ModelCatalog::is_empty`, `ToolIdError::field`, `ModeHandle::mode`, `SectionVm::global_json`, and `runvil_version`. - Remove the `Depth` and `GlobKind` enums and the forms that take them: `mkdir_with` and `remove_with` on `Access` and `VfsAccess`, and `glob_with` on `VfsAccess`. Remove `Access::read_range`, `Access::read_range_numbered`, and the helper `with_line_range`. - Stop exporting `RunUid`, `GlobalNameErrorKind`, and `OpSink` from the `runvil` facade. `RunContext::uid` and `GlobalNameError::kind` become `pub(crate)`, because they return types that the facade no longer exports. - Narrow 48 items in total to `pub(crate)`, for example `RunLimits::tool_iterations`, `SourceLocation::new`, `FailureRecord::new`, `RealBackend::with_read_only`, `Compactor`, and `SharedSource`. Items that only tests call also get `#[cfg(test)]`. - `split_h1` now returns `Vec` and no longer builds the description string. The `Debug` output of `RunContext` no longer shows `depth`. - The tests for `read_range`, `read_range_numbered`, `remove_with`, `mkdir_with`, and `runvil_version` are deleted with the code, and nothing replaces them. The `glob_with` test now calls `glob_kind`, and the parser tests that read `description_text` now check `h1_blocks`. --- .../engine/src/execute/config-limits.rs | 8 +- .../engine/src/execute/config.rs | 43 +--------- .../engine/src/execute/error.rs | 11 ++- .../engine/src/execute/run/effect.rs | 4 +- crates/runvil-internal/lua/src/compactors.rs | 8 +- crates/runvil-internal/lua/src/coro.rs | 2 +- crates/runvil-internal/lua/src/detail.rs | 2 +- crates/runvil-internal/lua/src/dispatch.rs | 6 +- .../lua/src/engine_globals-store.rs | 2 +- crates/runvil-internal/lua/src/error-value.rs | 15 ++-- crates/runvil-internal/lua/src/error.rs | 2 +- crates/runvil-internal/lua/src/globals.rs | 2 +- crates/runvil-internal/lua/src/handles.rs | 2 +- crates/runvil-internal/lua/src/lib.rs | 9 +-- crates/runvil-internal/lua/src/messages.rs | 4 +- .../lua/src/protocol/answer.rs | 4 +- .../lua/src/protocol/non_empty.rs | 7 +- .../lua/src/protocol/record.rs | 4 +- crates/runvil-internal/lua/src/require.rs | 2 +- crates/runvil-internal/lua/src/scope.rs | 6 +- .../lua/src/tests/store_errors.rs | 2 +- crates/runvil-internal/lua/src/vm.rs | 7 +- crates/runvil-internal/lua/src/vm/inject.rs | 3 +- crates/runvil-internal/lua/src/vm/state.rs | 19 ----- crates/runvil-internal/parser/src/error.rs | 2 +- crates/runvil-internal/parser/src/fence.rs | 12 +-- .../runvil-internal/parser/src/frontmatter.rs | 29 +------ crates/runvil-internal/parser/src/lib.rs | 6 +- crates/runvil-internal/parser/src/parse.rs | 4 +- crates/runvil-internal/parser/src/prompt.rs | 17 +--- crates/runvil-internal/parser/src/tests.rs | 1 - .../parser/src/tests/breaks.rs | 3 +- .../parser/src/tests/frontmatter.rs | 43 +--------- .../parser/src/tests/h1_fences.rs | 11 ++- .../parser/src/tests/headings.rs | 5 +- crates/runvil-internal/types/src/emitter.rs | 3 +- crates/runvil-internal/types/src/models.rs | 8 +- crates/runvil-internal/types/src/names.rs | 11 +-- crates/runvil-internal/types/src/seed.rs | 4 +- crates/runvil-internal/types/src/tools/ids.rs | 6 -- crates/runvil-internal/types/src/untrusted.rs | 2 +- crates/runvil-internal/vfs/src/handle.rs | 2 +- .../runvil-internal/vfs/src/handle/access.rs | 35 -------- .../vfs/src/handle/operations.rs | 76 +----------------- .../vfs/src/handle/tests/operations.rs | 77 +----------------- crates/runvil-internal/vfs/src/lib.rs | 16 +--- crates/runvil-internal/vfs/src/real.rs | 6 +- crates/runvil-internal/vfs/src/traits.rs | 2 +- .../runvil-internal/vfs/src/traits/backend.rs | 79 +------------------ .../runvil-internal/vfs/src/traits/tests.rs | 44 +++-------- crates/runvil/public-api.txt | 52 ------------ crates/runvil/src/lib.rs | 5 -- 52 files changed, 122 insertions(+), 613 deletions(-) diff --git a/crates/runvil-internal/engine/src/execute/config-limits.rs b/crates/runvil-internal/engine/src/execute/config-limits.rs index fc682ee3a..448754ce9 100644 --- a/crates/runvil-internal/engine/src/execute/config-limits.rs +++ b/crates/runvil-internal/engine/src/execute/config-limits.rs @@ -118,14 +118,14 @@ impl RunLimits { /// Returns the default maximum number of tool iterations per section. #[must_use] - pub fn tool_iterations(&self) -> NonZeroU32 { + pub(crate) fn tool_iterations(&self) -> NonZeroU32 { self.max_tool_iterations } /// Returns the run's concurrency ceiling: the most tasks the /// scheduler admits at once across the whole run. #[must_use] - pub fn concurrency(&self) -> NonZeroUsize { + pub(crate) fn concurrency(&self) -> NonZeroUsize { self.concurrency } @@ -137,14 +137,14 @@ impl RunLimits { /// Returns the memory ceiling for each Lua virtual machine, in bytes. #[must_use] - pub fn lua_memory(&self) -> NonZeroUsize { + pub(crate) fn lua_memory(&self) -> NonZeroUsize { self.lua_memory_bytes } /// Returns the maximum number of `log` events that a prompt's Lua code /// can record in each Lua virtual machine. #[must_use] - pub fn lua_logs(&self) -> NonZeroU32 { + pub(crate) fn lua_logs(&self) -> NonZeroU32 { self.lua_log_events } diff --git a/crates/runvil-internal/engine/src/execute/config.rs b/crates/runvil-internal/engine/src/execute/config.rs index db4745484..d1e13aa29 100644 --- a/crates/runvil-internal/engine/src/execute/config.rs +++ b/crates/runvil-internal/engine/src/execute/config.rs @@ -45,8 +45,8 @@ use super::requirements::{Requirements, UnavailablePack}; /// CSPRNG and read the start time from its own clock. The caller records both /// values, and a replay passes back the recorded ones. Given the same /// inputs and the same answers, a run reproduces its run id, nonces, -/// `sys.when`, effects, and events. The `Debug` form shows the run id -/// ([`uid`](RunContext::uid)) and never the seed. +/// `sys.when`, effects, and events. The `Debug` form shows the run id and +/// never the seed. #[non_exhaustive] pub struct RunContext { /// Run identity, stamped on every report and event. @@ -65,9 +65,6 @@ pub struct RunContext { /// count, so the run's root task continues the sequence and /// `(task, seq)` is unique across the parse/run boundary. pub(super) provenance_start: u32, - /// Model-orchestrated prompt-tool nesting depth: 0 for a root run. - /// Nothing increments it, so it is always 0. - depth: u32, /// Whether the run reports each model round's raw request and response /// bodies as `Request` and `Response` events. Off by default: the /// bodies already travel in the `Chat` effect and its answer, and the @@ -134,7 +131,6 @@ impl RunContext { flags: Flags::EMPTY, started_at, provenance_start: 0, - depth: 0, report_debug: DebugMode::Off, cancel: CancelHandle::new(), limits: RunLimits::new(), @@ -345,22 +341,6 @@ impl RunContext { &self.vfs } - /// Returns the run's current model, or `None` by default. - #[must_use] - pub fn current_model(&self) -> Option<&ModelInfo> { - self.model.as_ref() - } - - /// Returns the run's cancel flag. - /// - /// The caller watches this flag, so one cancel reaches the run and the - /// effects the caller has in flight. Replace the flag with - /// [`cancel`](RunContext::cancel). - #[must_use] - pub fn cancel_handle(&self) -> CancelHandle { - self.cancel.clone() - } - /// Returns the run's model bindings, which map each declared role to a /// concrete model. /// @@ -387,13 +367,6 @@ impl RunContext { &self.tools } - /// Returns the run's name, which identifies the run on every report and - /// event. - #[must_use] - pub fn name(&self) -> &str { - &self.name - } - /// Returns the run's seed, as the caller supplied it. #[must_use] pub fn seed(&self) -> RunSeed { @@ -406,7 +379,7 @@ impl RunContext { /// without revealing the seed or the nonce. A replay under the recorded /// seed has the same id. #[must_use] - pub fn uid(&self) -> RunUid { + pub(crate) fn uid(&self) -> RunUid { RunUid::from_seed(&self.seed) } @@ -422,15 +395,6 @@ impl RunContext { pub fn started_at(&self) -> Timestamp { self.started_at } - - /// Returns how many model-orchestrated prompt tools this run is nested - /// inside. - /// - /// The depth is 0 for a root run. - #[must_use] - pub fn depth(&self) -> u32 { - self.depth - } } impl fmt::Debug for RunContext { @@ -442,7 +406,6 @@ impl fmt::Debug for RunContext { .field("flags", &self.flags) .field("started_at", &self.started_at) .field("provenance_start", &self.provenance_start) - .field("depth", &self.depth) .field("report_debug", &self.report_debug) .field("cancel", &self.cancel) .field("limits", &self.limits) diff --git a/crates/runvil-internal/engine/src/execute/error.rs b/crates/runvil-internal/engine/src/execute/error.rs index 34bf6ff1e..d2f5c90bc 100644 --- a/crates/runvil-internal/engine/src/execute/error.rs +++ b/crates/runvil-internal/engine/src/execute/error.rs @@ -61,8 +61,7 @@ pub enum RunErrorKind { /// The error's [`RunErrorKind`] says which of the two it is, and the /// extension of `path` says so too. Use the kind to branch in code, the /// error message to show a reader, and the location to navigate to the -/// fault. Build one with [`new`](SourceLocation::new) and the `with_` -/// methods. +/// fault. Only the Engine builds one. #[derive(Debug, Clone, PartialEq, Eq)] #[non_exhaustive] pub struct SourceLocation { @@ -93,7 +92,7 @@ pub struct SourceLocation { impl SourceLocation { /// Builds a location in `path` with no line, column, or span. #[must_use] - pub fn new(path: impl Into) -> SourceLocation { + pub(crate) fn new(path: impl Into) -> SourceLocation { SourceLocation { path: path.into(), line: None, @@ -104,21 +103,21 @@ impl SourceLocation { /// Sets the 1-based line. #[must_use] - pub fn with_line(mut self, line: Option) -> SourceLocation { + pub(crate) fn with_line(mut self, line: Option) -> SourceLocation { self.line = line; self } /// Sets the 1-based column. #[must_use] - pub fn with_column(mut self, column: Option) -> SourceLocation { + pub(crate) fn with_column(mut self, column: Option) -> SourceLocation { self.column = column; self } /// Sets the byte span of the offending region in the document body. #[must_use] - pub fn with_span(mut self, span: Option>) -> SourceLocation { + pub(crate) fn with_span(mut self, span: Option>) -> SourceLocation { self.span = span; self } diff --git a/crates/runvil-internal/engine/src/execute/run/effect.rs b/crates/runvil-internal/engine/src/execute/run/effect.rs index 07db1eba9..cbdf9aac6 100644 --- a/crates/runvil-internal/engine/src/execute/run/effect.rs +++ b/crates/runvil-internal/engine/src/execute/run/effect.rs @@ -391,7 +391,7 @@ impl FailureRecord { /// Builds the record of a failure of kind `kind` with `message` as its /// display text. #[must_use] - pub fn new(kind: impl Into, message: impl Into) -> FailureRecord { + pub(crate) fn new(kind: impl Into, message: impl Into) -> FailureRecord { FailureRecord { kind: kind.into(), message: message.into(), @@ -485,7 +485,7 @@ pub struct ToolAnswerRecord { impl ToolAnswerRecord { /// Builds the record of an output of `text` at `trust`. #[must_use] - pub fn new(text: impl Into, trust: OutputTrust) -> ToolAnswerRecord { + pub(crate) fn new(text: impl Into, trust: OutputTrust) -> ToolAnswerRecord { ToolAnswerRecord { text: text.into(), trust, diff --git a/crates/runvil-internal/lua/src/compactors.rs b/crates/runvil-internal/lua/src/compactors.rs index ea6f26210..80792b7da 100644 --- a/crates/runvil-internal/lua/src/compactors.rs +++ b/crates/runvil-internal/lua/src/compactors.rs @@ -60,7 +60,7 @@ impl OverflowReason { /// The invocation tag the compactor callback receives, also the /// `reason` field of a `context_exhausted` error table. #[must_use] - pub fn tag(self) -> &'static str { + pub(crate) fn tag(self) -> &'static str { match self { OverflowReason::Precheck => "precheck", OverflowReason::Provider => "provider", @@ -85,7 +85,7 @@ impl std::fmt::Display for OverflowReason { /// An overflow tag's description, or any other reason as given. /// /// This is the detail a context exhaustion's message shows: an exact -/// [`OverflowReason::tag`] reads as that overflow's [`Display`](std::fmt::Display), +/// `OverflowReason::tag` reads as that overflow's [`Display`](std::fmt::Display), /// and a caller's own reason reads as itself. #[must_use] pub fn exhaustion_detail(reason: &str) -> Cow<'_, str> { @@ -102,7 +102,7 @@ pub fn exhaustion_detail(reason: &str) -> Cow<'_, str> { /// so a section can start its conversation over without leaving, and /// refuses unless a compactor is running over the list. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] -pub enum Compactor { +pub(crate) enum Compactor { /// `compactors.fail`: always raises [`Error::ContextExhausted`]. #[default] Fail, @@ -120,7 +120,7 @@ impl Compactor { /// `Fail` always returns [`Error::ContextExhausted`] holding `reason`; /// `Clear` returns [`Error::Lua`] when no compactor is running over /// `list`, and leaves it unchanged. - pub fn invoke(self, list: &MessageList, reason: &str) -> Result<()> { + pub(crate) fn invoke(self, list: &MessageList, reason: &str) -> Result<()> { match self { Compactor::Fail => Err(Error::ContextExhausted { reason: reason.to_owned(), diff --git a/crates/runvil-internal/lua/src/coro.rs b/crates/runvil-internal/lua/src/coro.rs index f570a6471..f9bf8a4bd 100644 --- a/crates/runvil-internal/lua/src/coro.rs +++ b/crates/runvil-internal/lua/src/coro.rs @@ -29,8 +29,8 @@ use std::sync::{Arc, LazyLock}; use mlua::{Function, Lua, StdLib, Table, Value}; -use crate::SharedSource; use crate::engine_globals::route_store_to_shims; +use crate::error::SharedSource; use crate::error::{Error, Result}; use crate::error_value::{install_error_value, install_normalize_failure}; use crate::hardening::InstructionBudget; diff --git a/crates/runvil-internal/lua/src/detail.rs b/crates/runvil-internal/lua/src/detail.rs index 676d6ffb1..899cea422 100644 --- a/crates/runvil-internal/lua/src/detail.rs +++ b/crates/runvil-internal/lua/src/detail.rs @@ -1,6 +1,6 @@ //! The constructor the compiled-program statics wrap their failure with. -use crate::SharedSource; +use crate::error::SharedSource; /// Wraps a concrete error as a shareable cause. #[must_use] diff --git a/crates/runvil-internal/lua/src/dispatch.rs b/crates/runvil-internal/lua/src/dispatch.rs index 5d2b148ac..39ae703cf 100644 --- a/crates/runvil-internal/lua/src/dispatch.rs +++ b/crates/runvil-internal/lua/src/dispatch.rs @@ -65,16 +65,18 @@ pub struct ToolDispatch { impl ToolDispatch { /// The final content: trusted output verbatim, anything else /// nonce-wrapped. + #[cfg(test)] #[must_use] - pub fn content(&self) -> &str { + pub(crate) fn content(&self) -> &str { &self.content } /// The content's trust marking: [`OutputTrust::Trusted`] /// for verbatim output, [`OutputTrust::Untrusted`] for the /// nonce-wrapped envelope. + #[cfg(test)] #[must_use] - pub fn trust(&self) -> OutputTrust { + pub(crate) fn trust(&self) -> OutputTrust { self.trust } diff --git a/crates/runvil-internal/lua/src/engine_globals-store.rs b/crates/runvil-internal/lua/src/engine_globals-store.rs index 23ca38914..aff406e40 100644 --- a/crates/runvil-internal/lua/src/engine_globals-store.rs +++ b/crates/runvil-internal/lua/src/engine_globals-store.rs @@ -10,7 +10,7 @@ use runvil_types::event::lifecycle::{self, Lifecycle}; use runvil_vfs::{Access, VfsError}; use super::{read_store, read_store_numbered}; -use crate::SharedSource; +use crate::error::SharedSource; use crate::error::{Error, Result}; use crate::program::LuaProgram; use crate::protocol::VfsOp; diff --git a/crates/runvil-internal/lua/src/error-value.rs b/crates/runvil-internal/lua/src/error-value.rs index f52995dcd..66d95326e 100644 --- a/crates/runvil-internal/lua/src/error-value.rs +++ b/crates/runvil-internal/lua/src/error-value.rs @@ -81,7 +81,7 @@ pub enum ErrorKind { impl ErrorKind { /// Every kind, in declaration order. - pub const ALL: &'static [ErrorKind] = &[ + pub(crate) const ALL: &'static [ErrorKind] = &[ ErrorKind::ToolLoopExhausted, ErrorKind::ContextExhausted, ErrorKind::EmptyModelReply, @@ -99,7 +99,7 @@ impl ErrorKind { /// Returns the `kind` string the Lua table holds. #[must_use] - pub fn tag(self) -> &'static str { + pub(crate) fn tag(self) -> &'static str { match self { ErrorKind::ToolLoopExhausted => "tool_loop_exhausted", ErrorKind::ContextExhausted => "context_exhausted", @@ -119,7 +119,7 @@ impl ErrorKind { /// Parses a `kind` string; `None` for a tag outside the vocabulary. #[must_use] - pub fn from_tag(tag: &str) -> Option { + pub(crate) fn from_tag(tag: &str) -> Option { match tag { "tool_loop_exhausted" => Some(ErrorKind::ToolLoopExhausted), "context_exhausted" => Some(ErrorKind::ContextExhausted), @@ -148,7 +148,7 @@ impl std::fmt::Display for ErrorKind { impl FromStr for ErrorKind { type Err = ParseErrorKindError; - /// Parses a kind from its exact tag, as [`ErrorKind::from_tag`] does. + /// Parses a kind from its exact tag, as `ErrorKind::from_tag` does. fn from_str(tag: &str) -> Result { ErrorKind::from_tag(tag).ok_or_else(|| ParseErrorKindError { input: tag.to_owned(), @@ -169,8 +169,9 @@ pub struct ParseErrorKindError { impl ParseErrorKindError { /// Returns the rejected text. + #[cfg(test)] #[must_use] - pub fn input(&self) -> &str { + pub(crate) fn input(&self) -> &str { &self.input } } @@ -266,7 +267,7 @@ impl ErrorValue for Error { /// /// This is the shape a block coroutine's failure takes when the raised /// value was an error table (built by the shim's `raise` or by -/// [`error_table`]) and no retained typed error was substituted for it - +/// `error_table`) and no retained typed error was substituted for it - /// the case for a Lua-side raise. The executor maps it back onto its own /// internal type by kind. #[derive(Debug, Clone, PartialEq, Eq)] @@ -334,7 +335,7 @@ fn finish_table(lua: &Lua, kind: ErrorKind, fields: Table) -> mlua::Result mlua::Result
{ +pub(crate) fn error_table(lua: &Lua, error: &impl ErrorValue) -> mlua::Result
{ let table = lua.create_table()?; table.raw_set("message", error.to_string())?; for (name, value) in error.fields() { diff --git a/crates/runvil-internal/lua/src/error.rs b/crates/runvil-internal/lua/src/error.rs index d5d4f4ae9..7daaf4709 100644 --- a/crates/runvil-internal/lua/src/error.rs +++ b/crates/runvil-internal/lua/src/error.rs @@ -32,7 +32,7 @@ type BoxedSource = Box; /// globals chunk, and the store shims) are the callers, through /// `detail::shared_source_new`. #[derive(Debug, Clone)] -pub struct SharedSource(pub(crate) std::sync::Arc); +pub(crate) struct SharedSource(pub(crate) std::sync::Arc); impl std::fmt::Display for SharedSource { fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/crates/runvil-internal/lua/src/globals.rs b/crates/runvil-internal/lua/src/globals.rs index 6b4ef2349..bb2e3a2d0 100644 --- a/crates/runvil-internal/lua/src/globals.rs +++ b/crates/runvil-internal/lua/src/globals.rs @@ -39,7 +39,7 @@ use std::sync::LazyLock; use mlua::{AnyUserData, Function, Lua, Table, Value}; -use crate::SharedSource; +use crate::error::SharedSource; use crate::error::{Error, Result}; use crate::program::LuaProgram; diff --git a/crates/runvil-internal/lua/src/handles.rs b/crates/runvil-internal/lua/src/handles.rs index 9df05bf3b..2038e5f4e 100644 --- a/crates/runvil-internal/lua/src/handles.rs +++ b/crates/runvil-internal/lua/src/handles.rs @@ -216,7 +216,7 @@ impl ToolSet { /// Returns every installed Pack the caller reports, with the reason, /// written for the model, when it cannot serve the run. #[must_use] - pub fn roster(&self) -> &BTreeMap> { + pub(crate) fn roster(&self) -> &BTreeMap> { &self.roster } diff --git a/crates/runvil-internal/lua/src/lib.rs b/crates/runvil-internal/lua/src/lib.rs index 352c5d8cb..d7df4460d 100644 --- a/crates/runvil-internal/lua/src/lib.rs +++ b/crates/runvil-internal/lua/src/lib.rs @@ -112,7 +112,7 @@ mod tests; pub use crate::argv::Argv; pub use crate::collection::render_item; pub use crate::compactors::{ - Compactor, OverflowReason, UsageAnchor, exhaustion_detail, output_reserve, precheck, + OverflowReason, UsageAnchor, exhaustion_detail, output_reserve, precheck, }; pub use crate::coro::{install_section_loop_shim, install_store_shims}; pub use crate::dispatch::{ @@ -121,17 +121,16 @@ pub use crate::dispatch::{ pub use crate::engine_globals::{ install_ui, run_store_op, store_error_message, store_probe_message, }; -pub use crate::error::{Error, QuotaResource, SharedSource}; +pub use crate::error::{Error, QuotaResource}; pub use crate::error_value::{ - ErrorField, ErrorKind, ErrorValue, ParseErrorKindError, Raised, error_table, - store_error_value_fields, + ErrorField, ErrorKind, ErrorValue, ParseErrorKindError, Raised, store_error_value_fields, }; pub use crate::globals::{RESERVED_NAMES, Reserved, reserved_name}; pub use crate::handles::{ Library, LibraryBlock, LibraryKey, LuaBlockResult, SectionText, ToolBinding, ToolOutputKind, ToolSet, }; -pub use crate::messages::{ListEditError, MessageList}; +pub use crate::messages::MessageList; pub use crate::models::ModelRuntime; pub use crate::prelude::install_preludes; pub use crate::program::LuaProgram; diff --git a/crates/runvil-internal/lua/src/messages.rs b/crates/runvil-internal/lua/src/messages.rs index b2dc19649..d80e8eb89 100644 --- a/crates/runvil-internal/lua/src/messages.rs +++ b/crates/runvil-internal/lua/src/messages.rs @@ -74,7 +74,7 @@ pub struct MessageList(Arc>); /// Why a [`MessageList`] refused an edit, which leaves the list unchanged. #[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)] -pub enum ListEditError { +pub(crate) enum ListEditError { /// A system record at the 1-based `index` would sit behind a /// non-system record. #[error( @@ -207,7 +207,7 @@ impl MessageList { /// Whether a rendered tool list is attached; no list means false. #[must_use] - pub fn rendered(&self) -> bool { + pub(crate) fn rendered(&self) -> bool { self.state().rendered.is_some() } diff --git a/crates/runvil-internal/lua/src/protocol/answer.rs b/crates/runvil-internal/lua/src/protocol/answer.rs index 7733f2444..1c16ec96a 100644 --- a/crates/runvil-internal/lua/src/protocol/answer.rs +++ b/crates/runvil-internal/lua/src/protocol/answer.rs @@ -171,7 +171,7 @@ impl TaskPhase { /// The tag `tasks.status` reports: `running`, `done`, `cancelled`, or /// `abandoned`. #[must_use] - pub fn tag(self) -> &'static str { + pub(crate) fn tag(self) -> &'static str { match self { TaskPhase::Running => "running", TaskPhase::Done => "done", @@ -203,7 +203,7 @@ impl Blocked { /// The tag `tasks.status` reports: `chat`, `tool_call`, `store`, /// `tasks`, `call`, or `queued`. #[must_use] - pub fn tag(self) -> &'static str { + pub(crate) fn tag(self) -> &'static str { match self { Blocked::Chat => "chat", Blocked::ToolCall => "tool_call", diff --git a/crates/runvil-internal/lua/src/protocol/non_empty.rs b/crates/runvil-internal/lua/src/protocol/non_empty.rs index 35cb23a3c..e736d885c 100644 --- a/crates/runvil-internal/lua/src/protocol/non_empty.rs +++ b/crates/runvil-internal/lua/src/protocol/non_empty.rs @@ -10,8 +10,9 @@ pub struct NonEmpty(Vec); impl NonEmpty { /// The sequence of `first` followed by `rest`. + #[cfg(test)] #[must_use] - pub fn new(first: T, rest: Vec) -> Self { + pub(crate) fn new(first: T, rest: Vec) -> Self { let mut items = Vec::with_capacity(rest.len() + 1); items.push(first); items.extend(rest); @@ -20,7 +21,7 @@ impl NonEmpty { /// `items` as a non-empty sequence, or `None` when it holds nothing. #[must_use] - pub fn from_vec(items: Vec) -> Option { + pub(crate) fn from_vec(items: Vec) -> Option { if items.is_empty() { None } else { @@ -36,7 +37,7 @@ impl NonEmpty { /// The sequence of `items` followed by this one's elements. #[must_use] - pub fn preceded_by(mut self, mut items: Vec) -> Self { + pub(crate) fn preceded_by(mut self, mut items: Vec) -> Self { items.append(&mut self.0); Self(items) } diff --git a/crates/runvil-internal/lua/src/protocol/record.rs b/crates/runvil-internal/lua/src/protocol/record.rs index ed9868cd0..6f383a5b5 100644 --- a/crates/runvil-internal/lua/src/protocol/record.rs +++ b/crates/runvil-internal/lua/src/protocol/record.rs @@ -64,7 +64,7 @@ pub enum RecordRole { impl RecordRole { /// The wire role. #[must_use] - pub fn kind(&self) -> Role { + pub(crate) fn kind(&self) -> Role { match self { RecordRole::System => Role::System, RecordRole::User => Role::User, @@ -75,7 +75,7 @@ impl RecordRole { /// The call ID a tool result answers; `None` for every other role. #[must_use] - pub fn tool_call_id(&self) -> Option<&str> { + pub(crate) fn tool_call_id(&self) -> Option<&str> { match self { RecordRole::Tool { tool_call_id } => Some(tool_call_id), RecordRole::System | RecordRole::User | RecordRole::Assistant => None, diff --git a/crates/runvil-internal/lua/src/require.rs b/crates/runvil-internal/lua/src/require.rs index d6b56c2e0..1a01674a3 100644 --- a/crates/runvil-internal/lua/src/require.rs +++ b/crates/runvil-internal/lua/src/require.rs @@ -21,7 +21,7 @@ use mlua::{AnyUserData, Function, Lua, Value}; use runvil_types::emitter::{Emitter, LibraryLoad}; use serde_json::Value as Json; -use crate::SharedSource; +use crate::error::SharedSource; use crate::error::{Error, Result}; use crate::error_value::install_error_value; use crate::handles::{Library, LibraryKey}; diff --git a/crates/runvil-internal/lua/src/scope.rs b/crates/runvil-internal/lua/src/scope.rs index e37fc3cd3..d33376ce8 100644 --- a/crates/runvil-internal/lua/src/scope.rs +++ b/crates/runvil-internal/lua/src/scope.rs @@ -25,7 +25,7 @@ pub struct ToolCallCounts { impl ToolCallCounts { /// Creates a counts map pre-seeded with 0 for every name. #[must_use] - pub fn new(names: impl IntoIterator) -> Self { + pub(crate) fn new(names: impl IntoIterator) -> Self { let map: BTreeMap = names.into_iter().map(|name| (name, 0)).collect(); Self { inner: Arc::new(Mutex::new(map)), @@ -69,7 +69,7 @@ impl ToolCallCounts { /// /// # Errors /// Returns [`Error::Internal`] if the mutex is poisoned. - pub fn get(&self, name: &str) -> Result> { + pub(crate) fn get(&self, name: &str) -> Result> { Ok(self.lock()?.get(name).copied()) } @@ -77,7 +77,7 @@ impl ToolCallCounts { /// /// # Errors /// Returns [`Error::Internal`] if the mutex is poisoned. - pub fn names(&self) -> Result> { + pub(crate) fn names(&self) -> Result> { Ok(self.lock()?.keys().cloned().collect()) } } diff --git a/crates/runvil-internal/lua/src/tests/store_errors.rs b/crates/runvil-internal/lua/src/tests/store_errors.rs index b972b41a3..e11b39ccb 100644 --- a/crates/runvil-internal/lua/src/tests/store_errors.rs +++ b/crates/runvil-internal/lua/src/tests/store_errors.rs @@ -363,7 +363,7 @@ fn a_raised_store_error_renders_an_integer_count_and_the_message() { let fields = error.fields(); assert!(fields.contains(&("count".to_owned(), crate::ErrorField::Integer(3),))); let lua = mlua::Lua::new(); - let table = crate::error_table(&lua, &error).expect("the table builds"); + let table = crate::error_value::error_table(&lua, &error).expect("the table builds"); let raised = crate::error_value::raised_from(&lua, &Value::Table(table)) .expect("the table reads back") .expect("the table is a structured error table"); diff --git a/crates/runvil-internal/lua/src/vm.rs b/crates/runvil-internal/lua/src/vm.rs index e6c211c7e..ad657c32f 100644 --- a/crates/runvil-internal/lua/src/vm.rs +++ b/crates/runvil-internal/lua/src/vm.rs @@ -253,7 +253,7 @@ impl SectionVm { /// /// # Errors /// Returns [`Error::LuaRuntime`] if the VM cannot be built or hardened. - pub fn new(nonce: &GuardNonce, emitter: &Emitter, section: &str) -> Result { + pub(crate) fn new(nonce: &GuardNonce, emitter: &Emitter, section: &str) -> Result { let lua = Lua::new_with( StdLib::STRING | StdLib::TABLE | StdLib::MATH | StdLib::UTF8, LuaOptions::default(), @@ -344,7 +344,7 @@ impl SectionVm { /// budget (`lua_log_events`). Called by the executor right after /// construction, ahead of the Pack preludes and every block, so they /// already spend the caller's run limits rather than only the safe - /// non-env defaults installed in [`SectionVm::new`]. + /// non-env defaults installed in `SectionVm::new`. /// /// # Errors /// Returns [`Error::LuaRuntime`] if the underlying VM rejects the memory @@ -397,8 +397,9 @@ impl SectionVm { /// The section's one conversation, which the `messages` global holds /// from Engine injection until the VM drops. + #[cfg(test)] #[must_use] - pub fn messages(&self) -> &MessageList { + pub(crate) fn messages(&self) -> &MessageList { &self.messages } diff --git a/crates/runvil-internal/lua/src/vm/inject.rs b/crates/runvil-internal/lua/src/vm/inject.rs index 84ea5e4ae..f8c7de7ac 100644 --- a/crates/runvil-internal/lua/src/vm/inject.rs +++ b/crates/runvil-internal/lua/src/vm/inject.rs @@ -29,8 +29,9 @@ pub struct InjectFailure { impl InjectFailure { /// Why the injection failed. + #[cfg(test)] #[must_use] - pub fn error(&self) -> &Error { + pub(crate) fn error(&self) -> &Error { &self.error } diff --git a/crates/runvil-internal/lua/src/vm/state.rs b/crates/runvil-internal/lua/src/vm/state.rs index efb1b5e47..5c5b21596 100644 --- a/crates/runvil-internal/lua/src/vm/state.rs +++ b/crates/runvil-internal/lua/src/vm/state.rs @@ -29,25 +29,6 @@ impl SectionVm { var_to_json(&self.lua) } - /// Reads a bare global for prose substitution: `None` when the global is - /// unset, its JSON form when set. - /// - /// # Errors - /// Returns [`Error::Lua`] when the global is a function, userdata, or - /// thread (bare globals in prose must be data), or when its value cannot - /// be represented as JSON. - pub fn global_json(&self, name: &str) -> Result> { - let value: Value = self.lua.globals().get(name).map_err(Error::lua)?; - match value { - Value::Nil => Ok(None), - Value::Function(_) | Value::UserData(_) | Value::Thread(_) => Err(Error::Lua(format!( - "global `{name}` is a {}; bare globals in prose must be JSON data", - value.type_name() - ))), - other => Ok(Some(self.lua.from_value(other).map_err(Error::lua)?)), - } - } - /// Reads the `argv` global back as JSON at the H1 freeze: `None` when /// nil, its JSON form otherwise. Call this on the H1 VM only - a frozen /// section's `argv` sits behind the guard proxy, which is not the diff --git a/crates/runvil-internal/parser/src/error.rs b/crates/runvil-internal/parser/src/error.rs index 78c7d44d5..4d00f03a7 100644 --- a/crates/runvil-internal/parser/src/error.rs +++ b/crates/runvil-internal/parser/src/error.rs @@ -116,7 +116,7 @@ impl Error { /// The failure's `Display` already holds the cause's text. Every other /// failure returns `None`. #[must_use] - pub fn cause(&self) -> Option<&(dyn std::error::Error + Send + Sync + 'static)> { + pub(crate) fn cause(&self) -> Option<&(dyn std::error::Error + Send + Sync + 'static)> { match self { Error::ParseFrontmatter { cause, .. } => Some(cause.as_ref()), Error::Lua(lua) => lua.cause(), diff --git a/crates/runvil-internal/parser/src/fence.rs b/crates/runvil-internal/parser/src/fence.rs index 605276f9c..87568f473 100644 --- a/crates/runvil-internal/parser/src/fence.rs +++ b/crates/runvil-internal/parser/src/fence.rs @@ -41,7 +41,7 @@ pub(super) fn split_h1( title: &str, content_abs_line: u32, emitter: &Emitter, -) -> Result<(Vec, String)> { +) -> Result> { let raw_blocks = split_section_blocks(content, title)?; let mut blocks = Vec::with_capacity(raw_blocks.len()); for raw in raw_blocks { @@ -71,15 +71,7 @@ pub(super) fn split_h1( ) { blocks.clear(); } - let description_text = blocks - .iter() - .filter_map(|block| match block { - Block::Prose { text, .. } if !text.as_str().is_empty() => Some(text.as_str()), - _ => None, - }) - .collect::>() - .join("\n\n"); - Ok((blocks, description_text)) + Ok(blocks) } /// Removes complete leading lines that contain only whitespace. diff --git a/crates/runvil-internal/parser/src/frontmatter.rs b/crates/runvil-internal/parser/src/frontmatter.rs index ffcc87ff6..4aedd9de4 100644 --- a/crates/runvil-internal/parser/src/frontmatter.rs +++ b/crates/runvil-internal/parser/src/frontmatter.rs @@ -81,12 +81,12 @@ pub struct Frontmatter { } /// The largest explicit `max_tool_iterations` a prompt may declare. -pub const MAX_TOOL_ITERATIONS: u32 = 1000; +pub(crate) const MAX_TOOL_ITERATIONS: u32 = 1000; /// A frontmatter tool-loop cap: absent or a positive, bounded count. /// /// An omitted cap leaves the runtime's own default in force. Deserialization -/// rejects `0`, negatives, and values above [`MAX_TOOL_ITERATIONS`], so no +/// rejects `0`, negatives, and values above `MAX_TOOL_ITERATIONS`, so no /// invalid cap can reach execution. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] #[non_exhaustive] @@ -110,7 +110,7 @@ impl MaxToolIterations { /// Returns the explicit limit when one was declared. #[must_use] - pub fn limit(self) -> Option { + pub(crate) fn limit(self) -> Option { match self { MaxToolIterations::Default => None, MaxToolIterations::Limit(limit) => Some(limit), @@ -255,26 +255,3 @@ pub(crate) fn split_frontmatter(input: &str) -> Result<(String, String, u32)> { let body = lines.collect::>().join("\n"); Ok((yaml, body, line_count)) } - -/// Reports the runvil Engine major declared in `source`'s frontmatter. -/// -/// Returns `Some(major)` when `source` opens with a YAML frontmatter block that -/// declares a `runvil:` key, and `None` otherwise. The check is lenient by -/// design and never errors or panics: a source with no frontmatter block, -/// malformed or unclosed frontmatter, or a frontmatter that simply omits the -/// key all read as `None` ("not a runvil prompt"). No other frontmatter -/// field is required for detection. -#[must_use] -pub fn runvil_version(source: &str) -> Option { - /// Reads only the `runvil` key, ignoring every other field so - /// detection does not depend on a complete, valid [`Frontmatter`]. - #[derive(serde::Deserialize)] - struct Probe { - #[serde(default)] - runvil: Option, - } - - let (yaml, _body, _lines) = split_frontmatter(source).ok()?; - let probe: Probe = serde_yaml_ng::from_str(&yaml).ok()?; - probe.runvil -} diff --git a/crates/runvil-internal/parser/src/lib.rs b/crates/runvil-internal/parser/src/lib.rs index b1c7b8c97..4e958bad3 100644 --- a/crates/runvil-internal/parser/src/lib.rs +++ b/crates/runvil-internal/parser/src/lib.rs @@ -44,9 +44,9 @@ pub use contract::{ }; use error::Result; pub use error::{Error, ParseError, ParseErrorKind}; -pub use frontmatter::{ - FileDecl, Frontmatter, MAX_TOOL_ITERATIONS, MaxToolIterations, runvil_version, -}; +#[cfg(test)] +use frontmatter::MAX_TOOL_ITERATIONS; +pub use frontmatter::{FileDecl, Frontmatter, MaxToolIterations}; pub use prompt::{Block, Prompt, Section}; #[cfg(test)] diff --git a/crates/runvil-internal/parser/src/parse.rs b/crates/runvil-internal/parser/src/parse.rs index a12228b3c..4531567ee 100644 --- a/crates/runvil-internal/parser/src/parse.rs +++ b/crates/runvil-internal/parser/src/parse.rs @@ -168,8 +168,7 @@ impl Prompt { }; return Err(Error::parse_at(ParseErrorKind::Fence, line, message)); } - let (h1_blocks, description_text) = - fence::split_h1(shared, h1.content, &title, h1_content_abs_line, emitter)?; + let h1_blocks = fence::split_h1(shared, h1.content, &title, h1_content_abs_line, emitter)?; // Everything before the H1 is preface and has no prompt semantics. // Sections are headings after the H1 at level 2 or deeper. @@ -192,7 +191,6 @@ impl Prompt { frontmatter, title, h1_blocks, - description_text, sections, }) } diff --git a/crates/runvil-internal/parser/src/prompt.rs b/crates/runvil-internal/parser/src/prompt.rs index 78d71e700..934f0d3d1 100644 --- a/crates/runvil-internal/parser/src/prompt.rs +++ b/crates/runvil-internal/parser/src/prompt.rs @@ -123,8 +123,9 @@ impl Section { /// [`items`](Self::items) - i.e. it had no Lua blocks and every nonblank /// prose line was a valid list item. Ordinary prose (even prose that /// happens to contain a single bullet line) is not list-only. + #[cfg(test)] #[must_use] - pub fn is_list_only(&self) -> bool { + pub(crate) fn is_list_only(&self) -> bool { !self.items.is_empty() } } @@ -139,8 +140,6 @@ pub struct Prompt { pub(crate) title: String, /// Ordered live Lua and prose blocks from the H1. pub(crate) h1_blocks: Vec, - /// Human-readable prose from the H1. - pub(crate) description_text: String, /// Top-level sections (H2s) in file order. pub(crate) sections: Vec
, } @@ -178,16 +177,4 @@ impl Prompt { pub(crate) fn entry(&self) -> Option<&Section> { self.sections.first() } - - /// Removes every prose block under the prompt's H1 heading, keeping only - /// its compiled Lua blocks. - /// - /// The description text taken from that prose is cleared too. The rest of - /// the prompt tree stays as it is. Use this to run the H1's Lua while - /// withholding its prose from a model. - pub fn strip_h1_prose(&mut self) { - self.h1_blocks - .retain(|block| matches!(block, Block::Lua(_))); - self.description_text.clear(); - } } diff --git a/crates/runvil-internal/parser/src/tests.rs b/crates/runvil-internal/parser/src/tests.rs index c7d7bab8e..d6aac9942 100644 --- a/crates/runvil-internal/parser/src/tests.rs +++ b/crates/runvil-internal/parser/src/tests.rs @@ -201,7 +201,6 @@ fn parses_multi_section_with_all_features() { text: BodyText::from_owned("Human-readable intro text.".to_owned()), }] ); - assert_eq!(p.description_text, "Human-readable intro text."); assert_eq!(p.sections.len(), 2); let first = &p.sections[0]; diff --git a/crates/runvil-internal/parser/src/tests/breaks.rs b/crates/runvil-internal/parser/src/tests/breaks.rs index 3bf24b921..58ab9cb60 100644 --- a/crates/runvil-internal/parser/src/tests/breaks.rs +++ b/crates/runvil-internal/parser/src/tests/breaks.rs @@ -78,11 +78,10 @@ fn a_break_resets_list_item_capture() { #[test] fn h1_break_resets_prose_and_lua_fence_below_stays_live() { // The H1 follows the same reset rule: Markdown above the break is - // commentary excluded from the description, and a `lua` fence below + // commentary that leaves an empty prose block, and a `lua` fence below // the break is live because a break makes nothing reader-only. let h1 = "Description above.\n\n---\n\n```lua\nlocal live = 1\n```\n\nBelow prose."; let prompt = parse_ok(&PromptSource::new().h1_prose(h1).prose("S", "p").build()); - assert_eq!(prompt.description_text, "Below prose."); assert!(matches!( prompt.h1_blocks.as_slice(), [Block::Prose { text: above }, Block::Lua(program), Block::Prose { text: below }] diff --git a/crates/runvil-internal/parser/src/tests/frontmatter.rs b/crates/runvil-internal/parser/src/tests/frontmatter.rs index 868b26b7c..66642de94 100644 --- a/crates/runvil-internal/parser/src/tests/frontmatter.rs +++ b/crates/runvil-internal/parser/src/tests/frontmatter.rs @@ -1,5 +1,5 @@ //! Frontmatter tests: required keys and delimiters, the tool-loop cap, -//! version detection, and declared files. +//! the `runvil:` key, and declared files. use super::*; @@ -80,42 +80,6 @@ fn max_tool_iterations_resolve_uses_default_only_when_absent() { ); } -#[test] -fn detection_reads_runvil_major() { - let src = "---\nname: x\ndescription: d\nrunvil: 0\n---\n\n## S\n\np\n"; - assert_eq!(runvil_version(src), Some(0)); -} - -#[test] -fn detection_needs_only_the_runvil_key() { - // No name or description, but the key is present. - let src = "---\nrunvil: 2\n---\n\n## S\n\np\n"; - assert_eq!(runvil_version(src), Some(2)); -} - -#[test] -fn detection_absent_key_is_none() { - let src = "---\nname: x\ndescription: d\n---\n\n## S\n\np\n"; - assert_eq!(runvil_version(src), None); -} - -#[test] -fn detection_no_frontmatter_is_none() { - let src = "# Just a title\n\nPlain prose with no frontmatter block at all.\n"; - assert_eq!(runvil_version(src), None); -} - -#[test] -fn detection_malformed_frontmatter_is_none() { - // Opening delimiter but never closed. - let unclosed = "---\nrunvil: 0\nname: x\n\n## S\n\np\n"; - assert_eq!(runvil_version(unclosed), None); - - // Closed, but not valid YAML. - let bad_yaml = "---\nrunvil: 0\n : : oops\n---\n\n## S\n\np\n"; - assert_eq!(runvil_version(bad_yaml), None); -} - #[test] fn frontmatter_exposes_runvil_field() { let with = "---\nname: x\ndescription: d\nrunvil: 0\n---\n\n# T\n\n## S\n\np\n"; @@ -152,9 +116,8 @@ fn frontmatter_without_input_output_still_parses() { #[test] fn runvil_zero_is_accepted() { - // `runvil: 0` is the active Engine major: it parses, is exposed on - // the frontmatter, and is reported by version detection. + // `runvil: 0` is the active Engine major: it parses and is exposed on + // the frontmatter. let src = "---\nname: x\ndescription: d\nrunvil: 0\n---\n\n# T\n\n## S\n\np\n"; assert_eq!(parse_ok(src).frontmatter().runvil(), Some(0)); - assert_eq!(runvil_version(src), Some(0)); } diff --git a/crates/runvil-internal/parser/src/tests/h1_fences.rs b/crates/runvil-internal/parser/src/tests/h1_fences.rs index 890d3dac3..efe446bee 100644 --- a/crates/runvil-internal/parser/src/tests/h1_fences.rs +++ b/crates/runvil-internal/parser/src/tests/h1_fences.rs @@ -56,7 +56,6 @@ fn h1_plain_lua_and_prose_are_live_blocks() { &prompt.h1_blocks[2], Block::Lua(program) if program.source() == "store.write('done', reply)" )); - assert_eq!(prompt.description_text, "Plan {{ args }}."); } #[test] @@ -119,7 +118,15 @@ fn label_near_misses_inside_longer_fences_remain_prose() { let src = "---\nname: x\ndescription: d\n---\n\n# T\n\n````markdown\n```lua extra\nreturn 1\n```\n````\n\nIntro.\n\n## S\n\n````markdown\n```lua extra\nreturn 2\n```\n````\n"; let prompt = parse_ok(src); - assert!(prompt.description_text.contains("```lua extra")); + assert!( + prompt + .h1_blocks + .iter() + .all(|block| matches!(block, Block::Prose { .. })) + ); + assert!(prompt.h1_blocks.iter().any( + |block| matches!(block, Block::Prose { text } if text.as_str().contains("```lua extra")) + )); assert!(prompt.sections[0].prologue().is_none()); assert!(prompt.sections[0].prose().contains("```lua extra")); } diff --git a/crates/runvil-internal/parser/src/tests/headings.rs b/crates/runvil-internal/parser/src/tests/headings.rs index 6e3bca973..da94b1266 100644 --- a/crates/runvil-internal/parser/src/tests/headings.rs +++ b/crates/runvil-internal/parser/src/tests/headings.rs @@ -31,7 +31,10 @@ fn preface_before_h1_is_ignored() { let src = "---\nname: x\ndescription: d\n---\n\nIgnored preface.\n\n```text\nalso ignored\n```\n\n# T\n\nDescription.\n\n## S\n\np\n"; let prompt = parse_ok(src); assert_eq!(prompt.title, "T"); - assert_eq!(prompt.description_text, "Description."); + assert!(matches!( + prompt.h1_blocks.as_slice(), + [Block::Prose { text }] if text == "Description." + )); assert_eq!(prompt.entry().expect("has sections").name, "S"); } diff --git a/crates/runvil-internal/types/src/emitter.rs b/crates/runvil-internal/types/src/emitter.rs index 9fc0799fb..ea74da69e 100644 --- a/crates/runvil-internal/types/src/emitter.rs +++ b/crates/runvil-internal/types/src/emitter.rs @@ -211,8 +211,9 @@ impl Emitter { } /// The caller-chosen run identifier stamped on every event. + #[cfg(test)] #[must_use] - pub fn execution(&self) -> &str { + pub(crate) fn execution(&self) -> &str { &self.execution } diff --git a/crates/runvil-internal/types/src/models.rs b/crates/runvil-internal/types/src/models.rs index 1faa63ee4..336f29cf0 100644 --- a/crates/runvil-internal/types/src/models.rs +++ b/crates/runvil-internal/types/src/models.rs @@ -80,7 +80,7 @@ impl ModelId { /// Returns the server namespace. #[must_use] - pub fn server(&self) -> &str { + pub(crate) fn server(&self) -> &str { &self.server } @@ -272,12 +272,6 @@ impl ModelCatalog { &self.models } - /// Returns whether the catalog is empty. - #[must_use] - pub fn is_empty(&self) -> bool { - self.models.is_empty() - } - /// Looks up a model info by stable identity. #[must_use] pub fn get(&self, id: &ModelId) -> Option<&ModelInfo> { diff --git a/crates/runvil-internal/types/src/names.rs b/crates/runvil-internal/types/src/names.rs index 4a2912e9d..2c74b64b7 100644 --- a/crates/runvil-internal/types/src/names.rs +++ b/crates/runvil-internal/types/src/names.rs @@ -42,12 +42,9 @@ impl GlobalName { /// /// Returns [`GlobalNameError`] when: /// - /// - a segment is empty, including the whole string being empty - /// ([`GlobalNameErrorKind::Empty`]); - /// - a segment contains a control byte - /// ([`GlobalNameErrorKind::Control`]); - /// - a segment contains any other character outside the set - /// ([`GlobalNameErrorKind::Charset`]). + /// - a segment is empty, including the whole string being empty; + /// - a segment contains a control byte; + /// - a segment contains any other character outside the set. pub fn parse(s: &str) -> Result { let segments: Vec<&str> = s.split('/').collect(); for segment in &segments { @@ -166,7 +163,7 @@ pub struct GlobalNameError { impl GlobalNameError { /// Returns the stable classification of this error. #[must_use] - pub fn kind(&self) -> GlobalNameErrorKind { + pub(crate) fn kind(&self) -> GlobalNameErrorKind { self.kind } } diff --git a/crates/runvil-internal/types/src/seed.rs b/crates/runvil-internal/types/src/seed.rs index 30989fe4b..4e39b58ec 100644 --- a/crates/runvil-internal/types/src/seed.rs +++ b/crates/runvil-internal/types/src/seed.rs @@ -2,7 +2,7 @@ //! //! The caller draws a run's [`RunSeed`] from a CSPRNG for a live run and //! passes the recorded one back for a replay. Every value derived from the -//! seed goes through [`derive()`] under its own `runvil..v1` +//! seed goes through `derive()` under its own `runvil..v1` //! tag: the guard nonce //! ([`GuardNonce::from_seed`](crate::untrusted::GuardNonce::from_seed)) and //! the run id ([`RunUid`]). Each derivation is one-way, so a derived value @@ -77,7 +77,7 @@ impl<'de> Deserialize<'de> for RunSeed { /// derivation is part of the run's replay contract and never changes /// silently. #[must_use] -pub fn derive(domain: &[u8], seed: &RunSeed) -> [u8; 32] { +pub(crate) fn derive(domain: &[u8], seed: &RunSeed) -> [u8; 32] { let digest = Sha256::new() .chain_update(domain) .chain_update(seed.0) diff --git a/crates/runvil-internal/types/src/tools/ids.rs b/crates/runvil-internal/types/src/tools/ids.rs index ae0a65ed0..9aa7e2ab8 100644 --- a/crates/runvil-internal/types/src/tools/ids.rs +++ b/crates/runvil-internal/types/src/tools/ids.rs @@ -142,12 +142,6 @@ impl ToolIdError { self.kind } - /// Returns what was rejected: `id`, the tool id being parsed. - #[must_use] - pub fn field(&self) -> &str { - self.field - } - /// Maps a global-name rejection onto the tool-id error vocabulary. fn from_global_name_kind(global_kind: GlobalNameErrorKind) -> ToolIdError { let (kind, reason) = match global_kind { diff --git a/crates/runvil-internal/types/src/untrusted.rs b/crates/runvil-internal/types/src/untrusted.rs index 18c7a48cf..64b8e8a95 100644 --- a/crates/runvil-internal/types/src/untrusted.rs +++ b/crates/runvil-internal/types/src/untrusted.rs @@ -70,7 +70,7 @@ impl GuardNonce { /// its envelopes byte for byte. A run has one nonce, shared by every /// envelope the run wraps. /// - /// The nonce is the first 16 bytes of [`derive()`] under the ASCII tag + /// The nonce is the first 16 bytes of `derive()` under the ASCII tag /// `runvil.guard-nonce.v1`, rendered as 32 lowercase hex digits. /// The derivation is part of the run's replay contract and never /// changes silently. It is one-way: the nonce appears in every envelope diff --git a/crates/runvil-internal/vfs/src/handle.rs b/crates/runvil-internal/vfs/src/handle.rs index ad3aa71b4..eafae3d9d 100644 --- a/crates/runvil-internal/vfs/src/handle.rs +++ b/crates/runvil-internal/vfs/src/handle.rs @@ -110,7 +110,7 @@ impl VfsRef { /// through an `Arc`. When the caller changes that state during a run, /// the next operation sees the change. #[must_use] - pub fn with_policy( + pub(crate) fn with_policy( backend: impl Vfs + 'static, policy: impl Policy + Sync + 'static, ) -> VfsRef { diff --git a/crates/runvil-internal/vfs/src/handle/access.rs b/crates/runvil-internal/vfs/src/handle/access.rs index d829cbfe8..2d1b5f3ae 100644 --- a/crates/runvil-internal/vfs/src/handle/access.rs +++ b/crates/runvil-internal/vfs/src/handle/access.rs @@ -183,41 +183,6 @@ impl Access { sink(OpEvent { op, path, origin }); } - /// Reads the file and resolves one line range while its contents - /// remain live. - pub(super) fn with_line_range( - &self, - path: &str, - start: usize, - end: Option, - render: impl FnOnce(&[&str], usize) -> String, - ) -> Result { - // The store view validates the path before the bounds, in the - // store contract's order. - if self.store_root.is_some() { - validate_store_path(path)?; - } - if start < 1 { - return Err(VfsError::InvalidRange { - path: path.to_owned(), - reason: "start is below 1", - }); - } - let contents = self.read_string(path)?; - let lines: Vec<&str> = contents.lines().collect(); - if start > lines.len() { - return Ok(String::new()); - } - let end = end.unwrap_or(lines.len()).min(lines.len()); - if end < start { - return Err(VfsError::InvalidRange { - path: path.to_owned(), - reason: "end is before start", - }); - } - Ok(render(&lines[start - 1..end], start)) - } - /// Poison-safe lock on the backend's access object, held per call. pub(super) fn inner(&self) -> MutexGuard<'_, Box> { self.inner.lock().unwrap_or_else(PoisonError::into_inner) diff --git a/crates/runvil-internal/vfs/src/handle/operations.rs b/crates/runvil-internal/vfs/src/handle/operations.rs index 060e273e3..7b754fd70 100644 --- a/crates/runvil-internal/vfs/src/handle/operations.rs +++ b/crates/runvil-internal/vfs/src/handle/operations.rs @@ -7,7 +7,7 @@ use super::store_view::{strip_root, validate_store_path}; use crate::error::{PathReason, VfsError}; use crate::glob::validate_glob_pattern; use crate::stat::{Entry, Stat}; -use crate::traits::{Depth, Op}; +use crate::traits::Op; impl Access { /// Reads the bytes of the file at `path`, exactly as stored. @@ -36,58 +36,6 @@ impl Access { }) } - /// Reads a range of lines from the file at `path` as text. - /// - /// Lines are numbered from 1, and the range runs from `start` to - /// `end` with both ends included. Each line drops its `"\n"` or - /// `"\r\n"` ending, and the lines are joined by `"\n"`, so the text - /// ends with the last line's own content. When `end` is `None`, the - /// range runs to the last line. An `end` past the last line is - /// lowered to the last line. A `start` past the last line returns the - /// empty string. - /// - /// # Errors - /// Returns an error when `start` is below 1 or `end` is before - /// `start`. It also returns an error under the same conditions as - /// `Access::read_string`, such as a missing file or contents that - /// are not UTF-8. - pub fn read_range( - &self, - path: &str, - start: usize, - end: Option, - ) -> Result { - self.with_line_range(path, start, end, |lines, _| lines.join("\n")) - } - - /// Reads a range of lines from the file at `path`, each prefixed with - /// its line number. - /// - /// Each line keeps its number in the file, so the first line shown is - /// numbered `start`. The numbers are right-aligned to the width of - /// the largest number shown, and each is followed by `"| "`. The - /// range bounds behave as in [`Access::read_range`]. - /// - /// # Errors - /// Returns an error under the same conditions as - /// [`Access::read_range`]. - pub fn read_range_numbered( - &self, - path: &str, - start: usize, - end: Option, - ) -> Result { - self.with_line_range(path, start, end, |lines, first| { - let width = (first + lines.len() - 1).to_string().len(); - lines - .iter() - .enumerate() - .map(|(index, line)| format!("{:>width$}| {}", first + index, line)) - .collect::>() - .join("\n") - }) - } - /// Creates or overwrites the file at `path` with `contents`. /// /// # Errors @@ -171,19 +119,6 @@ impl Access { } } - /// Removes the file, link, or directory at `path`, reaching as far as - /// `depth`: [`Depth::Recursive`] also removes a directory that holds - /// entries, along with everything under it. - /// - /// It is [`Access::remove`] with `recursive` set for - /// [`Depth::Recursive`], and returns what that returns. - /// - /// # Errors - /// Returns an error under the same conditions as [`Access::remove`]. - pub fn remove_with(&self, path: &str, depth: Depth) -> Result { - self.remove(path, depth.recursive()) - } - /// Reports whether anything exists at `path`. /// /// Returns `Ok(false)` only when the path is confirmed absent. @@ -310,15 +245,6 @@ impl Access { self.inner().mkdir(&path, recursive) } - /// Creates the directory at `path`, also creating any missing parent - /// directories when `depth` is [`Depth::Recursive`]. - /// - /// # Errors - /// Returns an error under the same conditions as [`Access::mkdir`]. - pub fn mkdir_with(&self, path: &str, depth: Depth) -> Result<(), VfsError> { - self.mkdir(path, depth.recursive()) - } - /// Renames or moves `from` to `to`. /// /// The move is atomic where the backend allows it. It claims the diff --git a/crates/runvil-internal/vfs/src/handle/tests/operations.rs b/crates/runvil-internal/vfs/src/handle/tests/operations.rs index 1f7307c8d..7767736b5 100644 --- a/crates/runvil-internal/vfs/src/handle/tests/operations.rs +++ b/crates/runvil-internal/vfs/src/handle/tests/operations.rs @@ -1,8 +1,7 @@ //! Tests for the capability's file operations: reads and writes through -//! the handle, the empty-anchor refusal, line ranges, and UTF-8 reads. +//! the handle, the empty-anchor refusal, and UTF-8 reads. use super::*; -use crate::traits::Depth; #[test] fn an_access_reads_and_writes_through_the_handle() -> Result<(), VfsError> { @@ -61,63 +60,6 @@ fn an_empty_anchor_on_a_non_empty_file_is_refused_and_leaves_it_unchanged() -> R Ok(()) } -#[test] -fn read_range_slices_lines_one_based_and_inclusive() -> Result<(), VfsError> { - let access = access(&handle(TestFs::seeded(&[("/f.txt", "one\ntwo\nthree\n")])))?; - assert_eq!(access.read_range("/f.txt", 2, None)?, "two\nthree"); - assert_eq!(access.read_range("/f.txt", 2, Some(99))?, "two\nthree"); - assert_eq!(access.read_range("/f.txt", 99, None)?, ""); - assert_eq!(access.read_range("/f.txt", 1, Some(1))?, "one"); - Ok(()) -} - -#[test] -fn read_range_rejects_invalid_bounds() -> Result<(), VfsError> { - let access = access(&handle(TestFs::seeded(&[("/f.txt", "one\ntwo\n")])))?; - assert_eq!( - access.read_range("/f.txt", 0, None), - Err(VfsError::InvalidRange { - path: "/f.txt".to_owned(), - reason: "start is below 1", - }) - ); - assert_eq!( - access.read_range("/f.txt", 2, Some(1)), - Err(VfsError::InvalidRange { - path: "/f.txt".to_owned(), - reason: "end is before start", - }) - ); - Ok(()) -} - -#[test] -fn read_range_numbered_numbers_absolutely_from_start() -> Result<(), VfsError> { - let access = access(&handle(TestFs::seeded(&[("/f.txt", "one\ntwo\nthree\n")])))?; - assert_eq!( - access.read_range_numbered("/f.txt", 1, None)?, - "1| one\n2| two\n3| three" - ); - assert_eq!( - access.read_range_numbered("/f.txt", 2, Some(3))?, - "2| two\n3| three" - ); - assert_eq!(access.read_range_numbered("/f.txt", 99, None)?, ""); - Ok(()) -} - -#[test] -fn read_range_numbered_pads_to_the_widest_emitted_number() -> Result<(), VfsError> { - let lines: Vec = (1..=10).map(|n| format!("line{n}")).collect(); - let text = lines.join("\n"); - let access = access(&handle(TestFs::seeded(&[("/f.txt", &text)])))?; - assert_eq!( - access.read_range_numbered("/f.txt", 9, Some(10))?, - " 9| line9\n10| line10" - ); - Ok(()) -} - #[test] fn read_string_rejects_non_utf8() -> Result<(), VfsError> { let access = access(&handle(TestFs::default()))?; @@ -132,23 +74,6 @@ fn read_string_rejects_non_utf8() -> Result<(), VfsError> { Ok(()) } -#[test] -fn the_depth_siblings_remove_and_create_as_far_as_their_depth() -> Result<(), VfsError> { - let access = access(&handle(TestFs::seeded(&[("/d/a.txt", "a")])))?; - assert_eq!( - access.remove_with("/d", Depth::One), - Err(VfsError::DirectoryNotEmpty { - path: "/d".to_owned(), - }) - ); - assert!(access.remove_with("/d", Depth::Recursive)?); - assert!(!access.remove_with("/d", Depth::Recursive)?, "already gone"); - assert!(access.mkdir_with("/p/q", Depth::One).is_err()); - access.mkdir_with("/p/q", Depth::Recursive)?; - assert!(access.exists("/p")?); - Ok(()) -} - #[test] fn the_handle_and_capability_are_send_and_sync() { fn assert_send_sync() {} diff --git a/crates/runvil-internal/vfs/src/lib.rs b/crates/runvil-internal/vfs/src/lib.rs index d6c06e499..933d7f9e7 100644 --- a/crates/runvil-internal/vfs/src/lib.rs +++ b/crates/runvil-internal/vfs/src/lib.rs @@ -43,9 +43,7 @@ pub use path::{VfsPath, VfsPathBuf}; pub use real::{RealBackend, Writability}; pub use router::VfsRefBuilder; pub use stat::{Entry, FileType, Stat}; -pub use traits::{ - AcquireContext, AllowAll, Depth, ExecId, GlobKind, Op, Policy, Verdict, Vfs, VfsAccess, -}; +pub use traits::{AcquireContext, AllowAll, ExecId, Op, Policy, Verdict, Vfs, VfsAccess}; /// The default handle has one mount: an in-memory store at `/`. /// @@ -98,7 +96,7 @@ pub struct ModePolicy { mode: Arc>, } -/// A handle that reads and changes the mode of a `ModePolicy`. +/// A handle that changes the mode of a `ModePolicy`. /// /// Clones share one mode with each other and with the policy. #[derive(Debug, Clone)] @@ -115,8 +113,8 @@ impl ModePolicy { } } - /// Returns a handle that reads and changes this policy's mode. A - /// change made mid-run takes effect on the next operation. + /// Returns a handle that changes this policy's mode. A change made + /// mid-run takes effect on the next operation. #[must_use] pub fn handle(&self) -> ModeHandle { ModeHandle { @@ -130,12 +128,6 @@ impl ModeHandle { pub fn set(&self, mode: Mode) { *lock(&self.mode) = mode; } - - /// Returns the current mode. - #[must_use] - pub fn mode(&self) -> Mode { - *lock(&self.mode) - } } /// Poison-safe lock on the shared mode cell. diff --git a/crates/runvil-internal/vfs/src/real.rs b/crates/runvil-internal/vfs/src/real.rs index 88077b167..b27250ab7 100644 --- a/crates/runvil-internal/vfs/src/real.rs +++ b/crates/runvil-internal/vfs/src/real.rs @@ -151,13 +151,13 @@ impl RealBackend { /// /// The flag is a property of the mount, separate from any policy. #[must_use] - pub fn with_read_only(mut self, read_only: bool) -> RealBackend { + pub(crate) fn with_read_only(mut self, read_only: bool) -> RealBackend { self.read_only = read_only; self } - /// Sets whether the backend accepts mutations, as - /// [`RealBackend::with_read_only`] does. + /// Sets whether the backend accepts mutations. [`Writability::ReadOnly`] + /// rejects all of them. #[must_use] pub fn with_writability(self, writability: Writability) -> RealBackend { self.with_read_only(match writability { diff --git a/crates/runvil-internal/vfs/src/traits.rs b/crates/runvil-internal/vfs/src/traits.rs index 6b1b25a6f..d292cf91b 100644 --- a/crates/runvil-internal/vfs/src/traits.rs +++ b/crates/runvil-internal/vfs/src/traits.rs @@ -11,6 +11,6 @@ mod policy; #[cfg(test)] mod tests; -pub use backend::{Depth, GlobKind, Vfs, VfsAccess}; +pub use backend::{Vfs, VfsAccess}; pub use identity::{AcquireContext, ExecId}; pub use policy::{AllowAll, Op, Policy, Verdict}; diff --git a/crates/runvil-internal/vfs/src/traits/backend.rs b/crates/runvil-internal/vfs/src/traits/backend.rs index 515fd444b..4139b6a11 100644 --- a/crates/runvil-internal/vfs/src/traits/backend.rs +++ b/crates/runvil-internal/vfs/src/traits/backend.rs @@ -1,44 +1,11 @@ //! The backend traits: [`Vfs`], one backend behind the virtual namespace, -//! and [`VfsAccess`], one identity's session with it, plus the enums the -//! session's enum-taking operations take. +//! and [`VfsAccess`], one identity's session with it. use super::identity::{AcquireContext, ExecId}; use crate::error::VfsError; use crate::path::{VfsPath, VfsPathBuf, canonicalize_absolute}; use crate::stat::{Entry, FileType, Stat}; -/// How far a removal or a directory creation reaches. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum Depth { - /// Only the named path: a removal refuses a directory that still has - /// entries, and a creation refuses a missing parent directory. - One, - /// The named path and every path it needs: a removal takes the whole - /// subtree, and a creation makes every missing parent directory. - Recursive, -} - -impl Depth { - /// The `recursive` flag of the `bool` forms. - pub(crate) fn recursive(self) -> bool { - match self { - Depth::One => false, - Depth::Recursive => true, - } - } -} - -/// Which matches of a glob pattern to keep. -#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum GlobKind { - /// Only the matches that are files. - FilesOnly, - /// Only the matches that are directories. - DirsOnly, -} - /// A storage backend behind the virtual filesystem. /// /// Operations are synchronous because the Lua VM and the single thread @@ -148,20 +115,6 @@ pub trait VfsAccess: Send { /// error when the removal fails. fn remove(&mut self, path: &VfsPath, recursive: bool) -> Result<(), VfsError>; - /// Removes the file, link, or directory at `path`, reaching as far as - /// `depth`. - /// - /// The default calls [`VfsAccess::remove`] with `recursive` set for - /// [`Depth::Recursive`]. - /// - /// # Errors - /// - /// Returns an error under the same conditions as - /// [`VfsAccess::remove`]. - fn remove_with(&mut self, path: &VfsPath, depth: Depth) -> Result<(), VfsError> { - self.remove(path, depth.recursive()) - } - /// Reports whether `path` exists. /// /// A confirmed absence returns `Ok(false)`, and a backend failure @@ -207,23 +160,6 @@ pub trait VfsAccess: Send { Ok(kept) } - /// Returns the stored paths matching `pattern` that `kind` keeps, - /// sorted. - /// - /// The default calls [`VfsAccess::glob_kind`], with `dirs_only` clear - /// for [`GlobKind::FilesOnly`] and set for [`GlobKind::DirsOnly`]. - /// - /// # Errors - /// - /// Returns an error under the same conditions as - /// [`VfsAccess::glob_kind`]. - fn glob_with(&self, pattern: &str, kind: GlobKind) -> Result, VfsError> { - match kind { - GlobKind::FilesOnly => self.glob_kind(pattern, false), - GlobKind::DirsOnly => self.glob_kind(pattern, true), - } - } - /// Lists the directory at `path`. /// /// # Errors @@ -247,19 +183,6 @@ pub trait VfsAccess: Send { /// Returns an error when creating the directory fails. fn mkdir(&mut self, path: &VfsPath, recursive: bool) -> Result<(), VfsError>; - /// Creates the directory at `path`, making missing parents when - /// `depth` is [`Depth::Recursive`]. - /// - /// The default calls [`VfsAccess::mkdir`]. - /// - /// # Errors - /// - /// Returns an error under the same conditions as - /// [`VfsAccess::mkdir`]. - fn mkdir_with(&mut self, path: &VfsPath, depth: Depth) -> Result<(), VfsError> { - self.mkdir(path, depth.recursive()) - } - /// Renames or moves `from` to `to`, atomically where the backend /// allows. /// diff --git a/crates/runvil-internal/vfs/src/traits/tests.rs b/crates/runvil-internal/vfs/src/traits/tests.rs index 6b12887df..9fae56fbb 100644 --- a/crates/runvil-internal/vfs/src/traits/tests.rs +++ b/crates/runvil-internal/vfs/src/traits/tests.rs @@ -1,4 +1,4 @@ -use super::{AllowAll, Depth, GlobKind, Op, Policy, Verdict, Vfs, VfsAccess}; +use super::{AllowAll, Op, Policy, Verdict, Vfs, VfsAccess}; use crate::error::VfsError; use crate::test_support::{TestFs, context, path}; @@ -120,48 +120,24 @@ fn the_default_str_replace_reports_non_utf8_text() -> Result<(), VfsError> { } #[test] -fn the_depth_siblings_delegate_to_the_bool_forms() -> Result<(), VfsError> { - let mut backend = stub(&[("/d/a.txt", "x")])?; - assert_eq!( - backend.remove_with(&path("/d")?, Depth::One), - Err(VfsError::DirectoryNotEmpty { - path: "/d".to_owned(), - }) - ); - backend.remove_with(&path("/d")?, Depth::Recursive)?; - assert!(!backend.exists(&path("/d")?)?); - assert_eq!( - backend.mkdir_with(&path("/p/q")?, Depth::One), - Err(VfsError::NotFound { - path: "/p/q".to_owned(), - }) - ); - backend.mkdir_with(&path("/p/q")?, Depth::Recursive)?; - assert!(backend.exists(&path("/p")?)?); - Ok(()) -} - -#[test] -fn the_glob_kind_sibling_keeps_only_files_or_only_directories() -> Result<(), VfsError> { +fn the_default_glob_kind_keeps_only_files_or_only_directories() -> Result<(), VfsError> { let backend = stub(&[("/d/a.txt", "x")])?; assert_eq!( - backend.glob_with("/d*", GlobKind::FilesOnly)?, + backend.glob_kind("/d*", false)?, Vec::::new(), - "a directory is dropped under FilesOnly" + "a directory is dropped when files are wanted" ); assert_eq!( - backend.glob_with("/d/*", GlobKind::FilesOnly)?, + backend.glob_kind("/d/*", false)?, ["/d/a.txt".to_owned()], - "a file matches under FilesOnly" + "a file matches when files are wanted" ); assert_eq!( - backend.glob_with("/d/*", GlobKind::DirsOnly)?, - Vec::::new() - ); - assert_eq!( - backend.glob_with("/d*", GlobKind::DirsOnly)?, - ["/d".to_owned()] + backend.glob_kind("/d/*", true)?, + Vec::::new(), + "a file is dropped when directories are wanted" ); + assert_eq!(backend.glob_kind("/d*", true)?, ["/d".to_owned()]); Ok(()) } diff --git a/crates/runvil/public-api.txt b/crates/runvil/public-api.txt index c1b516d92..d1636fe4c 100644 --- a/crates/runvil/public-api.txt +++ b/crates/runvil/public-api.txt @@ -15,7 +15,6 @@ #[non_exhaustive] pub enum runvil::model::Role #[non_exhaustive] pub enum runvil::model::TemperatureError #[non_exhaustive] pub enum runvil::model::ThinkingMode -#[non_exhaustive] pub enum runvil::packs::GlobalNameErrorKind #[non_exhaustive] pub enum runvil::packs::PackIdErrorKind #[non_exhaustive] pub enum runvil::prompt::ArgType #[non_exhaustive] pub enum runvil::prompt::ModelKeyword @@ -24,9 +23,7 @@ #[non_exhaustive] pub enum runvil::tools::ToolCatalogErrorKind #[non_exhaustive] pub enum runvil::tools::ToolErrorKind #[non_exhaustive] pub enum runvil::tools::ToolIdErrorKind -#[non_exhaustive] pub enum runvil::vfs::Depth #[non_exhaustive] pub enum runvil::vfs::FileType -#[non_exhaustive] pub enum runvil::vfs::GlobKind #[non_exhaustive] pub enum runvil::vfs::Mode #[non_exhaustive] pub enum runvil::vfs::Op #[non_exhaustive] pub enum runvil::vfs::PathReason @@ -107,7 +104,6 @@ auto runvil::RunErrorKind: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::RunLimits: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::RunResult: Freeze, !RefUnwindSafe, Send, Sync, Unpin, !UnwindSafe auto runvil::RunSeed: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe -auto runvil::RunUid: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::SourceLocation: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::Step: Freeze, !RefUnwindSafe, Send, Sync, Unpin, !UnwindSafe auto runvil::UnavailablePack: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe @@ -166,7 +162,6 @@ auto runvil::model::ToolCall: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSa auto runvil::model::ToolSchema: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::packs::GlobalName: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::packs::GlobalNameError: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe -auto runvil::packs::GlobalNameErrorKind: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::packs::PackId: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::packs::PackIdError: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::packs::PackIdErrorKind: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe @@ -198,11 +193,9 @@ auto runvil::tools::ToolOutput: Freeze, RefUnwindSafe, Send, Sync, Unpin, Unwind auto runvil::vfs::Access: !Freeze, !RefUnwindSafe, Send, Sync, Unpin, !UnwindSafe auto runvil::vfs::AcquireContext: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::AllowAll: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe -auto runvil::vfs::Depth: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::Entry: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::ExecId: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::FileType: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe -auto runvil::vfs::GlobKind: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::MemoryBackend: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::Mode: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe auto runvil::vfs::ModeHandle: Freeze, RefUnwindSafe, Send, Sync, Unpin, UnwindSafe @@ -236,7 +229,6 @@ derives runvil::RunErrorKind: Clone, Copy, Debug, Eq, Hash, PartialEq derives runvil::RunLimits: Clone, Copy, Debug, Default, Eq, Hash, PartialEq derives runvil::RunResult: Debug derives runvil::RunSeed: Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize -derives runvil::RunUid: Clone, Copy, Debug, Eq, Hash, PartialEq derives runvil::SourceLocation: Clone, Debug, Eq, PartialEq derives runvil::Step: Debug derives runvil::UnavailablePack: Clone, Debug, Eq, PartialEq @@ -295,7 +287,6 @@ derives runvil::model::ToolCall: Clone, Debug, Eq, PartialEq derives runvil::model::ToolSchema: Clone, Debug, Eq, PartialEq, Serialize derives runvil::packs::GlobalName: Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd derives runvil::packs::GlobalNameError: Clone, Debug, Eq, PartialEq -derives runvil::packs::GlobalNameErrorKind: Clone, Copy, Debug, Eq, PartialEq derives runvil::packs::PackId: Clone, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize derives runvil::packs::PackIdError: Clone, Debug, Eq, PartialEq derives runvil::packs::PackIdErrorKind: Clone, Copy, Debug, Eq, PartialEq @@ -327,11 +318,9 @@ derives runvil::tools::ToolOutput: Clone, Debug, Eq, PartialEq derives runvil::vfs::Access: Debug derives runvil::vfs::AcquireContext: Clone, Debug derives runvil::vfs::AllowAll: Clone, Copy, Debug, Default, Eq, Hash, PartialEq -derives runvil::vfs::Depth: Clone, Copy, Debug, Eq, Hash, PartialEq derives runvil::vfs::Entry: Clone, Debug, Eq, Hash, PartialEq derives runvil::vfs::ExecId: Clone, Copy, Debug, Eq, Hash, PartialEq derives runvil::vfs::FileType: Clone, Copy, Debug, Eq, Hash, PartialEq -derives runvil::vfs::GlobKind: Clone, Copy, Debug, Eq, Hash, PartialEq derives runvil::vfs::MemoryBackend: Clone, Debug, Default derives runvil::vfs::Mode: Clone, Copy, Debug, Eq, PartialEq derives runvil::vfs::ModeHandle: Clone, Debug @@ -375,7 +364,6 @@ impl core::error::Error for runvil::vfs::VfsError impl core::fmt::Display for runvil::ParseError impl core::fmt::Display for runvil::RunError impl core::fmt::Display for runvil::RunSeed -impl core::fmt::Display for runvil::RunUid impl core::fmt::Display for runvil::effect::EffectId impl core::fmt::Display for runvil::ids::ChainId impl core::fmt::Display for runvil::ids::ParseIdError @@ -468,7 +456,6 @@ pub fn runvil::ParseError::name(&self) -> core::option::Option<&str> pub fn runvil::ParseError::span(&self) -> core::option::Option> pub fn runvil::Prompt::frontmatter(&self) -> &runvil::prompt::Frontmatter pub fn runvil::Prompt::parse(input: &str, execution: &str) -> (core::result::Result, alloc::vec::Vec) -pub fn runvil::Prompt::strip_h1_prose(&mut self) pub fn runvil::Prompt::title(&self) -> &str pub fn runvil::Requirements::is_satisfied(&self) -> bool pub fn runvil::Requirements::merge(&mut self, other: runvil::Requirements) @@ -481,15 +468,11 @@ pub fn runvil::Run::new(prompt: alloc::sync::Arc, args: &str, ct pub fn runvil::Run::resume(&mut self, id: runvil::effect::EffectId, answer: runvil::effect::EffectAnswer) pub fn runvil::Run::step(&mut self) -> runvil::Step pub fn runvil::RunContext::cancel(self, handle: runvil::cancel::CancelHandle) -> runvil::RunContext -pub fn runvil::RunContext::cancel_handle(&self) -> runvil::cancel::CancelHandle pub fn runvil::RunContext::catalog(&self) -> &runvil::tools::ToolCatalog -pub fn runvil::RunContext::current_model(&self) -> core::option::Option<&runvil::model::ModelInfo> -pub fn runvil::RunContext::depth(&self) -> u32 pub fn runvil::RunContext::flags(self, flags: runvil::replay::Flags) -> runvil::RunContext pub fn runvil::RunContext::limits(self, limits: runvil::RunLimits) -> runvil::RunContext pub fn runvil::RunContext::model(self, model: runvil::model::ModelInfo) -> runvil::RunContext pub fn runvil::RunContext::model_bindings(&self) -> &runvil::model::ModelBindings -pub fn runvil::RunContext::name(&self) -> &str pub fn runvil::RunContext::new(name: impl core::convert::Into, seed: runvil::RunSeed, started_at: runvil::timestamp::Timestamp) -> runvil::RunContext pub fn runvil::RunContext::packs(self, usable: alloc::vec::Vec, unavailable: alloc::vec::Vec) -> runvil::RunContext pub fn runvil::RunContext::preludes(self, preludes: alloc::vec::Vec) -> runvil::RunContext @@ -501,7 +484,6 @@ pub fn runvil::RunContext::seed(&self) -> runvil::RunSeed pub fn runvil::RunContext::started_at(&self) -> runvil::timestamp::Timestamp pub fn runvil::RunContext::tools(self, tools: runvil::tools::ToolCatalog) -> runvil::RunContext pub fn runvil::RunContext::ui(self, snapshot: serde_json::value::Value) -> runvil::RunContext -pub fn runvil::RunContext::uid(&self) -> runvil::RunUid pub fn runvil::RunContext::vfs(self, vfs: runvil::vfs::VfsRef) -> runvil::RunContext pub fn runvil::RunContext::vfs_handle(&self) -> &runvil::vfs::VfsRef pub fn runvil::RunError::cause(&self) -> core::option::Option<&dyn core::error::Error + core::marker::Send + core::marker::Sync + 'static> @@ -509,10 +491,7 @@ pub fn runvil::RunError::is_cancelled(&self) -> bool pub fn runvil::RunError::is_retryable(&self) -> bool pub fn runvil::RunError::kind(&self) -> runvil::RunErrorKind pub fn runvil::RunError::location(&self) -> core::option::Option -pub fn runvil::RunLimits::concurrency(&self) -> core::num::nonzero::NonZeroUsize pub fn runvil::RunLimits::lua_log_events(self, value: core::num::nonzero::NonZeroU32) -> runvil::RunLimits -pub fn runvil::RunLimits::lua_logs(&self) -> core::num::nonzero::NonZeroU32 -pub fn runvil::RunLimits::lua_memory(&self) -> core::num::nonzero::NonZeroUsize pub fn runvil::RunLimits::lua_memory_bytes(self, value: core::num::nonzero::NonZeroUsize) -> runvil::RunLimits pub fn runvil::RunLimits::max_concurrency(self, value: core::num::nonzero::NonZeroUsize) -> runvil::RunLimits pub fn runvil::RunLimits::max_response_bytes(self, value: core::num::nonzero::NonZeroU64) -> runvil::RunLimits @@ -521,12 +500,6 @@ pub fn runvil::RunLimits::new() -> runvil::RunLimits pub fn runvil::RunLimits::request_timeout(self, value: core::time::Duration) -> runvil::RunLimits pub fn runvil::RunLimits::response_bytes(&self) -> core::num::nonzero::NonZeroU64 pub fn runvil::RunLimits::timeout(&self) -> core::time::Duration -pub fn runvil::RunLimits::tool_iterations(&self) -> core::num::nonzero::NonZeroU32 -pub fn runvil::RunUid::from_seed(seed: &runvil::RunSeed) -> runvil::RunUid -pub fn runvil::SourceLocation::new(path: impl core::convert::Into) -> runvil::SourceLocation -pub fn runvil::SourceLocation::with_column(self, column: core::option::Option) -> runvil::SourceLocation -pub fn runvil::SourceLocation::with_line(self, line: core::option::Option) -> runvil::SourceLocation -pub fn runvil::SourceLocation::with_span(self, span: core::option::Option>) -> runvil::SourceLocation pub fn runvil::UnavailablePack::new(pack: runvil::packs::PackId, reason: impl core::convert::Into) -> runvil::UnavailablePack pub fn runvil::cancel::CancelHandle::cancel(&self) pub fn runvil::cancel::CancelHandle::cancelled(&self) -> runvil::cancel::Cancelled @@ -539,9 +512,7 @@ pub fn runvil::effect::ChatAnswerRecord::with_reply(self, reply: core::option::O pub fn runvil::effect::ChatAnswerRecord::with_tool_calls(self, tool_calls: alloc::vec::Vec) -> runvil::effect::ChatAnswerRecord pub fn runvil::effect::Effect::record(&self) -> runvil::effect::EffectRecord pub fn runvil::effect::EffectAnswer::record(&self) -> runvil::effect::AnswerRecord -pub fn runvil::effect::FailureRecord::new(kind: impl core::convert::Into, message: impl core::convert::Into) -> runvil::effect::FailureRecord pub fn runvil::effect::Round::new(id: runvil::ids::RoundId, origin: runvil::event::ReplyOrigin) -> runvil::effect::Round -pub fn runvil::effect::ToolAnswerRecord::new(text: impl core::convert::Into, trust: runvil::tools::OutputTrust) -> runvil::effect::ToolAnswerRecord pub fn runvil::effect::ToolCallOrigin::new(execution: impl core::convert::Into, section: impl core::convert::Into, caller: runvil::effect::ToolCaller) -> runvil::effect::ToolCallOrigin pub fn runvil::event::Event::execution(&self) -> &str pub fn runvil::event::Event::provenance(&self) -> &runvil::ids::Provenance @@ -635,13 +606,11 @@ pub fn runvil::model::ModelBindings::role_id(&self, label: &str) -> core::option pub fn runvil::model::ModelCatalog::contains(&self, id: &runvil::model::ModelId) -> bool pub fn runvil::model::ModelCatalog::empty() -> Self pub fn runvil::model::ModelCatalog::get(&self, id: &runvil::model::ModelId) -> core::option::Option<&runvil::model::ModelInfo> -pub fn runvil::model::ModelCatalog::is_empty(&self) -> bool pub fn runvil::model::ModelCatalog::models(&self) -> &[runvil::model::ModelInfo] pub fn runvil::model::ModelCatalog::new(models: impl core::iter::traits::collect::IntoIterator) -> core::result::Result pub fn runvil::model::ModelId::gateway(name: impl core::convert::Into) -> core::result::Result pub fn runvil::model::ModelId::name(&self) -> &str pub fn runvil::model::ModelId::new(server: impl core::convert::Into, name: impl core::convert::Into) -> core::result::Result -pub fn runvil::model::ModelId::server(&self) -> &str pub fn runvil::model::ModelInfo::context(&self) -> core::num::nonzero::NonZeroU32 pub fn runvil::model::ModelInfo::description(&self) -> &str pub fn runvil::model::ModelInfo::id(&self) -> &runvil::model::ModelId @@ -672,7 +641,6 @@ pub fn runvil::model::ToolSchema::description(&self) -> &str pub fn runvil::model::ToolSchema::name(&self) -> &str pub fn runvil::model::ToolSchema::parameters(&self) -> &serde_json::value::Value pub fn runvil::packs::GlobalName::parse(s: &str) -> core::result::Result -pub fn runvil::packs::GlobalNameError::kind(&self) -> runvil::packs::GlobalNameErrorKind pub fn runvil::packs::PackId::contains(&self, tool: &runvil::tools::ToolId) -> bool pub fn runvil::packs::PackId::parse(name: &str) -> core::result::Result pub fn runvil::packs::PackIdError::kind(&self) -> runvil::packs::PackIdErrorKind @@ -725,7 +693,6 @@ pub fn runvil::tools::ToolErrorKind::tag(self) -> &'static str pub fn runvil::tools::ToolId::name(&self) -> &str pub fn runvil::tools::ToolId::pack(&self) -> runvil::packs::PackId pub fn runvil::tools::ToolId::parse(id: &str) -> core::result::Result -pub fn runvil::tools::ToolIdError::field(&self) -> &str pub fn runvil::tools::ToolIdError::kind(&self) -> runvil::tools::ToolIdErrorKind pub fn runvil::tools::ToolInfo::new(id: runvil::tools::ToolId, description: impl core::convert::Into, parameters_schema: serde_json::value::Value) -> runvil::tools::ToolInfo pub fn runvil::tools::ToolInfo::structured(self, structured: bool) -> runvil::tools::ToolInfo @@ -741,13 +708,9 @@ pub fn runvil::vfs::Access::exists(&self, path: &str) -> core::result::Result core::result::Result, runvil::vfs::VfsError> pub fn runvil::vfs::Access::list(&self, path: &str) -> core::result::Result, runvil::vfs::VfsError> pub fn runvil::vfs::Access::mkdir(&self, path: &str, recursive: bool) -> core::result::Result<(), runvil::vfs::VfsError> -pub fn runvil::vfs::Access::mkdir_with(&self, path: &str, depth: runvil::vfs::Depth) -> core::result::Result<(), runvil::vfs::VfsError> pub fn runvil::vfs::Access::read(&self, path: &str) -> core::result::Result, runvil::vfs::VfsError> -pub fn runvil::vfs::Access::read_range(&self, path: &str, start: usize, end: core::option::Option) -> core::result::Result -pub fn runvil::vfs::Access::read_range_numbered(&self, path: &str, start: usize, end: core::option::Option) -> core::result::Result pub fn runvil::vfs::Access::read_string(&self, path: &str) -> core::result::Result pub fn runvil::vfs::Access::remove(&self, path: &str, recursive: bool) -> core::result::Result -pub fn runvil::vfs::Access::remove_with(&self, path: &str, depth: runvil::vfs::Depth) -> core::result::Result pub fn runvil::vfs::Access::rename(&self, from: &str, to: &str) -> core::result::Result<(), runvil::vfs::VfsError> pub fn runvil::vfs::Access::stat(&self, path: &str) -> core::result::Result pub fn runvil::vfs::Access::str_replace(&self, path: &str, old: &str, new: &str) -> core::result::Result<(), runvil::vfs::VfsError> @@ -756,7 +719,6 @@ pub fn runvil::vfs::AcquireContext::id(&self) -> runvil::vfs::ExecId pub fn runvil::vfs::Entry::new(name: impl core::convert::Into, stat: runvil::vfs::Stat) -> runvil::vfs::Entry pub fn runvil::vfs::Entry::with_description(self, description: core::option::Option) -> runvil::vfs::Entry pub fn runvil::vfs::MemoryBackend::new() -> runvil::vfs::MemoryBackend -pub fn runvil::vfs::ModeHandle::mode(&self) -> runvil::vfs::Mode pub fn runvil::vfs::ModeHandle::set(&self, mode: runvil::vfs::Mode) pub fn runvil::vfs::ModePolicy::handle(&self) -> runvil::vfs::ModeHandle pub fn runvil::vfs::ModePolicy::new(mode: runvil::vfs::Mode) -> runvil::vfs::ModePolicy @@ -771,7 +733,6 @@ pub fn runvil::vfs::PathReason::tag(self) -> &'static str pub fn runvil::vfs::Policy::check(&self, op: runvil::vfs::Op, path: &runvil::vfs::VfsPath) -> runvil::vfs::Verdict pub fn runvil::vfs::RealBackend::identity() -> runvil::vfs::RealBackend pub fn runvil::vfs::RealBackend::rooted(dir: impl core::convert::AsRef) -> core::result::Result -pub fn runvil::vfs::RealBackend::with_read_only(self, read_only: bool) -> runvil::vfs::RealBackend pub fn runvil::vfs::RealBackend::with_writability(self, writability: runvil::vfs::Writability) -> runvil::vfs::RealBackend pub fn runvil::vfs::Stat::new(file_type: runvil::vfs::FileType, size: u64) -> runvil::vfs::Stat pub fn runvil::vfs::Stat::with_created(self, created: core::option::Option) -> runvil::vfs::Stat @@ -787,15 +748,12 @@ pub fn runvil::vfs::VfsAccess::copy(&mut self, from: &runvil::vfs::VfsPath, to: pub fn runvil::vfs::VfsAccess::exists(&self, path: &runvil::vfs::VfsPath) -> core::result::Result pub fn runvil::vfs::VfsAccess::glob(&self, pattern: &str) -> core::result::Result, runvil::vfs::VfsError> pub fn runvil::vfs::VfsAccess::glob_kind(&self, pattern: &str, dirs_only: bool) -> core::result::Result, runvil::vfs::VfsError> { .. } -pub fn runvil::vfs::VfsAccess::glob_with(&self, pattern: &str, kind: runvil::vfs::GlobKind) -> core::result::Result, runvil::vfs::VfsError> { .. } pub fn runvil::vfs::VfsAccess::list(&self, path: &runvil::vfs::VfsPath) -> core::result::Result, runvil::vfs::VfsError> pub fn runvil::vfs::VfsAccess::mkdir(&mut self, path: &runvil::vfs::VfsPath, recursive: bool) -> core::result::Result<(), runvil::vfs::VfsError> -pub fn runvil::vfs::VfsAccess::mkdir_with(&mut self, path: &runvil::vfs::VfsPath, depth: runvil::vfs::Depth) -> core::result::Result<(), runvil::vfs::VfsError> { .. } pub fn runvil::vfs::VfsAccess::read(&self, path: &runvil::vfs::VfsPath) -> core::result::Result, runvil::vfs::VfsError> pub fn runvil::vfs::VfsAccess::read_link(&self, path: &runvil::vfs::VfsPath) -> core::result::Result { .. } pub fn runvil::vfs::VfsAccess::read_range(&self, path: &runvil::vfs::VfsPath, offset: u64, len: u64) -> core::result::Result, runvil::vfs::VfsError> { .. } pub fn runvil::vfs::VfsAccess::remove(&mut self, path: &runvil::vfs::VfsPath, recursive: bool) -> core::result::Result<(), runvil::vfs::VfsError> -pub fn runvil::vfs::VfsAccess::remove_with(&mut self, path: &runvil::vfs::VfsPath, depth: runvil::vfs::Depth) -> core::result::Result<(), runvil::vfs::VfsError> { .. } pub fn runvil::vfs::VfsAccess::rename(&mut self, from: &runvil::vfs::VfsPath, to: &runvil::vfs::VfsPath) -> core::result::Result<(), runvil::vfs::VfsError> pub fn runvil::vfs::VfsAccess::stat(&self, path: &runvil::vfs::VfsPath) -> core::result::Result pub fn runvil::vfs::VfsAccess::str_replace(&mut self, path: &runvil::vfs::VfsPath, old: &str, new: &str) -> core::result::Result<(), runvil::vfs::VfsError> { .. } @@ -810,7 +768,6 @@ pub fn runvil::vfs::VfsRef::acquire_store(&self, origin: runvil::vfs::Origin) -> pub fn runvil::vfs::VfsRef::builder() -> runvil::vfs::VfsRefBuilder pub fn runvil::vfs::VfsRef::new(backend: impl runvil::vfs::Vfs + 'static) -> runvil::vfs::VfsRef pub fn runvil::vfs::VfsRef::overlay(&self, prefix: &str, backend: impl runvil::vfs::Vfs + 'static) -> runvil::vfs::VfsRef -pub fn runvil::vfs::VfsRef::with_policy(backend: impl runvil::vfs::Vfs + 'static, policy: impl runvil::vfs::Policy + core::marker::Sync + 'static) -> runvil::vfs::VfsRef pub fn runvil::vfs::VfsRefBuilder::build(self) -> runvil::vfs::VfsRef pub fn runvil::vfs::VfsRefBuilder::mount(self, prefix: &str, backend: impl runvil::vfs::Vfs + 'static) -> runvil::vfs::VfsRefBuilder pub fn runvil::vfs::VfsRefBuilder::on_op(self, sink: impl core::ops::function::Fn(runvil::vfs::OpEvent<'_>) + core::marker::Send + core::marker::Sync + 'static) -> runvil::vfs::VfsRefBuilder @@ -1322,9 +1279,6 @@ pub runvil::model::TemperatureError::OutOfRange::value: f64 pub runvil::model::ThinkingMode::Always pub runvil::model::ThinkingMode::Never pub runvil::model::ThinkingMode::Switchable -pub runvil::packs::GlobalNameErrorKind::Charset -pub runvil::packs::GlobalNameErrorKind::Control -pub runvil::packs::GlobalNameErrorKind::Empty pub runvil::packs::PackIdErrorKind::Charset pub runvil::packs::PackIdErrorKind::Control pub runvil::packs::PackIdErrorKind::Empty @@ -1358,8 +1312,6 @@ pub runvil::tools::ToolInfo::id: runvil::tools::ToolId pub runvil::tools::ToolInfo::parameters_schema: serde_json::value::Value pub runvil::tools::ToolInfo::structured_output: bool pub runvil::tools::ToolInfo::survives_stop: bool -pub runvil::vfs::Depth::One -pub runvil::vfs::Depth::Recursive pub runvil::vfs::Entry::description: core::option::Option pub runvil::vfs::Entry::name: alloc::string::String pub runvil::vfs::Entry::stat: runvil::vfs::Stat @@ -1370,8 +1322,6 @@ pub runvil::vfs::FileType::Fifo pub runvil::vfs::FileType::File pub runvil::vfs::FileType::Socket pub runvil::vfs::FileType::Symlink -pub runvil::vfs::GlobKind::DirsOnly -pub runvil::vfs::GlobKind::FilesOnly pub runvil::vfs::Mode::Agent pub runvil::vfs::Mode::Ask pub runvil::vfs::Mode::Plan @@ -1503,7 +1453,6 @@ pub runvil::vfs::Writability::ReadOnly pub runvil::vfs::Writability::ReadWrite pub struct runvil::Run { /* private fields */ } pub struct runvil::RunSeed(/* private fields */) -pub struct runvil::RunUid(/* private fields */) pub struct runvil::cancel::CancelHandle { /* private fields */ } pub struct runvil::cancel::Cancelled { /* private fields */ } pub struct runvil::effect::EffectId(/* private fields */) @@ -1537,4 +1486,3 @@ pub struct runvil::vfs::VfsRefBuilder { /* private fields */ } pub trait runvil::vfs::Policy: core::marker::Send pub trait runvil::vfs::Vfs: core::marker::Send pub trait runvil::vfs::VfsAccess: core::marker::Send -pub type runvil::vfs::OpSink = alloc::sync::Arc) + core::marker::Send + core::marker::Sync> diff --git a/crates/runvil/src/lib.rs b/crates/runvil/src/lib.rs index 33ea3625d..b091feb3e 100644 --- a/crates/runvil/src/lib.rs +++ b/crates/runvil/src/lib.rs @@ -27,7 +27,6 @@ pub use runvil_parser::ParseError; pub use runvil_parser::ParseErrorKind; pub use runvil_parser::Prompt; pub use runvil_types::seed::RunSeed; -pub use runvil_types::seed::RunUid; pub mod effect { //! The outside work a run asks for, the answers it takes back, and the @@ -120,7 +119,6 @@ pub mod packs { pub use runvil_types::names::GlobalName; pub use runvil_types::names::GlobalNameError; - pub use runvil_types::names::GlobalNameErrorKind; pub use runvil_types::packs::PackId; pub use runvil_types::packs::PackIdError; pub use runvil_types::packs::PackIdErrorKind; @@ -154,18 +152,15 @@ pub mod vfs { pub use runvil_vfs::Access; pub use runvil_vfs::AcquireContext; pub use runvil_vfs::AllowAll; - pub use runvil_vfs::Depth; pub use runvil_vfs::Entry; pub use runvil_vfs::ExecId; pub use runvil_vfs::FileType; - pub use runvil_vfs::GlobKind; pub use runvil_vfs::MemoryBackend; pub use runvil_vfs::Mode; pub use runvil_vfs::ModeHandle; pub use runvil_vfs::ModePolicy; pub use runvil_vfs::Op; pub use runvil_vfs::OpEvent; - pub use runvil_vfs::OpSink; pub use runvil_vfs::Origin; pub use runvil_vfs::ParsePathReasonError; pub use runvil_vfs::PathReason;