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 Raghavanee9fd4dc598b
diff --git a/scripts/ci/check_public_benchmarks.py b/scripts/ci/check_public_benchmarks.py
index 29f23abe..a2d7a7e4 100644
--- a/scripts/ci/check_public_benchmarks.py
+++ b/scripts/ci/check_public_benchmarks.py
@@ -79,6 +79,7 @@ _AGENT_MODEL_STATE = re.compile(
r"^[^,]+ \((?:`[^`,]+`|model not recorded)\)$",
flags=re.IGNORECASE,
)
+_RECORDED_AGENT_MODEL_STATE = re.compile(r"^[^,]+ \(`[^`,]+`\)$")
_OVERALL_PASS = re.compile(
r"^\s*>\s*.*Overall verdict:\s*PASS\b",
flags=re.IGNORECASE | re.MULTILINE,
@@ -113,6 +114,20 @@ _METADATA_FIELD_RULES = (
re.compile(r"(?:required for publication|optional by policy)", flags=re.IGNORECASE),
),
)
+_PASS_METADATA_FIELD_RULES = (
+ ("Evaluation date", re.compile(r"\d{4}-\d{2}-\d{2}")),
+ ("Evaluator version", re.compile(r"`[^`\s][^`]*`")),
+ ("Tasks", re.compile(r"[1-9]\d*\s+evaluation tasks?(?:\s+\(.*\))?", flags=re.IGNORECASE)),
+ (
+ "Dataset digest",
+ re.compile(
+ r"`sha256:[0-9a-f]{64}`\s+\(skill-evaluator-dataset-snapshot/1\)",
+ flags=re.IGNORECASE,
+ ),
+ ),
+ ("Attempts per task", re.compile(r"[1-9]\d*")),
+ ("Environment", re.compile(r"`[^`\s][^`]*`")),
+)
@dataclass(frozen=True)
@@ -262,10 +277,40 @@ def _check_verdict_tier_consistency(path: Path, text: str, offenders: list[Offen
line_number, tier3_status = tier3_row
tier3_complete = tier3_status == "PASS"
tier3_optional = (_metadata_field_value(text, "Tier 3 evidence") or "").lower() == "optional by policy"
+ if not tier3_optional:
+ _check_pass_provenance(path, text, offenders)
if not tier3_complete and not tier3_optional:
offenders.append(Offender(path, line_number, "publication PASS without completed Tier 3 evidence"))
+def _check_pass_provenance(path: Path, text: str, offenders: list[Offender]) -> None:
+ """Reject PASS cards that replace required provenance with legacy placeholders."""
+ metadata_lines = _metadata_section_lines(text)
+ fallback_line = metadata_lines[0][0] if metadata_lines else 1
+ for field, pattern in _PASS_METADATA_FIELD_RULES:
+ matches = _metadata_field_matches(metadata_lines, field)
+ line_number = matches[0][0] if matches else fallback_line
+ if len(matches) != 1 or not pattern.fullmatch(matches[0][1]):
+ offenders.append(
+ Offender(path, line_number, f"publication PASS without recorded {field.lower()}")
+ )
+
+ agent_matches = _metadata_field_matches(metadata_lines, "Agents")
+ line_number = agent_matches[0][0] if agent_matches else fallback_line
+ if len(agent_matches) != 1:
+ return
+ value = agent_matches[0][1]
+ if (value.lower().startswith("not recorded") or _valid_agent_model_states(value)) and not (
+ _valid_recorded_agent_models(value)
+ ):
+ offenders.append(Offender(path, line_number, "publication PASS without recorded agent model identity"))
+
+
+def _valid_recorded_agent_models(value: str) -> bool:
+ agents = [agent.strip() for agent in value.split(",")]
+ return bool(agents) and all(_RECORDED_AGENT_MODEL_STATE.fullmatch(agent) for agent in agents)
+
+
def find_offenders(roots: list[Path]) -> tuple[list[Path], list[Offender]]:
files: set[Path] = set()
offenders: list[Offender] = []
diff --git a/src/skillevaluator/reporting/benchmark.py b/src/skillevaluator/reporting/benchmark.py
index 8c61cc0f..1c9c6c03 100644
--- a/src/skillevaluator/reporting/benchmark.py
+++ b/src/skillevaluator/reporting/benchmark.py
@@ -606,9 +606,15 @@ def _tier3_evidence_complete(ae: dict[str, Any] | None) -> bool:
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")
+ environment = (
+ summary.get("environment")
+ or summary.get("requested_environment")
+ or ae.get("environment")
+ or ae.get("requested_environment")
+ )
return bool(
execution_status == "succeeded"
+ and _tier3_dimension_verdict(ae) is not None
and str(evaluated_at or "").strip()
and str(evaluator_version or "").strip()
and str(dataset_digest or "").strip()
@@ -618,6 +624,58 @@ def _tier3_evidence_complete(ae: dict[str, Any] | None) -> bool:
)
+def _tier3_dimension_verdict(ae: dict[str, Any] | None) -> str | None:
+ """Recompute the canonical verdict from every supported agent's dimensions."""
+ supported_agents = [agent for agent in _agents(ae).values() if agent.get("execution_status") == "succeeded"]
+ if not supported_agents:
+ return None
+
+ agent_verdicts: list[str] = []
+ for agent in supported_agents:
+ scores = _agent_dimension_scores(agent)
+ if scores is None:
+ return None
+ if any(score < DIMENSION_VERDICT_NEUTRAL_THRESHOLD for score in scores):
+ agent_verdicts.append("fail")
+ elif any(score < DIMENSION_VERDICT_PASS_THRESHOLD for score in scores):
+ agent_verdicts.append("neutral")
+ else:
+ agent_verdicts.append("pass")
+
+ if "pass" in agent_verdicts:
+ return "pass"
+ if "neutral" in agent_verdicts:
+ return "neutral"
+ return "fail"
+
+
+def _agent_dimension_scores(agent: dict[str, Any]) -> list[float] | None:
+ """Return all configured in-range dimension scores, rejecting partial evidence."""
+ raw_dimensions = agent.get("dimensions")
+ if not isinstance(raw_dimensions, list):
+ return None
+ dimensions: dict[str, dict[str, Any]] = {}
+ for dimension in raw_dimensions:
+ if not isinstance(dimension, dict):
+ continue
+ dimension_id = str(dimension.get("id") or "")
+ if dimension_id in dimensions:
+ return None
+ dimensions[dimension_id] = dimension
+
+ scores: list[float] = []
+ for dimension_id in DIMENSION_MAPPING:
+ dimension = dimensions.get(dimension_id)
+ if dimension is None:
+ return None
+ value = dimension.get("with_skill") if "with_skill" in dimension else dimension.get("score")
+ score = _number(value)
+ if score is None or not 0.0 <= score <= 1.0:
+ return None
+ scores.append(score)
+ return scores
+
+
def _advisory_agent_eval_skip_message(results: list[ValidationResult]) -> str | None:
for result in results:
if not is_advisory_agent_eval_skip(result):
@@ -653,14 +711,17 @@ def _overall_status(
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":
+ dimension_verdict = _tier3_dimension_verdict(ae)
+ if has_failures or verdict == "fail" or dimension_verdict == "fail":
return "FAIL"
+ if benchmark_policy["tier3_required"] and not _tier3_evidence_complete(ae):
+ 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"
+ if verdict == "pass" and dimension_verdict == "neutral":
+ return "NEUTRAL"
return "PASS"
@@ -903,12 +964,23 @@ def _tier_status(
if tier == "Tier 3" and ae:
summary = _mapping(ae.get("summary"))
- execution = str(ae.get("execution_status") or summary.get("execution_status") or "")
- verdict = str(ae.get("verdict") or summary.get("verdict") or "").upper()
+ execution = str(ae.get("execution_status") or summary.get("execution_status") or "").lower()
+ verdict = str(ae.get("verdict") or summary.get("verdict") or "").lower()
+ dimension_verdict = _tier3_dimension_verdict(ae)
+ if verdict == "fail" or dimension_verdict == "fail":
+ return "FAIL", f"{len(_agents(ae))} agent(s); {_dataset_summary(ae)['total_tasks']} task(s)"
if execution and execution != "succeeded":
return "INCOMPLETE", f"Execution status: {execution}"
- if verdict in {"PASS", "NEUTRAL", "FAIL"}:
- return verdict, f"{len(_agents(ae))} agent(s); {_dataset_summary(ae)['total_tasks']} task(s)"
+ policy = _benchmark_policy(results, ae)
+ if policy["tier3_required"] and not _tier3_evidence_complete(ae):
+ return "INCOMPLETE", "Required Tier 3 evidence is missing"
+ effective_verdict = verdict
+ if verdict == "pass" and dimension_verdict == "neutral":
+ effective_verdict = "neutral"
+ if effective_verdict in {"pass", "neutral"}:
+ return effective_verdict.upper(), (
+ f"{len(_agents(ae))} agent(s); {_dataset_summary(ae)['total_tasks']} task(s)"
+ )
status = "PASSED WITH OBSERVATIONS" if findings else "PASSED"
return status, f"{len(results)} validator(s); {len(findings)} finding(s)"
@@ -1016,7 +1088,12 @@ def _private_environment_labels(ae: dict[str, Any] | None) -> tuple[str, ...]:
if not ae:
return ()
summary = _mapping(ae.get("summary"))
- candidates = [summary.get("environment"), ae.get("environment")]
+ candidates = [
+ summary.get("environment"),
+ summary.get("requested_environment"),
+ ae.get("environment"),
+ ae.get("requested_environment"),
+ ]
labels: list[str] = []
for value in candidates:
label = " ".join(str(value or "").split())
diff --git a/tests/golden/benchmark_fail/BENCHMARK.md b/tests/golden/benchmark_fail/BENCHMARK.md
index 4f029f37..23f18a11 100644
--- a/tests/golden/benchmark_fail/BENCHMARK.md
+++ b/tests/golden/benchmark_fail/BENCHMARK.md
@@ -11,7 +11,7 @@ The skill should be reviewed before publication. Address the blocking findings b
- Evaluator version: `0.8.2`
- Agents: Claude Code (`claude-sonnet`), Codex (`gpt-codex`)
- Tasks: 8 evaluation tasks (6 positive, 2 negative)
-- Dataset digest: `sha256:0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
+- Dataset digest: `sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
- Attempts per task: 3
- Environment: `Isolated sandbox`
- Tier 3 evidence: required for publication
diff --git a/tests/golden/benchmark_pass/BENCHMARK.md b/tests/golden/benchmark_pass/BENCHMARK.md
index e44dfaf2..e86f1b57 100644
--- a/tests/golden/benchmark_pass/BENCHMARK.md
+++ b/tests/golden/benchmark_pass/BENCHMARK.md
@@ -13,7 +13,7 @@ Recommended for publication based on the completed evaluation evidence in this r
- Evaluator version: `0.8.2`
- Agents: Claude Code (`claude-sonnet`), Codex (`gpt-codex`)
- Tasks: 8 evaluation tasks (6 positive, 2 negative)
-- Dataset digest: `sha256:0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
+- Dataset digest: `sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
- Attempts per task: 3
- Environment: `Isolated sandbox`
- Tier 3 evidence: required for publication
diff --git a/tests/golden/test_benchmark_card.py b/tests/golden/test_benchmark_card.py
index 1be2dec6..eb3b87c9 100644
--- a/tests/golden/test_benchmark_card.py
+++ b/tests/golden/test_benchmark_card.py
@@ -107,12 +107,13 @@ def _live_tier3_result() -> ValidationResult:
"unclassified_tasks": 0,
"source": "dataset",
},
- "dataset_digest": "sha256:0123456789abcdef",
+ "dataset_digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"dataset_digest_algorithm": "skill-evaluator-dataset-snapshot/1",
"attempt_policy": {"max_attempts": 3, "pass_threshold": 0.5},
"agents": {
"claude-code": {
"model": "claude-sonnet",
+ "execution_status": "succeeded",
"baseline": 0.47,
"with_skill": 0.92,
"dimensions": dimensions(0.47, 0.92),
@@ -120,6 +121,7 @@ def _live_tier3_result() -> ValidationResult:
},
"codex": {
"model": "gpt-codex",
+ "execution_status": "succeeded",
"baseline": 0.55,
"with_skill": 0.88,
"dimensions": dimensions(0.55, 0.88),
@@ -177,7 +179,10 @@ def test_benchmark_live_results_are_decision_first_and_unambiguous() -> None:
assert "- Evaluation date: 2026-07-24" in rendered
assert "- Evaluator version: `0.8.2`" in rendered
assert "- Tasks: 8 evaluation tasks (6 positive, 2 negative)" in rendered
- assert "- Dataset digest: `sha256:0123456789abcdef` (skill-evaluator-dataset-snapshot/1)" in rendered
+ assert (
+ "- Dataset digest: `sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` "
+ "(skill-evaluator-dataset-snapshot/1)"
+ ) in rendered
assert "- Tier 3 evidence: required for publication" in rendered
assert "Each task attempt ran in its own isolated sandbox." in rendered
assert "| Measure | Claude Code (Baseline → Skill Uplift) | Codex (Baseline → Skill Uplift) |" in rendered
@@ -222,7 +227,7 @@ def test_benchmark_allows_explicit_persisted_optional_tier3_policy() -> None:
assert "- Tier 3 evidence: optional by policy" in rendered
-def test_legacy_neutral_verdict_stays_neutral_without_execution_status() -> None:
+def test_legacy_neutral_verdict_is_incomplete_without_required_evidence() -> None:
tier3 = _tier3_result(environment="docker")
payload = tier3.metadata["agent_eval"]
payload["verdict"] = "neutral"
@@ -230,9 +235,9 @@ def test_legacy_neutral_verdict_stays_neutral_without_execution_status() -> None
rendered = BenchmarkReporter(include_timestamp=False).render_all([*_deterministic_results(), tier3])
- assert "Overall verdict: NEUTRAL" in rendered
+ assert "Overall verdict: INCOMPLETE" in rendered
assert "## Publication Recommendation" not in rendered
- assert "| Tier 3 | Live agent evaluation | **NEUTRAL** |" in rendered
+ assert "| Tier 3 | Live agent evaluation | **INCOMPLETE** |" in rendered
def test_verdict_callout_falls_back_for_future_statuses() -> None:
diff --git a/tests/test_public_benchmark_gate.py b/tests/test_public_benchmark_gate.py
index b9be4e36..de9c3f7c 100644
--- a/tests/test_public_benchmark_gate.py
+++ b/tests/test_public_benchmark_gate.py
@@ -5,12 +5,13 @@
from __future__ import annotations
+from copy import deepcopy
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.evaluation.tier3_report import _validation_result_from_payload, advisory_skip_result
from skillevaluator.models import Finding, Severity, ValidationResult
from skillevaluator.reporting import BenchmarkReporter
@@ -33,7 +34,7 @@ def _valid_benchmark() -> str:
- Evaluator version: `0.8.3`
- Agents: Codex (`gpt-codex`)
- Tasks: 4 evaluation tasks
-- Dataset digest: `sha256:0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
+- Dataset digest: `sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` (skill-evaluator-dataset-snapshot/1)
- Attempts per task: 1
- Environment: `Isolated sandbox`
- Tier 3 evidence: required for publication
@@ -122,7 +123,7 @@ def test_gate_requires_explicit_agent_model_state(tmp_path: Path) -> None:
assert {offender.reason for offender in offenders} == {"agent model identity not recorded"}
-def test_gate_accepts_multiple_explicit_agent_model_states(tmp_path: Path) -> None:
+def test_gate_rejects_pass_when_any_agent_model_is_not_recorded(tmp_path: Path) -> None:
benchmark = tmp_path / "BENCHMARK.md"
benchmark.write_text(
_valid_benchmark().replace(
@@ -134,7 +135,9 @@ def test_gate_accepts_multiple_explicit_agent_model_states(tmp_path: Path) -> No
_files, offenders = benchmark_gate.find_offenders([benchmark])
- assert offenders == []
+ assert {offender.reason for offender in offenders} == {
+ "publication PASS without recorded agent model identity"
+ }
@pytest.mark.parametrize(
@@ -223,6 +226,16 @@ def _tier3_result(verdict: str, *, legacy: bool = False) -> ValidationResult:
"agents": {"codex": {} if legacy else {"model": "gpt-codex"}},
}
if not legacy:
+ dimension_score = {"pass": 0.9, "neutral": 0.7, "fail": 0.3}[verdict.lower()]
+ payload["agents"]["codex"].update(
+ {
+ "execution_status": "succeeded",
+ "dimensions": [
+ {"id": dimension, "with_skill": dimension_score}
+ for dimension in ("security", "correctness", "discoverability", "effectiveness", "efficiency")
+ ],
+ }
+ )
payload.update(
{
"execution_status": "succeeded",
@@ -235,7 +248,7 @@ def _tier3_result(verdict: str, *, legacy: bool = False) -> ValidationResult:
"unclassified_tasks": 0,
"source": "dataset",
},
- "dataset_digest": "sha256:0123456789abcdef",
+ "dataset_digest": "sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"dataset_digest_algorithm": "skill-evaluator-dataset-snapshot/1",
"attempt_policy": {"max_attempts": 1, "pass_threshold": 0.5},
}
@@ -288,6 +301,38 @@ def test_legacy_pass_is_incomplete_without_publication_provenance(tmp_path: Path
assert offenders == []
+def test_legacy_neutral_is_incomplete_without_required_publication_provenance(tmp_path: Path) -> None:
+ rendered = BenchmarkReporter(include_timestamp=True).render_all(
+ [_tier1_result(), _tier3_result("NEUTRAL", 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 "| Tier 3 | Live agent evaluation | **INCOMPLETE** |" in rendered
+ assert offenders == []
+
+
+def test_malformed_canonical_pass_payload_is_incomplete_and_lints_cleanly(tmp_path: Path) -> None:
+ payload = deepcopy(_tier3_result("PASS").metadata["agent_eval"])
+ payload["overall_score"] = 0.9
+ payload["agents"]["codex"]["dimensions"] = []
+ result = _validation_result_from_payload(payload)
+ assert result is not None
+
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([_tier1_result(), result])
+ 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 "| Tier 3 | Live agent evaluation | **INCOMPLETE** |" in rendered
+ assert offenders == []
+
+
@pytest.mark.parametrize(
("tier3_required", "expected_verdict"),
[(True, "INCOMPLETE"), (False, "PASS")],
@@ -345,6 +390,24 @@ def test_reporter_sanitizes_finding_before_publication_gate(tmp_path: Path) -> N
assert offenders == []
+def test_reporter_sanitizes_requested_environment_from_advisory_payload(tmp_path: Path) -> None:
+ private_environment = "secret-cluster"
+ result = advisory_skip_result(
+ f"Runtime unavailable in {private_environment}",
+ skill_name="demo-skill",
+ )
+ result.metadata["agent_eval"]["requested_environment"] = private_environment
+ rendered = BenchmarkReporter(include_timestamp=True).render_all([_tier1_result(), result])
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(rendered, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert private_environment not in rendered
+ assert "Runtime unavailable in Isolated sandbox" in rendered
+ assert offenders == []
+
+
@pytest.mark.parametrize(
"private_path",
[
@@ -421,6 +484,54 @@ def test_gate_does_not_treat_pass_in_tier3_evidence_as_completion(tmp_path: Path
assert {offender.reason for offender in offenders} == {"publication PASS without completed Tier 3 evidence"}
+def test_gate_rejects_pass_with_placeholder_provenance(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ content = _valid_benchmark()
+ replacements = {
+ "- Evaluation date: 2026-07-25": "- Evaluation date: not recorded (legacy or non-live result)",
+ "- Evaluator version: `0.8.3`": "- Evaluator version: not recorded (legacy or non-live result)",
+ "- Agents: Codex (`gpt-codex`)": "- Agents: Codex (model not recorded)",
+ "- Tasks: 4 evaluation tasks": "- Tasks: not recorded (legacy or non-live result)",
+ "- Dataset digest: `sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` "
+ "(skill-evaluator-dataset-snapshot/1)": (
+ "- Dataset digest: not recorded (legacy or non-live result)"
+ ),
+ "- Attempts per task: 1": "- Attempts per task: not recorded (legacy or non-live result)",
+ "- Environment: `Isolated sandbox`": "- Environment: not recorded (legacy or non-live result)",
+ }
+ for original, replacement in replacements.items():
+ content = content.replace(original, replacement)
+ benchmark.write_text(content, encoding="utf-8")
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert {offender.reason for offender in offenders} == {
+ "publication PASS without recorded evaluation date",
+ "publication PASS without recorded evaluator version",
+ "publication PASS without recorded agent model identity",
+ "publication PASS without recorded tasks",
+ "publication PASS without recorded dataset digest",
+ "publication PASS without recorded attempts per task",
+ "publication PASS without recorded environment",
+ }
+
+
+def test_gate_rejects_pass_with_malformed_dataset_digest(tmp_path: Path) -> None:
+ benchmark = tmp_path / "BENCHMARK.md"
+ benchmark.write_text(
+ _valid_benchmark().replace(
+ "`sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef` "
+ "(skill-evaluator-dataset-snapshot/1)",
+ "`md5:0123456789abcdef` (legacy)",
+ ),
+ encoding="utf-8",
+ )
+
+ _files, offenders = benchmark_gate.find_offenders([benchmark])
+
+ assert "publication PASS without recorded dataset digest" in {offender.reason for offender in offenders}
+
+
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