Repository navigation
feat(tier1): score tier 1 quality checks via a configurable YAML file - #213
Conversation
Signed-off-by: Weston Platter <[email protected]>
Signed-off-by: Weston Platter <[email protected]>
Load validated heading rules with optional alternatives and point deductions from the quality configuration. Match document-level Markdown headings so examples, nested content, and incorrect heading levels do not satisfy rules. Signed-off-by: Weston Platter <[email protected]>
Signed-off-by: Weston Platter <[email protected]>
Configurable expected headings changed how the default config scored skills. Restore upstream behavior: - Match a heading by substring in the content, as before, instead of exact parsed headings. Drop the now-unused markdown_headings helper. - Require message and suggestion on each expected_headers entry, and set the packaged defaults to the original finding text. - Use float points in the packaged config to match deduct(). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Assert the installed wheel ships quality-default.yaml and that load_quality_config() returns the default expected headings. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Add an expected-headings section to the Tier 1 quality docs with a YAML example and field table, and add --quality-config flag rows for `validate` and `quality-check` in the CLI reference. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Run quality-check and tier1 quality-check unmocked against the simple fixture: the packaged default reports the upstream heading findings, a custom config replaces them, and a missing config path is a usage error. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
QualityConfigError escaped as a traceback. --quality-config now uses a validating click.Path type, so quality-check, tier1 quality-check, and validate exit 2 with the file and problem named before any work runs. validate checks the file even when the quality check is not selected. The loader also rejects unknown keys and duplicate headings, prefixes every message with the file path, shortens YAML errors to "line N, column M: <problem>", and wraps read and UTF-8 errors. Catalog validate now forwards --quality-config to per-skill children, which previously fell back to the default rubric. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Run validate's real Tier 1 pipeline with the packaged default and a custom config, asserting on the JSON report. The custom case fails if validate stops passing quality_config to run_validation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Expected headings match as a case-sensitive substring of SKILL.md, not as parsed headings. Cover both directions: deeper levels, longer text, code blocks, and prose match; shallower levels, other case, missing space, and setext headings do not. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
tier1 PATH and tier1 validate now take --quality-config, defaulting to the packaged quality-default.yaml like quality-check and validate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
An expected_headers entry may omit message or suggestion. Omitted ones get generic text naming the heading and its alternatives, so the YAML example in NVIDIA#169 works as written. A message or suggestion that is set must still be a non-empty string. The packaged quality-default.yaml still sets both for every entry, so default findings keep the upstream wording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
Drop the float() conversion so integer points stay integers. Reports again show "deduction": 5 for the default heading findings, matching upstream and every other deduction in the validator. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Automated review: 2 findings (0 P1, 0 P2, 2 P3); 2 posted inline.
Load quality configs with a SafeLoader subclass that rejects repeated mapping keys, so a second expected_headers block no longer silently replaces the first. Deeply nested YAML and integer points too large for a float now raise QualityConfigError instead of a traceback. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
The QUALITY result now carries quality_config: whether the rules came from the packaged default or a custom file, the custom file's name (never its directory), a sha256 digest of the normalized rules, and the --min-score pass threshold. The JSON report, Markdown report and BENCHMARK.md surface it, so a reader can tell which rules and threshold produced a score. The digest covers the rules only, so formatting edits do not change it and runs with different thresholds still compare as the same rules. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
…' into feat/configurable-quality-checks
|
@rng1995 thanks for running the automated review. Updated the PR based on the feedback. |
Merging main brought in the v0.6.0 release, which renamed the old Unreleased heading to 0.6.0 and left this entry under a released version. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Weston Platter <[email protected]>
rng1995
left a comment
There was a problem hiding this comment.
Approving at 40614da.
- Reports: they now record which quality config produced the score. JSON, Markdown and BENCHMARK.md show the source, the file name, a rules digest and the min score, and no local path leaks into BENCHMARK.md.
- Duplicate keys and bad YAML: duplicate keys and most malformed files now give a clean usage error. The few YAML scalars that still raise a traceback are noted in the open thread. They are non-blocking and can be a small follow-up.
- Merge check: a trial merge with current main is clean, and the related tests pass on it.
- Overlap with #211: that PR edits some of the same files. The two only conflict in
CHANGELOG.md, so whichever lands second needs a CHANGELOG fix-up.
…uality-checks # Conflicts: # CHANGELOG.md
PyYAML raises plain ValueError/TypeError/KeyError/AttributeError for some scalars (integers over the 4300-digit limit, impossible dates, bad explicit tags), which previously surfaced as a traceback with exit code 1. Wrap them in QualityConfigError so they become the same usage error as other invalid configs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
…' into feat/configurable-quality-checks
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
|
@westonplatter thanks. I verified the YAML error handling at 9f5db94, and the merge with #211 keeps both CHANGELOG entries under The DCO check is failing because the three new commits have no |
9f5db94 to
8ce5c1c
Compare
|
@westonplatter commits 0c2f577, 887515a and 9f5db94 had no Only the commit messages changed. The file contents are identical, the earlier commits keep their SHAs, and DCO now passes locally. The head moved from 9f5db94 to 8ce5c1c. Before you push to this branch again, please fetch it and reset your local branch to the new head. |
Brings in NVIDIA#218 (two-path quickstart docs). Conflicts: - CHANGELOG.md: kept the --quality-config entry under Unreleased / Added and main's Unreleased Changed and Fixed entries, in Added, Changed, Fixed order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
|
@rng1995 thanks for handing the |
Brings in main up to 87f49e2: #213 --quality-config, #210 nested catalog discovery with linked-directory handling, #224 docs refresh. Conflicts: - src/skillevaluator/utils/helpers.py: find_skills_in_directory follows #210 (recursive walk that stops at skill boundaries, prunes scan exclusions, skips in-catalog aliases, reports external linked or unreadable directories through the problems dict, else raises). It keeps the branch's lstat-first root handling: an unreadable root is a problem rather than an empty catalog, and a linked root directory is refused without querying its target, while a selected manifest file, linked or not, still names its skill as on main. The branch's secure plugin discovery (find_bundled_plugin_skill_manifests and find_bundled_plugin_skills) is unchanged and does not use this function. - src/skillevaluator/cli.py: _resolve_validate_target now returns every catalog skill, nested ones included, plus the discovery problems, and validate passes the resolved root and those problems to main's catalog runners. The branch's PREVIOUS_VERSION_ENV guard is kept. - src/skillevaluator/tier1/commands.py: --quality-config reaches the branch's _run_validation, so plugin bundled skills (QualityScoreValidator and _ListedSkillsQuality) use it too. - src/skillevaluator/validators/plugin_schema.py: kept the branch's validator, which already turns a bundled-skill discovery failure into a HIGH finding (bundled_skill_path_unsafe) and refuses a linked skills folder in its tree check (unsafe_plugin_filesystem). - tests/validators/test_plugin_schema.py: kept the branch's tests. Main's two #210 tests now check the branch's findings: a linked skills folder is an unsafe_plugin_filesystem finding, and a failing find_bundled_plugin_skill_manifests is a bundled_skill_path_unsafe finding at skills/. - CHANGELOG.md: #213's Added entry, #224's Documentation section (between Changed and Fixed, as on main) and #210's Fixed entry go into the branch's Unreleased sections in main's order. Released sections are identical to main. - docs/reports.mdx, docs/tier3-live-evaluation.mdx: kept the branch's shared-dimension Skill Lift text and added main's judge-model exclusion note. docs/tier1-validation.mdx: kept the branch's plugin policy note and main's note that severity overrides do not waive --min-score. - docs/plugin-evaluation.mdx: --min-score and --quality-config apply to bundled skills. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
…#213) * feat(quality): support packaged and custom quality configs Signed-off-by: Weston Platter <[email protected]>
…#213) * fix(lint): fix a lint issue * feat(quality): make expected Markdown headings configurable * fix(lint): run Ruff through uv * fix(quality): preserve the upstream default rubric * ci(package): smoke-test packaged quality config in the wheel * docs(quality): document --quality-config * test(quality): cover --quality-config through quality-check * fix(quality): reject invalid --quality-config files as usage errors * test(quality): cover --quality-config through validate * test(quality): pin text-anywhere expected-heading matching * feat(cli): accept --quality-config on direct tier1 * chore: add SPDX headers to quality config files * revert(lint): restore upstream Makefile lint target * feat(quality): make expected-heading message and suggestion optional * docs(changelog): add --quality-config entry * fix(quality): keep expected-heading points as written * fix(quality): reject duplicate keys and pathological config values * feat(quality): record the quality config and min score in reports * docs(changelog): move --quality-config entry under Unreleased * fix(quality): reject unparseable YAML scalars with exit code 2 * docs(changelog): rewrap --quality-config entry * refactor(quality): drop redundant comment on YAML value error handler Signed-off-by: Weston Platter <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Brings in main up to 87f49e2: #213 --quality-config, #210 nested catalog discovery with linked-directory handling, #224 docs refresh. Conflicts: - src/skillevaluator/utils/helpers.py: find_skills_in_directory follows #210 (recursive walk that stops at skill boundaries, prunes scan exclusions, skips in-catalog aliases, reports external linked or unreadable directories through the problems dict, else raises). It keeps the branch's lstat-first root handling: an unreadable root is a problem rather than an empty catalog, and a linked root directory is refused without querying its target, while a selected manifest file, linked or not, still names its skill as on main. The branch's secure plugin discovery (find_bundled_plugin_skill_manifests and find_bundled_plugin_skills) is unchanged and does not use this function. - src/skillevaluator/cli.py: _resolve_validate_target now returns every catalog skill, nested ones included, plus the discovery problems, and validate passes the resolved root and those problems to main's catalog runners. The branch's PREVIOUS_VERSION_ENV guard is kept. - src/skillevaluator/tier1/commands.py: --quality-config reaches the branch's _run_validation, so plugin bundled skills (QualityScoreValidator and _ListedSkillsQuality) use it too. - src/skillevaluator/validators/plugin_schema.py: kept the branch's validator, which already turns a bundled-skill discovery failure into a HIGH finding (bundled_skill_path_unsafe) and refuses a linked skills folder in its tree check (unsafe_plugin_filesystem). - tests/validators/test_plugin_schema.py: kept the branch's tests. Main's two #210 tests now check the branch's findings: a linked skills folder is an unsafe_plugin_filesystem finding, and a failing find_bundled_plugin_skill_manifests is a bundled_skill_path_unsafe finding at skills/. - CHANGELOG.md: #213's Added entry, #224's Documentation section (between Changed and Fixed, as on main) and #210's Fixed entry go into the branch's Unreleased sections in main's order. Released sections are identical to main. - docs/reports.mdx, docs/tier3-live-evaluation.mdx: kept the branch's shared-dimension Skill Lift text and added main's judge-model exclusion note. docs/tier1-validation.mdx: kept the branch's plugin policy note and main's note that severity overrides do not waive --min-score. - docs/plugin-evaluation.mdx: --min-score and --quality-config apply to bundled skills. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Narendran Raghavan <[email protected]>
Summary
Closes #169
The Tier 1 quality check's expected-heading rules (Prerequisites, Limitations, Troubleshooting) move out of hard-coded Python and into YAML. The current rules ship with the package as
quality-default.yamland stay the default. To use your own heading rules instead, pass--quality-config PATHtoquality-check,tier1 quality-check,tier1 PATH/tier1 validate, orvalidate.Only the expected-heading rules are configurable. The other quality checks (error handling, script and library reliability, and so on) are unchanged and remain in code.
Docs: the "Expected headings" section in
docs/tier1-validation.mdx(example, field table, error behavior) and the flag rows indocs/cli-reference.mdx.Before: heading rules in code
After: heading rules in YAML
load_quality_config()fills in defaults (alternatives: [],points: 5, and generatedmessage/suggestion), so the loop above can index every key directly.Changes to existing behavior
Default scoring is unchanged. The packaged config lists the same three headings, alternatives, points and finding text as the old code. Matching is the same case-sensitive "heading text appears anywhere in
SKILL.md" check as before. New tests intests/validators/test_quality_score.pypin this behavior, so a change to stricter Markdown heading parsing can be its own PR.### X(contains## X),## X and more, inside a code block, inside prose# X, different case,##X, setext headings--quality-configis validated before any checks run. The file is checked while arguments are parsed. A missing, unreadable, non-UTF-8, invalid-YAML, unknown-key or duplicate-heading file is a usage error (exit 2), even when--checksleaves outqualityor the target isn't a skill. Each error names the file and the field. This is deliberate:It matches how
--env-modeand the Tier 2--thresholdreject bad values at parse time. Most other check-specific flags (--previous-version,--min-score, the Tier 3 options) are still silently ignored when their check is off; this PR leaves them alone.messageandsuggestionare optional per entry. When omitted, they're generated from the headings, for exampleMissing expected heading: '## Security'andAdd a '## Security' section, orAdd one of these sections: ...when there are alternatives. The packaged defaults set both, so default findings keep their current wording.Catalog
validatenow forwards--quality-configto each per-skill run. Before this, the flag was dropped.Verification
quality-checkandtier1 quality-check(unmocked), throughvalidate(real--tier1-checks schema,qualityrun, asserting on the JSON report) and throughtier1 PATHquality-check,tier1 quality-check,tier1 PATH,tier1 validateandvalidate(including--checks schema) exit 2 with a usage error and no traceback.github/workflows/ci.ymlassertsquality-default.yamlships in the wheel and loads the three default headingsfern check: 0 errors)make lintmake testmake buildRelease Impact
CHANGELOG.md