From a530ad8b1d287da19e7d28ca2e361aaa65c15d06 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 2 Dec 2026 09:11:39 -0800 Subject: [PATCH 1/2] Add the plan for the pin of contract 0.8 Record the plan for moving Workshop's pins of the Harness, `runvil-plugin-sdk`, and the library Plugins to contract 0.8. Plan: /plan/2026-12-02-1-tool-call-model-and-origin.plan.md --- ...12-02-1-tool-call-model-and-origin.plan.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plan/2026-12-02-1-tool-call-model-and-origin.plan.md diff --git a/plan/2026-12-02-1-tool-call-model-and-origin.plan.md b/plan/2026-12-02-1-tool-call-model-and-origin.plan.md new file mode 100644 index 00000000..ae6ddf43 --- /dev/null +++ b/plan/2026-12-02-1-tool-call-model-and-origin.plan.md @@ -0,0 +1,31 @@ +--- +name: Model and Origin on Tool Calls +overview: Pass the call's origin (caller, section, entry) and the requesting round's full ModelInfo to every tool call across the Engine, Harness, and C Plugin contract (version 0.8), and update the documentation and downstream pins across all repositories. +todos: + - id: workshop-pin-0-8 + content: "runvil-workshop: testable commits for plan copy and pinning Harness, SDK 0.8, and Plugins; verify, push to origin, open PR, monitor GitHub Actions and CodeRabbit comments, address findings, and merge to upstream" + status: pending +isProject: false +--- + +# Pass the Model and Origin to Tool Calls (Contract 0.8) + +## The idea in plain terms + +Today a render (`RV_PACK_RENDER` and `RenderContext`) learns the section entry (`sys.id`) and the full `ModelInfo` (`server`, `name`, `description`, `context`, `thinking`, and `provider`) of the section's first model round, while a tool call learns less: + +- In the Engine and Harness (`Effect::ToolCall` and `ToolContext`), a tool call receives `ToolCallOrigin` (`section`, `caller`, `entry`, and `model` as a bare model-name string), without the rest of the round's `ModelInfo`. +- Across the C Plugin contract (`RvToolCallArgs` and `runvil_plugin_sdk::ToolCall`), a tool call receives only `tool`, `arguments`, `resources`, the file functions, and `waker`. A contract Plugin cannot tell whether a script or a model called it, which section or entry made the call, or which model requested the call. + +This change gives every tool call both the call's origin and, when a model round requested the call, that round's full model facts: + +- **In the Engine (`runvil-lua` and `runvil-runtime`):** `MessageList::commit` records the round's `ModelInfo` (`binding.render_info()`) instead of only `binding.id().name()`. When a model round requests a tool call (`CallSite::Model` or `CallSite::Batch`), `prepare_catalog_call` attaches `Some(ModelInfo)` to `Effect::ToolCall` and sets `origin.model` to the model's name as before. When Lua calls `tools.call` directly (`CallSite::Script`), `model` is `None`. +- **In the Harness (`runvil-plugin` and `harness-runner`):** `ToolContext<'a>` gains `model: Option<&'a ModelInfo>` and `ToolContext::model(&self) -> Option<&'a ModelInfo>`, populated by `RunPacks::call`. +- **In the C contract (`runvil-plugin-sys` v0.8):** `RvToolCallArgs` gains `caller: RvCaller` (`RV_CALLER_MODEL = 0`, `RV_CALLER_SCRIPT = 1`, placed in the 4-byte `reserved` slot after `size`) and three `RvStr` fields at the end: `section`, `entry` (empty when unset), and `model` (the same JSON object shape as `RvPackRenderArgs.model` when a model round asked for the call, and empty for a script call). Every step of one call gets the same values. +- **In the SDK (`runvil-plugin-sdk` v0.8):** `ToolCall<'a>` gains `caller(&self) -> Caller`, `section(&self) -> &'a str`, `entry(&self) -> Option<&'a str>`, and `model(&self) -> Option<&'a str>`, backed by copies in `CallState` taken on the first step. The fake Host (`testing`) defaults a call to `Caller::Model`, `section: "Test"`, `entry: Some("0.0")`, and `model: None`, and adds builder setters on `testing::Call` so existing Plugin test suites compile unchanged while new tests can exercise every field. + +## Wave 3: `runvil-workshop` + +- Commit 1: Plan record `plan/2026-12-02-1-tool-call-model-and-origin.plan.md`. +- Commit 2: `Pin the Harness, the SDK, and the Plugins at contract 0.8` in `Cargo.toml` and `Cargo.lock`. +- Verify with a fresh verifier subagent, push, open a PR, wait for green CI, and merge. From 0381a776f37240bf900a035d572774af5054b705 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 2 Dec 2026 10:06:15 -0800 Subject: [PATCH 2/2] Pin the Harness, the SDK, and the Plugins at contract 0.8 Workshop now builds the Harness that passes a tool call's origin and model and the three library Plugins at the SDK that speaks contract 0.8. The root `Cargo.toml` pins each at its merged commit, and `Cargo.lock` follows. - `runvil`, `harness-gateway-client`, and `plugin-mcp` move to `faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0`. - `runvil-plugin-sdk` moves to version `0.8.0` at `f2d42cc41b0f28f81ac73193f21c2eacfafc11d9`, the commit the Harness pins `runvil-plugin-sys` at. - `std-plugin` moves to `c3653768df3817a7140059c1de66195e51408b70`, `bashkit-plugin` to `67cc930c47bedace9af648982f72b6e12c77ba08`, and `web-plugin` to `a24f3400022e43f237319db89ec4454063ec859a`. Plan: /plan/2026-12-02-1-tool-call-model-and-origin.plan.md --- Cargo.lock | 48 ++++++++++++++++++++++++------------------------ Cargo.toml | 16 ++++++++-------- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37558787..16f45bb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1882,7 +1882,7 @@ dependencies = [ [[package]] name = "gateway-client" version = "0.1.0" -source = "git+https://github.com/cppalliance/gateway-client?rev=5315394ac4e44c00f727e0e69789c34c6dfc86b5#5315394ac4e44c00f727e0e69789c34c6dfc86b5" +source = "git+https://github.com/cppalliance/gateway-client?rev=b77b3017967b6c4f2690a556a5f14e9d33968be7#b77b3017967b6c4f2690a556a5f14e9d33968be7" dependencies = [ "bytes", "gateway-types", @@ -1896,7 +1896,7 @@ dependencies = [ [[package]] name = "gateway-types" version = "0.1.0" -source = "git+https://github.com/cppalliance/gateway-client?rev=5315394ac4e44c00f727e0e69789c34c6dfc86b5#5315394ac4e44c00f727e0e69789c34c6dfc86b5" +source = "git+https://github.com/cppalliance/gateway-client?rev=b77b3017967b6c4f2690a556a5f14e9d33968be7#b77b3017967b6c4f2690a556a5f14e9d33968be7" dependencies = [ "serde", "serde_json", @@ -2250,7 +2250,7 @@ dependencies = [ [[package]] name = "harness-gateway-client" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "gateway-client", "runvil", @@ -2261,7 +2261,7 @@ dependencies = [ [[package]] name = "harness-plugin-loader" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "libloading 0.8.9", "runvil-plugin", @@ -2272,7 +2272,7 @@ dependencies = [ [[package]] name = "harness-runner" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "futures-util", "gateway-types", @@ -4000,9 +4000,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "f120c8d5021b34abd2f2ffd7ee96687cbcd6c54a3e68d86b6169f4a5cd480ffe" [[package]] name = "piper" @@ -4037,7 +4037,7 @@ dependencies = [ [[package]] name = "plugin-bashkit" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-bashkit?rev=35f8e4b72a9c14a4611899abcdb43a888a3287a3#35f8e4b72a9c14a4611899abcdb43a888a3287a3" +source = "git+https://github.com/cppalliance/runvil-plugin-bashkit?rev=67cc930c47bedace9af648982f72b6e12c77ba08#67cc930c47bedace9af648982f72b6e12c77ba08" dependencies = [ "bashkit", "runvil-plugin-sdk", @@ -4049,7 +4049,7 @@ dependencies = [ [[package]] name = "plugin-mcp" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "futures-util", "reqwest", @@ -4063,7 +4063,7 @@ dependencies = [ [[package]] name = "plugin-std" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-std?rev=f1541bf93b2a7fe75abfc905e4588906104f3a16#f1541bf93b2a7fe75abfc905e4588906104f3a16" +source = "git+https://github.com/cppalliance/runvil-plugin-std?rev=c3653768df3817a7140059c1de66195e51408b70#c3653768df3817a7140059c1de66195e51408b70" dependencies = [ "regex", "runvil-plugin-sdk", @@ -4074,7 +4074,7 @@ dependencies = [ [[package]] name = "plugin-web" version = "0.1.0" -source = "git+https://github.com/cppalliance/runvil-plugin-web?rev=1d5aefccada1b49d924cada1d2c2080a22b3db3b#1d5aefccada1b49d924cada1d2c2080a22b3db3b" +source = "git+https://github.com/cppalliance/runvil-plugin-web?rev=a24f3400022e43f237319db89ec4454063ec859a#a24f3400022e43f237319db89ec4454063ec859a" dependencies = [ "encoding_rs", "htmd", @@ -4719,7 +4719,7 @@ dependencies = [ [[package]] name = "runvil" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "harness-plugin-loader", "harness-runner", @@ -4730,7 +4730,7 @@ dependencies = [ [[package]] name = "runvil-engine" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "gateway-types", "runvil-lua", @@ -4743,7 +4743,7 @@ dependencies = [ [[package]] name = "runvil-lua" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "gateway-types", "mlua", @@ -4757,7 +4757,7 @@ dependencies = [ [[package]] name = "runvil-markdown" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "pulldown-cmark", "serde", @@ -4768,7 +4768,7 @@ dependencies = [ [[package]] name = "runvil-plugin" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "runvil-types", "runvil-vfs", @@ -4777,21 +4777,21 @@ dependencies = [ [[package]] name = "runvil-plugin-sdk" -version = "0.7.0" -source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78#450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" +version = "0.8.0" +source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=f2d42cc41b0f28f81ac73193f21c2eacfafc11d9#f2d42cc41b0f28f81ac73193f21c2eacfafc11d9" dependencies = [ "runvil-plugin-sys", ] [[package]] name = "runvil-plugin-sys" -version = "0.7.0" -source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78#450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" +version = "0.8.0" +source = "git+https://github.com/cppalliance/runvil-plugin-api?rev=f2d42cc41b0f28f81ac73193f21c2eacfafc11d9#f2d42cc41b0f28f81ac73193f21c2eacfafc11d9" [[package]] name = "runvil-prompt" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "pulldown-cmark", "runvil-lua", @@ -4804,7 +4804,7 @@ dependencies = [ [[package]] name = "runvil-runtime" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "gateway-types", "mlua", @@ -4822,7 +4822,7 @@ dependencies = [ [[package]] name = "runvil-types" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" dependencies = [ "gateway-types", "serde", @@ -4833,7 +4833,7 @@ dependencies = [ [[package]] name = "runvil-vfs" version = "0.3.0" -source = "git+https://github.com/cppalliance/runvil-harness?rev=942835504ee66f32538c9dcb6dea59dd057e61f1#942835504ee66f32538c9dcb6dea59dd057e61f1" +source = "git+https://github.com/cppalliance/runvil-harness?rev=faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0#faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" [[package]] name = "rust-embed" diff --git a/Cargo.toml b/Cargo.toml index 4397809d..ad3afe35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,35 +25,35 @@ repository = "https://github.com/cppalliance/runvil-workshop" # Workshop links in. All three name one commit, because two commits would # be two copies of every type the crates share. `version` beside `git` # keeps cargo-deny's wildcard check quiet. -runvil = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "942835504ee66f32538c9dcb6dea59dd057e61f1" } -harness-gateway-client = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "942835504ee66f32538c9dcb6dea59dd057e61f1" } -plugin-mcp = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "942835504ee66f32538c9dcb6dea59dd057e61f1" } -# The safe layer over the C Plugin contract, version 0.7, from its own +runvil = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" } +harness-gateway-client = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" } +plugin-mcp = { version = "0.3.0", git = "https://github.com/cppalliance/runvil-harness", rev = "faf6d613bb9e76fd422fbaba3e5aba6b67ba58e0" } +# The safe layer over the C Plugin contract, version 0.8, from its own # repository, pinned by commit. Only the library Plugin crates under # `crates/workshop/` name it, for `export_plugin!`. The commit is the one # runvil-harness pins the contract's `runvil-plugin-sys` at: that crate # sets `links`, so Cargo refuses two commits of the contract in one build. -runvil-plugin-sdk = { version = "0.7.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "450afa2d3b0d70c3f2a4a9f89f5938da5ef0fb78" } +runvil-plugin-sdk = { version = "0.8.0", git = "https://github.com/cppalliance/runvil-plugin-api", rev = "f2d42cc41b0f28f81ac73193f21c2eacfafc11d9" } # The std Plugin, from its own repository, pinned by commit, which must be # built against the contract commit above. default-features off drops its # own export of `runvil_plugin`, which `workshop-plugin-std` makes instead. # The key is `std-plugin` because that crate's own library is named # `plugin_std`, the name of the file Workshop ships. -std-plugin = { package = "plugin-std", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-std", rev = "f1541bf93b2a7fe75abfc905e4588906104f3a16", default-features = false } +std-plugin = { package = "plugin-std", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-std", rev = "c3653768df3817a7140059c1de66195e51408b70", default-features = false } # The bashkit Plugin, from its own repository, pinned by commit and built # against the same contract commit. default-features off drops its own # export of `runvil_plugin`, which `workshop-plugin-bashkit` makes # instead. The key is `bashkit-plugin` for the reason std's is # `std-plugin`: the crate's own library has the name of the file Workshop # ships, `plugin_bashkit`. -bashkit-plugin = { package = "plugin-bashkit", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-bashkit", rev = "35f8e4b72a9c14a4611899abcdb43a888a3287a3", default-features = false } +bashkit-plugin = { package = "plugin-bashkit", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-bashkit", rev = "67cc930c47bedace9af648982f72b6e12c77ba08", default-features = false } # The web Plugin, from its own repository, pinned by commit and built # against the same contract commit. default-features off drops its own # export of `runvil_plugin`, which `workshop-plugin-web` makes instead. # The key is `web-plugin` for the reason std's is `std-plugin`: the # crate's own library has the name of the file Workshop ships, # `plugin_web`. -web-plugin = { package = "plugin-web", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-web", rev = "1d5aefccada1b49d924cada1d2c2080a22b3db3b", default-features = false } +web-plugin = { package = "plugin-web", version = "0.1.0", git = "https://github.com/cppalliance/runvil-plugin-web", rev = "a24f3400022e43f237319db89ec4454063ec859a", default-features = false } workshop-gateway-discovery = { path = "crates/workshop/gateway-discovery" } workshop-server = { path = "crates/workshop/server" } workshop-server-api = { path = "crates/workshop/server-api" }