refactor(run): split src/run.rs into submodules (#57, 1/3)#62
Merged
Conversation
src/run.rs (1326 LOC) was the largest file outside enricher data tables and well over the module size budget set in PR #49. Split into src/run/ with one submodule per concern: mod.rs 34 LOC dispatch + public re-exports baseline.rs 66 LOC baseline subcommand calibration.rs 231 LOC --debug-calibration emission diff.rs 467 LOC diff subcommand (the real work) init.rs 90 LOC init subcommand + scaffolding predicates.rs 56 LOC tripped / any_kev / budget_tripped tests.rs 417 LOC unit tests, gated #[cfg(test)] Pure mechanical split. No public API changes — crate::run::{run, tripped, any_kev, any_epss_at_or_above, budget_tripped, FAIL_ON_EXIT_CODE} still resolve via pub use in mod.rs. Crate- private CalibrationOverrides / CalibrationScore / CalibrationThreshold / write_calibration_row preserved via pub(crate) use. 429 lib tests pass. cargo clippy --all-targets -D warnings clean. Addresses one of three files called out in #57; maintainer.rs and sarif.rs to follow as separate PRs.
Coverage reportLine coverage: 84.3% (9717 / 11532 lines) Full lcov report available as workflow artifact coverage-lcov: download from this run. v0.9.8 introduces this report; |
This was referenced Jun 1, 2026
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.
Addresses #57 — module size budget round 2.
src/run.rs was 1326 LOC, the largest file outside enricher data tables and well over the budget set in PR #49.
Split
mod.rsbaseline.rscalibration.rs--debug-calibrationemissiondiff.rsinit.rspredicates.rstripped/any_kev/budget_trippedtests.rs#[cfg(test)]Largest remaining file in the split:
diff.rsat 467 LOC.Public API
No changes.
crate::run::{run, tripped, any_kev, any_epss_at_or_above, budget_tripped, FAIL_ON_EXIT_CODE}still resolve viapub useinmod.rs(lib.rs:28 unmodified). Crate-privateCalibrationOverrides/CalibrationScore/CalibrationThreshold/write_calibration_rowpreserved viapub(crate) use.Verification
cargo check— cleancargo clippy --all-targets -- -D warnings— cleancargo test --lib— 429 passed, 0 failedcargo fmt— appliedPure mechanical split. No rename of items, no behavior change, no dead code removal.
enrich/maintainer.rs(1284 LOC) andrender/sarif.rs(1205 LOC) follow as separate PRs against #57.