diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efa31fe3..fd66f248 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -278,6 +278,10 @@ jobs: # dylint-link binaries need glibc 2.38 or later, and 22.04 ships 2.35. dylint: runs-on: ubuntu-24.04 + env: + # The Tauri system packages, named once for the two steps that hand + # them to apt-get. + TAURI_APT_PACKAGES: libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev steps: - uses: actions/checkout@v4 @@ -290,13 +294,175 @@ jobs: - name: Cache cargo uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2 - # A mirror that does not answer makes apt-get wait for a long time, so - # the step fails after 20 minutes. It normally takes under one. - - name: Install Tauri system packages - timeout-minutes: 20 + # On this image apt can get the archives of the Tauri packages at + # about 60 kB/s, which is 20 minutes for 70 MB. It stays on that + # mirror, because its timeout fires only when no data arrives for 15 + # seconds: https://github.com/actions/runner-images/issues/14823 + # So this step and the three after it keep the archives in an Actions + # cache, and apt downloads only the ones the cache lacks. This step + # asks apt which archives it would download, and the cache key is a + # hash of their names, sizes, and hashes. The key leaves the addresses + # out, because the mirror differs from runner to runner. A mirror that + # does not answer makes apt-get wait for a long time, so the step + # fails after 10 minutes. + - name: List the archives of the Tauri system packages + id: apt-list + timeout-minutes: 10 + shell: bash run: | + set -euo pipefail + read -r -a packages <<< "$TAURI_APT_PACKAGES" + list="$RUNNER_TEMP/dylint-apt-archives.txt" sudo apt-get update - sudo apt-get install -y --no-install-recommends libwebkit2gtk-4.1-dev libssl-dev librsvg2-dev + # --print-uris prints one line for each archive apt would download: + # 'address' name size KIND:hash. ForceHash makes the hash the + # SHA-256 of the package index, where apt prints the MD5 sum by + # default. An archive whose line has no SHA-256 or SHA-512 is + # listed with `-` and is never cached. + name_form='^[A-Za-z0-9][A-Za-z0-9+._~%-]*\.deb$' + hash_form='^(SHA256:[0-9a-f]{64}|SHA512:[0-9a-f]{128})$' + : > "$list.unsorted" + unread=0 + if uris="$(sudo apt-get install --print-uris -qq -y --no-install-recommends \ + -o Acquire::ForceHash=sha256 "${packages[@]}")"; then + while read -r address name size hash _; do + if [[ "$name" =~ $name_form && "$size" =~ ^[0-9]+$ ]]; then + [[ "$hash" =~ $hash_form ]] || hash=- + printf '%s %s %s\n' "$name" "$size" "$hash" >> "$list.unsorted" + elif [ -n "$address" ]; then + unread=$((unread + 1)) + fi + done <<< "$uris" + else + echo "::warning::apt-get could not list the archives of the Tauri packages, so this run uses no cache of them." + fi + # One order on every runner, so one list gives one key. + LC_ALL=C sort -u "$list.unsorted" > "$list" || : > "$list" + if [ "$unread" -ne 0 ]; then + echo "::warning::$unread lines of apt-get --print-uris do not have the form 'address' name size hash, so their archives are not cached." + fi + echo "apt would download $(wc -l < "$list") archives, and $(grep -c -v ' -$' "$list" || true) of them have a hash this job checks." + digest="$(sha256sum < "$list")" || digest=unlisted + { + echo "list=$list" + echo "dir=$RUNNER_TEMP/dylint-apt-archives" + echo "hash=${digest%% *}" + } >> "$GITHUB_OUTPUT" + + # A run that finds no cache of its own list restores the newest cache + # of another list, and the next step takes from it the archives that + # are in both lists. A restore that fails, or that takes more than 10 + # minutes, is a run with no cache. + - name: Restore the archives of the Tauri system packages + id: apt-cache + continue-on-error: true + timeout-minutes: 10 + uses: actions/cache/restore@v6 + with: + path: ${{ steps.apt-list.outputs.dir }} + key: dylint-apt-archives-${{ steps.apt-list.outputs.hash }} + restore-keys: dylint-apt-archives- + + # apt takes an archive that is already in its directory when the size + # is right, and it checks no hash of it. So a restored file goes into + # that directory only when it has the hash that apt listed, and apt + # downloads every other archive itself. After the download the cache + # directory gets the listed archives and nothing else, each checked + # the same way, and that comes before the install in case the install + # removes them. A run with no cache downloads every archive, which + # takes about 20 minutes from a slow mirror, so the step fails after + # 30. With every archive in the cache it downloads nothing. + - name: Install Tauri system packages + id: apt-install + timeout-minutes: 30 + shell: bash + env: + APT_LIST: ${{ steps.apt-list.outputs.list }} + APT_CACHE: ${{ steps.apt-list.outputs.dir }} + run: | + set -euo pipefail + read -r -a packages <<< "$TAURI_APT_PACKAGES" + list="${APT_LIST:-}" + cache="${APT_CACHE:-}" + # The cache directory is removed below, so it must be this job's. + case "$cache" in "$RUNNER_TEMP"/?*) ;; *) cache= ;; esac + archives=/var/cache/apt/archives/ + eval "$(apt-config shell archives Dir::Cache::Archives/d || true)" + archives="${archives%/}" + [ -d "$archives" ] || archives=/var/cache/apt/archives + + # Succeeds when the file $2 has the hash $1, which is SHA256:hex + # or SHA512:hex. A hash of any other kind is not checked, so the + # file fails. + has_hash() { + local actual + case "$1" in + SHA256:*) actual="$(sha256sum < "$2")" || return 1 ;; + SHA512:*) actual="$(sha512sum < "$2")" || return 1 ;; + *) return 1 ;; + esac + [ "${1%%:*}:${actual%% *}" = "$1" ] + } + + staged=0 + refused=0 + if [ -n "$cache" ] && [ -d "$cache" ] && [ -f "$list" ]; then + while read -r name _ expected <&3; do + case "$expected" in SHA256:* | SHA512:*) ;; *) continue ;; esac + [ -f "$cache/$name" ] || continue + if ! has_hash "$expected" "$cache/$name"; then + refused=$((refused + 1)) + echo "The restored $name does not have the hash $expected." + elif sudo cp -- "$cache/$name" "$archives/$name"; then + staged=$((staged + 1)) + fi + done 3< "$list" + fi + echo "$staged archives come from the cache." + if [ "$refused" -ne 0 ]; then + echo "::warning::$refused restored archives do not have the hash that apt lists, so apt downloads them again. This job saves only archives that have that hash, so the restored cache is damaged or something else saved it. Delete that cache." + fi + + sudo apt-get install --download-only -y --no-install-recommends "${packages[@]}" + + kept=0 + wanted=0 + if [ -n "$cache" ] && [ -f "$list" ] && rm -rf -- "$cache" && mkdir -p -- "$cache"; then + while read -r name _ expected <&3; do + case "$expected" in SHA256:* | SHA512:*) ;; *) continue ;; esac + wanted=$((wanted + 1)) + if [ -f "$archives/$name" ] && sudo cat -- "$archives/$name" > "$cache/$name" && has_hash "$expected" "$cache/$name"; then + kept=$((kept + 1)) + else + rm -f -- "$cache/$name" || true + fi + done 3< "$list" + fi + complete=false + if [ "$wanted" -gt 0 ] && [ "$kept" -eq "$wanted" ]; then + complete=true + elif [ "$wanted" -gt 0 ]; then + echo "::warning::The cache directory holds $kept of the $wanted archives to cache, so this run saves no cache." + fi + echo "The cache directory holds $kept of the $wanted archives to cache." + echo "cache-complete=$complete" >> "$GITHUB_OUTPUT" + + sudo apt-get install -y --no-install-recommends "${packages[@]}" + + # A step of its own, before the lint, so that a run whose lint fails + # still saves the archives. A cache is never replaced, so a run that + # restored the cache of its own list saves nothing. A run whose cache + # directory lacks an archive of the list saves nothing either, because + # a later run would restore that cache and never fill it. A save that + # fails leaves the job as it is. + - name: Save the archives of the Tauri system packages + if: steps.apt-cache.outputs.cache-hit != 'true' && steps.apt-install.outputs.cache-complete == 'true' + continue-on-error: true + timeout-minutes: 10 + uses: actions/cache/save@v6 + with: + path: ${{ steps.apt-list.outputs.dir }} + key: dylint-apt-archives-${{ steps.apt-list.outputs.hash }} - uses: actions/setup-node@v4 with: diff --git a/Cargo.lock b/Cargo.lock index 12b665fc..e0ce945f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2415,12 +2415,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "humantime" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" - [[package]] name = "hybrid-array" version = "0.4.14" @@ -8182,7 +8176,6 @@ version = "0.0.0" dependencies = [ "axum", "dunce", - "humantime", "percent-encoding", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 6252e917..5cac133d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,7 +110,6 @@ arc-swap = "1" # into the binary in release builds. interpolate-folder-path resolves the # $OUT_DIR prefix in the `folder` attribute. rust-embed = { version = "8", features = ["interpolate-folder-path"] } -humantime = "2" tempfile = "3" # Exact pin: turso is pre-1.0 and backs user-visible workspace files, so # upgrades are deliberate, reviewed changes rather than resolver drift. diff --git a/crates/workshop/workspace/Cargo.toml b/crates/workshop/workspace/Cargo.toml index f321db38..078f81b5 100644 --- a/crates/workshop/workspace/Cargo.toml +++ b/crates/workshop/workspace/Cargo.toml @@ -17,7 +17,6 @@ test-fixtures = [] [dependencies] axum.workspace = true dunce.workspace = true -humantime.workspace = true serde.workspace = true serde_json.workspace = true thiserror.workspace = true diff --git a/crates/workshop/workspace/src/lib.rs b/crates/workshop/workspace/src/lib.rs index 243a486d..6cda5483 100644 --- a/crates/workshop/workspace/src/lib.rs +++ b/crates/workshop/workspace/src/lib.rs @@ -31,6 +31,7 @@ mod blocking; mod error; mod handlers; mod handles; +mod rfc3339; #[cfg(test)] mod test_support; mod workspace; diff --git a/crates/workshop/workspace/src/rfc3339-tests.rs b/crates/workshop/workspace/src/rfc3339-tests.rs new file mode 100644 index 00000000..05358017 --- /dev/null +++ b/crates/workshop/workspace/src/rfc3339-tests.rs @@ -0,0 +1,90 @@ +//! Tests of the time text: fixed counts of seconds on each side of a +//! leap day, of a century year that has none, and of the end of the +//! year 9999, then the two rules for a clock outside those years. + +use std::time::Duration; + +use super::*; + +/// The last second that RFC 3339 has a text for, `9999-12-31T23:59:59Z`. +const LAST_SECOND_OF_9999: u64 = 253_402_300_799; + +#[test] +fn a_count_of_seconds_formats_as_its_utc_date_and_time() { + let cases = [ + (0, "1970-01-01T00:00:00Z"), + (951_782_400, "2000-02-29T00:00:00Z"), + (951_868_799, "2000-02-29T23:59:59Z"), + (1_000_000_000, "2001-09-09T01:46:40Z"), + (1_709_164_800, "2024-02-29T00:00:00Z"), + (LAST_SECOND_OF_9999, "9999-12-31T23:59:59Z"), + ]; + for (seconds, text) in cases { + assert_eq!(rfc3339_of_seconds(seconds), text, "{seconds} seconds"); + } +} + +#[test] +fn a_century_year_that_400_does_not_divide_has_no_leap_day() { + assert_eq!(rfc3339_of_seconds(4_107_542_399), "2100-02-28T23:59:59Z"); + assert_eq!( + rfc3339_of_seconds(4_107_542_400), + "2100-03-01T00:00:00Z", + "the second after February 28 of 2100 is in March" + ); +} + +#[test] +fn a_time_drops_its_part_of_a_second() { + let time = UNIX_EPOCH + Duration::new(1_000_000_000, 999_999_900); + assert_eq!(rfc3339_of(time), "2001-09-09T01:46:40Z"); +} + +#[test] +fn a_time_before_the_epoch_reads_as_the_epoch() { + let before = [ + Duration::from_nanos(100), + Duration::from_secs(1), + Duration::from_hours(24 * 365), + ]; + for earlier in before { + let time = UNIX_EPOCH + .checked_sub(earlier) + .expect("the system clock has a time this far before the epoch"); + assert_eq!( + rfc3339_of(time), + "1970-01-01T00:00:00Z", + "{earlier:?} before the epoch" + ); + } +} + +#[test] +fn a_year_past_9999_prints_every_digit_it_has() { + assert_eq!( + rfc3339_of_seconds(LAST_SECOND_OF_9999 + 1), + "10000-01-01T00:00:00Z", + "the second after the last one RFC 3339 has a text for" + ); + assert_eq!( + rfc3339_of_seconds(u64::MAX), + "584554051223-11-09T07:00:15Z", + "the largest count of seconds formats too" + ); +} + +#[test] +fn the_current_time_has_the_form_of_the_text() { + let now = now_rfc3339(); + let form: String = now + .chars() + .map(|character| { + if character.is_ascii_digit() { + '0' + } else { + character + } + }) + .collect(); + assert_eq!(form, "0000-00-00T00:00:00Z", "{now}"); +} diff --git a/crates/workshop/workspace/src/rfc3339.rs b/crates/workshop/workspace/src/rfc3339.rs new file mode 100644 index 00000000..97f4744c --- /dev/null +++ b/crates/workshop/workspace/src/rfc3339.rs @@ -0,0 +1,83 @@ +//! The time text the workspace stores: RFC 3339 in UTC to whole seconds, +//! `YYYY-MM-DDTHH:MM:SSZ`. +//! +//! [`now_rfc3339`] reads the wall clock, and [`rfc3339_of_seconds`] +//! formats a count of seconds with no clock, so a test pins exact texts. +//! Both are total: no clock reading and no count of seconds makes one +//! fail or panic. A time before the Unix epoch reads as the epoch, and +//! a year past 9999, for which RFC 3339 has no form, prints with every +//! digit it has. + +use std::time::{SystemTime, UNIX_EPOCH}; + +/// The seconds in one day of Unix time, which counts no leap second. +const SECONDS_PER_DAY: u64 = 86_400; + +/// The current time as RFC 3339 in UTC, whole seconds. It never fails: +/// a clock set before the Unix epoch reads as the epoch +/// ([`rfc3339_of`]), and a clock past the year 9999 prints its year with +/// every digit it has ([`rfc3339_of_seconds`]). +pub(crate) fn now_rfc3339() -> String { + rfc3339_of(SystemTime::now()) +} + +/// `time` as RFC 3339 in UTC, with the part of a second dropped. A time +/// before the Unix epoch reads as the epoch, `1970-01-01T00:00:00Z`: the +/// text records when something happened, and a clock set that far back +/// is wrong whatever the text says. +fn rfc3339_of(time: SystemTime) -> String { + // `duration_since` fails only for a time before the epoch. + let since_epoch = time.duration_since(UNIX_EPOCH).unwrap_or_default(); + rfc3339_of_seconds(since_epoch.as_secs()) +} + +/// The time `seconds` whole seconds after the Unix epoch, as +/// `YYYY-MM-DDTHH:MM:SSZ`. The year has four digits through +/// `9999-12-31T23:59:59Z`, which is 253,402,300,799 seconds. A later +/// time prints its year with every digit it has, as in +/// `10000-01-01T00:00:00Z`, which is no RFC 3339 text, and the largest +/// count there is still formats. +fn rfc3339_of_seconds(seconds: u64) -> String { + let (year, month, day) = civil_from_days(seconds / SECONDS_PER_DAY); + let second_of_day = seconds % SECONDS_PER_DAY; + format!( + "{year:04}-{month:02}-{day:02}T{:02}:{:02}:{:02}Z", + second_of_day / 3_600, + second_of_day / 60 % 60, + second_of_day % 60 + ) +} + +/// The year, the month, and the day of the month of the day `days` days +/// after 1970-01-01, in the Gregorian calendar. `days` is a count of +/// seconds divided by [`SECONDS_PER_DAY`], and no such number is large +/// enough to overflow a sum here. +fn civil_from_days(days: u64) -> (u64, u64, u64) { + // Howard Hinnant's `civil_from_days`: + // https://howardhinnant.github.io/date_algorithms.html#civil_from_days + // It counts days from 0000-03-01, so a year starts in March and a + // leap day is the last day of its year, and it works in eras of 400 + // years, which are 146,097 days each. A day at or after 1970-01-01 + // keeps every value here at or above zero, so the arithmetic is + // unsigned. + let shifted = days + 719_468; + let era = shifted / 146_097; + let day_of_era = shifted % 146_097; + let year_of_era = + (day_of_era - day_of_era / 1_460 + day_of_era / 36_524 - day_of_era / 146_096) / 365; + let day_of_year = day_of_era - (365 * year_of_era + year_of_era / 4 - year_of_era / 100); + let month_from_march = (5 * day_of_year + 2) / 153; + let day = day_of_year - (153 * month_from_march + 2) / 5 + 1; + let month = if month_from_march < 10 { + month_from_march + 3 + } else { + month_from_march - 9 + }; + // January and February belong to the year that started in March. + let year = year_of_era + era * 400 + u64::from(month <= 2); + (year, month, day) +} + +#[cfg(test)] +#[path = "rfc3339-tests.rs"] +mod tests; diff --git a/crates/workshop/workspace/src/workspace.rs b/crates/workshop/workspace/src/workspace.rs index f7cee8d4..86c876df 100644 --- a/crates/workshop/workspace/src/workspace.rs +++ b/crates/workshop/workspace/src/workspace.rs @@ -25,7 +25,8 @@ use serde::Serialize; use tokio::sync::watch; use crate::error::WorkspaceError; -use crate::workspace_file::{WindowState, now_rfc3339}; +use crate::rfc3339::now_rfc3339; +use crate::workspace_file::WindowState; mod backing; mod confine; diff --git a/crates/workshop/workspace/src/workspace_file.rs b/crates/workshop/workspace/src/workspace_file.rs index 0d57cc69..9aab0616 100644 --- a/crates/workshop/workspace/src/workspace_file.rs +++ b/crates/workshop/workspace/src/workspace_file.rs @@ -23,7 +23,6 @@ mod actor; mod siblings; pub(crate) mod ui_state_kv; -pub(crate) use actor::now_rfc3339; use actor::{COMMAND_QUEUE_DEPTH, Command, SCHEMA_V1}; use siblings::{already_taken, copy_siblings_or_clean_up, plan_siblings}; pub(crate) use ui_state_kv::{UI_STATE_KEYS, empty_ui_state}; diff --git a/crates/workshop/workspace/src/workspace_file/actor.rs b/crates/workshop/workspace/src/workspace_file/actor.rs index 9c7166f2..df651eb2 100644 --- a/crates/workshop/workspace/src/workspace_file/actor.rs +++ b/crates/workshop/workspace/src/workspace_file/actor.rs @@ -3,7 +3,6 @@ //! so the file mirrors memory without locks. use std::path::{Path, PathBuf}; -use std::time::SystemTime; use tokio::sync::{mpsc, oneshot}; @@ -13,6 +12,7 @@ use super::{ SUPPORTED_VERSION, WindowState, WorkspaceContents, WorkspaceFileError, io_failure, }; use crate::blocking::blocking; +use crate::rfc3339::now_rfc3339; /// A reply slot for a command that answers with success or failure. type Ack = oneshot::Sender>; @@ -328,11 +328,6 @@ fn window_json(state: &WindowState) -> String { serde_json::to_string(state).unwrap_or_default() } -/// The current time as RFC 3339 in UTC, whole seconds. -pub(crate) fn now_rfc3339() -> String { - humantime::format_rfc3339_seconds(SystemTime::now()).to_string() -} - /// Removes the `-wal` sidecar beside `path` when it holds no frames. fn remove_empty_wal_sidecar(path: &Path) { let sidecar = wal_sidecar_of(path); diff --git a/deny.toml b/deny.toml index eaa32d99..4ac7e957 100644 --- a/deny.toml +++ b/deny.toml @@ -14,13 +14,7 @@ version = 2 unmaintained = "workspace" yanked = "deny" # Reviewed advisories consciously accepted go here, each with a rationale. -ignore = [ - # humantime is marked unmaintained; the advisory reports no vulnerability - # and no safe upgrade. workshop-workspace uses one function of it, - # `format_rfc3339_seconds`, to stamp a time. The entry goes when the - # crate is replaced. - { id = "RUSTSEC-2026-0542", reason = "humantime is unmaintained with no vulnerability reported and no safe upgrade; remove this entry when the crate is replaced" }, -] +ignore = [] [licenses] version = 2 diff --git a/plan/2026-11-08-2-run-inbox-user-pack.plan.md b/plan/2026-11-08-2-run-inbox-user-pack.plan.md index 40af531f..8d2779a3 100644 --- a/plan/2026-11-08-2-run-inbox-user-pack.plan.md +++ b/plan/2026-11-08-2-run-inbox-user-pack.plan.md @@ -294,7 +294,7 @@ A message is not a stop. It withdraws only a model request that has no answer ye - One loop form. A conversation with a user loops over `messages:user(tasks.receive())` and `models.loop()`; a resumable task loops over `models.loop()` and `messages:user(tasks.reply(messages[#messages].content))`. `models.loop` keeps returning nothing, since `messages[#messages].content` already holds its final reply. There is no `models.user_loop`. - A message the Host sends is recorded as its `InboxMessage` event, which `Run::deliver` returns so the Harness records it where the input happened, and a replay delivers it again. Making each message the answer to a standing effect on the main chain would keep replay to answers alone, but that effect would have to be spared by stops, left out of stall detection, and reissued after every message. - Hosts learn the main chain's input state from the events their recorder receives: `InboxWaiting` when it parks on its empty inbox, and `InboxMessage` when a message arrives. `RunControl` stays `send`, `stop_round`, and cancel. -- A message never withdraws a tool call. Harnesses that steer a running turn let running tools finish and cut at most the model's streaming reply, because a cut-off tool may already have changed something; a stop stays the way to cut tools. The source survey is in the sibling repository `runvil-design`, at `research/2026-11-08-harness-survey-input-steering.md`. +- A message never withdraws a tool call. Harnesses that steer a running turn let running tools finish and cut at most the model's streaming reply, because a cut-off tool may already have changed something; a stop stays the way to cut tools. - `tasks.send` and `RunControl::send` deliver the text as given. The Engine adds only the arrival line, and only to messages `models.loop` appends. Labeling a model-written message and wrapping it as untrusted belongs to the future subagents Pack. - `tasks.send` returns false for a task that has ended, and `RunControl::send` returns false once the run has ended, each dropping the text, as `tasks.cancel` does nothing for a task that has ended (`crates/runvil-internal/engine/src/execute/scheduler/waits.rs` line 26). Neither adds an error. - One delivery mode in the Engine: a message always steers the loop that is running. A follow-up queue, which holds messages until the agent waits for one, belongs to the Host. The Workshop will keep one, so its operator can edit or unsend a message until it is handed over: it hands over one message per `InboxWaiting` event on the main chain. `RunControl` gains no unsend, since a message it accepted is committed. Until that queue exists, the Workshop sends each message at once, which steers a running turn. diff --git a/vibe/2026-09/2026-09-13-1-capabilities-global-naming.md b/vibe/2026-09/2026-09-13-1-capabilities-global-naming.md index 6e92e3b1..57fb1e63 100644 --- a/vibe/2026-09/2026-09-13-1-capabilities-global-naming.md +++ b/vibe/2026-09/2026-09-13-1-capabilities-global-naming.md @@ -30,7 +30,7 @@ isProject: false **How to Execute This Plan (read first if you are a fresh context):** -- **Where the code is**: the repository is `runvil/` in the workspace root (`c:\Users\Vinnie\cursor\runvil`), a Rust workspace with crates under `crates/`. All `crates/...` paths in this plan are relative to that repo. Related paths, also relative to the workspace root: `runvil-design/research/` (the evidence documents), `vibe/` (prior plans), `wg21-paperflow/crates/papergate` (the first out-of-repo consumer), and the prompt guide at `runvil/guide/src/`. +- **Where the code is**: the repository is `runvil/` in the workspace root (`c:\Users\Vinnie\cursor\runvil`), a Rust workspace with crates under `crates/`. All `crates/...` paths in this plan are relative to that repo. Related paths, also relative to the workspace root: `vibe/` (prior plans), `wg21-paperflow/crates/papergate` (the first out-of-repo consumer), and the prompt guide at `runvil/guide/src/`. - **Read order**: Product Requirements (what and why) -> Technical Design including the live declarations (the shapes to build) -> Execution Instructions (the components and their ordered steps) -> Testing Plan. Read the Project Survey first if you are new to the codebase - it defines every term (H1/H2, the picker, slots/bindings, the VFS, fanout) and lists the verified current-state facts with file and line references. Consult the Decision Record only when a choice seems arbitrary; every decision records its user quote. - **Status**: surveyed and decomposed, execution not started. The Project Survey carries `- Status: complete` (build/test/lint/fmt/docs commands discovered 2026-09-13). The Execution Instructions are 18 committable steps in 7 dependency-ordered components, each wrapped in a `` tag pair; the frontmatter todos mirror the components with their step ranges - mark each `complete` as its steps land, and the run appends ` [completed]` to each `### Step N:` heading. The plan passes the vibe-coder contract check (seven H2 sections in order, six balanced contract tag pairs, balanced step tags) and is ready to seed into `vibe/` when a run starts. Reviewed for internal consistency 2026-09-13 (deferrals of the open toolset, the `prompt` reflection global, and the prompt-pack Plugin are fully propagated). - **Working agreements** (from the plan's constraints): behavior changes ship with their tests in the same change; the interface consolidation (step 4) is the parity gate (no behavior change, full suite green); do not build anything listed under Deferred - the live shapes leave room for it, that is all. @@ -843,7 +843,7 @@ Current-state facts established by two codebase maps and a targeted VFS review ( - 2026-09-13 verification, migration scale: 4 shipped prompts use prose binds (1 tools.bind, 4 models.bind/default), `chat.md` needs no bind migration, 3 fenced guide examples, and ~60-80 prose bind call sites in tests concentrated in `runvil-lua/src/tests.rs` and runvil-api execute/model test modules. - 2026-09-13 verification, external consumer: papergate (`wg21-paperflow/crates/papergate`) is the first out-of-repo Host - a CLI consuming the `runvil_core` facade via `execute::run(&parsed, args, resolution, &store, config)` (five arguments; an explicit store rides alongside ResolutionContext/RunConfig, a slightly different shape than the interface recorded above). It builds a picker over an empty catalog as pure ceremony and manages its own temp-dir store - both eliminated by the new interface. Its migration is the external validation of the prepare -> adjust -> run flow. - The one-interface plan (`vibe/2026-09-12-5-one-door-runvil-api.md`) explicitly deferred "Harness-installed tool groups / global tool namespace" - this plan is that work. -- Background research (permanent locations): the naming survey `runvil-design/research/naming-survey-tool-packs.md` (2026-09-13; four sub-surveys behind it) and the Everruns feature survey plus integration-path analysis (`runvil-design/research/feature-survey-everruns.md` and `runvil-design/research/integration-path-everruns-capabilities.md`, 2026-09-12). +- Background research: the naming survey (2026-09-13; four sub-surveys behind it) and the Everruns feature survey plus integration-path analysis (2026-09-12). diff --git a/vibe/2026-09/2026-09-15-5-workshop-menu-overhaul.md b/vibe/2026-09/2026-09-15-5-workshop-menu-overhaul.md index 29d1b28e..bb38159d 100644 --- a/vibe/2026-09/2026-09-15-5-workshop-menu-overhaul.md +++ b/vibe/2026-09/2026-09-15-5-workshop-menu-overhaul.md @@ -50,7 +50,7 @@ The Runvil workshop is an IDE shell for writing and running Runvil prompts, with - Non-goals: no `workshop-server` or protocol changes (the desktop shell crate gains only the macOS window config and a `quit` command that reuses the existing menu handler); no browser panel (designed, deferred); no debugger, terminal, search-across-files, source control, or language-server features (their rows are stubs); no multi-window support; no Model menu (the agent toolbar's model picker covers model selection); no recursive file index behind Ctrl+P. - Success criteria: the eight menus render the spec's rows with correct enabled/disabled state; every wired row performs its action from menu, shortcut, and palette; flyouts and chords behave as specified; the pill opens the modes list; the full test suite, typecheck, and bundle build pass with the lazy chunk split intact. - Constraints: - - This plan is self-contained and needs no conversation history. Paths are relative to the workspace root `c:\Users\Vinnie\cursor`, which holds the `runvil` repository (the code under test), `runvil-design` (research), and `cabinet` (staging; superseded files go to `cabinet/_trash/`). The frontmatter todos mirror the work items in Execution Instructions; mark each `in_progress` then `completed` as it lands. + - This plan is self-contained and needs no conversation history. Paths are relative to the workspace root `c:\Users\Vinnie\cursor`, which holds the `runvil` repository (the code under test) and `cabinet` (staging; superseded files go to `cabinet/_trash/`). The frontmatter todos mirror the work items in Execution Instructions; mark each `in_progress` then `completed` as it lands. - The existing stack is fixed: plain-DOM TypeScript bundled by esbuild, CodeMirror 6 editors, dockview panels, Tauri 2 shell; layering rule `base/ -> services/ -> ui/` with `main.ts` as composition root (`runvil/crates/workshop-server/ui/AGENTS.md`). - Shared state lives in services with change emitters; no mutable module globals (`runvil/crates/workshop-server/ui/AGENTS.md`). - The server owns workbench state; the UI renders and dispatches. @@ -483,7 +483,7 @@ Keybinding changes versus today: `editor.close` moves from Ctrl+W to Ctrl+F4 (Cu ## Technical Design -The mechanics are the VS Code family's: a command registry carrying action metadata, a menu registry keyed by `MenuId` where a submenu is a menu item whose payload is another menu id and the menubar is the root menu's children, a keybinding registry with a pure chord resolver, a context-key service with a `when` expression language, and a prefix-keyed quick-access registry. A field study of seven codebases at pinned commits (microsoft/vscode, eclipse-theia/theia, opensumi/core, voideditor/void, posit-dev/positron, gitpod-io/openvscode-server, coder/code-server) found the two from-scratch reimplementations converged on these names and shapes; the evidence and per-reference citations are at `runvil-design/research/workshop-steal-vscode-menu-architecture.md`. Registries are DOM-free and live in `services/`; widgets live in `ui/`; the existing layering rule `base/ -> services/ -> ui/` is unchanged. +The mechanics are the VS Code family's: a command registry carrying action metadata, a menu registry keyed by `MenuId` where a submenu is a menu item whose payload is another menu id and the menubar is the root menu's children, a keybinding registry with a pure chord resolver, a context-key service with a `when` expression language, and a prefix-keyed quick-access registry. A field study of seven codebases at pinned commits (microsoft/vscode, eclipse-theia/theia, opensumi/core, voideditor/void, posit-dev/positron, gitpod-io/openvscode-server, coder/code-server) found the two from-scratch reimplementations converged on these names and shapes. Registries are DOM-free and live in `services/`; widgets live in `ui/`; the existing layering rule `base/ -> services/ -> ui/` is unchanged. ```mermaid flowchart LR @@ -597,7 +597,7 @@ Registries and resolvers get jsdom-free unit tests; widgets and contributions ge - Wire every command CodeMirror or the installed Tauri plugins already back, under VS Code command ids, all `f1` so the palette and pill list them. User's words: "if CodeMirror has the commands then wire them. And can you wire the available commands into the pill? Make commands for the things we support? ... I want it compatible with vscode how it does things, names of things, approach to implementation, you know what I mean?" - Undo/redo/select-all route through a `TextControlService` with per-widget adapters (CodeMirror, the agent's ProseMirror prompt, future Run-panel boxes) instead of branching on editor kind. User's words: "The Agent window needs just as good undo as the editors, plus there will be the Run window (a new panel) that has edit boxes which need undo." - Ctrl+P uses only data that already exists (fetched tree listings, recent files); no server route, no index, no follow-up. User's words: "the files/context stuff is totally absent, do not put any effort into Ctrl+P. Only use what is there. If nothing is there, then that's also ok. do not invent shit." - - Naming follows VS Code without the `I` prefix (`MenuItem`, `SubmenuItem`, `CommandAction`, `ContextKey`), with command ids, context-key names, `MenuId` values, group names, and method names verbatim. Rationale: the no-prefix convention is the codebase's standard and Theia's precedent; convergence evidence across seven references is at `runvil-design/research/workshop-steal-vscode-menu-architecture.md`. + - Naming follows VS Code without the `I` prefix (`MenuItem`, `SubmenuItem`, `CommandAction`, `ContextKey`), with command ids, context-key names, `MenuId` values, group names, and method names verbatim. Rationale: the no-prefix convention is the codebase's standard and Theia's precedent; convergence evidence across seven references is in the field study. - Eager `*.contribution.ts` files register action data at boot while `run` lazily imports the implementation. Rationale: feature `register()` runs on chunk load, so actions registered there would render as disabled raw ids at boot; the panel registry already holds metadata eager and code lazy (`runvil/crates/workshop-server/ui/src/services/panel-registry.ts`). - The keybinding dispatcher listens in the capture phase and swallows claimed chords. Rationale: a bubbling listener runs after CodeMirror's keymap on the content element, so shared chords would fire twice, and a claimed key must never reach the webview's defaults. - Commands take arguments and may be async (`executeCommand(id, ...args): Promise`). Rationale: Open Recent rows each carry a path and the file pickers are asynchronous. diff --git a/vibe/2026-09/2026-09-18-2-remove-tool-picker.md b/vibe/2026-09/2026-09-18-2-remove-tool-picker.md index a2777164..1a1818c1 100644 --- a/vibe/2026-09/2026-09-18-2-remove-tool-picker.md +++ b/vibe/2026-09/2026-09-18-2-remove-tool-picker.md @@ -1,10 +1,7 @@ --- name: Remove tool picker -overview: Archive `runvil-tool-picker` as a frozen non-compiling artifact in the sibling `runvil-design` repository, then remove the crate and every feature that existed only for it (fuzzy tool slots, near-duplicate tool conflicts, the Plugin description lint, the dead `models.bind` resolver) from the Runvil workspace, together with the candle/tokenizers/hf-hub dependency stack, the embedded embedding model, and the CI model cache. +overview: Remove the crate `runvil-tool-picker` and every feature that existed only for it (fuzzy tool slots, near-duplicate tool conflicts, the Plugin description lint, the dead `models.bind` resolver) from the Runvil workspace, together with the candle/tokenizers/hf-hub dependency stack, the embedded embedding model, and the CI model cache. todos: - - id: archive - content: Copy the crate to runvil-design/study-tool-picker/crate/ with a README note and commit there - status: completed - id: consumers content: Remove the picker, fuzzy slots, conflicts, the Plugin lint, and the models.bind resolver from model-client, lua, parser, runtime, and workshop-workspace status: completed @@ -22,18 +19,17 @@ isProject: false # Remove the tool picker -All paths below are relative to the Runvil repository root (`runvil/` in the workspace) unless prefixed with `../runvil-design/`, the sibling design-archive repository. Facts about the dependency graph come from `vibe/dependency-surface.md`, measured on 2026-09-18 at the commit landing the `toml 1` pin with cargo 1.98.0. +All paths below are relative to the Runvil repository root (`runvil/` in the workspace). Facts about the dependency graph come from `vibe/dependency-surface.md`, measured on 2026-09-18 at the commit landing the `toml 1` pin with cargo 1.98.0. ## Product Requirements -The tool picker is a local sentence-embedding engine that maps prose capability descriptions to tools. It is switched off in every shipped build: the Workshop builds its session environment without a picker, so fuzzy slots already go unfilled and the near-duplicate scan already records nothing. Its only live use is an advisory lint inside the Plugin registry. Yet every binary that links the runtime still embeds the fp16 `BAAI/bge-small-en-v1.5` weights, compiles the 50-crate candle and tokenizers stack, needs network access to Hugging Face on a first build, and drags a model cache through four CI workflows. The picker is removed outright, archived as a frozen artifact in the design repository, and the three language and public-API features that existed only for it are removed with it. +The tool picker is a local sentence-embedding engine that maps prose capability descriptions to tools. It is switched off in every shipped build: the Workshop builds its session environment without a picker, so fuzzy slots already go unfilled and the near-duplicate scan already records nothing. Its only live use is an advisory lint inside the Plugin registry. Yet every binary that links the runtime still embeds the fp16 `BAAI/bge-small-en-v1.5` weights, compiles the 50-crate candle and tokenizers stack, needs network access to Hugging Face on a first build, and drags a model cache through four CI workflows. The picker is removed outright, and the three language and public-API features that existed only for it are removed with it. - Problem and users: `crates/workshop/sessions/src/agents/environment.rs` builds `Environment::new().registry(registry)` with no `.picker(...)`, so the fuzzy fill and the conflict scan in `crates/runvil-api-runtime/src/execute/fill.rs` are inert in production; the single live use is `PluginRegistry::new()` building `ToolPicker::empty` for a registration-time lint (`crates/runvil-api-runtime/src/capabilities.rs`). The cost is paid by everyone who builds or ships the runtime or the Workshop: `crates/runvil/tool-picker/build.rs` downloads and converts the model on first build and `src/assets.rs` embeds it with `include_bytes!`; the candle-core/candle-nn/candle-transformers/tokenizers set is 50 exclusive crates, the second-largest exclusive cost in the tree (`vibe/dependency-surface.md`, ranked table); `.github/actions/hf-model-cache/action.yml` is used eleven times across `ci.yml`, `nightly.yml`, `release-workshop.yml`, and `workshop-installer-smoke.yml`. - Goals: - The crate `runvil-tool-picker` and every reference to it leave the Runvil repository: code, tests, benches, manifests, hakari output, nextest configuration, CI, crate READMEs, and the user guide. - - The crate's source is preserved verbatim as a non-compiling artifact in `../runvil-design/study-tool-picker/crate/`, beside the study that produced it. - Fuzzy tool slots (the frontmatter `tools:` map form with `want` and `optional`), near-duplicate tool conflicts (bind-time recording and the scope-time error), and the Plugin description lint are removed as features. - The dead `models.bind` semantic resolver in `crates/runvil/model-client` and its error variants are removed, since that machinery is the model client's only reason to name the picker and `models.bind` itself is already gone from the language. - The workspace pins `candle-core`, `candle-nn`, `candle-transformers`, `tokenizers`, `hf-hub`, `safetensors`, and `half` leave the root `Cargo.toml` when no remaining crate needs them. @@ -46,7 +42,6 @@ The tool picker is a local sentence-embedding engine that maps prose capability - Success criteria: - `cargo tree --workspace -e normal,build --target all -i candle-core` prints nothing, and likewise for `tokenizers`, `hf-hub`, and `safetensors`. - A search of `crates/`, `.github/`, `.config/`, `guide/src/`, `Cargo.toml`, and `AGENTS.md` for `tool-picker`, `tool_picker`, `ToolPicker`, `FuzzySlot`, `NearDuplicate`, `hf-model-cache`, and `HF_TOKEN` returns nothing. History under `vibe/` is exempt, and so are the gateway's own `HF_TOKEN` reads under `crates/gateway/` (its Hugging Face download token for local model artifacts, unrelated to the picker). - - `../runvil-design/study-tool-picker/crate/` holds the 20 files of the crate as they were at the removal commit, and `../runvil-design/study-tool-picker/README.md` names it. - Every verification gate in the Testing Plan passes; `cargo hakari verify` is clean; `cargo test -p build-xtask` passes. - Constraints: - Workspace lints (`Cargo.toml`, `[workspace.lints]`): `unsafe_code` forbidden; `unwrap_used`, `expect_used`, clippy `all` and `pedantic` denied; `missing_docs` and `unreachable_pub` warn. Removal must not leave dead imports, unused fields, or orphaned doc links (`rustdoc::broken_intra_doc_links` is denied). @@ -54,7 +49,6 @@ The tool picker is a local sentence-embedding engine that maps prose capability - Repository policy admits no new structural check without explicit user approval; this plan adds none. - `ToolSlot` in `crates/runvil/parser/src/contract.rs` keeps `#[non_exhaustive]`: the deferred open Host-offered posture is still planned to join it. - Files stay under the 500-line ceiling enforced on the workshop crates carrying the invariants marker (`AGENTS.md`). - - The `../runvil-design` worktree carries unrelated uncommitted changes; the archive commit stages only the copied crate files and the README edit. - Open questions: None ## Functional Specification @@ -77,7 +71,7 @@ No shipped behavior changes for the Workshop's chat sessions, which never had a ## Technical Design -The change is a removal across eight crates, the workspace manifests, CI, the Workshop SPA, and documentation, plus one copy into the sibling repository. No new abstractions are introduced. Exact tool slots, the Plugin registry, and the run's tool catalog keep their shapes minus the picker-dependent members. +The change is a removal across eight crates, the workspace manifests, CI, the Workshop SPA, and documentation. No new abstractions are introduced. Exact tool slots, the Plugin registry, and the run's tool catalog keep their shapes minus the picker-dependent members. - Architecture: unchanged product topology. `runvil-api-runtime` remains the one door; `crates/runvil/` loses one private member. Dependency directions are unaffected: `runvil-model-client` stops depending on the picker, and nothing else gains an edge. - Modules and interfaces: @@ -102,7 +96,6 @@ The change is a removal across eight crates, the workspace manifests, CI, the Wo - CI: every `uses: ./.github/actions/hf-model-cache` step and its `name: Cache the embedding model` line are removed (`ci.yml` five, `nightly.yml` three, `release-workshop.yml` one, `workshop-installer-smoke.yml` one); the `HF_TOKEN: ${{ secrets.HF_TOKEN }}` env entries in `ci.yml`, `nightly.yml`, and `workshop-installer-smoke.yml` are removed; the explanatory comments at `ci.yml` lines 12-18, `nightly.yml` lines 20-22, and `release-workshop.yml` lines 125-126 are removed or rewritten to drop the picker. - Documentation: `crates/README.md` (the `runvil-api-runtime` paragraph no longer lists `tool-picker`); `crates/runvil/README.md` (the `runvil-tool-picker` section is removed and the `runvil-model-client` paragraph no longer names it); `crates/runvil/model-client/README.md` if it names the resolver; `crates/workshop/server/README.md` if its one "picker" mention is the tool picker rather than the model picker; guide sources `guide/src/language/01-frontmatter-and-structure.md` (line 38), `02-the-run.md` (line 7), `07-tools.md` (lines 31, 97, 124), then the assembled `guide/runvil-language-guide.md` regenerated with the `build-user-guide` crate. The `guide/src/workshop/*` "picker" hits are the UI model picker and stay. - `vibe/dependency-surface.md`: remove the candle row from the ranked table and the picker note in measurement trap 4; remove the `base64 0.13` (via `spm_precompiled`) and `rand 0.8` (via candle) entries from the duplicate-versions list if they left; add a row to "What was replaced, and why" (removed: the picker crate and its embedding stack; replacement: none, exact slots only, with `cargo tree -i candle-core` output as evidence); rerun the shipped-shape counts and update the header commit and date per that file's "Reproducing the measurements" section. - - Archive: `../runvil-design/study-tool-picker/crate/` receives a verbatim copy of `crates/runvil/tool-picker/` (all 20 files: `Cargo.toml`, `build.rs`, `README.md`, `src/{assets,catalog,config,embed,error,lib,model,picker,picker-tests,policy,policy-tests,rank,selected}.rs`, `tests/it/{main,behavior,public_api}.rs`, `tests/fixtures/mixed-servers.json`); `../runvil-design/study-tool-picker/README.md` gains a paragraph naming the directory as the frozen crate source at the Runvil removal commit, non-compiling because `version.workspace`, `edition.workspace`, `[lints] workspace`, and `runvil-api-types.workspace` have no workspace to inherit from there. No manifest in the design repository is edited. - Data, persistence, failure, security, and privacy constraints: - No persisted data or wire format changes. The Workshop's prompt-contract JSON loses an enum case that was never produced by shipped prompts that parse. - `Cargo.lock` changes and is committed; `--locked` gates run against the updated lock. @@ -146,7 +139,6 @@ Verification is the workspace's existing gate list plus dependency-graph invaria - Decisions: - Remove the picker entirely rather than relocate it. Rationale: it is inert in every shipped build, its only live use is an advisory lint, and its cost (50 exclusive crates, embedded fp16 weights in every runtime-linking binary, a first-build network fetch, eleven CI cache steps) is paid for nothing. User's words: "I want to eliminate the tool picker completely." - - Archive the crate source in `../runvil-design/study-tool-picker/crate/` as a non-compiling artifact. Rationale: the design repository already holds the study (`study-tool-picker/`) and spike (`spike-tool-picker/`) the crate came from, so the frozen source sits beside its evidence; no workspace there means it cannot compile, which is the intent. User's words: "Put it in runvil-design as a non-compiling artifact." - Remove fuzzy tool slots, near-duplicate tool conflicts, and the Plugin description lint as features rather than stub them. Rationale: each exists only to consume picker output; a grammar that can never fill and a conflict record nothing can produce are traps for authors and Hosts. User's words: "I agree with your recommend removing all three (Fuzzy tool slots, near-dup tool conflicts, capability description lint)." - Remove the `models.bind` resolver machinery in `runvil-model-client` (`PickerModelResolver`, `ModelBindOpts`, `ModelResolver`, `ResolvedModel`, the id escape helpers, the `ModelBind*` error variants). Rationale: `models.bind` was already removed from the language (`crates/runvil-api-runtime/src/execute/tests/exec_flow.rs` near line 2392 asserts calling it fails), nothing constructs the resolver, and it is the model client's only edge to the picker. Falls under "remove all code that references it." - Keep `#[non_exhaustive]` on `ToolSlot`. Rationale: the deferred open Host-offered posture is documented on the enum as a future member. @@ -154,16 +146,13 @@ Verification is the workspace's existing gate list plus dependency-graph invaria - Keep the step count low and run a single full verification at the end. User's words: "keep the number of steps low and only do a full verify at the end". - Rejected alternatives: - Move the crate to `crates/runvil-tool-picker/` at the workspace root. Reason: the root is the documented public layer (`crates/README.md`, `AGENTS.md`), and a private substrate crate there would be the first exception; it also removes nothing. Revisit: never, superseded by removal. - - Move the crate to `../runvil-design/crates/` as a compiling path dependency. Reason: it depends on `runvil_api_types::tools::ToolId` and `shared_progress::ProgressHandle`, so the two repositories would depend on each other through path edges that `actions/checkout` breaks, the crate would leave the product-boundary matrix (`crates/build-xtask/src/product.rs` binds workspace members only), and the design repository has no CI. Revisit: never, superseded by removal. - - Cut only the `model-client` edge and leave the crate consumed by the runtime alone. Reason: still ships the weights and the stack for a feature that is off. Revisit: if fuzzy slot resolution is wanted again, restore from the archive as a new design. + - Cut only the `model-client` edge and leave the crate consumed by the runtime alone. Reason: still ships the weights and the stack for a feature that is off. Revisit: if fuzzy slot resolution is wanted again, restore from an archive outside this repository as a new design. - Shrink build cost through a hakari `[traversal-excludes]` entry instead of removal. Reason: keeps the crate and its build script; the floor question (Finding 2) is independent and stays deferred. - Assumptions, risks, and notes: - `cargo-hakari` must be installed locally to regenerate `crates/workspace-hack/Cargo.toml`; `.config/hakari.toml` governs it. - `crates/runvil-api-runtime/src/capabilities.rs` (line 66) imports `ToolId` through the picker's re-export (`crates/runvil/tool-picker/src/catalog.rs` line 18, `pub use runvil_api_types::tools::ToolId`); after removal that import comes from `runvil_api_types::tools::ToolId` directly. - `half` appears in `crates/workspace-hack/Cargo.toml` with features that may be requested by another transitive puller; the pin is removed from the root manifest only if `cargo tree -i half` shows no remaining normal or build edge from a workspace member. The same check governs each of the seven pins. - The `HF_TOKEN` repository secret lives in GitHub settings, outside the repository; retiring it is a manual follow-up after CI stops referencing it. - - The `../runvil-design` worktree has five unrelated uncommitted paths; the archive commit stages only `study-tool-picker/crate/**` and `study-tool-picker/README.md`. - - The archive lands in a different repository from the one the run operates on, so it is committed there directly by the session rather than through the per-step review cycle; the Runvil-side deletion is what the run reviews. - Post-removal closure counts are projections until measured: roughly 51 fewer packages in the `runvil-api-runtime`, `workshop`, `runvil-lua`, `runvil-parser`, and `runvil-model-client` closures, low single digits for `gateway`, and about 67 MB of embedded weights out of the Workshop binary. The `dependency-surface.md` refresh records the measured numbers. - The `guide/runvil-language-guide.md` assembled export is regenerated from `guide/src/` by the `build-user-guide` crate; edit sources, not the export. @@ -196,7 +185,7 @@ Verification is the workspace's existing gate list plus dependency-graph invaria ## Execution Instructions -The objective is one removal: the tool picker leaves Runvil, its source is frozen in the design repository, and the three features and the dependency stack that existed only for it leave with it. The archive already landed: `../runvil-design/study-tool-picker/crate/` holds a verbatim copy of the 20 crate files and `../runvil-design/study-tool-picker/README.md` names it, committed in that repository as `c973a42` (Runvil `HEAD` at copy time was `bf8cb465`). The Runvil work divides into three components, each one shippable slice, each one piece, each one step with one commit. The operator asked for few steps and one full verification at the end, so no component is divided further. +The objective is one removal: the tool picker leaves Runvil, and the three features and the dependency stack that existed only for it leave with it. The Runvil work divides into three components, each one shippable slice, each one piece, each one step with one commit. The operator asked for few steps and one full verification at the end, so no component is divided further. - Component order and reasons: - `rust-consumers` first. The five consuming crates stop naming the picker while the crate is still a workspace member, so the commit builds on its own and the crate becomes an orphan with no in-workspace edge. @@ -226,7 +215,7 @@ The objective is one removal: the tool picker leaves Runvil, its source is froze ### Step 2: Delete the crate and prune the workspace, nextest, CI, and crate READMEs [completed] - Component: `workspace` -- Crate: `git rm -r crates/runvil/tool-picker` (the 20 files already archived in `../runvil-design` at `c973a42`). This removes the only `build.rs` in the runtime and Workshop closure that reaches the network, and the `include_bytes!` of the fp16 `BAAI/bge-small-en-v1.5` weights. +- Crate: `git rm -r crates/runvil/tool-picker`. This removes the only `build.rs` in the runtime and Workshop closure that reaches the network, and the `include_bytes!` of the fp16 `BAAI/bge-small-en-v1.5` weights. - Root `Cargo.toml`: remove `"crates/runvil/tool-picker"` from `members`; remove `runvil-tool-picker` from `[workspace.dependencies]`; then, for each of `candle-core`, `candle-nn`, `candle-transformers`, `tokenizers`, `hf-hub`, `safetensors`, and `half`, run `cargo tree --workspace -e normal,build --target all -i ` and remove the pin (with the `tokenizers` unification comment) only when the command prints nothing. A pin that still has a puller stays and is named in the step's return. - Hakari: `cargo hakari generate`, then `cargo hakari manage-deps`, then `cargo hakari verify` clean; `crates/workspace-hack/Cargo.toml` and `Cargo.lock` are committed. - Nextest: `.config/nextest.toml` loses `package(runvil-tool-picker)` from both `heavy` group filters (lines 23 and 28); the `heavy` group itself stays for `gateway-stt-backend-whisper` and `gateway-stt`. @@ -246,7 +235,7 @@ The objective is one removal: the tool picker leaves Runvil, its source is froze - Guide: edit the sources `guide/src/language/01-frontmatter-and-structure.md` (line 38), `guide/src/language/02-the-run.md` (line 7), and `guide/src/language/07-tools.md` (lines 31, 97, 124) so `tools:` is documented as alias-to-exact-path strings only, then regenerate `guide/runvil-language-guide.md` with the `build-user-guide` crate (never edit the export by hand). The `guide/src/workshop/*` "picker" hits are the UI model picker and stay. - Other READMEs: `crates/workshop/server/README.md` only if its one "picker" mention is the tool picker rather than the model picker. - `vibe/dependency-surface.md`: remove the candle row from the ranked table and the picker note in measurement trap 4; remove the `base64 0.13` (via `spm_precompiled`) and `rand 0.8` (via candle) entries from the duplicate-versions list when `cargo tree -i` shows they left; add a row to "What was replaced, and why" (removed: `runvil-tool-picker` and its candle, tokenizers, hf-hub, safetensors stack; replacement: none, exact slots only; evidence: the empty `cargo tree --workspace -e normal,build --target all -i candle-core` output); rerun the shipped-shape closure counts for `runvil-api-runtime`, `workshop`, `runvil-lua`, `runvil-parser`, `runvil-model-client`, and `gateway` per the file's "Reproducing the measurements" section, replacing the projected figures (about 51 packages and about 67 MB of embedded weights) with measured ones; update the header commit hash and date. -- Tests: `npm run typecheck && npm test` in `crates/workshop/server/ui`; the reference sweep `rg -n "tool-picker|tool_picker|ToolPicker|FuzzySlot|NearDuplicate|hf-model-cache|HF_TOKEN" crates .github .config guide/src Cargo.toml AGENTS.md --glob '!crates/gateway/**' --glob '!guide/src/gateway/**'` returns nothing and `rg -n "tool-picker|tool_picker|ToolPicker|FuzzySlot|NearDuplicate|hf-model-cache" crates/gateway` returns nothing (history under `vibe/` exempt; the gateway's own `HF_TOKEN` reads stay); `../runvil-design/study-tool-picker/crate/` still holds 20 files and `../runvil-design/study-tool-picker/README.md` names it. +- Tests: `npm run typecheck && npm test` in `crates/workshop/server/ui`; the reference sweep `rg -n "tool-picker|tool_picker|ToolPicker|FuzzySlot|NearDuplicate|hf-model-cache|HF_TOKEN" crates .github .config guide/src Cargo.toml AGENTS.md --glob '!crates/gateway/**' --glob '!guide/src/gateway/**'` returns nothing and `rg -n "tool-picker|tool_picker|ToolPicker|FuzzySlot|NearDuplicate|hf-model-cache" crates/gateway` returns nothing (history under `vibe/` exempt; the gateway's own `HF_TOKEN` reads stay). - Verification (`FULL`, the only standalone Verify dispatch in this plan), all of which must pass: - `cargo fmt --all --check` - `cargo clippy --workspace --exclude workshop --exclude workshop-server --exclude workshop-server-api --all-targets --all-features -- -D warnings` diff --git a/vibe/2026-09/2026-09-28-2-capability-harness-redesign.md b/vibe/2026-09/2026-09-28-2-capability-harness-redesign.md index 30f89661..3effb37f 100644 --- a/vibe/2026-09/2026-09-28-2-capability-harness-redesign.md +++ b/vibe/2026-09/2026-09-28-2-capability-harness-redesign.md @@ -383,7 +383,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio - **Plugins contribute far more than tools.** Status: Owner decision on the framing; the survey's findings are Proposed. The owner named the design as a Plugin that injects Lua, hooks the step loop, and offers tools. - Owner, 2026-09-19: "so capabilities can obviously install tools, that's the least interesting case." - Owner, 2026-09-27: "did we talk about Runvil Engine Capability which injects Lua, hooks the step() loop, and offers tools?" - - The 2026-09-19 report "What a Runvil capability could contribute besides tools" (`runvil-design/research/survey-non-tool-capabilities.md`) surveyed everruns (a cloud agent product), zeroclaw (an agent runtime with plugins defined in WIT, the WebAssembly interface language, plus channels, approval, and a sandbox), zed (an editor), bashkit (an in-process bash interpreter over an in-memory filesystem), and eight public frameworks: MCP, Claude Code, the OpenAI Agents SDK, LangGraph, Pydantic AI, Google ADK, Letta, and the Claude Agent SDK. It found thirty Plugins that give a run something besides tools. + - The 2026-09-19 report "What a Runvil capability could contribute besides tools" surveyed everruns (a cloud agent product), zeroclaw (an agent runtime with plugins defined in WIT, the WebAssembly interface language, plus channels, approval, and a sandbox), zed (an editor), bashkit (an in-process bash interpreter over an in-memory filesystem), and eight public frameworks: MCP, Claude Code, the OpenAI Agents SDK, LangGraph, Pydantic AI, Google ADK, Letta, and the Claude Agent SDK. It found thirty Plugins that give a run something besides tools. - Between them they need six kinds of contribution: a mount (a filesystem backend placed at a path in the run's VFS); prompt text (a named slot in the system prompt or per-turn context, with a trust level and a flag for text that changes every turn); Lua surface (the report's "Lua functions", now settled as a prelude string); a hook (code at a fixed point in the run); a command (an action an operator runs without the model); and saved state (bytes the Harness stores for resume, plus a teardown call when the run ends). Each Plugin also declares what it needs: Host services, other Plugins, and settings. - The three rules every surveyed system follows are recorded under Constraints. Evidence, all in the survey report: everruns states generic handling in four doc comments (line 238); everruns, zed, and zeroclaw each arrived at named, trust-marked prompt slots independently (line 240); and the permission lesson comes from the same systems (line 242). - The report rejected four candidates as crossing rules Runvil has already written down: `budget` (limits are interior to the runtime), `compaction` (author-side Lua policy), `request-shaping` (the gateway owns dialects), and `model-router` (the Harness fills model roles). Each has a reduced form that fits, usually a hook or a per-turn fact. @@ -406,7 +406,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio - Refinement from the decomposition review, 2026-09-27, confidence high: a prelude that fails to load or collides fails the run with the existing `RunErrorKind::Lua` rather than a new public kind, because `Lua` already means a section's Lua phase failed to run, and a new variant would widen the facade's surface for one failure path. - **The log stores what was read, not a second copy of it.** Status: the concern is the owner's; the remedy (the projection under Technical Design) is Proposed, recommended with medium confidence because it reuses the log's existing projection pattern but the store's version stamp is still unresolved. This is a live problem in today's code, not a new one. - Owner, 2026-09-19: "Yeah but think about it. A script reading many thousands of files in a loop is also making copies of everything it reads, because this has to go in the event log." - - Precedents: zed's `ActionLog` records file read times (`file_read_times`), though the research notes do not establish that it never keeps contents, and it also tracks buffers (`runvil-design/research/survey-capabilities-zed.md`, line 176). Everruns has a built-in named `tool_output_persistence`, but the notes name it without describing it, so the claim that it moves large outputs to storage and keeps a reference in context is unverified (`runvil-design/research/survey-capabilities-everruns.md`). + - Precedents: zed's `ActionLog` records file read times (`file_read_times`), though the research notes do not establish that it never keeps contents, and it also tracks buffers. Everruns has a built-in named `tool_output_persistence`, but the notes name it without describing it, so the claim that it moves large outputs to storage and keeps a reference in context is unverified. - **The step hook.** Status: Proposed, and deferred as a build item; recommended with medium confidence, because its rules follow from determinism but the set of hook points is open. It started from the owner's question. - Owner, 2026-09-19: "How much functionality can be accomplished by just allowing a hook for each step in the runtime engine? the hook can edit events and talk to the virtual fs" @@ -421,7 +421,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio - Owner, 2026-09-27: "on the subject of generating the unguessable ids, should we use a cryptographic primitive like a hash function in counter mode or something, keyed from the Run environment's sseed?" - **The guard nonce is derived with a one-way hash, still one per run.** Status: Owner decision, 2026-09-27. SHA-256 replaces SplitMix64, so the nonce no longer gives back the seed, while the per-run design, the 32-hex format, and determinism stay as they are. This restores the documented intent that a Harness-drawn seed stays unguessable (`runvil/crates/runvil/src/lib.md`, lines 219-225). The assistant first suggested a fresh nonce per wrap, then corrected itself: the project had used per-wrap nonces and replaced them with one per run, because per-call freshness broke the byte-identical envelopes prompt caching needs (`runvil/vibe/2026-08/2026-08-22-1-runcontext-seed.md`, lines 173-208; `runvil/vibe/2026-08/2026-08-18-3-untrusted-global-vm-reorder.md`, line 81), and escaping `<` already stops forged closing tags (`runvil/vibe/2026-08/2026-08-30-1-chat-templates-injection-defense.md`, lines 291-299). - The owner chose: "Small fix in this plan: derive the per-run nonce with a one-way hash so it no longer reveals the seed, with no change to caching or determinism". - - **Tool calls record their origin, and Plugin tools bind under full ids.** Status: Owner decision on the origin's shape, 2026-09-27: the calling execution and section plus the caller, script or model, with a prelude's calls counting as the script's. The owner confirmed full-id binding as written on the same day. Hosts want per-caller policy, and the run log gains attribution. Zeroclaw's `TurnOrigin`, keyed by who initiated a turn, is the precedent (`runvil-design/research/survey-capabilities-zeroclaw.md`; the survey report describes the idea as origin stamping on scheduled turns, line 197). Binding under full ids lets preludes call their own tools; advertising still takes `tools.add`. + - **Tool calls record their origin, and Plugin tools bind under full ids.** Status: Owner decision on the origin's shape, 2026-09-27: the calling execution and section plus the caller, script or model, with a prelude's calls counting as the script's. The owner confirmed full-id binding as written on the same day. Hosts want per-caller policy, and the run log gains attribution. Zeroclaw's `TurnOrigin`, keyed by who initiated a turn, is the precedent (the survey report describes the idea as origin stamping on scheduled turns, line 197). Binding under full ids lets preludes call their own tools; advertising still takes `tools.add`. - Correction and refinements from the plan review, 2026-09-27. The earlier reasoning said the ask tool needs the calling section to route a question to the right operator. The code says otherwise: `SessionInputBroker::wait` ignores the execution and section it is given (`runvil/crates/harness-internal/sessions/src/input-tool.rs`, lines 108-112), and a question reaches the right operator because each session's runs get their own broker. So user input does not depend on the origin, and the origin item can be built in any order. Refinement: the origin stops at the effect and its record, and does not reach `Tool::call`, until the first Host policy needs it there (confidence high: nothing consumes it yet, and `Tool` is a documented stable extension point whose signatures should not change for nothing). Refinement: full-id binding is a fallback in the script `tools.call` path against the run's catalog, not a binding step at activation (confidence high: the behavior is identical, and it needs no second binding list in activation and no change to `install_captured_bindings`). - **`user_input()` becomes the `runvil/user-input` Plugin.** Status: Owner decision on the goal and on its place in a core set of Plugins the Harness always provides; the shape (the tool, the prelude, and the answer under Technical Design) was confirmed by the owner on 2026-09-27 and settled further in the plan review the same day. The sub-bullets below record the parts he decided explicitly: the trusted answer, the plain-text answer, no arguments yet, mandatory declaration, removal of `user_input()`, and the model's opt-in. - Owner, 2026-09-27: "how can we get rid of user_input() as an explicit facility and replace it with a capability?" @@ -453,7 +453,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio - Owner, 2026-09-27: "we're going to have a user interface where the user can create an agent by selecting a prompt file, and then the user can dynamically choose which capabilities they want. from like a menu. Right? Like, we'll look at all the loaded DLLs and we'll read it and we'll make a, we'll make a table, and the user can just check off the boxes of the capabilities that, that they want. But that means, that means that a capability which needs a special constructor has to be known to the host. Do you understand the problem? Like, we wanted the capabilities to be installable just by name, binding them at runtime." - Owner, 2026-09-27: "What if the capability is something having to do with the virtual file system and you, and there's a configuration associated with it?" The worked answer is the `acme/project-files` walk-through under Functional Specification. - A DLL that wants a service the Harness does not define cannot get one through a closure, and should not. Zeroclaw argues for exactly this: "Adding a service is an explicit API change, and a store cannot be constructed while a required service is missing." (survey report, line 232). Zeroclaw's rule that the manifest states intent and the Host intersects it with its own policy governs config paths (line 230). - - Precedents for configuration: everruns attaches capabilities as `{ "ref": id, "config": {...} }` with `config_schema`, `config_ui_schema`, and `validate_config` methods, and warns to pass only a non-secret handle, since capability config is not a secret store (`runvil-design/research/survey-capabilities-everruns.md`; survey report, line 165). Zeroclaw's plugin manifest has a `config_schema`, and its WIT `config` import gives a plugin the schema-validated, non-secret portion of its configuration (`runvil-design/research/survey-capabilities-zeroclaw.md`). Zed's context-server configuration JSON drives a setup modal (`runvil-design/research/survey-capabilities-zed.md`, lines 344-346). + - Precedents for configuration: everruns attaches capabilities as `{ "ref": id, "config": {...} }` with `config_schema`, `config_ui_schema`, and `validate_config` methods, and warns to pass only a non-secret handle, since capability config is not a secret store (survey report, line 165). Zeroclaw's plugin manifest has a `config_schema`, and its WIT `config` import gives a plugin the schema-validated, non-secret portion of its configuration. Zed's context-server configuration JSON drives a setup modal. - **The Workshop Plugin menu.** Status: Owner decision on the feature; the details (the seven steps under Functional Specification) are Proposed, recommended with medium confidence because each step follows from a settled rule but the owner has not reviewed them. - **Prompts can open a slot for tools known only at runtime.** Status: Owner decision. Today a prompt can use only tools it names in advance, which blocks MCP. A prompt needs a way to say, in a section, "put all the extra tools the user added here" or "put the few extra tools most relevant to this task here". A prompt without an open slot stays closed, and users cannot add Plugins to it; a prompt with one can be extended from the menu; a Plugin the prompt requires is still required, and the open slot covers only additions the prompt did not require. Syntax and semantics are open. - Owner, 2026-09-27: "in order for a user to insert novel capabilities into a prompt, the prompt has to declare that it's, it's okay to do that ... right now, the, a prompt can only add named tools, so we, we still need to add a feature that allows the prompt to inject added tools that are only known at runtime, right? In other words, we need a prompt section to be able to say, take all the tools and make them available here. Or take a subset with using a semantic search, but it can't be known ahead of time, right? So that's how the user says, okay, now I'm gonna, now I'm gonna turbocharge this prompt with MCP. But if the prompt required MCP, then, then you can run it without it, right?" @@ -489,7 +489,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio local payload = webhook.wait(hook) -- a tool call; this chain waits, others keep running ``` - - One process-wide listener, created when the DLL initializes, routes requests by an unguessable per-wait token: 128 bits from the DLL's own secure random generator, never derived from the run seed. Zeroclaw uses this pattern: its runtime runs the listener and deposits each received message into a per-plugin queue (`runvil-design/research/survey-capabilities-zeroclaw.md`). Per-run listeners would exhaust ports and need firewall changes per run. The port comes from Host configuration, never frontmatter. + - One process-wide listener, created when the DLL initializes, routes requests by an unguessable per-wait token: 128 bits from the DLL's own secure random generator, never derived from the run seed. Zeroclaw uses this pattern: its runtime runs the listener and deposits each received message into a per-plugin queue. Per-run listeners would exhaust ports and need firewall changes per run. The port comes from Host configuration, never frontmatter. - A webhook payload is untrusted and goes through the guard wrap when it reaches a model. The token authenticates the caller; it is no reason to trust the contents. Optionally require an HMAC signature over the body, keyed by a secret from the secrets service, as GitHub and Stripe do. - `expect` carries a timeout. When it expires, the DLL drops the route and the wait fails. On run cancel the wait's effect is answered `Dropped`, and the DLL drops the route when it sees the abandoned completion. - Several callbacks on one token are a loop of `wait` calls, each a fresh effect, with the DLL queueing arrivals between waits. An effect gets exactly one answer. @@ -540,7 +540,6 @@ Each work item lands with tests at the layer it changes; the user-input migratio - The Plugin DLL plan targets crates that no longer exist under those names: `runvil-core` and `runvil-mcp-server` (Plugin DLL plan, lines 38, 78, and 80) are absent from `runvil/crates`. Its locked choices stand; the one-verb manifest widens its surface from tools to the full manifest without adding functions. - The survey report remains valid for the thirty Plugins, the six contribution kinds, the three shared rules, the four rejections, and its constraints appendix (Appendix B, lines 299-303). Stale in it: the "Lua functions" row of Table 2 (lines 219-228) and recommendation 2 (line 264), both replaced by the prelude; its build order; its "not yet built" caveats about the Harness; and its file paths. - The Plugins and global naming plan remains valid for the interior versus exterior rule, `ServiceGap`, the discovery Plugin, `offering`, the open posture, and the mount overlay sequence. Its Lua surface design and its in-process-only rule are superseded. - - The five 2026-09-19 survey research notes sit beside the survey report in `runvil-design/research/`: `survey-capabilities-everruns.md`, `survey-capabilities-zeroclaw.md`, `survey-capabilities-zed.md`, `survey-capabilities-runvil-bashkit.md`, and `survey-capabilities-field-web.md`. The owner had all five promoted there on 2026-09-27 so they would not be purged; the plan cites the first three, and the other two are the rest of the evidence behind the same report. - The architecture document, `runvil/vibe/archdoc.md`, holds invariants A1 to A9; this plan quotes A6, A8, and A9. - Risk: an in-process DLL that hooks `pre_chat` or calls `secrets.get` sees every message or credential. This is acceptable only while Plugins are first-party. - Facts from the plan review that bear on held items, for whoever resumes them: @@ -551,7 +550,7 @@ Each work item lands with tests at the layer it changes; the user-input migratio - Answer records: the inlining threshold is still open, and `RunLimits::max_response_bytes` is not a candidate. It caps a model response body (16 MiB by default; `config-limits.rs`, lines 49 and 72), so as a threshold it would leave almost every file read inline. - A gap the review found and left alone: a frontmatter tool or model alias that equals a built-in global, such as `store` or `tools`, silently replaces it, because `install_captured_bindings` raw-sets aliases as globals. Prelude globals are protected from this by the collision check; aliases are not, and closing it would be a separate language change. - Old run logs. Rows written before Engine removal hold `user_input` events and `UserInput` effect and answer records, and `runs.db` persists across restarts (`runvil/crates/harness-internal/sessions/src/runtime.rs`, lines 31 and 196). Nothing reads them back: sessions live in one process, transcripts are read only for a live session's runs, and effect and answer payloads are stored as JSON and never deserialized. So no migration is needed, but a future viewer of past runs must tolerate event kinds it does not know. - - Out of scope: the sibling checkouts `runvil2/` and `runvil3/` in the workspace, and the dated design and research documents in `runvil-design/`, also mention `user_input()`. They are not part of the `runvil` repository and are left as they are. + - Out of scope: the sibling checkouts `runvil2/` and `runvil3/` in the workspace also mention `user_input()`. They are not part of the `runvil` repository and are left as they are. - Resuming the held items. The ready items are built by the vibe coder, whose sub-agents edit only code and whose main session marks only step headings, so these notes do not change during that run. After it closes, whoever resumes a held item marks the nine ready todos completed, adds here any fact from the run's commits or ledger that bears on a held item, and leaves the held items, their open questions, and the Proposed decisions they rest on unchanged. To resume, re-check the code citations the held items rely on, because the ready work moves that code: `plugin.rs` will likely be split, `RunServices`, `Contribution`, and `Effect::ToolCall` gain fields, and the Engine's user-input pieces are gone. Then settle each held item's open questions and Proposed decisions in this plan, one item at a time, and move it to the ready list. ### Deferred and Out of Scope diff --git a/vibe/2026-10-31-2-built-in-model-roles.md b/vibe/2026-10-31-2-built-in-model-roles.md index cf0be0c8..054e3506 100644 --- a/vibe/2026-10-31-2-built-in-model-roles.md +++ b/vibe/2026-10-31-2-built-in-model-roles.md @@ -15,16 +15,16 @@ todos: content: "Engine: prepare(prompt, BTreeMap) checks declared requirements against the filling model, refuses a non-empty map without default (RequirementCheck::Unbound), and builds the ModelSet on RunContext; delete ModelBindings, bindings.rs, model_bindings(), bind_role_for_test, Scenario::bind_roles; RequirementCheck {ContextMinimum, Thinking, Unbound}; UnmetRequirement.role: ModelRole; RunState holds Arc" status: completed - id: callers-and-fixtures - content: "One pass per file: prepare callers (harness prepare_from_snapshot, scenarios, example, bench, tests) and every prompt and fixture with custom labels, keywords or models.default (README, prompts, workshop chat.md, roughly 30 fixture files); regenerate public-api.txt; first design doc update" + content: "One pass per file: prepare callers (harness prepare_from_snapshot, scenarios, example, bench, tests) and every prompt and fixture with custom labels, keywords or models.default (README, prompts, workshop chat.md, roughly 30 fixture files); regenerate public-api.txt" status: completed - id: gate-commit-1 content: "Commit 1 gate: cargo test and clippy for types, parser, model-client, lua, engine, harness, facade, workshop server; UI build; stale-name and wording sweeps; check that model-call events record the model id actually used" status: completed - id: chain-selection - content: "Commit 2: Chain owns the selection Arc; ChainStart carries the starting value (default binding for root chains, parent's value for call and spawn, taken at dispatch); end_h1 hands H1's value to the root walk; section setup passes the chain's Arc into injection; tests; design doc update" + content: "Commit 2: Chain owns the selection Arc; ChainStart carries the starting value (default binding for root chains, parent's value for call and spawn, taken at dispatch); end_h1 hands H1's value to the root walk; section setup passes the chain's Arc into injection; tests" status: completed - id: fanout-shim - content: "Commit 3: 3-arg tasks.fanout(model, worker, collection) entirely in __impl_fanout.lua using privileged nil-safe selection get/set captured at install: switch, spawn every arm, restore before the first join and on the spawn-failure path; tests; design doc update" + content: "Commit 3: 3-arg tasks.fanout(model, worker, collection) entirely in __impl_fanout.lua using privileged nil-safe selection get/set captured at install: switch, spawn every arm, restore before the first join and on the spawn-failure path; tests" status: completed - id: final-gate content: "Gates for commits 2 and 3: tests, clippy, public-api check, stale-name and wording sweeps" @@ -60,7 +60,7 @@ Prompt authors declare model roles in `models:` front matter and pick one with ` - Every deleted name listed in the sweep (Testing Plan) is absent from living code and docs. - Every gate in Execution Instructions passes. - Constraints: - - Code, doc comments, error messages, test names, README text and the design document describe present behavior only. None says "replaces", "formerly", "previously", "no longer", "legacy", "removed" or "migrated", and no test asserts that a deleted name is gone. + - Code, doc comments, error messages, test names and README text describe present behavior only. None says "replaces", "formerly", "previously", "no longer", "legacy", "removed" or "migrated", and no test asserts that a deleted name is gone. - Prompts, fixtures and docs are rewritten in place, with no "was X, now Y" annotations. - Dated logs under `vibe/` and the generated `.vibelight/` directory are not edited. - Each step commit leaves the workspace building with its tests passing. @@ -194,7 +194,7 @@ The Host's role map enters `prepare`, which resolves the five roles, checks requ - Deleted from the Lua and front matter surface: `models.default`, the handle's `capabilities` field, front matter `keywords:` and per-role `description:`. - Deleted across modules: `ModelView`, `ModelSetError`, the default alias and its accessors on `ModelSet`, the run-wide model-set mutex, `ModelSelection` and `resolve_model_binding`. - Regenerate `crates/runvil/public-api.txt`. - - Rewrite in place: `README.md`; `prompts/hello.md`, `prompts/greet.md`, `prompts/research-person.md`, `prompts/analyst-example.md`; `crates/workshop/agents/agents/chat.md`; about 30 fixtures that embed `models:` front matter under `crates/runvil-internal/engine`, `crates/harness-internal/runner/tests/it`, `crates/harness/tests/suite`, `crates/runvil/tests/suite`, `crates/harness-gateway-client/src/wire/request-tests.rs` and `crates/workshop/server`; and the models section of `runvil-design/design/architect-runvil-prompting-language.md` in the sibling design repository. + - Rewrite in place: `README.md`; `prompts/hello.md`, `prompts/greet.md`, `prompts/research-person.md`, `prompts/analyst-example.md`; `crates/workshop/agents/agents/chat.md`; and about 30 fixtures that embed `models:` front matter under `crates/runvil-internal/engine`, `crates/harness-internal/runner/tests/it`, `crates/harness/tests/suite`, `crates/runvil/tests/suite`, `crates/harness-gateway-client/src/wire/request-tests.rs` and `crates/workshop/server`. - Data, persistence, failure, security, and privacy constraints: - The only externally visible data change is the Workshop prompt-contract JSON above. No other persisted format changes. - `prepare` refuses a run before any effect is issued: unmet requirements and a missing `default` are carried in `Requirements`, and the harness only merges and refuses (`crates/harness-internal/runner/src/prepare.rs`). No non-test code outside `requirements.rs` and the constructing code in `fill.rs` matches on `RequirementCheck` or reads `UnmetRequirement.role` or `.check`, so those types can change freely. @@ -242,7 +242,7 @@ Tests cover the parse rules, `prepare` resolution, the Lua surface, chain inheri - a non-handle first argument is an error. - A prompt with no `models:` runs end to end through the harness against a one-model Host, using the rewritten fixtures. - Regression, security, and performance: - - Deleted-name sweep: search `crates`, `README.md` and `prompts` in the runvil repository, and `design` in the sibling design repository, for `models.default`, `models.bind`, `default_alias`, `set_default_alias`, `ModelView`, `ModelSetError`, `ModelBindings`, `model_bindings`, `ModelRoles`, `ModelRolesIter`, `ModelKeyword`, `keyword_name`, `keyword_wire`, `with_capabilities`, `HardKeyword`, `resolve_model_binding`, `trivial fill` and `bound model role`. Expect no hits. Skip `vibe/` and `.vibelight/`. + - Deleted-name sweep: search `crates`, `README.md` and `prompts` in the runvil repository for `models.default`, `models.bind`, `default_alias`, `set_default_alias`, `ModelView`, `ModelSetError`, `ModelBindings`, `model_bindings`, `ModelRoles`, `ModelRolesIter`, `ModelKeyword`, `keyword_name`, `keyword_wire`, `with_capabilities`, `HardKeyword`, `resolve_model_binding`, `trivial fill` and `bound model role`. Expect no hits. Skip `vibe/` and `.vibelight/`. - Wording sweep: search the added lines of the diff for `no longer`, `formerly`, `previously`, `legacy`, `deprecat`, `backward`, `replaces` and `migrat`. Expect no hits. - Public API check: `crates/runvil/public-api.txt` is regenerated and matches the surface listed in Technical Design. - Security: the child-isolation tests above. @@ -272,7 +272,7 @@ Tests cover the parse rules, `prepare` resolution, the Lua surface, chain inheri - No backward compatibility, and no trail to old behavior in code, docs, errors or tests. User: "I want no backward compatibility. Dont leave behind notes referring to the old behavior, etc.. just change it." - Reduce the API surface while keeping the results. User: "see if you can reduce the API surface and get the same results". Applied as: an immutable `ModelSet`, `prepare` building the model set directly so `ModelBindings` goes, and the selection storing a whole `ModelBinding`. - `Frontmatter::role_requirements(role)` returns `Option<&RoleRequirements>`: `None` when the prompt does not declare the role, and `Some` with neither field set when it declares `role: {}`. The Workshop prompt contract lists exactly the declared roles, which needs that distinction. The plan named the accessor without its return type. - - The work is built as three components in eight steps. Each step is one commit that leaves the workspace building with its tests passing, and the component that ends at a step carries that step's gate of full tests, lints, the public API check and both sweeps. The eight steps are: (1) the `ModelRole` type; (2) the Host role map in `prepare`; (3) the immutable model set with the `default` role as baseline; (4) `models.use` with a handle, `models.current` and the handle fields; (5) requirements-only front matter with the Workshop contract and UI, which ends the first component and its gate; (6) the chain-owned current model with inheritance at dispatch, which ends the second component and its gate; (7) the model-first `tasks.fanout`, which ends the third component and its gate; (8) one design-document step in `runvil-design`, written after all the code, that describes the final surface of all three components. The rationale is fewer review cycles, and a document that describes the finished surface once instead of three partial states. The owner said "12 steps seems like a lot" about a split that gave each component its own design-document commit, and chose this eight-step shape. The three components are independently shippable, and only the second carries real risk. + - The work is built as three components in seven steps. Each step is one commit that leaves the workspace building with its tests passing, and the component that ends at a step carries that step's gate of full tests, lints, the public API check and both sweeps. The seven steps are: (1) the `ModelRole` type; (2) the Host role map in `prepare`; (3) the immutable model set with the `default` role as baseline; (4) `models.use` with a handle, `models.current` and the handle fields; (5) requirements-only front matter with the Workshop contract and UI, which ends the first component and its gate; (6) the chain-owned current model with inheritance at dispatch, which ends the second component and its gate; (7) the model-first `tasks.fanout`, which ends the third component and its gate. The rationale is fewer review cycles. The owner said "12 steps seems like a lot" and chose this shape. The three components are independently shippable, and only the second carries real risk. - Rejected alternatives: - Custom prompt-declared roles alongside the five. The user rejected them. Revisit only if the five tiers prove insufficient, which would be a change to the prompt language. - A `thinking` role. The user rejected it because thinking is a model property. @@ -285,7 +285,7 @@ Tests cover the parse rules, `prepare` resolution, the Lua surface, chain inheri - Keeping the soft keywords, `description` and the handle's `capabilities`. Rejected as dead surface. Revisit if a Host needs role metadata. - A `models.default` stub or a migration error. Rejected by the no-compatibility decision. - Assumptions, risks, and notes: - - Paths in this plan are relative to the root of the `runvil` repository, except paths starting with `runvil-design/`, which are in the sibling design repository. + - Paths in this plan are relative to the root of the `runvil` repository. - "No prompt that lacks a `models:` section should fail" is read as a statement about front matter. With an empty Host map a prompt fails only when it calls a model, which follows from "the map can be empty". - Model-call events carry a `model` field set from the completion, not from the request (`crates/runvil-internal/engine/src/execute/turn.rs`, `crates/runvil-internal/types/src/event.rs`), so attribution by model is available. Whether `Completion::model()` falls back to the requested model when a backend omits the name was not established, and events then carry a `ModelMetadataDegraded` signal. A test pins the attribution rather than assuming it. - The search for `RequirementCheck` consumers skipped gitignored paths and the Workshop UI `dist` bundles, and a read of `role` or `check` through JSON would not have matched the type names. It found no non-test consumer. @@ -537,7 +537,7 @@ Finish the author-facing Lua surface for model roles: `models.current()`, `model Make `models:` front matter optional and limited to requirements on the five roles. Give the Engine, the Workshop server and the Workshop UI the new reader. This is the last step of the first component, so its tests include the component's whole exit gate for the `runvil` repository. -- Placement: this piece, "Requirements-only front matter", comes after the Host map piece because the requirement checks now read the parser's new accessor and the fixtures already use role names. The parser, the engine reader, the Workshop server and the Workshop UI are one step. Removing the parser's old types stops the engine and the server from compiling until they read the new accessor, and once the server sends the new JSON the UI's reader returns `null` for every model row, so a commit that left the UI behind would leave the run panel without its model rows. The design document is step 8, written after all the code, so it describes the final surface. +- Placement: this piece, "Requirements-only front matter", comes after the Host map piece because the requirement checks now read the parser's new accessor and the fixtures already use role names. The parser, the engine reader, the Workshop server and the Workshop UI are one step. Removing the parser's old types stops the engine and the server from compiling until they read the new accessor, and once the server sends the new JSON the UI's reader returns `null` for every model row, so a commit that left the UI behind would leave the run panel without its model rows. - Build state: the workspace and the UI build and pass after this step, and the whole gate above passes. The facade listing changes, so regenerate `crates/runvil/public-api.txt` with `cargo +nightly-2026-09-05 xtask api --bless`. If a gate command fails because of an earlier step's leftover (a deleted name still present, a doc link, a listing difference), fix it here. - Behavior: - Front matter `models:` maps role names to `{ min_context, thinking }`. `min_context` is a positive token count and `thinking` is a boolean. Both are optional, and `fast: {}` is valid and adds nothing. A prompt with no `models:` key is valid. @@ -656,30 +656,4 @@ Add the model-first form `tasks.fanout(model, worker, collection)`, implemented - - -### Step 8: Design document for roles, the chain's current model and fanout [completed] - -- Component: Model-first fanout -- Tests: - - Run from the `runvil-design` repository, the sibling of `runvil`: `rg -n "models\.default|models\.bind|default_alias|ModelView|ModelSetError|ModelBindings|model_bindings|ModelRoles|ModelRolesIter|ModelKeyword|keyword_name|keyword_wire|with_capabilities|HardKeyword|resolve_model_binding|trivial fill|bound model role" design` (a pass prints nothing and exits with code 1) - - Run from the `runvil-design` repository: `git add -N .; git diff -U0 HEAD | rg -n -i "^\+.*(no longer|formerly|previously|legacy|deprecat|backward|replaces|migrat)"` (a pass prints nothing and exits with code 1) - -Rewrite the models part and the task descriptions of `design/architect-runvil-prompting-language.md` in the `runvil-design` repository to describe the behavior steps 1 to 7 ship. This step's commit goes in `runvil-design`, not in `runvil`. - -- Placement: the last step of the plan. It is written once, after all the code, so the document describes the finished surface of the three components and not three partial states. It is its own step because it is a commit in a different repository. It is filed under the third component, which finished its code at step 7, so the plan keeps three components. -- Build state: documentation only. Nothing in `runvil` changes. -- Behavior to document (present tense, no history): - - Every prompt has exactly five roles: `default`, `strong`, `small`, `fast`, `creative`. There are no custom roles. Front matter `models:` is optional and holds only requirements per role, `min_context` (a positive token count) and `thinking` (`true` requires a model that can think and turns thinking on for that role's requests, `false` requires one that can run without thinking and turns it off). An unknown role name or field is a parse error. - - The Host passes a role-to-model map to `prepare`. A role with no entry uses the `default` entry. An empty map means the Host has no model, and a prompt fails only when it calls a model. A non-empty map without `default` is refused before the run starts. Requirements are checked against the model that fills the role, fallbacks included. - - The Lua surface: a chain starts on the `default` role. `models.use(role_or_handle, options?)` switches the chain's current model and returns the handle, and the switch lasts across that chain's sections until the next switch. `models.current()` returns the current handle, `models.get(role)` inspects without switching, and `models.infer` and `models.loop` run on the current model or an explicit handle. A handle exposes `label`, `model_id`, `description`, `context`, `thinking` and `provider`, plus `infer` and `loop`. Error texts: `models.use label "reviewer" is not a model role: expected default, strong, small, fast or creative`, and `the caller supplied no model`. - - `call` children, `tasks.spawn` tasks and fanout arms start with a copy of the parent's current model, taken when the call or spawn is dispatched. The root walk starts with the model the H1 pass ended on. A child's switch never reaches its parent or its siblings. - - The save-and-restore pattern is `local prev = models.current(); models.use('creative'); ...; models.use(prev)`. A `models.use('strong')` for one expensive step leaves every later section of that chain on `strong`, which is a cost to plan for, and the save-and-restore pattern undoes it. - - `tasks.fanout(worker, items)` runs every arm on the chain's current model. `tasks.fanout(model, worker, items)` takes a model handle first and runs every arm on it, without switching the parent: the parent's model after the call is what it was before, including when a spawn fails part-way. Example: `tasks.fanout(models.get('fast'), worker, items)`. Inside an arm, `models.use('strong')` affects only that arm and its children, and `models.use('default')` selects the `default` role. Error texts: `tasks.fanout: the first argument must be a model handle, got nil` and `tasks.fanout takes (worker, collection) or (model, worker, collection)`. The save-and-restore example with a 2-argument fanout stays valid: `local prev = models.current(); models.use('creative'); local drafts = tasks.fanout(worker, items); models.use(prev)`. - - Wherever the document says a switch lasts for the rest of the section, it says the chain instead. -- Artifacts: in `design/architect-runvil-prompting-language.md`, rewrite the `## Models` section, every other mention of `models.bind` and `models.default`, and the `tasks.fanout` and `tasks.spawn` descriptions and examples. Find the places with `rg -n "models\.bind|models\.default|keywords|models\.use|models\.current|selection|tasks\.fanout|tasks\.spawn" design`. The `models.bind` and `models.default` hits are in the deferred-work list near the top, the sample prompt that calls `models.default("writer")`, the `models.bind` and `models.default` headings and effects, the paragraph about the section's model selection and explicit handles, and the later examples. Rewrite each example in place to run on the `default` role or to call `models.use` with a role. Follow the document's existing heading and example style. -- Rules: nothing you write says "replaces", "formerly", "previously", "no longer", "legacy", "removed" or "migrated", or notes what a name used to be. Do not edit dated logs. - - - diff --git a/vibe/2026-10/2026-10-03-3-agent-context-cleanup.md b/vibe/2026-10/2026-10-03-3-agent-context-cleanup.md index 343d137d..50bc6384 100644 --- a/vibe/2026-10/2026-10-03-3-agent-context-cleanup.md +++ b/vibe/2026-10/2026-10-03-3-agent-context-cleanup.md @@ -3,7 +3,7 @@ name: Agent context cleanup overview: Hide stale docs from the agent, one audited item at a time. todos: - id: "1" - content: Remove all rustdoc markdown includes (runvil, harness, engine) and archive them, plus tools/cicerone, in runvil-design/saved-docs/ + content: Remove all rustdoc markdown includes (runvil, harness, engine) and archive them, plus tools/cicerone status: completed - id: "2" content: Move or delete every remaining doctest, remove the doctest steps, and add a tidy check that rejects new doctests @@ -76,7 +76,7 @@ Runvil is at version 0 and changes fast: one vibe-coding session can land a hund - Every crate inherits one strict workspace lint table, the enforcement this plan names exists, and the `AGENTS.md` text it replaces is gone. - No Rust file in any crate exceeds 500 lines, a violation fails the build with split guidance, and no `pub(crate)` or `pub(super)` item is wider than its uses need. - Constraints: - - Changes land in the `runvil` repository (`c:\Users\Vinnie\cursor\runvil`), with two named exceptions. Archived rustdoc pages go to the `runvil-design` repository (`c:\Users\Vinnie\cursor\runvil-design`) under `saved-docs//`, and `tools/cicerone` goes under `saved-docs/cicerone/`. Guide chapters go to the `runvil-docs` repository (`c:\Users\Vinnie\cursor\runvil-docs`). Touch nothing else in the surrounding workspace folder `c:\Users\Vinnie\cursor`. + - Changes land in the `runvil` repository (`c:\Users\Vinnie\cursor\runvil`), with two named exceptions. Archived rustdoc pages and `tools/cicerone` go to an archive outside this repository. Guide chapters go to the `runvil-docs` repository (`c:\Users\Vinnie\cursor\runvil-docs`). Touch nothing else in the surrounding workspace folder `c:\Users\Vinnie\cursor`. - Retired files are removed with git, and the history keeps them. In the user's words: "override the workspace rule. we have git." - Installers must not break: the Tauri desktop build of `crates/workshop/desktop`, and the cargo-dist release of `crates/gateway/app` configured in `dist-workspace.toml`. - The development machine runs Windows with PowerShell. The toolchain is the unpinned `stable` channel (`rust-toolchain.toml`), currently Cargo 1.99. @@ -119,8 +119,8 @@ Enforcement moves out of prose and into the compiler, clippy, cargo-deny, and th - Rules every step follows: - Find each edit by its quoted text. Line numbers and counts in this plan are as of 2026-10-03, and they drift. - Remove retired files with `git rm`, because the history keeps them. - - Commit edits to `runvil-design` (`c:\Users\Vinnie\cursor\runvil-design`) and `runvil-docs` (`c:\Users\Vinnie\cursor\runvil-docs`) in those repositories first, as separate commits, and push each one right away. The run does every push itself, and it never asks the operator to push. - - Sub-agents never stage or commit in any repository. They delete retired files from the worktree outright, never moving them to `cabinet/_trash/`, because the user overrode that workspace rule for this plan ("we have git"). The step's runvil commit records each removal, which is what `git rm` means in this plan. They write sibling-repository copies unstaged. The session running the step commits and pushes `runvil-design` or `runvil-docs` after the coding sub-agent returns and before the step's runvil commit, and again after any later round that changes them. + - Commit edits to `runvil-docs` (`c:\Users\Vinnie\cursor\runvil-docs`) in that repository first, as separate commits, and push each one right away. The run does every push itself, and it never asks the operator to push. + - Sub-agents never stage or commit in any repository. They delete retired files from the worktree outright, never moving them to `cabinet/_trash/`, because the user overrode that workspace rule for this plan ("we have git"). The step's runvil commit records each removal, which is what `git rm` means in this plan. They write sibling-repository copies unstaged. The session running the step commits and pushes `runvil-docs` after the coding sub-agent returns and before the step's runvil commit, and again after any later round that changes it. - The last step pushes runvil after full verification passes. It then starts the site workflow with `gh workflow run site.yml`, and watches that run and the CI run for the pushed commit with `gh run watch` until both succeed. A failure in either is fixed in that same step. - A step that spans many crates divides the work among parallel sub-agents, one crate group each, with disjoint files. Every sub-agent leaves its changes unstaged, and the step's coding agent merges them, runs the step's checks, and returns as usual. - Parallel sub-agents share one worktree and one Cargo target directory. Each compiles only its own packages, and when a build fails only in files another sub-agent owns, it waits and retries instead of editing them. A pass that breaks a crate on purpose while it compiles, such as Step 9's narrow-then-restore loop, walks crates in dependency order in one sub-agent or scripted walker, or runs each sub-agent in its own git worktree whose diff the step's coding agent applies to the main worktree. @@ -203,7 +203,7 @@ Enforcement moves out of prose and into the compiler, clippy, cargo-deny, and th - `rustls::crypto::CryptoProvider::install_default`. - Each reason reads "use X instead, because Y". Add `replacement` only where the call shape matches, and drop any entry whose crate isn't in `Cargo.lock`. - `deny.toml` gains a `[[bans.features]]` entry: `crate = "serde_json"`, `deny = ["preserve_order"]`. - - `tools/cicerone.md` and `tools/cicerone/` (two plans and ten Python scripts) move to `runvil-design/saved-docs/cicerone/`. Nothing outside `vibe/` references them. + - `tools/cicerone.md` and `tools/cicerone/` (two plans and ten Python scripts) move to an archive outside this repository. Nothing outside `vibe/` references them. - `.cargo/config.toml` gains `[env] CLIPPY_DISABLE_DOCS_LINKS = "1"`. - Warnings as errors: - Gate commands (CI and `.githooks/pre-push`) set `CARGO_BUILD_WARNINGS=deny` instead of passing `-- -D warnings`. @@ -263,7 +263,7 @@ The user settled each decision below in conversation, and their words are quoted - Decisions: - Only doc comments document code inside runvil: "The ONLY docs in the repo will be doc comments". Rustdoc stays in runvil because "runvil repo is the source of truth for the Rustdocs". - - Every markdown file pulled into rustdoc is removed and archived: "I want all lib.md and related markdown includes removed from runvil and archived in the runvil-design repo under a directory in saved-docs". + - Every markdown file pulled into rustdoc is removed and archived. - Doctests go, because removing them speeds up the gate. Each one is moved or deleted at the implementer's discretion: "for each doctest either move it or delete it (your call)". - READMEs become generic: "rewritten to be so generic they can never go out of date. Just describe the crate's responsibility in broad terms. Sand off anything that could go stale." The root README keeps its images and badges: "keep the badges. lose anything related to crates.io - we don't publish there." - The landing page becomes "a simple table. No images", and the Workshop guide keeps a row. It is generated from the rustdoc and book lists because the hand-written page already missed `harness-gateway-client` as a top-level crate. @@ -284,9 +284,9 @@ The user settled each decision below in conversation, and their words are quoted - So these six crates' `build.rs` files pull in `crates/build-ceiling/src/lib.rs` with `#[path]` and call `build_ceiling::check()`, the way `build-ceiling`'s own `build.rs` does. Both existing rules stay unchanged, and the ceiling-wiring check accepts either form. - Rejected: exempting `build-ceiling` from both rules. It weakens a product boundary, and a rule its owner marked never to weaken, for the sake of tooling. - The user confirmed this choice when asked during review. - - `tools/cicerone` is archived to `runvil-design/saved-docs/cicerone/`. It generated the rustdoc tutorial pages this plan deletes, and its instructions still target `lib.md` and `guide/src/`, so an agent could regenerate them. The user chose archiving during review. + - `tools/cicerone` is archived. It generated the rustdoc tutorial pages this plan deletes, and its instructions still target `lib.md` and `guide/src/`, so an agent could regenerate them. The user chose archiving during review. - A tidy check rejects new doctests, because once the doctest steps are gone, a doctest an agent writes later would never run. The user chose adding it during review. - - The run does everything, pushes included: "YOU DO EVERYTHING". It pushes the two sibling repositories as it commits to them, and it pushes runvil and checks CI and the site workflow at the end. + - The run does everything, pushes included: "YOU DO EVERYTHING". It pushes the sibling repository as it commits to it, and it pushes runvil and checks CI and the site workflow at the end. - The run uses nine steps, not 29, because each step's fixed cost of review, verification, and commit message dominated: "do we REALLY need 29 steps?" The steps group work by subject, and the three largest (the doctest sweep, the file splits, and the visibility pass) fan out to parallel sub-agents inside the step. - `runvil-docs` keeps the old `guide/` layout (added during decomposition, 2026-10-03): chapters under `src//`, plus `src/introduction.md`, with `CONTRIBUTING.md` at its root. `RUNVIL_DOCS` names the root of that checkout, and `build-user-guide` and `cargo xtask site` read `$RUNVIL_DOCS/src/` where they read `guide/src/` before. Both fail with a message naming the variable when it is unset or names no such directory. - `build_ceiling::check()` returns `Result<(), build_ceiling::Violations>` instead of exiting the process (added during decomposition, 2026-10-03): @@ -330,7 +330,7 @@ The user settled each decision below in conversation, and their words are quoted - `CARGO_BUILD_WARNINGS` might not cover rustdoc warnings, so rustdoc steps keep `RUSTDOCFLAGS="-D warnings"` unless that's verified. Cargo ignores `build.warnings` under `--message-format=json`, which rust-analyzer uses, so the editor still shows warnings. - Whether the Tauri bundler or cargo-dist reads `description` is unverified. That's why it stays on both shipped binaries. - `runvil-docs` sits at `c:\Users\Vinnie\cursor\runvil-docs`, inside the workspace folder. An agent opened on `c:\Users\Vinnie\cursor` can still read the guides there, so vibe with `runvil` opened as its own workspace. The repository is public (`git@github.com:cppalliance/runvil-docs`, default branch `master`) and holds only `README.md` and `LICENSE`. - - Edits to `runvil-design` and `runvil-docs` are committed in those repositories, separately from runvil's commits. + - Edits to `runvil-docs` are committed in that repository, separately from runvil's commits. - `core.hooksPath` is a per-clone git setting, and this plan sets it only in this clone. The hooks are bash scripts, which Git for Windows runs. - The 500-line limit as of 2026-10-03: - The tidy ceiling covered 23 of 49 crates. 0 of their 751 files are over 500 lines. @@ -408,15 +408,15 @@ The user settled each decision below in conversation, and their words are quoted ## Execution Instructions -The work runs as 9 steps in four components. Each step is one runvil commit holding its code and its tests. A step that also changes `runvil-design` or `runvil-docs` commits there first, as a separate commit, and pushes that repository right away. The run does every push itself: it pushes the two sibling repositories as it commits to them, and the last step pushes runvil after full verification, starts the site workflow, and watches that run and the CI run until both succeed. The three largest bodies of work (the doctest sweep in Step 2, the file splits in Step 7, and the visibility pass in Step 9) fan out to parallel sub-agents on disjoint files inside their step, and the step's coding agent merges the results and runs the step's checks. Work item numbers refer to the 13 todos in the frontmatter. +The work runs as 9 steps in four components. Each step is one runvil commit holding its code and its tests. A step that also changes `runvil-docs` commits there first, as a separate commit, and pushes that repository right away. The run does every push itself: it pushes the sibling repository as it commits to it, and the last step pushes runvil after full verification, starts the site workflow, and watches that run and the CI run until both succeed. The three largest bodies of work (the doctest sweep in Step 2, the file splits in Step 7, and the visibility pass in Step 9) fan out to parallel sub-agents on disjoint files inside their step, and the step's coding agent merges the results and runs the step's checks. Work item numbers refer to the 13 todos in the frontmatter. - Rules for every step: - Find each edit by its quoted text. Line numbers and line counts below are as of 2026-10-03 and drift. - Verify with the Project Survey commands for the crates the step touches, plus `cargo fmt --all --check` and the checks the step names. Each step repeats this in its own checks. - - Remove retired files with `git rm`; the history keeps them. Touch nothing in `c:\Users\Vinnie\cursor` outside `runvil`, `runvil-design`, and `runvil-docs`. + - Remove retired files with `git rm`; the history keeps them. Touch nothing in `c:\Users\Vinnie\cursor` outside `runvil` and `runvil-docs`. - Write new prose without em dashes or double dashes, in the Engine, Harness, and Host vocabulary that `crates/workshop/ui/test/docs-claims.mjs` checks. - Until Step 8 removes it, the tidy ceiling still binds the 23 crates with the `## Invariants` marker. A step that grows one of their files past 500 lines splits it under the split rule in Technical Design. - - Sub-agents never stage or commit, and the session running the step commits and pushes the sibling repositories, as the rules in Technical Design set out. + - Sub-agents never stage or commit, and the session running the step commits and pushes the sibling repository, as the rules in Technical Design set out. - Components, in dependency order: 1. Docs out of rustdoc (Steps 1 and 2; items 1 and 2). First, because item 2 needs item 1 done, and dropping the doctest steps takes about 67 seconds off every later local gate run. 2. READMEs, manifests, and docs site (Steps 3 and 4; items 3, 4, 5, and 6). Independent of the enforcement work. Early, so the steps that later edit the same manifests (the lint tables in Step 5, the build-dependencies in Step 8) start from trimmed files, and so the Docs line of `AGENTS.md` is final before Step 6 shrinks the file. @@ -435,11 +435,7 @@ The work runs as 9 steps in four components. Each step is one runvil commit hold - Component: Docs out of rustdoc - Work item: 1, for `runvil`, `runvil-engine`, `harness`, and `tools/cicerone`. - Archive: - - Copy the 13 pages in `crates/runvil/src/` (`lib`, `effect`, `event`, `ids`, `model`, `tools`, `capabilities`, `prompt`, `vfs`, `cancel`, `timestamp`, `metrics`, and `replay`, each `.md`) to `runvil-design/saved-docs/runvil/`. - - Copy `crates/runvil-internal/engine/src/lib.md` to `runvil-design/saved-docs/runvil-engine/`. - - Copy `crates/harness/src/{lib,capability,record,vfs}.md` to `runvil-design/saved-docs/harness/`. - - Copy `tools/cicerone.md` and `tools/cicerone/` (two plans and ten Python scripts) to `runvil-design/saved-docs/cicerone/`. Cicerone wrote the rustdoc pages this step deletes, and its instructions still target `lib.md` and `guide/src/`. Nothing outside `vibe/` references it. - - Commit the copies in `runvil-design` (`c:\Users\Vinnie\cursor\runvil-design`) and push that repository right away. Then `git rm` the 18 pages and both cicerone paths from runvil. + - `git rm` the 18 pages and both cicerone paths from runvil. - Tests: - Port into `crates/runvil/tests/suite/`, one topic module per page wired from `tests/suite/main.rs`, every `runvil` page example whose behavior no suite test covers, with its assertions. - Port the engine page's version-detection and parse example into the engine's `tests/` binary if no test covers it. @@ -458,7 +454,6 @@ The work runs as 9 steps in four components. Each step is one runvil commit hold - `cargo +nightly-2026-09-05 xtask api --check` and `cargo test -p build-xtask`. - `rg 'doc = include_str!' crates` matches only the fixture strings in `crates/build-xtask/src/*-tests.rs`, so it finds nothing in `runvil`, `runvil-engine`, or `harness`. - `tools/cicerone.md` and `tools/cicerone/` no longer exist, and `rg -i cicerone --glob '!vibe/**'` finds nothing. - - `git -C c:\Users\Vinnie\cursor\runvil-design status -sb` shows no unpushed commit. diff --git a/vibe/2026-10/2026-10-04-2-plugin-rename.md b/vibe/2026-10/2026-10-04-2-plugin-rename.md index 05571c8d..06e7bf80 100644 --- a/vibe/2026-10/2026-10-04-2-plugin-rename.md +++ b/vibe/2026-10/2026-10-04-2-plugin-rename.md @@ -222,7 +222,7 @@ The owner chose Plugin over Addon and Extension, and asked for one defined term - **Wrong sense calls.** A kept sense could be renamed, or a Plugin could be left behind. The kept and ambiguous lists in Technical Design, plus the residual reports, catch these. - **Lockfile.** Every `--locked` command fails until `Cargo.lock` is rewritten after the crate is renamed. - **Docs lag.** The guide's quoted messages are stale between the code step and the guide step. No test reads them. - - **External references.** References to the old names outside the two repositories stay as they are: cabinet reports, the `runvil-design` repository, `~/.cursor/plans`, and the sibling checkouts `runvil2/` and `runvil3/`. + - **External references.** References to the old names outside the two repositories stay as they are: cabinet reports, `~/.cursor/plans`, and the sibling checkouts `runvil2/` and `runvil3/`. - **The shell.** If the shell cannot run commands on this machine, edits still proceed, and Vinnie runs the gates. ### Deferred and Out of Scope @@ -230,7 +230,7 @@ The owner chose Plugin over Addon and Extension, and asked for one defined term - Deferred: **the Plugin API redesign** (a manifest as data, a Plugin source that loads Plugins from configuration, lazy per-run creation, teardown, and configuration tiers). Revisit after this rename lands. - Out of scope: - the `tools-public` repository, which uses "capability" in its plain-English sense - - the `runvil-design` repository and cabinet reports + - cabinet reports - the sibling checkouts `runvil2/` and `runvil3/` - the gateway's model-capability vocabulary diff --git a/vibe/2026-10/2026-10-13-1-plugin-offering.md b/vibe/2026-10/2026-10-13-1-plugin-offering.md index e78c8fcb..7ade35fd 100644 --- a/vibe/2026-10/2026-10-13-1-plugin-offering.md +++ b/vibe/2026-10/2026-10-13-1-plugin-offering.md @@ -350,7 +350,7 @@ Authors offer a Plugin whole with `plugins.offer`, in the section the call runs ### Deferred and Out of Scope - Deferred to stage 2, the late-bound plan: model-shaped rendering, listed and unlisted tools, the `tools.offer` error that names a Plugin's listed tools, name-clash numbering, and local tools no longer hiding catalog tools. -- Out of scope: the separate `runvil-docs` repository and the language spec in `../runvil-design`. +- Out of scope: the separate `runvil-docs` repository. diff --git a/vibe/2026-10/2026-10-19-2-pack-plugin-rename.md b/vibe/2026-10/2026-10-19-2-pack-plugin-rename.md index 419fcd10..090326a4 100644 --- a/vibe/2026-10/2026-10-19-2-pack-plugin-rename.md +++ b/vibe/2026-10/2026-10-19-2-pack-plugin-rename.md @@ -23,9 +23,6 @@ todos: - id: docs content: "runvil-docs commit: unit-sense Plugin to Pack, plugins: to uses:, plugins.* to packs.*, .plugin to .pack, Plugin id to Pack id, quoted messages, heading anchors and links; rewrite every passage the reorganization makes false or incomplete (Host installation, Host-chosen ids with the browse and operator examples, undeclared third-party Packs, vendor/name entries), found by search; draft after Step 2, land after Step 5; pass the docs site build, the runvil-docs completeness search, and the anchor check" status: completed - - id: design - content: "runvil-design commit: whole-file placeholder-based name swap in the mlua wrapper report, Appendix A included; superseded status line on the naming report; land after the runvil-docs commit, whose heading names the report's references take" - status: completed - id: close content: "Close commit in runvil, with the subject Close plan: pack-plugin-rename and the Plan: trailer naming the record; mark every todo completed in the record and remove vibe/ACTIVE; push nothing" status: completed @@ -38,14 +35,14 @@ isProject: false ## Product Requirements -Runvil's code and docs call the named unit of tools and preludes a Plugin, and the 2026-10-18 rename reserved "package" for the crate or dynamic library that ships it. The owner, who is the repository's owner and the source of every quoted decision below, reversed both names: the unit becomes a Pack, "Plugin" moves to the one entry point a crate or dynamic library provides, which installs Packs, and the frontmatter key `uses:` replaces `plugins:`. A crate that provides a Plugin is a Plugin crate. This plan renames the code, the language guide, and the two live design reports to match, shrinks the root `AGENTS.md` to one-line definitions, rebuilds the mcp Pack around two static tools, and then makes the smallest reorganization that puts Plugins in charge: a Host only calls Plugins, and every Pack they register is built. Paths are relative to the `runvil` repository unless they start with `runvil-docs/`, `runvil-design/`, or `wg21-paperflow/`, which are sibling repositories. +Runvil's code and docs call the named unit of tools and preludes a Plugin, and the 2026-10-18 rename reserved "package" for the crate or dynamic library that ships it. The owner, who is the repository's owner and the source of every quoted decision below, reversed both names: the unit becomes a Pack, "Plugin" moves to the one entry point a crate or dynamic library provides, which installs Packs, and the frontmatter key `uses:` replaces `plugins:`. A crate that provides a Plugin is a Plugin crate. This plan renames the code and the language guide to match, shrinks the root `AGENTS.md` to one-line definitions, rebuilds the mcp Pack around two static tools, and then makes the smallest reorganization that puts Plugins in charge: a Host only calls Plugins, and every Pack they register is built. Paths are relative to the `runvil` repository unless they start with `runvil-docs/` or `wg21-paperflow/`, which are sibling repositories. - Problem and users: - Today a Plugin is the unit with tools and a Lua prelude, installed by its fully qualified name (FQN) under a Plugin id, and "Plugins ship in packages" (`AGENTS.md` line 12). The owner's model is the reverse: a crate or dynamic library provides one entry point, the Plugin, which the Host calls once and which installs zero or more Packs, and each Pack can have zero or more tools, an optional native prelude, and an optional Lua prelude. - Today the Host fills the registry, then picks Packs and installs each under an id with its own config. Workshop installs the MCP Pack once per server, under the server's name, with that server's `mcp.json` entry as config (`crates/workshop/server/src/agents.rs` lines 153-190; `crates/plugin-mcp/src/lib.rs` lines 85-125). The owner calls that per-server Pack "broken" and "a mistake". - Users: Host authors (Workshop, and Paperweight through a vendored snapshot), Plugin crate authors, coding agents that read `AGENTS.md` and crate docs, and prompt authors through the language guide. - Goals: - - Every name for the unit in code, messages, docs, and the two live design reports says Pack, following the name map in Technical Design. + - Every name for the unit in code, messages, and docs says Pack, following the name map in Technical Design. - "Plugin" means only an entry point that installs zero or more Packs, as the root `AGENTS.md` defines it. The crate that provides one is a Plugin crate, and a dynamic library will provide a library Plugin. - Prompts declare Packs as `uses: [web, mcp, json]`, and `plugins:` no longer parses. - The root `AGENTS.md` defines Pack and Plugin in one line each and keeps no rule that conflicts with the planned design. @@ -68,7 +65,7 @@ Runvil's code and docs call the named unit of tools and preludes a Plugin, and t - `crates/runvil/public-api.txt` is generated: regenerate it, never edit it by hand. - Renamed source files keep the flat `parent-label.rs` form with explicit `#[path]` attributes. - `runvil-plugin` is an Engine crate for the Engine guards (`crates/build-xtask/src/engine_guards.rs` line 16) and the Engine clippy bans (`crates/runvil-plugin/clippy.toml`). Code and tests that Step 5 moves into it follow the Engine rules: no tokio, no wall clock, no timeouts, and no Harness crate. - - Nothing under `vibe/` changes except this plan's own record. In `runvil-design`, only the two reports named in Technical Design change. + - Nothing under `vibe/` changes except this plan's own record. - Open questions: None ## Functional Specification @@ -88,7 +85,7 @@ Prompt authors work as today, under new names: a prompt declares Packs under `us - The UI accepts any string id (`run-api.ts` lines 80-88) and only skips the field (`crates/workshop/ui/src/parts/run/run-rows.ts` lines 1-4), so it needs no other change. - Tool ids keep their text, such as `web/fetch`. Their first segment is now called the Pack id, and a Pack id is always the second segment of the Pack's FQN, so `runvil/web` is `web`. The FQN's first segment is the vendor, so a Plugin names its vendor through every Pack it adds. Runvil's own Packs use the vendor `runvil`. - A `uses:` entry is either a bare Pack id, which always means the `runvil` Pack of that id (`web` means `runvil/web`), or a full `vendor/name`, which is the only way to name a third-party Pack (`acme/poop`). - - The mcp Pack (`runvil/mcp`, Pack id `mcp`) takes the whole `mcpServers` object as its config, connects to every server in it, and offers exactly two static tools. They are modeled on Cursor's `GetDynamicTools` and `CallDynamicTool` (`runvil-design/research/2026-10-14-harness-mcp-dynamic-tools.md`, Appendix A, lines 2526-2584), and a namespace is a server's name exactly as written in `mcpServers`: + - The mcp Pack (`runvil/mcp`, Pack id `mcp`) takes the whole `mcpServers` object as its config, connects to every server in it, and offers exactly two static tools. They are modeled on Cursor's `GetDynamicTools` and `CallDynamicTool`, and a namespace is a server's name exactly as written in `mcpServers`: - `mcp/get_dynamic_tools`, with optional `namespace` and `toolName`. With no arguments it lists each namespace, its status (`ready`, `loading`, or `error` with the reason), and its tools' names and descriptions. With `namespace` it returns every tool of that server as `tool`, `description`, and `inputSchema`. With both it returns one tool. - `mcp/call_dynamic_tool`, with required `namespace` and `toolName` and optional `arguments`. It calls that server's tool, as today's per-server call does. - Input schemas: `get_dynamic_tools` takes an object with the optional strings `namespace` and `toolName`. `call_dynamic_tool` takes an object with the required strings `namespace` and `toolName` and an optional object `arguments`, which defaults to `{}`. Arguments that are not an object are refused before anything is sent, as today. @@ -407,14 +404,6 @@ impl HostContext { - `runvil-docs/plans/build-language-guide.md` is a dated plan and stays verbatim. - Heading anchors change, and so does every link to them. Of the 37 headings that contain "plugin" in any letter case, 11 have incoming links, 80 in all, such as the 23 links to `#tool-objects-and-plugin-objects` and the 20 to `#offering-tools-with-toolsoffer-and-pluginsoffer`. The docs site build does not check fragments, so the anchor check in Testing Plan finds the broken ones. - `table.pack` (`language/05-lua-environment.md` line 506) and Lua's `package` library (same file, lines 567-570) stay. - - Design reports: - - `runvil-design/research/2026-10-18-mlua-c-wrapper.md`, the whole report, with prose to match. The old names run through all of it, not only sections 2 and 3: Appendix A (lines 723-845) is a full C example that uses them, and the contents list, the headings of sections 5.2 and 6.3-6.5, and the references name them too. The references' language guide headings, such as "Declaring Plugins under `plugins:`", take the names the `runvil-docs` commit gives them. Each "plugin" and "package" hit is classified, because Lua's `package` library keeps its name: - - `runvil_package_init` becomes `runvil_plugin_init`, `RvPackage` becomes `RvPlugin`, `RvPackageInfo` becomes `RvPluginInfo`, and `describe_package` becomes `describe_plugin`. - - The old `RvPluginInfo` becomes `RvPackInfo`, `register_plugin` becomes `register_pack`, `plugin_data` and `plugin_id` become `pack_data` and `pack_id`, and `plugins:` becomes `uses:`. - - `RvPluginInfo` exists both before and after with different meanings, so the swap runs in three passes. First, every old Plugin-sense name becomes a unique temporary token, such as `@@PACK_INFO@@` for `RvPluginInfo`. Second, every package-sense name becomes its Plugin name. Third, every token becomes its Pack name. The report has no `@@` today, so afterward a search for `@@` in it prints nothing. - - The C example's values and parameters follow the same split: `ACME_URL_PACKAGE` becomes `ACME_URL_PLUGIN`, `URL_PLUGIN` becomes `URL_PACK`, `plugin_id_len` becomes `pack_id_len`, a parameter that holds an `RvPackage` becomes `plugin`, and a parameter of the old `RvPluginInfo` type becomes `pack`. `ACME_URL_PACKAGE` and `URL_PLUGIN` also go through the three passes, because swapping in the wrong order turns `ACME_URL_PLUGIN` into `ACME_URL_PACK`. - - Prose names the code as it stands after this plan: `Plugin::call` (line 604) becomes `Pack::call`, the reference at line 701 names `crates/runvil-plugin/src/pack.rs`, `PackInfo`, and the `Pack` trait, and the Vocabulary line (line 8) states the new names. - - `runvil-design/research/2026-10-18-runvil-plugin-naming.md` gets one status line at the top saying the 2026-10-19 Pack and Plugin rename supersedes its package and Plugin names. The body stays verbatim. - Data, persistence, failure, security, and privacy constraints: - The Workshop prompt contract's JSON field changes on the server and in the UI in the same commit. - No other serialized format names Plugins. A search of `crates/` for serde renames and quoted `plugin` keys finds only Debug output field names (`crates/harness-internal/runner/src/host.rs` line 215 and `crates/harness-internal/runner/src/host-run.rs` line 248), the Lua global, and Tauri's config. `Frontmatter` derives only `Deserialize`, and `Requirements` and its entries derive no serde, so their renamed fields change no wire format. Old runs are not replayed. @@ -561,7 +550,6 @@ The owner swapped the two names because the unit is a Pack of tools and preludes - Rationale: one bad entry would otherwise take every server down, where today only that server is unavailable; tool names never become tool ids; and a script can read JSON with `json.decode`. - An agent recommendation, accepted with this plan. - Dated records stay verbatim. - - The owner chose: "Leave them verbatim; update only living docs, code, and the two design reports". - No replay compatibility work. - The owner: "there are no replays of old runs." - The two mcp tools' input schemas and descriptions are fixed in Functional Specification. @@ -623,7 +611,7 @@ The owner swapped the two names because the unit is a Pack of tools and preludes - One mcp Pack per configured server: - Reason: the owner called it "broken" and "a mistake". It also needed one install per server, which no longer exists. - Revisit: none. - - The research report's three-tool bridge, `tool_search`, `tool_describe`, and `tool_call` (`runvil-design/research/2026-10-14-harness-mcp-dynamic-tools.md` Section 10, lines 1322-1348): + - A research report's three-tool bridge, `tool_search`, `tool_describe`, and `tool_call`: - Reason: the owner asked for two tools matching Cursor's. - Revisit: if models struggle to find tools without a separate search tool. - A trait or function table in `runvil-plugin` instead of passing `PackRegistry` itself: @@ -681,7 +669,7 @@ The owner swapped the two names because the unit is a Pack of tools and preludes - Reason: it would save one full run of the gates, but a rename this wide is easier to review in two halves. - Revisit: none. - Assumptions, risks, and notes: - - Note: "the dynamic-library step" means the planned work that loads Plugins from dynamic libraries through the C API drafted in `runvil-design/research/2026-10-18-mlua-c-wrapper.md`. "The toolset design" means the planned design for naming and offering groups of tools, from the open findings of `runvil-design/research/2026-10-18-runvil-plugin-naming.md`. Neither is written yet. + - Note: "the dynamic-library step" means the planned work that loads Plugins from dynamic libraries through the C API drafted in a research report. "The toolset design" means the planned design for naming and offering groups of tools, from the open findings of a research report. Neither is written yet. - Note: `json`, `url`, and `markdown` in examples such as `uses: [web, mcp, json]` are illustrative. No such Packs exist today. The Packs that exist are `runvil/web`, `runvil/user-input`, `runvil/mcp`, and the built-in `runvil/subagents`. - Note: this reverses the 2026-10-04 decision that retired "pack" as a second name for the unit (`vibe/2026-10/2026-10-04-2-plugin-rename.md` line 208). That record stays verbatim. - Note: each crate's constant was `PACKAGE` until 2026-10-18 (`vibe/2026-10-18-2-plugin-registry-rename.md` line 3), is `PLUGIN` now, and becomes private in Step 5, where `install` takes its public place. @@ -694,7 +682,6 @@ The owner swapped the two names because the unit is a Pack of tools and preludes - Note: other senses of "pack" stay: Lua's `table.pack` (`runvil-docs/src/language/05-lua-environment.md` line 506 and `crates/runvil-internal/lua/src/globals-tests.rs` line 321), the verb and "packed" in `crates/build-llama-cuda/src/bundle.rs` and `src/lib.rs` line 7, `crates/runvil-internal/engine/src/execute/tests/scheduler/fanout/scheduling.rs` lines 13 and 119, `crates/runvil-internal/types/src/ids.rs` line 13, and `crates/gateway/stt/README.md` line 79, CodeMirror's language packs in `crates/workshop/ui/src/parts/editor/editor-surface.ts` line 331, the private function `pack_sequence` in `crates/runvil-internal/lua/src/vm.rs`, and the test name `my-pack` in `crates/runvil-internal/types/src/names-tests.rs` line 51. Only the doc of `pack_sequence` changes, because it opens with the capitalized "Packs". - Risk: classifying "Plugin" in prose is manual, and mixed sentences such as "links the Plugin crate into the Host" keep "Plugin". The completeness searches and a read of every remaining hit catch mistakes. - Risk: renamed headings in the language guide break links, and the docs site build's link check does not catch a broken fragment, because it confirms only that the linked file exists (`crates/build-xtask/src/site.rs`, `resolve`). The anchor check in Testing Plan catches them. - - Risk: the mlua report uses lowercase "plugin" loosely (lines 584-606, and sections 5 and 6). Each occurrence is classified as Pack or Plugin. - Risk: crate prose that the reorganization makes false has no zero-hit gate. Step 5's prose search finds the candidates, and each hit is read. ### Deferred and Out of Scope @@ -702,8 +689,8 @@ The owner swapped the two names because the unit is a Pack of tools and preludes - Deferred: the dynamic-library entry point and its C function table, and any `PackSet` type. Revisit in the dynamic-library step. - Deferred: native preludes. Revisit in the dynamic-library step. - Deferred: the rest of Cursor's pair for MCP: `pattern` search, short descriptions in the listing, `mcpDetails`, and an authentication flow. Revisit when MCP use shows the need. -- Deferred: tool identity and selection: whether Lua names tools, toolsets chosen by behavior traits, and wire names. These are the open findings F1, F2, and F5 in `runvil-design/research/2026-10-18-runvil-plugin-naming.md` (Table 1). F6, who picks Pack ids, is settled here: nobody does, because the id is the FQN's second segment. Revisit in the toolset design. -- Out of scope: `vibe/` (apart from this plan's record), and `runvil-design` chats, huddles, datasets, and dated research other than the two reports. +- Deferred: tool identity and selection: whether Lua names tools, toolsets chosen by behavior traits, and wire names. These are the open findings F1, F2, and F5 in a research report. F6, who picks Pack ids, is settled here: nobody does, because the id is the FQN's second segment. Revisit in the toolset design. +- Out of scope: `vibe/` (apart from this plan's record). - Out of scope: `wg21-paperflow/vendor/runvil` and Paperweight. The snapshot predates the 2026-10-18 rename (it still has `crates/harness-internal/runner/src/packages.rs`) and picks up both renames when it is next vendored. @@ -733,7 +720,6 @@ The repositories, their starting points, the tools, and the commands every gate - Repositories, each clean on `master` when this plan was written. Every line number in this plan refers to these commits. Where a cited line no longer matches, find the passage by its quoted text. - `runvil` at `c:\Users\Vinnie\cursor\runvil`, commit `fc4a1c0ed` - `runvil-docs` at `c:\Users\Vinnie\cursor\runvil-docs`, commit `5bead4f34`, with the language guide under `src/language/` - - `runvil-design` at `c:\Users\Vinnie\cursor\runvil-design`, commit `971f8652c`, with the design reports under `research/` - In `runvil`, `crates/` holds all code, `AGENTS.md` is the root rulebook, `prompts/` holds the shipped prompts, `vibe/` holds dated plan records and `ACTIVE`, and `guide/` holds the documentation site's landing page and chrome. The shell is Windows PowerShell. - Four directories without a manifest of their own hold private crates: `crates/runvil-internal/` (the Engine's `types`, `parser`, `lua`, `engine`, `vfs`, and `model-client`), `crates/harness-internal/` (`runner`, package `harness-runner`), `crates/gateway/`, and `crates/workshop/`. - Component boundaries: `runvil-plugin` depends on `runvil-types`, `runvil-vfs`, and `serde_json` (`crates/runvil-plugin/Cargo.toml` lines 11-15). A `plugin-*` crate may depend only on `runvil-plugin`, `shared-*` crates, and outside libraries (`crates/build-xtask/src/product.rs` lines 19-22). `harness` depends on `harness-runner`, `runvil`, and `runvil-plugin` (`crates/harness/Cargo.toml` lines 14-16). `runvil-plugin` is an Engine crate for the Engine guards (`crates/build-xtask/src/engine_guards.rs` line 16) and the Engine clippy bans (`crates/runvil-plugin/clippy.toml`). `cargo test -p build-xtask` enforces these boundaries. @@ -757,9 +743,9 @@ The repositories, their starting points, the tools, and the commands every gate - `git grep -n -E "Four words|named unit of tools|never capability|Plugin lifecycle wording" -- AGENTS.md` prints nothing - `git grep -n -i "capabilit" -- crates/workshop/ui/test/docs-claims.mjs` prints nothing -- Component placement: first of six. It states the two definitions every later step follows, it changes no Rust, and the `docs-claims.mjs` gate that Steps 2 to 5 run scans the rulebook it rewrites. +- Component placement: first of five. It states the two definitions every later step follows, it changes no Rust, and the `docs-claims.mjs` gate that Steps 2 to 5 run scans the rulebook it rewrites. - Piece: one piece in one step. The `AGENTS.md` sentence "never capability, pack, or addon" and the capability check that enforces it must go in the same commit for `docs-claims.mjs` to pass. -- Before editing: read the root `AGENTS.md`, confirm the Project Survey, and check that each repository is at its listed commit (`runvil` at `fc4a1c0ed`, `runvil-docs` at `5bead4f34`, `runvil-design` at `971f8652c`) or that the cited lines still match. Where a cited line has moved, find the passage by its quoted text. +- Before editing: read the root `AGENTS.md`, confirm the Project Survey, and check that each repository is at its listed commit (`runvil` at `fc4a1c0ed`, `runvil-docs` at `5bead4f34`) or that the cited lines still match. Where a cited line has moved, find the passage by its quoted text. - `AGENTS.md`: - Replace the whole Plugin paragraph (line 12, which starts "- **Plugin**: a named unit of tools") with exactly the two lines in the block below. - Change "Four words" (line 7) to "Five words". @@ -803,7 +789,7 @@ The repositories, their starting points, the tools, and the commands every gate - `$env:RUSTDOCFLAGS="-D warnings"; cargo doc -p runvil --no-deps` - `git grep -n -E "PluginId|UnavailablePlugin|PluginDto|PluginListError|RunContractPlugin|LuaPluginHandle|PLUGIN_OBJECTS_REGISTRY|@plugin:|plugin_segment|::plugins|plugins\.(offer|get|required|extras)|plugins:" -- crates prompts AGENTS.md` prints only the esbuild `plugins:` lines in `crates/workshop/ui/build.mjs` and `crates/workshop/ui/test/tab-shimmer.mjs` -- Component placement: second of six. It renames the code to the vocabulary Step 1 defines, and the two code components after it are written against its names and widen the `uses:` key it adds. +- Component placement: second of five. It renames the code to the vocabulary Step 1 defines, and the two code components after it are written against its names and widen the `uses:` key it adds. - Piece: Engine names, the first of this component's two pieces, built sequentially before Step 3. Step 3's names build on these (`PackInfo`'s construct takes `&PackId`), and each commit must compile and pass alone. The owner kept the rename as two commits because a rename this wide is easier to review in halves. - Scope, as Technical Design lists it: the public facade changes, the Engine internals, the Lua global `plugins` to `packs` and the Tool object field `plugin` to `pack`, the prelude chunk name, the Engine messages below, and the frontmatter key `plugins:` to `uses:`. Change every caller in the same commit: the Harness, `runvil-plugin`'s re-export (`src/lib.rs` line 68), the `plugin-*` crates (`plugin-mcp`'s `connect::run` takes a `PackId` until Step 4), the Workshop server and UI, `prompts/`, and test fixtures. - Messages, each with Plugin in the unit sense replaced by Pack and the same meaning. Update every test that pins one: @@ -838,7 +824,7 @@ The repositories, their starting points, the tools, and the commands every gate - The names in Technical Design's "Names that stay Plugin" list, and the phrase "Plugin crate". - Other senses of pack: Lua's `table.pack` (`crates/runvil-internal/lua/src/globals-tests.rs` line 321), the verb and "packed" in `crates/build-llama-cuda/src/bundle.rs` and `src/lib.rs` line 7, `crates/runvil-internal/engine/src/execute/tests/scheduler/fanout/scheduling.rs` lines 13 and 119, `crates/runvil-internal/types/src/ids.rs` line 13, `crates/gateway/stt/README.md` line 79, CodeMirror's language packs (`crates/workshop/ui/src/parts/editor/editor-surface.ts` line 331), the function `pack_sequence`, and the test name `my-pack` (`crates/runvil-internal/types/src/names-tests.rs` line 51). No `Pack*` or `PACK` identifier exists in `crates/` or `prompts/` before this step. - The unrelated `uses` field in `crates/build-xtask/src/api/items.rs` (lines 102-180). - - `runvil-docs`, `runvil-design`, `vibe/`, and `wg21-paperflow/vendor/runvil`. + - `runvil-docs`, `vibe/`, and `wg21-paperflow/vendor/runvil`. - Commit: one commit in `runvil` holding this step's code and tests, made once every test above passes, in the repository's usual form: an imperative subject, a paragraph, bullets, and trailers that end with `Plan:` and the record path that `vibe/ACTIVE` holds (`git show c5d883452` shows the form). Push nothing. - Stop and report, instead of improvising, when a test fails for a reason this plan does not cover, a cited passage cannot be found by its line or its quoted text, or the step would need a change this plan rules out. @@ -874,7 +860,7 @@ The repositories, their starting points, the tools, and the commands every gate - Behavior does not change. The registry and install tests (`crates/harness-internal/runner/src/registry-tests.rs` and `tests/it/registry.rs`) pass under the new names and messages, and renamed tests keep their assertions. - Docs in these crates say Pack for the unit. Sentences about installing a Pack under a Pack id stay true until Step 5, which rewrites them, so leave their meaning alone here. - This step does not bless the facade listing. If `xtask api --check` fails, the `runvil` facade changed by accident: stop and report. -- Leave Cargo's, npm's, and Lua's package, other programs' plugins (Tauri, ProseMirror, CodeMirror, esbuild, and NSIS), the names in Technical Design's "Names that stay Plugin" list, and the phrase "Plugin crate" as they are, and make no blind search and replace. `runvil-docs`, `runvil-design`, `vibe/`, and `wg21-paperflow/vendor/runvil` stay untouched. +- Leave Cargo's, npm's, and Lua's package, other programs' plugins (Tauri, ProseMirror, CodeMirror, esbuild, and NSIS), the names in Technical Design's "Names that stay Plugin" list, and the phrase "Plugin crate" as they are, and make no blind search and replace. `runvil-docs`, `vibe/`, and `wg21-paperflow/vendor/runvil` stay untouched. - Commit: one commit in `runvil` holding this step's code and tests, made once every test above passes, in the repository's usual form: an imperative subject, a paragraph, bullets, and trailers that end with `Plan:` and the record path that `vibe/ACTIVE` holds (`git show c5d883452` shows the form). Push nothing. - Stop and report, instead of improvising, when a test fails for a reason this plan does not cover, a cited passage cannot be found by its line or its quoted text, or the step would need a change this plan rules out. @@ -898,14 +884,14 @@ The repositories, their starting points, the tools, and the commands every gate - `$env:RUSTDOCFLAGS="-D warnings"; cargo doc --workspace --no-deps --all-features --exclude workshop --exclude workshop-server --exclude workshop-server-api` - `$env:RUSTDOCFLAGS="-D warnings"; cargo doc -p runvil --no-deps` -- Component placement: third of six. It is written against the pack-rename component's names, and it comes before the plugin-entry-points component, whose `plugin_mcp::install` only adds this one Pack with `config["mcp"]`. The owner chose to land it in its own commit, on today's install API, before the reorganization. +- Component placement: third of five. It is written against the pack-rename component's names, and it comes before the plugin-entry-points component, whose `plugin_mcp::install` only adds this one Pack with `config["mcp"]`. The owner chose to land it in its own commit, on today's install API, before the reorganization. - Piece: one piece, built jointly. The construct's config changes from one server entry to the whole server map, so `plugin-mcp`, Workshop's install, and their tests must change in the same commit to compile and pass. - Build what Technical Design lists under "Step 4, the mcp Pack": the construct over the whole `mcpServers` object, with each entry parsed on its own by today's `entry::parse` and one connection per parsed entry reusing `crates/plugin-mcp/src/connect.rs`, `result.rs`, and `server.rs`; one new Pack object that holds every server; the removal of the per-server `ToolInfo` ids and of the tool-id filter in `catalog` (`server.rs` lines 51-87); `connect::run` (`connect.rs` line 68) taking the server's name as a `String`; the doc rewrites; and Workshop's single install. - Config: - The construct takes the whole `mcpServers` object. A `null` config means no servers. Any other config that is not an object refuses the construct, and so does a missing runtime service, as today. - Each entry is parsed on its own. An entry that fails, such as a local `command` entry, a bad header, or an unset `${env:NAME}`, becomes a namespace with status `error` and that reason, and the other servers still connect. One bad entry never fails the construct. A local entry's reason is "local MCP servers (command) are not supported yet". - A namespace is the server's name exactly as written in `mcpServers`, with no lowercasing, because namespaces never become tool ids. -- Tools: the Pack offers exactly two static tools under the Pack id `construct` receives (`mcp` in Workshop), modeled on Cursor's `GetDynamicTools` and `CallDynamicTool` (`runvil-design/research/2026-10-14-harness-mcp-dynamic-tools.md`, Appendix A, lines 2526-2584). `ready` resolves at once, and each server's state shows through `get_dynamic_tools`. +- Tools: the Pack offers exactly two static tools under the Pack id `construct` receives (`mcp` in Workshop), modeled on Cursor's `GetDynamicTools` and `CallDynamicTool`. `ready` resolves at once, and each server's state shows through `get_dynamic_tools`. - `mcp/get_dynamic_tools` takes an object with the optional strings `namespace` and `toolName`. Its description reads: "List the tools of the configured MCP servers. With no arguments, list each server's namespace, status, and tool names; with namespace, that server's tools and their input schemas; with namespace and toolName, one tool." - `mcp/call_dynamic_tool` takes an object with the required strings `namespace` and `toolName` and an optional object `arguments`, which defaults to `{}`. Arguments that are not an object are refused before anything is sent, as today. It calls that server's tool as today's per-server call does. Its description reads: "Call a tool of a configured MCP server by namespace and toolName, with arguments as a JSON object that matches the tool's input schema. List the servers' tools first to see it." - Both tools' output is untrusted, because descriptions, schemas, and results all come from the servers. @@ -954,7 +940,7 @@ The repositories, their starting points, the tools, and the commands every gate - `git grep -n -i plugin -- crates prompts AGENTS.md`, with every hit read and classified as below - `git grep -n -i -E "installed (it )?under|installed as|picks another|chose|chooses|default (name|plugin id|pack id)|plain name|declared or not|every usable" -- crates`, with every hit read and each one about Packs rewritten -- Component placement: fourth of six, and the last code component. It needs the Pack names and the one-Pack mcp Pack, and the docs and design components describe what it builds. +- Component placement: fourth of five, and the last code component. It needs the Pack names and the one-Pack mcp Pack, and the docs component describes what it builds. - Piece: one piece in one commit, built jointly, because removing `HostContext::install`, Plugins that add Packs, the per-run pick, and `PackRef` all change the same call sites and tests. The owner chose to keep this step whole rather than split it in two. - Build what Technical Design lists under "Step 5, the reorganization", with the signatures in its Rust block: - The move of `PackRegistry`, `PackOrigin`, `InstallError`, and the built-in `runvil/subagents` Pack with its unreachable object into `crates/runvil-plugin/src/registry.rs`, with `registry-tests.rs` beside it, the `thiserror` dependency, the hand-written Debug, `into_entries`, and the re-exports from `runvil-plugin` and `harness::pack`. @@ -998,7 +984,7 @@ The repositories, their starting points, the tools, and the commands every gate - Prose: rewrite every crate doc and comment the reorganization makes false, that is, every one that says the Host installs a Pack by FQN, picks or defaults its Pack id, or that every run receives every usable Pack. Technical Design lists the known ones. Engine crate docs say "the caller", never the Host. Neither the name searches nor rustdoc finds these, so read every hit of the prose search in Tests. - The background that the old `AGENTS.md` Plugin paragraph held lives in crate docs once this step lands, chiefly `runvil-plugin`'s crate doc: a Pack has an FQN such as `runvil/web`, and its Pack id is the FQN's second segment, `web`, which prefixes its tools (`web/fetch`); a linked Plugin is the `install` function of a Plugin crate (a `plugin-*` crate), and a library Plugin will be the entry point a dynamic library exports (not built yet); and `runvil/subagents` is a built-in Pack that reserves its id for the Engine's subagent tools. - Classify every hit of the case-insensitive search. Each remaining one means a Plugin (an entry point that installs Packs), sits in "Plugin crate" or a crate name (`plugin-web`, `plugin-mcp`, `plugin-user-input`, `runvil-plugin`, or their `_` forms), belongs to the Plugin crate family checks in `crates/build-xtask`, is in Technical Design's "Names that stay Plugin" list, or names another program's plugin. Hits on crate names, other programs' names, and "Plugin crate" pass on sight. Rename every other one. -- Out of scope: `wg21-paperflow/vendor/runvil` and Paperweight, the dynamic-library entry point and its C function table, native preludes, and library Plugins. `runvil-docs`, `runvil-design`, and `vibe/` stay untouched. +- Out of scope: `wg21-paperflow/vendor/runvil` and Paperweight, the dynamic-library entry point and its C function table, native preludes, and library Plugins. `runvil-docs` and `vibe/` stay untouched. - Commit: one commit in `runvil` holding this step's code and tests, made once every test above passes, in the repository's usual form: an imperative subject, a paragraph, bullets, and trailers that end with `Plan:` and the record path that `vibe/ACTIVE` holds (`git show c5d883452` shows the form). Push nothing. - Stop and report, instead of improvising, when a test fails for a reason this plan does not cover, a cited passage cannot be found by its line or its quoted text, or the step would need a change this plan rules out. @@ -1015,7 +1001,7 @@ The repositories, their starting points, the tools, and the commands every gate - The old-slug check block below prints nothing - The fragment check block below prints `unresolved: 0` -- Component placement: fifth of six. The guide quotes messages and Pack ids that Steps 2 and 5 fix, so it lands after Step 5. Check every quoted message and Pack id against the `runvil` code at that point, and stop and report any difference from the texts below. +- Component placement: last of five. The guide quotes messages and Pack ids that Steps 2 and 5 fix, so it lands after Step 5. Check every quoted message and Pack id against the `runvil` code at that point, and stop and report any difference from the texts below. - Piece: one piece, built jointly. Heading renames and the links to them must change together for the anchor check, and the passages to rewrite overlap the passages to rename. - Work in `c:\Users\Vinnie\cursor\runvil-docs`, under `src/`. Do what Technical Design lists under "Language guide": the renames (unit-sense Plugin to Pack, `plugins:` to `uses:`, `plugins.*` to `packs.*`, `.plugin` to `.pack`, "Plugin id" to "Pack id", "bundled Plugins" to "bundled Packs", and the lowercase spots it lists), the quoted messages, the heading anchors and every link to them, and the rewrite of every passage in its four groups, found by reading every hit of `git grep -n -i -E "install|picks? (a|no|another) plugin id|chooses|browse|operator|extras|undeclared|not declared|declared or not|every usable|every installed|one segment|single segment|plain name|runvil/" -- src/language`. - What the rewritten passages say: @@ -1076,32 +1062,4 @@ $bad - - -### Step 7: Design report updates [completed] - -- Component: design-reports -- Tests: run in PowerShell: - - `git -C c:\Users\Vinnie\cursor\runvil-design grep -n -F "@@" -- research/2026-10-18-mlua-c-wrapper.md` prints nothing - - `git -C c:\Users\Vinnie\cursor\runvil-design grep -n -w -E "runvil_package_init|RvPackage|RvPackageInfo|describe_package|register_plugin|plugin_data|plugin_id|plugin_id_len|ACME_URL_PACKAGE|URL_PLUGIN" -- research/2026-10-18-mlua-c-wrapper.md` prints nothing (36 lines match at `971f8652c`) - - `git -C c:\Users\Vinnie\cursor\runvil-design grep -n -F -e "plugins:" -e "Plugin::call" -e "runvil-plugin/src/plugin.rs" -- research/2026-10-18-mlua-c-wrapper.md` prints nothing - - `git -C c:\Users\Vinnie\cursor\runvil-design grep -n -i -E "plugin|package" -- research/2026-10-18-mlua-c-wrapper.md`, with every hit read; each remaining one names a Plugin (an entry point that installs Packs), a Plugin crate, or Lua's `package` library - - `git -C c:\Users\Vinnie\cursor\runvil-design grep -n -F "Pack and Plugin rename supersedes" -- research/2026-10-18-runvil-plugin-naming.md` prints one line, line 3 - -- Component placement: last of six. The mlua report's references cite language guide headings by name and take the names Step 6 gives them. -- Piece: one piece holding both reports, built jointly because they share one commit in `runvil-design`. -- Work in `c:\Users\Vinnie\cursor\runvil-design`. Change only `research/2026-10-18-mlua-c-wrapper.md` and `research/2026-10-18-runvil-plugin-naming.md`. Chats, huddles, datasets, and other dated research stay verbatim. -- The mlua report: the whole file, with prose to match, as Technical Design lists under "Design reports". The old names run through Appendix A (lines 723-845), the contents list, the headings of sections 5.2 and 6.3-6.5, and the references, not only sections 2 and 3. - - Package-sense names become Plugin names: `runvil_package_init` to `runvil_plugin_init`, `RvPackage` to `RvPlugin`, `RvPackageInfo` to `RvPluginInfo`, `describe_package` to `describe_plugin`, `ACME_URL_PACKAGE` to `ACME_URL_PLUGIN`, and a parameter that holds an `RvPackage` to `plugin`. - - Old Plugin-sense names become Pack names: `RvPluginInfo` to `RvPackInfo`, `register_plugin` to `register_pack`, `plugin_data` to `pack_data`, `plugin_id` to `pack_id`, `plugin_id_len` to `pack_id_len`, `URL_PLUGIN` to `URL_PACK`, a parameter of the old `RvPluginInfo` type to `pack`, and `plugins:` to `uses:`. - - `RvPluginInfo` exists before and after with different meanings, and `ACME_URL_PACKAGE` and `URL_PLUGIN` collide the same way, so swap in three passes. First, every old Plugin-sense name becomes a unique temporary token, such as `@@PACK_INFO@@` for `RvPluginInfo`. Second, every package-sense name becomes its Plugin name. Third, every token becomes its Pack name. The report has no `@@` today, so afterward a search for `@@` in it prints nothing. - - Classify each remaining "plugin" and "package" hit by meaning. Lua's `package` library keeps its name, and the loose lowercase "plugin" (lines 584-606, and sections 5 and 6) becomes Pack or Plugin. - - Prose names the code as it stands after Step 5: `Plugin::call` (line 604) becomes `Pack::call`, the references at lines 604 and 701 name `crates/runvil-plugin/src/pack.rs`, line 701 names `PackInfo` and the `Pack` trait, and the Vocabulary line (line 8) states the new names. - - The references to language guide headings, such as "Declaring Plugins under `plugins:`" (line 714) and "Declared Plugins are required Plugins" and "Which Plugins add globals" (line 598), take each heading's exact new text from `runvil-docs` after Step 6. -- The naming report: insert one line directly below the H1 title, before the metadata bullets, reading `- Superseded: the 2026-10-19 Pack and Plugin rename supersedes this report's package and Plugin names.` Keep every other line verbatim, the existing Status bullet included. -- Commit: one commit in `runvil-design` containing only these two files, made once every test above passes, in that repository's usual form (`git -C c:\Users\Vinnie\cursor\runvil-design log -3` shows it). Push nothing. -- Stop and report, instead of improvising, when a test fails for a reason this plan does not cover, a cited passage cannot be found by its line or its quoted text, or the step would need a change this plan rules out. - - - diff --git a/vibe/2026-10/2026-10-20-1-library-plugin-loading.md b/vibe/2026-10/2026-10-20-1-library-plugin-loading.md index e5753f9f..c4e50fc6 100644 --- a/vibe/2026-10/2026-10-20-1-library-plugin-loading.md +++ b/vibe/2026-10/2026-10-20-1-library-plugin-loading.md @@ -987,7 +987,6 @@ The loader's unit tests drive the whole contract with fake entry points inserted - **A config per Plugin,** passed in `RV_PLUGIN_LOAD`'s arguments. Revisit with `insert_pack`. - **The dynamic library's hash in the Pack roster.** Revisit with `insert_pack`. - **Workshop loading from its `plugins` workspace directory** (`crates/workshop/workspace/src/workspace_file/siblings.rs`, line 14). Revisit with `insert_pack`. - - **Revising the C draft** (`research/2026-10-18-mlua-c-wrapper.md` in the sibling `runvil-design` repository, the earlier design of the full C API, including the Lua API) to this contract: one entry point shape taking `RvCall`, `RvStr` strings, the verbs, the instance pointers, and no `RvPlugin` token. Revisit before the Lua API is built. - Out of scope: - every verb other than `RV_PLUGIN_LOAD` and `RV_PLUGIN_UNLOAD` - Packs, tools, Lua, or mlua through the entry point, and so `PackOrigin::Library` diff --git a/vibe/2026-10/2026-10-23-1-one-offer-api.md b/vibe/2026-10/2026-10-23-1-one-offer-api.md index ea7e7f74..b314e1fd 100644 --- a/vibe/2026-10/2026-10-23-1-one-offer-api.md +++ b/vibe/2026-10/2026-10-23-1-one-offer-api.md @@ -501,8 +501,7 @@ Lua crate tests pin every form, error, and ordering rule. Engine and other crate - **Structured output from adhoc tools.** A function returning a table fails. No catalog tool has structured output today, so every catalog tool can be wrapped; a structured one would hand its wrapper a table that the wrapper cannot return. Revisit: when a prompt needs it, or when the first catalog tool with structured output exists. - Out of scope: - the vendored `wg21-paperflow/vendor/runvil` copy; - - the historical `vibe/` plans, except the one note in the Execution Instructions; - - the `runvil-design` research reports. + - the historical `vibe/` plans, except the one note in the Execution Instructions. @@ -1106,7 +1105,7 @@ Edits come in four labeled parts. Line hints are approximate at `e1a469c`, so fi - `12-tools.md`, beyond the passages above: lines 558 and 1163 (part A's replacement example), line 2044 (deleted in part A), the batch passage at lines 2141-2176 (part A), line 2331, and line 2391; - `15-tasks.md`, the model-task sentences outside the ranges above: line 93 drops its last sentence, about the model's task built-ins; delete line 552; lines 1089 and 1105 drop the model's notices, and line 1105 says the reason's phrase is what the `TaskAbandoned` trace line renders (`AbandonReason::why` in `types/src/ids.rs`); the `tool_loop_exhausted` row (line 1111) reads "while the task was live", and line 1115 says it is kept apart from `owner_failed` so a report can name the round cap as the cause; line 1333 drops its `await_tasks` sentence; delete lines 1840-1841, and line 1844 drops its model task id sentence; delete line 1996; in "Task events and task errors", lines 2665, 2671-2672, 2684, 2686, and 2690 lose their model-task parts, and "Notice and tool call events" (lines 2692-2700) is deleted, since the code has no `TaskNotice` event and no task built-ins; - `17-quick-reference.md`: delete the four `Engine built-in` rows (lines 254-257), and row 101 reads as part A gives it; - - the vendored `wg21-paperflow/vendor/runvil` copy and the `runvil-design` reports are out of scope. + - the vendored `wg21-paperflow/vendor/runvil` copy is out of scope. **Part C, task origin.** The code has no task origin, so every passage that gives a task an origin, or counts only author tasks, is removed or corrected. Facts from the code, which this part documents: `tasks.pending()` takes no arguments, and any non-nil argument raises `tasks.pending takes no arguments, got {type}` (`tasks_pending` in `lua/src/__impl_tasks.lua`); a status table holds exactly `target`, `state`, `ok`, `section`, `blocked`, `turns`, `tasks`, `depth`, and `note` (`TaskStatus` in `lua/src/protocol/answer.rs`); `TaskStarted` records `task`, `target`, `input`, `item`, `index`, and `var` (`types/src/event.rs`); and every live task a chain spawned counts toward `tasks_live`, whose message is `chain ended with tasks still live: {ids}; wait on or cancel every task a chain spawns before it ends` (`engine/src/error.rs`, line 218). diff --git a/vibe/2026-10/2026-10-25-1-tools-kernel-redo.md b/vibe/2026-10/2026-10-25-1-tools-kernel-redo.md index 0580500f..989a1994 100644 --- a/vibe/2026-10/2026-10-25-1-tools-kernel-redo.md +++ b/vibe/2026-10/2026-10-25-1-tools-kernel-redo.md @@ -448,7 +448,7 @@ Each work item ships its tests in the same commit. Unit tests pin the new types - Note: two tests in `crates/workshop/ui/test/docs-claims.mjs` read the whole root `AGENTS.md`, even the Definitions section that its wording scan skips. They fail on "activat", "TOML config", "three named buckets", or "three homes", so the new Definitions bullets avoid them. - Note: an old `ToolInfo` fixture in `a_tool_info_logged_without_survives_stop_reads_as_not_surviving` (`crates/runvil-internal/types/src/tools/tests.rs`) holds `"wire_name":"fetch"`. With the new field it would read as `Some("fetch")`, so the key is removed and the test keeps pinning only the missing `survives_stop`. This supersedes the one-offer API plan's note against naming the field `wire_name` (`vibe/2026-10-23-1-one-offer-api.md`), because that fixture is the one stored `ToolInfo` in the repository. - Note: the facade does not re-export `Pack`, so `ToolInfo`'s doc names `Pack::render` in plain text. An intra-doc link would fail `xtask api --check`. - - Note: the discovery tools are modeled on Cursor's pair, `GetDynamicTools(namespace?, toolName?, pattern?)` with an RE2 pattern of at most 256 characters, and `CallDynamicTool(namespace, toolName, arguments, mcpDetails?)`. The capture is `research/2026-10-14-harness-mcp-dynamic-tools.md`, Appendix A, in the `runvil-design` repository. + - Note: the discovery tools are modeled on Cursor's pair, `GetDynamicTools(namespace?, toolName?, pattern?)` with an RE2 pattern of at most 256 characters, and `CallDynamicTool(namespace, toolName, arguments, mcpDetails?)`. - Note: `ToolCallOrigin.section` and `ToolCallOrigin.execution` are the section's and the run's names, so two entries of one section share both. That is why the origin gains the entry id. - Note: the plan was checked against `runvil` commit `c27899e7a` with a clean tree. Line numbers may drift, and symbol names are the reliable anchors. The repositories are `c:\Users\Vinnie\cursor\runvil` and `c:\Users\Vinnie\cursor\runvil-docs`. diff --git a/vibe/2026-11-01-1-std-read-listdir-grep.md b/vibe/2026-11-01-1-std-read-listdir-grep.md index fca265f5..fc7adf00 100644 --- a/vibe/2026-11-01-1-std-read-listdir-grep.md +++ b/vibe/2026-11-01-1-std-read-listdir-grep.md @@ -154,11 +154,11 @@ Unit tests pin every text, boundary, and constant. Integration tests flip the st - Unit: - Read: the numbering window table; the cap and a page-by-page rebuild across 1, 2, 5, 37, 2,000, and 2,001 lines with and without a final newline; the first-line cut on lines of 1-, 2-, 3-, and 4-byte characters (99,992 or 99,990 kept bytes, always valid UTF-8); a cap sweep from 12 to 60 bytes over mixed-width text; a file that ends mid-sequence; the offset table on a 10-line file; line totals; carriage returns; the decode ladder; the binary sniff boundaries (NUL at index 8,191 versus 8,192, 5% versus 4.9%); every failure text byte for byte; the argument rules; a trust test; and the description pin, which asserts the text contains `100000` and `16777216` and not `cat -n`. - - ListDir: the POSIX tree example in the parent design report (`runvil-design/specs/cursor/agent-file-tools.md`), an empty directory, a file as target, a missing path, `.git` skipped while `.env` and `.gitignore` are listed, sort order against `Access::glob`'s for the same tree, the byte cap and its note, and `ignore_globs` matching at any depth. + - ListDir: the POSIX tree example in the parent design report, an empty directory, a file as target, a missing path, `.git` skipped while `.env` and `.gitignore` are listed, sort order against `Access::glob`'s for the same tree, the byte cap and its note, and `ignore_globs` matching at any depth. - Grep: full-path order on `/B`, `/a-b`, `/a.txt`, `/a/x`, `/b`; `head_limit` global across files; page joins at 25 matches; `-C` overridden per side; merged context; the window around a match at position 1,001; skips with their counts; each regex failure; every argument string; UTF-8 safety of the long-line window and the context clip at every start offset over emoji and CJK text; and the description pin. - Matcher: each grammar rule, dotfiles, any-depth matching, and each refusal. The cases the matcher shares with `Access::glob` are pinned against that function's own cases, and a test records the one difference, which is any-depth matching. - Refusal text: every `VfsError` variant, including `Conflict`, built directly with no second call. - - Worked examples to reuse as cases are in `specs/cursor/master-read.md` and `specs/cursor/master-grep.md` in the runvil-design repository. Where one disagrees with a rule in this plan, this plan governs. + - Worked examples to reuse as cases are in the Read and Grep design reports. Where one disagrees with a rule in this plan, this plan governs. - VFS, in the vfs crate: `read_range` is denied by a read-denying policy, takes a read claim, fires the read event, and passes a `len` of 16,777,217 to a counting backend. - Integration and end-to-end: - Flip Read, ListDir, and Grep in `crates/plugin-std/tests/it/tools.rs` from the stub text to real output. The four remaining stubs keep their stub tests. @@ -185,7 +185,7 @@ Unit tests pin every text, boundary, and constant. Integration tests flip the st - Name and ids. The Pack is `std` (crate `plugin-std`), Lua ids are `std/`, and model-facing names copy Cursor's. Rationale: one namespace for the file tools with the names models already know. The maintainer said: "what about std instead of core?", "std yes; the Lua names would be maybe std/read, std/write, std/grep, std/replace, std/rm ? the model facing names should match Cursor". - Access only through the VFS, with no shell and no user approval yet. Rationale: Mode and policy then gate every access for free. The maintainer said: "VFS for sure; leave out shell, we can decide it later; no user approval, we will add that later". - Text only. The maintainer said: "text only of course". - - Read and Grep behavior is the behavior in this plan, which follows the Read and Grep design reports in the runvil-design repository (`specs/cursor/master-read.md` and `specs/cursor/master-grep.md`) over Cursor's behavior. Rationale: the reports depart from Cursor on purpose (Read's cap is no longer an error, and Grep takes the bundle schema plus `literal`). The maintainer attached them as the context for this plan: "context: @runvil-design/specs/cursor/master-grep.md @runvil-design/specs/cursor/master-read.md". Where a report disagrees with this plan, this plan governs. + - Read and Grep behavior is the behavior in this plan, which follows the Read and Grep design reports over Cursor's behavior. Rationale: the reports depart from Cursor on purpose (Read's cap is no longer an error, and Grep takes the bundle schema plus `literal`). The maintainer attached them as the context for this plan. Where a report disagrees with this plan, this plan governs. - No cut splits a UTF-8 code point. Rationale: a split sequence turns into replacement characters or an invalid string. The maintainer said: "Read has to make sure not to split a UTF code point. Just update the design files". - Dotfiles are listed and searched, and only `.git` is skipped. Rationale: a model often needs to edit `.gitignore` and similar files. The maintainer said: "for the record, filtering dot files is stupid. one of the most useful things a model can do is stuff like edit .gitignore, and so on." - ListDir is added as `std/dir` with the shape in the Functional Specification. Rationale: Cursor explores directories through its shell and keeps a directory tool only behind a deprecated setting, so a Runvil model with no shell needs one. The maintainer asked "what about std/dir" and said "cursor has ListDir, and I am working on adding it to the report". @@ -374,7 +374,7 @@ Read, in `crates/plugin-std/src/read.rs` (entry) and `src/read/` (`args.rs`, `wi - A read that reaches the last line of the file prints no trailer, which includes the last page and every negative-offset tail read. - First-line cut: when the window's first line alone passes the cap, keep `clip_to_boundary(text, 0, cap - prefix_len - 1)` (99,992 bytes for a six-wide prefix and the default cap), print it numbered, show no other line, and make the trailer `[Line {n} is {bytes} bytes and is cut after {kept} bytes. No parameter reads the rest of a line.` followed by ` Use offset={n + 1} to continue.` when a later line exists in the file, then `]`. `bytes` is the line's full byte length and `kept` is the bytes kept, so ASCII gives `cut after 99992 bytes` and 3-byte characters give `cut after 99990 bytes`. This is the only cut inside a line. UTF-16 is decoded in full before the cut. - Notes, in this order, before the trailer: a UTF-16 file adds `[Note: the file is UTF-16LE and was decoded to text.]` (or `UTF-16BE`), and replaced bytes add `[Note: {n} invalid UTF-8 sequences in this file were shown as U+FFFD.]` using `plural(n, "invalid UTF-8 sequence")` for the count and noun, so one reads `1 invalid UTF-8 sequence`. -- Worked checks to reuse: 5,000 lines of 40 `x` give 2,083 numbered lines, the cap trailer above, and a length of at most 100,120 bytes. More worked examples are in `runvil-design/specs/cursor/master-read.md`; where one disagrees with this step, this step governs. +- Worked checks to reuse: 5,000 lines of 40 `x` give 2,083 numbered lines, the cap trailer above, and a length of at most 100,120 bytes. More worked examples are in the Read design report; where one disagrees with this step, this step governs. Definition and wiring: @@ -447,7 +447,7 @@ Definition and wiring: Tests: - Unit, `dir/tests.rs` and topic files: - - The POSIX tree. Seed `/home/dev/proj` with `README.md`, `package.json`, `docs/guide.md`, `src/app.tsx`, `src/index.ts`, and `src/utils/math.ts`, call with `{"target_directory": "/home/dev/proj"}`, and assert exactly this text (the parent report `runvil-design/specs/cursor/agent-file-tools.md` shows `package.json` before `README.md` because Cursor sorts with `localeCompare`; this plan's byte order governs, so `README.md` comes first): + - The POSIX tree. Seed `/home/dev/proj` with `README.md`, `package.json`, `docs/guide.md`, `src/app.tsx`, `src/index.ts`, and `src/utils/math.ts`, call with `{"target_directory": "/home/dev/proj"}`, and assert exactly this text (the parent report shows `package.json` before `README.md` because Cursor sorts with `localeCompare`; this plan's byte order governs, so `README.md` comes first): ```text /home/dev/proj/ - README.md