Skip to content

fix(tier3): show which Tier 3 source checks failed - #290

Merged
rng1995 merged 6 commits into
mainfrom
naren/port-tier3-source-validation-errors
Nov 3, 2026
Merged

rng1995 merged 6 commits into
mainfrom
naren/port-tier3-source-validation-errors

Conversation

@rng1995

@rng1995 rng1995 commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When validate finds an unusable Tier 3 source, the terminal and HTML report now list the failed checks as path: message lines (for example entry case-3: Missing required fields: question). Before this change they only showed "Create or fix the Tier 3 source ... and rerun validation."

  • CLI report (-r cli or --verbose): a Source validation: block under the Tier 3 finding lists the errors.
  • Compact Tier 3 panel (default quiet view): adds a validation row with the error count. It also lists the errors, unless the full CLI report is printed too. This way -r cli,json,html lists each error only once.
  • How many the terminal shows: when the run also writes an HTML or JSON report, the terminal shows the first five errors and names the report that has the rest ("N more errors: see Full Insights in the HTML report.", or "see tier3.provenance.source_validation in the JSON report." when only JSON is written). When the run writes neither, for example -r cli alone or --verbose without -r, the terminal lists every error and names no report, since the rest would not be reachable anywhere else.
  • HTML report:
    • The Tier 3 dashboard's "Conclusion & Next Steps" shows a single error in full. When there are several, it shows the count and points to Full Insights. The line follows the existing content, whether that is the case-based fix list or the metric-based conclusion and recommendations.
    • Full Insights gets a new "Source Validation Errors (N)" section that lists every error in order. Existing conclusions and recommendations stay where they are. The "No evaluation insights were generated." message no longer appears when there are source errors.
  • dataset_required_result now records only missing/error checks. Its only caller already passed errors only, so the JSON output does not change.
  • Adds a SOURCE_VALIDATION_CLI_LIMIT constant (5).
  • Adds shared helpers in reporting/base.py: source_validation_errors() (used by the CLI report, the panel and the HTML report), and source_validation_preview() with source_validation_full_report(), which decide from the formats the run emits how many errors a terminal view prints and which report, if any, it names.
  • Docs: docs/eval-datasets.mdx ("Validate before you run") explains where the errors appear. CHANGELOG entry under Unreleased → Fixed.

Validation rules, gate decisions, severities, and the finding's message and suggestion text are unchanged.

Why

Say a skill author's evals/evals.json has several invalid entries. validate failed the Tier 3 source check (or reported it as advisory), but the terminal and the HTML report, which are what CI users see, never said which entries were wrong. The details were recorded in finding metadata and in the JSON report's tier3.provenance.source_validation, but no reporter read them. Authors had to open the JSON, or run skillevaluator tier3 validate separately, to find the problem.

The errors stay in metadata instead of being added to the suggestion. Report grouping and SARIF results key on the finding's text, so fixing entries one at a time does not turn the same finding into a "new" one.

Kept from public

The display is built on public's existing hardening instead of replacing it:

  • CLI report: error text goes through escape_markup (which strips terminal controls and makes [...] inert to Rich), is collapsed to a single line, and is capped at 1024 characters, the same pattern as _rich_skip_reason.
  • Compact panel: rows go through sanitize_tier3_console_text (one bounded, control-free line), like every other Tier 3 row. The panel's rendering still uses Text.append plus strip_terminal_controls.
  • HTML: _sanitize_tier3_display_payload normalizes provenance.source_validation to well-formed {path, status, message} string items that are failed checks only. It runs on top of the existing _json_safe_tier3_payload projection, and Jinja autoescape stays on.
  • Hardened summarize_tier3: kept as is (payload/summary type checks, finite-number lift handling, bounded strings). The new rows are appended without changing its pass/fail logic.
  • validate option handling: the panel gets the formats from _effective_report_formats, and emit_reports hands its formats to CLIReporter, so both follow the same explicit/implicit -r rules as report emission instead of guessing which files exist.

Tests

New file tests/reporting/test_tier3_source_validation_reporting.py (210 cases):

  • Only failed checks are recorded in metadata, provenance, and the JSON report, for both blocking and advisory runs.
  • The finding text and suggestion stay the same as errors change.
  • CLI report with 0/1/5/6/13/100 errors, for cli alone and with Markdown/SARIF, JSON, HTML, or both: order, the five-error limit only when an HTML or JSON report is written, the overflow note naming only that report, and every error with no note otherwise. A CLIReporter given no formats lists every error.
  • source_validation_preview() / source_validation_full_report() across the same format sets.
  • Untrusted text: Rich markup, ANSI/OSC sequences, newlines, and trailing backslashes in entry IDs and messages print as plain text, with no control bytes in the output.
  • Malformed source_validation metadata (non-list, non-dict items, non-string fields, blank messages, passing checks and warnings) is ignored.
  • Compact panel: count, "(showing first 5)", preview rows, and overflow note across 0-100 errors for every format set (count only when cli is emitted; the full list when no HTML or JSON report is written), for blocking and advisory runs. Also covers the single-line, control-free, length-bounded projection.
  • HTML report:
    • Dashboard text for 0/1/2/13/100 errors, and the full ordered list in Full Insights.
    • Escaping of <script>.
    • Existing conclusions and recommendations are kept, and the empty-insights message is suppressed.
    • A skipped Tier 3 report renders without undefined template variables.
    • The payload sanitizer keeps only well-formed failed checks.
  • End-to-end validate with 13 invalid entries, using default formats, -r cli, -r json, -r cli,json, -r cli,json,html, -r json,html, and --verbose, blocking and advisory: errors appear exactly once, the terminal shows five plus a note naming a report that was written, or all 13 when no HTML or JSON report is written, and the JSON and HTML reports, when written, carry all 13.

Run against unmodified main (with the new imports stubbed as pass-throughs), 186 of the 210 cases fail. Of the 24 that pass, 8 check the no-error and no-regression paths, and 16 are helper cases whose expected result (every error, no note, because no HTML or JSON report is written) matches the pass-through stub.

Validation run locally:

  • pytest -n 8 on tests/reporting, tests/cli, tests/evaluation, tests/tier3, tests/test_cli.py, tests/test_commands.py, every other top-level suite that uses emit_reports, CLIReporter, summarize_tier3 or the Tier 3 report helpers (benchmark source provenance, evaluation service, Harbor collector/runner/HTML-report/timeout-recovery, issue-55 collector truth, judge lift integrity, public benchmark gate, quality policy gate, Tier 3 max-cases and progress), the OSS boundary/packaging/hygiene tests, the benchmark-docs and CI-workflow tests, and the security, structured-secrets and hygiene-link validator suites: 10017 passed, 5 skipped. After merging the latest main again, tests/reporting, tests/cli, tests/test_cli.py, tests/test_commands.py, tests/test_skillspector_provenance.py and the OSS boundary/packaging/hygiene tests: 1920 passed.
  • The new module was also run with FORCE_COLOR=1, TTY_COMPATIBLE=1, COLUMNS=60, under -n 4: 210 passed.
  • ruff check passes on all changed files. ruff format --check passes on every changed file except reporting/console_ui.py, which ruff format would already rewrite on main; none of those hunks are in this diff.
  • scripts/check_oss_boundary.py: passed.

🤖 Generated with Claude Code

When validate finds an unusable Tier 3 source (for example evals.json
entries missing required fields, an unparseable dataset, or a broken
native Harbor task), the terminal and the HTML report only said "Create
or fix the Tier 3 source ... and rerun validation." The failed checks
were already recorded in the finding metadata and in the JSON report's
tier3.provenance.source_validation, but no reporter displayed them, so
authors had to dig through JSON to learn which entries were wrong.

Surface the recorded errors as path: message lines:

- The CLI report lists the first five under the Tier 3 finding and
  counts the rest.
- The compact Tier 3 panel shows the error count, plus the first five
  errors when the full CLI report is not also printed, so -r cli,json,html
  does not repeat them.
- The HTML dashboard shows a single error in full or the error count, and
  Full Insights lists every error under Source Validation Errors without
  hiding existing conclusions or recommendations.

The text comes from the skill's eval files, so it goes through the
existing Rich escaping, terminal-control stripping and HTML autoescape,
and the HTML payload sanitizer keeps only well-formed failed checks.
dataset_required_result now records only missing/error checks itself.
The finding's message and suggestion are unchanged, so report grouping
stays stable while entries are fixed one at a time. Validation rules and
gate decisions are unchanged.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed the diff and the surrounding reporters. Behavior, escaping of eval-file text (Rich markup, terminal controls, HTML autoescape), the unchanged finding text, and CHANGELOG/docs placement all look right. ruff is clean and the new reporting tests plus the reporting, CLI and evaluation suites pass locally. One P3 below.

Reviewed with Claude Code.

Comment thread src/skillevaluator/reporting/base.py Resolved
rng1995 and others added 3 commits November 2, 2026 10:52
No conflicted files; CHANGELOG.md, docs/eval-datasets.mdx, cli.py, tier3_report.py, reporting/base.py and report.html.j2 auto-merged.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The terminal preview of failed Tier 3 source checks stopped after five
errors with "N more errors: see Full Insights in the HTML report." With
an explicit -r cli, or --verbose without -r, the run writes no HTML or
JSON report, so the remaining errors were not reachable anywhere.

The CLI report and the compact Tier 3 panel now decide from the formats
the run actually emits. emit_reports hands its formats to CLIReporter,
and validate passes _effective_report_formats to summarize_tier3, so
both follow the same explicit/implicit -r rules as report emission:

- HTML written: first five, then "see Full Insights in the HTML report."
- JSON only: first five, then "see tier3.provenance.source_validation in
  the JSON report."
- Neither (cli alone, Markdown or SARIF): every error, and no note.

source_validation_preview() and source_validation_full_report() in
reporting/base.py replace source_validation_overflow_note(). A
CLIReporter built without formats lists every error. The CHANGELOG
entry and docs/eval-datasets.mdx describe the new rule.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
No conflicted files; CHANGELOG.md, reporting/html.py and report.html.j2 auto-merged.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[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.

I read the new helpers, all three renderers and the template, and traced validate through the quiet default and explicit -r paths. Escaping holds up (control stripping and markup escaping on the terminal, autoescape in HTML), the finding text stays stable, and the overflow note only names a report the run actually writes. One small robustness nit below, nothing blocking.

Comment thread src/skillevaluator/reporting/base.py Resolved
rng1995 and others added 2 commits November 3, 2026 04:30
Conflicts: src/skillevaluator/reporting/console_ui.py.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
source_validation_errors looked up the raw status in a frozenset, so a
list or mapping status raised TypeError instead of being dropped as
malformed. Check the type first, so the CLI report and the HTML payload
sanitizer skip such items.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 merged commit d69c438 into main Nov 3, 2026
21 checks passed
@rng1995
rng1995 deleted the naren/port-tier3-source-validation-errors branch November 3, 2026 20:04
rng1995 added a commit that referenced this pull request Nov 6, 2026
* docs(changelog): move entries released in 0.7.0-0.7.2 out of Unreleased

0.7.0 (#314) and 0.7.1 (#327) never cut their sections on main, and 0.7.2
(#335) added its section below the whole Unreleased block, so Unreleased
still listed work that had already shipped.

Place each Unreleased entry under the release that shipped the PR that
added it:

- 0.7.0: the published section from the 0.7.0 tag, verbatim. It already
  holds the six entries that main had filed under 0.6.0, so 0.6.0 again
  matches the v0.6.0 tag, including the original run_config.json entry.
- 0.7.1: #264 #271 #274 #281 #284 #289 #293 #299 #316 #317 #318 #323
  #324 #326 #327, plus the #320 wording of the Windows Git-root entry,
  since #320 changed that 0.7.0 fix in 0.7.1.
- 0.7.2: #263 #265 #269 #270 #276 #279 #287 #290 #296 #309 #328 #330
  merged with the existing #335 entries.

Only post-v0.7.2 entries stay under Unreleased, with one heading per
subsection. Entry text is unchanged, apart from the published tag wording
in 0.7.0 and 0.6.0.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): prepare v0.8.0

Set the package, fallback, lock, citation and developer-guide versions to
0.8.0 and move every entry merged since v0.7.2 under
'## 0.8.0 - 2026-11-05', leaving Unreleased empty.

The refusal-fallback documentation test now reads the release section
that names CLAUDE_CODE_DISABLE_REFUSAL_FALLBACK, requires it to be 0.8.0,
and requires exactly one entry there to name the switch.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(release): pin the verified 0.8.0 Tier 1 image and add its CI bundle

Pin onboarding to the Tier 1 image published by the reviewed main revision
55d2d04 in "Build and publish Tier 1 image" run 42158955180:
ghcr.io/nvidia/skillevaluator-tier1@sha256:9d5483243918937be4f2178f74cf7c622a531dee41e3176906994d52fa14950a
(config sha256:d17d6f5105ec5f1bf0cbe4dff0d693aae4ecf01e9c1c6a6ddb7830518acace33).
The workflow and publisher refs both move to 55d2d04.

ci/bundles/0.8.0 mirrors the 0.7.2 bundle. The templates, README and
release.json are the run's github-actions-onboarding artifact and match
ci/render_templates.py output for these pins byte for byte. The scanner
inventory and verification receipt come from the build's runtime-stage
version step, the five-case smoke receipt, the onboarding job's anonymous
pull, and the public manifest, whose config digest equals the smoke-tested
image ID. The ZIP uses the 0.7.2 layout (sorted members, inner checksums,
1980 timestamps, 0644, deflate level 9) and rebuilds to identical bytes.

Point the current-bundle links at 0.8.0 and list 0.7.2 as historical.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>

---------

Signed-off-by: Narendran Raghavan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants