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): reuse a run's saved feedback when view regenerates its report (#419)
Narendran Raghavan4892db05d4f7
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 86a7aa88..19f10569 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -371,6 +371,22 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed+- `skillevaluator view` no longer asks the LLM again when it regenerates a+ missing `report.html` for a Tier 3 run that saved its report feedback in+ `result.json`. The regenerated report shows the conclusions,+ recommendations, and suggestions that run produced, makes no LLM call, and+ reuses the run's `what_to_fix.json` when it has one. It also takes the run's+ duration and any Harbor log links recorded in `result.json`, which the 0.8.0+ rebuild left out. In 0.8.0 the Insights judge and the what-to-fix writer ran+ again: with a provider configured that cost tokens and could change the+ advice, without one the run's saved LLM advice was dropped, and either way+ `what_to_fix.json` was overwritten. Feedback saved by 0.6.0 or earlier has+ no per-case verdict, so the regenerated report adds the verdict and lists+ the case fixes as its recommendations and suggestions, without the LLM, as a+ new report does. A run that saved no feedback still has its feedback+ rebuilt, with the LLM when a provider is configured, and its+ `what_to_fix.json` rewritten.+- Public MCP URL probes handle modern SDK client and stream APIs while retainingchecked-address connections, header grants, response limits, and boundedcleanup. Redirect responses are refused before SDK-level redirect handling.diff --git a/docs/cli-reference.mdx b/docs/cli-reference.mdxindex 8ebcbe9f..138123bb 100644--- a/docs/cli-reference.mdx+++ b/docs/cli-reference.mdx@@ -677,7 +677,7 @@ skillevaluator init-harbor-task ./my-skill## view-Open the latest HTML live-evaluation report for a skill. If the results exist but `report.html` is missing, `view` regenerates it before opening.+Open the latest HTML live-evaluation report for a skill. If the results exist but `report.html` is missing, `view` regenerates it before opening. It reuses the feedback the run saved in `result.json`, and the run's `what_to_fix.json` when there is one, and makes no LLM call. A run that saved no feedback still has its feedback rebuilt, with the LLM when a provider is configured, and its `what_to_fix.json` rewritten.```bash title="Open the latest report"skillevaluator view ./my-skilldiff --git a/docs/reports.mdx b/docs/reports.mdxindex b322b1ee..01756550 100644--- a/docs/reports.mdx+++ b/docs/reports.mdx@@ -1303,7 +1303,17 @@ every agent.### viewOpens the newest `report.html` for a skill in your browser, regenerating it-from the stored run data if the file is missing.+from the stored run data if the file is missing. The regenerated report reuses+the conclusions, recommendations, and suggestions the run saved in+`result.json`, so it shows the advice the run produced and makes no LLM call.+It also reuses the run's `what_to_fix.json`. When that file is missing or+unusable, `view` writes the rule-based fixes, which can differ from the+recommendations the run saved. The report also takes the run's duration and any+Harbor log links recorded in `result.json`. Feedback saved by 0.6.0 or earlier+has no per-case verdict, so the report adds the verdict and lists the case+fixes as its recommendations and suggestions, without the LLM, as a new report+does. A run that saved no feedback still has its feedback rebuilt, with the LLM+when a provider is configured, and its `what_to_fix.json` rewritten.```bash title="Open the latest HTML report"skillevaluator view ./my-skilldiff --git a/src/skillevaluator/evaluation/tier3_report.py b/src/skillevaluator/evaluation/tier3_report.pyindex 6b386bd4..774cad8b 100644--- a/src/skillevaluator/evaluation/tier3_report.py+++ b/src/skillevaluator/evaluation/tier3_report.py@@ -621,8 +621,14 @@ def render_agent_eval_html_report(engine_result: dict[str, Any] | None = None,use_llm_judge: bool = True,include_benchmark: bool = False,+ saved_feedback: dict[str, list[Any]] | None = None,) -> Path:- """Render a standalone Tier 3 HTML report and optional standard benchmark."""+ """Render a standalone Tier 3 HTML report and optional standard benchmark.++ ``saved_feedback`` is the report feedback a completed run saved in+ ``result.json``. It replaces the rebuilt feedback fields and nothing calls+ an LLM; see ``_apply_saved_feedback``.+ """from skillevaluator.reporting import BenchmarkReporter, HTMLReporterskill_path = skill_path.expanduser().resolve()@@ -632,14 +638,17 @@ def render_agent_eval_html_report(run_dir,env_mode=env_mode,engine_result=engine_result,- use_llm_judge=use_llm_judge,+ use_llm_judge=use_llm_judge and not saved_feedback,)if result is None:raise ValueError(f"No agent results found in {run_dir}")canonical_payload = result.metadata.get("agent_eval")if isinstance(canonical_payload, dict):- _apply_case_findings(canonical_payload, engine_result, run_dir, skill_path, use_llm=use_llm_judge)+ if saved_feedback:+ _apply_saved_feedback(canonical_payload, saved_feedback, engine_result, run_dir, skill_path)+ else:+ _apply_case_findings(canonical_payload, engine_result, run_dir, skill_path, use_llm=use_llm_judge)if engine_result is not None and isinstance(canonical_payload, dict):# Persist only the compact feedback contract needed by the CLI. The# complete canonical payload remains in the HTML report and can be much@@ -4033,6 +4042,52 @@ def _recommendation_category_from(text: str) -> str:return _RECO_CATEGORY_HINTS.get(first, "Action")+def _is_case_verdict(conclusion: object) -> bool:+ """Whether a conclusion is the per-case verdict that ``_apply_case_findings`` adds (the report headline)."""+ return isinstance(conclusion, dict) and conclusion.get("title") == "Skill effect"+++def _saved_case_fixes(run_dir: Path) -> list[dict[str, Any]] | None:+ """The run's ``what_to_fix.json`` when the report can show it as is, else ``None``."""+ from skillevaluator.tier3.case_summary import load_case_findings++ fixes = load_case_findings(run_dir)+ if fixes is None or any(+ not all(isinstance(fix.get(key), str) for key in ("case", "scope", "kind", "what"))+ or not all(isinstance(fix.get(key) or "", str) for key in ("action", "evidence"))+ for fix in fixes+ ):+ return None+ return fixes+++def _apply_saved_feedback(+ payload: dict[str, Any],+ saved_feedback: dict[str, list[Any]],+ engine_result: dict[str, Any] | None,+ run_dir: Path,+ skill_path: Path,+) -> None:+ """Show the report feedback a completed run saved, with no LLM call.++ The case-findings pass still runs without the LLM, on the run's own+ ``what_to_fix.json`` when it is usable (otherwise it writes the rule-based+ fixes), so what it adds beyond the saved fields stays. Saved conclusions+ that carry the per-case verdict replace the pass's verdict and fixes, so+ rule-based fixes written then can differ from the saved recommendations;+ feedback saved before the verdict existed gets both added, as a fresh+ render shows them.+ """+ 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", [])):+ _apply_case_findings(payload, engine_result, run_dir, skill_path, use_llm=False, fixes=fixes)+ payload.update(saved)+ else:+ payload.update(saved)+ _apply_case_findings(payload, engine_result, run_dir, skill_path, use_llm=False, fixes=fixes)++def _apply_case_findings(payload: dict[str, Any],engine_result: dict[str, Any] | None,@@ -4040,8 +4095,12 @@ def _apply_case_findings(skill_path: Path,*,use_llm: bool,+ fixes: list[dict[str, Any]] | None = None,) -> None:- """Lead the report with the case-based verdict and fixes; also saves them as what_to_fix.json for the CLI."""+ """Lead the report with the case-based verdict and fixes; also saves them as what_to_fix.json for the CLI.++ ``fixes`` already saved for the run are reused as they are and not written again.+ """from skillevaluator.tier3.case_summary import goal_not_met_count, save_case_findings, what_to_fixfrom skillevaluator.tier3.case_summary import verdict as case_verdict@@ -4052,8 +4111,9 @@ def _apply_case_findings(if not isinstance(source, dict) or not isinstance(source.get("agents"), dict):returntry:- fixes = what_to_fix(source, run_dir=run_dir, skill_path=skill_path, use_llm=use_llm)- save_case_findings(run_dir, fixes)+ if fixes is None:+ fixes = what_to_fix(source, run_dir=run_dir, skill_path=skill_path, use_llm=use_llm)+ save_case_findings(run_dir, fixes)except Exception: # advisory: the report keeps its metric-based insightslogger.debug("Case findings skipped", exc_info=True)returndiff --git a/src/skillevaluator/tier3/commands.py b/src/skillevaluator/tier3/commands.pyindex f0cd0b12..4a164408 100644--- a/src/skillevaluator/tier3/commands.py+++ b/src/skillevaluator/tier3/commands.py@@ -1083,7 +1083,25 @@ def view_results(skill_path: Path, *, results_dir: Path | None = None) -> Path:target = latest.resolve() if latest.is_symlink() else latestreport_path = target / "report.html"if not report_path.exists():- report_path = render_agent_eval_html_report(skill_path, target)+ from skillevaluator.evaluation.tier3_feedback_chat import _read_result_json, saved_feedback_for_run+ from skillevaluator.evaluation.tier3_report import _TIER3_FEEDBACK_FIELDS++ saved_result = _read_result_json(target)+ saved_feedback = saved_feedback_for_run(saved_result, target)+ # A run saves every feedback field; anything less is rebuilt as before.+ if saved_feedback and saved_feedback.keys() == set(_TIER3_FEEDBACK_FIELDS):+ # Rebuild with the feedback this run saved. Asking the judge again+ # costs tokens and can change the advice; with no provider it+ # silently drops the advice the run saved.+ report_path = render_agent_eval_html_report(+ skill_path,+ target,+ engine_result=saved_result,+ use_llm_judge=False,+ saved_feedback=saved_feedback,+ )+ else:+ report_path = render_agent_eval_html_report(skill_path, target)console.print(f"Opening: [cyan]{escape_markup(str(report_path))}[/cyan]")webbrowser.open(report_path.as_uri())return report_pathdiff --git a/tests/tier3/test_view_results_feedback.py b/tests/tier3/test_view_results_feedback.pynew file mode 100644index 00000000..0707c084--- /dev/null+++ b/tests/tier3/test_view_results_feedback.py@@ -0,0 +1,336 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++"""``skillevaluator view`` rebuilds a missing report from the feedback its run saved."""++from __future__ import annotations++import json+import re+from pathlib import Path+from typing import Any++import pytest++from skillevaluator.evaluation import insights_judge, tier3_report+from skillevaluator.evaluation.tier3_report import render_agent_eval_html_report+from skillevaluator.tier3 import case_summary, commands+from skillevaluator.tier3.harbor.metrics import DEFAULT_METRICS+from skillevaluator.tier3.next_steps import next_steps++RUN_ID = "20261027_120000"+HARBOR_JOB_URL = "https://harbor.example.test/jobs/run"+SAVED_VERDICT = "per-case result: skill hurts (saved by the run)."+# What a run saves since the case findings exist: the per-case verdict leads the conclusions.+SAVED_FEEDBACK = {+ "schema_version": "1.0",+ "conclusions": [+ {"severity": "fail", "title": "Skill effect", "message": SAVED_VERDICT, "source": "deterministic"},+ {"severity": "warn", "title": "Saved conclusion", "message": "From this run"},+ ],+ "recommendations": [{"severity": "warn", "title": "Saved recommendation", "message": "Kept from the run"}],+ "suggestions": ["Saved suggestion"],+ "suggestions_v2": [],+}+# What earlier runs saved: no per-case verdict.+LEGACY_FEEDBACK = {+ **SAVED_FEEDBACK,+ "conclusions": [{"severity": "warn", "title": "Saved conclusion", "message": "From this run"}],+}+SAVED_FIXES = [+ {+ "case": "case-1",+ "scope": "opencode",+ "kind": "skill hurts",+ "what": "passes 1/1 without the skill but 0/1 with it",+ "attempts_lost": 1,+ "action": "Saved fix from the run",+ }+]+++def _write_json(path: Path, data: Any) -> None:+ path.parent.mkdir(parents=True, exist_ok=True)+ path.write_text(json.dumps(data), encoding="utf-8")+++def _write_arm(run: Path, arm: str, overall: float) -> None:+ scores = dict.fromkeys(DEFAULT_METRICS, overall)+ _write_json(+ run / "opencode" / arm / "summary.json",+ {+ "scores": scores,+ "metrics": list(DEFAULT_METRICS),+ "num_trials": 1,+ "expected_attempts": 1,+ "scored_attempts": 1,+ "execution_status": "succeeded",+ },+ )+ _write_json(run / "opencode" / arm / "trials" / "case-1__1" / "reward.json", {"entry_id": "case-1", **scores})+++def _completed_run(tmp_path: Path, *, fixes: Any = SAVED_FIXES, **result: Any) -> tuple[Path, Path, Path]:+ """A completed run whose case passes without the skill and fails with it; no report.html."""+ skill = tmp_path / "demo-skill"+ skill.mkdir()+ (skill / "SKILL.md").write_text("---\nname: demo-skill\ndescription: Demo.\n---\n# Demo\n", encoding="utf-8")+ results_root = tmp_path / "results"+ run = results_root / skill.name / RUN_ID+ run.mkdir(parents=True)+ _write_json(run / "run_config.json", {})+ _write_arm(run, "with-skill", 0.4)+ _write_arm(run, "without-skill", 0.6)+ cases = {+ "with_skill": {"cases": {"case-1": {"attempts": [{"passed": False, "trial": "case-1__1", "score": 0.4}]}}},+ "without_skill": {"cases": {"case-1": {"attempts": [{"passed": True, "trial": "case-1__1", "score": 0.6}]}}},+ }+ _write_json(+ run / "result.json",+ {"run_id": RUN_ID, "skill_name": skill.name, "agents": {"opencode": {"pass_at_k": cases}}, **result},+ )+ if fixes is not None:+ _write_json(run / "what_to_fix.json", fixes)+ return skill, results_root, run+++def llm_calls(monkeypatch: pytest.MonkeyPatch) -> list[str]:+ """Record every judge and what-to-fix LLM call; each one answers with fresh text."""+ calls: list[str] = []++ def judge(*_args: object, **_kwargs: object) -> dict[str, Any]:+ calls.append("insights")+ return {"conclusions": [{"title": "Fresh judge conclusion", "message": "Second pass"}], "recommendations": []}++ def actions(issues: list[dict[str, Any]], *_args: object) -> list[str]:+ calls.append("what_to_fix")+ return ["Fresh fix from a second pass"] * len(issues)++ monkeypatch.setattr(insights_judge, "build_insights", judge)+ monkeypatch.setattr(case_summary, "_llm_actions", actions)+ monkeypatch.setattr(commands.webbrowser, "open", lambda _uri: True)+ return calls+++def test_view_reuses_saved_feedback_when_report_is_missing(tmp_path: Path, llm_calls: list[str]) -> None:+ skill, results_root, run = _completed_run(+ tmp_path,+ tier3_feedback=SAVED_FEEDBACK,+ duration_seconds=4321.5,+ harbor_viewer={"job_url": HARBOR_JOB_URL},+ )+ saved_result = (run / "result.json").read_bytes()+ saved_fixes = (run / "what_to_fix.json").read_bytes()++ report = commands.view_results(skill, results_dir=results_root)++ html = report.read_text(encoding="utf-8")+ assert report == run / "report.html"+ assert llm_calls == []+ for text in (SAVED_VERDICT, "Saved conclusion", "Saved recommendation", "Saved suggestion"):+ assert text in html+ # The saved verdict leads the report; the rebuilt one is not added next to it.+ assert html.count("per-case result:") == html.count(SAVED_VERDICT)+ assert "Fresh judge conclusion" not in html+ assert "Fresh fix from a second pass" not in html+ # result.json is the report's engine result, so its runtime and Harbor links come back too.+ assert re.search(r'"runtime_seconds":\s*4321\.5', html)+ assert f'href="{HARBOR_JOB_URL}"' in html+ # Rebuilding the report writes nothing else into the run.+ assert (run / "result.json").read_bytes() == saved_result+ assert (run / "what_to_fix.json").read_bytes() == saved_fixes+++def test_view_writes_rule_based_fixes_when_a_verdict_run_lost_them(tmp_path: Path, llm_calls: list[str]) -> None:+ """The saved feedback still leads the report; only the missing fixes file gets the rule-based text."""+ skill, results_root, run = _completed_run(tmp_path, fixes=None, tier3_feedback=SAVED_FEEDBACK)+ saved_result = (run / "result.json").read_bytes()++ report = commands.view_results(skill, results_dir=results_root)++ html = report.read_text(encoding="utf-8")+ assert llm_calls == []+ for text in (SAVED_VERDICT, "Saved conclusion", "Saved recommendation", "Saved suggestion"):+ assert text in html+ assert "Check whether SKILL.md steers the agent" not in html+ assert (run / "result.json").read_bytes() == saved_result+ written = json.loads((run / "what_to_fix.json").read_text(encoding="utf-8"))+ assert written[0]["kind"] == "skill hurts"+ assert "Check whether SKILL.md steers the agent" in written[0]["action"]+++ ("fixes", "shown_fix"),+ [+ pytest.param(SAVED_FIXES, "Saved fix from the run", id="fixes_saved"),+ pytest.param(None, "Check whether SKILL.md steers the agent", id="no_fixes_saved"),+ pytest.param([{**SAVED_FIXES[0], "what": 5}], "Check whether SKILL.md steers the agent", id="unusable_fixes"),+ ],+)+def test_view_adds_the_case_verdict_to_feedback_saved_before_it(+ tmp_path: Path, llm_calls: list[str], fixes: Any, shown_fix: str+) -> None:+ skill, results_root, run = _completed_run(tmp_path, fixes=fixes, tier3_feedback=LEGACY_FEEDBACK)+ saved_result = (run / "result.json").read_bytes()++ report = commands.view_results(skill, results_dir=results_root)++ html = report.read_text(encoding="utf-8")+ assert llm_calls == []+ # The verdict needs no LLM: a run saved before it existed gets it, next to its own conclusions.+ assert "per-case result: skill hurts" in html+ assert "Saved conclusion" in html+ assert shown_fix in html+ assert "Fresh judge conclusion" not in html+ assert (run / "result.json").read_bytes() == saved_result+ # A usable saved what_to_fix.json is kept; otherwise the rule-based fixes are written.+ written = json.loads((run / "what_to_fix.json").read_text(encoding="utf-8"))+ assert written[0]["kind"] == "skill hurts"+ assert shown_fix in written[0]["action"]+ assert (written == SAVED_FIXES) is (fixes is SAVED_FIXES)+++ "result",+ [+ pytest.param({}, id="no_saved_feedback"),+ pytest.param({"tier3_feedback": {**SAVED_FEEDBACK, "schema_version": "0.9"}}, id="other_schema"),+ pytest.param({"tier3_feedback": {"schema_version": "1.0", "conclusions": "Saved conclusion"}}, id="no_lists"),+ pytest.param(+ {"tier3_feedback": {"schema_version": "1.0", "conclusions": SAVED_FEEDBACK["conclusions"]}},+ id="partial_feedback",+ ),+ ],+)+def test_view_rebuilds_feedback_when_none_is_saved_for_the_run(+ tmp_path: Path, llm_calls: list[str], result: dict[str, Any]+) -> None:+ skill, results_root, _run = _completed_run(tmp_path, **result)++ report = commands.view_results(skill, results_dir=results_root)++ html = report.read_text(encoding="utf-8")+ assert sorted(llm_calls) == ["insights", "what_to_fix"]+ assert "Fresh judge conclusion" in html+ assert "Saved conclusion" not in html+++def test_view_ignores_feedback_saved_for_another_run(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:+ skill, results_root, run = _completed_run(tmp_path, tier3_feedback=SAVED_FEEDBACK)+ result = json.loads((run / "result.json").read_text(encoding="utf-8"))+ _write_json(run / "result.json", {**result, "run_id": "20261026_120000"})+ calls: list[dict[str, Any]] = []++ def render(_skill_path: Path, target: Path, **kwargs: Any) -> Path:+ calls.append(kwargs)+ report = target / "report.html"+ report.write_text("<html>rebuilt</html>", encoding="utf-8")+ return report++ # Run selection already rejects such a run; the feedback check must too.+ monkeypatch.setattr(commands, "resolve_latest_results", lambda *_args: run)+ monkeypatch.setattr(commands, "render_agent_eval_html_report", render)+ monkeypatch.setattr(commands.webbrowser, "open", lambda _uri: True)++ commands.view_results(skill, results_dir=results_root)++ assert len(calls) == 1+ assert "saved_feedback" not in calls[0]+ assert calls[0].get("use_llm_judge", True)+++def test_view_opens_an_existing_report_without_rebuilding(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:+ skill, results_root, run = _completed_run(tmp_path, tier3_feedback=SAVED_FEEDBACK)+ (run / "report.html").write_text("<html>original</html>", encoding="utf-8")+ opened: list[str] = []++ def render(*_args: object, **_kwargs: object) -> Path:+ raise AssertionError("an existing report must not be rebuilt")++ monkeypatch.setattr(commands, "render_agent_eval_html_report", render)+ monkeypatch.setattr(commands.webbrowser, "open", opened.append)++ report = commands.view_results(skill, results_dir=results_root)++ assert report == run / "report.html"+ assert opened == [report.as_uri()]+ assert report.read_text(encoding="utf-8") == "<html>original</html>"+++def test_render_with_saved_feedback_skips_the_judge(tmp_path: Path, llm_calls: list[str]) -> None:+ skill, _results_root, run = _completed_run(tmp_path)+ engine_result = json.loads((run / "result.json").read_text(encoding="utf-8"))+ saved = {name: value for name, value in SAVED_FEEDBACK.items() if name != "schema_version"}++ report = render_agent_eval_html_report(skill, run, engine_result=engine_result, saved_feedback=saved)++ html = report.read_text(encoding="utf-8")+ assert llm_calls == []+ assert "Saved conclusion" in html+ assert "Fresh judge conclusion" not in html+ assert engine_result["tier3_feedback"] == SAVED_FEEDBACK+++ ("feedback", "fixes"),+ [+ pytest.param(SAVED_FEEDBACK, SAVED_FIXES, id="with_verdict"),+ pytest.param(LEGACY_FEEDBACK, SAVED_FIXES, id="before_verdict"),+ pytest.param(SAVED_FEEDBACK, None, id="with_verdict_no_fixes_saved"),+ pytest.param(LEGACY_FEEDBACK, None, id="before_verdict_no_fixes_saved"),+ ],+)+def test_saved_feedback_keeps_what_the_case_pass_adds(+ tmp_path: Path,+ llm_calls: list[str],+ monkeypatch: pytest.MonkeyPatch,+ feedback: dict[str, Any],+ fixes: list[dict[str, Any]] | None,+) -> None:+ """Report content the case-findings pass computes but the run does not save survives a rebuild."""+ skill, results_root, run = _completed_run(tmp_path, fixes=fixes, tier3_feedback=feedback)+ result = json.loads((run / "result.json").read_text(encoding="utf-8"))+ # What the payload build computes, before the case pass writes any rule-based fixes.+ built_steps = next_steps(result, run_dir=run, fixes=fixes)+ passes: list[dict[str, Any]] = []+ payloads: list[dict[str, Any]] = []+ apply_case_findings = tier3_report._apply_case_findings+ build_result = tier3_report.agent_eval_result_from_directory++ def case_pass(payload: dict[str, Any], *args: Any, **kwargs: Any) -> None:+ passes.append(kwargs)+ apply_case_findings(payload, *args, **kwargs)++ def build(*args: Any, **kwargs: Any) -> Any:+ result = build_result(*args, **kwargs)+ payloads.append(result.metadata["agent_eval"])+ return result++ monkeypatch.setattr(tier3_report, "_apply_case_findings", case_pass)+ monkeypatch.setattr(tier3_report, "agent_eval_result_from_directory", build)++ report = commands.view_results(skill, results_dir=results_root)++ assert llm_calls == []+ assert len(passes) == 1+ assert passes[0]["use_llm"] is False+ assert passes[0]["fixes"] == fixes+ [payload] = payloads+ # The report computes the run-level next steps both when it builds the payload and in the case pass,+ # and saves neither copy, so the rebuild must keep them.+ case_fixes = json.loads((run / "what_to_fix.json").read_text(encoding="utf-8"))+ assert (case_fixes == SAVED_FIXES) is (fixes is not None)+ expected_steps = next_steps(result, run_dir=run, fixes=case_fixes)+ assert expected_steps+ assert payload["next_steps"] == expected_steps+ # Without saved fixes the two copies differ: the case pass sees the rule-based fixes it writes+ # (here a fix for the baseline that passes every case, which drops the "more cases" step).+ assert (expected_steps == built_steps) is (fixes is not None)+ html = report.read_text(encoding="utf-8")+ assert 'id="tier3-run-next-steps"' in html+ for step in built_steps:+ assert (step["problem"] in html) is (step in expected_steps)+ if feedback is SAVED_FEEDBACK:+ for field in ("conclusions", "recommendations", "suggestions", "suggestions_v2"):+ assert payload[field] == SAVED_FEEDBACK[field]