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(tier3): derive accuracy scores from criterion verdicts (#190)

Narendran Raghavandb819c189c92
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1d9a4602..a1768aa6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -93,10 +93,44 @@ All notable changes to SkillEvaluator are documented in this file.
### Fixed
-- Derive accuracy scores from complete five-criterion verdicts in both judge
- runtimes, so an inconsistent model-supplied total cannot distort Skill Lift.
- Correct the Harbor prompt example to score five passing criteria as 1.0.
-
+- Tier 1 pyproject dependency audits now inspect static target declarations
+ rather than the evaluator environment. Exact direct pins (including optional
+ groups) are queried without installation or build-script execution;
+ unresolved declarations and invalid scanner evidence are incomplete.
+- Tier 1 PII scanning now includes `.mdc` rules and workflows.
+- Tier 3 negative-case accuracy excludes inapplicable skill identification and
+ records its scoring policy. Reports separately expose measured token and
+ agent execution-time differences with complete matching-arm coverage, while
+ efficiency continues to measure routing and productive tool use.
+- Derive accuracy scores from complete criterion verdicts in both judge
+ runtimes (passing applicable criteria divided by applicable criteria), so an
+ inconsistent model-supplied total cannot distort Skill Lift. Correct the
+ Harbor prompt example to score five passing criteria as 1.0.
+- Include schema-valid ATIF message content parts in final answers, conversation
+ summaries, and judge evidence references in the host and Harbor verifier.
+ Image and audio parts use markers without exposing their source paths.
+- Preserve scored Harbor trials when agent answers mention authentication errors
+ and per-step token usage is present but aggregate ATIF token metrics are absent
+ or zero. Explicit runtime exceptions and error events still invalidate trials.
+- Safety-classifier refusals, content filters and output-token truncation are
+ detected instead of being read as empty or malformed output. `--llm-verify`
+ and rubric evaluation report the cause, and `--llm-verify` keeps the
+ complete verdicts of a truncated reply. Claude 5.5 or later requests to the
+ native Claude API use server-side fallback to Claude Opus 4.8. In the Harbor
+ verifier, Bedrock retries a filtered Claude 5.5 reply on Claude Opus 4.8, and
+ a refusal or empty judge reply moves on to the next
+ `LLM_JUDGE_FALLBACK_MODELS` entry.
+- The Harbor verifier's last-resort judge model follows the selected provider.
+ With no judge or chat model configured, it used to request an OpenAI model
+ from Anthropic, Bedrock, NVIDIA Build and gateways. The unused host-side
+ `llm_judge.DEFAULT_JUDGE_MODEL` constant is removed.
+- Fixed Docker Codex and Claude Code setup wasting its timeout installing
+ distribution Node/npm before Harbor's own installers. Native, gateway Codex,
+ and NVIDIA Build agents now provision Node/npm only on the installer branches
+ that need them, while preserving installed-agent and version-pin checks.
+- Preserved multiline skill descriptions when saving and loading Tier 2
+ embedding catalogs. Descriptions can contain line breaks and tabs, while
+ catalog identifiers and other control characters remain strictly validated.
- Brought the published documentation in line with 0.5.0. It now covers how
standard grading builds judge evidence and rebuilds trajectories from
OpenCode and Codex logs, structured judge output and retries, the evidence
diff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdx
index 64486c6b..2c78c2bf 100644
--- a/docs/tier3-live-evaluation.mdx
+++ b/docs/tier3-live-evaluation.mdx
@@ -552,11 +552,14 @@ grades each trial after the agent finishes. `security`, `skill_execution`, and
`goal_accuracy`, and `behavior_check` are LLM judges that call the configured
evaluator provider. `custom_only` runs none of them.
-When `should_trigger` is false or no `expected_skill` is declared, accuracy
-excludes `SKILL_IDENTIFIED` and calculates the score from the other four
-criterion verdicts. The reward details record the excluded criterion and
-`applicable-accuracy-criteria/v1` scoring policy. Missing criterion evidence is
-an error. Positive cases retain their existing scoring contract.
+Accuracy is calculated from the judge's criterion verdicts, not its numeric
+total: passing applicable criteria divided by applicable criteria. Positive
+cases score all five criteria; a positive-case reply with no criteria falls
+back to the judge's numeric score. When `should_trigger` is false or no
+`expected_skill` is declared, accuracy excludes `SKILL_IDENTIFIED` from both
+counts and scores the other four criterion verdicts. The reward details record
+the excluded criterion and `applicable-accuracy-criteria/v1` scoring policy.
+Missing criterion evidence is an error for these cases.
### The graded trajectory
diff --git a/src/skillevaluator/tier3/eval_core/llm_judge.py b/src/skillevaluator/tier3/eval_core/llm_judge.py
index 0bc2f406..2841ecd1 100644
--- a/src/skillevaluator/tier3/eval_core/llm_judge.py
+++ b/src/skillevaluator/tier3/eval_core/llm_judge.py
@@ -810,9 +810,13 @@ def judge_accuracy(
criteria_valid = _valid_accuracy_criteria(criteria)
if criteria_valid:
- yes_count = sum(1 for v in criteria.values() if v is True)
- score = yes_count / 5.0
+ # Score only applicable verdicts; excluded criteria leave both numerator and denominator.
+ excluded = set() if skill_identification_applicable else {"SKILL_IDENTIFIED"}
+ applicable = [verdict for name, verdict in criteria.items() if name not in excluded]
+ score = sum(verdict is True for verdict in applicable) / len(applicable)
else:
+ # Legacy score-only payloads; validate_payload rejects them when a criterion is excluded.
+ assert skill_identification_applicable
score = _finite_score(parsed.get("score"))
assert score is not None
diff --git a/src/skillevaluator/tier3/harbor/templates/eval.py b/src/skillevaluator/tier3/harbor/templates/eval.py
index 6f77824c..2c3087f4 100644
--- a/src/skillevaluator/tier3/harbor/templates/eval.py
+++ b/src/skillevaluator/tier3/harbor/templates/eval.py
@@ -8266,9 +8266,7 @@ SELECTED EVIDENCE (final response + produced artifacts; low-relevance steps may
"1. SKILL_IDENTIFIED: Does the response reference or use the correct skill for the task?",
"1. SKILL_IDENTIFIED: Inapplicable: no skill is expected. Set false; exclude it from the score.",
).replace("Compute score = count(true) / 5.", "Compute score = count(true among the other four criteria) / 4.")
- prompt = prompt.replace('"SKILL_IDENTIFIED": true', '"SKILL_IDENTIFIED": false').replace(
- '"score": 0.8', '"score": 1.0'
- )
+ prompt = prompt.replace('"SKILL_IDENTIFIED": true', '"SKILL_IDENTIFIED": false')
# Adjust the rubric before interpolation so task/evidence text stays intact.
prompt = prompt.format(question=question, ground_truth=ground_truth, agent_text=agent_text)
@@ -8294,11 +8292,16 @@ SELECTED EVIDENCE (final response + produced artifacts; low-relevance steps may
criteria_valid = _valid_accuracy_criteria(criteria)
if criteria_valid:
- score = sum(1 for v in criteria.values() if v is True) / 5.0
+ # Score only applicable verdicts; excluded criteria leave both numerator and denominator.
+ excluded = set() if skill_identification_applicable else {"SKILL_IDENTIFIED"}
+ applicable = [verdict for name, verdict in criteria.items() if name not in excluded]
+ score = sum(verdict is True for verdict in applicable) / len(applicable)
else:
+ # Legacy score-only payloads; validate_payload rejects them when a criterion is excluded.
+ assert skill_identification_applicable
score = _finite_score(parsed.get("score"))
assert score is not None
- return {
+ result = {
"score": round(score, 4),
"reason": _bounded_judge_text(parsed.get("reason", "")),
"criteria": criteria if criteria_valid else {},
diff --git a/tests/test_accuracy_arithmetic.py b/tests/test_accuracy_arithmetic.py
index 6bb8f6f2..76f26f8b 100644
--- a/tests/test_accuracy_arithmetic.py
+++ b/tests/test_accuracy_arithmetic.py
@@ -1,11 +1,12 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
-"""Accuracy scores must implement the five-criterion rubric in both runtimes."""
+"""Accuracy scores must implement the applicable-criterion rubric in both runtimes."""
from __future__ import annotations
import json
+from pathlib import Path
import pytest
from tests.conftest import load_harbor_eval_template
@@ -37,6 +38,33 @@ def test_accuracy_derives_score_from_complete_criteria(monkeypatch, accuracy_jud
assert "error" not in result
[email protected]("skill_verdict", [True, False])
[email protected]("passed", range(5))
+def test_negative_accuracy_scores_only_applicable_criteria(monkeypatch, accuracy_judge, passed, skill_verdict):
+ # Negative cases drop SKILL_IDENTIFIED from numerator and denominator; the model total stays ignored.
+ applicable = sorted(llm_judge._ACCURACY_CRITERIA_KEYS - {"SKILL_IDENTIFIED"})
+ criteria = {key: index < passed for index, key in enumerate(applicable)}
+ criteria["SKILL_IDENTIFIED"] = skill_verdict
+ payload = {"criteria": criteria, "score": 0.1, "reason": "declined correctly"}
+ monkeypatch.setattr(accuracy_judge, "call_public_llm", lambda *_args, **_kwargs: (json.dumps(payload), None))
+
+ result = accuracy_judge.judge_accuracy("question", "reference", "answer", skill_identification_applicable=False)
+
+ assert result["score"] == pytest.approx(passed / 4)
+ assert result["criteria"] == criteria
+ assert result["excluded_criteria"] == ["SKILL_IDENTIFIED"]
+ assert result["scoring_policy"] == "applicable-accuracy-criteria/v1"
+
+
+def test_tier3_docs_describe_criterion_derived_accuracy():
+ docs = (Path(__file__).resolve().parents[1] / "docs" / "tier3-live-evaluation.mdx").read_text(encoding="utf-8")
+ normalized = " ".join(docs.split())
+
+ assert "passing applicable criteria divided by applicable criteria" in normalized
+ assert "falls back to the judge's numeric score" in normalized
+ assert "existing scoring contract" not in normalized
+
+
@pytest.mark.parametrize(
"payload, expected",
[