Skip to content

feat(cli): add --min-coverage threshold - #423

Open
rodboev wants to merge 4 commits into
NVIDIA:mainfrom
rodboev:pr/min-coverage-389
Open

feat(cli): add --min-coverage threshold#423
rodboev wants to merge 4 commits into
NVIDIA:mainfrom
rodboev:pr/min-coverage-389

Conversation

@rodboev

@rodboev rodboev commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Added --min-coverage FLOAT as an opt-in CLI gate over the existing canonical coverage percentage. A below-threshold scan exits 1 after writing its normal report.

Changes

  • Validate finite thresholds in the CLI's existing option framework.
  • Use strict less-than semantics, so equality passes.
  • Apply the same policy to single scans, each recursive child, and the recursive aggregate scope.
  • Fail closed when enabled coverage is missing or non-numeric, while preserving execution and existing gate precedence.

Preserved

Default behavior, --fail-on-incomplete, risk scoring and recommendation, output schemas, ledger coverage computation, and registry-mode boundaries remain unchanged.

Validation

Focused CLI tests cover threshold boundaries, recursive children and aggregate scope, invalid values, output-before-exit, missing coverage, precedence, and schema preservation. Verification completed: 112 passed, ruff check passed, ruff format --check passed, and git diff --check passed.

Related

Closes #389. PR #393 supplies the separate --fail-on-incomplete behavior.

Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>
Signed-off-by: Rod Boev <rod.boev@gmail.com>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SkillSpector Review]\n\nApproved. The coverage threshold validates finite values in range, fails closed on absent or non-numeric coverage, uses strict less-than semantics, and composes correctly with recursive and existing exit-code behavior. Current required checks pass.

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.

Coverage is computed but never affects the exit code: a partially-blind scan is indistinguishable from a complete one in CI

2 participants