Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

fix(reporting): enforce benchmark publication evidence

Narendran Raghavan492a6997a251
diff --cc .github/workflows/ci.yml
index 620c83cb,620c83cb..a1bbc251
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@@ -29,6 -29,6 +29,9 @@@ jobs
- name: Scan OSS source boundary
if: matrix.python-version == '3.12'
run: python scripts/check_oss_boundary.py --root . --allowlist config/oss_boundary_allowlist.json
++ - name: Check public benchmark publication cards
++ if: matrix.python-version == '3.12'
++ run: python scripts/ci/check_public_benchmarks.py --require-files tests/golden
- if: matrix.python-version == '3.12'
run: uv run ruff check .
- name: Run tests with coverage
diff --cc src/skillevaluator/reporting/benchmark.py
index 7f10d956,b052f4e2..8c61cc0f
--- a/src/skillevaluator/reporting/benchmark.py
+++ b/src/skillevaluator/reporting/benchmark.py
@@@ -561,43 -430,12 +561,61 @@@ def _agent_eval_payload(results: list[V
return None
-def _render_failed_benchmark_notes(lines: list[str]) -> None:
- lines.append(
- "The skill should be reviewed before SkillEvaluator publication. "
- "**Skill owners should address the applicable findings below and rerun "
- "SkillEvaluator to refresh this benchmark.**"
+def _mapping(value: object) -> dict[str, Any]:
+ return value if isinstance(value, dict) else {}
+
+
+def _benchmark_policy(
+ results: list[ValidationResult],
+ ae: dict[str, Any] | None,
+) -> dict[str, bool]:
+ """Resolve the persisted publication policy, defaulting Tier 3 to required."""
+ candidates: list[object] = [
+ (ae or {}).get("benchmark_policy"),
+ _mapping((ae or {}).get("summary")).get("benchmark_policy"),
+ ]
+ candidates.extend(
+ result.metadata.get("benchmark_policy") for result in results if isinstance(result.metadata, dict)
+ )
+ for candidate in candidates:
+ if not isinstance(candidate, dict):
+ continue
+ required = candidate.get("tier3_required")
+ if isinstance(required, bool):
+ return {"tier3_required": required}
+ return {"tier3_required": True}
+
+
+def _tier3_evidence_complete(ae: dict[str, Any] | None) -> bool:
- """Require an actual supported-agent verdict, with legacy compatibility."""
- if not isinstance(ae, dict) or not _agents(ae):
++ """Require a succeeded run with the minimum publication provenance."""
++ if not isinstance(ae, dict):
++ return False
++ agents = _agents(ae)
++ if not agents or any(
++ not str(agent.get("model") or agent.get("model_name") or agent.get("llm_model") or "").strip()
++ for agent in agents.values()
++ ):
+ return False
+ summary = _mapping(ae.get("summary"))
+ verdict = str(ae.get("verdict") or summary.get("verdict") or "").lower()
+ if verdict not in {"pass", "neutral", "fail"}:
+ return False
+ execution_status = str(ae.get("execution_status") or summary.get("execution_status") or "").lower()
- # Historical payloads predate execution_status. Their recorded agents and
- # verdict are the strongest available evidence and remain renderable.
- return execution_status in {"", "succeeded"}
++ evaluated_at = ae.get("evaluated_at") or summary.get("evaluated_at")
++ evaluator_version = ae.get("evaluator_version") or summary.get("evaluator_version")
++ dataset_digest = ae.get("dataset_digest") or summary.get("dataset_digest")
++ attempt_policy = _mapping(ae.get("attempt_policy"))
++ attempts = _nonnegative_int(attempt_policy.get("max_attempts"))
++ environment = summary.get("environment") or ae.get("environment")
++ return bool(
++ execution_status == "succeeded"
++ and str(evaluated_at or "").strip()
++ and str(evaluator_version or "").strip()
++ and str(dataset_digest or "").strip()
++ and _dataset_summary(ae)["total_tasks"] > 0
++ and attempts > 0
++ and str(environment or "").strip()
+ )
def _advisory_agent_eval_skip_message(results: list[ValidationResult]) -> str | None:
@@@ -611,43 -449,12 +629,38 @@@
return None
-def _combined_verdict(results: list[ValidationResult], tier3_verdict: object) -> str:
- """Return one report verdict with incomplete evidence taking precedence."""
+def _result_skipped(result: ValidationResult) -> bool:
+ """Return whether a result records a skipped validator run."""
+ return bool(result.metadata.get("skipped")) or is_advisory_agent_eval_skip(result)
+
+
+def _overall_status(
+ results: list[ValidationResult],
+ ae: dict[str, Any] | None,
+ benchmark_policy: dict[str, bool],
+) -> str:
if any(result.is_incomplete for result in results):
return "INCOMPLETE"
- if not all(passes_required_gate(result) for result in results) or str(tier3_verdict or "pass").lower() == "fail":
+
+ blocking_skips = [
+ result
+ for result in results
+ if _result_skipped(result) and not result.metadata.get("optional") and not is_advisory_agent_eval_skip(result)
+ ]
+ if blocking_skips:
+ return "INCOMPLETE"
+
+ has_failures = not all(passes_required_gate(result) for result in results)
+ summary = _mapping((ae or {}).get("summary"))
+ verdict = str((ae or {}).get("verdict") or summary.get("verdict") or "").lower()
+ if has_failures or verdict == "fail":
return "FAIL"
+
- if (
- benchmark_policy["tier3_required"]
- and not _tier3_evidence_complete(ae)
- and not _advisory_agent_eval_skip_message(results)
- ):
- return "INCOMPLETE"
-
+ execution_status = str((ae or {}).get("execution_status") or summary.get("execution_status") or "").lower()
+ if verdict == "neutral" and execution_status in {"succeeded", ""}:
+ return "NEUTRAL"
++ if benchmark_policy["tier3_required"] and not _tier3_evidence_complete(ae):
++ return "INCOMPLETE"
return "PASS"
diff --cc tests/test_public_benchmark_gate.py
index f8d3db8e,00000000..4e56e30f
mode 100644,000000..100644
--- a/tests/test_public_benchmark_gate.py
+++ b/tests/test_public_benchmark_gate.py
@@@ -1,393 -1,0 +1,432 @@@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+"""Tests for the generated BENCHMARK.md publication gate."""
+
+from __future__ import annotations
+
+from pathlib import Path
+
+import pytest
+from scripts.ci import check_public_benchmarks as benchmark_gate
+
++from skillevaluator.evaluation.tier3_report import advisory_skip_result
+from skillevaluator.models import Finding, Severity, ValidationResult
+from skillevaluator.reporting import BenchmarkReporter
+
+
+def _private_sandbox_name() -> str:
+ """Build the retired private label without embedding it in public source."""
+ private_name = chr(65) + "stra"
+ return f"{private_name} sandbox"
+
+
+def _valid_benchmark() -> str:
+ return """\
+# Skill Benchmark: demo
+
+> **Overall verdict: PASS**
+
+## Evaluation Metadata
+
+- Evaluation date: 2026-07-25
+- Evaluator version: `0.8.3`
+- Agents: Codex (`gpt-codex`)
+- Tasks: 4 evaluation tasks
+- Dataset digest: `sha256:0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
+- Attempts per task: 1
+- Environment: `Isolated sandbox`
+- Tier 3 evidence: required for publication
+
+## Results at a Glance
+
+| Measure | Codex (Baseline → Skill Uplift) |
+|---|---:|
+| Overall | 47% → 92% (+45 points) |
+
+## Tier Status
+
+| Tier | Purpose | Status | Evidence |
+|---|---|---|---|
+| Tier 1 | Static validation | **PASSED** | Complete |
+| Tier 2 | Semantic deduplication | **PASSED** | Complete |
+| Tier 3 | Live agent evaluation | **PASS** | Complete |
+
+## Freshness
+
+Regenerate after material inputs change.
+"""
+
+
+def test_gate_accepts_redesigned_public_card(tmp_path: Path) -> None:
+ benchmark = tmp_path / "skill" / "BENCHMARK.md"
+ benchmark.parent.mkdir()
+ benchmark.write_text(_valid_benchmark(), encoding="utf-8")
+
+ files, offenders = benchmark_gate.find_offenders([tmp_path])
+
+ assert files == [benchmark.resolve()]
+ assert offenders == []
+
+
+def test_gate_rejects_legacy_and_private_output(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(
+ _valid_benchmark()
+ + f"\n- Finding: Observed in {_private_sandbox_name()} during evaluation\n"
+ + "- Skill Evaluator profile: external\n"
+ + "- Finding: `/Users/private/repo/SKILL.md`\n"
+ + "Generated by legacy-skills-eval v1.2\n"
+ + "| Dimension | Num | Codex |\n"
+ + "| Security | 8 | 92% (+45%) |\n",
+ encoding="utf-8",
+ )
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+ reasons = {offender.reason for offender in offenders}
+
+ assert reasons == {
+ "internal environment identity",
+ "internal validation profile",
+ "retired product identity",
+ "absolute macOS user path",
+ "legacy Num score column",
+ "legacy ambiguous uplift cell",
+ }
+
+
+def test_gate_rejects_old_card_missing_decision_sections(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text("# Evaluation Report\n", encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ reasons = {offender.reason for offender in offenders}
+ assert "missing required section: # Skill Benchmark:" in reasons
+ assert "missing required section: ## Evaluation Metadata" in reasons
+ assert "missing required section: - Evaluation date:" in reasons
+ assert "missing required section: - Evaluator version:" in reasons
+ assert "missing required section: - Agents:" in reasons
+ assert "missing required section: - Tasks:" in reasons
+ assert "missing required section: - Attempts per task:" in reasons
+ assert "missing required section: - Environment:" in reasons
+ assert "missing Tier 3 status row" in reasons
+
+
+def test_gate_requires_explicit_agent_model_state(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(_valid_benchmark().replace("Agents: Codex (`gpt-codex`)", "Agents: Codex"), encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert {offender.reason for offender in offenders} == {"agent model identity not recorded"}
+
+
+ "field",
+ [
+ "Evaluation date",
+ "Evaluator version",
+ "Tasks",
+ "Dataset digest",
+ "Attempts per task",
+ "Environment",
+ "Tier 3 evidence",
+ ],
+)
+def test_gate_rejects_blank_required_metadata_values(tmp_path: Path, field: str) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ lines = [f"- {field}:" if line.startswith(f"- {field}:") else line for line in _valid_benchmark().splitlines()]
+ benchmark.write_text("\n".join(lines) + "\n", encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert f"invalid metadata field: - {field}:" in {offender.reason for offender in offenders}
+
+
+def test_gate_requires_metadata_fields_inside_metadata_section(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ date_line = "- Evaluation date: 2026-07-25"
+ content = _valid_benchmark().replace(f"{date_line}\n", "")
+ benchmark.write_text(content + f"\n{date_line}\n", encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert "missing metadata field: - Evaluation date:" in {offender.reason for offender in offenders}
+
+
+ "profile_line",
+ [
+ "- Profile: internal",
+ "- Profile: `external`",
+ "- Skill Evaluator profile: external",
+ "- skill evaluator Profile: `internal`",
+ ],
+)
+def test_gate_rejects_historical_profile_shapes(tmp_path: Path, profile_line: str) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(_valid_benchmark() + f"\n{profile_line}\n", encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert "internal validation profile" in {offender.reason for offender in offenders}
+
+
+def test_gate_rejects_internal_sandbox_phrase_anywhere_but_preserves_astra_db(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(
+ _valid_benchmark()
+ + "\n- Skill: `astra-db`\n"
+ + f"- Finding: Observed in {_private_sandbox_name()} during evaluation\n",
+ encoding="utf-8",
+ )
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert [offender.reason for offender in offenders] == ["internal environment identity"]
+
+
+def _tier1_result() -> ValidationResult:
+ result = ValidationResult(validator_name="Schema & Repository Governance")
+ result.metadata["quality_scores"] = {"skill_name": "demo-skill"}
+ result.add_success("schema", "Schema passed")
+ return result
+
+
+def _tier3_result(verdict: str, *, legacy: bool = False) -> ValidationResult:
+ result = ValidationResult(validator_name="AGENT_EVAL")
+ payload: dict = {
+ "skill_name": "demo-skill",
+ "verdict": verdict.lower(),
+ "summary": {
+ "verdict": verdict.lower(),
+ "environment": "docker",
+ },
+ "agents": {"codex": {} if legacy else {"model": "gpt-codex"}},
+ }
+ if not legacy:
+ payload.update(
+ {
+ "execution_status": "succeeded",
+ "evaluated_at": "2026-07-25T12:00:00+00:00",
+ "evaluator_version": "0.8.3",
+ "dataset_summary": {
+ "total_tasks": 4,
+ "positive_tasks": 3,
+ "negative_tasks": 1,
+ "unclassified_tasks": 0,
+ "source": "dataset",
+ },
+ "dataset_digest": "sha256:0123456789abcdef",
+ "dataset_digest_algorithm": "skill-evaluator-dataset-snapshot/1",
+ "attempt_policy": {"max_attempts": 1, "pass_threshold": 0.5},
+ }
+ )
+ payload["summary"]["execution_status"] = "succeeded"
+ result.metadata["agent_eval"] = payload
+ result.add_success("agent_eval", "Live evaluation completed")
+ return result
+
+
[email protected]("verdict", ["PASS", "FAIL", "NEUTRAL"])
+def test_real_reporter_cards_pass_publication_gate(tmp_path: Path, verdict: str) -> None:
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([_tier1_result(), _tier3_result(verdict)])
+ benchmark = tmp_path / verdict.lower() / "BENCHMARK.md"
+ benchmark.parent.mkdir()
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert f"Overall verdict: {verdict}" in rendered
+ assert offenders == []
+
+
+def test_real_incomplete_and_legacy_cards_pass_publication_gate(tmp_path: Path) -> None:
+ cards = {
+ "incomplete": BenchmarkReporter(include_timestamp=True).render_all([_tier1_result()]),
+ "legacy": BenchmarkReporter(include_timestamp=True).render_all(
+ [_tier1_result(), _tier3_result("NEUTRAL", legacy=True)]
+ ),
+ }
+ for name, rendered in cards.items():
+ benchmark = tmp_path / name / "BENCHMARK.md"
+ benchmark.parent.mkdir()
+ benchmark.write_text(rendered, encoding="utf-8")
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+ assert offenders == [], f"{name}: {offenders}"
+
+
++def test_legacy_pass_is_incomplete_without_publication_provenance(tmp_path: Path) -> None:
++ rendered = BenchmarkReporter(include_timestamp=True).render_all(
++ [_tier1_result(), _tier3_result("PASS", legacy=True)]
++ )
++ benchmark = tmp_path / "BENCHMARK.md"
++ benchmark.write_text(rendered, encoding="utf-8")
++
++ _files, offenders = benchmark_gate.find_offenders([benchmark])
++
++ assert "Overall verdict: INCOMPLETE" in rendered
++ assert "## Publication Recommendation" not in rendered
++ assert offenders == []
++
++
++ ("tier3_required", "expected_verdict"),
++ [(True, "INCOMPLETE"), (False, "PASS")],
++)
++def test_advisory_tier3_skip_respects_publication_policy(
++ tmp_path: Path,
++ tier3_required: bool,
++ expected_verdict: str,
++) -> None:
++ tier1 = _tier1_result()
++ tier1.metadata["benchmark_policy"] = {"tier3_required": tier3_required}
++ rendered = BenchmarkReporter(include_timestamp=True).render_all(
++ [tier1, advisory_skip_result("Live evaluation runtime unavailable", skill_name="demo-skill")]
++ )
++ benchmark = tmp_path / "BENCHMARK.md"
++ benchmark.write_text(rendered, encoding="utf-8")
++
++ _files, offenders = benchmark_gate.find_offenders([benchmark])
++
++ assert f"Overall verdict: {expected_verdict}" in rendered
++ assert "| Tier 3 | Live agent evaluation | **SKIPPED (ADVISORY)** |" in rendered
++ assert offenders == []
++
++
+def test_reporter_without_generation_timestamp_passes_publication_gate(tmp_path: Path) -> None:
+ rendered = BenchmarkReporter(include_timestamp=False).render_all([_tier1_result()])
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert "- Evaluation date: not recorded (legacy or non-live result)" in rendered
+ assert offenders == []
+
+
+def test_reporter_sanitizes_finding_before_publication_gate(tmp_path: Path) -> None:
+ tier3 = _tier3_result("PASS")
+ tier3.add_finding(
+ Finding(
+ category="AGENT_EVAL",
+ severity=Severity.LOW,
+ check_name="environment",
+ message=f"Observed in {_private_sandbox_name()} during evaluation",
+ file_path=None,
+ )
+ )
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([_tier1_result(), tier3])
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert _private_sandbox_name() not in rendered
+ assert "Observed in isolated sandbox during evaluation" in rendered
+ assert offenders == []
+
+
+ "private_path",
+ [
+ "/Users/private/catalog/SKILL.md",
+ "/home/private/catalog/SKILL.md",
+ r"C:\Users\private\catalog\SKILL.md",
+ ],
+)
+def test_reporter_sanitizes_absolute_paths_inside_finding_messages(
+ tmp_path: Path,
+ private_path: str,
+) -> None:
+ tier3 = _tier3_result("PASS")
+ tier3.add_finding(
+ Finding(
+ category="AGENT_EVAL",
+ severity=Severity.LOW,
+ check_name="private_path",
+ message=f"Read private artifact at {private_path}",
+ file_path=None,
+ )
+ )
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([_tier1_result(), tier3])
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert private_path not in rendered
+ assert offenders == []
+
+
+def test_real_optional_tier3_policy_card_passes_gate(tmp_path: Path) -> None:
+ tier1 = _tier1_result()
+ tier1.metadata["benchmark_policy"] = {"tier3_required": False}
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([tier1])
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert "Overall verdict: PASS" in rendered
+ assert "- Tier 3 evidence: optional by policy" in rendered
+ assert offenders == []
+
+
+def test_gate_rejects_pass_with_missing_required_tier3(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(
+ _valid_benchmark().replace(
+ "| Tier 3 | Live agent evaluation | **PASS** | Complete |",
+ "| Tier 3 | Live agent evaluation | **NOT RUN** | No result was recorded |",
+ ),
+ encoding="utf-8",
+ )
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert {offender.reason for offender in offenders} == {"publication PASS without completed Tier 3 evidence"}
+
+
+def test_gate_does_not_treat_pass_in_tier3_evidence_as_completion(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(
+ _valid_benchmark().replace(
+ "| Tier 3 | Live agent evaluation | **PASS** | Complete |",
+ "| Tier 3 | Live agent evaluation | **NOT RUN** | Previous result **PASS** |",
+ ),
+ encoding="utf-8",
+ )
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert {offender.reason for offender in offenders} == {"publication PASS without completed Tier 3 evidence"}
+
+
+def test_require_files_fails_empty_tree(tmp_path: Path, capsys) -> None:
+ assert benchmark_gate.main(["--require-files", str(tmp_path)]) == 1
+ assert "no BENCHMARK.md files found" in capsys.readouterr().out
+
+
+def test_gate_reports_invalid_utf8_as_unreadable(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_bytes(b"\xff\xfe\x00")
+
+ files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert files == [benchmark.resolve()]
+ assert offenders == [benchmark_gate.Offender(benchmark.resolve(), 1, "unreadable file (UnicodeDecodeError)")]
+
+
+def test_gate_reports_nonexistent_input_path(tmp_path: Path, capsys) -> None:
+ missing = tmp_path / "missing"
+
+ files, offenders = benchmark_gate.find_offenders([missing])
+
+ assert files == []
+ assert offenders == [benchmark_gate.Offender(missing.resolve(), 1, "input path does not exist")]
+ assert benchmark_gate.main(["--require-files", str(missing)]) == 1
+ output = capsys.readouterr().out
+ assert str(missing.resolve()) in output
+ assert "input path does not exist" in output