Skip to content

Drop size caps and recombine split modules and types - #89

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

vinniefalco merged 1 commit into
cppalliance:masterfrom
vinniefalco:master

Conversation

@vinniefalco

Copy link
Copy Markdown
Member

Remove the type_size check in build-xtask (MAX_FIELDS = 12 and MAX_METHODS = 25) and the too-many-lines-threshold and too-many-arguments-threshold caps in clippy.toml and Cargo.toml. Recombine the modules, types, and methods across the Engine, Harness, and Plugin crates that were split across files and helper types to satisfy those caps, and remove borrow-checker-evading clones and allocations.

Summary of Changes

  • Production footprint (374 files changed, 25,459 insertions(+), 37,330 deletions(-), -11,871 net lines):
    • Production .rs files reduced from 247 to 136 (-111 production files, -44.9%, plus crates/build-xtask/src/type_size.rs removed).
    • Non-comment, non-blank production Rust code lines reduced from 38,922 to 35,969 (-2,953 code lines, plus -758 in build-xtask), production functions/methods from 2,570 to 2,291 (-279), and production structs/enums from 500 to 429 (-71).
    • Zero changes to crates/runvil-engine/public-api.txt or crates/runvil/public-api.txt.
  • Harness & Plugin crates (harness-runner, harness-plugin-loader, plugin-mcp, harness-gateway-client, runvil-plugin):
    • Recombined Driver<'a> in effect_loop.rs (InboxState, StepFlow, InlineVfs, handle_pending, and reconcile_step folded in; RunSetup and RunControl borrowed directly), unified Flights onto a single BTreeMap<EffectId, Flight> with extract_if, removed ToolPerformer and drive_run (eliminating double-boxed ToolCall and Render futures), and folded prepare.rs, environment.rs, setup.rs, performers_offline.rs, recorder_memory.rs, and packs_builtin.rs into their owning modules (15 -> 9 files).
    • In harness-plugin-loader (10 -> 6 files): stack-allocated Session inside session::open, keyed Session directly by RvVerb with const-generic refuse / add_tool / file_* C callbacks, compressed Steps<'a> onto Phase<'a> and borrowed tool: &'a str, deleted EntryFactory and Offered, and folded load.rs, host.rs, resources.rs, and park.rs.
    • In plugin-mcp (6 -> 4 files) and harness-gateway-client (9 -> 3 files): unified Servers / Namespace / Status / Server, streamed Ready directly in list_ready, folded connect.rs and result.rs into server.rs, deleted WireLlamaTimings and the 4 private conversion traits in convert.rs, and folded catalog.rs, config.rs, fail.rs, metrics.rs, resources.rs, and timer.rs.
  • Engine crates (runvil-runtime, runvil-lua, runvil-vfs, runvil-prompt, runvil-types, runvil-model-client, runvil-markdown):
    • In runvil-runtime (41 -> 18 files): dissolved ChainOps and chain_ops.rs onto Chain and Scheduler, deleted vfs_record.rs and the 14 *Record serde mirror types (building sorted-key serde_json::Value directly in Effect::record and EffectAnswer::record without double-cloning VfsOp/VfsOutcome), deleted Scheduler::prompt_of via disjoint Chain field borrows, deleted SectionVmSetup, VmSeed, RunSets, ArrivedRound, Scope, Settled, Served, Sources, Dispatched, ChainStep, and Outstanding, and consolidated the 18-file execute/scheduler/ tree into 8 concept files.
    • In runvil-lua (68 -> 36 files): folded vm/{inject,install,run,state}.rs into src/vm.rs, folded models_loop/machine.rs into src/models_loop.rs (moving CancelHook and LoopGuard onto Machine and deleting Input<V>), eliminated MessageList::to_records / Snapshot::to_records full-conversation clones and ToolCallCounts::snapshot full-map clones, deleted RecordRole, VmShare, VAR_GUARDED_DATA_REGISTRY, and the raised_from reverse error parser, and consolidated json/*, tools/*, markdown/*, protocol/*, globals/*, and bindings/*.
    • In runvil-vfs (33 -> 18 files), runvil-prompt (16 -> 8 files), runvil-types (22 -> 15 files), runvil-model-client (9 -> 4 files), and runvil-markdown (11 -> 8 files): deleted StoreScoped (relativizing errors in Access), consolidated vfs/src/{handle,traits,real}/, scanned CommonMark once in PromptBody::scan with KeySeed and a single reusable &mut String path buffer in args_check, macro-drove ErrorCode, and flattened CONTROL_MARKUP.

Remove the `type_size` check in `build-xtask` and the `too_many_lines` and `too_many_arguments` limits in `Cargo.toml` and `clippy.toml`. Recombine the modules, types, and methods across the Engine, Harness, and Plugin crates that were split across files and helper types.

- Remove `ToolPerformer`, `drive_run`, `StoreScoped`, `ChainOps`, `vfs_record.rs`, `RecordRole`, `raised_from`, and `WireLlamaTimings`, and build `Effect::record` and `EffectAnswer::record` values directly.

- Stack-allocate `Session` in `session::open`, project `MessageList` and `Snapshot` records without cloning `Vec<MessageRecord>`, and borrow fields directly in `Driver`, `SectionVm`, `Machine`, `Chain`, and `Access`.
@vinniefalco
vinniefalco merged commit 4425603 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