Repository navigation
feat(quality): configure Reliability error handling in the quality config - #336
Conversation
Add an error_handling section to quality-default.yaml for the three Reliability error-handling rules: the SKILL.md mention check, the scripts check, and the lib check. Each rule carries points, message, suggestion, and its terms or markers. A custom --quality-config file may set any subset of the section. Omitted blocks and keys keep the packaged values, and a list replaces the packaged list. The packaged section is validated with every key required. Invalid content exits with the file and field named. The config digest now covers error_handling, so every quality_config digest changes, packaged and custom. The custom-file provenance test now derives its expected digest from the loaded config. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
The Reliability mention, scripts, and lib checks now read their points, message, suggestion, terms, and markers from the quality config instead of inline literals. The packaged values reproduce today's scores and findings. Terms match as whole words in any case. Any Unicode letter or digit counts as part of a word, as the old regex did. A try/except pair always counts as handling errors. A rule with points 0 adds no finding, and has_error_handling is still recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Describe the error_handling section, how it merges with packaged values, and how terms differ from markers. Note in the CHANGELOG that every quality_config digest changes after upgrade while scores stay the same. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Use one explicit check for whether a packaged base is present, and drop comments that restate the code. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
A custom term such as "error:" or "C++" never matched, because a word boundary needs a letter or digit on the inside edge. Match the term when no letter or digit sits directly before or after it instead. Packaged terms match exactly as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
…ed changes A custom file's digest now covers only the rules the file sets, not the packaged error_handling values merged into it. Existing custom files keep the digest they had before error_handling existed, and a custom digest changes only when that file's rules change. The packaged digest still covers the whole packaged config. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
04b7868 to
8f590f9
Compare
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 5 findings (0 P1, 0 P2, 5 P3); 5 posted inline.
Nothing blocking. Without a custom file the scores and findings stay the same, and the \b to lookaround change gives the same matches for the packaged terms. The comments are about the docs, the changelog, and one matching gap for custom multi-word terms.
Checked: the PR merges cleanly with current main (8a851c6). On that merge, tests/test_quality_config.py and tests/validators/test_quality_score.py pass (401 tests), as do the quality-config reporting, retained/redesign report, publication-evidence, commands, policy-gate and CLI tests (405). I ran the edge cases in the comments against the PR head.
chrisknvidia
left a comment
There was a problem hiding this comment.
@westonplatter reviewed the current head. The five open threads still apply; I left an inline note on each, with a reproduction for the wrapped custom term. CI has not run on this fork PR yet, and the branch conflicts with main, so it needs main merged in and a maintainer to approve the workflow run.
Resolve the CHANGELOG.md conflict by keeping main's entries and this PR's entry. Signed-off-by: Christopher Kevin <[email protected]>
…ror-handling-config Signed-off-by: Weston Platter <[email protected]> # Conflicts: # CHANGELOG.md # tests/validators/test_quality_score.py
A custom --quality-config file that leaves out expected_headers now keeps the packaged heading list, the same way error_handling overlays packaged values. A list that is present still replaces the packaged one, and [] still turns heading checks off. The packaged file still requires the key. The digest covers expected_headers only when the file sets it, so an omitted key is not hashed as the file's own rules and existing custom files keep their digests. The docs example no longer needs `expected_headers: []`. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
An error_handling rule with points: 0 is turned off and reports nothing. An expected_headers entry with points: 0 still reports a zero-point advisory finding. Say so in both places so readers don't expect the same behavior. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
The scripts rule checks only .py files directly in scripts/ or tools/, and the lib rule runs only for lib-based skills, which have no .py or .sh files in scripts/ or tools/. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
A custom term such as `exit code` now matches when its words are split by a line break or several spaces. Packaged terms are single words, so default scores are unchanged. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Add a short overview of the --quality-config file before the per-section details, and update the --quality-config flag rows in the CLI reference, which still said the file replaces the expected-heading rules. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Rename it to load_quality_config_and_overlay_defaults. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Rename load_quality_config_and_overlay_defaults back to the released name, quality_config_provenance, to match the QualityConfigProvenance record it returns. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
The function now takes only path and returns (config, provenance), so calls written as quality_config_provenance(path, config) need updating. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
…ovenance Rename the loader back to load_quality_config_with_provenance and replace the CHANGELOG entry: quality_config_provenance(path, config) is removed, and the ### Changed entry names load_quality_config_with_provenance(path) as its replacement. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
…ripts/ or tools/ A script in a subfolder of scripts/ or tools/ does not make a skill script-based or hybrid, so the lib check still runs. Addresses review feedback on NVIDIA#336: NVIDIA#336 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
|
@chrisknvidia Thanks for the detailed feedback. I revised the code, docs, and CHANGELOG.md. Tests are passing locally |
chrisknvidia
left a comment
There was a problem hiding this comment.
Re-reviewed at 461b560. All five open points are fixed:
- A custom file can omit
expected_headersand keep the packaged list, so a file with onlyerror_handlingloads.[]still turns heading checks off, and the digest only covers keys the file sets. - The docs now spell out the two meanings of
points: 0: anerror_handlingrule with 0 points is off, while anexpected_headersentry with 0 points still reports a zero-point finding. - The
scripts/librows match the code.detect_skill_typeuses_executable_files(.py/.shdirectly inscripts/ortools/), so the narrowerlibwording is accurate. - Multi-word terms match across any whitespace run, including line breaks and
\r\nwith indentation, andexit codestill doesn't matchexit codes. - The CHANGELOG lists the
quality_config_provenanceremoval and namesload_quality_config_with_provenance(path)as its replacement.
Checked locally: tests/test_quality_config.py and tests/validators/test_quality_score.py pass (424), and ruff check is clean.
The only thing left is the merge conflict. main has moved since your Nov 11 merge, and CHANGELOG.md conflicts again (it's the only file). Once you merge main and keep both sides, the code looks good to me.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
|
Thanks for the re-review @chrisknvidia. Resolved the merge conflicts. |
rng1995
left a comment
There was a problem hiding this comment.
Re-checked all five earlier comments at 1242bc3 and each one is addressed: expected_headers is optional in a custom file and falls back to the packaged list with unchanged digests, the docs explain points: 0 for both sections, the scripts/lib rows match detect_skill_type, multi-word terms now match across line breaks and repeated whitespace, and the CHANGELOG entry covers the removed quality_config_provenance helper. The latest commit only merges main with a keep-both CHANGELOG resolution. Approving.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
|
@rng1995 thanks! Fixed the latest merge conflicts and resolved the comments. Can I get approve for a CI run? |
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
|
Thanks @westonplatter for your contributions to SkillEvaluator! I have approved the CI workflows and enabled auto-merge. The PR will merge automatically once the CI workflows complete successfully. |
Summary
This PR follows #169. Tier 1 Reliability has three error-handling rules that were hard-coded, and this change moves them into a new optional
error_handlingsection of the quality config,quality-default.yaml/--quality-config. Teams can now tune or turn off these rules without changing code.The three rules:
mentionedSKILL.mdcontains none of theterms(whole word, any case)scripts*.pyscript has neither atry:/exceptpair nor any of themarkers(case-sensitive substring)libtry:/exceptpair nor any of themarkersEach rule sets its
points,message, andsuggestion, plus itstermsormarkers. Severity and the matching logic stay in code, as does thetry:/exceptcheck.Behavior:
\bregex, and a fuzz comparison found no differences.expected_headersgets the packaged rules.points: 0turns a rule off and emits no finding.(?<!\w)…(?!\w)lookarounds, so terms such aserror:andC++match.quality_configdigest still hashes the parsed rules, not the file's bytes, so comments and formatting don't change it. The packaged digest covers the whole packaged config. A custom file's digest covers only the rules that file sets, not the packaged values filled in around it, so it changes only when that file's rules change.Changes in behavior compared to
mainmainexpected_headersonly)quality_configdigestsha256:b70a47b9…sha256:298ff2bf…, becausequality-default.yamlgained theerror_handlingsection. Reports from earlier versions that ran without a custom file won't match it.main.error_handlingkeypoints,message,suggestion,terms/markers.points: 0turns a rule off.quality_config_provenance(path, config)load_quality_config_with_provenance(path), which returns the config and its provenance together.load_quality_configandquality_config_digestare unchanged.One new property follows from the custom digest: if a later release changes a packaged error-handling default, a custom file that doesn't set that value keeps its digest even though its score changes. The SkillEvaluator version recorded in the report tells those runs apart.
Docs:
docs/tier1-validation.mdxhas a new "Error-handling checks" subsection with an example and a rule table, plus additions to the list of invalid-file conditions.Verification
tests/test_quality_config.pycovers loading, the overlay, 16 invalid cases, and the digest, including that a headings-only custom file keeps itsmaindigest and that a custom digest ignores changes to packaged defaults it doesn't set.tests/validators/test_quality_score.pyaddsTestReliabilityErrorHandlingConfig, covering every packaged term, the Unicode non-match cases, custom terms and markers,points: 0, and punctuation-edged terms.make lint(withPYTHON="uv run python"): all checks passedmake test: 19,500 passed, 35 skipped, 2 failed. Both failures are intests/test_harbor_secure_docker_environment.py(test_sidecar_retains_only_structurally_required_nonsecret_compose_task_valueandtest_sidecar_retains_structurally_required_nonsecret_host_compose_value). They fail the same way onmain, so this change didn't cause them.make build: built the sdist and wheelRelease Impact
CHANGELOG.md🤖 Generated with Claude Code