Skip to content

Consolidate test suites and tighten recombined modules - #90

Merged
vinniefalco merged 2 commits into
cppalliance:masterfrom
vinniefalco:master
Dec 1, 2026
Merged

vinniefalco merged 2 commits into
cppalliance:masterfrom
vinniefalco:master

Conversation

@vinniefalco

Copy link
Copy Markdown
Member

Consolidate test builders, table-drive repetitive test suites, and tighten the newly recombined Engine, Harness, and Plugin modules against rust-rulebook.md.

Commits

  1. ba87f4bb - Consolidate test builders and table-drive test suites (189 files changed, 14,009 insertions(+), 23,991 deletions(-), -9,982 net test lines):

    • harness-plugin-loader (-1,829 net lines, +51 edge cases): Added #![cfg(test)] to fakes.rs, unified curried C callback wrappers (refuse, add_tool, ctx), replaced 15 ask_* / *_answer helpers with FileReq + FileReply, added closure-driven scripted_entry (script_load, script_pack_new, script_render, script_step) that asserts contract_holds on every verb, added CallPoller, shared bad_tool_info_cases() between RV_PACK_NEW and RV_PACK_RENDER, replaced 79 single-case macro expansions with table loops, and replaced Debug-string serialization in file-tests.rs with typed run_file_script and an all-9-callback C-ABI matrix (all_file_callbacks).
    • harness-runner, plugin-mcp, harness-gateway-client, runvil (-1,417 net lines, +21 edge cases): Consolidated HookedRecorder, FailingRecorder, ModelsBroker, ScriptedBroker::asked, lua_prompt, prompt_using, spawn_mcp_router, await_failed_start, ready_github, SuiteBroker, and assert_bounded_clean_diagnostic, and table-drove pre-start error, closed-send, uses: resolution, MCP redirect (301/302/307/308), and metadata degradation checks.
    • runvil-runtime & runvil-engine (-3,446 net lines): Added #![cfg(test)] to pure test-support modules, added Scenario::{one, sections, declaring, with_cancel, into_rig}, StepRig, and Trace / ScriptedChat query accessors (lua_logs, loop_details, tool_results, task_observations, reply_turns, tool_contents, user_prompts, last_tool_contents), deleted 5 custom Observer recorder structs, replaced raw multi-line YAML frontmatter string literals, table-drove subst-tests.rs and exit_rules.rs, extended runvil-engine's facade Scenario with tool-file receipt handling (deleting suite/vfs.rs's 110-line custom driver), and removed test-only use declarations from production modules.
    • runvil-lua, runvil-prompt, runvil-vfs, runvil-types, runvil-model-client (-3,296 net lines, +178 edge cases/parity assertions): Promoted BuiltVm::{refusal, assert_values, assert_raises, assert_block_raises}, TestVm::{with_libraries, with_empty_require}, and for_each_vm_seed into test_vm.rs; unified store.read and store.read_numbered slice/error matrices; added protocol table runners (assert_ok_answers, assert_parsed_requests, assert_refused_yields); consolidated SPAN_REFUSALS and wired automatic accept_args vs accept_args_value parity across 100% of JSON test inputs in frontmatter-tests-args-check.rs; and added assert_capability_semantics, assert_backend_crud_parity, and assert_all_ops_refused in vfs/src/test_support.rs.
  2. 93043245 - Tighten ownership, imports, and helpers after recombination (31 files changed, 212 insertions(+), 251 deletions(-)):

    • Grouped use declarations into three rustfmt-ordered blocks (std, external crates, crate/super/self) and cleaned up stale submodule references across the recombined files.
    • Moved remaining test-only functions (glob_match in vfs/src/glob.rs, neutralize in types/src/untrusted.rs, and resolve_library in runtime/src/section_path.rs) out of production module scope into their test modules.
    • Factored VfsRef::acquire_access in vfs/src/handle.rs to deduplicate VfsRef::acquire_with and Store::view, and computed logical(&path) once per arm in respell_error.
    • Removed the temporary Vec<Option<(ChainIndex, SpawnRecord)>> in Admission::plan, eliminated the extra Vec<&ToolId> in make_unbound_tool_call_error, and pre-sized HELD_AT_ONCE on the stack via std::array::from_fn in SectionVm::new.

Add shared test builders, query helpers, and table-driven matrices across the Engine, Harness, and Plugin test suites. Remove test-only `use` declarations from production modules.

- Add `scripted_entry`, `CallPoller`, `FileReq`, and `all_file_callbacks` in `harness-plugin-loader` (`fakes.rs`), checking `contract_holds` across every verb and all 9 `file_*` callbacks and sharing `bad_tool_info_cases` between `RV_PACK_NEW` and `RV_PACK_RENDER`.

- Add `StepRig`, `Scenario::one`, `Scenario::sections`, `Trace` and `ScriptedChat` query accessors, `BuiltVm::assert_values` and `assert_raises`, `assert_capability_semantics`, and `assert_backend_crud_parity`, and assert `accept_args_value` parity across `frontmatter-tests-args-check.rs`.
Group imports into three blocks, move test-only helpers into test modules, and remove intermediate allocations across the recombined Engine and Harness files.

- Deduplicate `VfsRef::acquire_with` and `Store::view` through `VfsRef::acquire_access` and compute `logical(&path)` once per arm in `respell_error`.

- Remove the temporary `Vec<Option<(ChainIndex, SpawnRecord)>>` in `Admission::plan`, pre-size `HELD_AT_ONCE` on the stack in `SectionVm::new`, and move `glob_match`, `neutralize`, and `resolve_library` into their test modules.
@vinniefalco
vinniefalco merged commit 9304324 into cppalliance:master Dec 1, 2026
13 checks passed
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