Repository navigation
fix(quality): share quality default across CLI and library gates - #447
Conversation
`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
left a comment
There was a problem hiding this comment.
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.
rng1995
left a comment
There was a problem hiding this comment.
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.
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
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.
Signed-off-by: Narendran Raghavan <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
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.
Summary
Use
QUALITY_DEFAULT_MIN_SCOREfor the six CLI default/fallback sites and the four library defaults inQualityScoreValidator,run_validation,run_quality_check, andrun_rubric_eval. Plugin quality checks inherit the same default. The default remains 70 and explicitmin_scoreoverrides keep working. Changing the shared constant before importing these consumers now changes their defaults consistently.Validation
run_quality_check, andrun_validation; an explicit threshold of 80 still fails. The regression failed before the library fix and passes afterward.git diff --checkpassed.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.