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
<!DOCTYPE html>
{% macro verification_detail(finding) -%}
{% set verification = finding | finding_verification %}
{% if verification %}
<div class="llm-verification">
<p><strong>LLM verification:</strong> {{ verification.verdict }} ({{ verification.confidence }} confidence)</p>
{% if verification.reasoning %}<p><strong>Reasoning:</strong> {{ verification.reasoning }}</p>{% endif %}
<p>{{ verification.severity_effect }}</p>
</div>
{% endif %}
{%- endmacro %}
{% from "telemetry.html.j2" import render_telemetry %}
{% from "dataset_diagnostics.html.j2" import render_case_diagnostics with context %}
{% from "native_evidence.html.j2" import render_native_warnings, render_native_evidence %}
{% from "plugin_evidence.html.j2" import render_plugin_evidence, render_retention_limits %}{% macro insight_plain_evidence(value) -%}
{% if value %}
{% if value | string | length > 240 %}
<details class="t3-eval-evidence"><summary>Evidence</summary><p class="t3-dim-hint">{{ value }}</p></details>
{% else %}<p class="t3-dim-hint">Evidence: {{ value }}</p>{% endif %}
{% endif %}
{%- endmacro %}
{% macro insight_cards(items, mode='recommendation') -%}
<div class="t3-sug-stack">
{% if mode == 'conclusion' %}
{% for conclusion in items %}
{% set sev = conclusion.severity or 'warn' %}
{% set sev_class = 'severity-pass' if sev in ('pass','ok') else ('severity-fail' if sev in ('fail','critical','high') else 'severity-warn') %}
{% set sev_pill = 'ok' if sev in ('pass','ok') else ('critical' if sev in ('fail','critical','high') else 'warning') %}
{% set source = (conclusion.source or 'deterministic') %}
<div class="t3-sug-card {{ sev_class }}">
<span class="t3-sug-num">{{ loop.index }}</span>
<div>
<div class="t3-sug-title">
{{ conclusion.title }}
<span class="t3-pill {{ sev_pill }}">{{ sev }}</span>
<span class="t3-insight-source insight-source-{{ source }}">{{ source }}</span>
</div>
<div class="t3-sug-body">{{ conclusion.message }}</div>
{% if conclusion.check %}<p class="t3-dim-hint">Check: {{ conclusion.check }}</p>{% endif %}
{{ insight_plain_evidence(conclusion.evidence_text) }}
{% if conclusion.evidence and conclusion.evidence.url %}<a class="t3-evidence-link" href="{{ conclusion.evidence.url }}" target="_blank" rel="noopener">View {{ conclusion.evidence.label or 'evidence' }}</a>{% endif %}
</div>
<div class="t3-sug-actions">
<button class="t3-copy-btn" data-report-action="copy" data-copy-text="{{ conclusion.title ~ ': ' ~ conclusion.message }}">Copy</button>
</div>
</div>
{% endfor %}
{% else %}
{% for reco in items %}
{% set sev = reco.severity or 'warn' %}
{% set sev_class = 'severity-pass' if sev in ('pass','ok') else ('severity-fail' if sev in ('fail','critical','high') else 'severity-warn') %}
{% set source = (reco.source or 'deterministic') %}
<div class="t3-sug-card {{ sev_class }}">
<span class="t3-sug-num">{{ loop.index }}</span>
<div>
<div class="t3-sug-title">
<span class="t3-sug-cat">{{ reco.category or 'Action' }}</span>
{% if reco.title %}<span style="font-weight:700;">{{ reco.title }}</span>{% endif %}
<span class="t3-insight-source insight-source-{{ source }}">{{ source }}</span>
</div>
<div class="t3-sug-body">{{ reco.message }}</div>
{% if reco.problem %}
{% if reco.problem_in_diagnostics %}<a class="t3-evidence-link" href="#tier3-execution-errors">Recorded problem in Diagnostics</a>
{% else %}<details class="t3-eval-evidence"><summary>Recorded problem</summary><p class="t3-dim-hint">{{ reco.problem }}</p></details>{% endif %}
{% endif %}
{% if reco.check %}<p class="t3-dim-hint">Check: {{ reco.check }}</p>{% endif %}
{% if reco.insight_kind == 'execution_action' %}<p class="t3-dim-hint">Scope: {{ reco.metric or 'evaluation' }}{% if reco.agent %} · Agent: {{ reco.agent }}{% endif %}{% if reco.case_id or reco.case %} · Case: {{ reco.case_id or reco.case }}{% endif %}{% if reco.condition %} · Condition: {{ reco.condition }}{% endif %}{% if reco.strength %} · Strength: {{ reco.strength }}{% endif %}</p>{% endif %}
{{ insight_plain_evidence(reco.evidence_text) }}
{% if reco.evidence and reco.evidence.url %}
<a class="t3-evidence-link" href="{{ reco.evidence.url }}" target="_blank" rel="noopener">View {{ reco.evidence.label or 'evidence' }}</a>
{% endif %}
</div>
<div class="t3-sug-actions">
<button class="t3-copy-btn" data-report-action="copy" data-copy-text="{{ reco.message }}">Copy</button>
</div>
</div>
{% endfor %}
{% endif %}
</div>
{%- endmacro %}
{% macro insight_next_steps(steps) -%}
{% if steps %}
<p class="t3-next-steps-conclusion">Next steps for the run:</p>
<ol class="t3-next-steps-list">
{% for step in steps %}<li><strong>{{ step.problem }}</strong> [{{ step.target }}{% if step.strength and step.strength != 'supported' %} · {{ step.strength }}{% endif %}]: {{ step.action }} Check: {{ step.check }}{% if step.evidence and step.evidence | string | length <= 240 %} Evidence: {{ step.evidence }}{% endif %}{% if step.evidence and step.evidence | string | length > 240 %}{{ insight_plain_evidence(step.evidence) }}{% endif %}</li>{% endfor %}
</ol>
{% endif %}
{%- endmacro %}
{% macro unavailable_lift(score, baseline, activation) -%}
{%- if activation.get('status') == 'never_activated' -%}inconclusive: skill never activated
{%- elif score is none and baseline is not none -%}with-skill unavailable
{%- elif score is none -%}N/A lift
{%- elif baseline is not none -%}comparison unavailable
{%- else -%}no baseline lift{%- endif -%}
{%- endmacro %}
{% macro other_dimension_cell(dimension, agent) -%}
<td>{% if dimension %}
{% set other_score = dimension.score if dimension.score is not none else dimension.with_skill %}
{% set other_color = 'var(--text-secondary)' if other_score is none else ('var(--success-color)' if other_score >= 0.7 else ('var(--warning-color)' if other_score >= 0.4 else 'var(--danger-color)')) %}
<div class="t3-mad-cell">
<div class="t3-mad-score-row"><span class="t3-mad-score" style="color:{{ other_color }};">{{ "%.2f" | format(other_score) if other_score is not none else 'N/A' }}</span>{% if other_score is not none %}<div class="t3-mad-bar"><span style="width:{{ (other_score * 100) | round(0) }}%;background:{{ other_color }};"></span></div>{% endif %}</div>
<span class="t3-mad-lift">{% if dimension.lift is not none and agent.get('skill_activation', {}).get('status') != 'never_activated' %}{{ "%+.2f" | format(dimension.lift) }} lift{% else %}{{ unavailable_lift(other_score, dimension.baseline, agent.get('skill_activation', {})) }}{% endif %}</span>
{% if dimension.partial %}<span class="t3-pill warning">partial</span>{% endif %}
{% if dimension.comparison and dimension.comparison.status != 'comparable' %}<span class="t3-dim-hint">{{ dimension.comparison.label }}{% if dimension.comparison.with_skill is number and dimension.comparison.baseline is number and dimension.comparison.lift is number %}: {{ "%.2f" | format(dimension.comparison.baseline) }} → {{ "%.2f" | format(dimension.comparison.with_skill) }} ({{ "%+.2f" | format(dimension.comparison.lift) }}){% endif %}{% if dimension.comparison.reason %} · {{ dimension.comparison.reason }}{% endif %}</span>{% endif %}
</div>
{% else %}N/A{% endif %}</td>
{%- endmacro %}
{% macro harbor_job_actions(jobs, tile=false) -%}
<div class="{{ 'tier-card-jobs' if tile else 't3-harbor-jobs' }}"{% if tile %} onclick="event.stopPropagation()"{% endif %}>
{% for job in jobs %}
<div class="{{ 'tier-card-job' if tile else 't3-harbor-job' }}">
{% if jobs | length > 1 %}<span class="{{ 'tier-card-job-label' if tile else 't3-harbor-job-label' }}">{{ job.display_label or ('Job ' ~ loop.index) }}</span>{% endif %}
<div class="{{ 'tier-card-links' if tile else 't3-harbor-actions' }}">
{% if job.url %}<a class="{{ 'tier-card-link' if tile else 't3-harbor-link' }}" href="{{ job.url }}" aria-label="Harbor logs · {{ job.display_label or ('Job ' ~ loop.index) }}" target="_blank" rel="noopener noreferrer">{{ 'Harbor logs' if tile else 'Logs' }}</a>{% endif %}
{% if job.analysis_url %}<a class="{{ 'tier-card-link' if tile else 't3-harbor-link' }}" href="{{ job.analysis_url }}" aria-label="Harbor analysis · {{ job.display_label or ('Job ' ~ loop.index) }}" target="_blank" rel="noopener noreferrer">{{ 'Harbor analysis' if tile else 'Analysis' }}</a>{% endif %}
</div>
</div>
{% endfor %}
</div>
{%- endmacro %}
<html lang="en" data-default-theme="{{ 'dark' if tier3 else 'light' }}" data-theme="{{ 'dark' if tier3 else 'light' }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title }}</title>
<style>
:root {
--nv: #76b900;
--accent-color: #76b900;
--primary-color: #0f4c2a;
--secondary-color: #76b900;
--success-color: #22c55e;
--danger-color: #ef4444;
--warning-color: #eab308;
--critical-color: #b91c1c;
--high-color: #dc2626;
--medium-color: #d97706;
--low-color: #6b7280;
--info-color: #0369a1;
--light-bg: #f8fafc;
--bg: #ffffff;
--bg-secondary: #f1f5f9;
--bg-tertiary: #e2e8f0;
--dark-text: #1e293b;
--text-secondary: #64748b;
--border-color: #e2e8f0;
--shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06);
--shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
--code-bg: #1e293b;
--code-text: #e2e8f0;
--table-header-bg: #f8fafc;
--table-row-hover: #f1f5f9;
--chart-grid: #e2e8f0;
--chart-tick: #64748b;
--chart-label: #0f172a;
--badge-pass-bg: #dcfce7;
--badge-pass-tx: #166534;
--badge-warn-bg: #fef9c3;
--badge-warn-tx: #854d0e;
--badge-fail-bg: #fee2e2;
--badge-fail-tx: #991b1b;
}
[data-theme="dark"] {
--primary-color: #0c111b;
--secondary-color: #76b900;
--success-color: #22c55e;
--danger-color: #ef4444;
--warning-color: #eab308;
--critical-color: #f87171;
--high-color: #f87171;
--medium-color: #fbbf24;
--low-color: #9ca3af;
--info-color: #38bdf8;
--light-bg: #0c111b;
--bg: #151d2e;
--bg-secondary: #1e293b;
--bg-tertiary: #2a3650;
--dark-text: #e2e8f0;
--text-secondary: #94a3b8;
--border-color: #334155;
--shadow: 0 1px 3px 0 rgba(0,0,0,0.4);
--shadow-lg: 0 4px 6px -1px rgba(0,0,0,0.4);
--code-bg: #161b22;
--code-text: #c9d1d9;
--table-header-bg: #1e293b;
--table-row-hover: #2a3650;
--chart-grid: #1e293b;
--chart-tick: #94a3b8;
--chart-label: #e2e8f0;
--badge-pass-bg: #14532d;
--badge-pass-tx: #bbf7d0;
--badge-warn-bg: #713f12;
--badge-warn-tx: #fef08a;
--badge-fail-bg: #7f1d1d;
--badge-fail-tx: #fecaca;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
background-color: var(--light-bg);
color: var(--dark-text);
line-height: 1.6;
transition: background-color 0.2s ease, color 0.2s ease;
}
.main-header {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
padding: 1.25rem 0;
box-shadow: var(--shadow-lg);
position: sticky;
top: 0;
z-index: 100;
}
.header-content {
max-width: 1200px;
margin: 0 auto;
padding: 0 2rem;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 1rem;
}
.logo-section { display: flex; flex-direction: column; gap: 0.2rem; }
/* Brand block. Sized to mirror the hero panel one row down so the
page reads as a single visual hierarchy rather than two competing
type scales (hero title is 1.8rem/800; brand sits a hair larger to
keep "SkillEvaluator" as the top-level identifier). Public branding uses
the canonical name; the native style declarations are unchanged. */
.header-title {
font-size: 2rem;
font-weight: 800;
margin: 0;
letter-spacing: -0.025em;
line-height: 1.1;
}
.header-subtitle-row {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 0.35rem;
}
.header-subtitle {
font-size: 0.95rem;
opacity: 0.9;
margin: 0;
font-weight: 400;
line-height: 1.3;
}
.header-powered-tag {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.2rem 0.6rem;
border: 1px solid rgba(255,255,255,0.32);
border-radius: 999px;
background: linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0.10));
box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
color: white;
font-size: 0.68rem;
font-weight: 700;
letter-spacing: 0.03em;
line-height: 1.2;
white-space: nowrap;
}
.header-powered-tag::before {
content: "";
width: 0.4rem;
height: 0.4rem;
border-radius: 999px;
background: #a3e635;
box-shadow: 0 0 0 2px rgba(163,230,53,0.20);
}
.header-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }
.header-meta-item { font-size: 0.8rem; opacity: 0.85; margin: 0; }
.header-target-link {
color: #a5d8ff;
text-decoration: underline;
text-underline-offset: 2px;
transition: color 0.15s ease;
}
.header-target-link:hover { color: #ffffff; }
.header-controls { display: flex; align-items: center; gap: 0.5rem; }
.theme-toggle, .export-btn {
background: rgba(255,255,255,0.15);
border: 1px solid rgba(255,255,255,0.25);
border-radius: 6px;
padding: 0.4rem 0.75rem;
cursor: pointer;
font-size: 0.8rem;
transition: all 0.2s ease;
color: white;
display: flex;
align-items: center;
gap: 0.375rem;
}
.theme-toggle:hover, .export-btn:hover { background: rgba(255,255,255,0.25); }
.header-status-badge {
display: inline-block;
padding: 0.375rem 1rem;
border-radius: 6px;
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.header-status-badge.pass { background: rgba(255,255,255,0.95); color: var(--success-color); }
.header-status-badge.fail { background: #fecaca; color: #991b1b; border: 1px solid #fca5a5; }
.header-status-badge.warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
[data-theme="dark"] .header-status-badge.fail { background: #450a0a; color: #fca5a5; border-color: #991b1b; }
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.nav-tabs { display: flex; gap: 0.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.nav-tab {
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
background: var(--bg);
color: var(--dark-text);
border-radius: 6px;
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
transition: all 0.2s ease;
}
.nav-tab:hover { border-color: var(--secondary-color); color: var(--secondary-color); }
.nav-tab.active { background: var(--secondary-color); color: white; border-color: var(--secondary-color); }
.tab-content { display: none; }
.tab-content.active { display: block; }
.dashboard {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.25rem;
margin: 1.5rem 0;
}
.dashboard-card {
background: var(--bg);
border-radius: 8px;
padding: 1.25rem;
box-shadow: var(--shadow);
transition: box-shadow 0.2s ease;
border: 1px solid var(--border-color);
}
.dashboard-card:hover { box-shadow: var(--shadow-lg); }
.dashboard-card-title {
font-size: 0.7rem;
color: var(--text-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
margin: 0 0 0.5rem 0;
font-weight: 600;
}
.dashboard-card-value { font-size: 1.75rem; font-weight: 700; margin: 0; color: var(--dark-text); }
.dashboard-card-subtitle { font-size: 0.75rem; color: var(--text-secondary); margin: 0.25rem 0 0 0; }
.dashboard-card.success .dashboard-card-value { color: var(--success-color); }
.dashboard-card.danger .dashboard-card-value { color: var(--danger-color); }
.progress-bar {
width: 100%; height: 6px;
background: var(--border-color);
border-radius: 3px;
overflow: hidden;
margin-top: 0.75rem;
}
.progress-bar-fill {
height: 100%;
background: var(--success-color);
border-radius: 3px;
transition: width 0.3s ease;
}
.status-badge {
display: inline-block;
padding: 0.2rem 0.6rem;
border-radius: 4px;
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
}
.status-badge.pass { background: #dcfce7; color: #166534; }
.status-badge.fail { background: #fee2e2; color: #991b1b; }
.status-badge.warn { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .status-badge.pass { background: #14532d; color: #86efac; }
[data-theme="dark"] .status-badge.fail { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .status-badge.warn { background: #451a03; color: #fcd34d; }
.section-header {
color: var(--dark-text);
font-weight: 600;
font-size: 1rem;
margin: 2rem 0 1rem 0;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border-color);
}
.filter-group {
display: flex; gap: 0.5rem; margin: 1.25rem 0; flex-wrap: wrap;
position: sticky; top: 4.5rem; z-index: 50;
background: var(--light-bg); padding-top: 0.75rem; padding-bottom: 0.75rem;
}
.filter-btn {
padding: 0.4rem 0.875rem;
border: 1px solid var(--border-color);
background: var(--bg);
color: var(--dark-text);
border-radius: 6px;
cursor: pointer;
font-size: 0.8rem;
font-weight: 500;
transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--secondary-color); }
.filter-btn.active { background: var(--secondary-color); color: white; border-color: var(--secondary-color); }
.filter-btn.success.active { background: var(--success-color); border-color: var(--success-color); }
.filter-btn.danger.active { background: var(--danger-color); border-color: var(--danger-color); }
.filter-btn.warning.active { background: var(--warning-color); border-color: var(--warning-color); }
.table-section { margin: 1.25rem 0; }
.table-toggle {
background: var(--bg);
color: var(--dark-text);
cursor: pointer;
padding: 0.875rem 1rem;
width: 100%;
border: 1px solid var(--border-color);
text-align: left;
font-size: 0.9rem;
font-weight: 600;
border-radius: 8px 8px 0 0;
transition: all 0.2s ease;
display: flex;
justify-content: space-between;
align-items: center;
}
.table-toggle:hover { background: var(--bg-secondary); }
.table-toggle .toggle-icon { font-size: 0.75rem; color: var(--text-secondary); transition: transform 0.2s ease; }
.table-toggle.active .toggle-icon { transform: rotate(180deg); }
.table-container {
background: var(--bg);
border-radius: 0 0 8px 8px;
overflow: hidden;
max-height: 0;
transition: max-height 0.3s ease-out;
border: 1px solid var(--border-color);
border-top: none;
}
.table-container.active { max-height: 2000px; }
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table th {
background: var(--table-header-bg);
color: var(--text-secondary);
padding: 0.75rem 1rem;
text-align: left;
font-weight: 600;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border-color);
}
.summary-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-color); vertical-align: middle; font-size: 0.875rem; }
.summary-table tbody tr { cursor: pointer; transition: background-color 0.15s ease; }
.summary-table tbody tr:hover { background-color: var(--table-row-hover); }
.summary-table tbody tr:last-child td { border-bottom: none; }
.summary-table .name-col { font-weight: 500; color: var(--dark-text); }
.summary-table .error-text { color: var(--danger-color); font-weight: 600; }
.summary-table .warning-text { color: var(--warning-color); font-weight: 600; }
.skill-card, .validator-card, .skill-filter-banner { scroll-margin-top: 9rem; }
.validator-card { margin-bottom: 0.75rem; border-radius: 8px; overflow: hidden; }
.validator-collapsible {
background: var(--bg);
color: var(--dark-text);
cursor: pointer;
padding: 0.875rem 1rem;
width: 100%;
border: 1px solid var(--border-color);
text-align: left;
font-size: 0.9rem;
font-weight: 500;
border-radius: 8px;
transition: all 0.2s ease;
display: flex;
justify-content: space-between;
align-items: center;
}
.validator-collapsible:hover { background: var(--bg-secondary); }
.validator-collapsible.active {
background: var(--secondary-color);
color: white;
border-color: var(--secondary-color);
border-radius: 8px 8px 0 0;
}
.validator-collapsible .expand-text { font-size: 0.7rem; font-weight: 500; opacity: 0.7; }
.validator-collapsible.active .expand-text { opacity: 0.9; }
.collapsible-header { display: flex; align-items: center; gap: 0.625rem; flex: 1; }
.collapsible-header .status-indicator { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.collapsible-header .status-indicator.pass { background: var(--success-color); }
.collapsible-header .status-indicator.fail { background: var(--danger-color); }
.collapsible-header .status-indicator.warn { background: var(--warning-color); }
.validator-collapsible.active .status-indicator.pass { background: #86efac; }
.validator-collapsible.active .status-indicator.fail { background: #fca5a5; }
.validator-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
background: var(--bg);
border: 1px solid var(--border-color);
border-top: none;
border-radius: 0 0 8px 8px;
}
.validator-content.active { max-height: 5000px; padding: 1rem; }
.validator-summary {
display: flex; flex-wrap: wrap; gap: 1rem;
padding: 0.625rem 0; margin-bottom: 0.625rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.8rem; color: var(--text-secondary);
}
.summary-stat { display: flex; align-items: center; gap: 0.375rem; }
.summary-stat svg { width: 0.875rem; height: 0.875rem; }
.summary-stat.error { color: var(--danger-color); }
.summary-stat.warning { color: var(--warning-color); }
.success-list { list-style: none; padding: 0; margin: 0; }
.success-item { padding: 0.375rem 0; display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.875rem; }
.success-icon { color: var(--success-color); flex-shrink: 0; width: 1rem; height: 1rem; margin-top: 0.125rem; }
.findings-list { display: flex; flex-direction: column; gap: 0.625rem; }
.finding { padding: 0.875rem; border-left: 3px solid; background: var(--bg-secondary); border-radius: 0 6px 6px 0; }
.finding.critical { border-color: var(--critical-color); }
.finding.high { border-color: var(--high-color); }
.finding.medium { border-color: var(--medium-color); }
.finding.low { border-color: var(--low-color); }
.finding.info { border-color: var(--info-color); }
.finding-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.375rem; }
.finding-message { font-weight: 500; font-size: 0.875rem; }
.severity-tag { font-size: 0.65rem; padding: 0.125rem 0.375rem; border-radius: 3px; font-weight: 600; white-space: nowrap; }
.severity-critical, .severity-high { background: #fee2e2; color: #991b1b; }
.severity-medium { background: #fef3c7; color: #92400e; }
.severity-low { background: #f3f4f6; color: #4b5563; }
.severity-info { background: #dbeafe; color: #1e40af; }
[data-theme="dark"] .severity-critical, [data-theme="dark"] .severity-high { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .severity-medium { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .severity-low { background: #374151; color: #9ca3af; }
[data-theme="dark"] .severity-info { background: #1e3a8a; color: #93c5fd; }
.finding-meta { display: flex; flex-wrap: wrap; gap: 0.75rem; color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.375rem; }
.finding-meta span { display: flex; align-items: center; gap: 0.25rem; }
.llm-verification { margin-top: 0.625rem; padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); border-radius: 6px; font-size: 0.8rem; overflow-wrap: anywhere; }
.llm-verification p { margin: 0.25rem 0; }
.meta-icon { width: 0.8rem; height: 0.8rem; flex-shrink: 0; }
.code-snippet {
font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', monospace;
background: var(--code-bg);
color: var(--code-text);
padding: 0.625rem 0.875rem;
border-radius: 4px;
margin: 0.5rem 0;
overflow-x: auto;
font-size: 0.8rem;
line-height: 1.5;
}
.suggestion {
background: #f0fdf4;
padding: 0.625rem 0.875rem;
border-radius: 4px;
margin-top: 0.5rem;
font-size: 0.8rem;
border-left: 3px solid var(--success-color);
color: #166534;
}
[data-theme="dark"] .suggestion { background: #14532d; color: #bbf7d0; }
footer {
margin-top: 2rem;
padding: 1.25rem 2rem;
border-top: 1px solid var(--border-color);
color: var(--text-secondary);
text-align: center;
font-size: 0.8rem;
background: var(--bg);
}
#backToTop {
display: none;
position: fixed;
bottom: 1.5rem; right: 1.5rem;
padding: 0.5rem 0.75rem;
border-radius: 6px;
background: var(--secondary-color);
color: white;
border: none;
cursor: pointer;
font-size: 0.75rem;
font-weight: 500;
box-shadow: var(--shadow-lg);
transition: all 0.2s ease;
z-index: 99;
align-items: center;
gap: 0.25rem;
}
#backToTop:hover { background: var(--primary-color); }
@media (max-width: 768px) {
.container { padding: 1rem; }
.header-content { flex-direction: column; align-items: flex-start; }
.header-meta { text-align: left; align-items: flex-start; }
.header-title { font-size: 1.65rem; }
.header-subtitle { font-size: 0.85rem; }
.header-powered-tag { font-size: 0.62rem; }
.dashboard { grid-template-columns: repeat(2, 1fr); }
.dashboard-card-value { font-size: 1.5rem; }
.finding-header { flex-direction: column; gap: 0.375rem; }
}
@media (max-width: 480px) {
.dashboard { grid-template-columns: 1fr; }
.header-controls { width: 100%; justify-content: flex-start; margin-top: 0.5rem; }
}
/* Skill-centric view styles */
.skill-card {
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 8px;
margin-bottom: 1rem;
overflow: hidden;
box-shadow: var(--shadow);
}
.skill-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
cursor: pointer;
}
.skill-header:hover { background: var(--table-row-hover); }
.skill-name {
font-weight: 600;
font-size: 1rem;
color: var(--dark-text);
display: flex;
align-items: center;
gap: 0.5rem;
}
.skill-name .status-dot {
width: 10px;
height: 10px;
border-radius: 50%;
}
.skill-name .status-dot.pass { background: var(--success-color); }
.skill-name .status-dot.fail { background: var(--danger-color); }
.skill-name .status-dot.warn { background: var(--warning-color); }
.skill-checks-summary {
display: flex;
align-items: center;
gap: 0.75rem;
font-size: 0.8rem;
}
.skill-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
}
.skill-content.active { max-height: 5000px; }
.skill-checks-grid {
padding: 1rem;
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.check-result {
border: 1px solid var(--border-color);
border-radius: 6px;
overflow: hidden;
}
.check-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.625rem 0.875rem;
background: var(--bg-secondary);
font-size: 0.875rem;
}
.check-name { font-weight: 600; color: var(--dark-text); }
.check-description { font-size: 0.75rem; color: var(--text-secondary); margin-left: 0.5rem; font-weight: 400; }
.check-details { padding: 0.75rem 0.875rem; }
.check-details-list { list-style: none; margin: 0; padding: 0; }
.check-detail-item {
padding: 0.375rem 0;
font-size: 0.8rem;
display: flex;
align-items: flex-start;
gap: 0.5rem;
}
.check-detail-item .detail-icon {
color: var(--success-color);
flex-shrink: 0;
margin-top: 0.125rem;
}
.check-detail-item.finding .detail-icon { color: var(--danger-color); }
.check-finding {
background: var(--bg-secondary);
border-left: 3px solid var(--danger-color);
padding: 0.625rem 0.875rem;
margin: 0.5rem 0;
border-radius: 0 4px 4px 0;
}
.check-finding.warning { border-left-color: var(--warning-color); }
.check-finding .finding-msg { font-weight: 500; font-size: 0.875rem; }
.check-finding .finding-suggestion {
background: #f0fdf4;
padding: 0.5rem 0.625rem;
border-radius: 4px;
margin-top: 0.5rem;
font-size: 0.75rem;
color: #166534;
}
[data-theme="dark"] .check-finding .finding-suggestion { background: #14532d; color: #bbf7d0; }
.metadata-tag {
display: inline-block;
background: var(--bg-secondary);
padding: 0.125rem 0.375rem;
border-radius: 3px;
font-size: 0.7rem;
color: var(--text-secondary);
margin-left: 0.375rem;
}
.view-toggle-section {
display: flex;
gap: 0.5rem;
margin: 1.5rem 0 1rem 0;
padding-bottom: 0.75rem;
border-bottom: 1px solid var(--border-color);
}
.view-toggle-btn {
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
background: var(--bg);
color: var(--dark-text);
border-radius: 6px;
cursor: pointer;
font-size: 0.875rem;
font-weight: 500;
transition: all 0.2s ease;
}
.view-toggle-btn:hover { border-color: var(--secondary-color); }
.view-toggle-btn.active { background: var(--secondary-color); color: white; border-color: var(--secondary-color); }
.results-view { display: none; }
.results-view.active { display: block; }
.skills-summary-bar {
display: flex;
gap: 1rem;
align-items: center;
padding: 0.75rem 1rem;
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 6px;
margin-bottom: 1rem;
font-size: 0.875rem;
}
.skills-summary-bar .summary-item {
display: flex;
align-items: center;
gap: 0.375rem;
}
.skills-summary-bar .summary-item strong { color: var(--dark-text); }
.skills-summary-bar .summary-item.pass strong { color: var(--success-color); }
.skills-summary-bar .summary-item.fail strong { color: var(--danger-color); }
/* Executive Summary / Top Issues table */
.top-issues-section {
margin: 1.5rem 0;
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 8px;
overflow: hidden;
box-shadow: var(--shadow);
}
.top-issues-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
cursor: pointer;
}
.top-issues-header:hover { background: var(--table-row-hover); }
.top-issues-header h3 {
font-size: 0.95rem;
font-weight: 600;
color: var(--dark-text);
margin: 0;
}
.top-issues-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
}
.top-issues-content.active { max-height: 3000px; }
.top-issues-table { width: 100%; border-collapse: collapse; }
.top-issues-table th {
background: var(--table-header-bg);
color: var(--text-secondary);
padding: 0.625rem 1rem;
text-align: left;
font-weight: 600;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border-color);
}
.top-issues-table td {
padding: 0.625rem 1rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.85rem;
vertical-align: middle;
}
.top-issues-table tbody tr:last-child td { border-bottom: none; }
.top-issues-table tbody tr { cursor: pointer; }
.top-issues-table tbody tr:hover { background: var(--table-row-hover); }
.skills-pills {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
}
.skill-pill {
display: inline-block;
background: var(--bg-secondary);
padding: 0.125rem 0.5rem;
border-radius: 10px;
font-size: 0.7rem;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.15s ease;
}
.skill-pill:hover { background: var(--secondary-color); color: white; }
/* Pair the skill pill (jumps to finding) with a small quality-score
link so the two destinations stay distinct: the issue lives in the
main pill, the quality score lives in the trailing ``Q`` chip. */
.skill-pill-group {
display: inline-flex;
align-items: center;
gap: 0.125rem;
}
.skill-pill-group .skill-pill {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.quality-pill {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.1rem;
height: 1.1rem;
padding: 0 0.3rem;
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
background: var(--bg-secondary);
color: var(--text-secondary);
font-size: 0.65rem;
font-weight: 700;
cursor: pointer;
transition: all 0.15s ease;
border-left: 1px solid var(--border-color);
}
.quality-pill:hover { background: var(--warning-color); color: white; }
.top-issues-active-row { background: var(--bg-secondary) !important; outline: 2px solid var(--secondary-color); outline-offset: -2px; }
/* Contributor Summary */
.contributor-section {
margin: 1.5rem 0;
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 8px;
overflow: hidden;
box-shadow: var(--shadow);
}
.contributor-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
background: var(--bg-secondary);
border-bottom: 1px solid var(--border-color);
cursor: pointer;
}
.contributor-header:hover { background: var(--table-row-hover); }
.contributor-header h3 {
font-size: 0.95rem;
font-weight: 600;
color: var(--dark-text);
margin: 0;
}
.contributor-content {
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out;
}
.contributor-content.active { max-height: 3000px; }
.contributor-table { width: 100%; border-collapse: collapse; }
.contributor-table th {
background: var(--table-header-bg);
color: var(--text-secondary);
padding: 0.625rem 1rem;
text-align: left;
font-weight: 600;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 1px solid var(--border-color);
}
.contributor-table td {
padding: 0.625rem 1rem;
border-bottom: 1px solid var(--border-color);
font-size: 0.85rem;
vertical-align: middle;
}
.contributor-table tbody tr:last-child td { border-bottom: none; }
.contributor-table tbody tr:hover { background: var(--table-row-hover); }
.contributor-items {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
}
.contributor-item-pill {
display: inline-block;
padding: 0.125rem 0.5rem;
border-radius: 10px;
font-size: 0.7rem;
cursor: pointer;
transition: all 0.15s ease;
}
.contributor-item-pill.pass { background: #dcfce7; color: #166534; }
.contributor-item-pill.fail { background: #fee2e2; color: #991b1b; }
.contributor-item-pill.warn { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .contributor-item-pill.pass { background: #14532d; color: #86efac; }
[data-theme="dark"] .contributor-item-pill.fail { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .contributor-item-pill.warn { background: #451a03; color: #fcd34d; }
.contributor-item-pill:hover { opacity: 0.8; }
.skill-filter-banner {
display: none;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: #eff6ff;
border: 1px solid #bfdbfe;
border-radius: 6px;
margin-bottom: 1rem;
font-size: 0.8rem;
color: #1e40af;
position: sticky; top: 8rem; z-index: 49;
}
[data-theme="dark"] .skill-filter-banner { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; }
.skill-filter-banner.visible { display: flex; }
.skill-filter-banner .clear-filter {
margin-left: auto;
cursor: pointer;
font-weight: 700;
padding: 0.3rem 0.875rem;
border-radius: 4px;
border: 1px solid currentColor;
background: transparent;
color: inherit;
font-size: 0.8rem;
}
.skill-filter-banner .clear-filter:hover { background: rgba(0,0,0,0.08); }
[data-theme="dark"] .skill-filter-banner .clear-filter:hover { background: rgba(255,255,255,0.1); }
.count-badge {
display: inline-block;
background: var(--danger-color);
color: white;
padding: 0.125rem 0.5rem;
border-radius: 10px;
font-size: 0.7rem;
font-weight: 600;
min-width: 1.5rem;
text-align: center;
}
.count-badge.medium-count { background: var(--warning-color); }
.count-badge.low-count { background: var(--low-color); }
/* Severity filter controls */
.severity-filter-group {
display: flex;
gap: 0.375rem;
margin-left: auto;
align-items: center;
}
.severity-filter-btn {
padding: 0.25rem 0.625rem;
border: 1px solid var(--border-color);
background: var(--bg);
color: var(--dark-text);
border-radius: 4px;
cursor: pointer;
font-size: 0.7rem;
font-weight: 500;
transition: all 0.2s ease;
}
.severity-filter-btn:hover { border-color: var(--secondary-color); }
.severity-filter-btn.active { background: var(--secondary-color); color: white; border-color: var(--secondary-color); }
.severity-filter-btn.active.critical-btn { background: var(--critical-color); border-color: var(--critical-color); }
.severity-filter-btn.active.high-btn { background: var(--high-color); border-color: var(--high-color); }
/* Confidence badge */
.confidence-badge {
display: inline-block;
padding: 0.1rem 0.375rem;
border-radius: 3px;
font-size: 0.6rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.3px;
margin-left: 0.375rem;
}
.confidence-badge.high-conf { background: #fee2e2; color: #991b1b; }
.confidence-badge.medium-conf { background: #fef3c7; color: #92400e; }
.confidence-badge.low-conf { background: #f3f4f6; color: #6b7280; border: 1px dashed #d1d5db; }
[data-theme="dark"] .confidence-badge.high-conf { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .confidence-badge.medium-conf { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .confidence-badge.low-conf { background: #374151; color: #9ca3af; border-color: #4b5563; }
/* Low-confidence finding styling */
.check-finding.low-confidence {
opacity: 0.65;
border-left-style: dashed;
}
.check-finding.low-confidence:hover { opacity: 1; }
/* Aggregated finding occurrences */
.occurrence-badge {
display: inline-block;
background: var(--bg-secondary);
border: 1px solid var(--border-color);
padding: 0.125rem 0.5rem;
border-radius: 10px;
font-size: 0.7rem;
font-weight: 600;
color: var(--text-secondary);
margin-left: 0.5rem;
}
.lines-list {
font-size: 0.7rem;
color: var(--text-secondary);
margin-top: 0.25rem;
}
/* Truncatable suggestion text */
.finding-suggestion.truncatable {
max-height: 2.4em;
overflow: hidden;
position: relative;
cursor: pointer;
}
.finding-suggestion.truncatable::after {
content: '... Show more';
position: absolute;
right: 0.625rem;
bottom: 0;
background: #f0fdf4;
padding-left: 0.5rem;
font-size: 0.7rem;
font-weight: 600;
color: var(--secondary-color);
}
[data-theme="dark"] .finding-suggestion.truncatable::after { background: #14532d; }
.finding-suggestion.truncatable.expanded {
max-height: none;
}
.finding-suggestion.truncatable.expanded::after {
content: 'Show less';
position: relative;
display: block;
text-align: right;
margin-top: 0.25rem;
}
/* Expand/Collapse all button */
.bulk-action-btn {
padding: 0.3rem 0.625rem;
border: 1px solid var(--border-color);
background: var(--bg);
color: var(--text-secondary);
border-radius: 4px;
cursor: pointer;
font-size: 0.7rem;
font-weight: 500;
transition: all 0.2s ease;
}
.bulk-action-btn:hover { border-color: var(--secondary-color); color: var(--secondary-color); }
/* Severity breakdown in dashboard */
.severity-breakdown {
display: flex;
gap: 0.5rem;
margin-top: 0.375rem;
flex-wrap: wrap;
}
.severity-breakdown-item {
font-size: 0.65rem;
font-weight: 600;
padding: 0.1rem 0.375rem;
border-radius: 3px;
}
.severity-breakdown-item.sev-critical { background: #fee2e2; color: #991b1b; }
.severity-breakdown-item.sev-high { background: #fee2e2; color: #991b1b; }
.severity-breakdown-item.sev-medium { background: #fef3c7; color: #92400e; }
.severity-breakdown-item.sev-low { background: #f3f4f6; color: #4b5563; }
[data-theme="dark"] .severity-breakdown-item.sev-critical,
[data-theme="dark"] .severity-breakdown-item.sev-high { background: #450a0a; color: #fca5a5; }
[data-theme="dark"] .severity-breakdown-item.sev-medium { background: #451a03; color: #fcd34d; }
[data-theme="dark"] .severity-breakdown-item.sev-low { background: #374151; color: #9ca3af; }
.severity-breakdown-label {
font-size: 0.65rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.03em;
color: var(--text-secondary);
margin-top: 0.5rem;
}
.severity-breakdown-label.advisory { color: #92400e; }
[data-theme="dark"] .severity-breakdown-label.advisory { color: #fcd34d; }
.advisory-note {
font-size: 0.65rem;
font-style: italic;
color: var(--text-secondary);
margin-top: 0.25rem;
}
/* Issue count badge in skill header */
.issue-count-badge {
font-size: 0.7rem;
color: var(--danger-color);
font-weight: 600;
}
/* Dedup finding collapsible cards */
.dedup-finding-high { border: 1px solid #fca5a5; background: #fef2f2; }
.dedup-finding-medium { border: 1px solid #fde68a; background: #fffbeb; }
[data-theme="dark"] .dedup-finding-high { border-color: #991b1b; background: #450a0a; }
[data-theme="dark"] .dedup-finding-medium { border-color: #92400e; background: #451a03; }
.dedup-recommendation {
margin-top: 0.75rem; padding: 0.75rem;
background: var(--bg-secondary); border-radius: 6px;
border-left: 3px solid var(--secondary-color);
}
.dedup-finding { list-style: none; }
.dedup-finding::-webkit-details-marker { display: none; }
.dedup-finding > summary { list-style: none; }
.dedup-finding > summary::-webkit-details-marker { display: none; }
.dedup-finding > summary::marker { display: none; content: ''; }
.dedup-finding .toggle-icon {
margin-left: auto;
font-size: 1.1rem;
font-weight: 700;
color: var(--text-secondary);
transition: transform 0.2s ease;
flex-shrink: 0;
}
.dedup-finding[open] .toggle-icon { transform: rotate(180deg); }
.agent-hero {
background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
border: 1px solid var(--border-color);
border-radius: 14px;
padding: 1.75rem;
box-shadow: var(--shadow);
display: flex;
flex-direction: column;
gap: 1.25rem;
margin-bottom: 1.25rem;
}
.agent-hero-top {
display: flex;
justify-content: space-between;
gap: 1.5rem;
flex-wrap: wrap;
align-items: flex-start;
}
.agent-hero-title-block { flex: 1 1 auto; min-width: 0; }
.agent-hero-eyebrow {
display: inline-block;
color: var(--text-secondary);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
margin-bottom: 0.35rem;
}
.agent-hero-title {
color: var(--secondary-color);
font-size: 1.8rem;
font-weight: 800;
line-height: 1.15;
margin: 0;
word-break: break-word;
}
.agent-hero-subtitle {
color: var(--text-secondary);
font-size: 0.9rem;
margin-top: 0.4rem;
line-height: 1.4;
word-break: break-all;
}
.agent-hero-subtitle a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px dashed var(--border-color); }
.agent-hero-subtitle a:hover { color: var(--secondary-color); border-bottom-color: var(--secondary-color); }
.agent-hero-meta { color: var(--text-secondary); font-size: 0.85rem; margin-top: 0.25rem; }
.agent-hero-score { font-size: 3rem; line-height: 1; font-weight: 800; text-align: right; }
.agent-hero-detail { color: var(--text-secondary); font-size: 0.85rem; text-align: right; margin-top: 0.25rem; }
.score-pass { color: var(--success-color); }
.score-warn { color: var(--warning-color); }
.score-fail { color: var(--danger-color); }
/* Tier summary tile cards (one per tier present in the run). */
.tier-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 0.85rem;
}
.tier-card {
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 1rem 1.1rem;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
gap: 0.45rem;
transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
cursor: pointer;
user-select: none;
}
.tier-card[role="button"]:focus { outline: none; }
.tier-card[role="button"]:focus-visible {
outline: 2px solid var(--secondary-color);
outline-offset: 2px;
}
.tier-card::before {
content: "";
position: absolute;
left: 0; top: 0; bottom: 0;
width: 4px;
background: var(--border-color);
}
.tier-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.tier-card.active {
border-color: var(--secondary-color);
box-shadow: 0 0 0 2px var(--secondary-color), var(--shadow);
}
.tier-card.active::before { width: 5px; background: var(--secondary-color); }
.tier-card.pass { background: linear-gradient(135deg, rgba(35, 134, 54, 0.08) 0%, var(--bg) 70%); }
.tier-card.pass::before { background: var(--success-color); }
.tier-card.fail { background: linear-gradient(135deg, rgba(218, 54, 51, 0.10) 0%, var(--bg) 70%); }
.tier-card.fail::before { background: var(--danger-color); }
.tier-card.warn { background: linear-gradient(135deg, rgba(187, 128, 9, 0.10) 0%, var(--bg) 70%); }
.tier-card.warn::before { background: var(--warning-color); }
.tier-card.skipped { opacity: 0.7; }
.tier-card.skipped::before { background: var(--text-secondary); }
.tier-card-head {
display: flex;
justify-content: space-between;
align-items: baseline;
gap: 0.5rem;
}
.tier-card-label {
font-size: 0.75rem;
font-weight: 700;
color: var(--text-secondary);
letter-spacing: 0.04em;
text-transform: uppercase;
}
.tier-card-verdict {
font-size: 0.75rem;
font-weight: 800;
padding: 0.15rem 0.55rem;
border-radius: 999px;
letter-spacing: 0.05em;
}
.tier-card.pass .tier-card-verdict { background: var(--success-color); color: white; }
.tier-card.fail .tier-card-verdict { background: var(--danger-color); color: white; }
.tier-card.warn .tier-card-verdict { background: var(--warning-color); color: white; }
.tier-card.skipped .tier-card-verdict { background: var(--bg-tertiary); color: var(--text-secondary); }
.tier-card-title {
font-size: 1.05rem;
font-weight: 700;
color: var(--dark-text);
margin: 0;
line-height: 1.2;
}
.tier-card-stats {
display: flex;
flex-wrap: wrap;
gap: 0.4rem 0.85rem;
font-size: 0.85rem;
color: var(--text-secondary);
margin-top: 0.15rem;
}
.tier-card-stats strong { color: var(--dark-text); font-weight: 700; }
.tier-card-links {
display: flex;
flex-wrap: wrap;
gap: 0.35rem;
margin-top: 0.2rem;
}
.tier-card-link {
display: inline-flex;
align-items: center;
gap: 0.3rem;
border: 1px solid var(--border-color);
border-radius: 6px;
background: var(--bg);
color: var(--secondary-color);
font-size: 0.74rem;
font-weight: 800;
padding: 0.22rem 0.5rem;
text-decoration: none;
}
.tier-card-link:hover { border-color: var(--secondary-color); background: var(--bg-secondary); }
.tier-card-jobs { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.2rem; width: 100%; }
.tier-card-job { display: flex; flex-direction: column; gap: 0.15rem; }
.tier-card-job-label { font-size: 0.72rem; font-weight: 700; color: var(--dark-text); }
.tier-card-sev {
display: flex;
flex-wrap: wrap;
gap: 0.3rem;
margin-top: 0.15rem;
}
.tier-card-sev-pill {
font-size: 0.7rem;
font-weight: 700;
padding: 0.1rem 0.45rem;
border-radius: 999px;
border: 1px solid var(--border-color);
background: var(--bg);
}
.tier-card-sev-pill.crit { color: var(--danger-color); border-color: var(--danger-color); }
.tier-card-sev-pill.high { color: #d29922; border-color: #d29922; }
.tier-card-sev-pill.med { color: var(--warning-color); border-color: var(--warning-color); }
.tier-card-sev-pill.low { color: var(--text-secondary); }
.chart-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 1.25rem;
margin: 1.25rem 0;
}
.chart-card {
background: var(--bg);
border: 1px solid var(--border-color);
border-radius: 10px;
padding: 1.25rem;
box-shadow: var(--shadow);
}
.chart-card h3 { font-size: 0.95rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.table-scroll { max-width: 100%; overflow-x: auto; margin: 1rem 0; border-radius: 10px; border: 1px solid var(--border-color); -webkit-overflow-scrolling: touch; }
.table-scroll .summary-table { margin: 0; }
.pass-at-k-table { min-width: 720px; }
.metric-bar-cell { display: flex; align-items: center; gap: 0.6rem; min-width: 120px; }
.metric-value { min-width: 2.5rem; font-weight: 700; }
.mini-bar { width: 76px; height: 7px; background: var(--bg-tertiary); border-radius: 999px; overflow: hidden; }
.mini-bar span { display: block; height: 100%; border-radius: 999px; }
@media (max-width: 720px) {
.agent-hero-score, .agent-hero-detail { text-align: left; }
.agent-hero-top { align-items: flex-start; }
.tier-cards { grid-template-columns: 1fr; }
}
</style>
<style>
.t3-subtabs { display:flex; gap:0.25rem; background:var(--bg); border-radius:10px; padding:0.25rem; margin-bottom:1.25rem; overflow-x:auto; border:1px solid var(--border-color); }
.t3-subtab { padding:0.65rem 1rem; cursor:pointer; border:none; background:transparent; color:var(--text-secondary); font-weight:600; font-size:0.9rem; border-radius:8px; white-space:nowrap; }
.t3-subtab:hover { background:var(--bg-secondary); color:var(--dark-text); }
.t3-subtab.active { color:var(--dark-text); background:var(--bg-secondary); box-shadow:var(--shadow); }
.t3-page { display:none; }
.t3-page.active { display:block; }
.t3-agent-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:1rem; margin-top:1rem; }
.t3-agent-card { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:1rem; border-top:3px solid var(--accent-color); box-shadow:var(--shadow); }
.t3-agent-name { font-weight:700; }
.t3-agent-score { font-size:1.75rem; font-weight:700; margin:0.25rem 0; }
.t3-mini-bar { height:7px; background:var(--bg-tertiary); border-radius:999px; overflow:hidden; margin-top:0.5rem; }
.t3-mini-bar > span { display:block; height:100%; background:var(--accent-color); }
.t3-finding-card { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:1rem; margin:0.5rem 0; box-shadow:var(--shadow); }
.t3-finding-card.ok { border-left:4px solid var(--success-color); }
.t3-finding-card.warning { border-left:4px solid var(--warning-color); }
.t3-finding-card.critical { border-left:4px solid var(--danger-color); }
.t3-checks { list-style:none; margin:0.6rem 0 0; padding:0; }
.t3-checks li { margin:0; padding:0.3rem 0; color:var(--text-secondary); font-size:0.85rem; border-bottom:1px solid var(--bg-tertiary); }
.t3-checks li:last-child { border-bottom:none; }
.t3-pill { display:inline-block; padding:0.15rem 0.5rem; border-radius:4px; font-size:0.7rem; font-weight:700; text-transform:uppercase; }
.t3-pill.ok, .t3-pill.pass { background:var(--badge-pass-bg); color:var(--badge-pass-tx); }
.t3-pill.warning, .t3-pill.warn, .t3-pill.neutral { background:var(--badge-warn-bg); color:var(--badge-warn-tx); }
.t3-pill.critical, .t3-pill.fail { background:var(--badge-fail-bg); color:var(--badge-fail-tx); }
.t3-pill.unavailable { background:var(--bg-tertiary); color:var(--text-secondary); }
.t3-collapsed { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:0.75rem 1rem; margin-top:1rem; box-shadow:var(--shadow); }
.t3-section { margin-top:1.5rem; }
.t3-pre { background:var(--bg); border:1px solid var(--border-color); border-radius:6px; padding:0.75rem; overflow:auto; font-size:0.78rem; max-height:280px; }
.t3-section h3 { margin-bottom:0.75rem; }
.t3-details { background:var(--bg); border:1px solid var(--border-color); border-radius:12px; box-shadow:var(--shadow); margin-top:1rem; overflow:hidden; }
.t3-details > summary { cursor:pointer; list-style:none; display:flex; justify-content:space-between; align-items:center; gap:0.75rem; padding:0.9rem 1rem; font-weight:800; color:var(--dark-text); }
.t3-details > summary::-webkit-details-marker { display:none; }
.t3-details > summary::after { content:'▼'; color:var(--text-secondary); font-size:0.9rem; font-weight:800; transition:transform 0.2s ease; }
.t3-details[open] > summary::after { content:'▲'; }
.t3-details-body { border-top:1px solid var(--border-color); padding:1rem; }
.t3-details-body > .t3-section:first-child { margin-top:0; }
/* INCOMPLETE plugin-run callout (organized summary of unresolved deps) */
.t3-incomplete-callout { background:linear-gradient(180deg, rgba(220,38,38,0.08), var(--bg)); border:1px solid var(--danger-color); border-left:5px solid var(--danger-color); border-radius:12px; padding:1rem 1.15rem; margin:0 0 1rem; box-shadow:var(--shadow); }
.t3-incomplete-head { display:flex; align-items:center; gap:0.6rem; margin-bottom:0.5rem; flex-wrap:wrap; }
.t3-incomplete-badge { background:var(--danger-color); color:#fff; font-weight:800; font-size:0.72rem; letter-spacing:0.06em; padding:0.22rem 0.6rem; border-radius:6px; }
.t3-incomplete-title { font-weight:800; color:var(--dark-text); }
.t3-incomplete-body { margin:0 0 0.8rem; color:var(--text-secondary); font-size:0.9rem; line-height:1.5; }
.t3-incomplete-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(118px, 1fr)); gap:0.55rem; margin-bottom:0.8rem; }
.t3-incomplete-grid > div { background:var(--bg); border:1px solid var(--border-color); border-radius:8px; padding:0.5rem 0.65rem; display:flex; flex-direction:column; gap:0.15rem; }
.t3-incomplete-num { font-size:1.35rem; font-weight:800; line-height:1; }
.t3-incomplete-num.ok { color:var(--success-color); }
.t3-incomplete-num.bad { color:var(--danger-color); }
.t3-incomplete-env { font-size:1rem; font-weight:800; color:var(--dark-text); font-family:monospace; }
.t3-incomplete-grid > div span:last-child { font-size:0.7rem; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.03em; }
.t3-incomplete-link { display:inline-block; font-weight:700; color:var(--danger-color); text-decoration:none; font-size:0.85rem; }
.t3-incomplete-link:hover { text-decoration:underline; }
.t3-dataset-card { border-left:4px solid var(--secondary-color); }
.t3-dataset-hero { background:var(--bg); border:1px solid var(--border-color); border-radius:12px; padding:1.25rem; box-shadow:var(--shadow); margin-bottom:1rem; }
.t3-dataset-hero h2 { margin:0; color:var(--secondary-color); font-size:1.3rem; }
.t3-dataset-list { display:grid; grid-template-columns:1fr; gap:1rem; }
.t3-ds-card { background:var(--bg); border:1px solid var(--border-color); border-left:4px solid var(--secondary-color); border-radius:12px; padding:1.1rem 1.2rem; box-shadow:var(--shadow); }
details.t3-ds-card { padding:0; overflow:hidden; }
details.t3-ds-card > summary { cursor:pointer; list-style:none; padding:1rem 1.2rem; display:flex; align-items:center; gap:0.75rem; }
details.t3-ds-card > summary::-webkit-details-marker { display:none; }
details.t3-ds-card > summary::after { content:'▼'; color:var(--text-secondary); font-size:0.9rem; font-weight:800; margin-left:auto; flex-shrink:0; }
details.t3-ds-card[open] > summary::after { content:'▲'; }
details.t3-ds-card > .t3-ds-body { border-top:1px solid var(--border-color); padding:0 1.2rem 1rem; }
.t3-ds-head { display:flex; align-items:center; justify-content:space-between; gap:0.75rem; flex-wrap:wrap; margin-bottom:0.85rem; }
.t3-ds-id { color:var(--secondary-color); font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-weight:800; font-size:1rem; }
.t3-ds-meta { display:flex; gap:0.5rem; flex-wrap:wrap; color:var(--text-secondary); font-size:0.8rem; }
.t3-ds-chip { background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:999px; padding:0.18rem 0.6rem; }
.t3-ds-field { margin:0.8rem 0; }
.t3-ds-label { display:block; color:var(--text-secondary); font-size:0.72rem; font-weight:800; letter-spacing:0.05em; text-transform:uppercase; margin-bottom:0.2rem; }
.t3-ds-value { font-size:0.92rem; line-height:1.55; white-space:pre-wrap; }
.t3-ds-gt { color:var(--text-secondary); font-style:italic; }
.t3-ds-behaviors { counter-reset:behavior; list-style:none; margin:0.45rem 0 0; padding:0; display:grid; gap:0.35rem; }
.t3-ds-behaviors li { counter-increment:behavior; display:grid; grid-template-columns:1.7rem 1fr; gap:0.5rem; align-items:start; color:var(--dark-text); font-size:0.87rem; line-height:1.45; }
.t3-ds-behaviors li::before { content:counter(behavior); display:inline-flex; align-items:center; justify-content:center; width:1.35rem; height:1.35rem; border-radius:999px; background:var(--bg-secondary); color:var(--secondary-color); font-weight:800; font-size:0.72rem; border:1px solid var(--border-color); }
.t3-conclusion { border-left:4px solid var(--warning-color); }
.t3-conclusion.pass { border-left-color:var(--success-color); }
.t3-conclusion.fail { border-left-color:var(--danger-color); }
.t3-agent-scorecards-row { display:grid; grid-template-columns:minmax(220px,0.85fr) repeat(2,minmax(260px,1fr)); gap:1.25rem; align-items:stretch; margin-top:0.75rem; }
.t3-agent-scorecard-list { display:grid; gap:1rem; align-content:start; }
.t3-overview-lead { background:linear-gradient(135deg,var(--bg),var(--bg-secondary)); border:1px solid var(--border-color); border-left:4px solid var(--secondary-color); border-radius:12px; padding:1rem 1.15rem; box-shadow:var(--shadow); color:var(--dark-text); line-height:1.55; margin:0 0 1rem; }
.t3-other-agent-notes { background:var(--bg); border:1px solid var(--border-color); border-left:4px solid var(--warning-color); border-radius:12px; padding:0.95rem 1.1rem; box-shadow:var(--shadow); margin:0 0 1rem; }
#tier3-viewer-delivery-warning { overflow-wrap:anywhere; }
.t3-other-agent-notes strong { color:var(--dark-text); }
.t3-other-agent-notes ul { margin:0.45rem 0 0; padding-left:1.15rem; color:var(--dark-text); display:grid; gap:0.25rem; }
.t3-other-agent-notes li { line-height:1.45; }
.t3-harbor-panel { background:var(--bg); border:1px solid var(--border-color); border-left:4px solid var(--secondary-color); border-radius:12px; padding:0.95rem 1.1rem; box-shadow:var(--shadow); margin:0 0 1rem; display:flex; gap:1rem; justify-content:space-between; align-items:center; flex-wrap:wrap; }
.t3-harbor-panel strong { color:var(--dark-text); }
.t3-harbor-panel p { color:var(--text-secondary); margin:0.2rem 0 0; font-size:0.85rem; line-height:1.45; }
.t3-harbor-actions { display:flex; gap:0.45rem; flex-wrap:wrap; }
.t3-harbor-link, .t3-evidence-link { display:inline-flex; align-items:center; gap:0.3rem; border:1px solid var(--border-color); border-radius:7px; background:var(--bg-secondary); color:var(--secondary-color); text-decoration:none; font-weight:800; }
.t3-harbor-link { padding:0.42rem 0.75rem; font-size:0.8rem; }
.t3-harbor-panel-multi { flex-direction:column; align-items:stretch; }
.t3-harbor-jobs { display:flex; flex-direction:column; gap:0.55rem; width:100%; }
.t3-harbor-job { display:flex; justify-content:space-between; align-items:center; gap:0.75rem; flex-wrap:wrap; }
.t3-harbor-job-label { color:var(--dark-text); font-weight:700; font-size:0.85rem; }
.t3-evidence-link { padding:0.22rem 0.55rem; font-size:0.76rem; margin-top:0.45rem; }
.t3-harbor-link:hover, .t3-evidence-link:hover { border-color:var(--secondary-color); background:var(--bg); color:var(--accent-color); }
.t3-next-steps { background:var(--bg); border:1px solid var(--border-color); border-radius:12px; padding:1rem 1.15rem; box-shadow:var(--shadow); margin:0 0 1rem; }
.t3-next-steps-head { display:flex; justify-content:space-between; gap:0.75rem; align-items:center; flex-wrap:wrap; margin-bottom:0.7rem; }
.t3-next-steps-head h3 { margin:0; color:var(--dark-text); font-size:1rem; }
.t3-next-steps-conclusion { margin:0 0 0.65rem; color:var(--dark-text); line-height:1.5; }
.t3-next-steps-list { margin:0; padding-left:1.15rem; color:var(--dark-text); display:grid; gap:0.35rem; }
.t3-link-btn { background:var(--secondary-color); border:1px solid var(--secondary-color); color:white; border-radius:7px; padding:0.38rem 0.75rem; font-size:0.78rem; font-weight:800; cursor:pointer; }
.t3-link-btn:hover { filter:brightness(0.95); }
.t3-agent-link { background:transparent; border:0; color:var(--secondary-color); font:inherit; font-weight:800; padding:0; cursor:pointer; text-decoration:underline; text-decoration-thickness:1px; text-underline-offset:2px; }
.t3-agent-link:hover { color:var(--accent-color); }
.t3-agent-deeplink { cursor:pointer; transition:transform 0.15s ease, border-color 0.15s ease; }
.t3-agent-deeplink:hover, .t3-agent-deeplink:focus { border-color:var(--secondary-color); transform:translateY(-1px); outline:none; }
/* Invisible scroll target inside each agent panel. ``scroll-margin-top``
keeps the anchor below the sticky Tier 3 sub-tab nav when jumped to. */
.t3-agent-anchor { display:block; width:0; height:0; overflow:hidden; scroll-margin-top:80px; }
@media(max-width:1100px){.t3-agent-scorecards-row{grid-template-columns:1fr}.t3-agent-scorecard-list{grid-template-columns:repeat(auto-fit,minmax(220px,1fr));}}
/* Sticky Tier 3 sub-tab nav */
.t3-subtabs { position:sticky; top:0; z-index:5; }
/* Score chip (reusable 0-1 score badge) */
.t3-score-chip { display:inline-flex; align-items:center; gap:0.35rem; padding:0.18rem 0.55rem; border-radius:6px; font-weight:700; font-size:0.85rem; font-variant-numeric:tabular-nums; border:1px solid transparent; }
.t3-score-chip.ok { background:var(--badge-pass-bg); color:var(--badge-pass-tx); }
.t3-score-chip.warn { background:var(--badge-warn-bg); color:var(--badge-warn-tx); }
.t3-score-chip.fail { background:var(--badge-fail-bg); color:var(--badge-fail-tx); }
.t3-score-chip.neutral { background:var(--bg-secondary); color:var(--text-secondary); border-color:var(--border-color); }
.t3-delta { font-weight:700; font-size:0.78rem; padding:0.1rem 0.4rem; border-radius:4px; font-variant-numeric:tabular-nums; }
.t3-delta.up { color:var(--success-color); background:rgba(34,197,94,0.12); }
.t3-delta.down { color:var(--danger-color); background:rgba(239,68,68,0.12); }
.t3-delta.flat { color:var(--text-secondary); background:var(--bg-tertiary); }
/* Agent tabs (horizontal pill bar inside Agent Details) */
.t3-agent-tabs { display:flex; gap:0.25rem; flex-wrap:wrap; padding:0.3rem; background:var(--bg-secondary); border-radius:10px; border:1px solid var(--border-color); margin-bottom:1rem; }
.t3-agent-tab-btn { background:transparent; border:none; color:var(--text-secondary); font-weight:700; font-size:0.88rem; padding:0.55rem 1rem; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; gap:0.5rem; white-space:nowrap; transition:background 0.15s, color 0.15s; }
.t3-agent-tab-btn:hover { color:var(--dark-text); background:var(--bg); }
.t3-agent-tab-btn .t3-tab-dot { width:0.6rem; height:0.6rem; border-radius:50%; background:var(--accent); display:inline-block; }
.t3-agent-tab-btn .t3-tab-score { font-size:0.75rem; font-weight:600; color:var(--text-secondary); padding-left:0.25rem; }
.t3-agent-tab-btn.active { background:var(--bg); color:var(--dark-text); box-shadow:var(--shadow); border-bottom:3px solid var(--accent); border-radius:8px 8px 4px 4px; }
.t3-agent-tab-btn.active .t3-tab-score { color:var(--dark-text); }
.t3-agent-panel { display:none; }
.t3-agent-panel.active { display:block; }
/* Agent KPI strip */
.t3-kpi-strip { display:grid; grid-template-columns:repeat(auto-fit, minmax(160px, 1fr)); gap:0.75rem; margin-bottom:1rem; }
.t3-kpi-card { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:0.85rem 1rem; box-shadow:var(--shadow); }
.t3-kpi-card .t3-kpi-label { font-size:0.7rem; font-weight:700; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.05em; }
.t3-kpi-card .t3-kpi-value { font-size:1.5rem; font-weight:800; line-height:1.2; margin-top:0.2rem; font-variant-numeric:tabular-nums; }
.t3-kpi-card .t3-kpi-sub { font-size:0.78rem; color:var(--text-secondary); margin-top:0.15rem; }
/* Dimension pill strip (compact horizontal mapping) */
.t3-dim-strip { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:0.5rem; margin:0.75rem 0 1rem; padding:0.75rem; background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:10px; }
.t3-dim-pill { background:var(--bg); border:1px solid var(--border-color); border-radius:8px; padding:0.55rem 0.75rem; display:flex; flex-direction:column; gap:0.15rem; }
.t3-dim-pill .t3-dim-name { font-size:0.72rem; font-weight:800; text-transform:uppercase; color:var(--text-secondary); letter-spacing:0.04em; }
.t3-dim-pill .t3-dim-score { font-size:1.1rem; font-weight:800; font-variant-numeric:tabular-nums; }
.t3-dim-pill .t3-dim-lift { font-size:0.72rem; font-weight:600; }
/* Vertical evaluator card stack */
.t3-eval-stack { display:flex; flex-direction:column; gap:0.85rem; }
.t3-eval-card { background:var(--bg); border:1px solid var(--border-color); border-radius:12px; padding:1rem 1.1rem; box-shadow:var(--shadow); border-left:4px solid var(--border-color); }
.t3-eval-card.ok { border-left-color:var(--success-color); }
.t3-eval-card.warn, .t3-eval-card.warning { border-left-color:var(--warning-color); }
.t3-eval-card.fail, .t3-eval-card.critical { border-left-color:var(--danger-color); }
.t3-eval-card.unavailable { border-left-color:var(--text-secondary); }
.t3-eval-head { display:grid; grid-template-columns:1fr auto auto; gap:1rem; align-items:center; }
@media(max-width:720px){.t3-eval-head{grid-template-columns:1fr;gap:0.5rem;}}
.t3-eval-title { font-weight:800; font-size:1rem; color:var(--dark-text); }
.t3-eval-desc { display:block; font-size:0.78rem; font-weight:500; color:var(--text-secondary); margin-top:0.15rem; }
.t3-eval-gauge { position:relative; width:64px; height:64px; flex-shrink:0; }
.t3-eval-gauge svg { width:100%; height:100%; transform:rotate(-90deg); }
.t3-eval-gauge .t3-gauge-track { fill:none; stroke:var(--bg-tertiary); stroke-width:8; }
.t3-eval-gauge .t3-gauge-arc { fill:none; stroke-width:8; stroke-linecap:round; transition:stroke-dashoffset 0.6s ease; }
.t3-eval-gauge .t3-gauge-text { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:0.9rem; font-variant-numeric:tabular-nums; }
.t3-eval-bars { margin-top:0.75rem; display:grid; grid-template-columns:80px 1fr auto; gap:0.5rem 0.75rem; align-items:center; font-size:0.82rem; }
.t3-eval-bars .t3-bar-label { color:var(--text-secondary); font-weight:600; }
.t3-eval-bars .t3-bar-track { height:8px; background:var(--bg-tertiary); border-radius:999px; overflow:hidden; position:relative; }
.t3-eval-bars .t3-bar-fill { height:100%; border-radius:999px; }
.t3-eval-bars .t3-bar-value { font-weight:700; font-variant-numeric:tabular-nums; min-width:2.5rem; text-align:right; }
.t3-eval-evidence { margin-top:0.85rem; }
.t3-eval-evidence > summary { cursor:pointer; list-style:none; color:var(--text-secondary); font-size:0.82rem; font-weight:600; padding:0.35rem 0; }
.t3-eval-evidence > summary::-webkit-details-marker { display:none; }
.t3-eval-evidence > summary::before { content:'▸'; display:inline-block; margin-right:0.4rem; transition:transform 0.15s ease; }
.t3-eval-evidence[open] > summary::before { transform:rotate(90deg); }
.t3-eval-evidence ul { list-style:none; margin:0.45rem 0 0; padding:0; display:grid; gap:0.3rem; }
.t3-eval-evidence li { display:grid; grid-template-columns:auto 1fr auto auto; gap:0.5rem; align-items:center; padding:0.35rem 0.55rem; background:var(--bg-secondary); border-radius:6px; font-size:0.82rem; }
.t3-eval-evidence li .t3-ev-id { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-weight:700; color:var(--secondary-color); }
.t3-eval-evidence li .t3-ev-count { font-size:0.7rem; color:var(--text-secondary); font-weight:700; padding:0.1rem 0.4rem; border-radius:4px; background:var(--bg-tertiary); }
.t3-eval-evidence li .t3-ev-notes { color:var(--text-secondary); font-size:0.78rem; }
.t3-eval-evidence li .t3-ev-detail { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:center; gap:0.5rem; }
.t3-eval-evidence li .t3-ev-detail .t3-evidence-link { margin-top:0; }
.t3-ev-excerpt { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:0.76rem; padding:0.15rem 0.4rem; border-radius:4px; background:var(--bg-tertiary); color:var(--text-secondary); overflow-wrap:anywhere; }
.t3-score-reason { border-bottom:1px dotted currentColor; cursor:help; }
/* Attempt Details: ACES-style chip table for per-case attempt scores */
.t3-attempt-list { display:flex; flex-wrap:wrap; gap:6px; min-width:180px; }
.t3-attempt-chip { display:inline-block; padding:3px 8px; border-radius:4px; font-size:0.76rem; font-weight:600; white-space:nowrap; font-variant-numeric:tabular-nums; }
a.t3-attempt-chip { text-decoration:none; }
a.t3-attempt-chip:hover { outline:1px solid currentColor; }
.t3-attempt-chip.pass { background:rgba(34,197,94,0.18); color:var(--success-color); }
.t3-attempt-chip.warn { background:rgba(234,179,8,0.18); color:var(--warning-color); }
.t3-attempt-chip.fail { background:rgba(239,68,68,0.18); color:var(--danger-color); }
.t3-attempt-chip.muted { background:var(--bg-secondary); color:var(--text-secondary); border:1px dashed var(--border-color); }
a.t3-attempt-case-link { color:inherit; text-decoration:underline; text-underline-offset:2px; }
a.t3-attempt-case-link:hover { color:var(--accent-color); }
/* Lift split-bar visual */
.t3-lift-row { display:grid; grid-template-columns:140px 1fr; gap:0.85rem; align-items:center; padding:0.45rem 0; border-bottom:1px dashed var(--border-color); }
.t3-lift-row:last-child { border-bottom:none; }
.t3-lift-row .t3-lift-label { font-size:0.82rem; color:var(--text-secondary); font-weight:600; }
.t3-lift-bar { position:relative; height:18px; background:var(--bg-tertiary); border-radius:999px; overflow:hidden; }
.t3-lift-bar .t3-lift-base { position:absolute; left:0; top:0; bottom:0; background:var(--text-secondary); opacity:0.45; }
.t3-lift-bar .t3-lift-with { position:absolute; left:0; top:0; bottom:0; }
.t3-lift-bar .t3-lift-with.up { background:var(--success-color); }
.t3-lift-bar .t3-lift-with.down { background:var(--danger-color); }
.t3-lift-bar .t3-lift-with.flat { background:var(--secondary-color); }
.t3-lift-bar .t3-lift-text { position:absolute; inset:0; display:flex; align-items:center; justify-content:flex-end; padding:0 0.6rem; font-size:0.72rem; font-weight:700; color:var(--dark-text); mix-blend-mode:plus-lighter; gap:0.4rem; }
.t3-lift-agent-block { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:0.6rem 0.9rem 0.85rem; margin-bottom:0.75rem; box-shadow:var(--shadow); }
.t3-lift-agent-block > h4 { display:flex; gap:0.5rem; align-items:center; margin:0 0 0.5rem; font-size:0.95rem; font-weight:800; }
.t3-lift-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:0.5rem 1.1rem; }
.t3-lift-case-block { padding:0.35rem 0; }
.t3-lift-case-id { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-weight:700; font-size:0.82rem; color:var(--secondary-color); margin-bottom:0.25rem; display:flex; flex-wrap:wrap; align-items:center; gap:0.45rem 0.75rem; }
.t3-lift-trial-links { display:flex; flex-wrap:wrap; gap:0.4rem; font-family:inherit; font-weight:700; }
.t3-lift-trial-links .t3-evidence-link { margin-top:0; }
/* Suggestions stacked cards & category chips */
.t3-sug-stack { display:flex; flex-direction:column; gap:0.7rem; }
.t3-sug-card { background:var(--bg); border:1px solid var(--border-color); border-radius:10px; padding:0.9rem 1rem; box-shadow:var(--shadow); border-left:4px solid var(--secondary-color); display:grid; grid-template-columns:auto 1fr auto; gap:0.75rem; align-items:start; }
.t3-sug-card.severity-pass { border-left-color:var(--success-color); }
.t3-sug-card.severity-warn { border-left-color:var(--warning-color); }
.t3-sug-card.severity-fail { border-left-color:var(--danger-color); }
.t3-sug-num { display:inline-flex; align-items:center; justify-content:center; width:1.7rem; height:1.7rem; border-radius:50%; background:var(--bg-secondary); border:1px solid var(--border-color); font-weight:800; font-size:0.78rem; color:var(--secondary-color); }
.t3-sug-body { font-size:0.92rem; line-height:1.55; color:var(--dark-text); }
.t3-sug-title { font-weight:800; color:var(--dark-text); display:flex; gap:0.55rem; align-items:center; flex-wrap:wrap; }
.t3-sug-cat { display:inline-block; padding:0.1rem 0.45rem; border-radius:4px; font-size:0.68rem; font-weight:800; text-transform:uppercase; letter-spacing:0.04em; background:var(--bg-secondary); color:var(--secondary-color); border:1px solid var(--border-color); }
.t3-sug-actions { display:flex; gap:0.35rem; }
.t3-copy-btn { background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:6px; padding:0.25rem 0.55rem; font-size:0.72rem; font-weight:700; color:var(--text-secondary); cursor:pointer; }
.t3-copy-btn:hover { color:var(--dark-text); background:var(--bg); }
.t3-copy-btn.copied { color:var(--success-color); border-color:var(--success-color); }
/* Provenance key-value grid */
.t3-prov-grid { display:grid; grid-template-columns:minmax(140px, 0.3fr) 1fr auto; gap:0.4rem 0.85rem; align-items:center; padding:0.25rem 0; }
.t3-prov-grid .t3-prov-label { font-weight:700; color:var(--dark-text); font-size:0.85rem; padding:0.4rem 0; }
.t3-prov-grid .t3-prov-value { font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:0.8rem; color:var(--text-secondary); background:var(--bg-secondary); padding:0.45rem 0.65rem; border-radius:6px; word-break:break-all; }
.t3-prov-grid .t3-prov-action { display:flex; gap:0.4rem; }
.t3-download-grid { display:flex; flex-wrap:wrap; gap:0.5rem; }
.t3-download-grid .t3-copy-btn { padding:0.4rem 0.85rem; font-size:0.78rem; }
/* Insight source tag (deterministic vs LLM) */
.t3-insight-source { display:inline-block; padding:0.05rem 0.4rem; border-radius:4px; font-size:0.65rem; font-weight:800; text-transform:uppercase; letter-spacing:0.04em; vertical-align:middle; margin-left:0.35rem; }
.insight-source-deterministic { background:var(--bg-secondary); color:var(--text-secondary); border:1px solid var(--border-color); }
.insight-source-llm { background:rgba(139,92,246,0.18); color:#8b5cf6; border:1px solid rgba(139,92,246,0.4); }
/* Reasoning column wraps at a comfortable width */
.t3-reasoning { font-size:0.85rem; color:var(--dark-text); max-width:520px; line-height:1.45; white-space:normal; }
.t3-reasoning-list { margin:0; padding-left:1.05rem; }
.t3-reasoning-list li { margin-bottom:0.2rem; }
.t3-reasoning-list li:last-child { margin-bottom:0; }
/* One-liner hint shown beneath a dimension name in tables */
.t3-dim-hint { color:var(--text-secondary); font-size:0.78rem; font-weight:400; margin-top:0.15rem; line-height:1.35; }
/* Reusable section hint paragraph used above several Tier 3 tables */
.t3-section-hint { color:var(--text-secondary); font-size:0.85rem; margin:0 0 0.75rem; }
/* Per-agent score+lift cell used in the consolidated dimension table */
.t3-mad-cell { display:flex; flex-direction:column; align-items:flex-start; gap:0.2rem; min-width:84px; }
.t3-mad-score-row { display:flex; align-items:center; gap:0.45rem; width:100%; }
.t3-mad-score { font-weight:700; font-variant-numeric:tabular-nums; }
.t3-mad-bar { flex:1; height:6px; min-width:48px; background:var(--bg-tertiary); border-radius:999px; overflow:hidden; }
.t3-mad-bar > span { display:block; height:100%; border-radius:999px; }
.t3-mad-lift { font-size:0.74rem; font-weight:700; font-variant-numeric:tabular-nums; }
/* Integration (plugin composition). Deliberately NOT table-shaped: it is a
2-arm ablation, not another dimension lift row, and the visual language
has to say so at a glance. */
.t3-details.t3-integration { border-left:4px solid #8b5cf6; }
.t3-integ-compare { display:flex; flex-wrap:wrap; align-items:stretch; gap:0.75rem; margin:0.25rem 0 0.25rem; }
.t3-integ-arm, .t3-integ-delta { flex:1 1 190px; background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:10px; padding:0.75rem 0.9rem; }
.t3-integ-delta { border-style:dashed; border-color:#8b5cf6; background:rgba(139,92,246,0.08); }
.t3-integ-arm-label { font-size:0.72rem; font-weight:800; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-secondary); }
.t3-integ-arm-score { font-size:1.7rem; font-weight:700; font-variant-numeric:tabular-nums; margin:0.15rem 0; color:var(--dark-text); }
.t3-integ-arm-note { font-size:0.76rem; color:var(--text-secondary); line-height:1.35; }
.t3-integ-vs { align-self:center; font-weight:800; color:var(--text-secondary); font-size:0.9rem; }
.t3-integ-callout { background:var(--bg-secondary); border:1px dashed var(--warning-color); border-radius:10px; padding:0.85rem 1rem; color:var(--dark-text); font-size:0.88rem; }
.t3-integ-callout-title { font-weight:700; color:var(--warning-color); }
.t3-integ-evidence { margin-top:0.85rem; padding-top:0.75rem; border-top:1px solid var(--border-color); }
.t3-integ-evidence-title { font-weight:700; font-size:0.85rem; margin-bottom:0.4rem; }
.t3-integ-chips { display:flex; flex-wrap:wrap; gap:0.4rem; }
.t3-integ-chip { background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:999px; padding:0.18rem 0.6rem; font-size:0.76rem; color:var(--text-secondary); }
.t3-integ-chip strong { color:var(--dark-text); }
.t3-integ-chip.good { border-color:var(--success-color); color:var(--success-color); }
.t3-integ-chip.bad { border-color:var(--warning-color); color:var(--warning-color); }
/* Tier summary chip strip on the global hero */
.agent-hero-tiers { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.65rem; }
.agent-hero-tier-chip { background:var(--bg-secondary); border:1px solid var(--border-color); border-radius:999px; padding:0.2rem 0.65rem; font-size:0.78rem; color:var(--text-secondary); }
.agent-hero-tier-chip strong { color:var(--dark-text); }
.agent-hero-tier-chip.pass strong { color:var(--success-color); }
.agent-hero-tier-chip.fail strong { color:var(--danger-color); }
.agent-hero-tier-chip.warn strong { color:var(--warning-color); }
/* Search/filter input */
.t3-filter-bar { display:flex; gap:0.5rem; align-items:center; margin:0 0 0.85rem; flex-wrap:wrap; }
.t3-filter-input { flex:1; min-width:220px; padding:0.5rem 0.75rem; border:1px solid var(--border-color); border-radius:8px; background:var(--bg); color:var(--dark-text); font-size:0.88rem; }
.t3-filter-input:focus { outline:none; border-color:var(--secondary-color); box-shadow:0 0 0 2px rgba(118,185,0,0.15); }
.t3-filter-count { font-size:0.78rem; color:var(--text-secondary); font-weight:600; }
/* Print-friendly */
@media print {
.t3-subtabs, .t3-agent-tabs, .t3-copy-btn, .t3-filter-bar { display:none !important; }
.t3-page, .t3-agent-panel { display:block !important; page-break-inside:avoid; }
.t3-eval-card, .t3-sug-card, .t3-kpi-card, .t3-pivot-wrap, .t3-lift-agent-block { page-break-inside:avoid; box-shadow:none; }
.t3-details { box-shadow:none; }
.t3-details > summary::after { display:none; }
.t3-eval-evidence { display:block; }
.t3-eval-evidence > summary { display:none; }
}
</style>
<style>{% include "report_ui.css.j2" %}</style>
<noscript><style>.dedup-subtab,.t3-page,.t3-agent-panel,.table-container,.tab-content,.results-view,.skill-content,.validator-content,.top-issues-content,.contributor-content{display:block!important;max-height:none!important;overflow:visible!important}.filter-group,.view-toggle-section,.report-searchbar,.header-controls{display:none!important}.table-container,.top-issues-content,.summary-table-container,.contributor-content{overflow-x:auto!important}</style></noscript>
</head>
<body>
{% set ci = ci_context | default({}, true) %}
<a class="skip-link" href="#report-workspace">Skip to report</a>
{% set has_tier3 = tier3 is defined and tier3 %}
{% set tier3_summary_data = (tier3.get('summary') or {}) if has_tier3 else {} %}
{% set tier3_provenance_data = (tier3.get('provenance') or {}) if has_tier3 else {} %}
{% set tier3_execution_status = (tier3.get('execution_status') or tier3_summary_data.get('execution_status')) if has_tier3 else none %}
{% 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 %}
{% set verdict_key = (tier3_verdict if tier3_verdict in ['pass', 'fail', 'neutral', 'inconclusive'] else 'incomplete') if report_scope == 'tier3' else {'passed': 'pass', 'failed': 'fail'}.get(presentation.command_status.value, 'incomplete') %}
{% set verdict_class = {'pass': 'pass', 'fail': 'fail'}.get(verdict_key, 'warn') %}
{% set verdict_label = (verdict_key | title) if report_scope == 'tier3' else presentation.command_label %}
{% set check_words = {'pass': 'Passed', 'fail': 'Failed', 'incomplete': 'Incomplete', 'skipped': 'Skipped', 'not_applicable': 'N/A'} %}
<header class="main-header">
<div class="header-content">
<div class="logo-section">
<div class="header-brand-row">
<p class="header-title">SkillEvaluator</p>
{% if version %}<span class="header-version" title="SkillEvaluator report renderer version">v{{ version }}</span>{% endif %}
</div>
<div class="header-subtitle-row"><p class="header-subtitle">NVIDIA Benchmark for Agent Skills Evaluation</p></div>
</div>
<div class="header-meta">
<div class="header-controls">
<label class="theme-control" for="report-theme">Theme <select id="report-theme" onchange="setReportTheme(this.value)"><option value="system">System</option><option value="light">Light</option><option value="dark">Dark</option></select></label>
{% if ci.get('canonical_json_url') %}<a class="export-btn" href="{{ ci.canonical_json_url }}" download="skillevaluator-report.json">↓ Download JSON</a>{% else %}
<button type="button" class="export-btn" onclick="exportJSON()" title="Export report as JSON">
<span aria-hidden="true">↓</span><span>Download JSON</span>
</button>{% endif %}
</div>
</div>
</div>
</header>
<main class="container" id="report-workspace" tabindex="-1">
{% if ci.get('report_index_url') %}<nav class="report-breadcrumb" aria-label="Breadcrumb"><a href="{{ ci.report_index_url }}">All skills</a> / <span aria-current="page">{{ content_label | default('Skill') }} report</span></nav>{% endif %}
{% set has_tier1 = tabs | selectattr('id', 'equalto', 'tier1') | list | length > 0 %}
{% set has_tier2 = tabs | selectattr('id', 'equalto', 'tier2') | list | length > 0 %}
{% set ui_t1 = tier1_execution_summary | default({}) %}
{% set ui_t1_pass = ui_t1.get('pass', tier1_summary.passed_count if has_tier1 else 0) %}
{% set ui_t1_na = ui_t1.get('not_applicable', 0) %}
{% set ui_t1_executed = ui_t1_pass + ui_t1.get('fail', tier1_summary.failed_count if has_tier1 else 0) + ui_t1.get('incomplete', 0) %}
{#-
Hero title: prefer the friendly ``skills/<name>`` label over the
full repo / filesystem path so reviewers can scan the report at a
glance. Falls back to Tier 3's stored skill_name (used by the
standalone ``agent-eval`` command), then ``target_display`` (which
collapses repository URLs to ``repo / skills/<name>``), then the raw
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 = 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 = presentation.coverage.text %}
{% set overview_coverage = namespace(known=true, scored=0, expected=0) %}
{% for arm in [presentation.coverage.with_skill, presentation.coverage.baseline] %}
{% if arm.status != 'skipped' %}
{% if arm.scored is none or arm.expected is none %}{% set overview_coverage.known = false %}
{% else %}{% set overview_coverage.scored = overview_coverage.scored + arm.scored %}{% set overview_coverage.expected = overview_coverage.expected + arm.expected %}{% endif %}
{% endif %}
{% endfor %}
{% set hero_metric_count = ((tier3.metric_ids or tier3.evaluators or {}) | length) if has_tier3 else 0 %}
<section class="agent-hero" aria-labelledby="report-title" data-verdict="{{ verdict_key }}">
<div class="agent-hero-top">
<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 {{ '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 %}
{#- In a folder scan this is the only sign that some skills were not reported. -#}
{% if has_tier1 or has_tier2 %}<p class="hero-skills">{{ content_label_plural }}: {{ passed_skills }} of {{ total_skills }} passed</p>{% endif %}
</div>
{#-
Right-side block: the Tier 3 verdict and score when Tier 3
ran, and publication eligibility for every report, kept
next to the verdict.
-#}
{% set publication_class = {'pass': 'pass', 'fail': 'fail'}.get(publication_status, 'warn') %}
<div class="hero-side">
{% if has_tier3 %}
{% set tier3_environment = (tier3.summary.environment if tier3.summary is defined and tier3.summary else None) or tier3.environment %}
{% set tier3_backend = (tier3.summary.execution_backend if tier3.summary is defined and tier3.summary else None) | tier3_backend_label %}
{% if tier3_is_skipped %}
<span class="verdict-chip warn">Tier 3 quality: {{ verdict_words['skipped'] }}</span>
<div class="agent-hero-detail">
<div><strong>Reason:</strong> {{ tier3_skip_message }}</div>
<div>Tier 3 is advisory and does not block required validation.</div>
</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.verdict_reason if tier3.budget and tier3.budget.not_run else tier3_status_reason }}</p>{% endif %}
{% if tier3.get('mode') == 'baseline_only' %}<p class="hero-reason">Baseline-only calibration; no skill lift measured.</p>{% endif %}
{% if completed_agent and completed_agent.needs_attention %}<p class="hero-reason">Completed-agent result; other execution failures need attention.</p>{% endif %}
{% 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></p>{% if publication_reasons %}<details class="publication-reasons"><summary>Eligibility reasons</summary><ul>{% for reason in publication_reasons %}<li>{{ reason }}</li>{% endfor %}</ul></details>{% endif %}
{% endif %}
</div>
</div>
{# Tiles retain populated tier summaries; presentation scope also exposes absent tiers truthfully. #}
{% set initial_tab = tabs[0].id if tabs else 'tier1' %}
{#- With one tier, the executive summary below carries the numbers. -#}
{% set single_tier = tabs | length < 2 and presentation.tiers.values() | selectattr('displayed') | list | length < 2 %}
{% macro absent_tier_tile(number, tier) %}
<div class="tier-card skipped" role="button" tabindex="0" data-target-tab="tier{{ number }}" aria-controls="tab-tier{{ number }}" aria-pressed="false"
data-report-tier-tile="true">
<div class="tier-card-head"><span class="tier-card-label">Tier {{ number }}</span><span class="tier-card-verdict">{{ tier.summary }}</span></div>
<p class="tier-card-title">{{ {1:'Security & Static Validation',2:'Deduplication',3:'Live Agent Evaluation'}[number] }}</p>
</div>
{% endmacro %}
<nav aria-label="Tier navigation" class="tier-cards{{ ' single-tier' if single_tier else '' }}{{ ' tier-line' if single_tier and has_tier1 else '' }}">
{% if has_tier1 %}
{% set t1_class = 'fail' if tier1_summary.failed_count else ('warn' if tier1_summary.incomplete_count else ('skipped' if tier1_summary.executed_count == 0 else 'pass')) %}
<div class="tier-card {{ t1_class }}{% if initial_tab == 'tier1' %} active{% endif %}"
role="button"
tabindex="0"
data-target-tab="tier1"
aria-controls="tab-tier1"
aria-pressed="{{ 'true' if initial_tab == 'tier1' else 'false' }}"
onclick="showTab('tier1')"
onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();showTab('tier1');}"
aria-label="Open Tier 1: Security and Static Validation"
title="Open Tier 1: Security and Static Validation">
<div class="tier-card-head">
<span class="tier-card-label">Tier 1</span>
{% if not single_tier %}<span class="tier-card-verdict">{{ 'N/A' if presentation.tiers[1].display_status == 'not_applicable' else verdict_words[{'pass': 'pass', 'fail': 'fail', 'warn': 'incomplete'}.get(t1_class, 'skipped')] }}</span>{% endif %}
</div>
<p class="tier-card-title">Security & Static Validation</p>
<div class="tier-card-stats">
{% if not single_tier %}
{% if tier1_summary.issue_count %}<span><strong>{{ tier1_summary.issue_count }}</strong> finding{{ 's' if tier1_summary.issue_count != 1 else '' }}</span>
{% elif ui_t1_executed %}<span><strong>{{ ui_t1_pass }}</strong> of {{ ui_t1_executed }} checks passed</span>
{% elif ui_t1_na %}<span><strong>{{ ui_t1_na }}</strong> not applicable</span>
{% else %}<span>No checks ran</span>{% endif %}
{% endif %}
{% if skillspector_versions %}<span class="tier-card-scanner-version" title="SkillSpector version that ran the Tier 1 security scan">SkillSpector <strong>v{{ skillspector_versions | join(', v') }}</strong></span>{% endif %}
</div>
</div>
{% elif presentation.tiers[1].displayed %}{{ absent_tier_tile(1, presentation.tiers[1]) }}
{% endif %}
{% if has_tier2 %}
{% set t2_class = 'fail' if tier2_summary.failed_count else ('warn' if tier2_summary.incomplete_count else ('skipped' if tier2_summary.executed_count == 0 else 'pass')) %}
<div class="tier-card {{ t2_class }}{% if initial_tab == 'tier2' %} active{% endif %}"
role="button"
tabindex="0"
data-target-tab="tier2"
aria-controls="tab-tier2"
aria-pressed="{{ 'true' if initial_tab == 'tier2' else 'false' }}"
onclick="showTab('tier2')"
onkeydown="if(event.key==='Enter'||event.key===' '){event.preventDefault();showTab('tier2');}"
aria-label="Open Tier 2: Deduplication"
title="Open Tier 2: Deduplication">
<div class="tier-card-head">
<span class="tier-card-label">Tier 2</span>
<span class="tier-card-verdict">{{ 'N/A' if presentation.tiers[2].display_status == 'not_applicable' else (advisory_fail_word if t2_class == 'fail' and 'tier2' in nonblocking_tiers else verdict_words[{'pass': 'pass', 'fail': 'fail', 'warn': 'incomplete'}.get(t2_class, 'skipped')]) }}</span>
</div>
<p class="tier-card-title">Deduplication</p>
<div class="tier-card-stats">
{% if tier2_summary.issue_count %}<span><strong>{{ tier2_summary.issue_count }}</strong> finding(s)</span>
{% elif tier2_summary.executed_count %}<span><strong>{{ tier2_summary.passed_count }}</strong> of {{ tier2_summary.executed_count }} checks passed</span>
{% elif tier2_summary.not_applicable_count %}<span><strong>{{ tier2_summary.not_applicable_count }}</strong> not applicable</span>
{% else %}<span>No checks ran</span>{% endif %}
</div>
</div>
{% elif presentation.tiers[2].displayed %}{{ absent_tier_tile(2, presentation.tiers[2]) }}
{% endif %}
{% if has_tier3 %}
{% set t3_tile_verdict = presentation.tiers[3].assessment_status or 'incomplete' %}
{% set tier3_display_verdict = verdict_words['skipped'] if tier3_is_skipped else (advisory_fail_word if t3_tile_verdict == 'fail' and 'tier3' in nonblocking_tiers else verdict_words[t3_tile_verdict if t3_tile_verdict in ['pass', 'fail', 'neutral'] else 'incomplete']) %}
{% set t3_class = 'fail' if t3_tile_verdict == 'fail' else ('skipped' if tier3_is_skipped else ('warn' if completed_agent and completed_agent.needs_attention else ('pass' if t3_tile_verdict == 'pass' else 'warn'))) %}
<div class="tier-card {{ t3_class }}{% if initial_tab == 'tier3' %} active{% endif %}"
role="button"
tabindex="0"
data-target-tab="tier3"
aria-controls="tab-tier3"
aria-pressed="{{ 'true' if initial_tab == 'tier3' else 'false' }}"
onclick="showTab('tier3')"
onkeydown="if(event.target===this&&(event.key==='Enter'||event.key===' ')){event.preventDefault();showTab('tier3');}"
aria-label="Open Tier 3: Live Agent Evaluation"
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>
</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 class="trial-coverage">{% if overview_coverage.known %}<strong>{{ overview_coverage.scored }}</strong> of {{ overview_coverage.expected }} attempts scored{% else %}{{ hero_trials }}{% endif %}</span>
{% endif %}
</div>
{% if harbor_jobs %}{{ harbor_job_actions(harbor_jobs, tile=true) }}{% endif %}
</div>
{% elif presentation.tiers[3].displayed %}{{ absent_tier_tile(3, presentation.tiers[3]) }}
{% endif %}
</nav>
</section>
<div id="report-evidence" class="workspace-heading" tabindex="-1"><h2>Findings & evidence</h2></div>
{% set workspace_tabs = [] %}
{% for number, tier in presentation.tiers.items() %}
{% set existing_tab = tabs | selectattr('id', 'equalto', 'tier' ~ number) | list %}
{% if existing_tab %}{% set _ = workspace_tabs.append(existing_tab[0]) %}
{% elif tier.displayed %}{% set _ = workspace_tabs.append({'id':'tier' ~ number,'label':'Tier ' ~ number,'empty':true,'number':number}) %}{% endif %}
{% endfor %}
{% for tab in workspace_tabs %}
<div id="tab-{{ tab.id }}" class="tab-content {{ 'active' if tab.id == initial_tab else '' }}" tabindex="-1" aria-label="{{ tab.label }}">
{% if tab.empty | default(false) %}
{{ render_plugin_evidence(plugin_evidence, tab.id) }}
<section class="tier-empty"><h2>{{ tab.label }} · {{ presentation.tiers[tab.number].summary }}</h2><p>No check evidence was recorded for this tier.</p></section>
{% elif tab.id == 'tier1' %}
{% set results = tier1_display_results %}
{% set skills = tier1_skills %}
{% set top_issues = tier1_top_issues %}
{% set contributors = tier1_contributors %}
{% set total_validators = ui_t1_executed %}
{% set passed_count = ui_t1_pass %}
{% set skipped_count = ui_t1.get('skipped', tier1_display_summary.skipped_count) %}
{% set failed_count = ui_t1.get('fail', tier1_display_summary.failed_count) %}
{% set incomplete_count = ui_t1.get('incomplete', 0) %}
{% set total_issues = tier1_display_summary.total_issues %}
{% set pass_percentage = ((ui_t1_pass * 100 / ui_t1_executed) | round(1)) if ui_t1_executed else 0 %}
{% set total_skills = tier1_display_summary.total_skills %}
{% set passed_skills = tier1_display_summary.passed_skills %}
{% set incomplete_skills = skills.values() | selectattr('status', 'defined') | selectattr('status', 'equalto', 'incomplete') | list | length %}
{% set failed_skills = [tier1_display_summary.failed_skills - incomplete_skills, 0] | max %}
{# ==================== EXECUTIVE SUMMARY ==================== #}
{% set t1_key = 'fail' if tier1_summary.failed_count else ('incomplete' if tier1_summary.incomplete_count else ('skipped' if tier1_summary.executed_count == 0 else 'pass')) %}
{% set t1_class = {'pass': 'pass', 'fail': 'fail'}.get(t1_key, 'warn') %}
{% set t1_all_checks = total_validators + ui_t1_na + (skipped_count or 0) %}
{% set qualities = skills.values() | selectattr('quality', 'defined') | map(attribute='quality') | selectattr('overall_score', 'defined') | list %}
<div class="dashboard tier1-statistics">
<div class="dashboard-card"><h3 class="dashboard-card-title">Validators Run</h3><p class="dashboard-card-value">{{ total_validators }}</p><p class="dashboard-card-subtitle">{{ skipped_count }} skipped · {{ ui_t1_na }} not applicable</p></div>
<div class="dashboard-card success"><h3 class="dashboard-card-title">Passed</h3><p class="dashboard-card-value">{{ passed_count }}</p><p class="dashboard-card-subtitle">{{ pass_percentage ~ '% success rate' if total_validators else 'No executed checks' }}</p></div>
<div class="dashboard-card{{ ' danger' if failed_count else '' }}"><h3 class="dashboard-card-title">Failed</h3><p class="dashboard-card-value">{{ failed_count }}</p><p class="dashboard-card-subtitle">{{ incomplete_count }} incomplete</p></div>
<div class="dashboard-card"><h3 class="dashboard-card-title">Findings</h3><p class="dashboard-card-value">{{ tier1_summary.issue_count or 0 }}</p><p class="dashboard-card-subtitle">{% set severity_separator = joiner(' · ') %}{% for level in ['critical', 'high', 'medium', 'low'] %}{% if tier1_summary[level] %}{{ severity_separator() }}{{ tier1_summary[level] }} {{ level }}{% endif %}{% endfor %}{% if not tier1_summary.issue_count %}None reported{% endif %}</p></div>
</div>
<details class="t3-details"><summary>Tier 1 result and next steps</summary>
<section class="exec-summary {{ t1_class }}" aria-labelledby="exec-summary-title">
<div class="exec-verdict">
<h2 id="exec-summary-title" class="exec-title"><span class="sr-only">Tier 1 result: </span><span class="verdict-chip {{ t1_class }}">{{ verdict_words[t1_key] }}</span></h2>
<p class="exec-reason">
{%- if t1_key == 'incomplete' -%}
A required scan did not finish{% if tier1_incomplete_scans %} ({{ tier1_incomplete_scans | join(', ') }}){% endif %}, so no pass is claimed.
{%- elif t1_key == 'fail' -%}
{{ failed_count }} of {{ total_validators }} checks failed: {{ tier1_failed_checks[:3] | join(', ') }}{% if tier1_failed_checks | length > 3 %} and {{ tier1_failed_checks | length - 3 }} more{% endif %}.{% if tier1_blocking_findings %} {{ tier1_blocking_findings }} critical or high finding{{ 's' if tier1_blocking_findings != 1 else '' }} in those checks block the verdict.{% endif %}
{%- elif t1_key == 'skipped' -%}
No Tier 1 check ran, so there is no result to report.
{%- else -%}
All {{ tier1_summary.executed_count }} checks that apply passed.{% if tier1_summary.issue_count %} {{ tier1_summary.issue_count }} advisory finding{{ 's do' if tier1_summary.issue_count != 1 else ' does' }} not block.{% endif %}
{%- endif -%}
{%- if tier1_incomplete_scans -%}
{%- if tier1_scanners_missing %} Install or enable the scanner and run the evaluation again.
{%- elif tier1_scan_stop %} {{ tier1_scan_stop }} Fix what stopped the scan and run the evaluation again.
{%- else %} Find out why the scan stopped and run the evaluation again.{% endif %}
{%- endif -%}
</p>
</div>
<dl class="kpis">
<div class="kpi">
<dt>Checks passed</dt>
<dd class="kpi-value"><strong>{{ passed_count }}</strong> of {{ total_validators }}</dd>
<dd class="kpi-sub">{{ total_validators }} of {{ t1_all_checks }} checks ran{% if ui_t1_na %}, {{ ui_t1_na }} not applicable{% endif %}{% if skipped_count %}, {{ skipped_count }} skipped{% endif %}{% if failed_count %}; {{ failed_count }} failed{% endif %}{% if incomplete_count %}; {{ incomplete_count }} incomplete{% endif %}</dd>
</div>
<div class="kpi">
<dt>Findings</dt>
<dd class="kpi-value"><strong>{{ tier1_summary.issue_count or 0 }}</strong></dd>
<dd class="kpi-sub sev-line">{% for level in ['critical', 'high', 'medium', 'low'] %}{% if tier1_summary[level] %}<span class="sev-item"><span class="sev-dot {{ level }}" aria-hidden="true"></span>{{ tier1_summary[level] }} {{ level }}</span> {% endif %}{% endfor %}{% if not tier1_summary.issue_count %}None reported{% endif %}</dd>
{% if tier1_summary.issue_detail %}<dd class="kpi-sub kpi-issue-detail">{{ tier1_summary.issue_detail }}</dd>{% endif %}
</div>
<div class="kpi">
<dt>Blocking critical + high</dt>
<dd class="kpi-value"><strong class="{{ 'score-fail' if tier1_blocking_findings else '' }}">{{ tier1_blocking_findings }}</strong></dd>
<dd class="kpi-sub">in checks that failed</dd>
</div>
<div class="kpi">
<dt>Quality</dt>
{% if qualities | length == 1 %}{% set q = qualities[0] %}
<dd class="kpi-value"><strong class="{{ 'score-fail' if quality_min_score is not none and q.overall_score < quality_min_score else '' }}">{{ q.overall_score | round(1) }}</strong> / 100{% if q.grade %} · grade {{ q.grade }}{% endif %}</dd>
<dd class="kpi-sub">{% if quality_min_score is not none %}Minimum {{ quality_min_score }} to pass{% else %}Content quality score{% endif %}</dd>
{% elif qualities %}
<dd class="kpi-value"><strong>{{ qualities | selectattr('overall_score', 'ge', quality_min_score if quality_min_score is not none else 0) | list | length }}</strong> of {{ qualities | length }}</dd>
<dd class="kpi-sub">{{ content_label_plural | lower }} meet {% if quality_min_score is not none %}the minimum of {{ quality_min_score }}{% else %}the quality bar{% endif %}</dd>
{% else %}
<dd class="kpi-value"><strong>—</strong></dd>
<dd class="kpi-sub">Not scored in this run</dd>
{% endif %}
</div>
</dl>
<p class="kpi-legend">A finding is one problem a check reports, with a severity from critical to low. The same problem reported on several lines or in several files or {{ content_label_plural | lower }} counts once; each location is an occurrence. Findings in a failed check block the verdict; findings in a passed check are advisory.</p>
{% if fix_first %}
<div class="fix-first">
<h3>{{ 'Worth a look' if t1_key == 'pass' else 'Fix first' }}</h3>
<ol>
{% for item in fix_first %}
<li>
<span class="severity-tag severity-{{ item.severity }}">{{ 'Incomplete' if item.kind == 'incomplete' else ('Failed' if item.kind == 'check' else item.severity | title) }}</span>
<a href="#{{ item.anchor }}" class="fix-link" onclick="return openFinding(this.getAttribute('href').slice(1))">{{ item.message | truncate(160) }}</a>
<span class="fix-meta">{{ item.check }}{% if skills | length > 1 %} · {{ item.skill }}{% endif %}{% if item.location %} · <code>{{ item.location }}</code>{% endif %}{% if not item.blocking %} · advisory{% endif %}</span>
</li>
{% endfor %}
</ol>
{% if tier1_summary.occurrence_count > fix_first | selectattr('kind', 'equalto', 'finding') | list | length %}<p class="fix-more">The other findings are listed under their checks below.</p>{% endif %}
</div>
{% endif %}
</section>
</details>
{# ==================== FINDING TYPES ==================== #}
{% if top_issues %}
<div class="top-issues-section {{ 'advisory-findings' if all_passed and not has_incomplete else '' }}">
<div class="top-issues-header" onclick="toggleTopIssues(this)">
<h3>{{ 'Advisory findings' if all_passed and not has_incomplete else 'Finding types' }} · {{ top_issues | length }}, most severe first</h3>
<span class="expand-text">▲</span>
</div>
<div class="top-issues-content active">
<table class="top-issues-table">
<thead>
<tr>
<th>Issue</th>
<th>Category</th>
<th>Severity</th>
<th>Total</th>
<th>{{ content_label_plural }} Affected</th>
</tr>
</thead>
<tbody>
{% for issue in top_issues[:10] %}
<tr data-severity="{{ issue.severity }}" data-affected-skills="{{ issue.skills_affected | join(',') }}" data-issue-key="{{ issue.issue_key }}" onclick="filterToAffectedSkills(this)" title="Click to jump to the first occurrence of this issue">
<td style="font-weight: 500;">{{ issue.message }}</td>
<td><span class="metadata-tag">{{ issue.category }}</span></td>
<td><span class="severity-tag severity-{{ issue.severity }}">{{ issue.severity | upper }}</span></td>
<td><span class="count-badge {{ 'medium-count' if issue.severity == 'medium' else '' }}{{ 'low-count' if issue.severity in ('low', 'info') else '' }}">{{ issue.total_count }}</span></td>
<td>
<div class="skills-pills">
{% for skill in issue.skills_affected[:5] %}
<span class="skill-pill-group">
<span class="skill-pill" data-skill-name="{{ skill }}" data-issue-key="{{ issue.issue_key }}" onclick="event.stopPropagation(); scrollToFinding(this.getAttribute('data-skill-name'), this.getAttribute('data-issue-key'))" title="Jump to this issue in {{ skill }}">{{ skill }}</span>
<span class="quality-pill" data-skill-name="{{ skill }}" onclick="event.stopPropagation(); scrollToQualityScore(this.getAttribute('data-skill-name'))" title="View quality score for {{ skill }}" aria-label="Quality score for {{ skill }}">Quality</span>
</span>
{% endfor %}
{% if issue.skills_affected | length > 5 %}
<span class="skill-pill">+{{ issue.skills_affected | length - 5 }} more</span>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if top_issues | length > 10 %}<p class="findings-overflow-note">Showing 10 of {{ top_issues | length }} finding types. Full evidence and suggested fixes are included below.</p>{% endif %}
</div>
</div>
{% endif %}
{% if skillspector_versions %}
<details class="t3-details">
<summary>Scanner provenance</summary>
<p>Recorded SkillSpector version{{ 's' if skillspector_versions | length != 1 else '' }}: {{ skillspector_versions | join(', ') }}</p>
</details>
{% endif %}
{# SkillSpector LLM provenance from --llm runs, validated by skillspector_provenance.py. #}
{% if skillspector_provenance %}
<div class="top-issues-section">
<div class="top-issues-header" onclick="toggleTopIssues(this)">
<h3>Tier 1 LLM Provenance</h3>
<span class="expand-text">▼</span>
</div>
<div class="top-issues-content">
<p style="margin: 0.75rem 1rem; color: var(--text-secondary); font-size: 0.85rem;">Provider, model, SkillSpector revision, and determinism evidence for the LLM security analysis.</p>
<table class="top-issues-table">
<thead>
<tr>
<th>Provider</th>
<th>Adapter</th>
<th>Analyzer</th>
<th>Model</th>
<th>Revision</th>
<th>Determinism</th>
</tr>
</thead>
<tbody>
{% for record in skillspector_provenance %}
{% set provenance = record.provenance %}
{% if provenance %}
{% for analyzer in provenance.analyzers %}
{% set source_revision = analyzer.analyzer_revision.source_revision %}
<tr>
<td>{{ record.provider_id or 'not recorded' }}</td>
<td>{{ provenance.provider.effective_adapter }}</td>
<td>{{ analyzer.analyzer_id }}</td>
<td><code>{{ analyzer.model }}</code></td>
<td><code>{{ analyzer.analyzer_revision.value }}</code>{% if source_revision and source_revision.value != 'unknown' %} <code>{{ source_revision.value[:12] }}</code>{% endif %}</td>
<td>{{ provenance.determinism.classification }} / {{ provenance.determinism.control_status }}</td>
</tr>
{% endfor %}
{% else %}
<tr>
<td>{{ record.provider_id or 'not recorded' }}</td>
<td colspan="5">No valid LLM provenance was recorded for this scan.</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<div class="report-searchbar">
<label for="report-search">Search evidence</label>
<input id="report-search" type="search" placeholder="Find a skill, check, or finding…" oninput="applyReportSearch()" autocomplete="off">
<button type="button" class="bulk-action-btn" onclick="resetReportFilters()">Reset filters</button>
<span id="report-search-count" role="status" aria-live="polite"></span>
</div>
<p id="report-no-matches" class="report-no-matches" hidden>No matching evidence. Try a different search or reset filters.</p>
<div class="view-toggle-section">
<span style="font-size: 0.875rem; color: var(--text-secondary); margin-right: 0.5rem;">View by:</span>
<button class="view-toggle-btn active" id="view-skill" onclick="switchView('skill')">By {{ content_label | lower }}</button>
<button class="view-toggle-btn" id="view-validator" onclick="switchView('validator')">By check</button>
</div>
{% for result in results if not result.passed %}
{% set reference_summary = result.metadata.get('skillspector_reference_summary') | skillspector_reference_summary %}
{% if reference_summary %}<p class="reference-analysis-summary" style="font-size: 0.875rem; color: var(--text-secondary);">{{ reference_summary }}</p>{% endif %}
{% endfor %}
{# ==================== SKILL-CENTRIC VIEW ==================== #}
<div id="results-by-skill" class="results-view active">
{% if skills %}
<div class="filter-group">
<button class="filter-btn active" id="skill-filter-all" onclick="filterSkills('all')">All {{ content_label_plural }}</button>
<button class="filter-btn success" id="skill-filter-pass" onclick="filterSkills('pass')">Passed</button>
<button class="filter-btn danger" id="skill-filter-fail" onclick="filterSkills('fail')">Changes required</button>
<button class="filter-btn" id="skill-filter-incomplete" onclick="filterSkills('incomplete')">Incomplete</button>
<button class="bulk-action-btn" onclick="toggleAllSkills(true)">Expand All</button>
<button class="bulk-action-btn" onclick="toggleAllSkills(false)">Collapse All</button>
<div class="severity-filter-group">
<span style="font-size: 0.75rem; color: var(--text-secondary);">Severity:</span>
<button class="severity-filter-btn active" id="sev-filter-all" onclick="filterSeverity('all')">All</button>
<button class="severity-filter-btn critical-btn" id="sev-filter-critical-high" onclick="filterSeverity('critical-high')">Critical+High</button>
<button class="severity-filter-btn" id="sev-filter-medium" onclick="filterSeverity('medium')">Medium</button>
<button class="severity-filter-btn" id="sev-filter-low" onclick="filterSeverity('low')">Low+Info</button>
</div>
</div>
<div class="skills-summary-bar"{% if total_skills < 2 %} hidden{% endif %}>
<div class="summary-item"><span>Total {{ content_label_plural }}:</span> <strong>{{ total_skills }}</strong></div>
<div class="summary-item pass"><span>Passed:</span> <strong>{{ passed_skills }}</strong></div>
<div class="summary-item fail"><span>Changes required:</span> <strong>{{ failed_skills }}</strong></div>
{% if incomplete_skills %}<div class="summary-item"><span>Incomplete:</span> <strong>{{ incomplete_skills }}</strong></div>{% endif %}
</div>
{# ==================== CONTRIBUTOR SUMMARY ==================== #}
{% if contributors and not (contributors | length == 1 and (contributors[0].author | lower) == 'unknown') %}
<div class="contributor-section">
<div class="contributor-header" onclick="toggleContributors(this)">
<h3>Contributor Summary ({{ contributors | length }} contributor{{ 's' if contributors | length != 1 else '' }})</h3>
<span class="expand-text">▲</span>
</div>
<div class="contributor-content active">
<table class="contributor-table">
<thead>
<tr>
<th>Contributor</th>
<th>Content Items</th>
<th>Passed</th>
<th>Not passed</th>
<th>Issues</th>
<th>Items</th>
</tr>
</thead>
<tbody>
{% for contrib in contributors %}
<tr>
<td style="font-weight: 500;">{{ contrib.author }}</td>
<td>{{ contrib.total_items }}</td>
<td><span class="status-badge pass" style="font-size: 0.75rem;">{{ contrib.passed_count }}</span></td>
<td>
{% if contrib.failed_count > 0 %}
<span class="status-badge fail" style="font-size: 0.75rem;">{{ contrib.failed_count }}</span>
{% else %}
<span style="color: var(--text-secondary);">0</span>
{% endif %}
</td>
<td>
{% if contrib.total_issues > 0 %}
<span class="count-badge">{{ contrib.total_issues }}</span>
{% else %}
<span style="color: var(--text-secondary);">0</span>
{% endif %}
</td>
<td>
<div class="contributor-items">
{% for item in contrib['items'][:8] %}
<span class="contributor-item-pill {{ 'pass' if item.passed else 'fail' }}" data-skill-name="{{ item.name }}" onclick="scrollToSkill(this.getAttribute('data-skill-name'))" title="{{ item.name }}: {{ 'Passed' if item.passed else 'Failed (' + item.issue_count|string + ' issues)' }}">{{ item.name }}</span>
{% endfor %}
{% if contrib['items'] | length > 8 %}
<span class="contributor-item-pill pass">+{{ contrib['items'] | length - 8 }} more</span>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
<div id="skill-filter-banner" class="skill-filter-banner">
<span id="skill-filter-banner-text">Showing skills affected by: ...</span>
<button class="clear-filter" onclick="clearSkillFilter()">Clear filter</button>
</div>
{% for skill_name, skill_data in skills.items() | sort %}
<div class="skill-card" data-skill-status="{{ skill_data.status | default('pass' if skill_data.passed else 'fail') }}" data-skill-name="{{ skill_name }}">
<div class="skill-header" role="button" tabindex="0" aria-expanded="{{ 'false' if skill_data.passed else 'true' }}" onclick="toggleSkill(this)">
<div class="skill-name">
<span class="status-dot {{ 'pass' if skill_data.passed else 'fail' }}"></span>
{{ skill_name }}
</div>
<div class="skill-checks-summary">
{% if skill_data.quality is defined and skill_data.quality.grade is defined %}
{% set qg = skill_data.quality.grade %}
{% set qs_val = skill_data.quality.overall_score %}
{% set gc = 'pass' if qg in ['A', 'B'] else ('warn' if qg == 'C' else 'fail') %}
<span class="status-badge {{ gc }}" title="Quality score out of 100{% if quality_min_score is not none %}, minimum {{ quality_min_score }} to pass{% endif %}">Quality {{ qs_val | round(1) }} / {{ qg }}</span>
{% endif %}
{% set skill_status = skill_data.status | default('pass' if skill_data.passed else 'fail') %}
<span class="status-badge {{ 'warn' if skill_status == 'incomplete' else skill_status }}">{{ verdict_words.get(skill_status, skill_status | title) }}</span>
<span style="color: var(--text-secondary);">{{ skill_data.validators | length }} checks</span>
{% if not skill_data.passed and skill_data.issue_count is defined and skill_data.issue_count > 0 %}
{% set skill_findings = skill_data.finding_count if skill_data.finding_count is defined else skill_data.issue_count %}
<span class="issue-count-badge">{{ skill_findings }} finding{{ 's' if skill_findings != 1 else '' }}</span>
{% endif %}
<span class="expand-text">{{ '▲' if not skill_data.passed else '▼' }}</span>
</div>
</div>
<div class="skill-content {{ 'active' if not skill_data.passed else '' }}">
{% if skill_data.quality is defined and skill_data.quality.dimensions is defined %}
<div class="quality-score-block" data-quality-skill-name="{{ skill_name }}" style="background: var(--bg-secondary); border-radius: 8px; padding: 1rem; margin-bottom: 1rem; border-left: 4px solid {% if skill_data.quality.grade in ['A','B'] %}var(--success-color){% elif skill_data.quality.grade == 'C' %}var(--warning-color){% else %}var(--danger-color){% endif %};">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem;">
<div>
<strong style="font-size: 1.1rem;">Quality score: {{ skill_data.quality.overall_score | round(1) }} / 100{% if quality_min_score is not none %}, minimum {{ quality_min_score }} to pass{% endif %}</strong>
<span style="margin-left: 0.5rem; padding: 2px 8px; border-radius: 4px; font-weight: bold; border: 1px solid currentColor; {% if skill_data.quality.grade in ['A','B'] %}color: var(--badge-pass-tx); background: var(--badge-pass-bg){% elif skill_data.quality.grade == 'C' %}color: var(--badge-warn-tx); background: var(--badge-warn-bg){% else %}color: var(--badge-fail-tx); background: var(--badge-fail-bg){% endif %};">{{ skill_data.quality.grade }}</span>
</div>
<span style="color: var(--text-secondary); font-size: 0.85rem;">Type: {{ skill_data.quality.skill_type }}</span>
</div>
<p class="quality-outcome-note">{% if quality_min_score is not none %}A score below {{ quality_min_score }} fails the Quality score check, which blocks the verdict. {% endif %}Grades: {{ quality_grade_legend }}.</p>
<table style="width: 100%; font-size: 0.85rem; border-collapse: collapse;">
<tr style="border-bottom: 1px solid var(--border-color);">
<th style="text-align: left; padding: 4px 8px;">Dimension</th>
<th style="text-align: right; padding: 4px 8px;">Score</th>
<th style="text-align: right; padding: 4px 8px;">Weight</th>
<th style="text-align: left; padding: 4px 8px; width: 50%;">Bar</th>
</tr>
{% for dname, ddata in skill_data.quality.dimensions.items() %}
<tr>
<td style="padding: 4px 8px; text-transform: capitalize;">{{ dname }}</td>
<td style="text-align: right; padding: 4px 8px; font-weight: bold; color: {% if ddata.score >= 80 %}var(--success-color){% elif ddata.score >= 60 %}var(--warning-color){% else %}var(--danger-color){% endif %};">{{ ddata.score | round(1) }}</td>
<td style="text-align: right; padding: 4px 8px; color: var(--text-secondary);">{{ (ddata.weight * 100) | round(0) }}%</td>
<td style="padding: 4px 8px;">
<div style="background: var(--border-color); border-radius: 4px; height: 8px; overflow: hidden;">
<div style="height: 100%; width: {{ ddata.score }}%; background: {% if ddata.score >= 80 %}var(--success-color){% elif ddata.score >= 60 %}var(--warning-color){% else %}var(--danger-color){% endif %}; border-radius: 4px;"></div>
</div>
</td>
</tr>
{% endfor %}
</table>
{% if skill_data.quality.metrics is defined %}
<div style="margin-top: 0.5rem; font-size: 0.8rem; color: var(--text-secondary);">
Est. tokens{% if skill_data.quality.metrics.estimate_method is defined %} ({{ skill_data.quality.metrics.estimate_method }}){% endif %}: {{ skill_data.quality.metrics.total_tokens }}
{% if skill_data.quality.metrics.recommended_max_tokens is defined %}
(recommended max: <{{ skill_data.quality.metrics.recommended_max_tokens }})
{% endif %}
{% if skill_data.quality.metrics.script_count %} | Scripts: {{ skill_data.quality.metrics.script_count }}{% endif %}
{% if skill_data.quality.metrics.has_examples %} | Examples: Yes{% endif %}
{% if skill_data.quality.metrics.has_error_handling %} | Error Handling: Yes{% endif %}
</div>
{% endif %}
</div>
{% endif %}
<div class="skill-checks-grid">
{% for validator_name, validator_data in skill_data.validators.items() | sort | sort(attribute='1.passed') %}
<details class="check-result" id="{{ check_anchors[skill_name][validator_name] }}"{% if not validator_data.passed %} open{% endif %}>
<summary class="check-header">
<span class="check-label">
<span class="check-name">{{ check_names.get(validator_name, validator_name) }}{% if validator_name in check_names %} <code class="check-id">{{ validator_name }}</code>{% endif %}</span>
{% if validator_data.description %}<span class="check-description">{{ validator_data.description }}</span>{% endif %}
</span>
{% set check_status = validator_data.status | default('pass' if validator_data.passed else 'fail') %}
<span class="status-badge {{ 'pass' if check_status == 'pass' else ('fail' if check_status == 'fail' else 'warn') }}">{{ check_words.get(check_status, check_status | title) }}</span>
</summary>
<div class="check-details">
{% if check_status == 'incomplete' %}<p class="incomplete-notice"><strong>Scan incomplete.</strong> {% if validator_data.incomplete_scans | default([]) %}Required scanner(s): {{ validator_data.incomplete_scans | join(', ') }}.{% endif %} The required evidence is unavailable.</p>{% endif %}
{#- Scanner diagnostics and gate failures always show and print. Lines that only
repeat a finding card below fold into the raw scanner output. -#}
{% set diagnostics = validator_data.additional_errors | default(validator_data.errors | default([])) %}
{% set diagnostic_warnings = validator_data.additional_warnings | default(validator_data.warnings | default([])) if check_status == 'incomplete' else [] %}
{% set finding_lines = (validator_data.errors | default([]) | reject('in', diagnostics) | list) + ((validator_data.warnings | default([]) | reject('in', diagnostic_warnings) | list) if check_status == 'incomplete' else []) %}
{% for line in diagnostics + diagnostic_warnings %}<p class="scan-diagnostic">{{ line }}</p>{% endfor %}
{% if finding_lines %}<details class="raw-output"><summary>Scanner output for the findings below ({{ finding_lines | length }} line{{ 's' if finding_lines | length != 1 else '' }})</summary>{% for line in finding_lines %}<p class="scan-diagnostic">{{ line }}</p>{% endfor %}</details>{% endif %}
{% if validator_data.passed %}
{% if validator_data.details %}
{% set detail = validator_data.details[0] %}
{% set checks = detail.metadata.checks if detail.metadata and detail.metadata.checks else [] %}
{% if checks %}
<div style="font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem;">
{{ checks | length }} check(s) passed:
</div>
<ul class="check-details-list">
{% for check in checks %}
<li class="check-detail-item">
<span class="detail-icon">{{ icons.checkmark | safe }}</span>
<span>{{ check.description if check.description else check.name }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<ul class="check-details-list">
{% for detail in validator_data.details %}
<li class="check-detail-item">
<span class="detail-icon">{{ icons.checkmark | safe }}</span>
<span>{% if detail.status | default('pass') == 'not_applicable' %}<strong>N/A · </strong>{% endif %}{{ detail.message }}</span>
</li>
{% endfor %}
</ul>
{% endif %}
{% else %}
<span style="color: var(--text-secondary); font-size: 0.8rem;">{{ 'Not applicable to this skill' if check_status == 'not_applicable' else ('Not executed' if check_status == 'skipped' else 'All checks passed') }}</span>
{% endif %}
{% if validator_data.findings %}
<div style="margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-color);">
<div style="font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.5rem;">{{ validator_data.findings | length }} advisory finding(s) — not blocking:</div>
{% for finding in validator_data.findings %}
{% set confidence = finding.confidence if finding.confidence is defined else 'high' %}
<div class="check-finding warning {{ 'low-confidence' if confidence == 'low' else '' }}" id="{{ finding_anchors[skill_name][validator_name][loop.index0] }}" data-finding-severity="{{ finding.severity }}" data-finding-confidence="{{ confidence }}" data-issue-key="{{ finding.issue_key | default('') }}">
<div class="finding-msg">
{{ finding.message }}
{% if finding.occurrences is defined and finding.occurrences > 1 %}
<span class="occurrence-badge">{{ finding.occurrences }} occurrences</span>
{% endif %}
</div>
<div class="finding-meta" style="margin-top: 0.375rem;">
{% if finding.file_path %}<span>{{ icons.file | safe }} {{ finding.file_path }}</span>{% endif %}
<span class="severity-tag severity-{{ finding.severity }}" style="margin-left: 0.5rem;">{{ finding.severity | upper }}</span>
</div>
{% if finding.suggestion %}<div class="finding-suggestion"><strong>Fix:</strong> {{ finding.suggestion }}</div>{% endif %}
{{ verification_detail(finding) }}
</div>
{% endfor %}
</div>
{% endif %}
{% else %}
{% if validator_data.findings %}
{% for finding in validator_data.findings %}
{% set confidence = finding.confidence if finding.confidence is defined else 'high' %}
<div class="check-finding {{ finding.severity }} {{ 'low-confidence' if confidence == 'low' else '' }}" id="{{ finding_anchors[skill_name][validator_name][loop.index0] }}" data-finding-severity="{{ finding.severity }}" data-finding-confidence="{{ confidence }}" data-issue-key="{{ finding.issue_key | default('') }}">
<div class="finding-msg">
{{ finding.message }}
{% if finding.occurrences is defined and finding.occurrences > 1 %}
<span class="occurrence-badge">{{ finding.occurrences }} occurrences</span>
{% endif %}
{% if confidence != 'high' %}
<span class="confidence-badge {{ confidence }}-conf">{{ confidence }} confidence</span>
{% endif %}
</div>
<div class="finding-meta" style="margin-top: 0.375rem;">
{% if finding.file_path %}<span>{{ icons.file | safe }} {{ finding.file_path }}</span>{% endif %}
{% if finding.occurrences is defined and finding.occurrences > 1 and finding.lines is defined and finding.lines %}
<span class="lines-list" style="margin-left: 0.5rem;">Lines: {{ finding.lines | join(', ') }}</span>
{% elif finding.line_number %}<span style="margin-left: 0.5rem;">Line {{ finding.line_number }}</span>
{% endif %}
<span class="severity-tag severity-{{ finding.severity }}" style="margin-left: 0.5rem;">{{ finding.severity | upper }}</span>
</div>
{% if finding.line_content %}<div class="code-snippet" style="margin: 0.5rem 0;">{{ finding.line_content | truncate(200) }}</div>{% endif %}
{% if finding.suggestion %}<div class="finding-suggestion {{ 'truncatable' if finding.suggestion | length > 150 else '' }}" {% if finding.suggestion | length > 150 %}onclick="this.classList.toggle('expanded')"{% endif %}><strong>Fix:</strong> {{ finding.suggestion }}</div>{% endif %}
{{ verification_detail(finding) }}
</div>
{% endfor %}
{% else %}
<span style="color: var(--danger-color); font-size: 0.8rem;">{{ 'Required scan did not complete. See the diagnostic above.' if check_status == 'incomplete' else 'Validation failed. Inspect the validator details for diagnostic evidence.' }}</span>
{% endif %}
{% endif %}
</div>
</details>
{% endfor %}
</div>
</div>
</div>
{% endfor %}
{% else %}
<p style="color: var(--text-secondary); padding: 1rem;">No skill-level results available. This may happen if validators don't report per-skill details.</p>
{% endif %}
</div>
{# ==================== VALIDATOR-CENTRIC VIEW (ORIGINAL) ==================== #}
<div id="results-by-validator" class="results-view">
<div class="filter-group">
<button class="filter-btn active" id="filter-all" onclick="filterValidators('all')">All checks</button>
<button class="filter-btn success" id="filter-pass" onclick="filterValidators('pass')">Passed</button>
<button class="filter-btn danger" id="filter-fail" onclick="filterValidators('fail')">Failed</button>
<button class="filter-btn" id="filter-incomplete" onclick="filterValidators('incomplete')">Incomplete</button>
</div>
<div class="table-section">
<button class="table-toggle active" onclick="toggleTable(this)">
<span>Validation Summary</span>
<span class="toggle-icon">▼</span>
</button>
<div class="table-container active">
<table class="summary-table">
<thead><tr><th>Validator</th><th>Status</th><th>Files Scanned</th><th>Checks Performed</th><th>Errors</th><th>Warnings</th></tr></thead>
<tbody>
{% for result in results %}
{% set result_is_skipped = result | cleanly_skipped %}
{% set result_execution_status = result | execution_status %}
<tr data-validator-index="{{ loop.index }}" onclick="scrollToValidator(Number(this.dataset.validatorIndex))" data-status="{{ result_execution_status }}">
<td class="name-col"><a class="validator-link" href="#validator-{{ loop.index }}">{{ check_names.get(result.validator_name, result.validator_name) }}</a>{% if result.validator_name in check_names %} <code class="check-id">{{ result.validator_name }}</code>{% endif %}</td>
<td><span class="status-badge {{ 'warn' if (result_execution_status in ['skipped', 'incomplete', 'not_applicable']) else ('pass' if result.passed else 'fail') }}">{{ check_words.get(result_execution_status, result_execution_status | title) }}</span></td>
<td>{{ result.summary.files_scanned }}</td>
<td>{{ result.summary.checks_performed }}</td>
<td class="{{ 'error-text' if result.summary.errors > 0 else '' }}">{{ result.summary.errors }}</td>
<td class="{{ 'warning-text' if result.summary.warnings > 0 else '' }}">{{ result.summary.warnings }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="section-header">Detailed Results</div>
{% for result in results %}
{% set result_is_skipped = result | cleanly_skipped %}
{% set result_execution_status = result | execution_status %}
<div class="validator-card" id="validator-{{ loop.index }}" data-status="{{ result_execution_status }}">
<button class="validator-collapsible {{ 'active' if (result_is_skipped or not result.passed) else '' }}" onclick="toggleValidator(this)">
<div class="collapsible-header">
<span class="status-indicator {{ 'warn' if (result_execution_status in ['skipped', 'incomplete', 'not_applicable']) else ('pass' if result.passed else 'fail') }}"></span>
<span>{{ check_names.get(result.validator_name, result.validator_name) }}{% if result.validator_name in check_names %} <code class="check-id">{{ result.validator_name }}</code>{% endif %}</span>
{% if result.validator_description %}<span style="opacity:0.6;font-weight:400;font-size:0.8rem;margin-left:0.25rem">— {{ result.validator_description }}</span>{% endif %}
</div>
<div style="display:flex;align-items:center;gap:0.75rem">
<span class="status-badge {{ 'warn' if (result_execution_status in ['skipped', 'incomplete', 'not_applicable']) else ('pass' if result.passed else 'fail') }}">{{ check_words.get(result_execution_status, result_execution_status | title) }}</span>
<span class="expand-text">{{ '▲ Collapse' if (result_is_skipped or not result.passed) else '▼ Expand' }}</span>
</div>
</button>
<div class="validator-content {{ 'active' if (result_is_skipped or not result.passed) else '' }}">
{% if result.summary.files_scanned > 0 or result.summary.checks_performed > 0 %}
<div class="validator-summary">
{% if result.summary.files_scanned > 0 %}<span class="summary-stat">{{ icons.file | safe }} {{ result.summary.files_scanned }} files scanned</span>{% endif %}
{% if result.summary.checks_performed > 0 %}<span class="summary-stat">{{ icons.checkmark | safe }} {{ result.summary.checks_performed }} checks performed</span>{% endif %}
{% if result.summary.errors > 0 %}<span class="summary-stat error">{{ result.summary.errors }} errors{% if result.summary.critical_count > 0 or result.summary.high_count > 0 %} ({% if result.summary.critical_count > 0 %}{{ result.summary.critical_count }} critical{% endif %}{% if result.summary.critical_count > 0 and result.summary.high_count > 0 %}, {% endif %}{% if result.summary.high_count > 0 %}{{ result.summary.high_count }} high{% endif %}){% endif %}</span>{% endif %}
{% if result.summary.warnings > 0 %}<span class="summary-stat warning">{{ result.summary.warnings }} warnings</span>{% endif %}
</div>
{% endif %}
{% if result.is_incomplete %}
<div class="suggestion" style="border-color:var(--warning-color);">
<strong>Incomplete scanner evidence:</strong> {{ result.incomplete_scans | join(', ') }} did not produce a trustworthy report. Restore the scanner and rerun validation before publication.
</div>
{% endif %}
{% if result_is_skipped %}
<div class="suggestion" style="border-color:var(--warning-color);">
<strong>Skip reason:</strong> {{ result | skip_reason }}
</div>
{% elif result.passed %}
<ul class="success-list">
{% if result.success_details %}{% for detail in result.success_details %}<li class="success-item">{{ icons.checkmark | safe }}<span>{{ detail.check_name }}: {{ detail.message }}{% if detail.metadata %} ({% for k, v in detail.metadata.items() %}{{ k }}={{ v }}{% if not loop.last %}, {% endif %}{% endfor %}){% endif %}</span></li>{% endfor %}
{% elif result.messages %}{% for msg in result.messages %}<li class="success-item">{{ icons.checkmark | safe }}<span>{{ msg }}</span></li>{% endfor %}
{% else %}<li class="success-item">{{ icons.checkmark | safe }}<span>All checks passed</span></li>{% endif %}
</ul>
{% if result.findings %}
<div style="margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border-color);">
<div style="font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem;">{{ result.findings | length }} advisory finding(s) — not blocking:</div>
<div class="findings-list">
{% for finding in result.findings %}
<div class="finding {{ finding.severity.value }}" style="opacity: 0.8;">
<div class="finding-header">
<span class="finding-message">{{ finding.message }}</span>
<span class="severity-tag severity-{{ finding.severity.value }}">{{ finding.severity.value | upper }}</span>
</div>
<div class="finding-meta">
<span>{{ icons.file | safe }} {{ finding.location }}</span>
<span>{{ icons.search | safe }} {{ finding.check_name }}</span>
</div>
{% if finding.suggestion %}<div class="suggestion"><strong>Suggestion:</strong> {{ finding.suggestion }}</div>{% endif %}
{{ verification_detail(finding) }}
</div>
{% endfor %}
</div>
</div>
{% endif %}
{% else %}
<div class="findings-list">
{% for error in result | additional_errors %}
<div class="finding high"><div class="finding-header"><span class="finding-message">{{ error }}</span></div></div>
{% endfor %}
{% if result.findings %}{% for finding in result.findings %}
<div class="finding {{ finding.severity.value }}">
<div class="finding-header">
<span class="finding-message">{{ finding.message }}</span>
<span class="severity-tag severity-{{ finding.severity.value }}">{{ finding.severity.value | upper }}</span>
</div>
<div class="finding-meta">
<span>{{ icons.file | safe }} {{ finding.location }}</span>
<span>{{ icons.search | safe }} {{ finding.check_name }}</span>
</div>
{% if finding.line_content %}<div class="code-snippet">{{ finding.line_content | truncate(200) }}</div>{% endif %}
{% if finding.suggestion %}<div class="suggestion"><strong>Suggestion:</strong> {{ finding.suggestion }}</div>{% endif %}
{{ verification_detail(finding) }}
</div>
{% endfor %}{% endif %}
</div>
{% endif %}
</div>
</div>
{% endfor %}
</div>{# End of results-by-validator #}
{{ render_plugin_evidence(plugin_evidence, 'tier1') }}
{% elif tab.id == 'tier2' %}
{# ==================== TIER 2: SEMANTIC OVERLAP ==================== #}
<div class="dashboard">
<div class="dashboard-card">
<h3 class="dashboard-card-title">Reported checks</h3>
<p class="dashboard-card-value">{{ tier2_results | length }}</p>
<p class="dashboard-card-subtitle">Intra-Skill + Inter-Skill</p>
</div>
<div class="dashboard-card{{ ' danger' if tier2_summary.issue_count else '' }}">
<h3 class="dashboard-card-title">Findings</h3>
<p class="dashboard-card-value">{{ tier2_summary.issue_count }}</p>
<p class="dashboard-card-subtitle">Recorded Tier 2 findings; completion and scope are shown below.</p>
</div>
</div>
<div class="nav-tabs tier2-subtabs" style="margin-top:1rem;" role="tablist" aria-label="Tier 2 comparison scopes">
<button class="nav-tab active" id="dedup-tab-intra" type="button" role="tab" aria-controls="dedup-intra" aria-selected="true" tabindex="0" onclick="showDedupTab('intra')">Intra-Skill</button>
<button class="nav-tab" id="dedup-tab-inter" type="button" role="tab" aria-controls="dedup-inter" aria-selected="false" tabindex="-1" onclick="showDedupTab('inter')">Inter-Skill</button>
{% if tier2_scopes | selectattr('id', 'equalto', 'other') | list %}<button class="nav-tab" id="dedup-tab-other" type="button" role="tab" aria-controls="dedup-other" aria-selected="false" tabindex="-1" onclick="showDedupTab('other')">Other checks</button>{% endif %}
</div>
{% for scope in tier2_scopes %}
{% set dedup_id = {'within':'intra','across':'inter'}.get(scope.id, 'other') %}
<div id="dedup-{{ dedup_id }}" class="dedup-subtab" style="display:{{ 'block' if loop.first else 'none' }};" role="tabpanel" aria-labelledby="dedup-tab-{{ dedup_id }}" tabindex="0">
<section id="tier2-{{ scope.id }}" aria-labelledby="tier2-{{ scope.id }}-title">
<h2 id="tier2-{{ scope.id }}-title">{{ scope.label }}</h2>
<p>{{ 'Redundant content among files in the evaluated skill.' if scope.id == 'within' else 'Semantic overlap with catalog entries or among a collection of skills.' }}</p>
{% if not scope.not_run %}
<dl class="tier2-scope-summary">
{% for label, value in [('Checks completed', scope.completed), ('Duplicate findings' if scope.id == 'within' else 'Similarity matches', scope.duplicates), ('Affected files' if scope.id == 'within' else 'Affected skills', scope.affected), ('Catalog entries compared', scope.catalog_entries)] %}
<div><dt>{{ label }}</dt><dd>{{ 'Not applicable' if label == 'Catalog entries compared' and scope.catalog_not_applicable else (value if value is not none else 'Unavailable') }}</dd></div>
{% endfor %}
</dl>
{% endif %}
{% for note in scope.notes %}<p class="t3-section-hint">{{ note }}</p>{% endfor %}
{% for skip in scope.skips %}
<div class="tier2-skip-notice">
<strong>Skip reason:</strong> {{ skip.reason }}
<div class="t3-dim-hint">Checks: {% for result in skip.results %}{{ result.validator_name }}{% if not loop.last %}, {% endif %}{% endfor %}</div>
</div>
{% endfor %}
{% for result in scope.results %}
{% set execution_errors = result | additional_errors %}
{% if execution_errors %}
<div style="background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1rem;margin:0.75rem 0;">
<strong>{{ 'Execution errors' if result.is_incomplete else 'Errors' }}</strong>
<ul style="margin:0.5rem 0 0;padding-left:1.25rem;">
{% for error in execution_errors %}<li style="white-space:pre-line;">{{ error }}</li>{% endfor %}
</ul>
</div>
{% endif %}
{% if result | cleanly_skipped %}
{# Scope-level notices retain every affected check once. #}
{% elif result.is_incomplete %}
<div style="background:var(--bg-secondary);border:1px solid var(--warning-color);border-radius:8px;padding:1rem;margin:0.75rem 0;">
<strong style="color:var(--warning-color);">Incomplete scanner evidence:</strong>
{{ result.incomplete_scans | join(', ') }} did not produce trustworthy evidence. Restore the scanner and rerun validation.
</div>
{% elif result.passed and not result.findings and scope.completed == scope.results | length %}
<div style="background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:1rem;margin:0.75rem 0;">
{{ icons.checkmark | safe }} <strong style="color:var(--success-color);">No semantic overlaps detected.</strong>
{% if result.success_details %}
<ul style="margin:0.5rem 0 0;padding-left:1.25rem;font-size:0.85rem;color:var(--text-secondary);">
{% for d in result.success_details %}<li>{{ d.message }}</li>{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% for finding in result.findings %}
{% set sev = finding.severity.value if finding.severity.value is defined else finding.severity %}
{% set is_high = sev in ['critical', 'high'] %}
<details class="dedup-finding {{ 'dedup-finding-high' if is_high else 'dedup-finding-medium' }}" style="border-radius:8px;margin:0.75rem 0;"{% if is_high %} open{% endif %}>
<summary style="padding:1rem;cursor:pointer;display:flex;align-items:center;gap:0.5rem;">
<span class="severity-tag severity-{{ sev }}" style="font-size:0.7rem;padding:2px 8px;border-radius:4px;">{{ sev | upper }}</span>
<strong style="font-size:0.95rem;">{{ finding.category }}</strong>
{% if finding.file_path %}<span style="font-size:0.8rem;color:var(--text-secondary);margin-left:auto;margin-right:0.5rem;">{{ finding.file_path }}{% if finding.line_number %}:{{ finding.line_number }}{% endif %}</span>{% endif %}
<span class="toggle-icon">▼</span>
</summary>
<div style="padding:0 1rem 1rem;">
<div style="font-size:0.9rem;line-height:1.5;white-space:pre-line;">{{ finding.message }}</div>
{% set related_paths = finding | related_paths %}
{% if related_paths %}
<div class="finding-meta"><span>{{ icons.file | safe }} Related paths: {{ related_paths | join(' <-> ') }}</span></div>
{% endif %}
{% if finding.suggestion %}
<div class="dedup-recommendation">
<strong style="color:var(--secondary-color);font-size:0.85rem;">Recommendation</strong>
<p style="margin:0.25rem 0 0;font-size:0.85rem;line-height:1.5;">{{ finding.suggestion }}</p>
</div>
{% endif %}
</div>
</details>
{% endfor %}
{% endfor %}
</section>
</div>
{% endfor %}
{{ render_plugin_evidence(plugin_evidence, 'tier2') }}
{% elif tab.id == 'tier3' %}
{# ==================== TIER 3: AGENT EVALUATION (dimensions-first, schema v2.0) ==================== #}
{% if tier3 %}
{# Helpers / locals used across the Tier 3 sub-tabs #}
{% set t3_summary = tier3.summary or {} %}
{% if tier3.baseline_description %}<p>{{ tier3.baseline_description }}</p>{% endif %}
{% for line in tier3.prior_version_lines | default([]) %}<p>{{ line }}</p>{% endfor %}
{% set t3_agents = tier3.agents or {} %}
{% macro tier3_chart(id, title, description, reference, reference_label, height) %}
<h3>{{ title }}</h3>
<p class="chart-description" id="{{ id }}-description">{{ description }} <a href="#{{ reference }}" onclick="return openTier3Reference(this.getAttribute('href').slice(1))">{{ reference_label }}</a>.</p>
<canvas id="{{ id }}" height="{{ height }}" role="img" aria-label="{{ title }}" aria-describedby="{{ id }}-description" hidden></canvas>
<p class="chart-fallback" id="{{ id }}-fallback" role="status">Chart unavailable. Use the data link above to read the results.</p>
{% endmacro %}
{% set t3_best_name = tier3.best_agent or t3_summary.best_agent %}
{% set t3_best = t3_agents[t3_best_name] if t3_best_name and t3_agents[t3_best_name] is defined else None %}
{% set t3_dim_ids = ["security", "correctness", "discoverability", "effectiveness", "efficiency"] %}
{% set t3_metric_ids = tier3.metric_ids or (tier3.evaluators or {}).keys() | list or ["security", "skill_execution", "skill_efficiency", "accuracy", "goal_accuracy", "behavior_check"] %}
{% set t3_metric_labels = tier3.metric_labels or {} %}
{% set t3_dim_hints = tier3.dimension_hints or {} %}
{% set t3_attempt_policy = tier3.attempt_policy or {} %}
{% set t3_max_attempts = (t3_attempt_policy.max_attempts or 1) | int %}
{% set t3_dataset = tier3.dataset or [] %}
{% set t3_provenance = tier3.provenance or {} %}
{% set t3_budget = tier3.budget or {} %}
{% set t3_source_errors = t3_provenance.get('source_validation') or [] %}
{% set t3_harbor = tier3.get('harbor_viewer') or t3_summary.get('harbor_viewer') or {} %}
{% set t3_harbor_job_url = t3_harbor.get('job_url') %}
{% set t3_harbor_analysis_url = t3_harbor.get('analysis_url') %}
{% 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 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}) %}
{% endfor %}
<nav class="t3-subtabs" role="tablist" aria-label="Live evaluation views">
<button class="t3-subtab active" data-tier3-tab="overview" role="tab" id="tier3-tab-overview" aria-controls="tier3-page-overview" aria-selected="true" tabindex="0" onclick="showTier3SubTab('overview', this)">Overview</button>
<button class="t3-subtab" data-tier3-tab="suggestions" role="tab" id="tier3-tab-suggestions" aria-controls="tier3-page-suggestions" aria-selected="false" tabindex="-1" onclick="showTier3SubTab('suggestions', this)">Insights</button>
<button class="t3-subtab" data-tier3-tab="agents" role="tab" id="tier3-tab-agents" aria-controls="tier3-page-agents" aria-selected="false" tabindex="-1" onclick="showTier3SubTab('agents', this)">Agent Details</button>
<button class="t3-subtab" data-tier3-tab="trials" role="tab" id="tier3-tab-trials" aria-controls="tier3-page-trials" aria-selected="false" tabindex="-1" onclick="showTier3SubTab('trials', this)">Trials</button>
<button class="t3-subtab" data-tier3-tab="dataset" role="tab" id="tier3-tab-dataset" aria-controls="tier3-page-dataset" aria-selected="false" tabindex="-1" onclick="showTier3SubTab('dataset', this)">Dataset</button>
<button class="t3-subtab" data-tier3-tab="provenance" role="tab" id="tier3-tab-provenance" aria-controls="tier3-page-provenance" aria-selected="false" tabindex="-1" onclick="showTier3SubTab('provenance', this)">Diagnostics</button>
</nav>
{% if tier3_truncation or tier3_preview_notice %}
<div class="t3-truncation-notice" role="status">
<strong>Embedded report details were bounded.</strong>
{% if tier3_truncation %}
<span>The canonical payload omits bounded diagnostic details; retained Harbor artifacts remain available from the run directory.</span>
{% endif %}
{% if tier3_preview_notice %}
<span>
{# Subscript lookups: ``notice.items`` would resolve to the dict method. #}
{% set t3_preview_omitted = [] %}
{% if tier3_preview_notice.get('characters') %}{% set _ = t3_preview_omitted.append(tier3_preview_notice['characters'] ~ ' characters') %}{% endif %}
{% if tier3_preview_notice.get('items') %}{% set _ = t3_preview_omitted.append(tier3_preview_notice['items'] ~ ' items') %}{% endif %}
{% if t3_preview_omitted %}HTML preview omitted {{ t3_preview_omitted | join(' and ') }}.{% endif %}
{% if tier3_preview_notice.failure_reasons %}
HTML preview left out {{ tier3_preview_notice.failure_reasons }} failure reason{{ 's' if tier3_preview_notice.failure_reasons != 1 else '' }} or excerpt{{ 's' if tier3_preview_notice.failure_reasons != 1 else '' }} to keep the overview complete.
{% endif %}
{% if tier3_preview_notice.case_diagnostics %}
Expectation diagnostics for {{ tier3_preview_notice.case_diagnostics }} case(s) were omitted from the HTML preview; use JSON Downloads for the retained inventory.
{% endif %}
JSON Downloads preserve the complete bounded canonical payload.
</span>
{% endif %}
{% if tier3_truncation.omitted %}
<ul>
{% for section, count in tier3_truncation.omitted.items() %}
<li>{{ section | replace('_', ' ') }} omitted: {{ count }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% set t3_coverage_messages = (tier3.coverage_notices or []) | selectattr('message', 'string') | map(attribute='message') | select | list %}
{# ---------- Overview ---------- #}
<section class="t3-page active" id="tier3-page-overview" role="tabpanel" aria-labelledby="tier3-tab-overview" tabindex="0">
{{ render_native_warnings(native_evidence) }}
{% set t3_effect = (insights_view.conclusions or []) | selectattr('title', 'equalto', 'Skill effect') | first %}
{# Set when the lead itself says that other failures need attention. #}
{% set t3_lead_needs_attention = false %}
<div class="t3-overview-lead" id="tier3-overview-summary" role="status">
<div class="t3-summary-line">
<span class="t3-summary-status">
{% if tier3_is_skipped %}<strong>Live evaluation skipped:</strong> {{ tier3_skip_message }}
{% elif tier3_verdict == 'inconclusive' %}<strong>Inconclusive: skill never activated.</strong> Scores are diagnostic only; no lift verdict was computed.
{% elif tier3.get('mode') == 'baseline_only' %}<strong>Baseline-only calibration:</strong> No with-skill arm; no skill lift measured.
{% elif completed_agent and completed_agent.needs_attention %}
<strong>Completed-agent result: {{ completed_agent.verdict | upper }}.</strong> Other execution failures need attention; not a whole-run or publication PASS.
{% else %}<strong>Live quality: {{ advisory_fail_word if tier3_advisory_fail else (verdict_words.get(tier3_verdict) or tier3_verdict | title) }}.</strong>{% endif %}
</span><a class="trial-coverage" href="#tier3-page-agents">Coverage: {% if overview_coverage.known %}{{ overview_coverage.scored }} of {{ overview_coverage.expected }} scored{% if overview_coverage.expected > overview_coverage.scored %} · {{ overview_coverage.expected - overview_coverage.scored }} unscored{% endif %}{% else %}{{ hero_trials }}{% endif %}</a>
{% if t3_coverage_messages %}<a href="#tier3-coverage-notices">Coverage details</a>{% endif %}
</div>
{% if hero_score is none %}<p id="tier3-quality-unavailable">Quality measurements unavailable.{% if t3_best_name %} Recorded best agent: {{ t3_best_name }}; review scoped evidence in Agent Details.{% endif %}</p>{% endif %}
{% for tolerated in tolerated_baselines or [] %}
<span class="tolerated-baseline">Baseline incomplete for <strong>{{ tolerated.name }}</strong>{% if tolerated.scored_attempts is not none and tolerated.expected_attempts is not none %} ({{ tolerated.scored_attempts }} of {{ tolerated.expected_attempts }} attempts scored){% endif %}: baseline timeouts were tolerated by <code>--tolerate-baseline-timeouts</code>; baseline and uplift unavailable.</span>
{% endfor %}
<div class="t3-summary-action" id="tier3-next-steps-preview">
{% set primary_step = (insights_view.next_steps or []) | first %}
{% set primary_recommendation = (insights_view.recommendations or []) | first %}
{% if insights_view.execution_errors and primary_step and primary_step.target != 'evaluation' %}<p><strong>Next action:</strong> Resolve the recorded execution errors before changing the skill or dataset, then rerun the affected attempts.</p>
{% elif primary_step or primary_recommendation %}<p><strong>Next action:</strong> {{ primary_step.action if primary_step else (primary_recommendation.title or primary_recommendation.message) }}</p>{% endif %}
<div class="t3-summary-links"><a href="#tier3-page-suggestions">View insights</a>{% if insights_view.execution_errors %}<a href="#tier3-execution-errors">Execution errors</a>{% endif %}</div>
</div>
</div>
{% if harbor_jobs %}
<div class="t3-harbor-panel" id="tier3-harbor-viewer">
<strong>Harbor Viewer</strong>
{{ harbor_job_actions(harbor_jobs) }}
</div>
{% else %}<p class="t3-harbor-unavailable" id="tier3-harbor-unavailable">No Harbor viewer or analysis links were recorded.</p>{% endif %}
{% if tier3_dataset_sufficiency and tier3_dataset_sufficiency.coverage_summary %}
<p class="t3-dataset-sufficiency{% if tier3_dataset_sufficiency.status == 'provisional' %} warning{% endif %}"
{% if tier3_dataset_sufficiency.status == 'provisional' %}style="color:var(--warning-color);font-weight:600"{% endif %}>
{{ tier3_dataset_sufficiency.coverage_summary }}
</p>
{% endif %}
{% if tier3.evidence_volume and tier3.evidence_volume.display %}
<p class="t3-evidence-volume{% if tier3.evidence_volume.limited %} warning{% endif %}"
{% if tier3.evidence_volume.limited %}style="color:var(--warning-color);font-weight:600"{% endif %}>
{{ tier3.evidence_volume.display }}
</p>
{% endif %}
{% if tier3_dataset_provenance_line and tier3_dataset_provenance_warning %}
<p class="t3-dataset-provenance{{ ' warning' if tier3_dataset_provenance_warning else '' }}">{{ tier3_dataset_provenance_line }}</p>
{% endif %}
{% if hero_score is not none %}
<div class="dashboard t3-primary-metrics">
{% if hero_score is not none %}
<div class="dashboard-card" data-primary-metric="score">
<h3 class="dashboard-card-title">{{ 'Baseline Score' if tier3.get('mode') == 'baseline_only' else ('Completed Agent Score' if completed_agent and completed_agent.needs_attention else 'Overall Score') }}</h3>
<p class="dashboard-card-value">{{ "%.2f" | format(hero_score) }}</p>
<p class="dashboard-card-subtitle">{{ completed_agent.name if completed_agent else (t3_best_name or 'Recorded quality') }}{% if tier3.get('mode') == 'baseline_only' %} · Baseline calibration (no with-skill arm){% endif %}</p>
</div>
<div class="dashboard-card" data-primary-metric="lift">
<h3 class="dashboard-card-title">Skill Lift</h3>
<p class="dashboard-card-value">{{ "%+.2f" | format(tier3.get('overall_lift')) if tier3.get('overall_lift') is not none else "N/A" }}</p>
<p class="dashboard-card-subtitle">{% if tier3.get('mode') == 'baseline_only' %}No with-skill arm{% elif tier3_verdict == 'inconclusive' %}Skill never activated{% elif tier3.get('overall_lift') is none %}{{ 'Comparison unavailable; baseline recorded' if t3_best and t3_best.baseline is not none else 'No comparable baseline' }}{% else %}Comparable scored cases{% endif %}</p>
</div>
{% endif %}
</div>
{% endif %}
{% set secondary = namespace(rows=[]) %}
{% for key, label, count in [('correct_answers', 'Goals met', 'correct'), ('required_checks', 'Required Checks Passed', 'passed'), ('security_clean', 'Security Clean', 'clean')] %}
{% set family = tier3.get(key) or {} %}
{% if (family.get('with_skill') or {}).get('scored') or (family.get('without_skill') or {}).get('scored') %}{% set _ = secondary.rows.append((label, family, count)) %}{% endif %}
{% endfor %}
{% if secondary.rows %}<div class="table-scroll"><table class="summary-table" id="tier3-secondary-outcomes">
<caption>Recorded outcomes</caption><thead><tr><th>Outcome</th><th>With skill</th><th>No skill</th><th>Difference</th></tr></thead><tbody>
{% for label, family, count in secondary.rows %}<tr><th scope="row">{{ label }}</th>
{% for condition in ['with_skill', 'without_skill'] %}{% set arm = family.get(condition) or {} %}<td>{% if arm.get('scored') %}{{ arm.get(count) if arm.get(count) is not none else 'N/A' }}/{{ arm.get('scored') }}{% else %}N/A{% endif %}</td>{% endfor %}
<td>{% if family.get('difference') is none %}N/A{% elif family.get('difference_unit') == 'percentage_points' %}{{ "%+.1f pp" | format(family.get('difference')) }}{% else %}{{ "%+d" | format(family.get('difference')) }}{% endif %}{% if family.get('reason') %} · {{ family.get('reason') }}{% endif %}</td></tr>{% endfor %}
</tbody></table></div>{% endif %}
{% set t3_na_dimensions = tier3.not_applicable_dimensions or [] %}
{% set t3_dim_by_agent = {} %}
{% set t3_other_agents = [] %}
{% for name, agent in t3_agents.items() %}
{% set dmap = {} %}
{% for dim in agent.dimensions or [] %}{% if dim.id %}{% set _ = dmap.update({dim.id: dim}) %}{% endif %}{% endfor %}
{% set _ = t3_dim_by_agent.update({name: dmap}) %}
{% if name != t3_best_name %}{% set _ = t3_other_agents.append(name) %}{% endif %}
{% endfor %}
{% set t3_present_dimension_ids = (tier3_display_dimensions | map(attribute='id') | list) + (t3_na_dimensions | map(attribute='id') | list) %}
{% set t3_peer_only_dimensions = [] %}
{% for name in t3_other_agents %}{% for dimension_id in t3_dim_by_agent[name] %}
{% if dimension_id not in t3_present_dimension_ids %}
{% set _ = t3_peer_only_dimensions.append({'id': dimension_id, 'peer_only': true}) %}
{% set _ = t3_present_dimension_ids.append(dimension_id) %}
{% endif %}
{% endfor %}{% endfor %}
{% if tier3_display_dimensions or t3_na_dimensions or t3_peer_only_dimensions %}
{% set t3_baseline_only = tier3.get('mode') == 'baseline_only' %}
{% set t3_signal_evidence = tier3.signal_evidence or {} %}
<details class="t3-details" id="tier3-dimension-lift" open>
<summary>Dimension Scores and Skill Lift{% if t3_best_name %} (Best Performing Agent: {{ t3_best_name }}){% endif %}</summary>
<div class="t3-details-body">
<div class="table-scroll" id="tier3-multi-agent-dimension-table">
<table class="summary-table" id="tier3-dimension-table">
<caption class="t3-comparison-caption">N/A means unavailable. Expand Details for the recorded scope and evidence.</caption>
<thead><tr>
<th>Dimension</th><th>Score</th>
<th>Baseline</th><th>Skill Lift</th>
<th>Verdict</th>
{% for name in t3_other_agents %}<th><button class="t3-agent-link" type="button" data-tier3-agent-link="{{ t3_agent_anchor_ids[name] }}" onclick="jumpToTier3Agent('{{ t3_agent_anchor_ids[name] }}')">{{ name }}</button></th>{% endfor %}
<th>Signals</th><th>Reasoning</th>
</tr></thead>
<tbody>
{% set t3_best_agent = t3_agents.get(t3_best_name, {}) %}
{% set t3_baseline_coverage = presentation.coverage.agents.get(t3_best_name, {}).get('without_skill') %}
{% set t3_recorded_conditions = t3_best_agent.get('conditions') %}
{% set t3_recorded_baseline = t3_recorded_conditions.get('without_skill') if t3_recorded_conditions is mapping else none %}
{% set baseline_na_metrics = t3_best_agent.get('not_applicable_metrics', {}).get('without_skill', []) %}
{% for dim in tier3_display_dimensions %}
{% set dim_score = dim.score if dim.score is not none else dim.with_skill %}
{% set dim_color = 'var(--text-secondary)' if dim_score is none else ('var(--success-color)' if dim_score >= 0.7 else ('var(--warning-color)' if dim_score >= 0.4 else 'var(--danger-color)')) %}
{% set dim_evidence = [] %}
{% for metric_id in dim.evaluators or [] %}{% if t3_signal_evidence.get(metric_id) and t3_signal_evidence.get(metric_id) not in dim_evidence %}{% set _ = dim_evidence.append(t3_signal_evidence.get(metric_id)) %}{% endif %}{% endfor %}
<tr>
<td>
<strong>{{ "Skill Efficiency" if dim.id == "efficiency" else (dim.id | title) }}</strong>
{% if dim.partial %}<span class="t3-pill warning" title="A subset of the configured signals was recorded.">partial</span>{% endif %}
{% if t3_dim_hints.get(dim.id) %}
<details class="t3-table-detail t3-dimension-definition">
<summary aria-label="Definition of {{ 'Skill Efficiency' if dim.id == 'efficiency' else (dim.id | title) }}">Definition</summary>
<p>{{ t3_dim_hints.get(dim.id) }}</p>
</details>
{% endif %}
</td>
<td>
{% if dim_score is not none %}
<div class="metric-bar-cell">
<span class="metric-value" style="color:{{ dim_color }}">{{ "%.2f" | format(dim_score) }}</span>
<div class="mini-bar"><span style="width:{{ (dim_score * 100) | round(0) }}%; background:{{ dim_color }};"></span></div>
</div>
{% else %}
<span class="metric-value" style="color:{{ dim_color }}" title="{{ 'with-skill arm not run' if t3_baseline_only else 'not scored with the skill' }}">N/A</span>
{% endif %}
</td>
<td{% if dim.id == 'discoverability' and 'skill_execution' in baseline_na_metrics %} title="No-skill baseline: {{ 'skill_execution' | not_applicable_reason }}"{% elif dim.id == 'efficiency' and 'skill_efficiency' in baseline_na_metrics %} title="No-skill baseline: {{ 'skill_efficiency' | not_applicable_reason }}"{% endif %}>
{% if dim.baseline is not none %}{{ "%.2f" | format(dim.baseline) }}{% else %}<span title="{{ 'baseline not run' if t3_baseline_coverage and t3_baseline_coverage.status == 'skipped' and t3_recorded_baseline is mapping and t3_recorded_baseline.get('execution_status') == 'skipped' else 'baseline quality unavailable' }}">N/A</span>{% endif %}
</td>
<td style="color:{{ 'var(--success-color)' if dim.lift is not none and dim.lift >= tier3_lift_pass_threshold else ('var(--danger-color)' if dim.lift is not none and dim.lift <= tier3_lift_fail_threshold else 'var(--text-secondary)') }};font-weight:600;">
{% if dim.lift is not none %}{{ "%+.2f" | format(dim.lift) }}{% else %}<span title="{% if t3_best_agent.get('skill_activation', {}).get('status') == 'never_activated' %}inconclusive: skill never activated{% elif t3_baseline_only %}baseline-only run{% elif dim_score is none %}with-skill unavailable{% elif dim.baseline is not none %}comparison unavailable{% else %}no baseline score{% endif %}">N/A</span>{% endif %}
</td>
{% set dim_regressed = dim.verdict == 'PASS' and dim.lift is not none and dim.lift <= tier3_lift_fail_threshold %}
<td>{% if dim.verdict %}<span class="t3-pill {{ 'warning' if dim_regressed else ('ok' if dim.verdict == 'PASS' else ('critical' if dim.verdict == 'FAIL' else 'warning')) }}">{{ dim.verdict }}{{ ' · regressed' if dim_regressed else '' }}</span>{% else %}<span class="t3-pill warning">No verdict</span>{% endif %}</td>
{% for name in t3_other_agents %}
{{ other_dimension_cell(t3_dim_by_agent[name].get(dim.id), t3_agents[name]) }}
{% endfor %}
<td>
{% if dim.evaluators %}<details class="t3-table-detail"><summary>{{ dim.evaluators | length }} signal{{ 's' if dim.evaluators | length != 1 else '' }}</summary>
{% for metric_id in dim.evaluators or [] %}
<span class="metadata-tag" title="{{ t3_signal_evidence.get(metric_id, '') }}">{{ t3_metric_labels.get(metric_id, metric_id | replace("_", " ") | title) }}</span>
{% endfor %}
</details>{% else %}—{% endif %}
</td>
<td class="t3-reasoning">
{% if dim.comparison and dim.comparison.status != 'comparable' %}<p class="t3-dim-hint">{% if dim.comparison.label %}<strong>{{ dim.comparison.label }}</strong>{% endif %}{% if dim.comparison.with_skill is number and dim.comparison.baseline is number and dim.comparison.lift is number %}: {{ "%.2f" | format(dim.comparison.baseline) }} → {{ "%.2f" | format(dim.comparison.with_skill) }} ({{ "%+.2f" | format(dim.comparison.lift) }} lift).{% endif %}</p>{% endif %}
<details class="t3-table-detail"><summary>Details</summary>
{% if dim_evidence %}<p>Evidence: {{ dim_evidence | join('; ') }}.</p>{% endif %}
{% if dim_score is none %}<p>{{ "with-skill arm not run" if t3_baseline_only else "not scored with the skill" }}</p>{% endif %}
{% if dim.baseline is none %}<p>{{ "baseline not run" if t3_baseline_coverage and t3_baseline_coverage.status == 'skipped' and t3_recorded_baseline is mapping and t3_recorded_baseline.get('execution_status') == 'skipped' else "baseline quality unavailable" }}</p>{% endif %}
{% if dim.lift is none %}<p>{{ 'with-skill unavailable' if dim_score is none else 'comparison unavailable' }}</p>{% endif %}
{% if dim.comparison and dim.comparison.status != 'comparable' and dim.comparison.reason %}<p>{{ dim.comparison.reason }}</p>{% endif %}
{% if dim.reasoning_bullets %}
<ul class="t3-reasoning-list">
{% for bullet in dim.reasoning_bullets %}<li>{{ bullet }}</li>{% endfor %}
</ul>
{% else %}
{{ dim.explanation if dim.explanation else "" }}
{% endif %}
</details>
</td>
</tr>
{% endfor %}
{% for dim in t3_na_dimensions + t3_peer_only_dimensions %}
<tr>
<td>
<strong>{{ "Skill Efficiency" if dim.id == "efficiency" else (dim.id | title) }}</strong>
{% if t3_dim_hints.get(dim.id) %}
<details class="t3-table-detail t3-dimension-definition">
<summary aria-label="Definition of {{ 'Skill Efficiency' if dim.id == 'efficiency' else (dim.id | title) }}">Definition</summary>
<p>{{ t3_dim_hints.get(dim.id) }}</p>
</details>
{% endif %}
</td>
<td>N/A</td><td>N/A</td><td>N/A</td>
<td><span class="t3-pill warning">{{ 'Not measured' if dim.peer_only else 'Not applicable' }}</span></td>
{% for name in t3_other_agents %}{{ other_dimension_cell(t3_dim_by_agent[name].get(dim.id), t3_agents[name]) }}{% endfor %}
<td></td>
<td class="t3-reasoning">{% if dim.peer_only %}No measurement was recorded for the primary agent; other-agent evidence is shown alongside.{% else %}{% set na_reason = dim.reason or "Not applicable: its signals had nothing to judge in any eval case" %}{{ na_reason }}{{ "" if na_reason.endswith(".") else "." }} It has no score, so the agent cannot PASS.{% endif %}</td>
</tr>
{% endfor %}
{% set best_overall_score = t3_best.with_skill if t3_best else none %}
{% set best_overall_baseline = t3_best.baseline if t3_best else none %}
{% set best_overall_color = 'var(--text-secondary)' if best_overall_score is none else ('var(--success-color)' if best_overall_score >= 0.7 else ('var(--warning-color)' if best_overall_score >= 0.4 else 'var(--danger-color)')) %}
<tr>
<td><strong>Overall</strong><div class="t3-dim-hint">Recorded aggregate; review each agent's scope below.</div></td>
<td>{% if best_overall_score is not none %}<div class="metric-bar-cell"><span class="metric-value" style="color:{{ best_overall_color }};">{{ "%.2f" | format(best_overall_score) }}</span><div class="mini-bar"><span style="width:{{ (best_overall_score * 100) | round(0) }}%;background:{{ best_overall_color }};"></span></div></div>{% else %}<span class="metric-value">N/A</span>{% endif %}</td>
<td>{{ "%.2f" | format(best_overall_baseline) if best_overall_baseline is not none else 'N/A' }}</td>
<td style="color:{{ 'var(--success-color)' if tier3.overall_lift is not none and tier3.overall_lift >= tier3_lift_pass_threshold else ('var(--danger-color)' if tier3.overall_lift is not none and tier3.overall_lift <= tier3_lift_fail_threshold else 'var(--text-secondary)') }};font-weight:600;">{% if tier3.overall_lift is not none %}{{ "%+.2f" | format(tier3.overall_lift) }}{% else %}N/A<div class="t3-dim-hint">{{ unavailable_lift(best_overall_score, best_overall_baseline, t3_best.get('skill_activation', {}) if t3_best else {}) }}</div>{% endif %}</td>
<td class="t3-dim-hint">—</td>
{% for name in t3_other_agents %}{% set other_agent = t3_agents[name] %}{% set other_overall_color = 'var(--text-secondary)' if other_agent.with_skill is none else ('var(--success-color)' if other_agent.with_skill >= 0.7 else ('var(--warning-color)' if other_agent.with_skill >= 0.4 else 'var(--danger-color)')) %}<td><div class="t3-mad-cell"><div class="t3-mad-score-row"><span class="t3-mad-score" style="color:{{ other_overall_color }};">{{ "%.2f" | format(other_agent.with_skill) if other_agent.with_skill is not none else 'N/A' }}</span>{% if other_agent.with_skill is not none %}<div class="t3-mad-bar"><span style="width:{{ (other_agent.with_skill * 100) | round(0) }}%;background:{{ other_overall_color }};"></span></div>{% endif %}</div><span class="t3-mad-lift">{% if other_agent.lift is not none and other_agent.get('skill_activation', {}).get('status') != 'never_activated' %}{{ "%+.2f" | format(other_agent.lift) }} lift{% else %}{{ unavailable_lift(other_agent.with_skill, other_agent.baseline, other_agent.get('skill_activation', {})) }}{% endif %}</span></div></td>{% endfor %}
<td colspan="2" class="t3-dim-hint">Agent Scorecards link to trial counts, coverage and evaluator evidence.</td>
</tr>
</tbody>
</table>
</div>
<details class="t3-method"><summary>How dimension scores and lift are read</summary><p class="t3-section-hint">
Each dimension answers one question about the skill, scored from 0.00 to 1.00.
Score is the agent's result with the skill; Baseline is the same eval cases run without it;
Skill Lift compares Overall on the metrics and cases both arms scored, so it can differ from subtracting the displayed Overall scores. A dimension passes at {{ "%.2f" | format(tier3_dimension_pass_threshold) }} or above
and fails below {{ "%.2f" | format(tier3_dimension_neutral_threshold) }}.
Signals are the evaluator metrics behind each dimension, and Evidence says where they come from.
N/A means no measurement, never a score of zero; the note under it says why.
</p></details>
{% if t3_other_agents %}<p class="t3-section-hint">Score, Baseline and Skill Lift describe {{ t3_best_name or 'the run result' }}. Other agent columns show that agent's score and lift.</p>{% endif %}
</div>
</details>
{% endif %}
<details class="t3-details" id="tier3-number-key">
<summary>What each number means</summary>
<div class="t3-details-body">
<ul class="t3-reasoning-list">
<li><strong>Verdict</strong>: the live-evaluation result from the five dimensions and required case checks. It passes when one agent scores at least {{ "%.2f" | format(tier3_dimension_pass_threshold) }} on every dimension with the skill and has no with-skill case failing a required goal-accuracy or security check. A scored unmet goal or security issue in any attempt fails its case and that agent's quality verdict, even if all dimensions pass. Baseline-arm required-check failures do not change this quality verdict.</li>
<li><strong>Overall Score</strong>: the equal-weight mean of the five dimension scores with the skill, from 0.00 to 1.00.</li>
<li><strong>Skill Lift</strong>: compares Overall on the metrics and cases both arms scored, so it can differ from subtracting the displayed Overall scores. It shows whether the skill helped and does not change the verdict; N/A means no comparable baseline, not zero.</li>
<li><strong>pass@k</strong> (Trials): the share of eval cases with at least one passing attempt out of k. It measures how repeatable success is.</li>
<li><strong>Quality Score</strong> (Tier 1, out of 100): a static review of the skill's files. It is not an input to any live-evaluation score.</li>
<li><strong>Publication eligibility</strong>: decided separately in BENCHMARK.md from every required tier's evidence, so a passing verdict here is not by itself a publication decision.</li>
</ul>
</div>
</details>
{% if tier3_metric_comparison_rows %}
<details class="t3-details" id="tier3-metric-comparison" open>
<summary>Metric Scores and Baseline</summary>
<div class="t3-details-body">
<p class="t3-section-hint">Recorded evaluator measurements. N/A means unavailable; no missing scores or lift values are estimated.</p>
<div class="table-scroll"><table class="summary-table" id="tier3-metric-comparison-table">
<thead><tr><th>Metric</th><th>Score</th><th>Baseline</th><th>Skill Lift</th><th>Reason</th></tr></thead>
<tbody>{% for row in tier3_metric_comparison_rows %}<tr>
<th scope="row">{{ row.label }}</th>
<td>{{ "%.2f" | format(row.score) if row.score is not none else 'N/A' }}</td>
<td>{{ "%.2f" | format(row.baseline) if row.baseline is not none else 'N/A' }}</td>
<td>{{ "%+.2f" | format(row.lift) if row.lift is not none else 'N/A' }}</td>
<td>{{ row.reason }}</td>
</tr>{% endfor %}</tbody>
</table></div>
{% if tier3_metric_comparison_omitted %}<p class="t3-section-hint">{{ tier3_metric_comparison_omitted }} additional metrics are retained in <a href="#tier3-json-downloads">JSON Downloads</a>.</p>{% endif %}
</div>
</details>
{% endif %}
{% if t3_agents %}
<details class="t3-details" id="tier3-agent-scorecards" open>
<summary>Agent Scorecards</summary>
<div class="t3-details-body">
<div class="t3-agent-scorecards-row{{ ' t3-scorecards-only' if not tier3_display_dimensions else '' }}">
<div class="t3-agent-scorecard-list">
{% for name, agent in t3_agents.items() %}
{% set score_color = 'var(--text-secondary)' if agent.with_skill is none else ('var(--success-color)' if agent.with_skill >= 0.7 else ('var(--warning-color)' if agent.with_skill >= 0.4 else 'var(--danger-color)')) %}
<div class="t3-agent-card t3-agent-deeplink"
role="button" tabindex="0" data-tier3-agent-link="{{ t3_agent_anchor_ids[name] }}"
onclick="jumpToTier3Agent('{{ t3_agent_anchor_ids[name] }}')"
onkeydown="tier3MaybeActivateAgentLink(event, '{{ t3_agent_anchor_ids[name] }}')"
aria-label="Open Agent Details for {{ name }}" title="Open Agent Details for {{ name }}">
<div class="t3-agent-name">{{ name }}</div>
<div class="t3-agent-score" style="color:{{ score_color }};">{{ "%.2f" | format(agent.with_skill) if agent.with_skill is not none else 'N/A' }}</div>
<div class="t3-dim-hint">{% if agent.lift is not none and agent.get('skill_activation', {}).get('status') != 'never_activated' %}{{ "%+.2f" | format(agent.lift) }} lift{% else %}{{ unavailable_lift(agent.with_skill, agent.baseline, agent.get('skill_activation', {})) }}{% endif %}</div>
<div class="t3-dim-hint">{{ agent.num_trials or 0 }} trials{% if agent.num_trials_baseline %} · {{ agent.num_trials_baseline }} baseline{% endif %}{% if agent.execution_status %} · {{ agent.execution_status | title }}{% endif %}</div>
{% set card_coverage = presentation.coverage.agents.get(name, {}) %}
{% if card_coverage %}<div class="t3-dim-hint">{% for condition, label in [('with_skill', 'With skill'), ('without_skill', 'Baseline')] %}{% set arm = card_coverage.get(condition) %}{% if arm %}{{ ' · ' if not loop.first else '' }}{{ label }} {{ arm.scored if arm.scored is not none else '?' }}/{{ arm.expected if arm.expected is not none else '?' }} scored{% endif %}{% endfor %}</div>{% endif %}
{% if agent.with_skill is not none %}<div class="t3-mini-bar"><span style="width:{{ (agent.with_skill * 100) | round(0) }}%;background:{{ score_color }};"></span></div>{% endif %}
</div>
{% endfor %}
</div>
{% set dimension_reference = ('tier3-multi-agent-dimension-table' if t3_agents | length > 1 else 'tier3-dimension-table') if tier3_display_dimensions else 'tier3-json-downloads' %}
{% set dimension_reference_label = 'Read the dimension scores table' if tier3_display_dimensions else 'Read JSON Downloads (dimension scores unavailable)' %}
{% if tier3_display_dimensions %}
<div class="chart-card">{{ tier3_chart('tier3-radar', 'Dimension Comparison (Radar)', 'Dimension scores for each agent, on a scale from 0 to 1; missing measurements are gaps.', dimension_reference, dimension_reference_label, 260) }}</div>
<div class="chart-card">{{ tier3_chart('tier3-metric-bar', 'Dimension Scores by Agent', 'Dimension scores grouped by dimension and agent, on a scale from 0 to 1; missing measurements are gaps.', dimension_reference, dimension_reference_label, 260) }}</div>
{% endif %}
</div>
</div>
</details>
{% endif %}
{{ render_plugin_evidence(plugin_evidence, 'overview') }}
</section>
{# ---------- Trials ---------- #}
<section class="t3-page" id="tier3-page-trials" role="tabpanel" aria-labelledby="tier3-tab-trials" tabindex="0">
{{ render_native_evidence(native_evidence, 'trials') }}
{# Drill-down rows for both conditions: with-skill rows come from the canonical
top-level trials, baseline rows from each agent's trials_baseline. #}
{% set t3_condition_trial_rows = [] %}
{% set t3_row_agents = t3_agents.keys() | list %}
{% for trial in tier3.trials or [] %}
{% if (trial.agent or '(default)') not in t3_row_agents %}
{% set _ = t3_row_agents.append(trial.agent or '(default)') %}
{% endif %}
{% endfor %}
{% for agent_name in t3_row_agents %}
{% for trial in tier3.trials or [] %}
{% if (trial.agent or '(default)') == agent_name %}
{% set _ = t3_condition_trial_rows.append({'agent': agent_name, 'condition': 'With skill', 'trial': trial}) %}
{% endif %}
{% endfor %}
{% set t3_row_agent = t3_agents.get(agent_name) %}
{% if t3_row_agent is mapping %}
{% for trial in t3_row_agent.get('trials_baseline') or [] %}
{% if trial is mapping %}
{% set _ = t3_condition_trial_rows.append({'agent': agent_name, 'condition': 'Without skill', 'trial': trial}) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% set t3_eval_ids = [] %}
{% set t3_trial_score_keys = [] %}
{% set t3_baseline_score_keys = [] %}
{% for row in t3_condition_trial_rows %}
{% set trial = row.trial %}
{% for score_map in [trial.scores, trial.baseline_scores, trial.lift_scores] %}
{% if score_map is mapping %}
{% for metric_id in score_map.keys() %}
{% if metric_id not in t3_trial_score_keys %}
{% set _ = t3_trial_score_keys.append(metric_id) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% if row.condition == 'Without skill' and trial.scores is mapping %}
{% for metric_id in trial.scores.keys() %}
{% if metric_id not in t3_baseline_score_keys %}
{% set _ = t3_baseline_score_keys.append(metric_id) %}
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% for metric_id in t3_metric_ids %}
{% if metric_id in t3_trial_score_keys %}
{% set _ = t3_eval_ids.append(metric_id) %}
{% endif %}
{% endfor %}
{# Baseline rows can score metrics the best agent's with-skill evaluators do not list;
they still get a column so a failing baseline score and its reason are visible. #}
{% for metric_id in t3_baseline_score_keys %}
{% if metric_id not in t3_eval_ids %}
{% set _ = t3_eval_ids.append(metric_id) %}
{% endif %}
{% endfor %}
{% if not t3_eval_ids and not t3_trial_score_keys %}{% set t3_eval_ids = t3_metric_ids %}{% endif %}
{# Pass@K is hoisted to the top of Trials so the rate sits immediately above
the Trial Charts and per-case Attempt Details that explain it.
Hiding it from Overview keeps the first-page beginner narrative focused. #}
{% if tier3.not_applicable_evaluators %}
<section class="dashboard-card" aria-label="Not applicable evaluators">
<h3>Not applicable evaluators</h3>
<ul>{% for item in tier3.not_applicable_evaluators %}<li><strong>{{ item.label or item.id }}</strong>: {{ item.reason }}</li>{% endfor %}</ul>
<p>N/A scores are excluded from applicable score totals. Missing evidence remains unscored.</p>
</section>
{% endif %}
{% if tier3.pass_at_k and tier3.pass_at_k.with_skill %}
<details class="t3-details" id="tier3-pass-at-k" open>
<summary>Pass@{{ t3_max_attempts }} (supporting reliability)</summary>
<div class="t3-details-body">
<p style="color:var(--text-secondary);font-size:0.85rem;margin:0 0 0.75rem;">
Pass@{{ t3_max_attempts }} is the share of cases with a passing attempt; an attempt passes at {% if t3_attempt_policy.pass_threshold is not none %}Overall ≥ {{ "%.2f" | format(t3_attempt_policy.pass_threshold) }}{% else %}the configured Overall threshold{% endif %}. This is supporting reliability; a positive pass-rate difference shows better observed repeatability on these evaluated cases.
</p>
<div class="table-scroll" tabindex="0" role="region" aria-label="Pass at K summary table">
{% macro t3_attempts_passed(branch) %}
{% set ns = namespace(n=0, seen=0, known=true, truncated=branch.case_details_truncated or false) %}
{% for case in (branch.cases if branch.cases is mapping else {}).values() %}
{% if case.attempt_details_truncated %}{% set ns.truncated = true %}{% endif %}
{% if case.attempts is not sequence or case.attempts is string or case.attempts is mapping or not case.attempts %}{% set ns.known = false %}
{% else %}{% for att in case.attempts %}{% if att is mapping and att.passed is boolean %}{% set ns.seen = ns.seen + 1 %}{% if att.passed %}{% set ns.n = ns.n + 1 %}{% endif %}{% else %}{% set ns.known = false %}{% endif %}{% endfor %}{% endif %}
{% endfor %}
{% if ns.truncated %}{{ branch.attempts_used if branch.attempts_used is integer else 'N/A' }} scored; pass details truncated
{% elif branch.cases is not mapping or not branch.cases or not ns.known or branch.attempts_used is not integer or ns.seen != branch.attempts_used %}N/A{% if branch.attempts_used is integer %} · {{ branch.attempts_used }} scored{% endif %}
{% else %}{{ ns.n }} of {{ branch.attempts_used }}{% endif %}
{% endmacro %}
<table class="summary-table pass-at-k-table" style="width:100%;">
<thead><tr>
<th>Agent</th><th>Condition</th><th>Pass Rate</th><th>95% Interval</th><th>Cases Passed</th><th>Attempts Passed</th><th>Pass-rate difference</th>
</tr></thead>
<tbody>
{% for name, agent in t3_agents.items() %}
{% set pak = agent.pass_at_k or {} %}
{% set wp = pak.with_skill or {} %}
{% set bp = pak.without_skill or {} %}
{% set lf = pak.lift or {} %}
{% set wi = wp.rate_interval or {} %}
{% set bi = bp.rate_interval or {} %}
{% set paired = lf.paired_comparison if lf.paired_comparison is mapping else {} %}
{% set wp_rate = wp.get('rate') if wp.get('rate') is number and wp.get('rate') is not boolean and 0 <= wp.get('rate') <= 1 else none %}
{% set bp_rate = bp.get('rate') if (tier3.baseline or {}).get('mode') != 'skipped' and bp.get('rate') is number and bp.get('rate') is not boolean and 0 <= bp.get('rate') <= 1 else none %}
{% set arm_delta = wp_rate - bp_rate if wp_rate is number and bp_rate is number else none %}
{% if wp %}
<tr>
<td><strong>{{ name }}</strong></td>
<td>With skill</td>
<td>{% if wp_rate is number and wp_rate is not boolean %}{{ "%.0f%%" | format(wp_rate * 100) }}{% else %}N/A{% endif %}</td>
<td>{% if wi %}{{ wi | adaptive_interval_percent }}{% else %}—{% endif %}</td>
<td>{% if wp.passed_cases is integer and wp.total_cases is integer %}{{ wp.passed_cases }} of {{ wp.total_cases }}{% else %}N/A{% endif %}</td>
<td>{{ t3_attempts_passed(wp) }}</td>
<td style="color:{{ 'var(--success-color)' if arm_delta is not none and arm_delta >= tier3_lift_pass_threshold else ('var(--danger-color)' if arm_delta is not none and arm_delta <= tier3_lift_fail_threshold else 'var(--text-secondary)') }};font-weight:600;">
{% if arm_delta is not none %}{{ "%+.0f%%" | format(arm_delta * 100) }}{% else %}—{% endif %}
{% if lf.basis == 'shared_metrics' %}
<div>Shared-metric pass-rate difference: {% if lf.with_skill is number and lf.without_skill is number %}{{ "%+.0f" | format((lf.with_skill - lf.without_skill) * 100) }} percentage points (with skill {{ "%.0f%%" | format(lf.with_skill * 100) }}, without skill {{ "%.0f%%" | format(lf.without_skill * 100) }}){% else %}N/A{% endif %}.</div>
{% endif %}
</td>
</tr>
{% endif %}
{% if bp %}
<tr>
<td></td>
<td>Without skill</td>
<td>{% if bp_rate is number and bp_rate is not boolean %}{{ "%.0f%%" | format(bp_rate * 100) }}{% else %}N/A{% endif %}</td>
<td>{% if bi %}{{ bi | adaptive_interval_percent }}{% else %}—{% endif %}</td>
<td>{% if bp.passed_cases is integer and bp.total_cases is integer %}{{ bp.passed_cases }} of {{ bp.total_cases }}{% else %}N/A{% endif %}</td>
<td>{{ t3_attempts_passed(bp) }}</td>
<td>baseline</td>
</tr>
{% endif %}
{% if paired %}
<tr>
<td></td>
<td colspan="6" style="color:var(--text-secondary);font-size:0.82rem;">
{% if paired.paired_cases %}
Paired cases: {{ paired.paired_cases or 0 }}
(skill-only passes {{ paired.with_skill_only_pass or 0 }},
baseline-only passes {{ paired.without_skill_only_pass or 0 }},
both pass {{ paired.both_pass or 0 }}, neither pass {{ paired.neither_pass or 0 }}).
Pairing: {{ paired.pairing_status or 'unavailable' }}.
{% if paired.paired_rate_delta is defined and paired.paired_rate_delta is not none %}
Paired pass-rate delta: {{ paired.paired_rate_delta | adaptive_percent(true) }}.
{% endif %}
{% set exact = paired.mcnemar_exact if paired.mcnemar_exact is mapping else {} %}
{% set exact_has_text = exact.p_value_text is defined and exact.p_value_text is string %}
{% set exact_has_number = exact.p_value is defined and exact.p_value is number %}
{% if exact_has_text or exact_has_number %}
Exact McNemar p={% if exact_has_text %}{{ exact.p_value_text }}{% else %}{{ "%.4g" | format(exact.p_value) }}{% endif %}.
{% set minimum_has_text = exact.minimum_attainable_p_value_text is defined and exact.minimum_attainable_p_value_text is string %}
{% set minimum_has_number = exact.minimum_attainable_p_value is defined and exact.minimum_attainable_p_value is number %}
{% if minimum_has_text or minimum_has_number %}
Minimum attainable p with {{ paired.discordant_cases or 0 }} observed discordant pair{{ 's' if (paired.discordant_cases or 0) != 1 else '' }}: {% if minimum_has_text %}{{ exact.minimum_attainable_p_value_text }}{% else %}{{ "%.4g" | format(exact.minimum_attainable_p_value) }}{% endif %}{% if exact.resolution_limited_at_alpha_0_05 %}
(resolution-limited at α=0.05){% endif %}.
{% endif %}
Diagnostic only.
{% endif %}
{% else %}
Paired comparison {{ paired.pairing_status or 'unavailable' }}; exact test not computed.
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
</div>
</details>
{% endif %}
{% if t3_agents %}
<details class="t3-details" id="tier3-agent-resources">
<summary>Measured Agent Resources</summary>
<div class="t3-details-body">
<p class="t3-section-hint">Observed consumption includes failed outcomes; lower use does not imply quality. Partial coverage limits comparisons; unavailable values are N/A.</p>
{% set t3_resource_rows = [
('tokens', 'Prompt + completion tokens (cache included)', '{:,.0f}', 'total'),
('agent_seconds', 'Agent execution seconds', '{:,.1f} s', 'total'),
('llm_seconds', 'LLM seconds', '{:,.1f} s', 'total'),
('tool_seconds', 'Tool seconds', '{:,.1f} s', 'total'),
('llm_ms_per_token', 'LLM ms per token', '{:,.2f} ms', 'value'),
] %}
{% macro t3_timing_source_text(sources) %}{% for source in sources %}{{ ' and ' if not loop.first }}{{ 'native ATIF timing' if source == 'atif' else ('inferred from step timestamps' if source == 'step_timestamps' else source) }}{% endfor %}{% if not sources %}none{% endif %}{% endmacro %}
<div class="table-scroll"><table class="summary-table">
<thead><tr><th>Agent</th><th>Measurement</th><th>With skill total</th><th>Baseline total</th><th>Delta</th><th>Measured trials (skill / baseline)</th></tr></thead>
<tbody>
{% for name, agent in t3_agents.items() %}
{% if agent.resources is defined %}
{% for field, label, unit_fmt, key in t3_resource_rows %}
{% if agent.resources[field] is defined %}
{% set measured = agent.resources[field] %}
{% set with_value = measured.with_skill[key] %}
{% set baseline_value = measured.baseline[key] %}
<tr><td>{{ name }}</td><td>{{ label }}</td>
<td>{{ unit_fmt.format(with_value) if with_value is not none else 'N/A' }}</td>
<td>{{ unit_fmt.format(baseline_value) if baseline_value is not none else 'N/A' }}</td>
<td>{% if measured.delta is not none %}{{ ('+' if measured.delta >= 0 else '') ~ unit_fmt.format(measured.delta) }}{% if baseline_value %} ({{ '%+.0f' | format(measured.delta / baseline_value * 100) }}%){% endif %}{% else %}N/A{% endif %}</td>
<td>{{ measured.with_skill.measured_trials }}/{{ measured.with_skill.trials }} / {{ measured.baseline.measured_trials }}/{{ measured.baseline.trials }}</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
</tbody>
</table></div>
{% for name, agent in t3_agents.items() %}
{% set t3_timing_sources = agent.resources.timing_sources if agent.resources is defined and agent.resources.timing_sources is mapping else {} %}
{% if t3_timing_sources.with_skill or t3_timing_sources.baseline %}
<p class="t3-section-hint">{{ name }} timing source: with skill {{ t3_timing_source_text(t3_timing_sources.with_skill or []) }}; baseline {{ t3_timing_source_text(t3_timing_sources.baseline or []) }}.{% if 'mixed_timing_sources' in (agent.resources.caveats or []) %} The measurements mix native and inferred timing, so LLM and tool seconds are not like-for-like.{% endif %}</p>
{% endif %}
{% endfor %}
{% if tier3_token_usage %}
<div id="t3-token-usage">
<p class="t3-section-hint"><strong>Token usage by case.</strong></p>
<div class="table-scroll"><table class="summary-table">
<thead><tr><th>Agent</th><th>Case</th><th>With skill</th><th>Baseline</th><th>Change</th><th>Measured attempts</th></tr></thead>
<tbody>
{% for row in tier3_token_usage.rows %}
<tr{% if not row.is_case %} style="font-weight:600"{% endif %}><td>{{ row.agent if row.agent is not none else 'All agents' }}</td><td>{{ row.case }}</td><td>{{ row.with_skill }}</td><td>{{ row.baseline }}</td><td>{{ row.change }}</td><td>{{ row.coverage }}</td></tr>
{% endfor %}
</tbody>
</table></div>
<p class="t3-section-hint">{{ tier3_token_usage.coverage_note }}</p>
{% if tier3_token_usage.reused_baseline %}<p class="t3-section-hint">{{ tier3_token_usage.reused_baseline }}</p>{% endif %}
{% for row in tier3_token_usage.rows if row.note %}
<p class="t3-section-hint">{{ row.agent if row.agent is not none else 'All agents' }}: {{ row.note }}</p>
{% endfor %}
{% for note in [tier3_token_usage.more_cases, tier3_token_usage.dropped_cases, tier3_token_usage.unverified_cases] if note %}
<p class="t3-section-hint">{{ note }}</p>
{% endfor %}
<details class="t3-details" id="tier3-token-accounting"><summary>Token accounting</summary><p class="t3-section-hint">{{ tier3_token_usage.note }}</p></details>
</div>
{% endif %}
</div>
<details class="t3-details" id="tier3-resource-methods"><summary>Resource methods</summary>
<p class="t3-section-hint">Efficiency scores measure routing and productive tool use. These separate measurements show observed agent resource use, including failed task outcomes. Lower use alone does not establish improved task quality or Efficiency. Delta = with skill minus baseline; negative means less use. Judge and setup time are excluded. Deltas require complete execution evidence, complete telemetry and matching case counts in both arms. Pairing does not certify matched concurrency or budget, or judge-model agreement. Reused baseline measurements are historical, not fresh or independent evidence. LLM and tool seconds split the agent's trajectory time; inferred LLM time also includes harness and queue time.</p>
</details>
</details>
{% endif %}
{% if declarative_coverage_groups %}
<h3>Declarative-check coverage</h3>
<p class="t3-section-hint">{{ declarative_denominator_note }}</p>
{% for group in declarative_coverage_groups %}
<h4>{{ group.agent }} / {{ group.arm }}</h4>
<p>{{ declarative_coverage_summary(group) }}</p>
<p class="t3-section-hint">Per-reward denominators: {{ declarative_attempt_denominators(group) }}</p>
<div class="table-scroll"><table class="summary-table">
<thead><tr><th>Case / trial</th><th>Check</th><th>Expected</th><th>Status</th><th>Reason</th></tr></thead>
<tbody>{% for item in group.results %}
<tr><td>{{ item.case_id }} / {{ item.trial_id }}</td><td>{{ item.type }}</td><td>{{ item.expected }}</td><td>{{ declarative_check_status(item) }}</td><td>{{ item.reason }}</td></tr>
{% endfor %}</tbody>
</table></div>
{% endfor %}
{% endif %}
{% if t3_condition_trial_rows %}
{% set t3_trial_agent_groups = (tier3.trials or []) | groupby('agent') %}
{% set t3_token_coverage = namespace(all_agents_complete=(t3_trial_agent_groups | length == (tier3.agents or {}) | length)) %}
{% for t3_agent_group in t3_trial_agent_groups %}
{% set t3_agent_token_trials = t3_agent_group.list | selectattr('tokens', 'defined') | list %}
{% if t3_agent_token_trials | length != t3_agent_group.list | length %}
{% set t3_token_coverage.all_agents_complete = false %}
{% endif %}
{% endfor %}
{% set t3_steps_chart = steps_by_case_chart | default({'labels': [], 'datasets': []}) %}
{# Charts moved above the heatmap so the visualization narrative is summary-chart -> pivot -> drill-down #}
{% if (t3_token_coverage.all_agents_complete and not tier3_telemetry.token_chart) or t3_steps_chart.datasets %}
<details class="t3-details" open>
<summary>Trial Charts</summary>
<div class="t3-details-body">
<div class="chart-grid">
{% if t3_token_coverage.all_agents_complete and not tier3_telemetry.token_chart %}<div class="chart-card">{{ tier3_chart('tier3-token-chart', 'With-Skill Token Usage by Agent', 'Prompt, completion and observed cached tokens summed across with-skill trials for each agent.', 't3-trials-table', 'Read token measurements in the trial table', 250) }}</div>{% endif %}
{% if t3_steps_chart.datasets %}<div class="chart-card">{{ tier3_chart('tier3-steps-chart', 'Steps per Eval Case by Agent and Condition', 'Average measured steps per eval case, grouped by agent and with-skill or baseline condition; incomplete measurements are gaps.', 't3-trials-table', 'Read individual step measurements in the trial table', 250) }}{% if t3_steps_chart.get('omitted_cases') %}<p style="color:var(--text-secondary);font-size:0.82rem;">Showing the first {{ t3_steps_chart.labels | length }} eval cases; {{ t3_steps_chart['omitted_cases'] }} more are in the JSON Downloads.</p>{% endif %}</div>{% endif %}
</div>
</div>
</details>
{% endif %}
{# ----- Attempt Details: SkillEvaluator-style per-case attempt-score breakdown ----- #}
{% set t3_pass_threshold = (t3_attempt_policy.pass_threshold if t3_attempt_policy.pass_threshold is not none else 0.5) | float %}
{% set t3_verdict_policy = tier3.get('verdict_policy') or {} %}
{% set t3_attempt_rows = [] %}
{% if t3_agents %}
{% for agent_name, agent in t3_agents.items() %}
{% set pak = agent.pass_at_k or {} %}
{% set t3_branches = [('With skill', pak.with_skill), ('Without skill', pak.without_skill)] | selectattr('1', 'mapping') | selectattr('1.cases') | list %}
{% set t3_case_ids = [] %}
{% for cond_label, branch in t3_branches %}{% for case_id in branch.cases %}{% if case_id not in t3_case_ids %}{% set _ = t3_case_ids.append(case_id) %}{% endif %}{% endfor %}{% endfor %}
{# Agent -> case -> condition, so each case's with/without rows sit together. #}
{% for case_id in t3_case_ids | sort %}
{% for cond_label, branch in t3_branches if case_id in branch.cases %}
{% set _ = t3_attempt_rows.append({'agent': agent_name, 'condition': cond_label, 'arm': 'with_skill' if branch is sameas pak.with_skill else 'without_skill', 'case_id': case_id, 'case': branch.cases[case_id]}) %}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
{% set t3_attempt_verdict_by_trial = {} %}
{% for agent_name, agent in t3_agents.items() %}
{% for condition, trial_rows in [('With skill', agent.trials), ('Without skill', agent.trials_baseline)] %}
{% for trial in trial_rows or [] %}
{% set attempt_verdict = trial.get('attempt_verdict') %}
{% if trial.get('trial_id') and attempt_verdict is mapping %}
{% set _ = t3_attempt_verdict_by_trial.update({(agent_name, condition, trial.get('trial_id')): attempt_verdict}) %}
{% endif %}
{% endfor %}
{% endfor %}
{% endfor %}
{% set t3_recovered_rows = namespace(any=false) %}
{% for row in t3_attempt_rows %}{% if (row.case.get('attempts_recovered') or 0) > 0 %}{% set t3_recovered_rows.any = true %}{% endif %}{% endfor %}
{% if t3_attempt_rows %}
<details class="t3-details" id="tier3-attempt-details" open>
<summary>Attempt Details</summary>
<div class="t3-details-body">
<p class="t3-section-hint">
Each row is one eval case for one agent under one condition. Attempt Scores
lists the scored attempts {% if t3_recovered_rows.any %}and any recovered timeouts{% else %}only{% endif %}; a score at or above
{{ "%.2f" | format(t3_pass_threshold) }} counts as passed for Pass@{{ t3_max_attempts }}
when scored goal accuracy is at least
{{ "%.2f" | format(t3_verdict_policy.get('goal_accuracy_pass_threshold', 1.0)) }}
and scored security is at least
{{ "%.2f" | format(t3_verdict_policy.get('security_pass_threshold', 1.0)) }}.
"Not scored" means no reward was found for that expected attempt; it is excluded from pass/fail.
{% if t3_recovered_rows.any %}"Timed out, recovered" marks an agent timeout that a later scored
attempt of the same case recovered; the chip shows the attempt number when the report has it,
and otherwise a count. It is not scored, but it used one of the case's attempts, so it counts
in the attempt total under Scored Attempts (the second number), not in the scored count.{% endif %}
</p>
<div class="t3-filter-bar">
<input class="t3-filter-input" type="search" placeholder="Filter by agent, case, condition, score..." oninput="tier3FilterTable(this, 't3-attempts-table')" aria-label="Filter attempt details">
<span class="t3-filter-count" data-tier3-filter-count="t3-attempts-table">{{ t3_attempt_rows | length }} / {{ t3_attempt_rows | length }}</span>
</div>
<div class="table-scroll">
<table class="summary-table" id="t3-attempts-table">
<thead><tr>
<th>Agent</th><th>Condition</th><th>Eval Case</th>
<th>Attempt Scores</th><th>Scored Attempts</th>
<th>Best Score</th><th>Result</th>
</tr></thead>
<tbody>
{% for row in t3_attempt_rows %}
{% set case_data = row.case %}
{% set attempts = case_data.get('attempts') or [] %}
{% set attempts_used_value = case_data.get('attempts_used') %}
{% set attempts_missing_value = case_data.get('attempts_missing') %}
{% set attempts_skipped_value = case_data.get('attempts_skipped') %}
{% set attempts_used = attempts_used_value | int if attempts_used_value is not none else (attempts | length) %}
{% set attempts_missing = attempts_missing_value | int if attempts_missing_value is not none else 0 %}
{% set attempts_skipped = attempts_skipped_value | int if attempts_skipped_value is not none else 0 %}
{% set attempts_recovered_value = case_data.get('attempts_recovered') %}
{% set attempts_recovered = attempts_recovered_value | int if attempts_recovered_value is not none else 0 %}
{# A recovered agent timeout is unscored but used a physical attempt: count it so the
denominator stays the case's attempt budget, matching the attempt numbers shown. #}
{% set total_expected = attempts_used + attempts_missing + attempts_skipped + attempts_recovered %}
{% if total_expected == 0 %}{% set total_expected = t3_max_attempts %}{% endif %}
{# Attempt numbers of recovered timeouts come from the arm's bounded recovery list;
when that list does not account for every recovery, show the count instead. #}
{% set recovered_ordinals = [] %}
{% if attempts_recovered > 0 %}
{% set row_conditions = t3_agents[row.agent].conditions %}
{% set row_condition = row_conditions.get(row.arm) if row_conditions is mapping else none %}
{% set recovered_items = row_condition.get('recovered_attempts') if row_condition is mapping else none %}
{% if recovered_items is sequence and recovered_items is not string and recovered_items is not mapping %}
{% for item in recovered_items if item is mapping and item.get('case_id') == row.case_id and item.get('attempt') is integer and item.get('attempt') > 0 %}
{% if item.get('attempt') not in recovered_ordinals %}{% set _ = recovered_ordinals.append(item.get('attempt')) %}{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% set recovered_ordinals = recovered_ordinals | sort if recovered_ordinals | length == attempts_recovered else [] %}
{% set best_score = case_data.get('best_score') %}
{% set passed = case_data.get('passed') %}
{% set first_pass_attempt = case_data.get('first_pass_attempt') %}
<tr>
<td><strong>{{ row.agent }}</strong></td>
<td>{{ row.condition }}</td>
<td style="font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:0.82rem;">{{ row.case_id }}</td>
<td>
{% if attempts or attempts_recovered %}
<div class="t3-attempt-list">
{% set pending_recovered = namespace(ordinals=recovered_ordinals) %}
{% for att in attempts %}
{% set sc = att.get('score') %}
{% set att_idx_value = att.get('attempt') %}
{% set att_idx = att_idx_value | int if att_idx_value is not none else loop.index %}
{% for ordinal in pending_recovered.ordinals if ordinal < att_idx %}
<span class="t3-attempt-chip muted" title="Attempt {{ ordinal }}: agent timed out; a later scored attempt recovered it. Not scored.">A{{ ordinal }}: timed out, recovered</span>
{% endfor %}
{% set pending_recovered.ordinals = pending_recovered.ordinals | reject('lt', att_idx) | list %}
{% set attempt_verdict = t3_attempt_verdict_by_trial.get((row.agent, row.condition, att.get('trial'))) or {} %}
{% set attempt_passed = att.get('passed') and attempt_verdict.get('passed', true) %}
{% set attempt_reason = attempt_verdict.get('reason') or att.get('reason') %}
{% if sc is none %}
<span class="t3-attempt-chip muted" title="Attempt {{ att_idx }}: not scored">A{{ att_idx }}: not scored</span>
{% else %}
{% set chip_cls = 'pass' if attempt_passed else ('warn' if sc >= 0.4 else 'fail') %}
{% set chip_label = 'PASS' if attempt_passed else 'FAIL' %}
<span class="t3-attempt-chip {{ chip_cls }}" title="{{ attempt_reason or '' }}">A{{ att_idx }}: {{ "%.2f" | format(sc) }} {{ chip_label }}</span>
{% endif %}
{% endfor %}
{% for ordinal in pending_recovered.ordinals %}
<span class="t3-attempt-chip muted" title="Attempt {{ ordinal }}: agent timed out; a later scored attempt recovered it. Not scored.">A{{ ordinal }}: timed out, recovered</span>
{% endfor %}
{% if attempts_recovered and not recovered_ordinals %}
<span class="t3-attempt-chip muted" title="Agent timeouts that later scored attempts recovered. Not scored.">{{ attempts_recovered }} timed out, recovered</span>
{% endif %}
{# Published attempt rows are capped per run, so a recovered case can arrive with no
rows; say so instead of letting the recovered chip read as the whole history. #}
{% if not attempts %}
{% if attempts_used > 0 %}
<span class="t3-attempt-chip muted" title="The report keeps details for a limited number of attempts; this case's {{ attempts_used }} scored attempt{{ 's' if attempts_used != 1 else '' }} still count{{ 's' if attempts_used == 1 else '' }} but {{ 'is' if attempts_used == 1 else 'are' }} not listed.">scored attempt details omitted</span>
{% else %}
<span class="t3-attempt-chip muted">no attempts recorded</span>
{% endif %}
{% endif %}
</div>
{% else %}
<span class="t3-attempt-chip muted">no attempts recorded</span>
{% endif %}
</td>
<td style="font-variant-numeric:tabular-nums;"{% if attempts_recovered %} title="Includes {{ attempts_recovered }} recovered agent timeout{{ 's' if attempts_recovered != 1 else '' }}, which {{ 'are' if attempts_recovered != 1 else 'is' }} not scored"{% endif %}>{{ attempts_used }} of {{ total_expected }} scored</td>
<td>
{% if best_score is not none %}
{% set bg = 'rgba(34,197,94,0.18)' if best_score >= t3_pass_threshold else ('rgba(234,179,8,0.18)' if best_score >= 0.4 else 'rgba(239,68,68,0.18)') %}
{% set fg = 'var(--success-color)' if best_score >= t3_pass_threshold else ('var(--warning-color)' if best_score >= 0.4 else 'var(--danger-color)') %}
<span style="background:{{ bg }};color:{{ fg }};font-weight:700;padding:0.18rem 0.5rem;border-radius:4px;font-variant-numeric:tabular-nums;">{{ "%.2f" | format(best_score) }}</span>
{% else %}
<span style="color:var(--text-secondary);">—</span>
{% endif %}
</td>
<td>
{% set outcome = namespace(passed=passed, first_pass=first_pass_attempt, reason=none, warnings=[]) %}
{% if attempts %}
{% set outcome.passed = false %}
{% set outcome.first_pass = none %}
{% for att in attempts %}
{% set attempt_verdict = t3_attempt_verdict_by_trial.get((row.agent, row.condition, att.get('trial'))) or {} %}
{% set attempt_passed = att.get('passed') and attempt_verdict.get('passed', true) %}
{% if attempt_passed %}
{% set outcome.passed = true %}
{% if outcome.first_pass is none %}{% set outcome.first_pass = att.get('attempt') or loop.index %}{% endif %}
{% elif attempt_verdict.get('reason') and outcome.reason is none %}
{% set outcome.reason = attempt_verdict.get('reason') %}
{% endif %}
{% for warning in attempt_verdict.get('warnings') or [] %}
{% if warning not in outcome.warnings %}{% set _ = outcome.warnings.append(warning) %}{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% if outcome.passed and outcome.first_pass is not none %}
<span class="t3-pill ok">passed on attempt {{ outcome.first_pass | int }}</span>
{% elif outcome.passed %}
<span class="t3-pill ok">passed</span>
{% elif attempts_used > 0 and outcome.reason %}
<span class="t3-pill critical">FAIL</span> {{ outcome.reason }}
{% elif attempts_used > 0 %}
<span class="t3-pill critical">failed across {{ attempts_used }} scored attempt{{ 's' if attempts_used != 1 else '' }}</span>
{% else %}
<span class="t3-pill warning">not scored</span>
{% endif %}
{% for warning in case_data.get('warnings') or [] %}
<br><span class="t3-pill warning">WARNING</span> {{ warning }}
{% endfor %}
{% for warning in outcome.warnings %}
{% if warning not in (case_data.get('warnings') or []) %}
<br><span class="t3-pill warning">WARNING</span> {{ warning }}
{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</details>
{% endif %}
{# ----- Detailed per-evaluator drill-down (collapsed; preserves all original info) ----- #}
<details class="t3-details">
<summary>Per-Evaluator Drill-Down</summary>
<div class="t3-details-body">
<div class="t3-filter-bar">
<input class="t3-filter-input" type="search" placeholder="Filter by agent, condition, case, score..." oninput="tier3FilterTable(this, 't3-trials-table')" aria-label="Filter trials">
<span class="t3-filter-count" data-tier3-filter-count="t3-trials-table">{{ t3_condition_trial_rows | length }} / {{ t3_condition_trial_rows | length }}</span>
</div>
{% if tier3_preview_notice and tier3_preview_notice.get('trial_rows') %}
<p style="color:var(--text-secondary);font-size:0.82rem;">The HTML preview left out {{ tier3_preview_notice['trial_rows'] }} per-trial row{{ 's' if tier3_preview_notice['trial_rows'] != 1 else '' }}: it caps with-skill rows across all agents and baseline rows per agent, so the two conditions can list different numbers of rows. JSON Downloads keep every trial.</p>
{% endif %}
<div class="table-scroll">
<table class="summary-table" id="t3-trials-table">
<thead><tr>
<th>Agent</th><th>Condition</th><th>Entry</th><th>Overall</th>
{% for eval_id in t3_eval_ids %}<th>{{ eval_id | replace("_", " ") | title }}</th>{% endfor %}
<th>Steps</th><th>Tokens</th><th>Warnings</th>
</tr></thead>
<tbody>
{% for row in t3_condition_trial_rows %}
{% set trial = row.trial %}
{% set scores = trial.scores or {} %}
{% set reasons = trial.score_reasons if trial.score_reasons is mapping else {} %}
{% set tokens = trial.tokens or {} %}
<tr>
<td><strong>{{ row.agent }}</strong></td>
<td>{{ row.condition }}</td>
<td style="font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:0.82rem;">{{ trial.entry_id or trial.trial_id or '?' }}</td>
<td style="background:{{ 'rgba(34,197,94,0.14)' if (trial.overall or 0) >= 0.7 else ('rgba(234,179,8,0.14)' if (trial.overall or 0) >= 0.4 else 'rgba(239,68,68,0.14)') }}; color:{{ 'var(--success-color)' if (trial.overall or 0) >= 0.7 else ('var(--warning-color)' if (trial.overall or 0) >= 0.4 else 'var(--danger-color)') }};font-weight:700;">
{{ "%.2f" | format(trial.overall) if trial.overall is not none else "—" }}
</td>
{% for eval_id in t3_eval_ids %}
{% set s = scores.get(eval_id) %}
{% set cell_na = s is none and eval_id in (trial.not_applicable_metrics or []) %}
{% set cell_reason = reasons.get(eval_id) if s is not none else (("Not applicable: " ~ (eval_id | not_applicable_reason(row.condition == 'With skill'))) if cell_na else none) %}
{% set cell_text = "%.2f" | format(s) if s is not none else ("N/A" if cell_na else "—") %}
<td style="{% if s is not none %}background:{{ 'rgba(34,197,94,0.14)' if s >= 0.7 else ('rgba(234,179,8,0.14)' if s >= 0.4 else 'rgba(239,68,68,0.14)') }}; color:{{ 'var(--success-color)' if s >= 0.7 else ('var(--warning-color)' if s >= 0.4 else 'var(--danger-color)') }}; font-weight:600;{% elif cell_na %}color:var(--text-secondary);{% endif %}"{% if cell_na %} data-not-applicable="true"{% endif %}{% if cell_reason %} title="{{ eval_id | replace('_', ' ') | title }}: {{ cell_reason }}"{% endif %}>{% if cell_reason %}<span class="t3-score-reason">{{ cell_text }}</span>{% else %}{{ cell_text }}{% endif %}</td>
{% endfor %}
<td>{{ trial.steps if trial.steps is number else "—" }}</td>
<td>{% if tokens.prompt is number and tokens.completion is number %}{{ tokens.prompt + tokens.completion }}{% else %}—{% endif %}</td>
<td>{% if trial.warnings %}<span class="t3-pill warning">{{ trial.warnings | length }}</span>{% else %}—{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</details>
{% else %}
<p style="color:var(--text-secondary);">No per-trial data available for this run.</p>
{% endif %}
{% set t3_lift_trials = [] %}
{% for trial in tier3.trials or [] %}
{% if trial.lift_scores is defined and trial.get('diagnostic_only') is not sameas true and trial.get('scored') is not sameas false and (trial.agent or '(default)') not in tier3_diagnostic_comparison_agents %}
{% set _ = t3_lift_trials.append(trial) %}
{% endif %}
{% endfor %}
{% if t3_lift_trials %}
<details class="t3-details" id="tier3-lift-per-case" open>
<summary>Lift per Eval Case</summary>
<div class="t3-details-body">
<p style="color:var(--text-secondary);font-size:0.85rem;margin:0 0 0.75rem;">
Per-trial with-skill versus baseline. Each bar shows the baseline portion (gray) and the with-skill portion (color); the chip on the right is the delta.
</p>
{# Group lift trials by agent for readability; track ordered agent list #}
{% set t3_lift_grouped = {} %}
{% set t3_lift_agent_order = [] %}
{% for trial in t3_lift_trials %}
{% set agent_name = trial.agent or '(default)' %}
{% if agent_name not in t3_lift_grouped %}
{% set _ = t3_lift_grouped.update({agent_name: []}) %}
{% set _ = t3_lift_agent_order.append(agent_name) %}
{% endif %}
{% set _ = t3_lift_grouped[agent_name].append(trial) %}
{% endfor %}
{% for agent_name in t3_lift_agent_order %}
{% set agent_trials = t3_lift_grouped[agent_name] %}
<div class="t3-lift-agent-block">
<h4>{{ agent_name }} <span style="color:var(--text-secondary);font-weight:600;font-size:0.78rem;">({{ agent_trials | length }} trial{{ 's' if agent_trials|length != 1 else '' }})</span></h4>
{% for trial in agent_trials %}
<div class="t3-lift-case-block">
<div class="t3-lift-case-id">{{ trial.entry_id or trial.trial_id or '?' }}</div>
<div class="t3-lift-grid">
{% for eval_id in t3_eval_ids %}
{% set score = (trial.scores or {}).get(eval_id) %}
{% set base = (trial.baseline_scores or {}).get(eval_id) %}
{% set lift = (trial.lift_scores or {}).get(eval_id) %}
{% if lift is not none and score is not none and base is not none %}
{% set lift_class = 'up' if lift >= tier3_lift_pass_threshold else ('down' if lift <= tier3_lift_fail_threshold else 'flat') %}
{% set base_pct = (base * 100) | round(1) %}
{% set with_pct = (score * 100) | round(1) %}
<div class="t3-lift-row">
<span class="t3-lift-label">{{ eval_id | replace("_", " ") | title }}</span>
<div style="display:flex;align-items:center;gap:0.5rem;">
<div class="t3-lift-bar" style="flex:1;">
<div class="t3-lift-base" style="width:{{ base_pct }}%;"></div>
<div class="t3-lift-with {{ lift_class }}" style="width:{{ with_pct }}%;opacity:0.85;"></div>
<div class="t3-lift-text"><span style="color:var(--text-secondary);font-weight:600;">{{ "%.2f" | format(base) }}</span>→<span>{{ "%.2f" | format(score) }}</span></div>
</div>
<span class="t3-delta {{ lift_class }}" style="min-width:3.6rem;text-align:center;">{{ "%+.2f" | format(lift) }}</span>
</div>
</div>
{% endif %}
{% endfor %}
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</details>
{% endif %}
{% set t3_recovery_trials = (tier3.trials or []) | selectattr('error_recovery', 'defined') | list %}
{% if t3_recovery_trials %}
<details class="t3-details" id="tier3-error-recovery" open>
<summary>Error Recovery</summary>
<div class="t3-details-body">
<p style="color:var(--text-secondary);font-size:0.85rem;">Trials with failures, warnings, or retry/fault evidence.</p>
<div class="table-scroll">
<table class="summary-table">
<thead><tr><th>Agent</th><th>Case</th><th>First Attempt</th><th>Faults</th><th>Details</th></tr></thead>
<tbody>
{% set t3_fault_trials = [] %}
{% for trial in t3_recovery_trials %}{% set recovery = trial.error_recovery or {} %}{% if recovery.skill_faults or recovery.agent_faults or recovery.first_attempt == 'retries needed' or recovery.details or trial.warnings %}{% set _ = t3_fault_trials.append(trial) %}{% endif %}{% endfor %}
{% if not t3_fault_trials %}
<tr><td colspan="5" style="color:var(--text-secondary);">No faults, retries or warnings recorded in {{ t3_recovery_trials | length }} trial{{ 's' if t3_recovery_trials | length != 1 else '' }}.</td></tr>
{% endif %}
{% for trial in t3_fault_trials %}
{% set recovery = trial.error_recovery or {} %}
<tr>
<td><strong>{{ trial.agent or '(default)' }}</strong></td>
<td>{{ trial.entry_id or trial.trial_id or '?' }}</td>
<td><span class="t3-pill {{ 'critical' if recovery.first_attempt == 'retries needed' else 'neutral' }}">{{ recovery.first_attempt or 'review' }}</span></td>
<td>
{% if recovery.skill_faults %}<span class="t3-pill critical">{{ recovery.skill_faults }} skill</span>{% endif %}
{% if recovery.agent_faults %}<span class="t3-pill warning">{{ recovery.agent_faults }} agent</span>{% endif %}
{% if not recovery.skill_faults and not recovery.agent_faults %}<span style="color:var(--text-secondary);">unclassified</span>{% endif %}
</td>
<td style="font-size:0.85rem;color:var(--text-secondary);">{{ (recovery.details or trial.warnings or []) | join('; ') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</details>
{% endif %}
{% set t3_warning_trials = (tier3.trials or []) | selectattr('warnings', 'defined') | selectattr('warnings') | list %}
{% if t3_warning_trials %}
<details class="t3-details">
<summary>Trial Warnings</summary>
<div class="t3-details-body">
<table class="summary-table" style="width:100%;">
<thead><tr><th>Agent</th><th>Entry</th><th>Warnings</th></tr></thead>
<tbody>
{% for trial in t3_warning_trials %}
<tr>
<td>{{ trial.agent or '(default)' }}</td>
<td>{{ trial.entry_id or trial.trial_id }}</td>
<td>{{ trial.warnings | join('; ') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</details>
{% endif %}
{{ render_telemetry(tier3_telemetry) }}
{{ render_plugin_evidence(plugin_evidence, 'trials') }}
</section>
{# ---------- Agent Details ---------- #}
<section class="t3-page" id="tier3-page-agents" role="tabpanel" aria-labelledby="tier3-tab-agents" tabindex="0">
{{ render_native_evidence(native_evidence, 'agents') }}
{% if t3_coverage_messages %}
<div class="t3-truncation-notice t3-coverage-notice" id="tier3-coverage-notices" role="status">
<strong>Agent coverage notes</strong>
<ul>
{% for message in t3_coverage_messages %}
<li>{{ message }}</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if t3_agents %}
{% set t3_palette = ["#76b900","#8b5cf6","#ec4899","#06b6d4","#3b82f6","#f59e0b","#22c55e"] %}
<nav class="t3-agent-tabs" role="tablist" aria-label="Agent details">
{% for name, agent in t3_agents.items() %}
{% set agent_idx = loop.index0 %}
{% set agent_color = t3_palette[agent_idx % (t3_palette | length)] %}
{% set agent_score = agent.with_skill %}
<button class="t3-agent-tab-btn{% if loop.first %} active{% endif %}"
role="tab" id="tier3-agent-tab-{{ loop.index0 }}" aria-controls="{{ t3_agent_panel_ids[name] }}" aria-selected="{{ 'true' if loop.first else 'false' }}" tabindex="{{ '0' if loop.first else '-1' }}"
data-tier3-agent="{{ name }}"
data-tier3-agent-panel-id="{{ t3_agent_panel_ids[name] }}"
style="--accent: {{ agent_color }};"
onclick="showTier3Agent(this.getAttribute('data-tier3-agent-panel-id'), this)">
<span class="t3-tab-dot"></span>{{ name }}
<span class="t3-tab-score">{{ "%.2f" | format(agent_score) if agent_score is not none else "N/A" }}{% if agent.lift is not none %} ({{ "%+.2f" | format(agent.lift) }}){% endif %}</span>
</button>
{% endfor %}
</nav>
{% for name, agent in t3_agents.items() %}
{% set agent_idx = loop.index0 %}
{% set agent_color = t3_palette[agent_idx % (t3_palette | length)] %}
{% set agent_score = agent.with_skill %}
{% set agent_score_color = 'var(--text-secondary)' if agent_score is none else ('var(--success-color)' if agent_score >= 0.7 else ('var(--warning-color)' if agent_score >= 0.4 else 'var(--danger-color)')) %}
{% set extremes = namespace(best=none, worst=none) %}
{% for d in agent.dimensions or [] %}
{% set dscore = d.score if d.score is not none else d.with_skill %}
{% if dscore is number %}
{% if extremes.best is none or dscore > (extremes.best.score if extremes.best.score is not none else extremes.best.with_skill) %}{% set extremes.best = d %}{% endif %}
{% if extremes.worst is none or dscore < (extremes.worst.score if extremes.worst.score is not none else extremes.worst.with_skill) %}{% set extremes.worst = d %}{% endif %}
{% endif %}
{% endfor %}
{% set best_dim = extremes.best %}{% set worst_dim = extremes.worst %}
<div class="t3-agent-panel{% if loop.first %} active{% endif %}" id="{{ t3_agent_panel_ids[name] }}" data-tier3-agent="{{ name }}" role="tabpanel" aria-labelledby="tier3-agent-tab-{{ loop.index0 }}" tabindex="0">
{# Stable, index-based scroll target for jumpToTier3Agent. Raw agent
names can contain characters that are unsafe in CSS/HTML IDs (slashes,
dots), so deep-links from Overview point at this anchor instead of
the panel id. The data-tier3-agent-name attribute lets the JS look
up the matching tab button to switch panels in one call. #}
<a id="{{ t3_agent_anchor_ids[name] }}"
class="t3-agent-anchor"
data-tier3-agent-name="{{ name }}"
data-tier3-agent-panel-id="{{ t3_agent_panel_ids[name] }}"
tabindex="-1"
aria-hidden="true"></a>
{% set agent_coverage = presentation.coverage.agents.get(name, {}) %}
{% if agent_coverage %}<dl class="t3-agent-coverage" aria-label="Recorded agent condition coverage">
{% for condition, label in [('with_skill', 'With skill'), ('without_skill', 'Without skill')] %}{% set arm = agent_coverage.get(condition) %}{% if arm %}
<div><dt>{{ label }}</dt><dd>{% if arm.status == 'skipped' %}Skipped{% else %}{{ arm.scored if arm.scored is not none else '?' }} of {{ arm.expected if arm.expected is not none else '?' }} scored · {{ arm.status | title }}{% endif %}</dd></div>
{% endif %}{% endfor %}
</dl>{% endif %}
{# KPI strip #}
<div class="t3-kpi-strip">
<div class="t3-kpi-card" style="border-top:3px solid {{ agent_color }};">
<div class="t3-kpi-label">Overall Score</div>
<div class="t3-kpi-value" style="color:{{ agent_score_color }};">{{ "%.2f" | format(agent_score) if agent_score is not none else "N/A" }}</div>
<div class="t3-kpi-sub">baseline {{ "%.2f" | format(agent.baseline) if agent.baseline is not none else "N/A" }}</div>
</div>
<div class="t3-kpi-card">
<div class="t3-kpi-label">Skill Lift</div>
{% if agent.lift is not none %}
{% set lift_color = 'var(--success-color)' if agent.lift >= tier3_lift_pass_threshold else ('var(--danger-color)' if agent.lift <= tier3_lift_fail_threshold else 'var(--text-secondary)') %}
<div class="t3-kpi-value" style="color:{{ lift_color }};">{{ "%+.2f" | format(agent.lift) }}</div>
<div class="t3-kpi-sub">{% if agent.lift >= tier3_lift_pass_threshold %}positive{% elif agent.lift <= tier3_lift_fail_threshold %}regression{% else %}neutral{% endif %}</div>
{% else %}
<div class="t3-kpi-value" style="color:var(--text-secondary);">N/A</div>
{% set baseline_condition = agent.conditions.get('without_skill') if agent.conditions is mapping else none %}
{% set baseline_condition = baseline_condition if baseline_condition is mapping else {} %}
<div class="t3-kpi-sub">{% if agent.get('skill_activation', {}).get('status') == 'never_activated' %}inconclusive: skill never activated{% elif agent.with_skill is none and agent.baseline is not none %}with-skill unavailable{% elif agent.with_skill is none %}N/A lift{% elif agent.baseline is not none %}comparison unavailable{% elif baseline_condition.get('execution_status') != 'skipped' and (agent.num_trials_baseline or baseline_condition.get('execution_status') in ['succeeded', 'failed', 'incomplete']) %}Overall baseline unavailable{% else %}no baseline{% endif %}</div>
{% endif %}
<div class="t3-kpi-sub"><a href="#tier3-number-key">How lift is measured</a></div>
</div>
<div class="t3-kpi-card">
<div class="t3-kpi-label">Trials</div>
<div class="t3-kpi-value">{{ agent.num_trials or 0 }}</div>
<div class="t3-kpi-sub">{% if agent.num_trials_baseline %}{{ agent.num_trials_baseline }} baseline{% else %}with-skill only{% endif %}</div>
</div>
{% if best_dim %}
{% set best_score = best_dim.score if best_dim.score is not none else best_dim.with_skill %}
<div class="t3-kpi-card">
<div class="t3-kpi-label">Best Dimension</div>
<div class="t3-kpi-value" style="font-size:1.1rem; color:var(--success-color);">{{ best_dim.id | title }}</div>
<div class="t3-kpi-sub">{{ "%.2f" | format(best_score) }}</div>
</div>
{% endif %}
{% if worst_dim and worst_dim.id != (best_dim.id if best_dim else None) %}
{% set worst_score = worst_dim.score if worst_dim.score is not none else worst_dim.with_skill %}
<div class="t3-kpi-card">
<div class="t3-kpi-label">Weakest Dimension</div>
<div class="t3-kpi-value" style="font-size:1.1rem; color:var(--danger-color);">{{ worst_dim.id | title }}</div>
<div class="t3-kpi-sub">{{ "%.2f" | format(worst_score) }}</div>
</div>
{% endif %}
</div>
{# SkillEvaluator Dimension Mapping pill strip #}
{% if agent.dimensions or agent.findings %}
<div class="t3-dim-strip" aria-label="SkillEvaluator dimensions">
{% set dim_source = agent.dimensions or agent.findings %}
{% for d in dim_source %}
{% set d_score = d.score if d.score is not none else d.with_skill %}
{% set d_id = d.id or d.dimension or d.label %}
{% set d_color = 'var(--text-secondary)' if d_score is none else ('var(--success-color)' if d_score >= 0.7 else ('var(--warning-color)' if d_score >= 0.4 else 'var(--danger-color)')) %}
<div class="t3-dim-pill" title="{{ t3_dim_hints.get(d_id) or d.explanation or '' }}">
<span class="t3-dim-name">{{ d_id | replace("_", " ") }}</span>
<span class="t3-dim-score" style="color:{{ d_color }};">{{ "%.2f" | format(d_score) if d_score is not none else "N/A" }}</span>
{% if d.lift is not none %}
{% set lift_class = 'up' if d.lift >= tier3_lift_pass_threshold else ('down' if d.lift <= tier3_lift_fail_threshold else 'flat') %}
<span class="t3-delta {{ lift_class }}">{{ "%+.2f" | format(d.lift) }} lift</span>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
{# Vertically stacked evaluator cards #}
{% if agent.evaluator_cards %}
<div class="t3-eval-stack">
{% for card in agent.evaluator_cards %}
{% set card_score = card.with_skill or 0.0 %}
{% set card_color = 'var(--success-color)' if card_score >= 0.7 else ('var(--warning-color)' if card_score >= 0.4 else 'var(--danger-color)') %}
{% set arc_offset = (1 - (card_score | float)) * 175.93 %}
{% set baseline_pct = ((card.baseline or 0) * 100) | round(1) %}
{% set with_pct = (card_score * 100) | round(1) %}
<div class="t3-eval-card {{ card.status or 'warning' }}">
<div class="t3-eval-head">
<div>
<div class="t3-eval-title">{{ card.label }}</div>
{% if card.description %}<span class="t3-eval-desc">{{ card.description }}</span>{% endif %}
</div>
<div class="t3-eval-gauge" aria-label="Score {{ "%.2f" | format(card_score) }}">
<svg viewBox="0 0 64 64">
<circle class="t3-gauge-track" cx="32" cy="32" r="28"/>
<circle class="t3-gauge-arc" cx="32" cy="32" r="28"
stroke="{{ card_color }}"
stroke-dasharray="175.93"
stroke-dashoffset="{{ arc_offset }}"/>
</svg>
<div class="t3-gauge-text" style="color:{{ card_color }};">{{ "%.2f" | format(card_score) }}</div>
</div>
<div>
<span class="t3-pill {{ card.status or 'warning' }}">{{ card.status or 'review' }}</span>
{% if card.lift is not none %}
{% set ev_lift_class = 'up' if card.lift >= tier3_lift_pass_threshold else ('down' if card.lift <= tier3_lift_fail_threshold else 'flat') %}
<div class="t3-delta {{ ev_lift_class }}" style="margin-top:0.4rem; display:inline-block;">{{ "%+.2f" | format(card.lift) }} lift</div>
{% endif %}
{% set lift_excluded_cases = card.comparison_basis.excluded_cases if card.comparison_basis else 0 %}
{% if lift_excluded_cases %}
{% set one_lift_excluded_case = lift_excluded_cases == 1 %}
{% set lift_excluded_label = lift_excluded_cases ~ (' case' if one_lift_excluded_case else ' cases') %}
{# Only a card with both arm scores can say they include the cases. #}
<div class="t3-dim-hint t3-eval-lift-note">
{%- if card.lift is none and card.comparison_basis.contributing_attempts == 0 -%}
No lift: {{ lift_excluded_label }} {{ 'was' if one_lift_excluded_case else 'were' }} scored by different judge models and no comparable result remains
{%- elif card.lift is none -%}
No lift: {{ lift_excluded_label }} {{ 'was' if one_lift_excluded_case else 'were' }} scored by different judge models and the loaded results cannot confirm the comparison
{%- else -%}
Lift leaves out {{ lift_excluded_label }} scored by different judge models
{%- endif -%}
{%- if card.baseline is not none %}; the arm scores include {{ 'it' if one_lift_excluded_case else 'them' }}{% endif %}.</div>
{% endif %}
</div>
</div>
<div class="t3-eval-bars">
<span class="t3-bar-label">Baseline</span>
<div class="t3-bar-track"><div class="t3-bar-fill" style="width:{{ baseline_pct }}%; background:var(--text-secondary); opacity:0.55;"></div></div>
<span class="t3-bar-value" style="color:var(--text-secondary);">{{ "%.2f" | format(card.baseline) if card.baseline is not none else "N/A" }}</span>
<span class="t3-bar-label">With skill</span>
<div class="t3-bar-track"><div class="t3-bar-fill" style="width:{{ with_pct }}%; background:{{ card_color }};"></div></div>
<span class="t3-bar-value" style="color:{{ card_color }};">{{ "%.2f" | format(card_score) }}</span>
</div>
{% if card.evidence %}
{# Deduplicate evidence by entry_id: count + average score. Reasons come from the
lowest-scoring attempt that explains itself, so a passing attempt cannot hide
a failing attempt's reason; otherwise keep the first non-empty text. #}
{% set dedup_map = {} %}
{% set dedup_order = [] %}
{% for ev in card.evidence %}
{% set eid = ev.entry_id or 'trial' %}
{% if eid not in dedup_map %}
{% set _ = dedup_order.append(eid) %}
{% set _ = dedup_map.update({eid: {'count': 0, 'sum': 0.0, 'with_score': 0, 'notes': [], 'failures': [], 'checks': [], 'evidence_refs': [], 'evidence_unavailable_reason': none, 'excerpt': none, 'reason': none, 'reason_score': none, 'comparison_excluded': false}}) %}
{% endif %}
{% set entry = dedup_map[eid] %}
{% set ev_occurrences = ev.occurrences or 1 %}
{% set _ = entry.update({'count': entry.count + ev_occurrences}) %}
{% if ev.score is not none %}
{% set _ = entry.update({'sum': entry.sum + (ev.score * ev_occurrences), 'with_score': entry.with_score + ev_occurrences}) %}
{% endif %}
{# Keep built reasons separate from the bounded grader notes. #}
{% set ev_notes = ev.notes or [] %}
{% if (ev_notes or ev.reason or ev.failures or ev.excerpt) and ev.score is not none and (entry.reason_score is none or ev.score < entry.reason_score) %}
{% set _ = entry.update({'notes': ev_notes, 'reason': ev.reason or none, 'failures': ev.failures or [], 'excerpt': ev.excerpt or none, 'reason_score': ev.score}) %}
{% elif entry.reason_score is none %}
{% if ev_notes and not entry.notes %}{% set _ = entry.update({'notes': ev_notes}) %}{% endif %}
{% if ev.reason and not entry.reason %}{% set _ = entry.update({'reason': ev.reason}) %}{% endif %}
{% if ev.failures and not entry.failures %}{% set _ = entry.update({'failures': ev.failures}) %}{% endif %}
{% if ev.excerpt and not entry.excerpt %}{% set _ = entry.update({'excerpt': ev.excerpt}) %}{% endif %}
{% endif %}
{% if ev.checks and not entry.checks %}{% set _ = entry.update({'checks': ev.checks}) %}{% endif %}
{% if ev.evidence_refs and not entry.evidence_refs %}{% set _ = entry.update({'evidence_refs': ev.evidence_refs}) %}{% endif %}
{% if ev.comparison_excluded %}{% set _ = entry.update({'comparison_excluded': true}) %}{% endif %}
{% if ev.evidence_unavailable_reason and not entry.evidence_unavailable_reason %}{% set _ = entry.update({'evidence_unavailable_reason': ev.evidence_unavailable_reason}) %}{% endif %}
{% endfor %}
{% set evidence_totals = namespace(trials=0) %}
{% for ev in card.evidence %}
{% set evidence_totals.trials = evidence_totals.trials + (ev.occurrences or 1) %}
{% endfor %}
<details class="t3-eval-evidence"{% if card.status == 'fail' %} open{% endif %}>
{% if card.evidence_sampling and card.evidence_sampling.truncated %}
<summary>Per-trial evidence (>={{ card.evidence_sampling.represented_cases }} cases, >={{ card.evidence_sampling.represented_trials }} of {{ card.evidence_sampling.total_trials }} trials; sampled first {{ card.evidence_sampling.scanned_trials }})</summary>
{% else %}
<summary>Per-trial evidence ({{ dedup_order | length }} cases, {{ evidence_totals.trials }} trials)</summary>
{% endif %}
<ul>
{% for eid in dedup_order %}
{% set ev = dedup_map[eid] %}
{% set avg_score = (ev.sum / ev.with_score) if ev.with_score else None %}
{% set ev_color = 'var(--success-color)' if (avg_score or 0) >= 0.7 else ('var(--warning-color)' if (avg_score or 0) >= 0.4 else 'var(--danger-color)') %}
<li>
<span class="t3-ev-id">{{ eid }}</span>
<span class="t3-ev-notes">
{% if ev.notes %}{{ (ev.notes[:2] | join('; '))[:160] }}{% endif %}
{% if ev.failures %}<span style="color:var(--danger-color);">{{ (ev.failures[:2] | join('; '))[:120] }}</span>{% endif %}
{% if not ev.notes and not ev.failures and ev.checks %}{{ (ev.checks | length) }} checks{% endif %}
{% if ev.evidence_refs %}<span class="t3-ev-refs">Evidence: {{ ev.evidence_refs[:3] | join('; ') }}</span>{% elif ev.evidence_unavailable_reason %}<span class="t3-ev-refs">Evidence unavailable — {{ ev.evidence_unavailable_reason }}</span>{% endif %}
</span>
<span class="t3-ev-count">×{{ ev.count }}</span>
{% if avg_score is not none %}
<span class="t3-bar-value" style="color:{{ ev_color }};">{{ "%.2f" | format(avg_score) }}</span>
{% else %}
<span class="t3-bar-value" style="color:var(--text-secondary);">N/A</span>
{% endif %}
{% if ev.reason %}<div class="t3-ev-detail t3-ev-reason">{{ ev.reason }}</div>{% endif %}
{% if ev.excerpt %}<div class="t3-ev-detail"><code class="t3-ev-excerpt">{{ ev.excerpt }}</code></div>{% endif %}
{% if ev.comparison_excluded %}<div class="t3-ev-detail t3-ev-lift-excluded">Left out of lift: different judge models</div>{% endif %}
</li>
{% endfor %}
</ul>
</details>
{% endif %}
</div>
{% endfor %}
</div>
{% endif %}
</div>
{% endfor %}
{% else %}
<p style="color:var(--text-secondary);">No per-agent data available.</p>
{% endif %}
{{ render_plugin_evidence(plugin_evidence, 'agents') }}
</section>
{# ---------- Dataset ---------- #}
<section class="t3-page" id="tier3-page-dataset" role="tabpanel" aria-labelledby="tier3-tab-dataset" tabindex="0">
{% if dataset_diagnostics_view %}<p class="t3-section-hint" id="dataset-diagnostic-guidance">Recorded verdicts, not inferred skill defects. Evidence excerpts are metric-level context; inspect the trial for attribution.</p>{% endif %}
{% if insights_view.execution_errors %}<p><a href="#tier3-execution-errors">Shared run execution errors are retained once in Diagnostics.</a></p>{% endif %}
{% if t3_dataset %}
<div class="t3-dataset-hero">
<h2>Evaluation Dataset</h2>
<p style="color:var(--text-secondary);font-size:0.9rem;margin:0.25rem 0 0;">
{{ t3_dataset | length }} eval case{{ 's' if t3_dataset | length != 1 else '' }} used for this Tier 3 run.
</p>
<div class="t3-ds-meta" style="margin-top:0.75rem;">
<span class="t3-ds-chip">{{ content_label }}: <b>{{ tier3.skill_name or 'unknown' }}</b></span>
{% if t3_best_name %}<span class="t3-ds-chip">Best Performing Agent: <b>{{ t3_best_name }}</b></span>{% endif %}
{% set t3_env = (tier3.summary.environment if tier3.summary is defined and tier3.summary else None) or tier3.environment %}
{% set t3_backend = (tier3.summary.execution_backend if tier3.summary is defined and tier3.summary else None) | tier3_backend_label %}
{% if t3_backend %}<span class="t3-ds-chip">Backend: <b>{{ t3_backend }}</b></span>{% endif %}
{% if t3_env %}<span class="t3-ds-chip">Environment: <b>{{ t3_env }}</b></span>{% endif %}
<span class="t3-ds-chip">Schema: <b>v{{ tier3.schema_version or '2.0' }}</b></span>
</div>
</div>
<div class="t3-filter-bar">
<input class="t3-filter-input" type="search" placeholder="Filter eval cases by id, question, skill..." oninput="tier3FilterCards(this, 't3-dataset-list')" aria-label="Filter dataset">
<span class="t3-filter-count" data-tier3-filter-count="t3-dataset-list">{{ t3_dataset | length }} / {{ t3_dataset | length }}</span>
</div>
<div class="t3-dataset-list" id="t3-dataset-list">
{% for case in t3_dataset %}
{% set case_prompt = case.prompt or case.question %}
{% set case_expected_output = case.expected_output or case.ground_truth %}
{% set case_assertions = case.assertions or case.expected_behavior %}
{% set _hay = (case.id or '') ~ ' ' ~ (case_prompt or '') ~ ' ' ~ (case.expected_skill or '') ~ ' ' ~ (case.expected_script or '') ~ ' ' ~ (case.category or '') ~ ' ' ~ (case_expected_output or '') %}
<details class="t3-ds-card" id="tier3-dataset-case-{{ loop.index0 }}" data-tier3-filterable="{{ _hay }}"{% if loop.first %} open{% endif %}>
<summary>
<div class="t3-ds-head" style="margin-bottom:0;">
<span class="t3-ds-id">{{ case.id or 'case-' ~ loop.index }}</span>
<div class="t3-ds-meta">
<span class="t3-ds-chip">Skill: <b>{{ case.expected_skill if case.expected_skill else 'none' }}</b></span>
<span class="t3-ds-chip">Script: <b>{{ case.expected_script if case.expected_script else 'none' }}</b></span>
{% if case.category %}<span class="t3-ds-chip">Category: <b>{{ case.category }}</b></span>{% endif %}
</div>
</div>
</summary>
<div class="t3-ds-body">
{% if case_prompt %}
<div class="t3-ds-field">
<span class="t3-ds-label">Prompt</span>
<div class="t3-ds-value">{{ case_prompt }}</div>
</div>
{% endif %}
{% if case_expected_output %}
<div class="t3-ds-field">
<span class="t3-ds-label">Expected Output</span>
<div class="t3-ds-value t3-ds-gt">{{ case_expected_output }}</div>
</div>
{% endif %}
{% if case_assertions %}
<div class="t3-ds-field">
<span class="t3-ds-label">Assertions</span>
<ol class="t3-ds-behaviors">{% for b in case_assertions %}<li>{{ b }}</li>{% endfor %}</ol>
</div>
{% endif %}
{{ render_case_diagnostics(dataset_diagnostics_view, case.id, insights_view.execution_errors, loop.index0) }}
</div>
</details>
{% endfor %}
</div>
{% else %}
<p style="color:var(--text-secondary);">No dataset entries loaded for this run.</p>
{% endif %}
</section>
{# ---------- Insights (Conclusions + Recommendations) ---------- #}
<section class="t3-page" id="tier3-page-suggestions" role="tabpanel" aria-labelledby="tier3-tab-suggestions" tabindex="0">
{% set t3_has_conclusions = insights_view.conclusions and (insights_view.conclusions | length) > 0 %}
{% set t3_recommendations = insights_view.recommendations or [] %}
{% set t3_has_suggestions = (t3_recommendations | length) > 0 or (tier3.suggestions and (tier3.suggestions | length) > 0) %}
{% if t3_source_errors %}
<details class="t3-details" id="tier3-source-validation-errors" open>
<summary>Source Validation Errors ({{ t3_source_errors | length }})</summary>
<div class="t3-details-body">
<ol class="t3-next-steps-list">
{% for error in t3_source_errors %}
<li>{% if error.path %}{{ error.path }}: {% endif %}{{ error.message }}</li>
{% endfor %}
</ol>
</div>
</details>
{% endif %}
<details class="t3-method"><summary>About insight sources</summary>
<p style="color:var(--text-secondary);font-size:0.85rem;margin:0 0 0.85rem;">
Insights combine deterministic baselines (best performing agent, weakest dimension, coverage gaps)
with additional contextual observations and action items produced by an LLM-as-Judge.
The
<span class="t3-insight-source insight-source-deterministic">deterministic</span>
tag marks the stable baselines; the
<span class="t3-insight-source insight-source-llm">LLM</span>
tag marks judge-generated entries that may vary between runs.
{% if t3_evidence_links %}Evidence links open the matching Harbor trial or exact trajectory step when captured.{% endif %}
</p>
</details>
{% if t3_has_conclusions %}
<details class="t3-details" id="tier3-conclusions" open>
<summary>Conclusions</summary>
<div class="t3-details-body">
{{ insight_cards(insights_view.conclusions, mode='conclusion') }}
</div>
</details>
{% endif %}
{% if t3_effect %}<p class="t3-next-steps-conclusion">{% if insights_case_fix_count %}{{ insights_case_fix_count }} issue{{ 's' if insights_case_fix_count != 1 else '' }} to fix, most attempts lost first:{% else %}Nothing to fix in the available case evidence.{% endif %}</p>{% endif %}
<div id="tier3-run-next-steps">
{% if t3_has_suggestions %}
<details class="t3-details" open>
<summary>Recommendations</summary>
<div class="t3-details-body">
<div class="t3-sug-stack">
{% if t3_recommendations %}
{{ insight_cards(insights_view.recommendations) }}
{% else %}
{% for suggestion in tier3.suggestions %}
{% set fallback_evidence = none %}
{% if t3_evidence_links and (t3_evidence_links | length) > 0 %}
{% set fallback_evidence = t3_evidence_links[loop.index0 % (t3_evidence_links | length)] %}
{% endif %}
{% set first_word = (suggestion | string).split(' ')[0] | lower %}
{% set cat = 'Update' if first_word in ('update','revise','refactor','rewrite','rework')
else ('Add' if first_word in ('add','create','introduce','provide','include')
else ('Implement' if first_word in ('implement','build','develop','design','enable')
else ('Document' if first_word in ('document','clarify','describe','explain','note')
else ('Fix' if first_word in ('fix','correct','resolve','address','repair')
else ('Test' if first_word in ('test','verify','validate','check','ensure')
else 'Action'))))) %}
<div class="t3-sug-card severity-warn">
<span class="t3-sug-num">{{ loop.index }}</span>
<div>
<div class="t3-sug-title">
<span class="t3-sug-cat">{{ cat }}</span>
<span class="t3-insight-source insight-source-deterministic">deterministic</span>
</div>
<div class="t3-sug-body">{{ suggestion }}</div>
{% if fallback_evidence and fallback_evidence.url %}
<a class="t3-evidence-link" href="{{ fallback_evidence.url }}" target="_blank" rel="noopener">View {{ fallback_evidence.label or 'evidence' }}</a>
{% endif %}
</div>
<div class="t3-sug-actions">
<button class="t3-copy-btn" onclick='tier3CopyText(this, {{ (suggestion | string | tojson) }})'>Copy</button>
</div>
</div>
{% endfor %}
{% endif %}
</div>
</div>
</details>
{% endif %}
{{ insight_next_steps(remaining_insight_steps) }}
</div>
{% if not t3_source_errors and not t3_has_conclusions and not t3_has_suggestions %}
<p style="color:var(--text-secondary);">No evaluation insights were generated.</p>
{% endif %}
</section>
{# ---------- Diagnostics (raw SkillEvaluator data + downloads) ---------- #}
<section class="t3-page" id="tier3-page-provenance" role="tabpanel" aria-labelledby="tier3-tab-provenance" tabindex="0">
{{ render_native_evidence(native_evidence, 'provenance') }}
{% if harbor_jobs %}
<div class="t3-harbor-panel">
<div>
<strong>Harbor artifacts</strong>
<p>Open retained logs, raw trajectories, artifacts, and generated Harbor analysis for this Tier 3 run.</p>
</div>
<div class="t3-harbor-actions">
{% for job in harbor_jobs %}
{% set job_labels = [] %}
{% for row in t3_condition_trial_rows if job.url and row.trial.harbor_viewer and row.trial.harbor_viewer.job_url == job.url %}
{% set label = row.agent ~ ' · ' ~ row.condition %}{% if label not in job_labels %}{% set _ = job_labels.append(label) %}{% endif %}
{% endfor %}
<div><strong>{{ job_labels | join('; ') if job_labels else ('Run analysis' if job.name == 'Run analysis' else 'Job ' ~ loop.index) }}</strong>
<details class="t3-artifact-identifiers"><summary>Artifact identifiers</summary><code>{{ job.name }}</code>{% if job.url %}<div>{{ job.url }}</div>{% endif %}{% if job.analysis_url %}<div>{{ job.analysis_url }}</div>{% endif %}</details>
{% if job.url %}<a class="t3-harbor-link" href="{{ job.url }}" target="_blank" rel="noopener">Results</a>{% endif %}
{% if job.analysis_url %}<a class="t3-harbor-link" href="{{ job.analysis_url }}" target="_blank" rel="noopener">Analysis</a>{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
<p style="color:var(--text-secondary);">
Raw scores, execution errors, artifacts and downloads.
</p>
{% if insights_view.execution_errors %}
<details class="t3-details t3-execution-errors" id="tier3-execution-errors">
<summary>Full execution errors ({{ insights_view.execution_errors | length }})</summary>
<div class="t3-details-body"><ol>{% for error in insights_view.execution_errors %}<li><pre>{{ error }}</pre></li>{% endfor %}</ol></div>
</details>
{% endif %}
<details class="t3-details">
<summary>Recorded evaluation provenance</summary>
<div class="t3-details-body">
{% if tier3_dataset_provenance_line and not tier3_dataset_provenance_warning %}<p>{{ tier3_dataset_provenance_line }}</p>{% endif %}
<p>Only metadata recorded for this evaluation is shown. Missing values are unavailable.</p>
<dl class="t3-prov-grid">
<dt>Evaluator version</dt><dd>{{ tier3.evaluator_version or t3_summary.evaluator_version or 'Unavailable' }}</dd>
<dt>Dataset digest</dt><dd><code>{{ dataset_provenance[0] if dataset_provenance else 'Unavailable' }}</code></dd>
<dt>Dataset digest algorithm</dt><dd><code>{{ dataset_provenance[1] if dataset_provenance else 'Unavailable' }}</code></dd>
{% if evaluated_source %}
{% for field, value in evaluated_source.items() %}<dt>Evaluated source {{ field | replace('_', ' ') }}</dt><dd><code>{{ value }}</code></dd>{% endfor %}
{% else %}<dt>Evaluated source</dt><dd>Unavailable</dd>{% endif %}
{% for name, agent in t3_agents.items() %}
<dt>{{ name }} model</dt><dd>{{ agent.model or agent.model_name or agent.llm_model or 'Unavailable' }}</dd>
{% endfor %}
</dl>
</div>
</details>
{# Attempt Policy is configuration/provenance: useful for reproducing a run but not
an Overview decision signal. Keep it here so reviewers can confirm the exact
max-attempts / pass-threshold / stop-on-pass settings the run used. #}
{% if tier3.attempt_policy and (t3_max_attempts > 1 or t3_attempt_policy.stop_on_pass) %}
<div class="t3-section t3-collapsed" id="tier3-attempt-policy">
<strong>Attempt Policy:</strong> max attempts {{ t3_max_attempts }},
pass threshold ≥ {{ "%.2f" | format(t3_attempt_policy.pass_threshold or 0.5) }},
stop-on-pass {{ 'enabled' if t3_attempt_policy.stop_on_pass else 'disabled' }}.
</div>
{% endif %}
<details class="t3-details" id="tier3-json-downloads" open>
<summary>JSON Downloads</summary>
<div class="t3-details-body">
<p style="color:var(--text-secondary);font-size:0.85rem;margin:0 0 0.75rem;">
Use these to share or attach the underlying data to a bug report.
</p>
{% if ci.get('canonical_json_url') %}
<a class="t3-harbor-link" href="{{ ci.canonical_json_url }}" download="skillevaluator-report.json">Download canonical report JSON</a>
{% elif tier3_canonical_data %}
<div class="t3-download-grid">
<button class="t3-copy-btn" onclick="tier3DownloadJson('tier3-full', 'tier3-full.json')">Download Full Tier 3 Payload</button>
{% if t3_provenance.raw_evaluators %}
<button class="t3-copy-btn" onclick="tier3DownloadJson('tier3-raw-evaluators', 'tier3-raw-evaluators.json')">Download Raw Evaluators</button>
{% endif %}
{% if t3_provenance.raw_lift %}
<button class="t3-copy-btn" onclick="tier3DownloadJson('tier3-raw-lift', 'tier3-raw-lift.json')">Download Raw Lift</button>
{% endif %}
{% if t3_provenance.comparison %}
<button class="t3-copy-btn" onclick="tier3DownloadJson('tier3-comparison', 'tier3-comparison.json')">Download comparison.json</button>
{% endif %}
{% if tier3.timing %}
<button class="t3-copy-btn" onclick="tier3DownloadJson('tier3-timing', 'tier3-timing.json')">Download Pipeline Timing</button>
{% endif %}
</div>
{% else %}<p>No canonical Tier 3 payload was recorded. The report JSON includes the supplied passive plugin snapshots.</p>{% endif %}
</div>
</details>
{% if not ci.get('canonical_json_url') and tier3_canonical_data %}<script type="application/json" id="tier3-full"{% if tier3_canonical_encoding == 'base64' %} data-encoding="base64"{% endif %}>{{ tier3_canonical_data | safe }}</script>{% endif %}
{% if tier3.evaluators %}
<details class="t3-details">
<summary>Raw Evaluator Scores (best performing agent: {{ t3_best_name or 'N/A' }})</summary>
<div class="t3-details-body">
<table class="summary-table" style="width:100%;">
<thead><tr><th>Evaluator</th><th>With Skill</th><th>Baseline</th><th>Lift</th></tr></thead>
<tbody>
{% for name, scores in tier3.evaluators.items() %}
<tr>
<td><strong>{{ name | replace("_", " ") | title }}</strong></td>
<td>{{ "%.2f" | format(scores.with_skill) if scores.with_skill is not none else ("N/A" if scores.with_skill_status == "not_applicable" else ("skipped" if scores.with_skill_status == "skipped" else "NO SCORE")) }}</td>
<td>{{ "%.2f" | format(scores.baseline) if scores.baseline is not none else ("N/A" if scores.baseline_status == "not_applicable" else "NO SCORE") }}</td>
<td style="color:{{ 'var(--success-color)' if scores.lift is not none and scores.lift >= tier3_lift_pass_threshold else ('var(--danger-color)' if scores.lift is not none and scores.lift <= tier3_lift_fail_threshold else 'var(--text-secondary)') }};font-weight:600;">
{{ "%+.2f" | format(scores.lift) if scores.lift is not none else ("N/A" if "not_applicable" in [scores.with_skill_status, scores.baseline_status] else ("skipped" if scores.with_skill_status == "skipped" else "NO SCORE")) }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</details>
{% endif %}
{% if t3_provenance.evaluator_paths or t3_provenance.run_dir or t3_harbor_job_url or t3_harbor_analysis_url %}
<details class="t3-details">
<summary>Artifact Paths</summary>
<div class="t3-details-body">
<div class="t3-prov-grid">
{% if t3_harbor_job_url %}
<div class="t3-prov-label">Harbor logs</div>
<a href="{{ t3_harbor_job_url }}" target="_blank" rel="noopener" class="t3-prov-value" style="color:var(--accent-color);text-decoration:none;">{{ t3_harbor_job_url }}</a>
<div class="t3-prov-action"><button class="t3-copy-btn" onclick='tier3CopyText(this, {{ (t3_harbor_job_url | string | tojson) }})'>Copy</button></div>
{% endif %}
{% if t3_harbor_analysis_url %}
<div class="t3-prov-label">Harbor analysis</div>
<a href="{{ t3_harbor_analysis_url }}" target="_blank" rel="noopener" class="t3-prov-value" style="color:var(--accent-color);text-decoration:none;">{{ t3_harbor_analysis_url }}</a>
<div class="t3-prov-action"><button class="t3-copy-btn" onclick='tier3CopyText(this, {{ (t3_harbor_analysis_url | string | tojson) }})'>Copy</button></div>
{% endif %}
{% if t3_provenance.evaluator_paths %}
{% for name, path in t3_provenance.evaluator_paths.items() %}
<div class="t3-prov-label">{{ name }}</div>
<code class="t3-prov-value">{{ path }}</code>
<div class="t3-prov-action"><button class="t3-copy-btn" onclick='tier3CopyText(this, {{ (path | string | tojson) }})'>Copy</button></div>
{% endfor %}
{% endif %}
{% if t3_provenance.run_dir %}
<div class="t3-prov-label">Harbor run dir</div>
<code class="t3-prov-value">{{ t3_provenance.run_dir }}</code>
<div class="t3-prov-action"><button class="t3-copy-btn" onclick='tier3CopyText(this, {{ (t3_provenance.run_dir | string | tojson) }})'>Copy</button></div>
{% endif %}
</div>
</div>
</details>
{% endif %}
{% if t3_provenance.raw_evaluators %}
<details class="t3-details">
<summary>Raw Evaluator Scores Per Agent</summary>
<div class="t3-details-body">
<pre class="t3-pre">{{ t3_provenance.raw_evaluators | tojson(indent=2) }}</pre>
</div>
</details>
{% endif %}
{% if t3_provenance.raw_lift %}
<details class="t3-details">
<summary>Raw Lift Per Agent</summary>
<div class="t3-details-body">
<pre class="t3-pre">{{ t3_provenance.raw_lift | tojson(indent=2) }}</pre>
</div>
</details>
{% endif %}
{% if t3_provenance.comparison %}
<details class="t3-details">
<summary>comparison.json</summary>
<div class="t3-details-body">
<pre class="t3-pre">{{ t3_provenance.comparison | tojson(indent=2) }}</pre>
</div>
</details>
{% endif %}
{% if tier3.timing %}
<details class="t3-details">
<summary>Pipeline Timing</summary>
<div class="t3-details-body">
<table class="summary-table" style="width:100%;">
<thead><tr><th>Step</th><th style="text-align:right;">Duration</th></tr></thead>
<tbody>
{% for s in tier3.timing %}
<tr><td>{{ s.name }}</td><td style="text-align:right;">{{ "%.1f" | format(s.seconds / 60) }}m</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</details>
{% endif %}
{{ render_plugin_evidence(plugin_evidence, 'provenance') }}
{{ render_retention_limits(plugin_evidence) }}
</section>
{# Sub-tab switcher and Chart.js charts #}
{% if t3_agents or tier3_telemetry.token_chart or (t3_steps_chart is defined and t3_steps_chart.datasets) %}
{% set chart_runtime, chart_notices = chart_assets() %}
{% if chart_runtime %}
<details class="chart-notices" id="tier3-chart-notices">
<summary>Chart software notices: Chart.js 4.5.1 and @kurkle/color 0.3.2 (MIT)</summary>
<pre>{{ chart_notices }}</pre>
</details>
<script id="tier3-chart-runtime">{{ chart_runtime | safe }}</script>
{% endif %}
{% endif %}
<script>
// Chart data links may point into another Tier 3 sub-tab; reveal it before jumping.
function openTier3Reference(id) {
if (typeof openReportDestination === 'function') return openReportDestination(id);
var target = document.getElementById(id);
if (!target) return true;
var page = target.closest('.t3-page');
if (page && !page.classList.contains('active')) {
var tab = page.id.slice('tier3-page-'.length);
showTier3SubTab(tab, Array.from(document.querySelectorAll('.t3-subtab')).find(function(b){ return b.dataset.tier3Tab === tab; }));
}
for (var ancestor = target; ancestor; ancestor = ancestor.parentElement) {
if (ancestor.tagName === 'DETAILS') ancestor.open = true;
}
try { history.replaceState(null, '', '#' + id); } catch (err) { /* file:// history is optional. */ }
target.scrollIntoView({block: 'start'});
target.setAttribute('tabindex', '-1');
target.focus({preventScroll:true});
return false;
}
function showTier3SubTab(id, btn) {
activateReportTabs('.t3-subtab', '.t3-page', 'tier3-page-' + id, btn);
}
function showTier3Agent(panelId, btn) {
activateReportTabs('.t3-agent-tab-btn', '.t3-agent-panel', panelId, btn);
}
// Deep-link from Overview's multi-agent table headers and Agent Scorecards
// into Agent Details. Uses the index-based anchor so agent names with unsafe
// characters (slashes, dots) don't break the scroll target.
function jumpToTier3Agent(anchorId) {
var anchor = document.getElementById(anchorId);
if (!anchor) return;
activateReportTier('tier3', {scroll:false, focus:false});
var panelId = anchor.getAttribute('data-tier3-agent-panel-id');
var subTabBtn = document.getElementById('tier3-tab-agents');
showTier3SubTab('agents', subTabBtn);
if (panelId) {
var agentTabBtn = Array.from(document.querySelectorAll('.t3-agent-tab-btn')).find(function(button) { return button.dataset.tier3AgentPanelId === panelId; });
showTier3Agent(panelId, agentTabBtn);
}
if (typeof anchor.scrollIntoView === 'function') {
// requestAnimationFrame defers the scroll until after the browser has
// applied the sub-tab/agent-panel ``.active`` class change, so the
// anchor is laid out at its final position when scrollIntoView fires.
// Without this, any future CSS transition on .t3-page or
// .t3-agent-panel could land the scroll on a transitional or
// off-screen position.
var scroll = function () {
reportScrollTo(anchor, 'start');
// The anchor is aria-hidden; focus the named agent panel instead.
var panel = panelId ? document.getElementById(panelId) : null;
if (panel) panel.focus({preventScroll:true});
};
if (typeof requestAnimationFrame === 'function') {
requestAnimationFrame(scroll);
} else {
scroll();
}
}
}
// Keyboard handler for clickable scorecards. Plain DIVs aren't focusable by
// default; the role/tabindex on the card gives them focus, and this maps
// Enter/Space to the same jump action a click would trigger.
function tier3MaybeActivateAgentLink(event, anchorId) {
if (event.key === 'Enter' || event.key === ' ' || event.code === 'Space') {
event.preventDefault();
jumpToTier3Agent(anchorId);
}
}
function tier3CopyText(btn, text) {
var feedback = function(success){
var orig = btn.textContent;
btn.classList.toggle('copied', success);
btn.textContent = success ? 'Copied' : 'Copy failed';
setTimeout(function(){
btn.classList.remove('copied');
btn.textContent = orig;
}, 1500);
};
// Modern clipboard API (requires secure context — works for https:// reports).
if (navigator.clipboard && window.isSecureContext) {
navigator.clipboard.writeText(text).then(function(){ feedback(true); }, function(){ tier3CopyFallback(text, feedback); });
return;
}
// file:// or insecure context: synchronous textarea + execCommand fallback.
tier3CopyFallback(text, feedback);
}
function tier3CopyFallback(text, feedback) {
try {
var ta = document.createElement('textarea');
ta.value = text;
ta.setAttribute('readonly', '');
ta.style.position = 'fixed';
ta.style.top = '0';
ta.style.left = '0';
ta.style.opacity = '0';
document.body.appendChild(ta);
ta.select();
ta.setSelectionRange(0, text.length);
var ok = document.execCommand('copy');
document.body.removeChild(ta);
feedback(!!ok);
} catch (err) {
feedback(false);
}
}
function tier3CanonicalPayload() {
if (tier3CanonicalPayload.cached) return tier3CanonicalPayload.cached;
var node = document.getElementById('tier3-full');
if (!node) return null;
var raw = (node.textContent || '').trim();
if (!raw) return null;
if (node.getAttribute('data-encoding') === 'base64') {
var binary = atob(raw);
var bytes = new Uint8Array(binary.length);
for (var i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
raw = new TextDecoder('utf-8').decode(bytes);
}
try {
tier3CanonicalPayload.cached = JSON.parse(raw);
return tier3CanonicalPayload.cached;
} catch (err) {
return null;
}
}
function tier3DownloadValue(downloadId) {
var payload = tier3CanonicalPayload();
if (!payload) return null;
var paths = {
'tier3-full': [],
'tier3-raw-evaluators': ['provenance', 'raw_evaluators'],
'tier3-raw-lift': ['provenance', 'raw_lift'],
'tier3-comparison': ['provenance', 'comparison'],
'tier3-timing': ['timing']
};
var path = paths[downloadId];
if (!path) return null;
var value = payload;
for (var i = 0; i < path.length; i++) {
if (!value || typeof value !== 'object') return null;
value = value[path[i]];
}
return value;
}
function tier3DownloadJson(downloadId, filename) {
var value = tier3DownloadValue(downloadId);
if (value === null || typeof value === 'undefined') return;
var pretty = JSON.stringify(value, null, 2);
var blob = new Blob([pretty], { type: 'application/json' });
var url = URL.createObjectURL(blob);
var a = document.createElement('a');
a.href = url;
a.download = filename || (downloadId + '.json');
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function tier3FilterTable(input, tableId) {
var q = (input.value || '').toLowerCase().trim();
var table = document.getElementById(tableId);
if (!table) return;
var rows = table.querySelectorAll('tbody tr');
var visible = 0;
rows.forEach(function(row){
var match = !q || row.textContent.toLowerCase().indexOf(q) !== -1;
row.style.display = match ? '' : 'none';
if (match) visible++;
});
var counter = document.querySelector('[data-tier3-filter-count="' + tableId + '"]');
if (counter) counter.textContent = visible + ' / ' + rows.length;
}
function tier3FilterCards(input, containerId) {
var q = (input.value || '').toLowerCase().trim();
var container = document.getElementById(containerId);
if (!container) return;
var cards = container.querySelectorAll('[data-tier3-filterable]');
var visible = 0;
cards.forEach(function(card){
var details = [card].concat(Array.from(card.querySelectorAll('details')));
details.forEach(function(detail){
if (detail.dataset.tier3SearchOpened) { detail.open = false; delete detail.dataset.tier3SearchOpened; }
});
var hay = ((card.getAttribute('data-tier3-filterable') || '') + ' ' + card.textContent).toLowerCase();
var match = !q || hay.indexOf(q) !== -1;
card.style.display = match ? '' : 'none';
if (match) {
visible++;
if (q) details.forEach(function(detail){
if (detail.tagName !== 'DETAILS' || detail.textContent.toLowerCase().indexOf(q) === -1) return;
for (var ancestor = detail; ancestor && ancestor !== container; ancestor = ancestor.parentElement) {
if (ancestor.tagName === 'DETAILS' && !ancestor.open) { ancestor.dataset.tier3SearchOpened = 'true'; ancestor.open = true; }
}
});
}
});
var counter = document.querySelector('[data-tier3-filter-count="' + containerId + '"]');
if (counter) counter.textContent = visible + ' / ' + cards.length;
}
(function(){
var tier3Data = {{ tier3_chart_data | tojson | safe }};
var dimensionIds = (tier3Data.dimensions || []).map(function(dim){ return dim.id; });
if (!dimensionIds.length) dimensionIds = ["security","correctness","discoverability","effectiveness","efficiency"];
var palette = ["#76b900", "#8b5cf6", "#ec4899", "#06b6d4", "#3b82f6", "#f59e0b", "#22c55e"];
var charts = Object.create(null);
function labelForDimension(dim) {
return dim.replace(/_/g, " ").replace(/\b\w/g, function(c){ return c.toUpperCase(); });
}
// While printing, charts use the light theme's colors: paper is white
// whatever theme is on screen, and a canvas does not restyle itself.
var printing = false;
function cssColors() {
var root = document.documentElement;
var theme = root.getAttribute("data-theme");
// beforeprint fires while screen styles still apply, so read the light values.
if (printing && theme === "dark") root.setAttribute("data-theme", "light");
var s = getComputedStyle(root);
var colors = {
grid: s.getPropertyValue("--chart-grid").trim() || "rgba(0,0,0,0.1)",
tick: s.getPropertyValue("--chart-tick").trim() || "#64748b",
label: s.getPropertyValue("--chart-label").trim() || "#0f172a"
};
if (printing && theme === "dark") root.setAttribute("data-theme", theme);
return colors;
}
// A chart drawn for print must be complete when the page is captured.
function chartOptions(options) {
if (printing) options.animation = false;
return options;
}
function agentEntries() {
return Object.entries(tier3Data.agents || {});
}
function agentDimensionData(agent) {
var byId = {};
(agent.dimensions || []).forEach(function(dim){ byId[dim.id] = dim; });
return dimensionIds.map(function(dimId){
var row = byId[dimId] || {};
var raw = row.score;
if (raw === null || raw === undefined) raw = row.with_skill;
return raw === null || raw === undefined ? null : Number(raw);
});
}
function tokenTotalsByAgent() {
var totals = {};
var trialCounts = {};
(tier3Data.trials || []).forEach(function(trial){
var name = trial.agent || "default";
trialCounts[name] = (trialCounts[name] || 0) + 1;
var tokens = trial.tokens || {};
var prompt = tokens.prompt;
var completion = tokens.completion;
if (typeof prompt !== "number" || !Number.isFinite(prompt) || prompt < 0 ||
typeof completion !== "number" || !Number.isFinite(completion) || completion < 0) return;
if (!totals[name]) totals[name] = {prompt:0, completion:0, cached:0, observed:0, cachedComplete:true};
totals[name].prompt += prompt;
totals[name].completion += completion;
totals[name].observed += 1;
if (typeof tokens.cached !== "number" || !Number.isFinite(tokens.cached) || tokens.cached < 0) {
totals[name].cachedComplete = false;
} else {
totals[name].cached += tokens.cached;
}
});
Object.keys(totals).forEach(function(name){
if (totals[name].observed !== trialCounts[name]) delete totals[name];
});
return totals;
}
function stepsByCaseDatasets() {
// Precomputed per agent and condition; null marks a missing or partially measured case.
var chart = {{ steps_by_case_chart | default({'labels': [], 'datasets': []}) | tojson | safe }};
chart.datasets.forEach(function(dataset, idx){
dataset.backgroundColor = palette[idx % palette.length] + "cc";
dataset.borderRadius = 4;
});
return chart;
}
function createChart(canvas, config) {
// A hidden canvas starts hidden until a chart succeeds. Check its
// container, including closed disclosures, before creating it.
if (!printing && (canvas.closest("details:not([open])") || !canvas.parentElement.getClientRects().length)) return;
var fallback = document.getElementById(canvas.id + "-fallback");
canvas.hidden = false;
var chart = charts[canvas.id];
try {
if (chart) {
chart.data = config.data;
chart.options = config.options;
chart.resize();
chart.update(printing ? "none" : undefined);
} else {
chart = new Chart(canvas, config);
}
// Chart.js can return an instance without a context instead of throwing.
if (!chart.ctx) throw new Error("Chart canvas unavailable");
charts[canvas.id] = chart;
if (fallback) fallback.hidden = true;
} catch (error) {
// A context-less instance is registered with canvas=null, so
// Chart.getChart(canvas) cannot find it; destroy what was built.
var partial = chart || (Chart.getChart && Chart.getChart(canvas));
if (partial) partial.destroy();
delete charts[canvas.id];
canvas.hidden = true;
if (fallback) fallback.hidden = false;
}
}
window.rebuildTier3Charts = function rebuildTier3Charts() {
if (typeof Chart === "undefined") return;
var colors = cssColors();
var agents = agentEntries();
var dimensionLabelList = dimensionIds.map(labelForDimension);
var radar = document.getElementById("tier3-radar");
if (radar && agents.length) {
createChart(radar, {
type: "radar",
data: {
labels: dimensionLabelList,
datasets: agents.map(function(item, idx){
return {
label: item[0],
data: agentDimensionData(item[1]),
borderColor: palette[idx % palette.length],
backgroundColor: palette[idx % palette.length] + "22",
pointBackgroundColor: palette[idx % palette.length],
borderWidth: 2,
pointRadius: 3
};
})
},
options: chartOptions({
responsive: true,
scales: { r: { min: 0, max: 1, ticks: { stepSize: 0.2, color: colors.tick, backdropColor: "transparent" }, grid: { color: colors.grid }, angleLines: { color: colors.grid }, pointLabels: { color: colors.label, font: { size: 11 } } } },
plugins: { legend: { labels: { color: colors.label } } }
})
});
}
var metricBar = document.getElementById("tier3-metric-bar");
if (metricBar && agents.length) {
createChart(metricBar, {
type: "bar",
data: {
labels: dimensionLabelList,
datasets: agents.map(function(item, idx){
return { label: item[0], data: agentDimensionData(item[1]), backgroundColor: palette[idx % palette.length] + "cc", borderRadius: 4 };
})
},
options: chartOptions({
responsive: true,
scales: { y: { min: 0, max: 1, ticks: { stepSize: 0.2, color: colors.tick }, grid: { color: colors.grid } }, x: { ticks: { color: colors.label, maxRotation: 45 }, grid: { display: false } } },
plugins: { legend: { labels: { color: colors.label } } }
})
});
}
var recordedTokenChart = document.getElementById("tier3-recorded-token-chart");
var recordedTokenData = {{ tier3_telemetry.token_chart | tojson | safe }};
if (recordedTokenChart && recordedTokenData) {
recordedTokenData.datasets.forEach(function(dataset, idx){ dataset.backgroundColor = palette[idx % palette.length] + "cc"; });
createChart(recordedTokenChart, {
type: "bar", data: recordedTokenData,
options: chartOptions({ responsive: true,
scales: { x: { stacked: true, ticks: { color: colors.tick, maxRotation: 45 }, grid: { display: false } }, y: { stacked: true, ticks: { color: colors.label }, grid: { color: colors.grid } } },
plugins: { legend: { labels: { color: colors.label } } }
})
});
}
var tokenChart = document.getElementById("tier3-token-chart");
var tokenTotals = tokenTotalsByAgent();
var tokenAgents = Object.keys(tokenTotals);
if (tokenChart && tokenAgents.length) {
createChart(tokenChart, {
type: "bar",
data: {
labels: tokenAgents,
datasets: [
{ label: "Prompt (total)", data: tokenAgents.map(function(a){ return tokenTotals[a].prompt; }), backgroundColor: "#3b82f6cc", borderRadius: 3 },
{ label: "Completion", data: tokenAgents.map(function(a){ return tokenTotals[a].completion; }), backgroundColor: "#22c55ecc", borderRadius: 3 },
{ label: "Cached (included in prompt)", data: tokenAgents.map(function(a){ return tokenTotals[a].cachedComplete ? tokenTotals[a].cached : null; }), backgroundColor: "#8b5cf6cc", borderRadius: 3 }
]
},
options: chartOptions({
responsive: true,
scales: { x: { ticks: { color: colors.tick }, grid: { color: colors.grid } }, y: { beginAtZero: true, ticks: { color: colors.label }, grid: { display: false } } },
plugins: { legend: { labels: { color: colors.label } } }
})
});
}
var stepsChart = document.getElementById("tier3-steps-chart");
if (stepsChart) {
var stepsData = stepsByCaseDatasets();
if (stepsData.labels.length) {
createChart(stepsChart, {
type: "bar",
data: stepsData,
options: chartOptions({
responsive: true,
scales: { x: { ticks: {
color: colors.tick, maxRotation: 0,
callback: function(value) {
var label = this.getLabelForValue(value);
return label.length > 24 ? (Number(value) + 1) + " · " + label.slice(0, 20) + "…" : label;
}
}, grid: { color: colors.grid } }, y: { ticks: { color: colors.label }, grid: { display: false } } },
plugins: {
legend: { labels: { color: colors.label } },
tooltip: { callbacks: { title: function(items) { return items.length ? items[0].label : ""; } } }
}
})
});
}
}
};
// The report theme initializer creates the first visible charts only
// after the saved/system theme has been applied.
document.addEventListener("toggle", function(event){
if (event.target.tagName === "DETAILS" && event.target.open && event.target.querySelector("canvas")) window.rebuildTier3Charts();
}, true);
function redrawForPrint(isPrinting) {
// beforeprint can precede disclosure opening and print CSS. A subsequent
// print-media event must resize against the now-visible layout as well.
printing = isPrinting;
window.rebuildTier3Charts();
}
// The report's disclosure handler draws after enabling its print layout.
window.addEventListener("beforeprint", function(){ printing = true; });
window.addEventListener("afterprint", function(){ redrawForPrint(false); });
if (window.matchMedia) {
var printQuery = window.matchMedia("print");
var onPrintChange = function(event){ redrawForPrint(event.matches); };
if (printQuery.addEventListener) printQuery.addEventListener("change", onPrintChange);
else if (printQuery.addListener) printQuery.addListener(onPrintChange);
}
})();
</script>
{% else %}
<p style="color: var(--text-secondary); padding: 1rem;">No agent evaluation data available. Run <code>skillevaluator evaluate</code> to generate Tier 3 results.</p>
{% endif %}
{% endif %}
</div>
{% endfor %}
<div class="scope-strip" aria-label="Evaluation scope">
<span><strong>Scope</strong></span>
<span>Tier 1 · {{ 'Static validation' if has_tier1 else 'Not run' }}</span>
<span>Tier 2 · {{ 'Deduplication' if has_tier2 else 'Not run' }}</span>
<span>Tier 3 · {{ 'Live evaluation' if has_tier3 and not tier3_is_skipped else 'Not run' }}</span>
</div>
<details class="run-metadata" id="run-metadata">
<summary>Run details & provenance</summary>
{% if not has_tier3 %}{{ render_retention_limits(plugin_evidence) }}{% endif %}
<div class="metadata-grid">
{% for owner in ['static', 'runtime'] %}{% set snapshot = plugin_evidence.metadata.get(owner) %}{% if snapshot %}
<div><strong>{{ owner | title }} evidence</strong><div>{{ snapshot.name }} · {{ snapshot.status }}</div>
{% if snapshot.run_id is defined %}<div>Run ID: <code>{{ snapshot.run_id }}</code></div>{% endif %}
{% if snapshot.execution_status is defined %}<div>Execution: {{ snapshot.execution_status }}</div>{% endif %}
{% if snapshot.source is defined %}{% for key, value in snapshot.source.items() %}<div>{{ key | replace('_', ' ') | title }}: <code>{{ value }}</code></div>{% endfor %}{% endif %}
{% if snapshot.notice %}<p>{{ snapshot.notice }}</p>{% endif %}
</div>{% endif %}{% endfor %}
{% if has_tier3 %}<div><strong>Agent evaluation</strong> {% if completed_agent and completed_agent.recovered_attempts %}<div>{{ completed_agent.recovered_attempts }} timeout attempt(s) recovered; failed history retained.</div>{% endif %}
<div class="trial-coverage">{{ hero_trials }}</div>{% for detail in presentation.coverage.details %}<div>{{ detail }}</div>{% endfor %}
<div><strong>Metrics:</strong> {{ hero_metric_count }} evaluators</div>
{% if tier3_backend %}<div><strong>Backend:</strong> {{ tier3_backend }}</div>{% endif %}
{% if tier3_environment %}<div><strong>Environment:</strong> <code>{{ tier3_environment }}</code></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 %}
{% if target_path %}<p class="header-meta-item"><strong>Target:</strong> {% if target_path.startswith('https://') %}<a href="{{ target_path }}" target="_blank" class="header-target-link" title="{{ target_path }}">{{ target_display or target_path }}</a>{% else %}{{ target_path }}{% endif %}</p>{% endif %}
{% if skillspector_versions %}<p>SkillSpector <strong>v{{ skillspector_versions | join(', v') }}</strong></p>{% endif %}
{% if profile %}<p class="header-meta-item"><strong>Profile:</strong> <span class="header-profile-badge profile-{{ profile }}">{{ profile }}</span></p>{% endif %}
{% if timestamp %}<p class="header-meta-item">Generated: {{ timestamp }}{% if version %} · SkillEvaluator v{{ version }}{% endif %}</p>{% endif %}
{% if ci.get('run_url') %}<p><strong>CI run</strong><a href="{{ ci.run_url }}" target="_blank" rel="noopener noreferrer">Open run ↗</a></p>{% endif %}
{% if ci.get('commit') %}<p><strong>Commit</strong><code>{{ ci.commit }}</code></p>{% endif %}
{% if ci.get('image') %}<p><strong>Evaluator image</strong><code>{{ ci.image }}</code></p>{% endif %}
{% if ci.get('ci_conclusion') %}<p><strong>CI conclusion</strong>{{ ci.ci_conclusion }}</p>{% endif %}
</div>
{% if has_tier2 or has_tier3 %}
{% set included_tiers = [] %}
{% if has_tier1 %}{% set _ = included_tiers.append('tier1') %}{% endif %}
{% if has_tier2 %}{% set _ = included_tiers.append('tier2') %}{% endif %}
{% if has_tier3 %}{% set _ = included_tiers.append('tier3') %}{% endif %}
{% set tier_labels = {'tier1': 'Tier 1', 'tier2': 'Tier 2', 'tier3': 'Tier 3 agent-eval'} %}
{% set blocking_labels = [] %}{% set advisory_labels = [] %}
{% for tier in gating.blocking_tiers if tier in included_tiers %}{% set _ = blocking_labels.append(tier_labels[tier]) %}{% endfor %}
{% for tier in gating.advisory_tiers if tier in included_tiers %}{% set _ = advisory_labels.append(tier_labels[tier]) %}{% endfor %}
<div class="gate-policy" aria-label="Gate policy for included tiers">
<strong>Gate policy</strong>
{% if blocking_labels %}<span>Blocking ({{ blocking_labels | join(' + ') }}): <strong>{{ blocking_critical }} critical · {{ blocking_high }} high · {{ blocking_medium }} medium · {{ blocking_low }} low</strong></span>{% endif %}
{% if advisory_labels %}<span>Advisory ({{ advisory_labels | join(' + ') }}): <strong>{{ advisory_critical }} critical · {{ advisory_high }} high · {{ advisory_medium }} medium · {{ advisory_low }} low</strong>.{% if has_tier3 and 'tier3' in gating.advisory_tiers %} Tier 3 agent-eval findings are advisory and don't block merge.{% endif %}</span>{% endif %}
</div>
{% endif %}
</details>
</main>
<footer>Generated by <strong>SkillEvaluator</strong> — NVIDIA Benchmark for Agent Skills Evaluation</footer>
<button id="backToTop" onclick="scrollToTop()" title="Back to Top">↑ Top</button>
{% if report_json is not none %}<script id="report-data" type="application/json">{{ report_json | safe }}</script>{% endif %}
<script>
function exportJSON() {
let jsonData = document.getElementById('report-data').textContent;
try {
const report = JSON.parse(jsonData);
const tier3Payload = (typeof tier3CanonicalPayload === 'function') ? tier3CanonicalPayload() : null;
if (tier3Payload) report.tier3 = tier3Payload;
jsonData = JSON.stringify(report, null, 2);
} catch (err) { /* retain the embedded report JSON */ }
const blob = new Blob([jsonData], { type: 'application/json' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'skillevaluator-report.json';
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
function showTab(tabId, btn) { activateReportTier(tabId); }
function filterValidators(status) {
const cards = document.querySelectorAll('#tab-tier1 .validator-card');
const rows = document.querySelectorAll('#tab-tier1 .summary-table tbody tr');
['all', 'pass', 'fail', 'incomplete'].forEach(s => document.getElementById('filter-' + s)?.classList.remove('active'));
document.getElementById('filter-' + status)?.classList.add('active');
let visibleCount = 0;
cards.forEach(c => {
const show = (status === 'all' || c.getAttribute('data-status') === status);
c.style.display = show ? '' : 'none';
if (show) visibleCount++;
});
rows.forEach(r => r.style.display = (status === 'all' || r.getAttribute('data-status') === status) ? '' : 'none');
// Show/hide empty state message
let emptyMsg = document.getElementById('validator-empty-msg');
if (!emptyMsg) {
emptyMsg = document.createElement('p');
emptyMsg.id = 'validator-empty-msg';
emptyMsg.style.cssText = 'color: var(--text-secondary); padding: 1.5rem; text-align: center; font-size: 0.875rem;';
const section = document.querySelector('#results-by-validator .section-header');
if (section) section.parentNode.insertBefore(emptyMsg, section.nextSibling);
}
if (visibleCount === 0) {
const label = status === 'pass' ? 'passed' : status === 'fail' ? 'failed' : '';
emptyMsg.textContent = 'No ' + label + ' validators to display.';
emptyMsg.style.display = '';
} else {
emptyMsg.style.display = 'none';
}
}
function toggleTable(btn) {
btn.classList.toggle('active');
btn.nextElementSibling.classList.toggle('active');
}
function toggleValidator(btn) {
btn.classList.toggle('active');
btn.nextElementSibling.classList.toggle('active');
const txt = btn.querySelector('.expand-text');
txt.textContent = btn.classList.contains('active') ? '▲ Collapse' : '▼ Expand';
}
function scrollToValidator(idx) {
const v = document.getElementById('validator-' + idx);
if (!v) return;
activateReportTier('tier1', {scroll:false, focus:false});
const query = document.getElementById('report-search');
if (query) query.value = '';
switchView('validator');
const btn = v.querySelector('.validator-collapsible');
if (!btn.classList.contains('active')) {
btn.classList.add('active');
btn.nextElementSibling.classList.add('active');
btn.querySelector('.expand-text').textContent = '▲ Collapse';
}
v.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });
v.tabIndex = -1;
v.focus({preventScroll:true});
}
window.onscroll = function() {
document.getElementById('backToTop').style.display = window.scrollY > 300 ? 'flex' : 'none';
};
function scrollToTop() { window.scrollTo({ top: 0, behavior: reportScrollBehavior() }); }
function switchView(view) {
document.querySelectorAll('.view-toggle-btn').forEach(b => b.classList.remove('active'));
document.getElementById('view-' + view).classList.add('active');
document.querySelectorAll('.results-view').forEach(v => v.classList.remove('active'));
document.getElementById('results-by-' + view).classList.add('active');
clearSkillFilter();
filterSeverity('all');
filterValidators('all');
}
function toggleSkill(header) {
const content = header.nextElementSibling;
const expandText = header.querySelector('.expand-text');
const isActive = content.classList.contains('active');
content.classList.toggle('active');
expandText.textContent = isActive ? '▼' : '▲';
}
function filterSkills(status) {
const cards = document.querySelectorAll('#results-by-skill .skill-card');
['all', 'pass', 'fail', 'incomplete'].forEach(s => document.getElementById('skill-filter-' + s)?.classList.remove('active'));
document.getElementById('skill-filter-' + status)?.classList.add('active');
let visibleCount = 0;
cards.forEach(c => {
const show = (status === 'all' || c.getAttribute('data-skill-status') === status);
c.style.display = show ? '' : 'none';
if (show) visibleCount++;
});
// Show/hide empty state message
let emptyMsg = document.getElementById('skill-empty-msg');
if (!emptyMsg) {
emptyMsg = document.createElement('p');
emptyMsg.id = 'skill-empty-msg';
emptyMsg.style.cssText = 'color: var(--text-secondary); padding: 1.5rem; text-align: center; font-size: 0.875rem;';
const lastCard = document.querySelector('#results-by-skill .skill-card:last-of-type');
if (lastCard) lastCard.parentNode.insertBefore(emptyMsg, lastCard.nextSibling);
}
if (visibleCount === 0) {
const label = status === 'pass' ? 'passed' : status === 'fail' ? 'failed' : '';
emptyMsg.textContent = 'No ' + label + ' skills to display.';
emptyMsg.style.display = '';
} else {
emptyMsg.style.display = 'none';
}
}
function toggleAllSkills(expand) {
document.querySelectorAll('#results-by-skill .skill-card .skill-content').forEach(c => {
if (expand) c.classList.add('active');
else c.classList.remove('active');
});
document.querySelectorAll('#results-by-skill .skill-card .skill-header .expand-text').forEach(t => {
t.textContent = expand ? '▲' : '▼';
});
}
function scrollToSkill(skillName) {
const card = _openSkillCard(skillName);
if (!card) return;
// Make sure it's visible (clear any active filter)
card.style.display = '';
// Expand it
const content = card.querySelector('.skill-content');
if (content && !content.classList.contains('active')) {
content.classList.add('active');
const arrow = card.querySelector('.expand-text');
if (arrow) arrow.textContent = '▲';
}
card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });
card.tabIndex = -1;
card.focus({preventScroll:true});
// Brief highlight
card.style.boxShadow = '0 0 0 3px var(--secondary-color)';
setTimeout(() => { card.style.boxShadow = ''; }, 2000);
}
// Open ``skillName``'s card and return it (or null if missing). Shared by
// every "jump into a skill card" entry point so they keep identical
// visibility / expansion semantics.
function _openSkillCard(skillName) {
const card = Array.from(document.querySelectorAll('.skill-card')).find(card => card.dataset.skillName === skillName);
if (!card) return null;
card.style.display = '';
const content = card.querySelector('.skill-content');
if (content && !content.classList.contains('active')) {
content.classList.add('active');
const arrow = card.querySelector('.skill-header .expand-text');
if (arrow) arrow.textContent = '\u25B2';
}
return card;
}
// Deep-link straight to the finding card matching ``issueKey`` inside
// ``skillName``. Top-issue rows roll up many findings; this lets the
// executive summary land the user on the actual occurrence rather than
// dropping them at the top of the skill card (where the quality score
// panel is the first thing they see).
function scrollToFinding(skillName, issueKey) {
const card = _openSkillCard(skillName);
if (!card) return;
let target = null;
if (issueKey) {
const findings = card.querySelectorAll('.check-finding[data-issue-key]');
for (const f of findings) {
if (f.getAttribute('data-issue-key') === issueKey) { target = f; break; }
}
}
if (target) {
// Findings can live inside collapsed checks, including passing checks.
for (let parent = target.parentElement; parent && parent !== card; parent = parent.parentElement) {
if (parent.tagName === 'DETAILS') parent.open = true;
}
target.scrollIntoView({ behavior: reportScrollBehavior(), block: 'center' });
target.tabIndex = -1;
target.focus({preventScroll:true});
target.style.boxShadow = '0 0 0 3px var(--secondary-color)';
setTimeout(() => { target.style.boxShadow = ''; }, 2000);
} else {
// Fall back to the card itself (e.g. the issue rolls up a
// finding that has been filtered out of the rendered DOM).
card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });
card.style.boxShadow = '0 0 0 3px var(--secondary-color)';
setTimeout(() => { card.style.boxShadow = ''; }, 2000);
}
}
// Dedicated entry point for the quality-score panel so it's a
// deliberate click rather than the accidental destination users hit
// when they click an issue and land at the top of the skill card.
function scrollToQualityScore(skillName) {
const card = _openSkillCard(skillName);
if (!card) return;
const block = card.querySelector('.quality-score-block');
if (block) {
block.scrollIntoView({ behavior: reportScrollBehavior(), block: 'center' });
block.tabIndex = -1;
block.focus({preventScroll:true});
block.style.boxShadow = '0 0 0 3px var(--warning-color)';
setTimeout(() => { block.style.boxShadow = ''; }, 2000);
} else {
card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });
}
}
function filterToAffectedSkills(row) {
const skillsStr = row.getAttribute('data-affected-skills') || '';
const affectedSkills = skillsStr.split(',').filter(s => s.length > 0);
if (affectedSkills.length === 0) return;
const issueName = row.cells[0].textContent.trim();
const issueKey = row.getAttribute('data-issue-key') || '';
// Highlight the clicked row
document.querySelectorAll('.top-issues-table tbody tr').forEach(r => r.classList.remove('top-issues-active-row'));
row.classList.add('top-issues-active-row');
// Reset skill status filter to "All"
['all', 'pass', 'fail', 'incomplete'].forEach(s => document.getElementById('skill-filter-' + s)?.classList.remove('active'));
document.getElementById('skill-filter-all')?.classList.add('active');
// Filter skill cards to show only affected ones
const cards = document.querySelectorAll('#results-by-skill .skill-card');
cards.forEach(c => {
const name = c.getAttribute('data-skill-name');
const show = affectedSkills.includes(name);
c.style.display = show ? '' : 'none';
// Expand affected cards
if (show) {
const content = c.querySelector('.skill-content');
if (content && !content.classList.contains('active')) {
content.classList.add('active');
const arrow = c.querySelector('.expand-text');
if (arrow) arrow.textContent = '▲';
}
}
});
// Show filter banner above the skill list
const banner = document.getElementById('skill-filter-banner');
document.getElementById('skill-filter-banner-text').textContent =
'Showing ' + affectedSkills.length + ' item(s) affected by: ' + issueName;
banner.classList.add('visible');
// Hide skill empty message if present
const emptyMsg = document.getElementById('skill-empty-msg');
if (emptyMsg) emptyMsg.style.display = 'none';
// Land directly on the actual finding in the first affected skill,
// not on the top of the card (which shows the quality score panel
// first and was the source of the prior "click on an issue ->
// ends up on the quality score" complaint).
if (issueKey && affectedSkills.length > 0) {
scrollToFinding(affectedSkills[0], issueKey);
} else {
banner.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });
}
}
function clearSkillFilter() {
document.querySelectorAll('#results-by-skill .skill-card').forEach(c => c.style.display = '');
document.getElementById('skill-filter-banner')?.classList.remove('visible');
document.querySelectorAll('.top-issues-table tbody tr').forEach(r => r.classList.remove('top-issues-active-row'));
['all', 'pass', 'fail', 'incomplete'].forEach(s => document.getElementById('skill-filter-' + s)?.classList.remove('active'));
document.getElementById('skill-filter-all')?.classList.add('active');
filterSeverity('all');
}
function toggleTopIssues(header) {
const content = header.nextElementSibling;
const expandText = header.querySelector('.expand-text');
const isActive = content.classList.contains('active');
content.classList.toggle('active');
expandText.textContent = isActive ? '\u25BC' : '\u25B2';
}
function toggleContributors(header) {
const content = header.nextElementSibling;
const expandText = header.querySelector('.expand-text');
const isActive = content.classList.contains('active');
content.classList.toggle('active');
expandText.textContent = isActive ? '\u25BC' : '\u25B2';
}
var currentSeverityFilter = 'all';
function filterSeverity(level) {
currentSeverityFilter = level;
['all', 'critical-high', 'medium', 'low'].forEach(s => document.getElementById('sev-filter-' + s)?.classList.remove('active'));
document.getElementById('sev-filter-' + level).classList.add('active');
const findings = document.querySelectorAll('.check-finding[data-finding-severity]');
findings.forEach(f => {
const sev = f.getAttribute('data-finding-severity');
let show = true;
if (level === 'critical-high') show = (sev === 'critical' || sev === 'high');
else if (level === 'medium') show = (sev === 'medium');
else if (level === 'low') show = (sev === 'low' || sev === 'info');
f.style.display = show ? '' : 'none';
});
// Also filter the top issues table rows
const issueRows = document.querySelectorAll('.top-issues-table tbody tr[data-severity]');
issueRows.forEach(r => {
const sev = r.getAttribute('data-severity');
let show = true;
if (level === 'critical-high') show = (sev === 'critical' || sev === 'high');
else if (level === 'medium') show = (sev === 'medium');
else if (level === 'low') show = (sev === 'low' || sev === 'info');
r.style.display = show ? '' : 'none';
});
}
document.addEventListener('DOMContentLoaded', initReportTheme);
{% include "report_ui.js.j2" %}
</script>
</body>
</html>