Repository navigation
Consolidate test suites and tighten recombined modules - #90
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidate test builders, table-drive repetitive test suites, and tighten the newly recombined Engine, Harness, and Plugin modules against
rust-rulebook.md.Commits
ba87f4bb- Consolidate test builders and table-drive test suites (189 files changed, 14,009 insertions(+), 23,991 deletions(-),-9,982net test lines):harness-plugin-loader(-1,829net lines,+51edge cases): Added#![cfg(test)]tofakes.rs, unified curried C callback wrappers (refuse,add_tool,ctx), replaced 15ask_*/*_answerhelpers withFileReq+FileReply, added closure-drivenscripted_entry(script_load,script_pack_new,script_render,script_step) that assertscontract_holdson every verb, addedCallPoller, sharedbad_tool_info_cases()betweenRV_PACK_NEWandRV_PACK_RENDER, replaced 79 single-case macro expansions with table loops, and replacedDebug-string serialization infile-tests.rswith typedrun_file_scriptand an all-9-callback C-ABI matrix (all_file_callbacks).harness-runner,plugin-mcp,harness-gateway-client,runvil(-1,417net lines,+21edge cases): ConsolidatedHookedRecorder,FailingRecorder,ModelsBroker,ScriptedBroker::asked,lua_prompt,prompt_using,spawn_mcp_router,await_failed_start,ready_github,SuiteBroker, andassert_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,446net lines): Added#![cfg(test)]to pure test-support modules, addedScenario::{one, sections, declaring, with_cancel, into_rig},StepRig, andTrace/ScriptedChatquery accessors (lua_logs,loop_details,tool_results,task_observations,reply_turns,tool_contents,user_prompts,last_tool_contents), deleted 5 customObserverrecorder structs, replaced raw multi-line YAML frontmatter string literals, table-drovesubst-tests.rsandexit_rules.rs, extendedrunvil-engine's facadeScenariowith tool-file receipt handling (deletingsuite/vfs.rs's 110-line custom driver), and removed test-onlyusedeclarations from production modules.runvil-lua,runvil-prompt,runvil-vfs,runvil-types,runvil-model-client(-3,296net lines,+178edge cases/parity assertions): PromotedBuiltVm::{refusal, assert_values, assert_raises, assert_block_raises},TestVm::{with_libraries, with_empty_require}, andfor_each_vm_seedintotest_vm.rs; unifiedstore.readandstore.read_numberedslice/error matrices; added protocol table runners (assert_ok_answers,assert_parsed_requests,assert_refused_yields); consolidatedSPAN_REFUSALSand wired automaticaccept_argsvsaccept_args_valueparity across 100% of JSON test inputs infrontmatter-tests-args-check.rs; and addedassert_capability_semantics,assert_backend_crud_parity, andassert_all_ops_refusedinvfs/src/test_support.rs.93043245- Tighten ownership, imports, and helpers after recombination (31 files changed, 212 insertions(+), 251 deletions(-)):usedeclarations into threerustfmt-ordered blocks (std, external crates,crate/super/self) and cleaned up stale submodule references across the recombined files.glob_matchinvfs/src/glob.rs,neutralizeintypes/src/untrusted.rs, andresolve_libraryinruntime/src/section_path.rs) out of production module scope into their test modules.VfsRef::acquire_accessinvfs/src/handle.rsto deduplicateVfsRef::acquire_withandStore::view, and computedlogical(&path)once per arm inrespell_error.Vec<Option<(ChainIndex, SpawnRecord)>>inAdmission::plan, eliminated the extraVec<&ToolId>inmake_unbound_tool_call_error, and pre-sizedHELD_AT_ONCEon the stack viastd::array::from_fninSectionVm::new.