Skip to content

refactor(run): split src/run.rs into submodules (#57, 1/3)#62

Merged
Metbcy merged 1 commit into
mainfrom
refactor/split-run-rs-57
Jun 1, 2026
Merged

refactor(run): split src/run.rs into submodules (#57, 1/3)#62
Metbcy merged 1 commit into
mainfrom
refactor/split-run-rs-57

Conversation

@Metbcy
Copy link
Copy Markdown
Owner

@Metbcy Metbcy commented Jun 1, 2026

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

file LOC purpose
mod.rs 34 dispatch + public re-exports
baseline.rs 66 baseline subcommand
calibration.rs 231 --debug-calibration emission
diff.rs 467 diff subcommand (the real work)
init.rs 90 init subcommand + scaffolding
predicates.rs 56 tripped / any_kev / budget_tripped
tests.rs 417 unit tests, #[cfg(test)]

Largest remaining file in the split: diff.rs at 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 via pub use in mod.rs (lib.rs:28 unmodified). Crate-private CalibrationOverrides / CalibrationScore / CalibrationThreshold / write_calibration_row preserved via pub(crate) use.

Verification

  • cargo check — clean
  • cargo clippy --all-targets -- -D warnings — clean
  • cargo test --lib429 passed, 0 failed
  • cargo fmt — applied

Pure mechanical split. No rename of items, no behavior change, no dead code removal. enrich/maintainer.rs (1284 LOC) and render/sarif.rs (1205 LOC) follow as separate PRs against #57.

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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

Coverage report

Line 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; --fail-under-lines will be added once coverage is visible across 2–3 releases.

@Metbcy Metbcy merged commit 5f6daff into main Jun 1, 2026
10 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