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): apply baseline-timeout tolerance to the printed verdict, report notes and token evidence (#523)
Narendran Raghavan9cdc223855c6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 760d3d0e..1db540a0 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -393,6 +393,22 @@ All notable changes to SkillEvaluator are documented in this file.`/root/.bashrc`, or `/etc/sudoers` scored 0.0 in 0.9.0 and now scores 1.0,and a view of a credential store such as `~/.netrc` still scores 0.0. Boththe host checker and the bundled Harbor verifier apply the fix.+- `--tolerate-baseline-timeouts` (added in 0.9.0) now follows its own rules+ in the printed run verdict, in the notes of both reports and during result+ collection. The `RUN QUALITY VERDICT` line that `tier3 evaluate` prints+ reads the same agents as the run verdict, so a tolerated agent that passes+ no longer prints PASS beside a complete agent that fails or never+ activated the skill; the line now reads FAIL or INCONCLUSIVE, as the+ reports do. `BENCHMARK.md` and `report.html` now keep the "Needs+ attention" note and the `Baseline incomplete` line for each tolerated+ agent also when a cost limit leaves the best agent's attempts short; both+ reports used to leave them out in that case. `report.html` also keeps the+ note when its overview reads Inconclusive because the complete agent never+ activated the skill. An output-token count past the JSON-safe integer+ range (above 2^53 - 1) in a timed-out attempt is no longer progress+ evidence; with no other in-range count for that attempt the agent is+ refused as `no_progress_evidence`, where result collection used to stop+ with `browser-unsafe JSON integer` and write no `result.json` or report.## 0.9.0 - 2026-11-13diff --git a/docs/reports.mdx b/docs/reports.mdxindex b93ef1fe..4d1eb158 100644--- a/docs/reports.mdx+++ b/docs/reports.mdx@@ -983,8 +983,9 @@ unknown. Eligibility is determined separately for each agent, so anotheragent with observed activation can still contribute a comparison.An arm that ran but failed, for example because one baseline attempt hit the-agent timeout, fails the agent and the run, and the other arm keeps its-scores. Reports describe such an arm by how many of its attempts scored,+agent timeout, fails the agent and the run unless `--tolerate-baseline-timeouts`+keeps the agent scored (see [Baseline timeouts](/skills/skillevaluator/tier3-live-evaluation#baseline-timeouts)),+and the other arm keeps its scores. Reports describe such an arm by how many of its attempts scored,never as not run. In `BENCHMARK.md`, the agent's Overall and dimension cellsread `90.0% — baseline incomplete (1 of 2 attempts scored); uplift unavailable`, or`baseline unavailable` when no baseline attempt scored. They readdiff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdxindex 62b82005..0cc978c4 100644--- a/docs/tier3-live-evaluation.mdx+++ b/docs/tier3-live-evaluation.mdx@@ -1137,7 +1137,8 @@ the run warning names the rule that did not hold:tolerated. Native multi-step tasks are not covered: Harbor records theiragent timeouts on the step rather than on the trial, so such a baseline isrefused (`step_timeout_not_supported`).-- Every timed-out attempt shows agent output (output tokens above zero).+- Every timed-out attempt shows agent output (output tokens above zero; a+ count past the JSON-safe integer range is not evidence).- Each timed-out attempt left an agent log, and no log shows a known provideroverload, rate limit, quota or authentication error identifier (such as`rate_limit_error`, `insufficient_quota`, `Error code: 429` or a `429`@@ -1154,13 +1155,15 @@ and its baseline scores, Skill Lift, pass@k lift and security attribution arenot reported. The reports, and the findings panel that `tier3 evaluate` printswith `--verbose`, rank it below every agent with a complete baseline, so thebest agent, overall score and lift come from complete evidence. The run's-verdict reads the same agents: a tolerated agent that passes every dimension+verdict and the `RUN QUALITY VERDICT` line that `tier3 evaluate` prints+read the same agents: a tolerated agent that passes every dimensiondoes not make the run PASS, and when every agent with a complete baselinenever activated the skill the verdict is INCONCLUSIVE. When the best agentnever activated the skill, the findings panel is left out rather than showinga tolerated agent's findings. `BENCHMARK.md` and `report.html` keep the "Needsattention" note and name each tolerated agent on its own line, for example-`Baseline incomplete for opencode (1 of 2 attempts scored)`.+`Baseline incomplete for opencode (1 of 2 attempts scored)`, also when a cost+limit leaves the report without a completed-agent result.`result.json` records the timed-out attempts under the agent's`baseline_timeout_tolerance` (also written todiff --git a/src/skillevaluator/reporting/benchmark.py b/src/skillevaluator/reporting/benchmark.pyindex 81a7d958..928884f2 100644--- a/src/skillevaluator/reporting/benchmark.py+++ b/src/skillevaluator/reporting/benchmark.py@@ -54,7 +54,11 @@ from skillevaluator.reporting.base import (from skillevaluator.reporting.run_status import resolve_run_statusfrom skillevaluator.reporting.summary_copy import SKILL_LIFT_DEFINITION, pass_at_k_summaryfrom skillevaluator.reporting.tier3_coverage import IncompleteArm, incomplete_arms-from skillevaluator.reporting.tier3_scope import completed_agent_result, validate_report_scope+from skillevaluator.reporting.tier3_scope import (+ completed_agent_result,+ tolerated_baseline_agents,+ validate_report_scope,+)from skillevaluator.reporting.tier3_token_usage import token_usage_markdown_linesfrom skillevaluator.source_identity import evaluated_source_revision, recorded_evaluated_sourcefrom skillevaluator.tier3.baseline_store import baseline_description@@ -251,6 +255,14 @@ class BenchmarkReporter(ReporterBase):])+ tolerated_lines = []+ for tolerated in tolerated_baseline_agents(ae):+ scored, expected = tolerated["scored_attempts"], tolerated["expected_attempts"]+ counts = f" ({scored} of {expected} attempts scored)" if scored is not None and expected is not None else ""+ tolerated_lines.append(+ f"Baseline incomplete for **{_publication_safe_inline(tolerated['name'], private_labels)}**"+ f"{counts}: kept by `--tolerate-baseline-timeouts`, so its baseline and uplift are not reported."+ )if completed and (self.report_scope == "tier3" or completed["needs_attention"]):lines.append(f"Completed agent: **{_publication_safe_inline(completed['name'], private_labels)}**; "@@ -267,20 +279,16 @@ class BenchmarkReporter(ReporterBase):lines.append("**Needs attention:** other execution failures remain. This completed-agent result does not certify the whole run.")- for tolerated in completed.get("baseline_timeouts_tolerated", ()):- scored, expected = tolerated["scored_attempts"], tolerated["expected_attempts"]- counts = (- f" ({scored} of {expected} attempts scored)" if scored is not None and expected is not None else ""- )- lines.append(- f"Baseline incomplete for **{_publication_safe_inline(tolerated['name'], private_labels)}**"- f"{counts}: kept by `--tolerate-baseline-timeouts`, so its baseline and uplift are not reported."- )+ lines.extend(tolerated_lines)if completed["recovered_attempts"]:lines.append(f"Recovered timeout attempts: {completed['recovered_attempts']}; failed history is retained and excluded from scoring.")lines.append("")+ elif tolerated_lines:+ # No completed-agent result (for example, a cost limit left the+ # best agent's coverage short), but the tolerated baselines remain.+ lines.extend(["**Needs attention:** baseline timeouts were tolerated.", *tolerated_lines, ""])self._render_metadata(lines,results,diff --git a/src/skillevaluator/reporting/html.py b/src/skillevaluator/reporting/html.pyindex 95b77d5c..05a10b15 100644--- a/src/skillevaluator/reporting/html.py+++ b/src/skillevaluator/reporting/html.py@@ -98,7 +98,11 @@ from skillevaluator.reporting.presentation import ()from skillevaluator.reporting.run_status import Status, result_status, result_tierfrom skillevaluator.reporting.tier2_views import tier2_scope_views-from skillevaluator.reporting.tier3_scope import completed_agent_result, validate_report_scope+from skillevaluator.reporting.tier3_scope import (+ completed_agent_result,+ tolerated_baseline_agents,+ validate_report_scope,+)from skillevaluator.reporting.tier3_token_usage import token_usage_tablefrom skillevaluator.reporting.trial_charts import steps_by_case_chartfrom skillevaluator.skillspector_provenance import skillspector_provenance_records@@ -3549,6 +3553,7 @@ class HTMLReporter(ReporterBase):report_scope=self.report_scope,presentation=context,completed_agent=completed_agent,+ tolerated_baselines=tolerated_baseline_agents(tier3_data),title=self.title,ci_context=self.ci_context,explicit_skill_name=self.explicit_skill_name,diff --git a/src/skillevaluator/reporting/templates/report.html.j2 b/src/skillevaluator/reporting/templates/report.html.j2index d4daf708..d1e9f222 100644--- a/src/skillevaluator/reporting/templates/report.html.j2+++ b/src/skillevaluator/reporting/templates/report.html.j2@@ -2537,6 +2537,8 @@{# ---------- Overview ---------- #}<section class="t3-page active" id="tier3-page-overview" role="tabpanel" aria-labelledby="tier3-tab-overview" tabindex="0">{% set t3_effect = (tier3.conclusions or []) | selectattr('title', 'equalto', 'Skill effect') | first %}+ {# Set when the lead itself says that other failures need attention. #}+ {% set t3_lead_needs_attention = false %}<div class="t3-overview-lead">{% if tier3_is_skipped %}<strong>Live evaluation skipped:</strong> {{ tier3_skip_message }}@@ -2552,6 +2554,7 @@No with-skill arm was run (<code>--skip-with-skill</code>), so no skill lift was measured.{% else %}{% if completed_agent and completed_agent.needs_attention %}+ {% set t3_lead_needs_attention = true %}<strong>Completed-agent result: {{ completed_agent.verdict | upper }}.</strong>{{ completed_agent.name }} scored {{ "%.2f" | format(completed_agent.score) }}.Other execution failures need attention. This is not a whole-run or publication PASS.@@ -2564,9 +2567,12 @@{% endif %}{% endif %}{% endif %}- {% if completed_agent %}{% for tolerated in completed_agent.baseline_timeouts_tolerated or [] %}+ {% if tolerated_baselines and not t3_lead_needs_attention %}+ <span class="tolerated-baseline"><strong>Needs attention:</strong> baseline timeouts were tolerated.</span>+ {% endif %}+ {% for tolerated in tolerated_baselines or [] %}<span class="tolerated-baseline">Baseline incomplete for <strong>{{ tolerated.name }}</strong>{% if tolerated.scored_attempts is not none and tolerated.expected_attempts is not none %} ({{ tolerated.scored_attempts }} of {{ tolerated.expected_attempts }} attempts scored){% endif %}: kept by <code>--tolerate-baseline-timeouts</code>, so its baseline and uplift are not reported.</span>- {% endfor %}{% endif %}+ {% endfor %}</div>{% if tier3_dataset_sufficiency and tier3_dataset_sufficiency.coverage_summary %}<p class="t3-dataset-sufficiency{% if tier3_dataset_sufficiency.status == 'provisional' %} warning{% endif %}"diff --git a/src/skillevaluator/reporting/tier3_scope.py b/src/skillevaluator/reporting/tier3_scope.pyindex 5c6a8796..6b2e44e2 100644--- a/src/skillevaluator/reporting/tier3_scope.py+++ b/src/skillevaluator/reporting/tier3_scope.py@@ -129,10 +129,22 @@ def completed_agent_result(payload: dict[str, Any] | None) -> dict[str, Any] | N),}# Agents kept by --tolerate-baseline-timeouts leave the run succeeded, but- # their failed baselines still need attention and are named in the report.+ # their failed baselines still need attention; reports name them through+ # tolerated_baseline_agents().+ result["needs_attention"] = result["needs_attention"] or bool(tolerated_baseline_agents(payload))+ return result+++def tolerated_baseline_agents(payload: dict[str, Any] | None) -> list[dict[str, Any]]:+ """Describe each agent kept by --tolerate-baseline-timeouts in ``payload``.++ Reports name these agents whether or not a completed-agent result exists,+ for example when a cost limit left the best agent's coverage short.+ """+ agents = payload.get("agents") if isinstance(payload, dict) else None+ if not isinstance(agents, dict) or not agents:+ # Reports without Tier 3 agents never load Tier 3 modules.+ return []from skillevaluator.tier3.harbor.baseline_timeouts import tolerated_baselines- tolerated = tolerated_baselines(agents)- result["baseline_timeouts_tolerated"] = tolerated- result["needs_attention"] = result["needs_attention"] or bool(tolerated)- return result+ return tolerated_baselines(agents)diff --git a/src/skillevaluator/tier3/harbor/collector.py b/src/skillevaluator/tier3/harbor/collector.pyindex 04dabdfe..9c7c1520 100644--- a/src/skillevaluator/tier3/harbor/collector.py+++ b/src/skillevaluator/tier3/harbor/collector.py@@ -7113,14 +7113,13 @@ def _agent_timeout_seconds(reason: str) -> float | None:def _positive_token_count(value: Any) -> int | None:- """Return a positive whole token count, or None for anything else (never bool)."""+ """Return a positive whole token count the run record can hold, or None for anything else (never bool)."""if isinstance(value, bool) or not isinstance(value, int | float):return None- try:- if not math.isfinite(value) or value < 1 or value != int(value):- return None- except OverflowError:- # JSON integers can exceed the float range used to check finiteness.+ # The range checks come first: they compare big JSON integers without a+ # float conversion that could overflow, and generated JSON refuses any+ # count past the browser-safe integer range.+ if value < 1 or value > _MAX_JSON_SAFE_INTEGER or not math.isfinite(value) or value != int(value):return Nonereturn int(value)diff --git a/src/skillevaluator/tier3/result_display.py b/src/skillevaluator/tier3/result_display.pyindex 49399100..4f0615ba 100644--- a/src/skillevaluator/tier3/result_display.py+++ b/src/skillevaluator/tier3/result_display.py@@ -26,6 +26,7 @@ from skillevaluator.reporting.terminal_styles import AMBER, FAINT, GREEN, RED, Tfrom skillevaluator.tier3.attempt_verdict import required_check_failure_reasonfrom skillevaluator.tier3.dataset_provenance import dataset_provenance_displayfrom skillevaluator.tier3.evidence_volume import evidence_volume_for_conditions, format_evidence_volume+from skillevaluator.tier3.harbor.baseline_timeouts import kept_with_failed_baselinefrom skillevaluator.tier3.harbor.metrics import (CUSTOM_ONLY_METRIC_SET,DEFAULT_METRIC_SET,@@ -125,6 +126,35 @@ def _never_activated(data: Mapping[str, Any]) -> bool:return isinstance(activation, Mapping) and activation.get("status") == "never_activated"+def _run_verdict_agents(agents: Mapping[str, Any]) -> list[Mapping[str, Any]]:+ """Return the agents a multi-agent run verdict reads, as the canonical report picks them.++ An agent kept by --tolerate-baseline-timeouts is set aside whenever an+ agent with a complete baseline ranks, so it never decides the verdict.+ """+ raw_agents = [raw for raw in agents.values() if isinstance(raw, Mapping)]+ complete = [raw for raw in raw_agents if not kept_with_failed_baseline(raw)]+ if len(complete) == len(raw_agents):+ return raw_agents+ if any(_ranks_like_the_canonical_report(raw) for raw in complete):+ return complete+ return raw_agents+++def _ranks_like_the_canonical_report(raw: Mapping[str, Any]) -> bool:+ """Return whether the canonical report ranks the raw agent data ``raw``.++ Data the canonical report cannot read, such as a string in place of a+ score map, does not rank, so the printed summary stays readable.+ """+ from skillevaluator.evaluation.tier3_report import _canonical_agent_rank_from_info++ try:+ return _canonical_agent_rank_from_info(dict(raw)) is not None+ except (AttributeError, TypeError, ValueError):+ return False++def _condition_usable(data: Mapping[str, Any], variant: str) -> bool:status = _condition_status(data, variant)if status:@@ -1070,9 +1100,7 @@ def render_evaluation_result(run_verdict = str(result.get("verdict") or "").casefold()if run_verdict not in {"pass", "fail", "neutral", "inconclusive"}:agent_verdicts = []- for raw in agents.values():- if not isinstance(raw, Mapping):- continue+ for raw in _run_verdict_agents(agents):explicit = str(raw.get("verdict") or "").casefold()if explicit in {"pass", "fail", "neutral", "inconclusive"}:agent_verdicts.append(explicit)diff --git a/tests/tier3/test_baseline_timeouts.py b/tests/tier3/test_baseline_timeouts.pyindex 386e356d..40aa95ae 100644--- a/tests/tier3/test_baseline_timeouts.py+++ b/tests/tier3/test_baseline_timeouts.py@@ -51,6 +51,30 @@ LAUNCH_ERROR = "{agent} without-skill Harbor run failed: Harbor job did not compADC_LAUNCH_ERROR = ("opencode without-skill Harbor run failed: Harbor job exceeded Google ADC token lifetime (3300s) in gke mode")+REPO_ROOT = Path(__file__).resolve().parents[2]+++def _doc_block(name: str, lead: str) -> str:+ """Return the one blank-line separated block of ``name`` that starts with ``lead``, whitespace-normalized."""+ blocks = [" ".join(block.split()) for block in (REPO_ROOT / name).read_text(encoding="utf-8").split("\n\n")]+ [block] = [block for block in blocks if block.startswith(lead)]+ return block+++def _changelog_entry(lead: str) -> str:+ """Return the one CHANGELOG.md bullet that starts with ``lead``, whitespace-normalized."""+ entries: list[list[str]] = []+ in_entry = False+ for line in (REPO_ROOT / "CHANGELOG.md").read_text(encoding="utf-8").splitlines():+ if line.startswith("- "):+ entries.append([line])+ in_entry = True+ elif in_entry and line.startswith(" "):+ entries[-1].append(line)+ else:+ in_entry = False+ [entry] = [text for text in (" ".join(" ".join(lines).split()) for lines in entries) if text.startswith(lead)]+ return entry# -- synthetic arm-level Harbor jobs ------------------------------------------@@ -306,18 +330,29 @@ def test_reports_reload_the_tolerated_agent_from_disk(tmp_path: Path) -> None:assert load_agent_data(tmp_path / "results")["opencode"]["execution_status"] == "failed"[email protected]("source", ["harbor_result", "trajectory"])-def test_oversized_completion_counter_rejects_tolerance_without_aborting_collection(- tmp_path: Path, source: str-) -> None:- huge_count = 10**400- launch_errors = _two_agent_jobs(tmp_path / "jobs", output_tokens=huge_count if source == "harbor_result" else None)+def _completion_counter_jobs(tmp_path: Path, source: str, count: Any) -> list[str]:+ """Return the launch errors of jobs whose timed-out baseline attempt reports ``count`` output tokens."""+ launch_errors = _two_agent_jobs(tmp_path / "jobs", output_tokens=count if source == "harbor_result" else None)if source == "trajectory":trial = tmp_path / "jobs" / f"{SKILL}-opencode-without" / "case-002__without1"_write_json(trial / "agent" / "trajectory.json",- {"steps": [], "final_metrics": {"total_completion_tokens": huge_count}},+ {"steps": [], "final_metrics": {"total_completion_tokens": count}},)+ return launch_errors++[email protected]("source", ["harbor_result", "trajectory"])+# Counts past the float range (either sign), past the JSON-safe integer range, and large floats.+ "count",+ [10**400, -(10**400), 2**53, 2**70, 1e16, 1e300],+ ids=["int-10pow400", "int-minus-10pow400", "int-2pow53", "int-2pow70", "float-1e16", "float-1e300"],+)+def test_oversized_completion_counter_rejects_tolerance_without_aborting_collection(+ tmp_path: Path, source: str, count: Any+) -> None:+ launch_errors = _completion_counter_jobs(tmp_path, source, count)results = _collect(tmp_path, launch_errors)@@ -326,6 +361,16 @@ def test_oversized_completion_counter_rejects_tolerance_without_aborting_collectassert results["agents"]["opencode"][REJECTION_KEY] == "no_progress_evidence"[email protected]("source", ["harbor_result", "trajectory"])+def test_completion_counter_at_the_json_safe_limit_proves_progress(tmp_path: Path, source: str) -> None:+ launch_errors = _completion_counter_jobs(tmp_path, source, 2**53 - 1)++ results = _collect(tmp_path, launch_errors)++ assert results["execution_status"] == "succeeded"+ assert results["agents"]["opencode"][RECORD_KEY]["failures"][0]["output_tokens"] == 2**53 - 1++def test_trajectory_completion_tokens_prove_progress(tmp_path: Path) -> None:launch_errors = _two_agent_jobs(tmp_path / "jobs", output_tokens=None)trial = tmp_path / "jobs" / f"{SKILL}-opencode-without" / "case-002__without1"@@ -337,6 +382,24 @@ def test_trajectory_completion_tokens_prove_progress(tmp_path: Path) -> None:assert results["agents"]["opencode"][RECORD_KEY]["failures"][0]["output_tokens"] == 42[email protected]("count", [2**53, 2**70, 1e16], ids=["int-2pow53", "int-2pow70", "float-1e16"])+def test_out_of_range_harbor_counter_falls_back_to_the_trajectory_and_the_changelog_says_so(+ tmp_path: Path, count: Any+) -> None:+ """Harbor's count past the JSON-safe range is no evidence, so an in-range trajectory count still proves progress."""+ launch_errors = _two_agent_jobs(tmp_path / "jobs", output_tokens=count)+ trial = tmp_path / "jobs" / f"{SKILL}-opencode-without" / "case-002__without1"+ _write_json(trial / "agent" / "trajectory.json", {"steps": [], "final_metrics": {"total_completion_tokens": 42}})++ results = _collect(tmp_path, launch_errors)++ assert results["execution_status"] == "succeeded"+ assert results["agents"]["opencode"][RECORD_KEY]["failures"][0]["output_tokens"] == 42+ # The entry refuses the agent only when the attempt has no other count in range.+ entry = _changelog_entry("- `--tolerate-baseline-timeouts` (added in 0.9.0) now follows its own rules")+ assert "with no other in-range count for that attempt the agent is refused as `no_progress_evidence`" in entry++@pytest.mark.parametrize(("failed", "code"),[@@ -654,7 +717,9 @@ def _render_reports(tmp_path: Path, results: dict[str, Any]) -> tuple[dict[str,return payload, benchmark, html-def _render_reports_and_message(tmp_path: Path, results: dict[str, Any]) -> tuple[dict[str, Any], str, str, str]:+def _render_reports_and_message(+ tmp_path: Path, results: dict[str, Any], *, max_attempts: int = 1+) -> tuple[dict[str, Any], str, str, str]:"""Like :func:`_render_reports`, and also return the Tier 3 result's ``agent_eval`` message."""from skillevaluator.evaluation.tier3_report import agent_eval_result_from_directory, render_agent_eval_html_report@@ -665,7 +730,7 @@ def _render_reports_and_message(tmp_path: Path, results: dict[str, Any]) -> tupl"run_dir": str(run_dir),"attempt_policy": {**results["attempt_policy"],- "max_attempts": 1,+ "max_attempts": max_attempts,"pass_threshold": 0.5,"stop_on_pass": False,},@@ -776,6 +841,7 @@ def test_verdict_comes_from_the_complete_peer_not_a_tolerated_agent(tmp_path: Path, peer: str, verdict: str, lead: str) -> None:from skillevaluator.evaluation.tier3_report import _agent_quality_verdict+ from skillevaluator.tier3.result_display import render_result# opencode activates the skill and passes every dimension and required# check (goal accuracy 1.0), but its baseline timed out. codex completes@@ -801,11 +867,64 @@ def test_verdict_comes_from_the_complete_peer_not_a_tolerated_agent(assert f"> **Tier 3 completed-agent result: {verdict.upper()}**" in benchmarkassert f"| Tier 3 | Live agent evaluation | **{verdict.upper()}** |" in benchmarkassert lead in html+ # The HTML overview says once that the tolerated baseline needs attention:+ # in the completed-agent lead, or in its own note when the lead reads+ # inconclusive, as BENCHMARK.md does in both cases.+ overview = html.split('<div class="t3-overview-lead">', 1)[1].split("</div>", 1)[0]+ lead_attention = "Other execution failures need attention."+ tolerated_attention = "<strong>Needs attention:</strong> baseline timeouts were tolerated."+ assert (lead_attention in overview) is (verdict == "fail")+ assert (tolerated_attention in overview) is (verdict == "inconclusive")+ assert "Baseline incomplete for <strong>opencode</strong> (1 of 2 attempts scored)" in overview+ assert "**Needs attention:** other execution failures remain." in benchmarkif verdict == "inconclusive":# The tolerated agent did activate the skill, so Insights names whose trials never did.assert payload["conclusions"][0]["message"].startswith("The skill was never activated in any positive with-skill trial of an agent with a complete baseline.")+ entry = _changelog_entry("- `--tolerate-baseline-timeouts` (added in 0.9.0) now follows its own rules")+ assert (+ "`report.html` also keeps the note when its overview reads Inconclusive because the complete agent "+ "never activated the skill." in entry+ )+ # The run verdict that `tier3 evaluate` prints reads the same agents.+ terminal = render_result(results)+ assert "Tier 3 Evaluation: DEGRADED" in terminal+ assert [line.strip() for line in terminal.splitlines() if line.startswith("RUN QUALITY VERDICT:")] == [+ f"RUN QUALITY VERDICT: {verdict.upper()}"+ ]+ block = _doc_block("docs/tier3-live-evaluation.mdx", "For a tolerated agent, the baseline condition stays")+ assert (+ "The run's verdict and the `RUN QUALITY VERDICT` line that `tier3 evaluate` prints read the same agents:"+ in block+ )++[email protected]("field", ["with_skill", "without_skill", "dimensions_with_skill"])+def test_printed_verdict_reads_every_agent_when_the_complete_peer_cannot_rank(tmp_path: Path, field: str) -> None:+ from skillevaluator.tier3.result_display import render_result++ # opencode passes and is tolerated. codex completes both arms, but its+ # persisted scores are not a map, so it cannot rank and does not set the+ # tolerated agent aside: the printed verdict reads every agent, and the+ # summary still renders.+ passing = {**SCORES, "goal_accuracy": 1.0}+ jobs = tmp_path / "jobs"+ _arm(jobs, "opencode", "with", [(case, "scored") for case in CASES], scores=passing, details=_activation(True))+ _arm(jobs, "opencode", "without", [("case-001", "scored"), ("case-002", "timeout")])+ _arm(jobs, "codex", "with", [(case, "scored") for case in CASES], details=_activation(True))+ _arm(jobs, "codex", "without", [(case, "scored") for case in CASES])+ results = _collect(tmp_path, [LAUNCH_ERROR.format(agent="opencode", count=1)])+ assert results[RUN_KEY]["tolerated_agents"] == ["opencode"]+ results.update({"skill_name": SKILL, "run_dir": str(tmp_path / "results")})+ results["agents"]["codex"][field] = "not a score map"++ terminal = render_result(results)++ assert "Tier 3 Evaluation: DEGRADED" in terminal+ assert [line.strip() for line in terminal.splitlines() if line.startswith("RUN QUALITY VERDICT:")] == [+ "RUN QUALITY VERDICT: PASS"+ ]def test_verdict_counts_come_from_a_complete_agent_that_set_the_verdict(tmp_path: Path) -> None:@@ -836,12 +955,20 @@ def test_verdict_counts_come_from_a_complete_agent_that_set_the_verdict(tmp_path@pytest.mark.parametrize(- ("tolerated", "panel_agent"),- [((), "opencode"), (("opencode",), None), (("opencode", "claude-code"), None)],+ ("tolerated", "panel_agent", "run_verdict"),+ [+ ((), "opencode", "FAIL"),+ (("opencode",), None, "INCONCLUSIVE"),+ (("opencode", "claude-code"), None, "INCONCLUSIVE"),+ ],ids=["none-tolerated", "one-tolerated", "two-tolerated"],)def test_terminal_findings_panel_never_shows_a_tolerated_agent(- tmp_path: Path, capsys: pytest.CaptureFixture[str], tolerated: tuple[str, ...], panel_agent: str | None+ tmp_path: Path,+ capsys: pytest.CaptureFixture[str],+ tolerated: tuple[str, ...],+ panel_agent: str | None,+ run_verdict: str,) -> None:from skillevaluator.tier3.result_display import render_result@@ -862,8 +989,14 @@ def test_terminal_findings_panel_never_shows_a_tolerated_agent(results.update({"skill_name": SKILL, "run_dir": str(tmp_path / "results")})capsys.readouterr()- render_result(results)+ rendered = render_result(results)printed = capsys.readouterr().out+ # The run verdict reads only codex once every activated agent is tolerated+ # (codex never activated). Without tolerance, opencode misses its goals+ # (goal accuracy 0.8), so the run fails, as on main.+ assert [line for line in rendered.splitlines() if line.startswith("RUN QUALITY VERDICT:")] == [+ f"RUN QUALITY VERDICT: {run_verdict}"+ ]written = sorted(path.parent.name for path in (tmp_path / "results").glob("*/findings.json"))if panel_agent is None:# The canonical best agent is codex, which has no findings to show. No@@ -876,6 +1009,22 @@ def test_terminal_findings_panel_never_shows_a_tolerated_agent(assert written == [panel_agent][email protected]("tolerate", [True, False], ids=["tolerated", "default"])+def test_failed_baseline_fails_the_run_unless_tolerated_and_the_docs_say_so(tmp_path: Path, tolerate: bool) -> None:+ """The baseline arm stays failed either way; only the option keeps the agent and the run."""+ results = _collect(tmp_path, _two_agent_jobs(tmp_path / "jobs"), tolerate_baseline_timeouts=tolerate)++ payload, _benchmark, _html = _render_reports(tmp_path, results)++ (notice,) = payload["coverage_notices"]+ assert (notice["agent"], notice["code"], notice["state"]) == ("opencode", "baseline_failed", "incomplete")+ assert payload["execution_status"] == ("succeeded" if tolerate else "failed")+ assert ("The agent and the Tier 3 run are marked failed." in notice["message"]) is not tolerate+ block = _doc_block("docs/reports.mdx", "An arm that ran but failed")+ assert "fails the agent and the run unless `--tolerate-baseline-timeouts` keeps the agent scored" in block+ assert "[Baseline timeouts](/skills/skillevaluator/tier3-live-evaluation#baseline-timeouts)" in block++@pytest.mark.parametrize("kwargs", [{"grading_mode": "custom_only"}, {"skip_baseline": True}])def test_tolerance_needs_a_baseline_and_dimension_grading(tmp_path: Path, kwargs: dict[str, Any]) -> None:launch_errors = _two_agent_jobs(tmp_path / "jobs")@@ -1080,18 +1229,26 @@ def test_stop_on_pass_recovered_timeout_beside_unrecovered_ones(tmp_path: Path)assert results[RUN_KEY]["explained_launch_errors"] == launch_errors-def test_cost_limit_attempts_that_never_ran_are_not_missing_baseline_attempts(tmp_path: Path) -> None:+_COST_LIMIT_LAUNCH_ERROR = (+ "opencode without-skill Harbor run failed: case-a attempt 2: Harbor job did not complete successfully: 1 errored"+)+++def _collect_cost_limited(tmp_path: Path, *, codex_short: bool = False) -> dict[str, Any]:+ """Collect attempt jobs a cost limit cut short; opencode's second case-a baseline attempt timed out.++ The limit admitted no attempt of case-b for opencode. With ``codex_short``+ it also left codex's second case-b attempt ``not_run`` in both arms.+ """pytest.importorskip("harbor")from skillevaluator.tier3.harbor.runner import _merge_attempt_jobs- # A cost limit runs every attempt as its own job. It admitted no attempt- # of case-b for opencode, so neither arm expects case-b; only the timed-out- # second attempt of case-a is missing from the baseline.+ codex_b_attempts = 1 if codex_short else 2plan = {("opencode", "with"): {"case-a": ["pass", "pass"]},("opencode", "without"): {"case-a": ["pass", "timeout"]},- ("codex", "with"): {"case-a": ["pass", "pass"], "case-b": ["pass", "pass"]},- ("codex", "without"): {"case-a": ["fail", "fail"], "case-b": ["fail", "fail"]},+ ("codex", "with"): {"case-a": ["pass", "pass"], "case-b": ["pass"] * codex_b_attempts},+ ("codex", "without"): {"case-a": ["fail", "fail"], "case-b": ["fail"] * codex_b_attempts},}for (agent, variant), cases in plan.items():jobs = [@@ -1105,11 +1262,12 @@ def test_cost_limit_attempts_that_never_ran_are_not_missing_baseline_attempts(tmfor arm in ("with", "without")for attempt in (1, 2)]- launch_errors = [- "opencode without-skill Harbor run failed: case-a attempt 2: Harbor job did not complete successfully: 1 errored"- ]-- results = collect_harbor_results(+ if codex_short:+ not_run += [+ {"agent": "codex", "arm": arm, "case_id": "case-b", "attempt": 2, "status": "not_run"}+ for arm in ("with", "without")+ ]+ return collect_harbor_results(skill_name=SKILL,agents=["opencode", "codex"],output_dir=tmp_path / "results",@@ -1119,11 +1277,18 @@ def test_cost_limit_attempts_that_never_ran_are_not_missing_baseline_attempts(tmexpected_case_ids=["case-a", "case-b"],case_id_by_task_selector={"case-a": "case-a", "case-b": "case-b"},expected_trials=4,- launch_errors=launch_errors,+ launch_errors=[_COST_LIMIT_LAUNCH_ERROR],tolerate_baseline_timeouts=True,budget_not_run=not_run,)++def test_cost_limit_attempts_that_never_ran_are_not_missing_baseline_attempts(tmp_path: Path) -> None:+ # A cost limit runs every attempt as its own job. It admitted no attempt+ # of case-b for opencode, so neither arm expects case-b; only the timed-out+ # second attempt of case-a is missing from the baseline.+ results = _collect_cost_limited(tmp_path)+opencode = results["agents"]["opencode"]assert results["execution_status"] == "succeeded", results.get("warnings")assert results["partial"] is True@@ -1132,7 +1297,50 @@ def test_cost_limit_attempts_that_never_ran_are_not_missing_baseline_attempts(tmrecord = opencode[RECORD_KEY]assert (record["expected_attempts"], record["scored_attempts"], record["failed_attempts"]) == (2, 1, 1)assert [(failure["case_id"], failure["attempt"]) for failure in record["failures"]] == [("case-a", 2)]- assert results[RUN_KEY]["explained_launch_errors"] == launch_errors+ assert results[RUN_KEY]["explained_launch_errors"] == [_COST_LIMIT_LAUNCH_ERROR]++[email protected]("codex_short", [False, True], ids=["peer-complete", "peer-cost-limited"])+def test_reports_name_tolerated_agents_without_a_completed_agent_result(tmp_path: Path, codex_short: bool) -> None:+ from skillevaluator.reporting.tier3_scope import completed_agent_result++ # With codex_short the cost limit also cut the best agent's coverage, so+ # the reports have no completed-agent result; the tolerated baseline still+ # needs attention and is named in both reports.+ results = _collect_cost_limited(tmp_path, codex_short=codex_short)+ assert results["execution_status"] == "succeeded", results.get("warnings")+ assert results[RUN_KEY]["tolerated_agents"] == ["opencode"]++ payload, benchmark, html, _message = _render_reports_and_message(tmp_path, results, max_attempts=2)++ assert payload["best_agent"] == "codex"+ assert (completed_agent_result(payload) is None) is codex_short+ assert _tolerated_line("opencode") in benchmark+ assert benchmark.count("**Needs attention:**") == 1+ assert "Baseline incomplete for <strong>opencode</strong> (1 of 2 attempts scored)" in html+ attention = "**Needs attention:** baseline timeouts were tolerated."+ html_attention = (+ '<span class="tolerated-baseline"><strong>Needs attention:</strong> baseline timeouts were tolerated.</span>'+ )+ if codex_short:+ # Nothing before the note names other failures, so it names the cause.+ assert "Completed agent: **codex**" not in benchmark+ assert f"{attention}\n{_tolerated_line('opencode')}" in benchmark+ assert "other execution failures" not in benchmark.lower()+ assert html_attention in html+ assert "other execution failures" not in html.lower()+ entry = _changelog_entry("- `--tolerate-baseline-timeouts` (added in 0.9.0) now follows its own rules")+ assert (+ "also when a cost limit leaves the best agent's attempts short; both reports used to leave them out "+ "in that case." in entry+ )+ else:+ # The completed-agent lead already says that other failures need attention.+ assert "Completed agent: **codex**" in benchmark+ assert "**Needs attention:** other execution failures remain." in benchmark+ assert "Other execution failures need attention. This is not a whole-run or publication PASS." in html+ assert attention not in benchmark+ assert html_attention not in html# -- pure rules -----------------------------------------------------------------