Skip to content

Define Engine, Harness and Host, enforce them in rulebooks, and rename the code to match - #104

Closed
vinniefalco wants to merge 12 commits into
cppalliance:masterfrom
vinniefalco:terminology-engine-harness-host
Closed

vinniefalco wants to merge 12 commits into
cppalliance:masterfrom
vinniefalco:terminology-engine-harness-host

Conversation

@vinniefalco

@vinniefalco vinniefalco commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

The words host, harness and engine had drifted: code, docs and rulebooks called the Harness "the engine's production host", so coding sessions read the Harness and the Host as one thing and built API layers on that. This PR gives the three words one meaning each, makes the rulebooks enforce it, and renames the code names and messages that still used "host" in another sense, so code and prose agree.

Breaking for Papergate: promptforge::vfs::HostBackend is now promptforge::vfs::RealBackend, with no alias. Papergate must update its import.

What changes

  • Definitions. The root AGENTS.md gets a ## Definitions section for Engine, Harness and Host, with the words to use for every other meaning (Engine globals, real files, machine, the embedding part, run/serve/embed/hold) and the names other tools define that stay as they are. The Roles bullets that restated the old meaning are gone.
  • Rulebooks. Statements that called the Harness a host or wrote today's session bindings down as rules are removed from the harness-sessions, workshop-server and harness-runner rulebooks and Invariants blocks; the other rulebooks are reworded.
  • Prose everywhere. Comments, facade pages, READMEs, the user guide, the cicerone plans, CI comments and the dated records in vibe/ now use "host" only for the application. Five guide headings change, with their links.
  • Capitalization. Engine, Harness and Host are capitalized in prose. Crate names, paths, identifiers, quotations and other senses (the gateway's speech engine, Rust's test harness) stay lowercase.
  • Guard. crates/workshop/ui/test/docs-claims.mjs now fails when a rulebook (every AGENTS.md, every .cursor/rules file, every ## Invariants crate doc) uses the words against the Definitions.
  • Code names. The real-directory backend, the Lua Engine-globals names, the Engine test-support names, two internal modules, the DOM container names in the TypeScript UIs and a few others now say what they are. Messages say "an Engine global", "Engine values" and "database" where they meant those.
  • Retired names. The retired-symbol scan lists nine more names, so the old ones cannot come back in live Engine source.

Commits

Commits 1 to 4 are the prose, rulebook and guard work. Commit 2 is case-only by construction, so reviewing commit by commit is easiest.

  1. Define Engine, Harness and Host and fix their use in prose: meaning fixes, about 520 files. Also adds the plan record vibe/2026-09-30-1-engine-harness-host-terminology.md.
  2. Capitalize Engine and Harness in prose: case-only, 262 files.
  3. Reword prose that names one crate or test scaffolding: 11 lines.
  4. Guard the Engine, Harness and Host terms in rulebooks: the test.

Commits 5 to 12 are the code renames, each with its own checks:

  1. Rename HostBackend to RealBackend: HostBackend is now RealBackend. HostAccess, HostRoot, identity_to_host and the vfs::host module change with it, and the mount fixtures in the tests use /mount. Also adds the plan record vibe/2026-09-30-2-host-identifier-rename.md.
  2. Refresh the vfs facade page for RealBackend: vfs.md, rewritten for the new name by the page tool. This is a near-total rewrite of one page, so it is easiest to review on its own.
  3. Rename the Lua Engine-globals names: inject_host is inject_values, install_host_apis is install_engine_globals, HostGlobal is EngineGlobal, and the module host is engine_globals. Reserved-name errors say "an Engine global" and the section VM errors say "Engine values". The guide quotation follows.
  4. Rename the Engine test-support Harness names: RunHost is RunHarness, and the host locals in the Engine tests are harness.
  5. Rename the internal modules named host and engine: performers-host.rs is performers-builtin.rs, and execute/engine.rs is walk_target.rs.
  6. Rename DOM container and test-helper names in the UIs: the modal and panel host option is container, LazyPanelHost is LazyPanelContainer, and the test helper harness() is setup().
  7. Retire the old host names and finish the rename: SyntheticHost is SyntheticMachine, HOSTED_OFFER is SERVED_OFFER, and database errors say "database". The retired-symbol scan gains HostBackend, HostAccess, HostRoot, identity_to_host, inject_host, inject_host_with_var, install_host_apis, host_injected and HostGlobal. The root AGENTS.md no longer says these names wait for a rename.
  8. Rename the remaining host names: one gateway deprecation message.

What stays

Names and messages that already mean the Host stay: HostSnapshot, set_host, "User input is unavailable in this host", and "this host provides none". Network and Cargo names (require_loopback_host, max_per_host, host_triple) stay as well.

Verification

Commits 1 to 4:

  • Every changed line in a code file is a comment or a Cargo description; no code file gains lines; the __impl_*.lua preludes keep their exact line counts (checked by script against the parent commit).
  • Commit 2 was checked line by line to differ from its parent only in letter case.
  • No link uses a renamed heading's old anchor.
  • After commits 1 and 2: cargo fmt --check, both clippy sets with -D warnings, the full nextest and doctest runs, workspace and facade cargo doc with -D warnings, cargo +nightly-2026-09-05 xtask api --check, cargo xtask site --books-only, and both npm suites all pass. The guard was shown to fail on a planted "production host" line.

Commits 5 to 12:

  • No code behavior changes beyond message text and one registry key (promptforge.engine.store_phase).
  • After the last commit, all 14 workspace gates pass (format, both clippy sets, nextest, doctests, docs, the API check, the site books and both npm suites), and so does the headless gateway check.
  • A search of every identifier that contains "host" finds only kept, network and Cargo names, and a search for the word in the vfs, Lua, Engine, facade and harness crates finds only the kept Host-sense strings.

The root `AGENTS.md` now defines Engine, Harness and Host in one `## Definitions` section, with the words to use for every other meaning. Comments, docs, rulebooks and dated records now use "host" only for the application that runs prompts through the Harness, and name the Harness, the Lua globals, the real filesystem, machines and embedding parts with their own words.

- Rulebooks lose the statements that called the Harness a host or fixed today's session bindings as rules: the pushed-binding and `LaunchOptions::vfs` invariants in `harness-sessions`, the binding and session-table invariants in `workshop-server`, and the `cancel::CancelHandle` invariant in `harness-runner`.
- Code files change only in comments and Cargo `description` strings. No code file gains lines, and the `__impl_*.lua` preludes keep their line counts.
- Guide headings in the old sense change, and their links follow, for example `#the-prompt-the-host-and-the-harness` and `#standard-lua-and-engine-calls`. The `guide/promptforge-*-guide.md` exports are regenerated.
- Identifiers, test names and message strings that contain "host" do not change.
Prose that names the Engine or the Harness now writes the word capitalized, as the root `AGENTS.md` Definitions require. Each changed line differs from its old form only in letter case, and code files change only in comments and Cargo `description` strings.

- Lowercase stays for crate names and paths (`harness-runner`, `promptforge-engine`), identifiers, string literals, quotations, and other senses such as the speech engine under `crates/gateway/stt/` and Rust's test harness.
- The `guide/promptforge-*-guide.md` exports are regenerated from the changed chapters.
Some lines used "engine" or "harness" for one crate or for test scaffolding, where the capitalized defined term would read wrong. They now name the crate, the walk, the Engine version, or the test server.

- `AGENTS.md` writes the single-public-crate pair as `promptforge` and `harness` and calls `promptforge-engine` the executor; `crates/promptforge-internal/engine/AGENTS.md` names the `promptforge-engine` module path.
- The comments for the frontmatter major version in `prompts.rs`, `run-api.ts` and `build-frontmatter.rs` now name the `promptforge:` key.
- Only comments change.
A new test in `docs-claims.mjs` reads every `AGENTS.md`, every `.cursor/rules` file, and the crate doc of every `lib.rs` or `main.rs` with `## Invariants`, and fails when one of them uses the three terms against the root `AGENTS.md` Definitions. Each finding names the file, the line, and the rule it breaks.

- The test fails on lowercase "host", on lowercase standalone "engine" or "harness", and on retired phrases such as "production host"; inline code, fenced code, and the Definitions section are skipped.
- Allowlists keep network and outside-tool phrases (`host-and-address`, self-hosted, GitHub-hosted) and other senses (speech engine, database engine, test harness); files under `crates/gateway/stt/` are exempt for "engine".
- `AGENTS.md` names the test as the enforcement of its rules.
`HostBackend` serves real directories. It does not stand for the Host. `promptforge::vfs::HostBackend` is now `promptforge::vfs::RealBackend`, and the old name has no alias. The vfs module `host` is now `real`, and its helper types, locals and test text follow.

- `HostAccess`, `HostRoot`, `identity_to_host`, `host_from` and `host_to` become `RealAccess`, `RealRoot`, `identity_to_real`, `real_from` and `real_to`.
- The read-only error text now says "the real backend is read-only". The lint reason in `lib.rs` now says "an operating-system notion".
- Tests that mounted a `MemoryBackend` at `/host` now use `/mount`. The Engine test `a_store_at_the_root_cannot_reach_a_mount_beneath_it` takes its new name from that mount.
- `public-api.txt` changes only in the 7 `HostBackend` lines. `vfs.md` changes only in names and two comments, so a later page refresh is separate.
`vfs.md` is rewritten for the new name `RealBackend`. The page has three tours and 29 Reference entries, and each tour's example compiles as a doctest. The diff covers most of the file, because the page is written fresh.

- Only `vfs.md` changes. No Rust source and no `public-api.txt` line changes.
The Lua module `host` installs the Engine's globals, so it never meant the Host. The module `host` is now `engine_globals`, and `inject_host`, `inject_host_with_var` and `install_host_apis` are now `inject_values`, `inject_values_with_var` and `install_engine_globals`. `HostGlobal`, `host_injected` and the Lua helper `host_type` become `EngineGlobal`, `values_injected` and `engine_type`.

- Reserved-name errors now say "an Engine global" in place of "a host global", and the section VM errors say "Engine values". The parser contract tests, the prelude tests and the quotation in `02-file-structure.md` follow, and `promptforge-language-guide.md` is regenerated.
- The registry key `promptforge.host.store_phase` is now `promptforge.engine.store_phase`.
- The Lua-sense test names, the `expect` texts and the prompt names `shared-host` and `shared-host-load` take the same words.
- Run behavior does not change. Only message text and the registry key string change.
`RunHost` stands in for the Harness in Engine tests, so its names now say Harness. `RunHost`, `run_with_host`, `run_host` and `delta_host` become `RunHarness`, `run_with_harness`, `run_harness` and `delta_harness`, and the module `host` in `test_support` becomes `harness`. Every local named `host` in the Engine crate follows.

- Test names and messages that meant the Harness now say Harness, such as `a_chat_round_streams_its_deltas_to_the_harness` and the assert text "the Harness's table".
- The doctest text in `effect.md`, `ids.md` and `transport.md` says Harness in the same places. The lint reason in `run.rs` now says "the public API".
- Strings that mean the Host keep the word host, and so does one Host-sense test name. No test logic changes.
The runner's `performers-host.rs` holds `LogTaskEvents`, `TokioTimer` and `VfsStore`, which the runner supplies itself. The file is now `performers-builtin.rs`, and its module `host` is now `builtin`. In the Engine, `execute/engine.rs` is now `execute/walk_target.rs`, and the module `engine` is now `walk_target`.

- Both file moves are pure renames, so file contents do not change. The re-exports `LogTaskEvents`, `TokioTimer` and `VfsStore` keep their paths.
- In the `execute.rs` header, the `walk_target` bullet moves to its alphabetical place after `tools`, and `mod walk_target;` sorts after `tools`.
- The four files that named `engine::` now name `walk_target::`.
The DOM element that holds a dialog or a panel is a container, not the Host. The `host` option of the modal and panel dialogs is now `container`, and `LazyPanelHost` is now `LazyPanelContainer`. The parameters and locals that hold that element take the name `container`, and the test helper `harness()` is now `setup()`.

- `harness.mjs` in the gateway config UI is now `test-support.mjs`, and its test importers follow.
- Check texts that named the Host now name the part: the chat box tests say "the owning part", the status bar tests say "the status bar", and the settings tests say "listener bind" in place of "hosting bind". The class `host-toolbar` is now `owner-toolbar`, and the unknown action `reboot-the-host` is now `reboot-the-machine`.
- Every caller of the renamed option changes in this commit, so the TypeScript build has no old name left. Network host names are unchanged.
`SyntheticHost` in the `build-llama-cuda` tests models a Windows machine, so it is now `SyntheticMachine`, and `HOSTED_OFFER` in the Foundry provider is now `SERVED_OFFER`. Database errors in the `harness-log` and `workshop-workspace` tests now say database, and one gateway test says "the native speech engine". `RETIRED_SEEDS` grows from 8 to 17 names, so the retired-symbol scan rejects the old host names in live Engine source.

- The root `AGENTS.md` drops the sentence that kept the old names until a rename landed, and "Cargo's host triple" now reads "Cargo's host and target vocabulary".
- The seed test now matches the full seed name in each violation text. Under the old substring match, `inject_host` shadowed `inject_host_with_var`, so the test could not name the longer seed.
- The retired names remain in `engine_guards.rs` as strings, because the scan needs them.
The deprecation text for the `[workshop]` section in `runner.rs` said the gateway "hosts" no workshop listener. It now says the gateway "runs" no workshop listener, so the word host keeps only the Host sense in this text.

- Only the message text changes. No test asserts it.
@vinniefalco vinniefalco changed the title Define Engine, Harness and Host and enforce them in rulebooks Define Engine, Harness and Host, enforce them in rulebooks, and rename the code to match Oct 1, 2026
@vinniefalco vinniefalco closed this Oct 1, 2026
@vinniefalco
vinniefalco deleted the terminology-engine-harness-host branch October 1, 2026 11:05

This branch was successfully deployed

1 active deployment
github-pages — 75ec912d Deployed Oct 1, 2026 by vinniefalco via deploy #48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant