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): report final budgets and incomplete run verdicts (#594)

Christopher Kevine7414e48b1f1
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ff87eb43..b0b9339e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -451,6 +451,11 @@ All notable changes to SkillEvaluator are documented in this file.
After observed symlink creation, only an unadorned direct leaf can qualify;
unknown command directories cannot qualify. Literal quoting is inert
because expansions and escapes are rejected before operands are parsed.
+- Tier 3 reports now use final run-budget accounting, including when rebuilding
+ saved runs with stale configuration snapshots. Terminal, HTML, and benchmark
+ reports show budget exhaustion, not-run attempts, overruns, and unverified
+ usage. Budget-stopped runs have an incomplete summary verdict; admitted
+ scores remain visible and their lift is not a complete-run skill-effect claim.
- The Tier 3 security scan no longer reads the license URL in a source file's
copyright header as data exfiltration. A `http://` or `https://` URL on a
comment line of a license or copyright notice is prose within recognized
diff --git a/docs/reports.mdx b/docs/reports.mdx
index 946b79a6..c8e7de74 100644
--- a/docs/reports.mdx
+++ b/docs/reports.mdx
@@ -989,6 +989,16 @@ count as activation opportunities; missing or unsupported evidence remains
unknown. Eligibility is determined separately for each agent, so another
agent with observed activation can still contribute a comparison.
+Budget-stopped runs are different from evaluated failures. If `budget.not_run`
+contains attempts, the canonical run summary verdict is `incomplete`, with a
+reason naming the budget and the planned attempts left not run. Terminal,
+HTML, `tier3-benchmark.md`, and the full benchmark card show the budget summary.
+Admitted attempts retain their scores, but any Skill Lift is labelled as
+covering admitted attempts only, not a complete-run claim that the skill helps.
+An overrun alone keeps the verdict and adds the budget warning. All reports
+use final accounting; rebuilding older runs prefers `result.json.budget` over
+a stale `run_config.json` snapshot. Execution status and exit codes are unchanged.
+
An arm that ran but failed, for example because one baseline attempt hit the
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)),
diff --git a/docs/tier3-live-evaluation.mdx b/docs/tier3-live-evaluation.mdx
index 7dec30eb..c532b79c 100644
--- a/docs/tier3-live-evaluation.mdx
+++ b/docs/tier3-live-evaluation.mdx
@@ -1007,6 +1007,20 @@ including for older saved runs. Missing or partially measured bounded usage
is reported as unverified, and unconfigured limits are not checked. An observed
overrun alone does not change scores, execution success, or partial-run status.
+After execution, `run_config.json`, `result.json.run_config.budget`, and
+`result.json.budget` contain the same final accounting. Reports also prefer
+the top-level result budget when rebuilding older runs with stale run configs.
+Terminal, HTML, and benchmark reports show the shared budget summary, including
+exhaustion, not-run attempts, measured overruns, and unverified bounded usage.
+
+When `budget.not_run` is non-empty, the run-level summary verdict is
+`incomplete`: the budget left planned work unexecuted, not evaluated failures.
+Admitted attempts keep their per-case and per-agent scores. Any displayed
+Skill Lift covers admitted attempts only; it is not a complete-run verdict
+that the skill helps. An overrun without not-run attempts retains its verdict.
+Budget reporting does not change admission, scoring, execution status, or
+command exit codes.
+
In a terminal, `--progress auto` uses the `rich` view: one table of the run
plan and its stages that keeps the same height for the whole run. Each row is
one line, and a long value ends in an ellipsis instead of wrapping. The agent
diff --git a/src/skillevaluator/evaluation/tier3_report.py b/src/skillevaluator/evaluation/tier3_report.py
index b28719d5..df0a0821 100644
--- a/src/skillevaluator/evaluation/tier3_report.py
+++ b/src/skillevaluator/evaluation/tier3_report.py
@@ -536,13 +536,19 @@ def agent_eval_result_from_directory(
skill_name = (
persisted_skill_name if isinstance(persisted_skill_name, str) and persisted_skill_name else skill_path.name
)
+ run_config = _read_run_config(run_dir)
+ result_truth = engine_result if isinstance(engine_result, dict) else _persisted_run_result(run_dir)
+ if not isinstance(result_truth, dict) or not isinstance(result_truth.get("budget"), dict):
+ result_truth = _persisted_run_result(run_dir)
+ if isinstance(result_truth, dict) and isinstance(result_truth.get("budget"), dict):
+ run_config = {**(run_config or {}), "budget": result_truth["budget"]}
payload = build_agent_eval_payload(
skill_name,
agents,
dataset=dataset,
attempt_policy=attempt_policy,
historical_missing_score_policy="score_policy" not in attempt_policy,
- run_config=_read_run_config(run_dir),
+ run_config=run_config,
env_mode=env_mode,
runtime_seconds=_runtime_seconds(engine_result),
harbor_viewer=_harbor_viewer_from_engine_result(engine_result),
@@ -698,6 +704,9 @@ def render_agent_eval_html_report(
# Restored feedback and fresh findings both join after the initial size budget.
fit_token_usage(canonical_payload)
if engine_result is not None and isinstance(canonical_payload, dict):
+ if canonical_payload.get("verdict") == "incomplete" and (canonical_payload.get("budget") or {}).get("not_run"):
+ engine_result["summary"] = dict(canonical_payload["summary"])
+ engine_result["verdict"] = "incomplete"
# Persist only the compact feedback contract needed by the CLI. The
# complete canonical payload remains in the HTML report and can be much
# larger because it duplicates trials, datasets, agents, and provenance.
@@ -1116,7 +1125,13 @@ def build_agent_eval_payload(
)
budget_metadata = (run_config or {}).get("budget")
- from skillevaluator.tier3.harbor.run_budget import budget_line
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason, budget_line
+
+ if reason := budget_incomplete_reason(budget_metadata):
+ verdict = "incomplete"
+ summary.update(verdict=verdict, verdict_reason=reason, overall_lift=None)
+ overall_lift = None
+ deterministic_conclusions = [{"severity": "warn", "title": "Evaluation incomplete", "message": reason}]
payload = {
"schema_version": _SCHEMA_VERSION,
@@ -4261,7 +4276,11 @@ def _apply_saved_feedback(
"""
saved = {field: list(saved_feedback[field]) for field in _TIER3_FEEDBACK_FIELDS if field in saved_feedback}
fixes = _saved_case_fixes(run_dir)
- if any(_is_case_verdict(item) for item in saved.get("conclusions", [])):
+ if (payload.get("budget") or {}).get("not_run"):
+ saved.pop("conclusions", None)
+ payload.update(saved)
+ _apply_case_findings(payload, engine_result, run_dir, skill_path, use_llm=False, fixes=fixes)
+ elif any(_is_case_verdict(item) for item in saved.get("conclusions", [])):
_apply_case_findings(payload, engine_result, run_dir, skill_path, use_llm=False, fixes=fixes)
payload.update(saved)
else:
@@ -4299,6 +4318,10 @@ def _apply_case_findings(
logger.debug("Case findings skipped", exc_info=True)
return
label, detail = case_verdict(source["agents"])
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason
+
+ if reason := budget_incomplete_reason(payload.get("budget")):
+ label, detail = "incomplete", reason
if not label:
return
message = f"per-case result: {label} ({detail})."
diff --git a/src/skillevaluator/reporting/benchmark.py b/src/skillevaluator/reporting/benchmark.py
index 5ed1f435..4086bd9c 100644
--- a/src/skillevaluator/reporting/benchmark.py
+++ b/src/skillevaluator/reporting/benchmark.py
@@ -202,7 +202,15 @@ class BenchmarkReporter(ReporterBase):
run_verdict = ae.get("verdict") if isinstance(ae, dict) else None
run_reason = ae.get("verdict_reason") if isinstance(ae, dict) else None
- if self.report_scope == "tier3" and isinstance(run_verdict, str):
+ budget = ae.get("budget") if isinstance(ae, dict) else None
+ budget_reason = None
+ if isinstance(budget, dict):
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason, budget_line
+
+ budget_reason = budget_incomplete_reason(budget)
+ if budget_reason:
+ tier3_callout = f"> **Tier 3: INCOMPLETE** — {budget_reason}"
+ elif self.report_scope == "tier3" and isinstance(run_verdict, str):
tier3_callout = f"> **Tier 3 completed-agent result: {run_verdict.upper()}**" + (
f" — {_publication_safe_inline(run_reason, private_labels)}" if run_reason else ""
)
@@ -269,6 +277,11 @@ class BenchmarkReporter(ReporterBase):
]
)
+ if budget_reason and self.report_scope != "tier3":
+ lines.extend([tier3_callout, ""])
+ if isinstance(budget, dict):
+ lines.extend([f"> {budget_line(budget)}", ""])
+
tolerated_lines = []
for tolerated in tolerated_baseline_agents(ae):
scored, expected = tolerated["scored_attempts"], tolerated["expected_attempts"]
@@ -279,12 +292,14 @@ class BenchmarkReporter(ReporterBase):
)
if completed and (self.report_scope == "tier3" or completed["needs_attention"]):
lines.append(
- f"Completed agent: **{_publication_safe_inline(completed['name'], private_labels)}**; "
+ f"{'Admitted-attempt agent' if budget_reason else 'Completed agent'}: "
+ f"**{_publication_safe_inline(completed['name'], private_labels)}**; "
f"score **{completed['score']:.4f}** ({completed['score'] * 100:.2f}%)."
)
if completed["lift"] is not None:
lines.append(
- f"Skill Lift: **{completed['lift']:+.4f}** ({completed['lift'] * 100:+.2f} percentage points)."
+ f"Skill Lift{' (admitted attempts only)' if budget_reason else ''}: "
+ f"**{completed['lift']:+.4f}** ({completed['lift'] * 100:+.2f} percentage points)."
)
lines.append(SKILL_LIFT_DEFINITION)
if pass_summary := pass_at_k_summary((ae or {}).get("pass_at_k"), (ae or {}).get("attempt_policy")):
diff --git a/src/skillevaluator/reporting/cli.py b/src/skillevaluator/reporting/cli.py
index 0bbdba6a..9e11b7c2 100644
--- a/src/skillevaluator/reporting/cli.py
+++ b/src/skillevaluator/reporting/cli.py
@@ -468,7 +468,14 @@ class CLIReporter(ReporterBase):
composite_style = lift_style(composite) if scored_lift else "dim"
verdict_text = escape_markup(str(verdict).upper())
verdict_reason = agent_eval.get("verdict_reason")
- safe_reason = f" — {escape_markup(str(verdict_reason))}" if verdict == "fail" and verdict_reason else ""
+ safe_reason = (
+ f" — {escape_markup(str(verdict_reason))}" if verdict in {"fail", "incomplete"} and verdict_reason else ""
+ )
+ budget = agent_eval.get("budget")
+ if isinstance(budget, dict):
+ from skillevaluator.tier3.harbor.run_budget import budget_line
+
+ console.print(escape_markup(budget_line(budget)))
lift_label = (
"Skill Lift (for reference)" if verdict == "fail" and scored_lift and composite > 0 else "Skill Lift"
)
diff --git a/src/skillevaluator/reporting/console_ui.py b/src/skillevaluator/reporting/console_ui.py
index 7c3ffc3c..5bc40ea2 100644
--- a/src/skillevaluator/reporting/console_ui.py
+++ b/src/skillevaluator/reporting/console_ui.py
@@ -1556,6 +1556,13 @@ def summarize_tier3(
rows = [TierRow("agent", agent_segments)]
if payload.get("verdict") == "inconclusive" or summary.get("verdict") == "inconclusive":
rows.append(TierRow("verdict", [("INCONCLUSIVE: skill never activated", TEXT)]))
+ budget = payload.get("budget")
+ if isinstance(budget, dict):
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason, budget_line
+
+ rows.append(TierRow("budget", [(budget_line(budget), TEXT)]))
+ if reason := budget_incomplete_reason(budget):
+ rows.append(TierRow("verdict", [(f"INCOMPLETE: {reason}", TEXT)]))
lift = _tier3_finite_number(summary.get("overall_lift"))
with_score = _tier3_finite_number(summary.get("overall_score"))
if lift is not None and -1.0 <= lift <= 1.0 and with_score is not None and 0.0 <= with_score <= 1.0:
diff --git a/src/skillevaluator/reporting/html.py b/src/skillevaluator/reporting/html.py
index 75108667..bd65021a 100644
--- a/src/skillevaluator/reporting/html.py
+++ b/src/skillevaluator/reporting/html.py
@@ -2941,7 +2941,7 @@ class HTMLReporter(ReporterBase):
) -> bool:
if agent_eval_publication_evidence_complete(candidate):
return True
- if payload_verdict(candidate) not in {"pass", "neutral", "fail", "inconclusive"}:
+ if payload_verdict(candidate) not in {"pass", "neutral", "fail", "inconclusive", "incomplete"}:
return False
execution_status = payload_execution_status(candidate)
if execution_status == "succeeded":
diff --git a/src/skillevaluator/reporting/templates/report.html.j2 b/src/skillevaluator/reporting/templates/report.html.j2
index d1e9f222..fdf478cf 100644
--- a/src/skillevaluator/reporting/templates/report.html.j2
+++ b/src/skillevaluator/reporting/templates/report.html.j2
@@ -1252,6 +1252,7 @@
{% set tier3_is_skipped = tier3_execution_status == 'skipped' or (tier3_provenance_data.get('advisory') and tier3_provenance_data.get('reason') == 'skipped') %}
{% set tier3_skip_message = tier3_provenance_data.get('message') or 'Live evaluation did not run.' %}
{% set tier3_verdict = (tier3_effective_status or tier3.get('verdict') or 'unknown') | lower if has_tier3 else 'unknown' %}
+ {% if has_tier3 and tier3.budget and tier3.budget.not_run %}{% set tier3_verdict = 'incomplete' %}{% endif %}
{#- A failing tier whose gate does not block is "Failed (advisory)", never "Changes required". -#}
{% set tier3_advisory_fail = tier3_verdict == 'fail' and 'tier3' in nonblocking_tiers %}
{% set has_t12_tab = tabs | selectattr('id', 'in', ['tier1', 'tier2']) | list | length > 0 %}
@@ -1319,7 +1320,7 @@
<div class="agent-hero-title-block">
<span class="agent-hero-eyebrow">{{ content_label }} evaluation</span>
<h1 class="agent-hero-title" id="report-title">{{ hero_title }}</h1>
- <p class="hero-command-status verdict-chip {{ verdict_class }}">{{ presentation.command_label }}</p>
+ <p class="hero-command-status verdict-chip {{ 'warn' if has_tier3 and tier3.budget and tier3.budget.not_run and report_scope == 'tier3' else verdict_class }}">{{ 'Incomplete' if has_tier3 and tier3.budget and tier3.budget.not_run and report_scope == 'tier3' else presentation.command_label }}</p>
{% if presentation.required_failed or presentation.required_incomplete %}<p class="hero-decision-reason">{{ presentation.required_failed }} failed · {{ presentation.required_incomplete }} incomplete required check(s). See tier evidence for reasons.</p>{% endif %}
{% if presentation.advisory_unfavorable %}<p class="hero-decision-reason">{{ presentation.advisory_unfavorable }} advisory check(s) failed or incomplete; advisory checks do not change the required result.</p>{% endif %}
{#-
@@ -1354,8 +1355,9 @@
</div>
{% else %}
{% set t3_key = tier3_verdict if tier3_verdict in ['pass', 'fail', 'neutral'] else 'incomplete' %}
+ {% if tier3.budget and tier3.budget.not_run %}{% set t3_key = 'incomplete' %}{% endif %}
<span class="verdict-chip {{ {'pass': 'pass', 'fail': 'fail'}.get(t3_key, 'warn') }}">Tier 3 quality: {{ advisory_fail_word if tier3_advisory_fail else verdict_words[t3_key] }}</span>
- {% if t3_key == 'incomplete' and tier3_status_reason %}<p class="hero-reason">{{ tier3_status_reason }}</p>{% endif %}
+ {% if t3_key == 'incomplete' and tier3_status_reason %}<p class="hero-reason">{{ tier3.verdict_reason if tier3.budget and tier3.budget.not_run else tier3_status_reason }}</p>{% endif %}
<div class="agent-hero-score {{ 'score-pass' if hero_score is not none and hero_score >= 0.8 else ('score-warn' if hero_score is not none and hero_score >= 0.6 else 'score-fail') }}">{{ "%.2f" | format(hero_score) if hero_score is not none else "N/A" }}<span class="hero-score-label">{{ presentation.score_scope }}{{ ' (baseline)' if tier3.get('mode') == 'baseline_only' else '' }}</span></div>
<div class="agent-hero-detail">
<div><strong>Best performing agent:</strong> {{ tier3.best_agent or 'N/A' }}</div>
@@ -2208,9 +2210,10 @@
{% set t3_evidence_links = t3_harbor.get('evidence_links') or [] %}
{% set t3_agent_anchor_ids = {} %}
{% set t3_agent_panel_ids = {} %}
- {% if tier3.budget_summary and (t3_budget.status == 'exhausted' or 'overrun observed' in tier3.budget_summary or 'not fully verified' in tier3.budget_summary) %}
+ {% if tier3.budget_summary and (t3_budget.status == 'exhausted' or t3_budget.partial or t3_budget.not_run or 'overrun observed' in tier3.budget_summary or 'not fully verified' in tier3.budget_summary) %}
<p class="warning">{{ tier3.budget_summary }}</p>
{% endif %}
+ {% if t3_budget.not_run %}<p class="warning">All scores and Skill Lift below cover admitted attempts only, not the complete planned run.</p>{% endif %}
{% for name, _agent in t3_agents.items() %}
{% set _ = t3_agent_anchor_ids.update({name: 'tier3-agent-anchor-' ~ loop.index0}) %}
{% set _ = t3_agent_panel_ids.update({name: 'tier3-agent-panel-' ~ loop.index0}) %}
diff --git a/src/skillevaluator/tier3/case_summary.py b/src/skillevaluator/tier3/case_summary.py
index 9399a135..0dd7f055 100644
--- a/src/skillevaluator/tier3/case_summary.py
+++ b/src/skillevaluator/tier3/case_summary.py
@@ -680,6 +680,10 @@ def render_case_summary(
if not case_ids:
return False
label, detail = verdict(agents)
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason
+
+ if reason := budget_incomplete_reason(result.get("budget")):
+ label, detail = "incomplete", reason
if label:
style = "bold green" if label == "skill helps" else "bold red" if label == "skill hurts" else "bold yellow"
line = Text(f"{'✔' if label == 'skill helps' else '✖' if label == 'skill hurts' else '•'} {label}", style=style)
diff --git a/src/skillevaluator/tier3/harbor/run_budget.py b/src/skillevaluator/tier3/harbor/run_budget.py
index bd133ba6..15f716d5 100644
--- a/src/skillevaluator/tier3/harbor/run_budget.py
+++ b/src/skillevaluator/tier3/harbor/run_budget.py
@@ -337,6 +337,16 @@ def _budget_number(value: Any, *, cost: bool = False, missing: str = "not measur
return f"{number:,}"
+def budget_incomplete_reason(metadata: object) -> str | None:
+ if not isinstance(metadata, dict) or not isinstance(metadata.get("not_run"), list) or not metadata["not_run"]:
+ return None
+ return (
+ f"run budget left {len(metadata['not_run'])} of "
+ f"{_budget_number(metadata.get('planned_attempts'), missing='unknown')} planned attempts not run; "
+ "scores and Skill Lift cover only admitted attempts"
+ )
+
+
def budget_line(metadata: dict[str, Any]) -> str:
# Recompute from usage and limits: cached observations may be absent or stale.
overruns, incomplete, configured = _budget_observations(metadata)
diff --git a/src/skillevaluator/tier3/harbor/runner.py b/src/skillevaluator/tier3/harbor/runner.py
index d37dc594..586b1b0b 100644
--- a/src/skillevaluator/tier3/harbor/runner.py
+++ b/src/skillevaluator/tier3/harbor/runner.py
@@ -6709,6 +6709,7 @@ def _run_harbor_eval_impl(
_emit_run_finished("failed", "result collection failed")
raise
reporter.emit(ProgressEvent(stage="collection", state="complete", detail="Harbor results collected"))
+ run_config["budget"] = budget.metadata()
identity["score_policy"] = results.get("score_policy", identity["score_policy"])
results.update(
{
@@ -6731,7 +6732,7 @@ def _run_harbor_eval_impl(
"dataset_digest_algorithm": dataset_truth["dataset_digest_algorithm"],
"identity_dataset_digest": identity_digest,
"baseline_task_tree_digest": task_tree_digest,
- "budget": budget.metadata(),
+ "budget": run_config["budget"],
"dataset_provenance": dataset_provenance,
"run_config": run_config,
"partial": bool(budget.not_run),
@@ -6802,6 +6803,11 @@ def _run_harbor_eval_impl(
if best_agent in agent_results:
results["dataset_sufficiency"] = agent_results[best_agent]["dataset_sufficiency"]
selected_metrics = tuple(results.get("metrics", DEFAULT_METRICS))
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason
+
+ if reason := budget_incomplete_reason(results["budget"]):
+ results["verdict"] = "incomplete"
+ results["summary"] = {"verdict": "incomplete", "verdict_reason": reason}
collected_attempt_policy = results.get("attempt_policy")
attempt_policy = dict(collected_attempt_policy) if isinstance(collected_attempt_policy, dict) else {}
selected_policy = results.get("score_policy") or attempt_policy.get("score_policy")
diff --git a/src/skillevaluator/tier3/result_display.py b/src/skillevaluator/tier3/result_display.py
index ed51fa10..29bb898a 100644
--- a/src/skillevaluator/tier3/result_display.py
+++ b/src/skillevaluator/tier3/result_display.py
@@ -528,6 +528,11 @@ def _agent_score_headlines(
agents = result.get("agents")
multiple_agents = isinstance(agents, Mapping) and len(agents) > 1
agent_verdict = "inconclusive" if _never_activated(data) else "fail" if verdict_reason else "pass"
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason
+
+ budget_partial = budget_incomplete_reason(result.get("budget")) is not None
+ if budget_partial:
+ agent_verdict = "incomplete"
if multiple_agents or verdict_reason:
verdict_label = f"QUALITY VERDICT ({safe(agent)}):" if multiple_agents else "QUALITY VERDICT:"
reason = f" — {safe(verdict_reason)}" if verdict_reason else ""
@@ -542,6 +547,8 @@ def _agent_score_headlines(
)
):
lift_label = "OVERALL SKILL LIFT"
+ if budget_partial:
+ lift_label += " (admitted attempts only)"
if verdict_reason and _finite_number(overall.get("delta")) is not None and overall["delta"] > 0:
lift_label += " (for reference)"
headline = Text(f"{lift_label} ", style="bold")
@@ -1097,11 +1104,21 @@ def render_evaluation_result(
console.print(safe(baseline_description(dict(baseline))))
budget = result.get("budget")
if isinstance(budget, Mapping) and (
- budget.get("status") == "exhausted" or any(value is not None for value in (budget.get("limits") or {}).values())
+ budget.get("status") == "exhausted"
+ or budget.get("partial")
+ or budget.get("not_run")
+ or budget.get("observed_overruns")
+ or any(value is not None for value in (budget.get("limits") or {}).values())
):
from skillevaluator.tier3.harbor.run_budget import budget_line
console.print(budget_line(dict(budget)))
+ from skillevaluator.tier3.harbor.run_budget import budget_incomplete_reason
+
+ budget_reason = budget_incomplete_reason(dict(budget)) if isinstance(budget, Mapping) else None
+ if budget_reason:
+ console.print(Text("RUN QUALITY VERDICT: INCOMPLETE", style="bold yellow"))
+ console.print(Text(budget_reason, style="yellow"))
provenance_line, provenance_is_template = dataset_provenance_display(result.get("dataset_provenance"))
if provenance_line:
console.print(Text(provenance_line, style="yellow" if provenance_is_template else "dim"))
@@ -1120,7 +1137,7 @@ def render_evaluation_result(
rendered_feedback_messages = _render_incomplete_execution(result=result, console=console, safe=safe)
has_cases = False
if isinstance(agents, Mapping) and agents and not incomplete:
- if len(agents) > 1:
+ if len(agents) > 1 and not budget_reason:
run_verdict = str(result.get("verdict") or "").casefold()
if run_verdict not in {"pass", "fail", "neutral", "inconclusive"}:
agent_verdicts = []
diff --git a/tests/reporting/test_budget_partial_reporting.py b/tests/reporting/test_budget_partial_reporting.py
new file mode 100644
index 00000000..86488c6f
--- /dev/null
+++ b/tests/reporting/test_budget_partial_reporting.py
@@ -0,0 +1,135 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+import copy
+import json
+
+import pytest
+from rich.console import Console
+
+from skillevaluator.evaluation import tier3_report
+from skillevaluator.reporting import BenchmarkReporter, CLIReporter, HTMLReporter
+from skillevaluator.tier3.harbor import report_data
+from skillevaluator.tier3.harbor.metrics import DEFAULT_METRICS
+from skillevaluator.tier3.harbor.run_budget import BudgetController, budget_incomplete_reason, budget_line
+from skillevaluator.tier3.result_display import render_evaluation_result
+
+
+def _agents():
+ scores = dict.fromkeys(DEFAULT_METRICS, 1.0)
+ baseline = dict.fromkeys(DEFAULT_METRICS, 0.5)
+ condition = {"execution_status": "succeeded", "expected_attempts": 1, "scored_attempts": 1}
+ return {
+ "agent": {
+ "model": "test-model",
+ "execution_status": "succeeded",
+ "execution_errors": [],
+ "expected_attempts": 2,
+ "scored_attempts": 2,
+ "with_skill": scores,
+ "without_skill": baseline,
+ "rewards": [{**scores, "entry_id": "case", "trial_id": "case__attempt1"}],
+ "rewards_baseline": [{**baseline, "entry_id": "case", "trial_id": "case__attempt1"}],
+ "conditions": {"with_skill": dict(condition), "without_skill": dict(condition)},
+ "num_trials": 1,
+ "num_trials_baseline": 1,
+ }
+ }
+
+
+def _budget(kind):
+ budget = BudgetController(max_agent_tokens=None if kind == "no_limits" else 10, planned=4)
+ budget.admit(agent="agent", arm="with", case_id="case", attempt=1)
+ budget.record_usage({"total_tokens": 20, "judge_calls": 1})
+ if kind == "partial":
+ budget.admit(agent="agent", arm="with", case_id="case", attempt=2)
+ if kind == "unverified":
+ budget.record_usage({})
+ return budget.metadata()
+
+
[email protected]("kind", ["partial", "overrun", "unverified", "no_limits"])
+def test_budget_payload_and_all_reports(kind):
+ budget = _budget(kind)
+ agents = _agents()
+ original = copy.deepcopy(agents)
+ payload = tier3_report.build_agent_eval_payload("demo", agents, run_config={"budget": budget}, use_llm_judge=False)
+ assert agents == original
+ assert payload["budget"] == budget
+ assert payload["budget_summary"] == budget_line(budget)
+ assert payload["execution_status"] == "succeeded"
+ assert payload["agents"]["agent"]["with_skill"] is not None
+ if kind == "partial":
+ assert payload["verdict"] == payload["summary"]["verdict"] == "incomplete"
+ assert payload["summary"]["verdict_reason"] == budget_incomplete_reason(budget)
+ assert payload["overall_lift"] is None
+ else:
+ assert payload["verdict"] == "pass"
+
+ result = tier3_report._validation_result_from_payload(payload)
+ for scope in ("publication", "tier3"):
+ benchmark = BenchmarkReporter(report_scope=scope, include_timestamp=False).render_all([result])
+ assert budget_line(budget) in benchmark
+ if kind == "partial":
+ assert "> **Tier 3: INCOMPLETE**" in benchmark
+ assert "completed-agent result: PASS" not in benchmark
+ assert "Skill Lift:" not in benchmark
+ html = HTMLReporter(report_scope="tier3", include_timestamp=False).render_all([result])
+ if kind != "no_limits":
+ assert f'<p class="warning">{budget_line(budget)}</p>' in html
+ else:
+ assert f'<p class="warning">{budget_line(budget)}</p>' not in html
+ if kind == "partial":
+ assert "Tier 3 quality: Incomplete" in html
+ assert "cover admitted attempts only" in html
+ console = Console(record=True, force_terminal=False, width=240)
+ render_evaluation_result({"agents": agents, "budget": budget, "execution_status": "succeeded"}, console=console)
+ terminal = console.export_text()
+ if kind != "no_limits":
+ assert budget_line(budget) in terminal
+ if kind == "partial":
+ assert "RUN QUALITY VERDICT: INCOMPLETE" in terminal
+ assert "skill helps" not in terminal
+ assert "OVERALL SKILL LIFT " not in terminal
+ cli_console = Console(record=True, force_terminal=False, width=240)
+ CLIReporter._print_agent_eval_tables(payload, cli_console)
+ assert budget_line(budget) in cli_console.export_text()
+
+
[email protected]("live", [False, True, "missing_budget"])
+def test_saved_top_level_budget_overrides_stale_config(monkeypatch, tmp_path, live):
+ fresh = _budget("partial")
+ stale = BudgetController(max_agent_tokens=10, planned=4).metadata()
+ (tmp_path / "run_config.json").write_text(json.dumps({"budget": stale}))
+ (tmp_path / "result.json").write_text(json.dumps({"budget": fresh}))
+ monkeypatch.setattr(report_data, "load_agent_data", lambda *_args, **_kwargs: _agents())
+ result = tier3_report.agent_eval_result_from_directory(
+ tmp_path / "demo",
+ tmp_path,
+ engine_result={} if live == "missing_budget" else {"budget": fresh} if live else None,
+ use_llm_judge=False,
+ )
+ payload = result.metadata["agent_eval"]
+ assert payload["budget"] == fresh
+ assert payload["summary"]["verdict"] == "incomplete"
+ assert payload["budget_summary"] == budget_line(fresh)
+
+
+def test_saved_complete_run_feedback_cannot_restore_skill_helps(tmp_path):
+ payload = tier3_report.build_agent_eval_payload(
+ "demo", _agents(), run_config={"budget": _budget("partial")}, use_llm_judge=False
+ )
+ tier3_report._apply_saved_feedback(
+ payload,
+ {"conclusions": [{"title": "Skill effect", "message": "skill helps"}]},
+ {"agents": _agents()},
+ tmp_path,
+ tmp_path,
+ )
+ assert "skill helps" not in json.dumps(payload["conclusions"])
+ assert payload["verdict"] == "incomplete"
+
+
[email protected]("metadata", [None, {}, {"not_run": []}, {"not_run": True}, {"not_run": "invalid"}])
+def test_empty_budget_has_no_incomplete_reason(metadata):
+ assert budget_incomplete_reason(metadata) is None
diff --git a/tests/test_tier3_max_cases.py b/tests/test_tier3_max_cases.py
index 3b152942..43175e86 100644
--- a/tests/test_tier3_max_cases.py
+++ b/tests/test_tier3_max_cases.py
@@ -49,6 +49,7 @@ def _run_engine(
(skill / "evals" / "config.yml").write_text(config_yaml, encoding="utf-8")
captured: dict[str, Any] = {"pairs": [], "collect": {}, "progress": []}
+ on_pair = engine_kwargs.pop("on_pair", None)
monkeypatch.setattr(runner, "resolve_llm_provider", _provider)
monkeypatch.setattr(runner, "find_evals_file", lambda _path: skill / "evals" / "evals.json")
@@ -64,6 +65,8 @@ def _run_engine(
return tasks
def pair(**kwargs: Any) -> list[str]:
+ if on_pair is not None:
+ on_pair(kwargs["budget_controller"])
datasets = [kwargs["with_skill"], kwargs["baseline"]]
captured["pairs"].append(
{
@@ -128,6 +131,22 @@ def _snapshot_ids(result: dict[str, Any]) -> list[str]:
return [entry["id"] for entry in snapshot["dataset"]]
+def test_final_budget_snapshot_is_shared_by_all_result_artifacts(monkeypatch, tmp_path):
+ def use_budget(budget):
+ budget.admit(agent="opencode", arm="with", case_id=CASES[0], attempt=1)
+ budget.record_usage({"total_tokens": 100, "judge_calls": 1})
+ budget.admit(agent="opencode", arm="with", case_id=CASES[1], attempt=1)
+
+ result, _ = _run_engine(monkeypatch, tmp_path, agents=["opencode"], max_attempts_total=1, on_pair=use_budget)
+ saved = json.loads(Path(result["result_path"]).read_text())
+ config = json.loads((Path(result["run_dir"]) / "run_config.json").read_text())
+ assert config["budget"] == saved["budget"] == saved["run_config"]["budget"] == result["budget"]
+ assert config["budget"]["status"] == "exhausted"
+ assert config["budget"]["started_attempts"] == 1
+ assert saved["summary"]["verdict"] == "incomplete"
+ assert saved["execution_status"] == "succeeded"
+
+
def test_unset_max_cases_runs_every_staged_case(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
result, captured = _run_engine(monkeypatch, tmp_path)