Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
be65be2
fix(reporting): name the exception Harbor recorded under a failed Tie…
rng1995 Nov 12, 2026
e6944ce
docs(tier3): limit the empty expected_output rejection to the object …
rng1995 Nov 13, 2026
e770ffa
fix(reporting): name only the shared outcome of a Not applicable dime…
rng1995 Nov 13, 2026
b5e3626
docs(reporting): say how the HTML labels a failed run's verdict
rng1995 Nov 13, 2026
33d46d7
fix(reporting): say when the loaded results cannot confirm a judge-mi…
rng1995 Nov 13, 2026
9f43d2c
docs(changelog): quote only the end of a recorded Tier 3 job failure
rng1995 Nov 13, 2026
a91387b
docs(changelog): say plainly when a card with no lift cannot confirm it
rng1995 Nov 13, 2026
f3f47c2
docs(changelog): rewrap the judge-mixed lift entry
rng1995 Nov 13, 2026
750cd53
Merge main into naren/fix-reporting-wording-followups
rng1995 Nov 14, 2026
8758ded
docs(reports): name the JSON report's Tier 3 payload as the one that …
rng1995 Nov 14, 2026
0ad86be
docs(changelog): record the two Tier 3 docs corrections under Documen…
rng1995 Nov 14, 2026
deeeb46
test(tier3): pin the empty expected_output rule for the tier3 PATH da…
rng1995 Nov 14, 2026
71280d4
Merge main into naren/fix-reporting-wording-followups
rng1995 Nov 14, 2026
f2ff121
test: let the two docs-correction CHANGELOG checks survive a release cut
rng1995 Nov 14, 2026
a70ccf2
Merge main (33b382feb) into naren/fix-reporting-wording-followups
rng1995 Nov 14, 2026
df50d4f
docs(reports): say which Tier 3 reports label a failed run Changes re…
rng1995 Nov 14, 2026
2d59361
docs(reports): say when a failed Tier 3 run keeps neutral in the JSON…
rng1995 Nov 14, 2026
04503cd
Merge main (0d5e35658) into naren/fix-reporting-wording-followups
rng1995 Nov 14, 2026
c7718e8
Merge main (1ea050cc3) into naren/fix-reporting-wording-followups
rng1995 Nov 15, 2026
7c7cf6b
docs(reports): shorten the failed Tier 3 run entry and note budget-st…
rng1995 Nov 15, 2026
8649910
Merge main (e9ea45cf9) into naren/fix-reporting-wording-followups
rng1995 Nov 15, 2026
adbb1dd
Merge main (9944bfe07) into naren/fix-reporting-wording-followups
rng1995 Nov 15, 2026
b420cd8
docs(changelog): shorten the failed Tier 3 run entry to the rule
chrisknvidia Nov 15, 2026
80415e5
Merge the PR branch head (b420cd8d5) into naren/fix-reporting-wording…
rng1995 Nov 16, 2026
ab34399
Merge main (8b19b2fe3) into naren/fix-reporting-wording-followups
rng1995 Nov 16, 2026
23a2b80
Merge main (597806167) into naren/fix-reporting-wording-followups
rng1995 Nov 16, 2026
ac0353f
Merge main (d41ec54b1) into naren/fix-reporting-wording-followups
rng1995 Nov 16, 2026
655baf8
Merge main (301700cd1) into naren/fix-reporting-wording-followups
rng1995 Nov 16, 2026
7702747
docs(reports): say which labels of a budget-stopped failed run read I…
rng1995 Nov 16, 2026
596f3de
Merge main (186134b13) into naren/fix-reporting-wording-followups
rng1995 Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,21 @@ All notable changes to SkillEvaluator are documented in this file.
"Keeps `<name>/SKILL.md` in sync" gets the generic task "handle a typical
request".

- The Tier 3 live evaluation guide said that `skillevaluator tier3 ./my-skill`
and `tier3 init-harbor-task` reject an empty `expected_output`. They reject
it only in a `{"skill_name", "evals"}` dataset. A flat dataset (a JSON or
YAML list, `{"cases": [...]}`, or any `evals.jsonl`) is legacy: there an
empty or whitespace-only `expected_output` or `ground_truth` is accepted and
makes `accuracy` and `goal_accuracy` N/A.

- Reports & Results now covers a failed Tier 3 run whose budget left planned
attempts not run. Its JSON `tier3` object and full Tier 3 download record
`incomplete` and leave `summary.overall_lift` null, even when the best agent
has a lift. Its **Tier 3 quality** status reads **Incomplete**, while its
Tier 3 tile reads **Changes required**, or **Failed (advisory)** when Tier 3
is advisory. The page said only that HTML displays a failed run as
**Changes required** and that both payloads keep the best agent's lift.

### Fixed

- Failed Tier 3 arms retain scored and errored trial activation diagnostics without restoring aggregate quality or lift, or double-counting token usage.
Expand Down
11 changes: 11 additions & 0 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1652,6 +1652,17 @@ HTML still displays the failed execution as a failure. Its stricter display
does not rewrite the retained payload; completed-agent details describe that
agent's evidence.

A failed run whose budget left planned attempts not run is the exception: the
JSON report's `tier3` object and **Download Full Tier 3 Payload** record
`incomplete`. The **Tier 3 quality** status of every HTML report and the
command status of the standalone Tier 3 `report.html` read **Incomplete**, as
does the Overview's **Live quality** line when the Overview shows it. The Tier 3
tile and the command status of a `validate` report read as for any other failed
run: the tile reads **Changes required**, or **Failed (advisory)** when Tier 3
is advisory. Both payloads leave `summary.overall_lift` null even when the best
agent has a lift, so the **Skill Lift** card reads N/A and **Run details &
provenance** has no **Best-agent lift** line.

The evidence is complete when the agent succeeded with no execution errors, has
a with-skill score from 0 to 1, and scored every expected attempt of every case
in each arm. `tier3-benchmark.md` shows lift only when the baseline arm also
Expand Down
7 changes: 5 additions & 2 deletions docs/tier3-live-evaluation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1635,8 +1635,11 @@ A metric can also be N/A (not applicable) for an eval case. It never counts as
`expected_output` (legacy `ground_truth`). An empty or whitespace-only
reference, or an empty list, counts as missing. The verifier does not call
those judges. `skillevaluator tier3 ./my-skill` and `tier3 init-harbor-task`
reject an empty `expected_output`, so with them only legacy cases without
`ground_truth` make `accuracy` and `goal_accuracy` N/A.
reject an empty `expected_output` only in a `{"skill_name", "evals"}`
dataset. A flat dataset (a JSON or YAML list, `{"cases": [...]}`, or any
`evals.jsonl`) is legacy: there an empty or whitespace-only
`expected_output` or `ground_truth` is accepted and makes `accuracy` and
`goal_accuracy` N/A.
- `skill_execution` and `skill_efficiency` are N/A in a baseline arm that has
no skill it could activate. A baseline arm that stages a skill the case could
activate is scored on them, and the case rules below apply to it too.
Expand Down
224 changes: 223 additions & 1 deletion tests/reporting/test_tier3_completed_agent_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,24 @@

from __future__ import annotations

import base64
import json
import re
from html import unescape
from pathlib import Path

import pytest
from tests.reporting.test_report_redesign import _tier_card_verdicts
from tests.reporting.test_tier3_scoped_reports import result_with_completed_peer
from tests.reporting.test_unified_tier3_report import _write_summary

from skillevaluator.evaluation.tier3_report import build_agent_eval_payload
from skillevaluator.evaluation.tier3_report import agent_eval_result_from_directory, build_agent_eval_payload
from skillevaluator.models import ValidationResult
from skillevaluator.reporting import BenchmarkReporter, HTMLReporter
from skillevaluator.reporting.html import ADVISORY_FAIL_WORD, VERDICT_WORDS
from skillevaluator.reporting.json_reporter import JSONReporter
from skillevaluator.tier3.harbor.metrics import DEFAULT_METRICS
from skillevaluator.tier3.harbor.run_budget import BudgetController

REPO = Path(__file__).resolve().parents[2]
HEADING = "### Completed agents in an incomplete run"
Expand Down Expand Up @@ -44,6 +50,16 @@ def _run_details(raw_html: str) -> str:
return _plain(raw_html[start : raw_html.index("</details>", start)])


def _embedded_tier3(raw_html: str) -> dict:
"""Return the full Tier 3 payload the HTML report embeds for download."""
match = re.search(
r'<script type="application/json" id="tier3-full"( data-encoding="base64")?>(.*?)</script>', raw_html, re.DOTALL
)
assert match is not None
body = match.group(2)
return json.loads(base64.b64decode(body).decode("utf-8") if match.group(1) else body)


def _hero_command_status(raw_html: str) -> str:
match = re.search(r'<p class="hero-command-status[^"]*">([^<]*)</p>', raw_html)
assert match is not None
Expand Down Expand Up @@ -395,3 +411,209 @@ def test_changelog_entry_matches_the_docs() -> None:
assert len(entries) == 1
assert "show the best agent's score when that agent's evidence is complete" in entries[0]
assert "every Tier 3 run, from `tier3 evaluate` or a `validate` run that includes Tier 3" in entries[0]


def _changelog_entry(lead: str) -> tuple[str, str, str]:
"""Return the release heading, subsection heading and plain text of the one entry starting with ``lead``."""
release = subsection = ""
found: list[tuple[str, str, str]] = []
for block in (REPO / "CHANGELOG.md").read_text(encoding="utf-8").split("\n\n"):
first = block.strip().splitlines()[0] if block.strip() else ""
if first.startswith("## "):
release, subsection = first, ""
elif first.startswith("### "):
subsection = first
elif _plain(block).startswith(lead):
found.append((release, subsection, _plain(block)))
assert len(found) == 1
return found[0]


def _newer_than_0_9_0(release: str) -> bool:
"""Whether ``release`` is ``## Unreleased`` or the heading of a release after 0.9.0."""
if release == "## Unreleased":
return True
match = re.match(r"## (\d+)\.(\d+)\.(\d+)\b", release)
return match is not None and tuple(int(part) for part in match.groups()) > (0, 9, 0)


def _validate_tier3_reports(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path, *, blocking: bool, tier3: ValidationResult
) -> tuple[int, dict, str]:
"""Run ``validate --tier3`` after a passing Tier 1; return its exit code, JSON ``tier3`` object and HTML report.

``tier3`` stands in for the live run, so no agent runs.
"""
from click.testing import CliRunner

from skillevaluator import cli as cli_module
from skillevaluator.cli import cli
from skillevaluator.evaluation import EvaluationService

for name in ("FORCE_COLOR", "TTY_COMPATIBLE"):
monkeypatch.delenv(name, raising=False)
skill = tmp_path / "demo"
(skill / "evals").mkdir(parents=True)
(skill / "SKILL.md").write_text("---\nname: demo\ndescription: test\n---\n", encoding="utf-8")
dataset = {"skill_name": "demo", "evals": [{"id": "case-a", "prompt": "Q", "expected_output": "A"}]}
(skill / "evals" / "evals.json").write_text(json.dumps(dataset), encoding="utf-8")
tier1 = ValidationResult(validator_name="SCHEMA")
tier1.add_success("schema", "ok")
monkeypatch.setattr(cli_module, "run_validation", lambda *_args, **_kwargs: [tier1])
monkeypatch.setattr(cli_module, "_run_agent_eval_or_skip", lambda *_args, **_kwargs: tier3)
monkeypatch.setattr(EvaluationService, "evaluate", lambda *_args, **_kwargs: pytest.fail("no agent may run"))
output = tmp_path / "reports"
args = ["validate", "--no-autopilot", str(skill), "--no-tier2", "--tier3", "-r", "json,html", "-o", str(output)]

command = CliRunner().invoke(cli, [*args, "--block-on-agent-eval"] if blocking else args)

[report_json] = output.glob("*.json")
[report_html] = output.glob("*.html")
report_tier3 = json.loads(report_json.read_text(encoding="utf-8"))["tier3"]
return command.exit_code, report_tier3, report_html.read_text(encoding="utf-8")


def _budget_left_attempts_not_run() -> dict:
"""Return budget metadata whose token cap stopped the run after its first attempt."""
budget = BudgetController(max_agent_tokens=10, planned=4)
budget.admit(agent="opencode", arm="with", case_id="case-a", attempt=1)
budget.record_usage({"total_tokens": 20, "judge_calls": 1})
budget.admit(agent="opencode", arm="with", case_id="case-a", attempt=2)
metadata = budget.metadata()
assert metadata["not_run"]
return metadata


def _failed_run(tmp_path: Path, failure: str, *, budget: dict | None) -> ValidationResult:
"""Return a run that failed through a failed peer or a backend error after scoring.

With ``budget``, the run's budget also left planned attempts not run.
"""
if failure == "failed peer":
failed_peer = {"execution_status": "failed", "execution_errors": ["Agent setup failed"]}
payload = build_agent_eval_payload(
"demo",
{"opencode": _agent(0.8), "codex": {**failed_peer, "with_skill": {}, "without_skill": {}}},
dataset=[{"id": "case-a"}],
attempt_policy={"max_attempts": 1, "stop_on_pass": False, "pass_threshold": 0.5},
run_config={"budget": budget} if budget else None,
use_llm_judge=False,
)
result = ValidationResult(validator_name="AGENT_EVAL")
result.metadata["agent_eval"] = payload
result.add_error("Agent setup failed")
return result
run_dir = tmp_path / "results" / "20260709_120005"
_write_summary(run_dir, score=1.0)
(tmp_path / "engine" / "demo").mkdir(parents=True)
engine: dict = {"execution_status": "failed", "execution_errors": ["Harbor job exited 1"]}
if budget:
engine["budget"] = budget
loaded = agent_eval_result_from_directory(
tmp_path / "engine" / "demo", run_dir, engine_result=engine, use_llm_judge=False
)
assert loaded is not None
return loaded


SKILL_LIFT_CARD = r'<h3 class="dashboard-card-title">Skill Lift</h3>\s*<p class="dashboard-card-value">([^<]*)<'


@pytest.mark.parametrize("blocking", [False, True])
@pytest.mark.parametrize("failure", ["failed peer", "backend error"])
def test_failed_run_whose_budget_left_attempts_not_run_reads_incomplete(
monkeypatch: pytest.MonkeyPatch, tmp_path: Path, blocking: bool, failure: str
) -> None:
# A failed run whose budget also left planned attempts not run records
# incomplete, and the labels that follow the run's verdict read Incomplete.
result = _failed_run(tmp_path / "budget", failure, budget=_budget_left_attempts_not_run())
payload = result.metadata["agent_eval"]
assert (payload["execution_status"], payload["verdict"]) == ("failed", "incomplete")
if failure == "failed peer":
# The best agent has a lift, but the run's summary does not keep it.
assert payload["best_agent"] == "opencode"
assert payload["agents"]["opencode"]["lift"] == pytest.approx(0.4)
other = _failed_run(tmp_path / "other", failure, budget=None)
assert (other.metadata["agent_eval"]["execution_status"], other.metadata["agent_eval"]["verdict"]) != (
"failed",
"incomplete",
)
# Render the standalone reports first: validate records its gate on the result.
standalone = HTMLReporter(report_scope="tier3").render(result)
other_standalone = HTMLReporter(report_scope="tier3").render(other)

exit_code, report_tier3, raw = _validate_tier3_reports(
monkeypatch, tmp_path / "validate", blocking=blocking, tier3=result
)
_, _, other_raw = _validate_tier3_reports(monkeypatch, tmp_path / "validate-other", blocking=blocking, tier3=other)

assert exit_code == (1 if blocking else 0)
assert (report_tier3["execution_status"], report_tier3["verdict"]) == ("failed", "incomplete")
assert report_tier3["summary"]["overall_lift"] is None
for html in (standalone, raw):
text = _plain(html)
assert f"Tier 3 quality: {VERDICT_WORDS['incomplete']}" in text
assert f"Tier 3 quality: {VERDICT_WORDS['fail']}" not in text
assert f"Tier 3 quality: {ADVISORY_FAIL_WORD}" not in text
if failure == "failed peer":
# The Overview leads with the completed agent's result instead.
assert "Live quality:" not in text
assert "Completed-agent result:" in text
else:
assert f"Live quality: {VERDICT_WORDS['incomplete']}." in text
embedded = _embedded_tier3(html)
assert (embedded["verdict"], embedded["summary"]["overall_lift"]) == ("incomplete", None)
assert re.findall(SKILL_LIFT_CARD, html) == ["N/A"]
assert "Best-agent lift" not in _run_details(html)
assert _hero_command_status(standalone) == VERDICT_WORDS["incomplete"]
# The Tier 3 tile and validate's command status read as for the same failed run without the budget stop.
assert dict(_tier_card_verdicts(standalone))["Tier 3"] == dict(_tier_card_verdicts(other_standalone))["Tier 3"]
assert dict(_tier_card_verdicts(standalone))["Tier 3"] == VERDICT_WORDS["fail"]
tile = VERDICT_WORDS["fail"] if blocking else ADVISORY_FAIL_WORD
assert dict(_tier_card_verdicts(raw))["Tier 3"] == dict(_tier_card_verdicts(other_raw))["Tier 3"] == tile
command_status = VERDICT_WORDS["fail"] if blocking else "Passed required checks"
assert _hero_command_status(raw) == _hero_command_status(other_raw) == command_status
assert (
"A failed run whose budget left planned attempts not run is the exception: the JSON report's `tier3` object "
"and Download Full Tier 3 Payload record `incomplete`. The Tier 3 quality status of every HTML report and the "
f"command status of the standalone Tier 3 `report.html` read {VERDICT_WORDS['incomplete']}, as does the "
"Overview's Live quality line when the Overview shows it. The Tier 3 tile and the command status of a "
f"`validate` report read as for any other failed run: the tile reads {VERDICT_WORDS['fail']}, or "
f"{ADVISORY_FAIL_WORD} when Tier 3 is advisory. Both payloads leave `summary.overall_lift` null even when the "
"best agent has a lift, so the Skill Lift card reads N/A and Run details & provenance has no Best-agent lift "
"line."
) in _section()


def test_changelog_documents_the_budget_stopped_failed_run(tmp_path: Path) -> None:
# The entry is found by its opening words in any section, so a release that
# moves Unreleased into a dated section keeps it valid. It must stay out of
# 0.9.0 and older released sections.
release, subsection, entry = _changelog_entry(
"- Reports & Results now covers a failed Tier 3 run whose budget left planned attempts not run."
)
assert subsection == "### Documentation"
assert _newer_than_0_9_0(release), release
assert (
"Its JSON `tier3` object and full Tier 3 download record `incomplete` and leave `summary.overall_lift` null, "
"even when the best agent has a lift."
) in entry
assert (
f"Its Tier 3 quality status reads {VERDICT_WORDS['incomplete']}, while its Tier 3 tile reads "
f"{VERDICT_WORDS['fail']}, or {ADVISORY_FAIL_WORD} when Tier 3 is advisory."
) in entry
result = _failed_run(tmp_path, "failed peer", budget=_budget_left_attempts_not_run())
raw = HTMLReporter(report_scope="tier3").render(result)
report_tier3 = json.loads(JSONReporter().render_all([result]))["tier3"]
embedded = _embedded_tier3(raw)
assert (report_tier3["verdict"], report_tier3["summary"]["overall_lift"]) == ("incomplete", None)
assert (embedded["verdict"], embedded["summary"]["overall_lift"]) == ("incomplete", None)
assert result.metadata["agent_eval"]["agents"]["opencode"]["lift"] == pytest.approx(0.4)
assert f"Tier 3 quality: {VERDICT_WORDS['incomplete']}" in _plain(raw)
assert dict(_tier_card_verdicts(raw))["Tier 3"] == VERDICT_WORDS["fail"]
# The general rule the page gave, which a budget-stopped run does not follow.
for said in (
f"HTML displays a failed run as {VERDICT_WORDS['fail']}",
"The JSON report's `tier3` object and full Tier 3 download both keep this lift in `summary.overall_lift`.",
):
assert said in _section()
Loading
Loading