Skip to content
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to SkillEvaluator are documented in this file.

## Unreleased

### Fixed

- Full validation runs use distinct report basenames even when they finish at
the same time, preserving each run's JSON, HTML and other selected reports.
The UTC timestamp changes from 14 to 20 digits (`YYYYMMDDHHMMSSffffff`),
followed by a hyphen and a 12-character random hexadecimal run ID. Tools
parsing report basenames must accept `skillevaluator-output-<timestamp>-<run-id>`;
existing `skillevaluator-output-*` globs still match.

## 1.4.0 - 2026-12-02

- Group Tier 1 bundle reports by bundle checks and effective member skills.
Expand Down
2 changes: 1 addition & 1 deletion docs/ci-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ The policy overlays the default rules, and the resulting profile name is stamped

## Parse the JSON

When the exit code is not enough — dashboards, custom thresholds, badge generation — read `reports/skillevaluator-output-<timestamp>.json`. The fields CI cares about sit at the top level:
When the exit code is not enough — dashboards, custom thresholds, badge generation — read `reports/skillevaluator-output-<timestamp>-<run-id>.json`. The fields CI cares about sit at the top level:

| Field | Type | Contents |
| --- | --- | --- |
Expand Down
4 changes: 2 additions & 2 deletions docs/cli-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ print the terminal report by default and write files for the formats you
request with `-r`.

File reports from `validate` use the basename
`skillevaluator-output-<timestamp>`. Standalone commands use a fixed
`skillevaluator-output-<timestamp>-<run-id>`. Standalone commands use a fixed
`skillevaluator-<kind>` basename, such as `skillevaluator-quality.json`.
Direct Tier 1 and Tier 2 workflows use `skillevaluator-tier1` and
`skillevaluator-tier2`. Re-running a command with a fixed basename overwrites
Expand Down Expand Up @@ -148,7 +148,7 @@ its own. Tier 1 always runs and gates the exit code, so `--tiers 2`,
| Tiers run | Only the named tier | Tier 1 plus any selected tiers |
| Tier 1 dependency audit | Included in `tier1 PATH` | Opt-in with `--checks`, which replaces the default list, so name every check you want plus `dependency` ([selection rules](/skills/skillevaluator/tier1-reference#narrow-to-specific-checks)) |
| Tier 1 LLM stages | Rubric, LLM security, and verification run when a provider is configured; `--no-llm` skips them | LLM security analysis runs only with `--llm`, and finding verification only with `--llm-verify`; no rubric stage |
| Reports | `tier1` and `tier2` default to `-r cli,json,html` and write `skillevaluator-tier1.*` or `skillevaluator-tier2.*` under `-o`. `tier3` writes its run under `--results-dir` and does not accept `-r` or `-o` | The compact view writes HTML and JSON as `skillevaluator-output-<timestamp>.*`; skill targets also get `BENCHMARK.md` |
| Reports | `tier1` and `tier2` default to `-r cli,json,html` and write `skillevaluator-tier1.*` or `skillevaluator-tier2.*` under `-o`. `tier3` writes its run under `--results-dir` and does not accept `-r` or `-o` | The compact view writes HTML and JSON as `skillevaluator-output-<timestamp>-<run-id>.*`; skill targets also get `BENCHMARK.md` |
| Exit code `1` | `tier1`: a check failed or required evidence is incomplete. `tier2`: HIGH or CRITICAL findings or a blocking analysis error. `tier3`: the run did not complete; a `FAIL` verdict alone exits `0` | Tier 1 failed; Tier 2 findings unless `--no-block-on-dedup`; Tier 3 only with `--block-on-agent-eval` |

For `tier2 PATH`, `tier3 PATH`, and `tier1 PATH --llm`, a missing provider is
Expand Down
2 changes: 1 addition & 1 deletion docs/gitlab-ci.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ skill-junit:
```

`skillevaluator validate` on a folder of skills writes one file per skill
instead, as `reports/<skill>/skillevaluator-output-<timestamp>.junit.xml`;
instead, as `reports/<skill>/skillevaluator-output-<timestamp>-<run-id>.junit.xml`;
point `junit:` at `reports/**/*.junit.xml` to include nested skill folders.

The [public examples](https://github.com/NVIDIA/SkillEvaluator/blob/main/ci/examples/README.md)
Expand Down
17 changes: 9 additions & 8 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ Report filenames follow two patterns, both under the output directory:

| Command | Basename | Overwrites? |
| --- | --- | --- |
| `validate` (full run) | `skillevaluator-output-<timestamp>` | Possible when reports share an output directory and UTC timestamp |
| `validate` (full run) | `skillevaluator-output-<timestamp>-<run-id>` | Distinct basename per run |
Comment thread
Afloat16 marked this conversation as resolved.
Resolved
| `quality-check` | `skillevaluator-quality` | Yes — fixed name per format |
| `rubric-eval` | `skillevaluator-rubric` | Yes |
| `security-scan` | `skillevaluator-security` | Yes |
Expand All @@ -440,12 +440,13 @@ The extension matches the format (`.json`, `.html`, `.md`, `.sarif.json`, `.juni
The `cli` and `github` formats write to the terminal. The `github` format
has no catalog-collision check because it has no report path.

A full `validate` run uses a UTC timestamp with one-second resolution
(`YYYYMMDDHHMMSS`). For example, `-r json` can write
`skillevaluator-output-20260709141530.json`. Two runs that generate reports
of the same format in the same second and use the same output directory can
replace the earlier file. Use a separate `--output-dir` per concurrent run
to retain each report.
A full `validate` run's basename includes a UTC timestamp with microseconds
(`YYYYMMDDHHMMSSffffff`) and a 12-character random hexadecimal run identifier. For example, `-r json`
can write
`skillevaluator-output-20260709141530123456-5e4a1670b53b.json`.
The identifier keeps simultaneous runs distinct even when their clock readings match.
All formats from one run share the same basename. Existing
`skillevaluator-output-*.json` glob patterns still find these reports.

## JUnit report

Expand Down Expand Up @@ -2015,7 +2016,7 @@ For CI and tooling, two JSON entry points matter:
Unscored metrics stay unscored rather than defaulting to 0.0, so
`overall_score` can be `null`.
- **`validate --tier3` runs** — the combined
`skillevaluator-output-<timestamp>.json` report embeds the Tier 3 payload
`skillevaluator-output-<timestamp>-<run-id>.json` report embeds the Tier 3 payload
alongside the Tier 1 and Tier 2 results, so one file covers all three
tiers. A bundle's run adds its `plugin_runtime` evidence. Each built-in Tier 1 or Tier 2 result carries its validated
`publication_evidence` producer marker alongside finalized gating metadata,
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 @@ -12,7 +12,7 @@ Global options go before the command: `skillevaluator -v validate <skill-dir>`.
| `-o, --output-dir` | `reports` | Report directory |

Passing `-r` is honored exactly: `-r cli` writes no files. Basenames:
`validate` writes `skillevaluator-output-<timestamp>.*`; `tier1`/`tier2` write
`validate` writes `skillevaluator-output-<timestamp>-<run-id>.*`; `tier1`/`tier2` write
`skillevaluator-tier1.*`/`skillevaluator-tier2.*`; focused commands write
`skillevaluator-<kind>.*` (for example `skillevaluator-quality.json`) and
overwrite earlier runs.
Expand Down
4 changes: 2 additions & 2 deletions skills/skillevaluator/references/reports-and-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## JSON fields to read

From `skillevaluator-output-<timestamp>.json` (or `skillevaluator-tier1.json`):
From `skillevaluator-output-<timestamp>-<run-id>.json` (or `skillevaluator-tier1.json`):

| Field | Meaning |
| --- | --- |
Expand Down Expand Up @@ -38,7 +38,7 @@ reads saved JSON, use the [recursive quality gate](https://docs.nvidia.com/skill
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
`<skill>/skillevaluator-output-<timestamp>-<run-id>.junit.xml` per skill. JUnit
failures follow the same gate as the exit code.

Add `github` to `-r` when a GitHub Actions job runs the CLI itself and needs
Expand Down
6 changes: 3 additions & 3 deletions src/skillevaluator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,9 @@ def _validate_progress_interval(_ctx: click.Context, _param: click.Parameter, va

Report formats (-r/--report):
cli Rich terminal output (default)
json Machine-readable JSON (skillevaluator-output-<timestamp>.json)
html Standalone HTML report (skillevaluator-output-<timestamp>.html)
markdown Markdown for PR comments (skillevaluator-output-<timestamp>.md)
json Machine-readable JSON (skillevaluator-output-<timestamp>-<run-id>.json)
html Standalone HTML report (skillevaluator-output-<timestamp>-<run-id>.html)
markdown Markdown for PR comments (skillevaluator-output-<timestamp>-<run-id>.md)

Tiers:
Tier 1 Static, security, and quality validation (gates the exit code).
Expand Down
8 changes: 5 additions & 3 deletions src/skillevaluator/utils/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@
from datetime import UTC, datetime
from pathlib import Path
from urllib.parse import quote
from uuid import uuid4

from skillevaluator.constants import SCAN_EXCLUDED_DIRS, SKILL_MANIFEST_FILE, SKILL_MANIFEST_VARIANTS
from skillevaluator.utils.path_security import matches_filesystem_name
from skillevaluator.utils.tier2_paths import is_link_or_reparse


def make_timestamped_basename(prefix: str, suffix: str = "") -> str:
"""Return ``<prefix>-YYYYMMDDHHMMSS<suffix>`` for report artifacts.
"""Return a sortable UTC timestamp and random run identifier for report artifacts.

Used so each combined ``validate`` run writes a distinct, sortable report
file rather than overwriting the previous one (SkillEvaluator parity). ``suffix``
is the optional file extension (e.g. ``".html"``); omit it to get the bare
timestamped basename.
"""
stamp = datetime.now(tz=UTC).strftime("%Y%m%d%H%M%S")
return f"{prefix}-{stamp}{suffix}"
stamp = datetime.now(tz=UTC).strftime("%Y%m%d%H%M%S%f")
# A finer clock alone still collides across processes or repeated clock readings.
return f"{prefix}-{stamp}-{uuid4().hex[:12]}{suffix}"


def _linked_directory_contains_skill(directory: Path) -> bool:
Expand Down
139 changes: 139 additions & 0 deletions tests/test_report_name_collisions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""A fast rerun must not replace the previous validation's report artifacts."""

from __future__ import annotations

import json
import re
import shutil
import subprocess
import sys
from concurrent.futures import ThreadPoolExecutor
from datetime import UTC, datetime
from pathlib import Path

import pytest
from click.testing import CliRunner

from skillevaluator import cli as cli_module
from skillevaluator.models.result import ValidationResult
from skillevaluator.utils import helpers


class _FrozenDatetime(datetime):
@classmethod
def now(cls, tz=None):
return cls(2026, 7, 9, 14, 15, 30, 123456, tzinfo=UTC).astimezone(tz)


@pytest.mark.parametrize("suffix", ["", ".json", ".sarif.json"])
def test_report_names_stay_distinct_with_an_identical_clock(monkeypatch, suffix: str) -> None:
monkeypatch.setattr(helpers, "datetime", _FrozenDatetime)

names = [helpers.make_timestamped_basename("skillevaluator-output", suffix) for _ in range(32)]

assert len(set(names)) == len(names)
assert all(
re.fullmatch(r"skillevaluator-output-20260709141530123456-[0-9a-f]{12}" + re.escape(suffix), name)
for name in names
)
assert all(name.endswith(suffix) for name in names)
assert all(Path(name).name == name for name in names)


def test_concurrent_validate_processes_keep_separate_reports(tmp_path: Path) -> None:
script = """
import sys
from datetime import UTC, datetime
from unittest.mock import patch
from skillevaluator.cli import cli
from skillevaluator.utils import helpers
with patch.object(helpers, 'datetime') as clock:
clock.now.return_value = datetime(2026, 7, 9, 14, 15, 30, 123456, tzinfo=UTC)
cli.main(sys.argv[1:])
"""
skill = tmp_path / "simple"
shutil.copytree(Path(__file__).parent / "fixtures" / "skills" / "simple", skill)
reports = tmp_path / "reports"
command = [
sys.executable,
"-c",
script,
"validate",
str(skill),
"--tiers",
"1",
"--checks",
"schema",
"--no-llm",
"--report",
"json,html",
"--output-dir",
str(reports),
]

def run(_index: int) -> subprocess.CompletedProcess[str]:
return subprocess.run(command, capture_output=True, text=True, encoding="utf-8", timeout=30, check=False)

with ThreadPoolExecutor(max_workers=2) as executor:
completed = list(executor.map(run, range(2)))

assert all(item.returncode == 0 for item in completed), [(item.stdout, item.stderr) for item in completed]
json_reports = list(reports.glob("skillevaluator-output-*.json"))
assert len(json_reports) == 2
assert all(report.with_suffix(".html").is_file() for report in json_reports)
assert all(json.loads(report.read_text(encoding="utf-8"))["overall_passed"] for report in json_reports)


@pytest.mark.parametrize("catalog", [False, True])
def test_validate_same_clock_preserves_both_runs_and_current_catalog_link(
tmp_path: Path, monkeypatch, catalog: bool
) -> None:
monkeypatch.setattr(helpers, "datetime", _FrozenDatetime)
target = tmp_path / "catalog" if catalog else tmp_path / "simple"
skill = target / "simple" if catalog else target
shutil.copytree(Path(__file__).parent / "fixtures" / "skills" / "simple", skill)
first = ValidationResult(validator_name="Example")
second = ValidationResult(validator_name="Example")
second.add_error("Second run's failure must not replace the first run")
outcomes = iter([[first], [second]])
monkeypatch.setattr(cli_module, "run_validation", lambda *_args, **_kwargs: next(outcomes))
reports = tmp_path / "reports"
report_dir = reports / "simple" if catalog else reports
command = [
"validate",
str(target),
"--tiers",
"1",
"--checks",
"schema",
"--no-llm",
"--report",
"json,html",
"--output-dir",
str(reports),
]
runner = CliRunner()

completed = runner.invoke(cli_module.cli, command)
assert completed.exit_code == 0, completed.output
(first_json,) = report_dir.glob("skillevaluator-output-*.json")
first_html = first_json.with_suffix(".html")
saved_json, saved_html = first_json.read_bytes(), first_html.read_bytes()

failed = runner.invoke(cli_module.cli, command)
assert failed.exit_code != 0, failed.output
json_reports = sorted(report_dir.glob("skillevaluator-output-*.json"))
assert len(json_reports) == 2
assert first_json.read_bytes() == saved_json
assert first_html.read_bytes() == saved_html
second_json = next(report for report in json_reports if report != first_json)
assert second_json.with_suffix(".html").is_file()
assert json.loads(saved_json)["overall_passed"] is True
assert json.loads(second_json.read_text(encoding="utf-8"))["overall_passed"] is False
if catalog:
summary = json.loads((reports / "catalog-summary.json").read_text(encoding="utf-8"))
assert summary["skills"][0]["json_report"] == second_json.name
assert summary["skills"][0]["overall_status"] == "failed"