Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
714c85c
feat(reporting): add a JUnit XML report format
mvanhorn Nov 16, 2026
34e99a8
Merge branch 'main' into feat/junit-report
chrisknvidia Nov 16, 2026
9818e30
fix(reporting): qualify JUnit test identities with the target
mvanhorn Nov 16, 2026
5ee48b9
Merge branch 'main' into feat/junit-report
mvanhorn Nov 16, 2026
397dcaf
fix(reporting): keep non-UTF-8 file names distinct in JUnit output
mvanhorn Nov 16, 2026
006c7a9
fix(reporting): fail JUnit findings the validator recorded as blocking
mvanhorn Nov 16, 2026
5be3b18
docs(gitlab): give the JUnit snippet a job that actually writes JUnit
mvanhorn Nov 16, 2026
3c85a16
fix(reporting): keep real JUnit status for cases beside an incomplete…
mvanhorn Nov 16, 2026
2129548
fix(reporting): make JUnit failures follow the validate exit gate
mvanhorn Nov 16, 2026
a8178d7
docs(reports): describe JUnit failure and skipped cases as emitted
mvanhorn Nov 16, 2026
a9a1c6a
docs(skill): list junit in the bundled skill's report and CI guidance
mvanhorn Nov 16, 2026
62a5dd2
fix(reporting): emit incomplete scans as JUnit errors with the scanne…
mvanhorn Nov 16, 2026
96141c8
fix(reporting): report a blocking skipped group as a JUnit gate failure
mvanhorn Nov 16, 2026
4f64717
test(reporting): pin JUnit passthrough for plugin evidence
mvanhorn Nov 16, 2026
1b46658
fix(reporting): name JUnit finding cases by check and location
mvanhorn Nov 17, 2026
3a5172a
fix(reporting): emit scanner execution errors as JUnit errors
mvanhorn Nov 17, 2026
1dcdd2f
Merge branch 'main' into feat/junit-report
chrisknvidia Nov 17, 2026
492b4b5
fix(reporting): give SARIF and JUnit the same Git-root paths on every…
mvanhorn Nov 17, 2026
4c61d4f
docs(changelog): describe the JUnit error and gate behaviour
chrisknvidia Nov 17, 2026
ac67d66
fix(cli): resolve the tier1 target before validation so report paths …
chrisknvidia Nov 17, 2026
2c09262
Merge branch 'main' into feat/junit-report
chrisknvidia Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to SkillEvaluator are documented in this file.

### Added

- JUnit XML report format (`-r junit`, `.junit.xml`) for CI test-report
artifacts. One testsuite is emitted per check group, failures include
file:line when recorded, and incomplete or unrun checks are skipped rather
than reported as passed.
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
- The Tier 3 report data and JSON report record which execution backend ran the
evaluation, as `execution_backend` (`harbor` or `nemo-gym`), next to the sandbox
`environment`.
Expand Down
4 changes: 2 additions & 2 deletions docs/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ Direct `tier1 PATH`, `tier1 validate PATH`, and `tier2 PATH` default to

| Flag | Default | Effect |
| --- | --- | --- |
| `-r, --report [cli\|json\|html\|markdown\|sarif]` | `cli,json,html` for direct workflows; `cli` for focused commands | Report format(s). Accepts comma- or space-separated values (`-r cli,json,html` or `-r cli json html`) and may be repeated. The compact default view writes html+json unless `-r` is passed explicitly, which is honored exactly (including `cli`). |
| `-r, --report [cli\|json\|html\|markdown\|sarif\|junit]` | `cli,json,html` for direct workflows; `cli` for focused commands | Report format(s). Accepts comma- or space-separated values (`-r cli,json,html` or `-r cli json html`) and may be repeated. The compact default view writes html+json unless `-r` is passed explicitly, which is honored exactly (including `cli`). |
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
| `-o, --output-dir DIRECTORY` | `reports` | Directory for generated reports. |

In practice: a default `validate` run (no `-r`) shows the compact pipeline view **and** writes `json` + `html` report files; passing `-r` takes over completely — `-r cli` really means terminal output only, no files. The focused expert commands take the `cli` default literally: they print the full terminal report and write files only for the formats you request with `-r`. A `validate` run writes `skillevaluator-output-<timestamp>.json` / `.html` (plus `.md` with `-r markdown` or `.sarif.json` with `-r sarif`); standalone commands write a fixed `skillevaluator-<kind>` basename (for example `skillevaluator-quality.json`), so a re-run overwrites the previous report. Direct workflows write `skillevaluator-tier1` or `skillevaluator-tier2` reports in the selected formats and also overwrite previous files with that basename. Filename conventions and report anatomy live in [Reports & Results](/skills/skillevaluator/reports).
In practice: a default `validate` run (no `-r`) shows the compact pipeline view **and** writes `json` + `html` report files; passing `-r` takes over completely — `-r cli` really means terminal output only, no files. The focused expert commands take the `cli` default literally: they print the full terminal report and write files only for the formats you request with `-r`. A `validate` run writes `skillevaluator-output-<timestamp>.json` / `.html` (plus `.md` with `-r markdown`, `.sarif.json` with `-r sarif`, or `.junit.xml` with `-r junit`); standalone commands write a fixed `skillevaluator-<kind>` basename (for example `skillevaluator-quality.json`), so a re-run overwrites the previous report. Direct workflows write `skillevaluator-tier1` or `skillevaluator-tier2` reports in the selected formats and also overwrite previous files with that basename. Filename conventions and report anatomy live in [Reports & Results](/skills/skillevaluator/reports).

**Exit codes.** Commands communicate through a small exit-code contract — this is what your CI gates on (see [Gate Your CI](/skills/skillevaluator/ci-integration)):

Expand Down
20 changes: 20 additions & 0 deletions docs/gitlab-ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,26 @@ its detailed HTML report. JSON, Markdown and SARIF are included.
<img src="./assets/repository-ci-results-example.png" alt="Example report table showing a failed skill with a quality score of 98.2 and a link to its report" />
</Frame>

The shared `skill-evaluation` job writes JSON, Markdown and SARIF reports; it
does not produce JUnit XML yet. To show findings as a native GitLab
merge-request test report, run SkillEvaluator in your own job with `-r junit`
and attach the file it writes. `tier1` writes
`reports/skillevaluator-tier1.junit.xml`:

```yaml title="Run it yourself: JUnit test report"
skill-junit:
script:
- skillevaluator tier1 skills/foo -r junit -o reports
artifacts:
when: always
reports:
junit: reports/skillevaluator-tier1.junit.xml
```

`skillevaluator validate` on a folder of skills writes one file per skill
instead, as `reports/<skill>/skillevaluator-output-<timestamp>.junit.xml`;
point `junit:` at `reports/*/*.junit.xml` for that layout.

The [public examples](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/examples/README.md)
include this report preview and a log excerpt without requiring access to a
separate demo project.
Expand Down
45 changes: 42 additions & 3 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ no-color, redirected, and string-rendered output retains readable paths.
| `html` | Standalone HTML report (default) | A human needs to review or archive a run |
| `markdown` | Markdown for PR comments | You want the result posted on a pull request |
| `sarif` | SARIF 2.1.0 JSON | GitHub Code Scanning or other SARIF consumers need inline annotations |
| `junit` | JUnit XML | CI systems that show native test reports need a JUnit artifact |

HTML reports use a shared NVIDIA presentation across all three tiers, with
numbered Insights cards, expandable findings, and tables alongside charts.
Expand All @@ -94,8 +95,8 @@ Saved Light, Dark and System choices take precedence when browser storage is
available; System follows changes to the device preference.
Reports, including charts, work without a network connection.

```bash title="One run, four report files"
skillevaluator validate ./my-skill -r json,html,markdown,sarif -o reports
```bash title="One run, five report files"
skillevaluator validate ./my-skill -r json,html,markdown,sarif,junit -o reports
```

For gating a pipeline on the JSON output, see [Gate Your CI](/skills/skillevaluator/ci-integration).
Expand Down Expand Up @@ -332,12 +333,50 @@ Report filenames follow two patterns, both under the output directory:
| `context-optimization-check` | `skillevaluator-context` | Yes |
| `dedup-scan` | `skillevaluator-dedup` | Yes |

The extension matches the format (`.json`, `.html`, `.md`, `.sarif.json`); the `cli` format
The extension matches the format (`.json`, `.html`, `.md`, `.sarif.json`, `.junit.xml`); the `cli` format
prints to the terminal and never writes a file. A full `validate` run's
timestamp is `YYYYMMDDHHMMSS`, so
`-r json` produces something like `skillevaluator-output-20260709141530.json`
and never clobbers the previous run.

## JUnit report

`-r junit` writes one XML file for CI test-report consumers such as GitLab
merge-request test reports, Jenkins, Azure Pipelines, CircleCI, and Buildkite.

| JUnit element | SkillEvaluator source |
| --- | --- |
| `testsuites` | One document per run |
| `testsuite` | One check group (`ValidationResult`) |
| `testcase` | One check, finding, gate failure, or incomplete scanner |
| `failure` | A blocking finding, with `file:line` when recorded; an independent error on a group whose scanners all completed (schema errors, `No SKILL.md found`) as a case named `error`; or a gate failure, such as a minimum score, as a case named `gate_failure` |
| `error` | An `incomplete/<tool>` case for a scanner that did not complete, with `type="incomplete"` and the scanner's own reason when one was recorded (for example `skillspector not installed`); and, on a group with an incomplete scanner, each independent error that is not a gate failure (a crash or unusable scanner output, such as `Bandit did not return valid JSON; scan did not complete`) as a case named `error` with `type="execution"`. Other checks and findings in that group keep their real passed or failed status |
| `skipped` | A check group that did not run and does not fail the gate, as one case with its skip reason. A blocking group that was skipped is a `gate_failure` instead |
| `system-out` | Score and threshold when recorded, and non-failing finding text |

Counts on `testsuites` and each `testsuite` (`tests`, `failures`, `errors`,
`skipped`, `time`) match the cases they contain. A finding case is named
after its check and location, `check_name (path:line)` (or `check_name (path)`
when no line was recorded), so adding or reordering findings does not rename
the others in CI test history. File paths are relative to the Git repository
root that contains the target (the target folder when it is not in a Git
repository), from `validate` and from single-check commands alike. SARIF uses the
same base, resolution rules, and percent-encoding, so a file
name that is not valid UTF-8 stays distinct (`caf%E9.md`). In other text such a
name is backslash-escaped (`caf\xe9.md`), then characters XML 1.0 forbids are
stripped. An incomplete scan is never emitted as an all-passed suite, and a
run that failed on one never reports `failures` and `errors` both zero.

Failures follow the same gate as the exit code. When `validate` marks a group
as blocking and it fails the gate with no failing case of its own, for example
a scored Tier 3 verdict of FAIL or NEUTRAL under `--block-on-agent-eval`, the
suite gets a `gate_failure` case whose message is the cause: the first error,
the Tier 3 verdict, or the skip reason. An advisory group (Tier 3 without
`--block-on-agent-eval`, Tier 2 with `--no-block-on-dedup`) never adds a
`failure` or `error`; its findings, errors, and execution errors are kept in
`system-out` with an `Advisory, does not gate:` prefix, and its incomplete
scanners are `skipped`.

## HTML report

The HTML report is one self-contained file. It opens on the answer and puts
Expand Down
2 changes: 1 addition & 1 deletion docs/tier1-validation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ for skills. Its Tier 1 LLM checks still run only when requested.
Direct `tier1 PATH` and `tier1 validate PATH` print the terminal report and
write JSON and HTML reports by default. Use `-r cli` for terminal-only output.

Reports for any of these runs are selected with `-r`/`--report` (`cli`, `json`, `html`, `markdown`, `sarif`) and written to `-o`/`--output-dir` (default `reports/`). File naming, `BENCHMARK.md`, and the JSON contract are covered in [Reports & Results](/skills/skillevaluator/reports).
Reports for any of these runs are selected with `-r`/`--report` (`cli`, `json`, `html`, `markdown`, `sarif`, `junit`) and written to `-o`/`--output-dir` (default `reports/`). File naming, `BENCHMARK.md`, and the JSON contract are covered in [Reports & Results](/skills/skillevaluator/reports).

## Content types

Expand Down
1 change: 1 addition & 0 deletions skills/skillevaluator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Never print, echo, or commit API keys; keep them in the host environment.
| Same, without Docker | `skillevaluator tier3 evaluate <skill-dir> -a opencode --env-mode local` | provider, agent CLI on host |
| Everything, with one exit code | `skillevaluator validate <skill-dir>` | all of the above |
| CI-safe keyless gate | `skillevaluator validate <skills-dir> --profile default --tiers 1 -r json,markdown,sarif -o reports` | scanners |
| CI test report (JUnit XML) | add `junit` to `-r`, for example `-r json,sarif,junit` | same as the gate |
| Set up repo CI | `skillevaluator ci init` | GitHub checkout |

Full flag tables: [Tier 1](references/commands-tier1.md),
Expand Down
2 changes: 1 addition & 1 deletion skills/skillevaluator/references/commands-tier1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Global options go before the command: `skillevaluator -v validate <skill-dir>`.

| Flag | Default | Effect |
| --- | --- | --- |
| `-r, --report` | `cli,json,html` for `tier1 PATH`, `tier2 PATH`, `validate`; `cli` for focused commands | `cli`, `json`, `html`, `markdown`, `sarif`; comma-separated or repeated |
| `-r, --report` | `cli,json,html` for `tier1 PATH`, `tier2 PATH`, `validate`; `cli` for focused commands | `cli`, `json`, `html`, `markdown`, `sarif`, `junit`; comma-separated or repeated |
| `-o, --output-dir` | `reports` | Report directory |

Passing `-r` is honored exactly: `-r cli` writes no files. Basenames:
Expand Down
6 changes: 6 additions & 0 deletions skills/skillevaluator/references/reports-and-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ skillevaluator validate <skills-dir> --profile default --tiers 1 -c \
-r json,markdown,sarif -o reports --min-score 70
```

Add `junit` to `-r` when the CI system shows native test reports (GitLab
`artifacts:reports:junit`, Jenkins, Azure Pipelines). `tier1` writes
`skillevaluator-tier1.junit.xml`; `validate` on a skills folder writes
`<skill>/skillevaluator-output-<timestamp>.junit.xml` per skill. JUnit
failures follow the same gate as the exit code.

Adopt progressively: run with `|| true` (advisory), then gate on Tier 1,
raise `--min-score`, add `--llm --tiers 1,2` with a masked provider secret,
and finally an advisory Tier 3 job (`--block-on-agent-eval` when ready).
Expand Down
38 changes: 30 additions & 8 deletions src/skillevaluator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
)
from skillevaluator.tier3_environments import all_env_modes
from skillevaluator.tier_group import TierGroup
from skillevaluator.utils.helpers import resolve_git_root
from skillevaluator.utils.json_output import json_needs_ascii
from skillevaluator.utils.path_security import resolve_repo_context_root
from skillevaluator.utils.rich_markup import escape_markup, strip_terminal_controls
Expand Down Expand Up @@ -406,6 +407,7 @@ def _reject_linked_tier2_root(path: Path) -> None:
"html": ".html",
"markdown": ".md",
"sarif": ".sarif.json",
"junit": ".junit.xml",
}


Expand Down Expand Up @@ -497,7 +499,7 @@ def _report_options(func):
"report_formats",
cls=_MultiValueOption,
multiple=True,
type=click.Choice(["cli", "json", "html", "markdown", "sarif"]),
type=click.Choice(["cli", "json", "html", "markdown", "sarif", "junit"]),
default=("cli",),
show_default=True,
help="Report format(s). Accepts comma- or space-separated values "
Expand Down Expand Up @@ -618,6 +620,19 @@ def _resolve_report_output_location(target_path: Path, output_dir: Path) -> Path
)


def _report_roots(target_path: Path) -> dict[str, Path]:
"""Return the scan and repository roots SARIF and JUnit paths are made relative to.

The repository root is the Git root containing *target_path*, so a finding
reads the same repository-relative ``file`` from every command; outside Git
it falls back to the target folder.
"""
repository_root = resolve_git_root(target_path)
if repository_root is None:
repository_root = target_path if target_path.is_dir() else target_path.parent
return {"scan_root": target_path, "repository_root": repository_root}


def _resolve_file_report_output_location(
target_path: Path,
output_dir: Path,
Expand Down Expand Up @@ -1983,7 +1998,7 @@ def _finish_pipeline_view(
details += (context.coverage.text, *context.coverage.details)
details += (f"Publication eligibility: {context.publication_label}",)

ext = {"html": ".html", "json": ".json", "markdown": ".md", "sarif": ".sarif.json"}
ext = {"html": ".html", "json": ".json", "markdown": ".md", "sarif": ".sarif.json", "junit": ".junit.xml"}
links: list[tuple[str, str]] = [
("report" if fmt == "html" else fmt, str(output_dir / f"{basename}{ext[fmt]}"))
for fmt in report_formats
Expand Down Expand Up @@ -2616,7 +2631,7 @@ def validate(
)
from skillevaluator.reporting import CLIReporter
from skillevaluator.reporting.naming import REPORT_PREFIX
from skillevaluator.utils.helpers import make_timestamped_basename, resolve_git_remote_url, resolve_git_root
from skillevaluator.utils.helpers import make_timestamped_basename, resolve_git_remote_url
from skillevaluator.validators.policy import apply_policy, resolve_policy

if external and profile and profile not in {"default", "external"}:
Expand Down Expand Up @@ -3023,9 +3038,6 @@ def _on_case_rows(rows: list[TierRow]) -> None:
CONTENT_TYPE_PLUGIN: "Plugin",
}.get(resolved_type, "Skill")
target_display = resolve_git_remote_url(target_path) or str(target_path)
sarif_repository_root = resolve_git_root(target_path)
if sarif_repository_root is None:
sarif_repository_root = target_path if target_path.is_dir() else target_path.parent

# Quiet mode defaults the reports to html+json (the terminal shows only
# the summary; the files carry the findings) and points at them from the
Expand Down Expand Up @@ -3055,8 +3067,8 @@ def _on_case_rows(rows: list[TierRow]) -> None:
explicit_skill_name=publication_name if resolved_type == CONTENT_TYPE_SKILL and target_path.is_dir() else None,
content_label=content_label,
announce_paths=not quiet,
sarif_scan_root=target_path,
sarif_repository_root=sarif_repository_root,
**_report_roots(target_path),
catalog_root=catalog_root,
)
_record_validate_json_report(f"{report_basename_value}.json" if "json" in effective_formats else None)
if harness_rows and "json" in effective_formats:
Expand Down Expand Up @@ -3257,6 +3269,7 @@ def quality_check(
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("quality"),
**_report_roots(target_path),
):
raise click.ClickException("quality check failed")

Expand All @@ -3273,6 +3286,7 @@ def rubric_eval(target_path: Path, min_score: int, report_formats: tuple[str, ..
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("rubric"),
**_report_roots(target_path),
):
raise click.ClickException("rubric evaluation failed")

Expand Down Expand Up @@ -3300,6 +3314,7 @@ def security_scan(
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("security"),
**_report_roots(target_path),
):
raise click.ClickException("security scan failed")

Expand All @@ -3323,6 +3338,7 @@ def pii_scan(
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("pii"),
**_report_roots(target_path),
):
raise click.ClickException("PII scan failed")

Expand All @@ -3338,6 +3354,7 @@ def lint_scripts(target_path: Path, report_formats: tuple[str, ...], output_dir:
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("script-lint"),
**_report_roots(target_path),
):
raise click.ClickException("script lint failed")

Expand Down Expand Up @@ -3438,6 +3455,7 @@ def similarity_check(
report_formats=report_formats,
output_dir=output_dir,
basename=similarity_basename,
**_report_roots(content_path),
):
raise click.ClickException("similarity check failed")

Expand Down Expand Up @@ -3468,6 +3486,7 @@ def context_optimization_check(
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("context"),
**_report_roots(skill_path),
):
raise click.ClickException("context optimization check failed")

Expand Down Expand Up @@ -3503,6 +3522,7 @@ def dedup_scan(
report_formats=report_formats,
output_dir=output_dir,
basename=report_basename("dedup"),
**_report_roots(skill_path),
):
raise click.ClickException("dedup scan failed")

Expand Down Expand Up @@ -3613,6 +3633,7 @@ def _tier1_workflow(
basename=report_basename("tier1"),
policy=policy,
target_path=str(skill_path),
**_report_roots(skill_path),
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
):
raise click.ClickException("Tier 1 checks failed or were incomplete")

Expand Down Expand Up @@ -3682,6 +3703,7 @@ def _tier2_workflow(
output_dir=resolved_output_dir,
basename=basename,
target_path=str(skill_path),
**_report_roots(skill_path),
):
raise click.ClickException("Tier 2 checks failed or were incomplete")

Expand Down
Loading