Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions decisions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ The pages list 79 gaps and ask 118 questions. These ten gaps matter most.
- **Update of 2026-11-12.** The text on repositories was brought to `runvil` at `48a4dbc08` and `runvil-harness` at `5bca6f9`, where the Engine, Harness, and Plugin crates are in the `runvil-harness` repository and `runvil` pins four of them by commit. The history of `runvil-harness` was written a second time that day, to include the plan and vibe records of the Engine and the Harness, and commit `48a4dbc08` of `runvil` moved the pin to `5bca6f9` in that history. [Crates, build, and CI](crates-build-and-ci.md) has most of it: the two workspaces, their crates, the dependency rules, the place of each structural check, and the CI jobs, with one new entry on the pin. [Workshop: how the app is built](workshop-app.md), [Guides and docs](guides-and-docs.md), and [Prompts that ship](shipped-prompts.md) have the sentences that the move changed. Eight pages have a new Paths bullet, because the code they describe is in `runvil-harness`: [The prompt language](prompt-language.md), [Model calls and conversations](models-and-conversations.md), [Tasks and fanout](tasks-and-fanout.md), [Files and the VFS](files-and-the-vfs.md), [The Engine](engine.md), [The Harness and the Host API](harness-and-host.md), [Tools and Packs](tools-and-packs.md), and [Testing and debugging](testing-and-debugging.md). Each page lists its updated parts in its last section.
- **Update of 2026-11-13.** The text on Plugins, Packs, and file access by tools was brought to `runvil-harness` at `18361d02`, `runvil-workshop` at `f386801b`, `runvil-plugin-api` at `03a9fa3`, `runvil-plugin-std` at `ee04d10`, and `runvil-plugin-bashkit` at `9c8e980`. Workshop is in the `runvil-workshop` repository, which pins `runvil-harness` at `7147e709`, `runvil-plugin-std` at `782ad23`, and `runvil-plugin-bashkit` at `0864f1f`. The update is on [Tools and Packs](tools-and-packs.md) and on six more pages: [Files and the VFS](files-and-the-vfs.md), [The Harness and the Host API](harness-and-host.md), [Crates, build, and CI](crates-build-and-ci.md), [Workshop: how the app is built](workshop-app.md), [Testing and debugging](testing-and-debugging.md), and [Prompts that ship](shipped-prompts.md). The pages state three things. `web` and `mcp` enter a Host through a Rust `install` API, and one Plugin API through the C contract is planned work. The Plugin surface is unfinished and grows a piece at a time. The C contract reads files, and its functions that write and delete a file are still to be built. [Tools and Packs](tools-and-packs.md) gained one entry, on the `bash` Pack, one gap, on the two APIs, and two questions. Its list of places where the language guide differs from the code went from seven to one, after the same session corrected six of them in the working tree of `runvil-docs` over commit `c03ec91`. That session read the code and left the build and the tests unrun. Each page lists its updated parts in its last section.
- **Update of 2026-11-19.** The text on Plugins, Packs, and file access by tools was brought to `runvil-harness` at `ee199e3a`, `runvil-workshop` at `956e7800`, `runvil-plugin-api` at `52a4905`, `runvil-plugin-std` at `a806bf6`, and `runvil-plugin-bashkit` at `f348f7a`. Workshop pins `runvil-harness` at `4afed45f`, whose code is the code of `ee199e3a`, and the other three at the commits named here. Between the two updates a tool lost its file access: it asks its caller for each file operation, the Engine issues the operation as a `Vfs` effect, and the Harness performs it and records it. The C contract went from version 0.4 to 0.5 and gained six functions that change files, so the `std` tools Write, StrReplace, and Delete do their work and the shell of `bash` changes files. The conflict check applies in a store only, and a call of a tool that changes files runs alone, after the calls that the model listed before it. The update is on eight pages. [Files and the VFS](files-and-the-vfs.md) gained four entries, lost one gap and gained four, and lost two questions and gained one. [Tools and Packs](tools-and-packs.md) gained two entries and three gaps, and lost one question and gained three. [The Engine](engine.md) gained one entry, lost the eight questions that the owner answered, and gained two. [The Harness and the Host API](harness-and-host.md) gained two questions, and [Tasks and fanout](tasks-and-fanout.md) lost one, which the owner answered. [Testing and debugging](testing-and-debugging.md), [Workshop: how the app is built](workshop-app.md), and [Prompts that ship](shipped-prompts.md) have the counts they had. The owner's words on the new decisions are quoted from the decision pages of `runvil-harness` at `ee199e3a`. Two counts that were wrong before this change were corrected with it: the surface check allows three serde crates, in [Crates, build, and CI](crates-build-and-ci.md), and the Engine has seven internal crates, in [Testing and debugging](testing-and-debugging.md). The two entries of [Crates, build, and CI](crates-build-and-ci.md) on the pin and on Plugin crates were read against these commits and stand as the update of 2026-11-13 left them, and the gap on the language guide in [Tools and Packs](tools-and-packs.md) stays at the commits of that update. Those sessions read the code and left the build and the tests unrun. Each page lists its updated parts in its last section.
- **Update of 2026-11-24.** The text on streaming a reply was brought to `runvil-harness` at `5d9c7bf8` and `runvil-workshop` at `1b33d9f8`, where `InferenceBroker::chat` takes an `on_piece` callback and a Host sets `RunSetup::streaming`. Workshop pins `runvil-harness` at `5d9c7bf8`. The update is on three pages: [The Harness and the Host API](harness-and-host.md), [Model calls and conversations](models-and-conversations.md), and [Workshop: how the app is built](workshop-app.md). The pages state that the Harness hands a Host's callback each piece of a section's own model round, that the callback returns at once and never calls into the Harness, and that Workshop's launch code sets the callback and publishes each piece into the conversation. The three pages have the entry counts they had, and each page lists its updated parts in its last section. The verification list of each repository passes at those commits.
- **Still to update.** Four groups of text describe older code. The entries on installers, releases, and lints in [Crates, build, and CI](crates-build-and-ci.md) describe the code at the commits listed at the top, and gap 7 above names two workflows that `runvil` has since replaced with `installers.yml`. The text on sections, `jump` targets, and the `prompt` reads in [The prompt language](prompt-language.md) also describes that code, and so does the entry on `find_visible` in [The Engine](engine.md), which names four functions that `runvil-harness` at `ee199e3a` lacks. Gap 2 of [The Engine](engine.md) counts six parse error kinds in the language guide and six codes of `Prompt::parse`, and that page's summary repeats the six kinds, where `runvil-docs` at `1d28c66` and `runvil-harness` at `ee199e3a` each have five. Workshop moved to the `runvil-workshop` repository after the update of 2026-11-12, and the text outside the updates of 2026-11-13 and 2026-11-19 describes Workshop's crates as part of `runvil`: the workspaces, crate counts, families, pins, and checks in [Crates, build, and CI](crates-build-and-ci.md), and the Paths bullets and repository names of the pages that the update of 2026-11-13 left alone.

*2026-11-10 16:53 - Claude Fable 5.2*
14 changes: 9 additions & 5 deletions decisions/harness-and-host.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Update: the walk-through's sentence on filling the `PackRegistry` describes `runvil` at commit `b0693699d`, and the Paths bullet names the repositories as of `runvil` at `48a4dbc08` and `runvil-harness` at `5bca6f9`, after the Engine and the Harness moved (section 10)
- Update: the text on how a Host installs Plugins, on `runvil::plugin`, on `ready`, on `HostServices`, and two planned items describe `runvil-harness` at commit `18361d02`, `runvil-workshop` at `f386801b`, and `runvil-plugin-api` at `03a9fa3` (section 10)
- Update: the text on file operations as effects, on the files of a tool call, on the turn that the effect loop gives its executor, on the record of a tool's file operation, on a stop and a cancel of a tool call that asks for files, the sentence on `ToolFiles` and the count of re-exports in section 1, two planned items, and two questions describe `runvil-harness` at commit `ee199e3a` and `runvil-plugin-api` at `52a4905` (section 10)
- Update: the two entries on the inference broker and on streaming in section 4 describe `runvil-harness` at commit `5d9c7bf8` (section 10)
- Paths: code paths start at the `crates/` folder of `runvil-harness`, the repository of the Engine and the Harness, and a path that begins with `workshop/` starts at the `crates/` folder of `runvil-workshop`

## Summary
Expand Down Expand Up @@ -163,9 +164,9 @@ When the main chain, the run's root task, waits on its inbox of sent messages, `

## 4. Inference, the clock, and Host services

### The Host supplies model inference as an `InferenceBroker` with two methods
### The Host supplies model inference as an `InferenceBroker`

`InferenceBroker` is a trait with two methods. `models()` lists the models the Host offers. `chat(binding, messages, tools, options, round)` runs one model round and returns the finished reply, and the loop calls it for each `Chat` effect. The broker decides where it sends each round, so a Gateway change applies to the next round.
`InferenceBroker` is a trait with the methods `models()`, `supports_streaming()`, and `chat(binding, messages, tools, options, round, on_piece)`. `models()` lists the models the Host offers. `supports_streaming()` says whether the broker hands the pieces of a reply to `on_piece` as the reply forms. `chat` runs one model round, takes an optional callback for the reply's pieces, and returns the finished reply, and the loop calls it for each `Chat` effect. The broker decides where it sends each round, so a Gateway change applies to the next round.

The Host supplies inference so that the Host's broker owns the Gateway's URL, its key, and its model catalog, and `RunSetup` needs only the broker. [Model calls and conversations](models-and-conversations.md) covers the request a round sends.

Expand All @@ -175,11 +176,13 @@ Before it prepares the run, the Harness awaits `models()` until the broker answe

The map has one entry because `RunSetup` has one `selected_model`, and section 7 lists a model for each role as planned work. Workshop's broker uses the wait: it answers once its catalog has a chat-capable model.

### The broker returns each reply whole, and a Host streams inside its own broker
### A Host streams through a callback on its setup, and each Host owns its queue

`InferenceBroker::chat` returns one finished `Completion`. A Host that shows a reply as it forms streams the pieces from inside its broker. `GatewayBroker::chat_streaming` runs the same round and passes each `StreamDelta` to a callback. The record contains the finished reply, as an `assistant_reply` event, and omits the pieces.
A Host that shows a reply as it forms sets `RunSetup::streaming` to a callback. The Harness hands the callback each piece of a section's own model round, with the round, in the order the model produced the pieces. A round that a nested `models.infer` runs hands the Host its finished reply alone. The Harness passes every piece on, and it neither buffers nor skips one. A broker that streams calls the `on_piece` callback of `InferenceBroker::chat` once for each piece, never after the round ends, and `supports_streaming()` tells a Host whether its broker does, for its display. The record contains the finished reply, as an `assistant_reply` event, and omits the pieces.

The owner's rule: "the engine, the harness would not know anything about streaming. only the host, through the inference broker. and for headless hosts, they dont need to stream at all".
The callback is the simpler primitive, and each Host owns its queue. The Host chooses the queue's type, its capacity, what happens when it is full, and how much memory it may use, where a stream from the Harness would choose one answer for every Host. A Host that lags stops taking pieces in its own code, keeps the first part of the reply, and takes the rest from the finished reply.

The callback returns at once and never calls into the Harness. It runs inside the future that drives the run, so a callback that waits stalls every effect of the run. The Harness is not reentrant, so it promises nothing about a call to `RunControl::send`, `RunControl::stop_round`, or `RunControl::cancel` from the callback. A Host that reacts to a piece does so from its own code, outside the callback: the callback hands the piece to a channel, a flag, or a broadcast and returns, and the Host's own task then stops the round or cancels the run. A callback that panics ends its round as a broker that panics does: the Harness answers the round `Dropped`.

### The Host's `Timer` performs each sleep and stamps each run's start

Expand Down Expand Up @@ -348,5 +351,6 @@ Each question asks for the reason behind a part of the design.
- **Move.** On 2026-11-12 the Paths bullet was brought to `runvil` at commit `48a4dbc08` and `runvil-harness` at `5bca6f9`. Commit `adca9db10` of `runvil` removed the Engine, Harness, and Plugin crates, which are in `runvil-harness` with their history and at the same paths under `crates/`. Workshop, the Host in `runvil`, takes the `runvil` crate from that repository as a git dependency at a pinned commit ([Crates, build, and CI](crates-build-and-ci.md)). The text of the page still describes the code at the commits above, when those crates were in `runvil`.
- **Update.** On 2026-11-13 the text on Plugins and Host services was brought to `runvil-harness` at commit `18361d02`, `runvil-workshop` at `f386801b`, and `runvil-plugin-api` at `03a9fa3`. Workshop moved to the `runvil-workshop` repository after the commits of the Move note. The update covers the first paragraph of the walk-through, the entry on the one crate in section 1, the entries on `Host::parse` and on `ready` in section 2, the entry on `HostServices` in section 4, two items of section 7, and the Paths bullet. It states that `web` and `mcp` enter a Host through the Rust `install` API and that one Plugin API is planned work. That session read the code and left the build and the tests unrun. The rest of the page still describes the commits above.
- **Update.** On 2026-11-19 the text on the file operations of tool calls was brought to `runvil-harness` at commit `ee199e3a` and `runvil-plugin-api` at `52a4905`, where the C contract is at version 0.5. At those commits a tool call holds no file access: its tool asks for each file operation, the Engine issues the operation as a `Vfs` effect, and the Harness performs it and records it. The update covers two sentences of the summary, the fourth paragraph of the walk-through, the entries on the three layers and on the one crate in section 1, the entry on the `RunSetup` fields in section 2, the entries on the one future and on the `Vfs` effect in section 3, the entry on loop order in section 5, the entries on a stop and on a cancel in section 6, the items on replay and on small records in section 7, questions 13 and 14 of section 9, and the third Update bullet at the top of the page. It states that the loop returns to its executor once in every 32 file requests of tool calls, that the record of a tool's file operation holds the operation and a receipt of its outcome, and that a replay has to repeat the file requests of tool calls beside the answers and the messages. The crate `runvil` has 124 re-exports where it had 121, and `ToolFiles`, `VfsOp`, and `VfsOutcome` are the difference. The count of 17 Engine names that `runvil` omits was taken again and is the same: `VfsOp` and `VfsOutcome` left that group, and `VfsAsker` and `VfsReceipt` joined it. That session read the code and left the build and the tests unrun. The update leaves the rest of the page as it was.
- **Update.** On 2026-11-24 the two entries of section 4 on the inference broker and on streaming were brought to `runvil-harness` at commit `5d9c7bf8`, the head of pull request 76, where Workshop's pull request 38 at `runvil-workshop` commit `1b33d9f8` sets the callback. The update covers those two entries and the fourth Update bullet at the top of the page. It states that `chat` takes an optional `on_piece` callback and that `supports_streaming` is a required method, that a Host sets `RunSetup::streaming` and the Harness hands it each piece of a section's own model round with its round, that the callback returns at once and never calls into the Harness, and that a callback that panics ends its round as `Dropped`. At those commits the whole verification list of each repository passes. The rest of the page still describes the commits above.

*2026-11-10 16:41 - Claude Fable 5.2*
Loading
Loading