Skip to content

Trim three pieces of Engine surface - #201

Closed
sykosyber wants to merge 4 commits into
cppalliance:masterfrom
sykosyber:mateo/engine-surface-trims
Closed

sykosyber wants to merge 4 commits into
cppalliance:masterfrom
sykosyber:mateo/engine-surface-trims

Conversation

@sykosyber

Copy link
Copy Markdown
Contributor

Three removals, one commit each. No behavior change, no replacement facility needed. The plan is vibe/2026-11-06-1-engine-surface-trims.md.

What and why

  • Stop exporting OpSink from runvil-vfs: zero users outside the crate, in production or in tests, and it is not in the facade or public-api.txt. It narrows to pub(crate) because three in-crate items still name it.
  • Delete prompt::detail::parse_error: a forwarder, one call to runvil_types::error::failure with its arguments unchanged. Its two callers (Scheduler::check_start and one test) now call failure directly.
  • Inline install_normalize_failure into install_shims: a single caller, and the body was lua.create_function(normalized). normalized already carries the contract.

Tests and gate results

No new tests, because no behavior changes. The existing tests cover each call site.

All gates from AGENTS.md "Verification" pass on this branch with no new warnings: both clippy runs with CARGO_BUILD_WARNINGS=deny, fmt, both doc runs, both nextest runs, xtask api --check (the pinned nightly, so public-api.txt is unchanged), cargo test -p build-xtask, and docs-claims.mjs. Results match unmodified master 8bb2b2ef.

The three commits also apply cleanly on top of #200, and install_shims stays under the new 100-line clippy limit after the inline (checked by merge, not a full gate run on #200).

One thing to know when running the main nextest suite on Windows with the repo and the temp directory on different drives: build-workshop::cancellation fails with CrossesDevices because it renames a pre-staged sidecar into the temp directory. It fails the same way on unmodified master and is unrelated to this change. With TEMP on the repo's drive, all 4168 tests pass on master and on this branch.

Left out on purpose

  • coro::block_guard is not inlined. Its registry key is private to coro.rs, which stores and reads it, so inlining at the one caller in vm/run.rs would make the key pub(crate) to save three lines.
  • Gating the test-only runvil-lua exports (ErrorField, error_fields, RESERVED_NAMES) behind test-support. The definitions need the same cfg as the export, because dead code fails the deny-warnings gate, so it is more than a trim.
  • runvil-types, which has other work in flight.

🤖 Generated with Claude Code

sykosyber and others added 4 commits November 6, 2026 04:41
`OpSink` is the alias for the observer closure that `VfsRefBuilder::on_op` accepts as `impl Fn(OpEvent<'_>)`. No crate outside `runvil-vfs` names it, in production or in tests, and it is not in the facade, so the root re-export only widened the crate's surface. It narrows to `pub(crate)` because `Volume`, `VfsRef::from_router`, and `VfsRefBuilder` still name it.

- `lib.rs` re-exports `OpEvent` and `Origin` only, and `observe.rs` declares `OpSink` as `pub(crate)`.
- This removes surface and adds none. No replacement facility is needed, because the public builder never took the alias.
- `crates/runvil/public-api.txt` does not change.

Design: removes surface-growth @ crates/runvil-internal/vfs/src/observe.rs::OpSink boundary: pub
Deferred: Moving the test-only `runvil-lua` exports behind `test-support` waits, because the definitions need the same `cfg` and dead code fails the gate.
Plan: vibe/2026-11-06-1-engine-surface-trims.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`parse_error` was one call to `runvil_types::error::failure` with its two arguments passed on unchanged. The scheduler's `check_start` and one test in `runvil-engine` called it, and both now call `failure` directly, as the rest of `runvil-engine` already does. `detail` in `runvil-prompt` goes from six items to five, and `detail.rs` no longer imports `ErrorCode`.

- `check_start` builds the missing-version failure with `failure(ErrorCode::StructureInvalid, ...)` and still hands it to `with_prompt_context`, so the failure is the same value with no location.
- `a_parse_failure_run_raises_names_the_prompt_and_its_file` builds its input with `runvil_types::error::failure`.
- This removes a facility and adds none. `failure` was already the facility, and the forwarder only renamed it.

Design: removes shim @ crates/runvil-internal/prompt/src/detail.rs::parse_error deps: Error,ErrorCode boundary: pub
Plan: vibe/2026-11-06-1-engine-surface-trims.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`install_normalize_failure` was `lua.create_function(normalized)`, and `install_shims` was its only caller. `install_shims` now makes that function itself with the same `map_err(error::lua)`, and `error_value` re-exports `normalized` alone. `normalized` already carries the contract the installer's doc restated, what the `normalize_failure` capture returns, and the `error_value` module doc now names it where it named the installer.

- `install_shims` builds the capture with `lua.create_function(normalized)` and keeps the `normalize_failure` local that the shim chunk receives.
- `error-value-classify.rs` drops the installer and its `Function` import. Nothing else in the crate changes.
- This removes a function and adds none. No replacement facility was needed, because `normalized` is the capture's whole body.
- `coro::block_guard` stays. Its registry key is private to `coro.rs`, which stores and reads it, so inlining it into `vm/run.rs` would widen that key to move three lines.

Design: removes pure-function @ crates/runvil-internal/lua/src/error-value-classify.rs::install_normalize_failure deps: Lua
Deferred: `coro::block_guard` is not inlined, because its registry key would need `pub(crate)` for one caller.
Plan: vibe/2026-11-06-1-engine-surface-trims.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Plan: vibe/2026-11-06-1-engine-surface-trims.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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