Skip to content

fix(quality): share quality default across CLI and library gates - #447

Merged
rng1995 merged 9 commits into
NVIDIA:mainfrom
lxcxjxhx:fix/quality-default-min-score
Nov 13, 2026
Merged

rng1995 merged 9 commits into
NVIDIA:mainfrom
lxcxjxhx:fix/quality-default-min-score

Conversation

@lxcxjxhx

@lxcxjxhx lxcxjxhx commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Use QUALITY_DEFAULT_MIN_SCORE for the six CLI default/fallback sites and the four library defaults in QualityScoreValidator, run_validation, run_quality_check, and run_rubric_eval. Plugin quality checks inherit the same default. The default remains 70 and explicit min_score overrides keep working. Changing the shared constant before importing these consumers now changes their defaults consistently.

Validation

  • 343 quality policy and quality validator tests passed.
  • Added a fresh-process regression that changes the shared default to 67 and checks actual pass/fail behavior for a 67.8-score skill through direct validation, plugin composition, run_quality_check, and run_validation; an explicit threshold of 80 still fails. The regression failed before the library fix and passes afterward.
  • Changed-file Ruff lint and formatting checks and git diff --check passed.
  • Follow-up fix received an independent review; commits are signed off.

The original contribution identified the six CLI sites by scanning for unused module-level constants; unrelated constants remain untouched. No default score or public option changed.

`constants.py` defines `QUALITY_DEFAULT_MIN_SCORE = 70`, and nothing reads it:
all six places that set the default wrote the number. Changing the constant had
no effect, which is the kind of dead knob that costs a reader an afternoon.

The six sites are one semantic value, the quality pass mark:

- `cli.py` params merge: `params.get("min_score", 70)` and `min_score != 70`
- `--min-score` on the tier1 group, `quality-check`, `rubric-eval`
- `--min-score` on `validate` (the `IntRange` form)

The value is identical, so behaviour is unchanged. Found by scanning for
module-level constants whose name appears exactly once in the repository.

Signed-off-by: lxcxjxhx <[email protected]>

@chrisknvidia chrisknvidia 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.

Thanks for this. I went through all six sites and they are the same value and type, so behavior is unchanged: --help still shows [default: 70], the golden CLI snapshot pins it, and CI is green.

One thing to finish before merge: the PR's point is that editing QUALITY_DEFAULT_MIN_SCORE should now change the default, but the pass mark is still a literal 70 in QualityScoreValidator.__init__ (validators/quality_score.py) and in run_validation, run_quality_check and run_rubric_eval (tier1/commands.py). tier1/plugin_checks.py calls QualityScoreValidator() with no argument, so the plugin quality gate would stay at 70 after someone changes the constant. Using the constant in those four signatures (the modules already import from skillevaluator.constants) would close it, or you could narrow the description to say only the CLI flags are wired.

Optional: a small test asserting the CLI defaults and those signature defaults all equal the constant, so they can't drift apart again. The CI onboarding code and the docs also quote 70, which is fine to leave, but a comment next to the constant saying so would help the next reader.

Comment thread src/skillevaluator/cli.py Resolved

@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.

Automated review: 0 findings (0 P1, 0 P2, 0 P3); 0 posted inline.

Checked all six edited sites in src/skillevaluator/cli.py against base: the params merge and the four --min-score options resolve to the same value as before, and --help still shows [default: 70]. Setting QUALITY_DEFAULT_MIN_SCORE to 80 in a scratch copy moved the four --min-score defaults (as shown in --help for validate, tier1 validate, quality-check and rubric-eval) and the params-merge fallback to 80.
The library defaults (QualityScoreValidator(), the plugin quality check, run_validation, run_quality_check, run_rubric_eval) stay at 70 in that copy; this is the gap raised in the earlier review, so there is no separate comment for it here.
Tests run: tests/golden/test_cli_surface.py, tests/test_commands.py, tests/cli/test_tier_workflows.py, tests/test_quality_policy_gate.py, tests/validators/test_quality_score.py (535 passed); tests/test_cli.py, tests/validators/test_private_plugin_composition.py, tests/validators/test_rubric_eval.py (231 passed, 1 skipped). ruff check and ruff format --check pass on cli.py.
The branch is 5 commits behind main (487910e) and merges cleanly.

@rng1995
rng1995 enabled auto-merge (squash) November 12, 2026 19:51
@rng1995
rng1995 disabled auto-merge November 12, 2026 19:51
@rng1995
rng1995 enabled auto-merge (squash) November 12, 2026 20:16
@rng1995 rng1995 changed the title fix(quality): read QUALITY_DEFAULT_MIN_SCORE instead of six 70 literals fix(quality): share quality default across CLI and library gates Nov 13, 2026

@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.

Thank you @lxcxjxhx for your contribution and for your patience throughout the review process. The remaining review feedback is addressed in 2e32866: the shared default now controls the library and plugin gates as well as the CLI. Verified 343 quality tests, including a failing-before/passing-after behavioral regression, Ruff lint/format checks, and an independent review. The default remains 70 and explicit overrides work. Approved; auto-merge remains subject to required CI checks.

@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.

Thank you @lxcxjxhx for your contributions and for your patience throughout the review process. Re-approving after merging current main in 48d2bd0 and resolving the quality validator import conflict by retaining both constants. The shared quality defaults and main’s configurable quality rules, provenance loading, token estimates, and CLI changes are preserved. Verified 505 focused quality/configuration, CLI workflow, CLI snapshot, and stdout-encoding tests, changed-file Ruff lint/format checks, a clean PR-relative diff check, and an independent review. Auto-merge remains subject to required CI checks.

@rng1995
rng1995 merged commit d40b0e2 into NVIDIA:main Nov 13, 2026
25 of 26 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.

3 participants