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.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(tier3): validate coverage against admitted attempt ordinals (#663)
Christopher Kevin2241694f3a6a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex ad67b987..0cbcb735 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -313,6 +313,7 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed+- Budget-limited Tier 3 coverage checks retain admitted attempt ordinals, avoiding false missing/excess errors when a denied slot leaves a gap.- HTML reports retain budget context for fully budget-denied runs withoutrestoring untrusted score evidence.- Fully budget-denied runs exit successfully and finish progress without andiff --git a/src/skillevaluator/tier3/harbor/collector.py b/src/skillevaluator/tier3/harbor/collector.pyindex 075f6e9a..a0b5326a 100644--- a/src/skillevaluator/tier3/harbor/collector.py+++ b/src/skillevaluator/tier3/harbor/collector.py@@ -6820,6 +6820,7 @@ def _condition_execution_summary(pass_threshold: float = 0.50,attempt_slots: dict[str, dict[str, Any]] | None = None,expected_attempts_by_case: Mapping[str, int] | None = None,+ expected_attempt_ordinals_by_case: Mapping[str, set[int]] | None = None,) -> dict[str, Any]:"""Describe whether a Harbor condition produced complete logical attempts.@@ -6958,8 +6959,14 @@ def _condition_execution_summary(if required > n_attempts:errors.append(f"Scored case {case_id!r} has an attempt ordinal above configured maximum {n_attempts}")+ expected_ordinals = set(range(1, required + 1))+ if expected_attempt_ordinals_by_case is not None and case_id in expected_attempt_ordinals_by_case:+ expected_ordinals = set(expected_attempt_ordinals_by_case[case_id])+ if stop_on_pass and first_pass is not None:+ expected_ordinals = {ordinal for ordinal in expected_ordinals if ordinal <= required}+ required = len(expected_ordinals)+if all_explicit:- expected_ordinals = set(range(1, required + 1))actual_ordinals = set(explicit + recovered_ordinals)missing_ordinals = sorted(expected_ordinals - actual_ordinals)if attempt_slots is not None:@@ -6970,12 +6977,13 @@ def _condition_execution_summary(}return required, bool(missing_ordinals), bool(actual_ordinals - expected_ordinals)if attempt_slots is not None:- # Stop-on-pass runs each attempt as its own labelled job, so a case- # with nothing scored owes every ordinal through the maximum.+ # Labelled jobs with nothing scored still owe every admitted ordinal.attempt_slots[case_id] = {"required": required,"missing": max(0, required - len(attempts)),- "missing_ordinals": list(range(1, required + 1)) if stop_on_pass and not attempts else None,+ "missing_ordinals": sorted(expected_ordinals)+ if not attempts and (stop_on_pass or (expected_attempt_ordinals_by_case or {}).get(case_id) is not None)+ else None,}return required, len(attempts) < required, len(attempts) > required@@ -7517,7 +7525,7 @@ def collect_harbor_results(def budget_expectations(agent: str,arm: str,- ) -> tuple[int | None, list[str] | None, int | None, dict[str, int] | None, bool]:+ ) -> tuple[int | None, list[str] | None, int | None, dict[str, int] | None, dict[str, set[int]] | None, bool]:matching = [itemfor item in budget_not_run@@ -7526,12 +7534,15 @@ def collect_harbor_results(and item.get("reason") in {None, "budget_exhausted"}]if not matching:- return expected_trials, expected_case_ids, expected_cases, None, False+ return expected_trials, expected_case_ids, expected_cases, None, None, Falseattempts_by_case: dict[str, int] = {}+ omitted_ordinals: dict[str, set[int]] = {}for item in matching:selector = str(item.get("case_id") or "")case_id = (case_id_by_task_selector or {}).get(selector, selector)attempts_by_case[case_id] = attempts_by_case.get(case_id, 0) + 1+ if type(attempt := item.get("attempt")) is int and 1 <= attempt <= n_attempts:+ omitted_ordinals.setdefault(case_id, set()).add(attempt)active_ids = [case_id for case_id in (expected_case_ids or []) if attempts_by_case.get(case_id, 0) < n_attempts]if expected_case_ids:active_case_ids: list[str] | None = active_ids@@ -7544,6 +7555,11 @@ def collect_harbor_results(attempt_counts = {case_id: max(0, n_attempts - count) for case_id, count in attempts_by_case.items() if count < n_attempts}+ attempt_ordinals = {+ case_id: set(range(1, n_attempts + 1)) - omitted_ordinals[case_id]+ for case_id, count in attempts_by_case.items()+ if case_id in attempt_counts and len(omitted_ordinals.get(case_id, set())) == count+ }actual_trials = None if expected_trials is None else max(0, expected_trials - len(matching))denied_slots = {(@@ -7566,7 +7582,7 @@ def collect_harbor_results(budget_denied = expected_cases > 0 and len(denied_cases) == expected_caseselse:budget_denied = bool(expected_trials and len(denied_cases) * n_attempts == expected_trials)- return actual_trials, active_case_ids, active_cases, attempt_counts, budget_denied+ return actual_trials, active_case_ids, active_cases, attempt_counts, attempt_ordinals, budget_denied# Unscored conditions keep the requested grading policy instead of# falling back to the default metric set, which custom_only never grades.@@ -7607,6 +7623,7 @@ def collect_harbor_results(with_expected_case_ids,with_expected_cases,with_expected_attempts,+ with_expected_ordinals,with_budget_denied,) = budget_expectations(agent, "with")(@@ -7614,6 +7631,7 @@ def collect_harbor_results(without_expected_case_ids,without_expected_cases,without_expected_attempts,+ without_expected_ordinals,without_budget_denied,) = budget_expectations(agent, "without")if skip_baseline:@@ -7724,6 +7742,7 @@ def collect_harbor_results(stop_on_pass=stop_on_pass,pass_threshold=pass_threshold,expected_attempts_by_case=with_expected_attempts,+ expected_attempt_ordinals_by_case=with_expected_ordinals,)if with_policy == "mixed-score-policies":_fail_execution_with_error(with_execution, "Conflicting score policies within the with-skill condition")@@ -7974,6 +7993,7 @@ def collect_harbor_results(pass_threshold=pass_threshold,attempt_slots=without_slots if tolerance_on else None,expected_attempts_by_case=without_expected_attempts,+ expected_attempt_ordinals_by_case=without_expected_ordinals,)if without_policy == "mixed-score-policies":_fail_execution_with_error(@@ -8081,6 +8101,7 @@ def collect_harbor_results(stop_on_pass=stop_on_pass,pass_threshold=pass_threshold,expected_attempts_by_case=without_expected_attempts,+ expected_attempt_ordinals_by_case=without_expected_ordinals,)if without_budget_denied:without_execution["skip_reason"] = "budget_exhausted"@@ -8417,6 +8438,7 @@ def collect_harbor_results(stop_on_pass=stop_on_pass,pass_threshold=pass_threshold,expected_attempts_by_case=without_expected_attempts,+ expected_attempt_ordinals_by_case=without_expected_ordinals,)tolerance_failures, tolerance_code = _baseline_timeout_failures(job_dir=without_job_dir,diff --git a/tests/tier3/test_budget_admitted_ordinals.py b/tests/tier3/test_budget_admitted_ordinals.pynew file mode 100644index 00000000..c6083f34--- /dev/null+++ b/tests/tier3/test_budget_admitted_ordinals.py@@ -0,0 +1,49 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++import pytest+from tests.tier3.test_baseline_timeouts import _attempt_job++from skillevaluator.tier3.harbor.collector import collect_harbor_results+from skillevaluator.tier3.harbor.runner import _merge_attempt_jobs++[email protected]("ordinals", [(1, 3), (1,), (3,), (), (1, 2), (1, 2, 3)])[email protected]("reason", ["budget_exhausted", None, "execution_failed"])[email protected]("stop_on_pass", [False, True])+def test_coverage_uses_admitted_slots(tmp_path, ordinals, reason, stop_on_pass):+ not_run = []+ for arm in ("with", "without"):+ jobs = [+ _attempt_job(tmp_path, "agent", arm, "selector", ordinal, "pass" if ordinal == 3 else "fail")+ for ordinal in ordinals+ ]+ _merge_attempt_jobs(jobs, tmp_path / "jobs" / f"demo-agent-{arm}")+ row = {"agent": "agent", "arm": arm, "case_id": "selector", "attempt": 2, "status": "not_run"}+ if reason is not None:+ row["reason"] = reason+ not_run.append(row)++ result = collect_harbor_results(+ skill_name="demo",+ agents=["agent"],+ output_dir=tmp_path / "results",+ jobs_dir=tmp_path / "jobs",+ n_attempts=3,+ expected_trials=None if stop_on_pass else 3,+ expected_case_ids=["case"],+ expected_cases=1,+ case_id_by_task_selector={"selector": "case"},+ budget_not_run=not_run,+ stop_on_pass=stop_on_pass,+ )+ omitted = reason != "execution_failed"+ complete = ordinals == ((1, 3) if omitted else (1, 2, 3))+ assert result["execution_status"] == ("succeeded" if complete else "failed")+ for condition in result["agents"]["agent"]["conditions"].values():+ assert condition["expected_attempts"] == (2 if omitted else 3)+ if complete:+ assert condition["scored_attempts"] == condition["expected_attempts"]+ assert not condition["execution_errors"]+ else:+ assert any("scored attempts" in error for error in condition["execution_errors"])