Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,12 @@ All notable changes to SkillEvaluator are documented in this file.
direct-target behavior, plugin discovery errors produce findings, and reports
and external Tier 3 results preserve catalog-relative paths for skills with
the same basename.
- Tier 3 runs now write a Tier 3-scoped `tier3-benchmark.md` alongside HTML,
named so publication tooling does not treat it as a `BENCHMARK.md` card. It
states that Tiers 1 and 2 are not covered by the report, separates the Tier 3
result from an unassessed publication decision, and displays a completed
agent's score and comparable lift when another agent fails. Failure warnings and the full publication checks remain unchanged.

- Changing finding severities through a policy no longer clears an independent
quality-score threshold failure. A score below `--min-score` still fails,
and its reason appears in the terminal, HTML, benchmark, and JSON reports.
Expand Down
21 changes: 18 additions & 3 deletions src/skillevaluator/evaluation/tier3_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,9 +584,10 @@ def render_agent_eval_html_report(
env_mode: str | None = None,
engine_result: dict[str, Any] | None = None,
use_llm_judge: bool = True,
include_benchmark: bool = False,
) -> Path:
"""Render one standalone Tier 3 run with the canonical HTML reporter."""
from skillevaluator.reporting import HTMLReporter
"""Render a standalone Tier 3 HTML report and optional standard benchmark."""
from skillevaluator.reporting import BenchmarkReporter, HTMLReporter

skill_path = skill_path.expanduser().resolve()
run_dir = run_dir.expanduser().resolve()
Expand Down Expand Up @@ -618,12 +619,26 @@ def render_agent_eval_html_report(
reporter = HTMLReporter(
target_path=str(skill_path),
content_label="Skill",
report_scope="tier3",
tabs=[{"id": "tier3", "label": "Tier 3: Live Agent Evaluation"}],
# The run records the filesystem entry name, which a lexical alias
# on a case- or normalization-insensitive filesystem need not match.
expected_skill_name=publication_target_name(skill_path) or skill_path.name,
)
reporter.save([result], target)
written: list[Path] = []
try:
reporter.save([result], target)
written.append(target)
if include_benchmark:
BenchmarkReporter(
skill_name=publication_target_name(skill_path) or skill_path.name, report_scope="tier3"
).save([result], target.with_name("tier3-benchmark.md"))
except Exception:
# Do not advertise half of a newly generated report pair. An unsafe
# destination that the writer rejected is never followed or removed.
for path in written:
path.unlink(missing_ok=True)
raise
return target


Expand Down
36 changes: 34 additions & 2 deletions src/skillevaluator/reporting/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
tier1_unscanned_publication_paths,
unrecognized_tier2_results,
)
from skillevaluator.reporting.tier3_scope import completed_agent_result, validate_report_scope
from skillevaluator.source_identity import evaluated_source_revision, recorded_evaluated_source
from skillevaluator.tier3_environments import HARBOR_ENV_MODES

Expand Down Expand Up @@ -130,9 +131,12 @@ def __init__(
include_timestamp: bool = True,
max_findings_shown: int = 5,
skill_name: str | None = None,
report_scope: str = "publication",
) -> None:
self.include_timestamp = include_timestamp
self.max_findings_shown = max_findings_shown
validate_report_scope(report_scope, [])
self.report_scope = report_scope
self.skill_name = skill_name

@property
Expand All @@ -147,7 +151,9 @@ def render(self, result: ValidationResult) -> str:
return self.render_all([result])

def render_all(self, results: list[ValidationResult]) -> str:
validate_report_scope(self.report_scope, results)
ae = _agent_eval_payload(results)
completed = completed_agent_result(ae)
publication_target = publication_target_for_results(
results,
ae,
Expand All @@ -165,10 +171,16 @@ def render_all(self, results: list[ValidationResult]) -> str:
lines: list[str] = [
f"# Skill Benchmark: {skill_name}",
"",
_verdict_callout(status),
(f"> **Tier 3 completed-agent result: {completed['verdict'].upper()}**" if completed
else "> **Tier 3: No complete agent result**") if self.report_scope == "tier3" else _verdict_callout(status),
"",
]
if status == "PASS":
if self.report_scope == "tier3":
lines.extend([
"Publication: **NOT ASSESSED**. This report covers Tier 3 only; Tiers 1 and 2 are not covered by this report.",
"The verdict describes with-skill quality; lift is a separate baseline comparison.", "",
])
elif status == "PASS":
self._render_publication_recommendation(lines, results)
elif status == "FAIL":
lines.extend(
Expand Down Expand Up @@ -201,6 +213,18 @@ def render_all(self, results: list[ValidationResult]) -> str:
]
)

if completed and (self.report_scope == "tier3" or completed["needs_attention"]):
lines.append(
f"Completed agent: **{_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"Same-agent comparable lift: **{completed['lift']:+.4f}** ({completed['lift'] * 100:+.2f} percentage points).")
if completed["needs_attention"]:
lines.append("**Needs attention:** other execution failures remain. This completed-agent result does not certify the whole run.")
if completed["recovered_attempts"]:
lines.append(f"Recovered timeout attempts: {completed['recovered_attempts']}; failed history is retained and excluded from scoring.")
lines.append("")
self._render_metadata(
lines,
results,
Expand Down Expand Up @@ -516,6 +540,14 @@ def _render_tier_status(
expected_skill_name=expected_skill_name,
expected_publication_target=publication_target,
)
if self.report_scope == "tier3":
if tier != "Tier 3":
status, evidence = "NOT COVERED", "Outside this report's Tier 3 scope"
elif completed := completed_agent_result(ae):
status = completed["verdict"].upper()
evidence = "Completed-agent quality result; publication not assessed"
if completed["needs_attention"]:
evidence += "; other execution failures need attention"
lines.append(f"| {tier} | {purpose} | **{status}** | {_md_cell(evidence, private_labels)} |")
lines.append("")

Expand Down
13 changes: 12 additions & 1 deletion src/skillevaluator/reporting/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
)
from skillevaluator.reporting.harbor_viewer import normalize_agent_eval_harbor_links
from skillevaluator.reporting.presentation import success_is_not_applicable
from skillevaluator.reporting.tier3_scope import completed_agent_result, validate_report_scope

if TYPE_CHECKING:
from skillevaluator.models import ValidationResult
Expand Down Expand Up @@ -1545,6 +1546,7 @@ def __init__(
expected_skill_name: str | None = None,
explicit_skill_name: str | None = None,
ci_context: dict[str, str] | None = None,
report_scope: str = "publication",
scan_root: str | None = None,
) -> None:
self.include_timestamp = include_timestamp
Expand All @@ -1557,6 +1559,8 @@ def __init__(
# in the report header so reviewers can tell which audience the
# validation gate was applied for.
self.profile = profile
validate_report_scope(report_scope, [])
self.report_scope = report_scope
self.expected_skill_name = expected_skill_name
self.explicit_skill_name = explicit_skill_name
self.ci_context = _validated_ci_context(ci_context)
Expand Down Expand Up @@ -2691,8 +2695,10 @@ def render(self, result: ValidationResult) -> str:
return self.render_all([result])

def render_all(self, results: list[ValidationResult]) -> str:
validate_report_scope(self.report_scope, results)
tier1_results, tier2_results, tier3_results = self._split_results_by_tier(results)
tier3_data = self._tier3_report_data(tier3_results)
completed_agent = completed_agent_result(tier3_data)
# Preserve the raw policy/provenance assessment, then let the emitted
# payload make the decision only more conservative. Display shaping
# must never invent a successful run or erase a persisted waiver.
Expand Down Expand Up @@ -3056,6 +3062,8 @@ def _attach_quality_scores(skills: dict[str, dict[str, Any]]) -> None:
template = self._env.get_template("report.html.j2")
cl = self.content_label
return template.render(
report_scope=self.report_scope,
completed_agent=completed_agent,
title=self.title,
ci_context=self.ci_context,
explicit_skill_name=self.explicit_skill_name,
Expand All @@ -3074,7 +3082,10 @@ def _attach_quality_scores(skills: dict[str, dict[str, Any]]) -> None:
overall_status=overall_status,
publication_status=publication.status,
publication_reasons=publication.reasons,
tier3_effective_status=publication.tier3.status,
tier3_effective_status=(
completed_agent["verdict"] if self.report_scope == "tier3" and completed_agent
else publication.tier3.status
),
total_validators=total_validators,
executed_count=executed_count,
passed_count=passed_count,
Expand Down
32 changes: 22 additions & 10 deletions src/skillevaluator/reporting/templates/report.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@
title — every step is opportunistic so the hero never goes blank.
-#}
{% set hero_title = explicit_skill_name | default(none) or friendly_label or (tier3.skill_name if has_tier3 and tier3.skill_name else (target_display or title)) %}
{% set hero_score = tier3.overall_score if has_tier3 and tier3.overall_score is not none else none %}
{% set hero_score = completed_agent.score if completed_agent else (tier3.overall_score if has_tier3 and tier3.overall_score is not none else none) %}
{% set hero_trials = ((tier3.trials or []) | length) if has_tier3 else 0 %}
{% set hero_metric_count = ((tier3.metric_ids or tier3.evaluators or {}) | length) if has_tier3 else 0 %}
{% set hero_harbor = (tier3.get('harbor_viewer') or tier3.get('summary', {}).get('harbor_viewer') or {}) if has_tier3 else {} %}
Expand Down Expand Up @@ -1351,14 +1351,20 @@
<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">overall score</span></div>
<div class="agent-hero-detail">
<div><strong>Best performing agent:</strong> {{ tier3.best_agent or 'N/A' }}</div>
{% if completed_agent and completed_agent.needs_attention %}<div class="score-warn">Completed-agent result. Other execution failures need attention; see agent details.</div>{% endif %}
{% if completed_agent and completed_agent.recovered_attempts %}<div>{{ completed_agent.recovered_attempts }} timeout attempt(s) recovered; failed history retained.</div>{% endif %}
<div><strong>Trials:</strong> {{ hero_trials }} across {{ (tier3.agents_run or []) | length }} agent(s)</div>
<div><strong>Metrics:</strong> {{ hero_metric_count }} evaluators</div>
{% if tier3_environment %}<div><strong>Environment:</strong> <code>{{ tier3_environment }}</code></div>{% endif %}
{% if tier3.get('overall_lift') is not none %}<div><strong>Overall lift:</strong> {{ "%+.2f" | format(tier3.get('overall_lift')) }}</div>{% endif %}
{% if tier3.get('overall_lift') is not none %}<div><strong>Best-agent lift:</strong> {{ "%+.2f" | format(tier3.get('overall_lift')) }}</div>{% endif %}
</div>
{% endif %}
{% endif %}
{% if report_scope == 'tier3' %}
<p class="publication-line" data-publication-status="not-assessed"><span class="publication-label">Publication eligibility</span> <span class="status-badge warn">Not assessed (Tier 3 only)</span></p>
{% else %}
<p class="publication-line" data-publication-status="{{ publication_status }}"><span class="publication-label">Publication eligibility</span> <span class="status-badge {{ publication_class }}">{{ publication_words.get(publication_status, publication_status | title) }}</span>{% if publication_reasons %} <span class="publication-reasons">{{ publication_reasons | join(' ') }}</span>{% endif %}</p>
{% endif %}
</div>
</div>
{#-
Expand Down Expand Up @@ -1437,7 +1443,7 @@
{% endif %}
{% if has_tier3 %}
{% set tier3_display_verdict = verdict_words['skipped'] if tier3_is_skipped else (advisory_fail_word if tier3_advisory_fail else verdict_words[tier3_verdict if tier3_verdict in ['pass', 'fail', 'neutral'] else 'incomplete']) %}
{% set t3_class = 'skipped' if tier3_is_skipped else ('pass' if tier3_verdict == 'pass' else ('fail' if tier3_verdict == 'fail' else 'warn')) %}
{% set t3_class = 'skipped' if tier3_is_skipped else ('warn' if completed_agent and completed_agent.needs_attention else ('pass' if tier3_verdict == 'pass' else ('fail' if tier3_verdict == 'fail' else 'warn'))) %}
<div class="tier-card {{ t3_class }}{% if initial_tab == 'tier3' %} active{% endif %}"
role="button"
tabindex="0"
Expand All @@ -1448,14 +1454,14 @@
title="Open Tier 3: Live Agent Evaluation">
<div class="tier-card-head">
<span class="tier-card-label">Tier 3</span>
<span class="tier-card-verdict">{{ tier3_display_verdict }}</span>
<span class="tier-card-verdict">{{ tier3_display_verdict }}{% if report_scope == 'tier3' and completed_agent %} · Quality{% if completed_agent.needs_attention %}; needs attention{% endif %}{% endif %}</span>
</div>
<p class="tier-card-title">Live Agent Evaluation</p>
<div class="tier-card-stats">
{% if tier3_is_skipped %}
<span>{{ tier3_skip_message }}</span>
{% else %}
<span>score <strong>{{ "%.2f" | format(tier3.overall_score) if tier3.overall_score is not none else "N/A" }}</strong></span>
<span>score <strong>{{ "%.2f" | format(hero_score) if hero_score is not none else "N/A" }}</strong></span>
{% if tier3.get('overall_lift') is not none %}<span>lift <strong>{{ "%+.2f" | format(tier3.get('overall_lift')) }}</strong></span>{% endif %}
{% if hero_trials %}<span><strong>{{ hero_trials }}</strong> trial(s)</span>{% endif %}
{% endif %}
Expand Down Expand Up @@ -2411,13 +2417,19 @@
<strong>Inconclusive: skill never activated.</strong>
Scores are diagnostic only; no lift verdict was computed. Check skill loading and agent support, then rerun the evaluation.
{% else %}
{% if completed_agent and completed_agent.needs_attention %}
<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.
{% else %}
<strong>Verdict at a glance:</strong>
{{ advisory_fail_word if tier3_advisory_fail else (verdict_words.get(tier3_verdict) or tier3_verdict | title) }}{% if t3_effect %} · {{ t3_effect.message }}{% else %} with an overall score of
{{ "%.2f" | format(tier3.overall_score) if tier3.overall_score is not none else "N/A" }}.
{{ "%.2f" | format(hero_score) if hero_score is not none else "N/A" }}.
{% if t3_best_name %}Best performing agent is <strong>{{ t3_best_name }}</strong>{% else %}No successfully scored agent is available{% endif %}
{% if tier3.get('overall_lift') is not none %} with {{ "%+.2f" | format(tier3.get('overall_lift')) }} skill lift{% endif %}.
{% endif %}
{% endif %}
{% endif %}
</div>
{% if t3_harbor_job_url or t3_harbor_analysis_url %}
<div class="t3-harbor-panel">
Expand All @@ -2433,13 +2445,13 @@
{% endif %}
<div class="dashboard">
<div class="dashboard-card {{ 'success' if tier3_verdict == 'pass' else ('danger' if tier3_verdict == 'fail' else '') }}">
<h3 class="dashboard-card-title">Verdict</h3>
<h3 class="dashboard-card-title">{{ 'Quality Verdict' if report_scope == 'tier3' and completed_agent else 'Verdict' }}</h3>
<p class="dashboard-card-value">{{ verdict_words['skipped'] if tier3_is_skipped else (advisory_fail_word if tier3_advisory_fail else (verdict_words.get(tier3_verdict) or tier3_verdict | title)) }}</p>
<p class="dashboard-card-subtitle">Evaluation outcome</p>
<p class="dashboard-card-subtitle">{{ 'Completed-agent quality; lift shown separately' if report_scope == 'tier3' and completed_agent else 'Evaluation outcome' }}</p>
</div>
<div class="dashboard-card">
<h3 class="dashboard-card-title">Overall Score</h3>
<p class="dashboard-card-value">{{ "%.2f" | format(tier3.overall_score) if tier3.overall_score is not none else "N/A" }}</p>
<h3 class="dashboard-card-title">{{ 'Completed Agent Score' if completed_agent and completed_agent.needs_attention else 'Overall Score' }}</h3>
<p class="dashboard-card-value">{{ "%.2f" | format(hero_score) if hero_score is not none else "N/A" }}</p>
<p class="dashboard-card-subtitle">Best run across evaluated dimensions</p>
</div>
<div class="dashboard-card">
Expand Down
Loading
Loading