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
Keep report navigation persistent and evidence accessible (#352)
Narendran Raghavand136a597c547
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 9dede73c..cf4bbf1a 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -35,6 +35,23 @@ All notable changes to SkillEvaluator are documented in this file.include accessible descriptions, links to data tables and visible fallbackswhen canvas initialization is unavailable; Tier 1 reports omit chart assets.+- Separate HTML Tier 2 evidence into within-skill and across-skill comparisons,+ with recorded completion, duplicate, affected-path, and catalog counts. Keep+ skipped or unavailable comparisons distinct from completed zero-match scans.+ Link every recorded Harbor job in HTML, terminal, and Markdown reports and+ disclose recorded scanner, evaluator, model, dataset, and source provenance.++- Give HTML summaries, tier tiles, KPI labels and values, findings, evidence+ tables and all six Tier 3 views more reading room. Use relaxed body line+ spacing and wrap Tier 3 navigation on narrow screens in both themes.++- Keep HTML tier navigation synchronized across sidebar, tiles and a mobile+ sticky bar, including absent tiers in comprehensive reports. Add accessible+ keyboard navigation for Tier 3 and agent tabs, a System/Light/Dark preference,+ complete expanded evidence, and readable no-JavaScript/print views. Keep+ required and advisory summary reasons distinct within mixed tiers and focus+ direct agent links on their named panels.+### Documentation- The 0.8.0 entry for refused `claude-code` attempts said the arm reports itsdiff --git a/docs/developer-guide.mdx b/docs/developer-guide.mdxindex c06cd5c9..088946e9 100644--- a/docs/developer-guide.mdx+++ b/docs/developer-guide.mdx@@ -66,6 +66,18 @@ The `dev` extra includes pytest-xdist, so you can parallelize any of these runs:pytest -n auto```+### Check the HTML report in a browser++`tests/reporting/browser_navigation_checks.py` opens the HTML report in a headless browser and checks navigation, focus, themes, print view and layout at three screen widths. pytest doesn't collect it, and it needs Playwright:++```bash title="Run the HTML report browser checks"+pip install playwright+python -m playwright install chromium+python tests/reporting/browser_navigation_checks.py browser-checks+```++The script renders its own fixture reports, then writes screenshots and `navigation-results.json` to `browser-checks/`. To use an installed Chrome instead of Playwright's Chromium, set `SKILLEVALUATOR_TEST_BROWSER` to the browser's executable or pass `--browser`.+## Code style and dependenciesRuff owns linting — `make lint` is the project's lint gate. CI runs `ruff check` over the whole repository, so lint the files you touch even outside `src` and `tests`.diff --git a/docs/reports.mdx b/docs/reports.mdxindex eba689fe..1af30fef 100644--- a/docs/reports.mdx+++ b/docs/reports.mdx@@ -105,6 +105,37 @@ scored totals. Preview limits and physical retry rows do not replace recordedattempt counts. These are display projections; canonical JSON and evaluationpayloads are unchanged.+### Tier 2 comparison scopes and evidence++The HTML Tier 2 view separates **Within this skill** (redundant content among+its files) from **Across skills** (catalog or collection comparisons). Each+scope shows Checks completed, Duplicate findings, Affected files or skills,+and Catalog entries compared. Completion uses recorded comparison+evidence; a completed check can still fail its gate because it found duplicates.+Refused LLM classifications and file safety errors remain visible findings,+but do not count as confirmed duplicates within a skill.++A completed comparison with no matches shows zero. A skipped catalog comparison,+missing metadata, or an incomplete scan shows the recorded reason and unavailable+counts. Target against catalog comparisons exclude the target's recorded self+entry. Within-skill checks and recorded pairwise scans mark Catalog entries compared+as not applicable. Pairwise scans identify the collection size separately. Affected counts use recorded file or skill paths,+so equal display names do not merge distinct skills. Token or context savings+are not estimated from duplicate counts.++HTML, terminal, and Markdown reports link every recorded Harbor job to its+**Results** and available **Analysis**, using the job's recorded name or+`Job N` when no name is available. Legacy single-job and analysis-only links+remain usable. Job names do not establish which agent or condition produced a+job. Links use the existing URL validation and output escaping.++HTML disclosures show recorded scanner versions and LLM provenance, plus+sanitized model, evaluator, dataset digest, and evaluated source metadata under+Tier 3 Diagnostics. Missing values remain unavailable. These views use existing+report data and do not read the source tree or contact providers while rendering.+Full downloads and preview omission counts remain available; with-skill token+charts are labeled separately from the resource table's two-arm comparisons.+## File namingReport filenames follow two patterns, both under the output directory:@@ -147,6 +178,27 @@ the evidence below it:repeat a finding are folded away.- **Run details.** Scope, the target path, provenance and the gate policy.+Use the sidebar or tier tiles to open a tier. A comprehensive `validate` report+keeps all three tiers visible, including **Not run** and **Not run (not requested)**+when evidence is absent. Targeted reports keep their narrower scope. On small+screens, a sticky tier bar keeps navigation available while reading long evidence.+Tier 3 retains Overview, Insights, Agent Details, Trials, Dataset and Diagnostics.+For its tabs, Left/Right and Home/End move focus; Enter or Space opens the focused+view. Finding links clear incompatible filters, open their evidence and move focus+to the exact finding. Direct agent links open and focus the named agent panel;+section links open at the start of the section.++The **Theme** control offers System, Light and Dark. System follows live device+changes; an explicit choice persists until System is selected again. Reports use+native theme-aware scrollbars and respect reduced motion. Without JavaScript,+all tier and agent evidence remains readable. Printing exposes supporting evidence+and then restores disclosure and filter state when returning to the screen.++Reports use 14-pixel body text with relaxed line spacing, distinct label/value+gaps, and consistent space between cards, findings and table rows. Tier 3 view+tabs wrap on narrow screens; wide evidence tables keep their own horizontal+scroll area. The same reading rhythm applies in Light and Dark themes.+Tier 3 charts include Chart.js 4.5.1 inside the HTML file and work offline;they make no CDN or source-map requests. Each chart describes its measurementsand links to the underlying data table. If JavaScript or canvas initialization@@ -174,6 +226,8 @@ words: **Passed**, **Changes required**, **Incomplete**, **Skipped** andwhose gate does not block, such as deduplication with `--no-block-on-dedup` orlive evaluation without `--block-on-agent-eval`, shows **Failed (advisory)**when it fails, because it does not require changes. Publication eligibility is+shown separately from the command result. Summary reasons count required and+advisory checks individually, including when a tier contains both. Eligibility isshown next to the verdict, because a report can pass its checks and still notbe eligible for publication. The report follows the system light or dark themeuntil you pick one, and always prints dark text on white paper.diff --git a/src/skillevaluator/cli.py b/src/skillevaluator/cli.pyindex f78c6d4a..62294095 100644--- a/src/skillevaluator/cli.py+++ b/src/skillevaluator/cli.py@@ -1643,6 +1643,7 @@ def _finish_pipeline_view() -> None:"""Render the quiet-mode verdict panel and report footer."""from skillevaluator.reporting.console_ui import MUTED, Verdict, _is_skipped, first_fix+ from skillevaluator.reporting.harbor_viewer import harbor_job_linksfrom skillevaluator.reporting.presentation import build_final_render_contextfrom skillevaluator.reporting.run_status import Status@@ -1665,6 +1666,10 @@ def _finish_pipeline_view(]payload = ((tier3_result.metadata or {}).get("agent_eval") or {}) if tier3_result is not None else {}summary = payload.get("summary") or payload+ for job in harbor_job_links(payload):+ for key, label in (("url", "Results"), ("analysis_url", "Analysis")):+ if job.get(key):+ links.append((f"{job['name']} {label}", job[key]))if not gate_failed:advisory_failed = any(block.status == "fail" and block.number in {2, 3} for block in view.blocks)diff --git a/src/skillevaluator/reporting/cli.py b/src/skillevaluator/reporting/cli.pyindex c45922af..1a080705 100644--- a/src/skillevaluator/reporting/cli.py+++ b/src/skillevaluator/reporting/cli.py@@ -47,7 +47,7 @@ from skillevaluator.reporting.base import ()from skillevaluator.reporting.harbor_viewer import (harbor_evidence_link_text,- normalize_harbor_viewer_for_display,+ harbor_job_links,safe_url,)from skillevaluator.reporting.presentation import FinalRenderContext, build_final_render_context, trial_coverage@@ -206,6 +206,14 @@ class CLIReporter(ReporterBase):for result in non_blocking:self.render_result(result, console)+ # Successful results do not enter the detailed failure/finding sections.+ rendered = {id(result) for result in (*failed, *non_blocking)}+ for result in results:+ if id(result) not in rendered:+ agent_eval = result.metadata.get("agent_eval")+ if isinstance(agent_eval, dict):+ self._print_harbor_artifacts(agent_eval, console)+color = {Status.PASSED: "green", Status.FAILED: "red"}.get(context.command_status, "yellow")console.print(f"\n[bold {color}][{context.command_status.verdict}] {context.command_label}[/bold {color}]")for number, tier in context.tiers.items():@@ -371,6 +379,20 @@ class CLIReporter(ReporterBase):console.print(table)console.print()+ @staticmethod+ def _print_harbor_artifacts(agent_eval: dict, console: Console) -> None:+ jobs = harbor_job_links(agent_eval)+ if jobs:+ console.print(" [bold]Harbor artifacts:[/bold]")+ for job in jobs:+ console.print(f" [bold]{escape_markup(job['name'])}[/bold]", highlight=False)+ if job.get("url"):+ console.print(f" Harbor logs: Results {escape_markup(job['url'])}", soft_wrap=True, highlight=False)+ if job.get("analysis_url"):+ console.print(+ f" Harbor analysis: {escape_markup(job['analysis_url'])}", soft_wrap=True, highlight=False+ )+@staticmethoddef _print_agent_eval_tables(agent_eval: dict, console: Console) -> None:"""Print Tier 3 agent evaluation results."""@@ -395,19 +417,7 @@ class CLIReporter(ReporterBase):)if runtime:console.print(f" [dim]Runtime: {runtime:.1f}s[/dim]")- harbor_viewer = normalize_harbor_viewer_for_display(agent_eval)- if harbor_viewer.get("job_url") or harbor_viewer.get("analysis_url"):- console.print(" [dim]Harbor artifacts:[/dim]")- if harbor_viewer.get("job_url"):- console.print(- f" [dim]Harbor logs:[/dim] [dim]{escape_markup(harbor_viewer['job_url'])}[/dim]",- soft_wrap=True,- )- if harbor_viewer.get("analysis_url"):- console.print(- f" [dim]Harbor analysis:[/dim] [dim]{escape_markup(harbor_viewer['analysis_url'])}[/dim]",- soft_wrap=True,- )+ CLIReporter._print_harbor_artifacts(agent_eval, console)console.print(f" {trial_coverage(agent_eval).text}")console.print()diff --git a/src/skillevaluator/reporting/harbor_viewer.py b/src/skillevaluator/reporting/harbor_viewer.pyindex 9ab88a02..46690733 100644--- a/src/skillevaluator/reporting/harbor_viewer.py+++ b/src/skillevaluator/reporting/harbor_viewer.py@@ -28,7 +28,8 @@ def normalize_harbor_viewer_for_display(agent_eval: dict[str, Any]) -> dict[str,jobs: list[dict[str, str]] = []seen_jobs: set[str] = set()- for item in raw.get("jobs") or []:+ raw_jobs = raw.get("jobs")+ for item in raw_jobs if isinstance(raw_jobs, list) else []:if not isinstance(item, dict):continueurl = safe_url(item.get("url") or item.get("job_url"))@@ -50,7 +51,8 @@ def normalize_harbor_viewer_for_display(agent_eval: dict[str, Any]) -> dict[str,evidence: list[dict[str, Any]] = []seen_evidence: set[str] = set()- for item in raw.get("evidence_links") or []:+ raw_evidence = raw.get("evidence_links")+ for item in raw_evidence if isinstance(raw_evidence, list) else []:if not isinstance(item, dict):continueurl = safe_url(item.get("url"))@@ -66,6 +68,34 @@ def normalize_harbor_viewer_for_display(agent_eval: dict[str, Any]) -> dict[str,return out+def harbor_job_links(agent_eval: dict[str, Any]) -> list[dict[str, str]]:+ """Project every normalized job and unmatched legacy link, without attribution."""+ viewer = normalize_harbor_viewer_for_display(agent_eval)+ jobs = [dict(job) for job in viewer.get("jobs", [])]+ job_url, analysis_url = viewer.get("job_url"), viewer.get("analysis_url")+ unmatched_analysis = bool(analysis_url) and not any(job.get("analysis_url") == analysis_url for job in jobs)+ if job_url and not any(job["url"] == job_url for job in jobs):+ legacy = {"url": job_url}+ if unmatched_analysis:+ # A top-level job_url/analysis_url pair describes one job.+ legacy["analysis_url"] = analysis_url+ unmatched_analysis = False+ jobs.append(legacy)+ for index, job in enumerate(jobs, 1):+ job["name"] = job.get("name") or f"Job {index}"+ if unmatched_analysis:+ # A run-level analysis is not a job; never number it as one.+ jobs.append({"name": "Run analysis", "analysis_url": analysis_url})+ seen_analysis: set[str] = set()+ for job in jobs:+ analysis = job.get("analysis_url")+ if analysis in seen_analysis:+ job.pop("analysis_url", None)+ elif analysis:+ seen_analysis.add(analysis)+ return jobs++def normalize_agent_eval_harbor_links(agent_eval: dict[str, Any]) -> dict[str, Any]:"""Return a shallow copy with display-safe Harbor links in nested fields."""normalized = dict(agent_eval)diff --git a/src/skillevaluator/reporting/html.py b/src/skillevaluator/reporting/html.pyindex 5b69f7db..1af5b49c 100644--- a/src/skillevaluator/reporting/html.py+++ b/src/skillevaluator/reporting/html.py@@ -47,6 +47,7 @@ from skillevaluator.reporting.base import (ReporterBase,additional_errors,additional_warnings,+ agent_eval_publication_dataset_provenance,agent_eval_publication_evidence_complete,agent_eval_report_serialization_issue,agent_eval_report_serialization_limits,@@ -77,7 +78,7 @@ from skillevaluator.reporting.finding_summary import (summarize_messages,total_issue_count,)-from skillevaluator.reporting.harbor_viewer import normalize_agent_eval_harbor_links+from skillevaluator.reporting.harbor_viewer import harbor_job_links, normalize_agent_eval_harbor_linksfrom skillevaluator.reporting.presentation import (FinalRenderContext,TierPresentation,@@ -86,9 +87,11 @@ from skillevaluator.reporting.presentation import (success_is_not_applicable,)from skillevaluator.reporting.run_status import Status, result_status, result_tier+from skillevaluator.reporting.tier2_views import tier2_scope_viewsfrom skillevaluator.reporting.tier3_scope import completed_agent_result, validate_report_scopefrom skillevaluator.reporting.trial_charts import steps_by_case_chartfrom skillevaluator.skillspector_provenance import skillspector_provenance_records+from skillevaluator.source_identity import recorded_evaluated_sourceif TYPE_CHECKING:from skillevaluator.models import ValidationResult@@ -3353,6 +3356,10 @@ class HTMLReporter(ReporterBase):tier1_contributors=tier1_contributors,tier1_display_summary=tier1_display_summary,tier2_results=tier2_results,+ tier2_scopes=tier2_scope_views(tier2_results),+ harbor_jobs=harbor_job_links(tier3_data or {}),+ dataset_provenance=agent_eval_publication_dataset_provenance(tier3_data),+ evaluated_source=recorded_evaluated_source(result.metadata for result in results),tier3_lift_pass_threshold=TIER3_LIFT_PASS_THRESHOLD,tier3_lift_fail_threshold=TIER3_LIFT_FAIL_THRESHOLD,quality_min_score=quality_min_score,diff --git a/src/skillevaluator/reporting/markdown.py b/src/skillevaluator/reporting/markdown.pyindex e52031ad..40278c93 100644--- a/src/skillevaluator/reporting/markdown.py+++ b/src/skillevaluator/reporting/markdown.py@@ -38,7 +38,7 @@ from skillevaluator.reporting.finding_summary import ()from skillevaluator.reporting.harbor_viewer import (harbor_evidence_link_text,- normalize_harbor_viewer_for_display,+ harbor_job_links,safe_url,)from skillevaluator.reporting.run_status import Status, resolve_run_status, result_status@@ -360,11 +360,22 @@ class MarkdownReporter(ReporterBase):runtime_number = _finite_report_number(runtime)runtime_text = f"{runtime_number:.1f}s" if runtime_number is not None else "N/A"lines.append(f"**Runtime:** {runtime_text}")- harbor_viewer = normalize_harbor_viewer_for_display(ae)- if job_url := _markdown_safe_url(harbor_viewer.get("job_url")):- lines.append(f"**Harbor logs:** [Open Harbor logs]({job_url})")- if analysis_url := _markdown_safe_url(harbor_viewer.get("analysis_url")):- lines.append(f"**Harbor analysis:** [Open Harbor analysis]({analysis_url})")+ # One list item per job, so CommonMark keeps each job's links separate.+ job_lines = []+ for job in harbor_job_links(ae):+ links = [+ f"[{label}]({url})"+ for label, url in (+ ("Harbor logs", _markdown_safe_url(job.get("url"))),+ ("Harbor analysis", _markdown_safe_url(job.get("analysis_url"))),+ )+ if url+ ]+ if links:+ job_lines.append(f"- **{_markdown_inline_text(job['name'])}:** " + " · ".join(links))+ if job_lines:+ lines.append("")+ lines.extend(job_lines)lines.append("")evaluators = ae.get("evaluators", {})diff --git a/src/skillevaluator/reporting/templates/report.html.j2 b/src/skillevaluator/reporting/templates/report.html.j2index 7725f675..af9a697b 100644--- a/src/skillevaluator/reporting/templates/report.html.j2+++ b/src/skillevaluator/reporting/templates/report.html.j2@@ -1119,7 +1119,6 @@.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;@@ -1229,7 +1228,7 @@}</style><style>{% include "report_ui.css.j2" %}</style>-<noscript><style>.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}</style></noscript>+<noscript><style>.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) %}@@ -1260,9 +1259,7 @@<div class="header-meta"><span class="header-status-badge verdict-badge {{ verdict_class }}" data-verdict="{{ verdict_key }}"><span class="verdict-dot" aria-hidden="true"></span><span class="sr-only">Verdict: </span>{{ verdict_label }}</span><div class="header-controls">- <button type="button" class="theme-toggle" onclick="toggleTheme()" aria-pressed="false" title="Switch between the light and dark themes">- <span id="theme-icon" aria-hidden="true">☾</span><span id="theme-text">Dark theme</span>- </button>+ <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>@@ -1274,13 +1271,15 @@<aside class="report-sidebar" aria-label="Report navigation"><a class="sidebar-brand" href="#report-workspace">{{ se_logo("se-logo-sidebar", 28, "") }}<span class="sidebar-brand-text">SkillEvaluator<small>Evaluation report</small></span></a><span class="sidebar-label">THIS REPORT</span>- <a href="#report-workspace" class="sidebar-current">Summary</a>- <a href="#report-evidence">Findings & evidence</a>- <a href="#run-metadata">Run details</a>+ <a href="#report-workspace" data-report-section="report-workspace" class="sidebar-current" aria-current="location">Summary</a>+ {% for number, tier in presentation.tiers.items() if tier.displayed or (tabs | selectattr('id', 'equalto', 'tier' ~ number) | list) %}+ <a href="#tab-tier{{ number }}" data-report-tier="tier{{ number }}">Tier {{ number }}</a>+ {% endfor %}+ <a href="#run-metadata" data-report-section="run-metadata">Run details</a>{% if ci.get('report_index_url') %}<a class="sidebar-index-link" href="{{ ci.report_index_url }}">← All skills</a>{% endif %}<div class="sidebar-footer">Evidence you can inspect.<br>Self-contained report.</div></aside>- <main class="container" id="report-workspace">+ <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 %}@@ -1308,7 +1307,9 @@<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_class }}">{{ presentation.command_label }}</p>+ <p class="hero-command-status verdict-chip {{ verdict_class }}">{{ 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 %}{#-Show the *full* path/URL only when it actually addsinformation (i.e. it differs from the friendly label).@@ -1334,25 +1335,20 @@{% if has_tier3 %}{% set tier3_environment = (tier3.summary.environment if tier3.summary is defined and tier3.summary else None) or tier3.environment %}{% if tier3_is_skipped %}- <span class="verdict-chip warn"><span class="sr-only">Tier 3 verdict: </span>{{ verdict_words['skipped'] }}</span>+ <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' %}- <span class="verdict-chip {{ {'pass': 'pass', 'fail': 'fail'}.get(t3_key, 'warn') }}"><span class="sr-only">Tier 3 verdict: </span>{{ advisory_fail_word if tier3_advisory_fail else verdict_words[t3_key] }}</span>+ <span class="verdict-chip {{ {'pass': 'pass', 'fail': 'fail'}.get(t3_key, 'warn') }}">Tier 3 quality: {{ advisory_fail_word if tier3_advisory_fail else verdict_words[t3_key] }}</span>{% if t3_key == 'incomplete' and tier3_status_reason %}<p class="hero-reason">{{ tier3_status_reason }}</p>{% endif %}<div class="agent-hero-score {{ 'score-pass' if hero_score is not none and hero_score >= 0.8 else ('score-warn' if hero_score is not none and hero_score >= 0.6 else 'score-fail') }}">{{ "%.2f" | format(hero_score) if hero_score is not none else "N/A" }}<span class="hero-score-label">{{ presentation.score_scope }}{{ ' (baseline)' if tier3.get('mode') == 'baseline_only' else '' }}</span></div><div class="agent-hero-detail"><div><strong>Best performing agent:</strong> {{ tier3.best_agent or 'N/A' }}</div>{% if tier3.get('mode') == 'baseline_only' %}<div>Baseline-only run (<code>--skip-with-skill</code>): no with-skill arm, so no skill lift was measured.</div>{% endif %}{% if completed_agent and completed_agent.needs_attention %}<div class="score-warn">Completed-agent result. Other execution failures need attention; see agent details.</div>{% endif %}- {% if completed_agent and completed_agent.recovered_attempts %}<div>{{ completed_agent.recovered_attempts }} timeout attempt(s) recovered; failed history retained.</div>{% endif %}- <div 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_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 %}{% endif %}@@ -1363,24 +1359,17 @@{% endif %}</div></div>- {#-- Per-tier summary tiles. Each tier renders its own card iff its- tab exists in ``tabs`` (so an agent-eval-only run shows just- Tier 3, a Tier-1+2 run shows two cards, a full pipeline shows- three). Stats are sourced from per-tier summaries computed in- ``HTMLReporter.render_all`` rather than the global aggregate- counters, so each card reflects only its own tier.-- Each card is also the *navigation control* for its tier — the- inline ``onclick``/keyboard handlers swap to the matching tab- immediately, replacing the previous secondary "nav-tabs" pill- row that lived below the hero. ``initial_tab`` matches the- first ``tab.id`` so the card's ``active`` styling lines up- with whichever tab content is rendered active by default.- -#}+ {# 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 %}+ {% 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 %}<div 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')) %}@@ -1388,6 +1377,8 @@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"@@ -1414,6 +1405,7 @@</div>{% endif %}</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')) %}@@ -1421,6 +1413,8 @@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"@@ -1434,9 +1428,10 @@<span><strong>{{ tier2_summary.passed_count }}</strong> of {{ tier2_summary.executed_count }} checks passed</span>{% if tier2_summary.not_applicable_count %}<span><strong>{{ tier2_summary.not_applicable_count }}</strong> not applicable</span>{% endif %}{% if tier2_summary.skipped_count %}<span><strong>{{ tier2_summary.skipped_count }}</strong> skipped</span>{% endif %}- {% if tier2_summary.issue_count %}<span><strong>{{ tier2_summary.issue_count }}</strong> duplicate(s)</span>{% endif %}+ {% if tier2_summary.issue_count %}<span><strong>{{ tier2_summary.issue_count }}</strong> finding(s)</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' %}@@ -1446,6 +1441,8 @@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.key==='Enter'||event.key===' '){event.preventDefault();showTab('tier3');}"aria-label="Open Tier 3: Live Agent Evaluation"@@ -1471,13 +1468,26 @@</div>{% endif %}</div>+ {% elif presentation.tiers[3].displayed %}{{ absent_tier_tile(3, presentation.tiers[3]) }}{% endif %}+</div></section>- {% if not has_tier1 %}<div id="report-evidence" class="workspace-heading"><h2>Findings & evidence</h2><p>Each check with its results and the evidence behind them.</p></div>{% endif %}- {% for tab in tabs %}- <div id="tab-{{ tab.id }}" class="tab-content {{ 'active' if loop.first else '' }}">- {% if tab.id == 'tier1' %}+ <nav class="mobile-tier-nav" aria-label="Tier navigation">+ {% for number, tier in presentation.tiers.items() if tier.displayed or (tabs | selectattr('id', 'equalto', 'tier' ~ number) | list) %}<a href="#tab-tier{{ number }}" data-report-tier="tier{{ number }}">Tier {{ number }}</a>{% endfor %}+ </nav>+ <div id="report-evidence" class="workspace-heading" tabindex="-1"><h2>Findings & evidence</h2><p>Each check with its results and the evidence behind them.</p></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) %}+ <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 %}@@ -1566,7 +1576,7 @@</div>{% endif %}</section>- <div id="report-evidence" class="workspace-heading"><h2>Findings & evidence</h2><p>Each check with its findings, evidence and suggested fixes.</p></div>+{# ==================== FINDING TYPES ==================== #}{% if top_issues %}<div class="top-issues-section {{ 'advisory-findings' if all_passed and not has_incomplete else '' }}">@@ -1613,6 +1623,12 @@</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">@@ -2062,26 +2078,26 @@{% elif tab.id == 'tier2' %}{# ==================== TIER 2: SEMANTIC OVERLAP ==================== #}- {% set tier2_findings = [] %}{% for r in tier2_results %}{% for f in r.findings %}{% if tier2_findings.append(f) %}{% endif %}{% endfor %}{% endfor %}-- <div class="dashboard">- <div class="dashboard-card">- <h3 class="dashboard-card-title">Checks Run</h3>- <p class="dashboard-card-value">{{ tier2_summary.executed_count }}</p>- <p class="dashboard-card-subtitle">Semantic overlap analysis</p>- </div>- <div class="dashboard-card danger">- <h3 class="dashboard-card-title">Matches Found</h3>- <p class="dashboard-card-value">{{ tier2_findings | length }}</p>- <p class="dashboard-card-subtitle" style="font-size:0.8rem;">Within or across evaluated skills</p>+ <nav aria-label="Tier 2 comparison scopes" class="tier2-scope-nav">+ {% for scope in tier2_scopes %}<a href="#tier2-{{ scope.id }}">{{ scope.label }}</a>{% endfor %}+ </nav>+ {% for scope in tier2_scopes %}+ <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 %}+ <div class="dashboard">+ {#- Across skills counts every similarity match, not only duplicates. -#}+ {% 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 class="dashboard-card">+ <h3 class="dashboard-card-title">{{ label }}</h3>+ <p class="dashboard-card-value">{{ 'Not applicable' if label == 'Catalog entries compared' and scope.catalog_not_applicable else (value if value is not none else 'Unavailable') }}</p>+ </div>+ {% endfor %}</div>- </div>-- {% if tier2_results %}- <p style="color:var(--text-secondary);font-size:0.9rem;margin:0.75rem 0;">- Checks for redundant content within one skill and semantic overlap across skills or local catalog entries.- </p>- {% for result in tier2_results %}+ {% endif %}+ {% for note in scope.notes %}<p class="t3-section-hint">{{ note }}</p>{% 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;">@@ -2100,7 +2116,7 @@<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 %}+ {% 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 %}@@ -2136,9 +2152,8 @@</details>{% endfor %}{% endfor %}- {% else %}- <p style="color: var(--text-secondary); padding: 1rem;">No Tier 2 checks were run. Configure a public embedding provider, then run <code>similarity-check</code> or <code>dedup-scan</code>.</p>- {% endif %}+ </section>+ {% endfor %}{% elif tab.id == 'tier3' %}{# ==================== TIER 3: AGENT EVALUATION (dimensions-first, schema v2.0) ==================== #}@@ -2431,13 +2446,13 @@}</style>- <nav class="t3-subtabs">- <button class="t3-subtab active" data-tier3-tab="overview" onclick="showTier3SubTab('overview', this)">Overview</button>- <button class="t3-subtab" data-tier3-tab="suggestions" onclick="showTier3SubTab('suggestions', this)">Insights</button>- <button class="t3-subtab" data-tier3-tab="agents" onclick="showTier3SubTab('agents', this)">Agent Details</button>- <button class="t3-subtab" data-tier3-tab="trials" onclick="showTier3SubTab('trials', this)">Trials</button>- <button class="t3-subtab" data-tier3-tab="dataset" onclick="showTier3SubTab('dataset', this)">Dataset</button>- <button class="t3-subtab" data-tier3-tab="provenance" onclick="showTier3SubTab('provenance', this)">Diagnostics</button>+ <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 %}@@ -2470,7 +2485,7 @@{% endif %}{# ---------- Overview ---------- #}- <section class="t3-page active" id="tier3-page-overview">+ <section class="t3-page active" id="tier3-page-overview" role="tabpanel" aria-labelledby="tier3-tab-overview" tabindex="0">{% set t3_effect = (tier3.conclusions or []) | selectattr('title', 'equalto', 'Skill effect') | first %}<div class="t3-overview-lead">{% if tier3_is_skipped %}@@ -2500,15 +2515,19 @@{% endif %}{% endif %}</div>- {% if t3_harbor_job_url or t3_harbor_analysis_url %}+ {% 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">- {% if t3_harbor_job_url %}<a class="t3-harbor-link" href="{{ t3_harbor_job_url }}" target="_blank" rel="noopener">Open Harbor logs</a>{% endif %}- {% if t3_harbor_analysis_url %}<a class="t3-harbor-link" href="{{ t3_harbor_analysis_url }}" target="_blank" rel="noopener">Open Harbor analysis</a>{% endif %}+ {% for job in harbor_jobs %}+ <div><strong>{{ job.name }}</strong>+ {% 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 %}@@ -2778,7 +2797,7 @@</section>{# ---------- Trials ---------- #}- <section class="t3-page" id="tier3-page-trials">+ <section class="t3-page" id="tier3-page-trials" role="tabpanel" aria-labelledby="tier3-tab-trials" tabindex="0">{# Drill-down rows for both conditions: with-skill rows come from the canonicaltop-level trials, baseline rows from each agent's trials_baseline. #}{% set t3_condition_trial_rows = [] %}@@ -3297,7 +3316,7 @@</section>{# ---------- Agent Details ---------- #}- <section class="t3-page" id="tier3-page-agents">+ <section class="t3-page" id="tier3-page-agents" role="tabpanel" aria-labelledby="tier3-tab-agents" tabindex="0">{% if t3_agents %}{% set t3_palette = ["#76b900","#8b5cf6","#ec4899","#06b6d4","#3b82f6","#f59e0b","#22c55e"] %}<nav class="t3-agent-tabs" role="tablist" aria-label="Agent details">@@ -3306,7 +3325,7 @@{% 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"+ 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 }};"@@ -3329,7 +3348,7 @@{% if best_dim is none or dscore > (best_dim.score if best_dim.score is not none else best_dim.with_skill) %}{% set best_dim = d %}{% endif %}{% if worst_dim is none or dscore < (worst_dim.score if worst_dim.score is not none else worst_dim.with_skill) %}{% set worst_dim = d %}{% endif %}{% endfor %}- <div class="t3-agent-panel{% if loop.first %} active{% endif %}" id="{{ t3_agent_panel_ids[name] }}" data-tier3-agent="{{ name }}" role="tabpanel">+ <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 agentnames can contain characters that are unsafe in CSS/HTML IDs (slashes,dots), so deep-links from Overview point at this anchor instead of@@ -3521,7 +3540,7 @@</section>{# ---------- Dataset ---------- #}- <section class="t3-page" id="tier3-page-dataset">+ <section class="t3-page" id="tier3-page-dataset" role="tabpanel" aria-labelledby="tier3-tab-dataset" tabindex="0">{% if t3_dataset %}<div class="t3-dataset-hero"><h2>AgentSkills Dataset</h2>@@ -3586,7 +3605,7 @@</section>{# ---------- Insights (Conclusions + Recommendations) ---------- #}- <section class="t3-page" id="tier3-page-suggestions">+ <section class="t3-page" id="tier3-page-suggestions" role="tabpanel" aria-labelledby="tier3-tab-suggestions" tabindex="0">{% set t3_has_conclusions = tier3.conclusions and (tier3.conclusions | length) > 0 %}{% set t3_recommendations = tier3.recommendations or [] %}{% set t3_has_suggestions = (t3_recommendations | length) > 0 or (tier3.suggestions and (tier3.suggestions | length) > 0) %}@@ -3718,7 +3737,7 @@</section>{# ---------- Diagnostics (raw SkillEvaluator data + downloads) ---------- #}- <section class="t3-page" id="tier3-page-provenance">+ <section class="t3-page" id="tier3-page-provenance" role="tabpanel" aria-labelledby="tier3-tab-provenance" tabindex="0"><p style="color:var(--text-secondary);">Diagnostics preserve raw evaluation artifacts for deep dives and troubleshooting.The main report leads with human-readable dimensions; the blocks below show the@@ -3726,6 +3745,24 @@one-click download.</p>+ <details class="t3-details">+ <summary>Recorded evaluation provenance</summary>+ <div class="t3-details-body">+ <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 notan Overview decision signal. Keep it here so reviewers can confirm the exactmax-attempts / pass-threshold / stop-on-pass settings the run used. #}@@ -3891,18 +3928,10 @@return false;}function showTier3SubTab(id, btn) {- document.querySelectorAll('.t3-page').forEach(function(p){ p.classList.remove('active'); });- document.querySelectorAll('.t3-subtab').forEach(function(t){ t.classList.remove('active'); });- var page = document.getElementById('tier3-page-' + id);- if (page) page.classList.add('active');- if (btn) btn.classList.add('active');+ activateReportTabs('.t3-subtab', '.t3-page', 'tier3-page-' + id, btn);}function showTier3Agent(panelId, btn) {- document.querySelectorAll('.t3-agent-panel').forEach(function(p){ p.classList.remove('active'); });- document.querySelectorAll('.t3-agent-tab-btn').forEach(function(t){ t.classList.remove('active'); });- var panel = document.getElementById(panelId);- if (panel) panel.classList.add('active');- if (btn) btn.classList.add('active');+ 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@@ -3910,20 +3939,12 @@function jumpToTier3Agent(anchorId) {var anchor = document.getElementById(anchorId);if (!anchor) return;- var name = anchor.getAttribute('data-tier3-agent-name');+ activateReportTier('tier3', {scroll:false, focus:false});var panelId = anchor.getAttribute('data-tier3-agent-panel-id');- var subTabBtn = document.querySelector('.t3-subtab[data-tier3-tab="agents"]');+ var subTabBtn = document.getElementById('tier3-tab-agents');showTier3SubTab('agents', subTabBtn);- if (name) {- // CSS.escape() guards against agent names containing characters that are- // unsafe inside a CSS attribute selector (`"`, `]`, etc.). Without the- // escape, names like ``model"v2`` would produce a malformed selector and- // the per-agent panel would silently fail to activate. Fallback to the- // raw concatenation only on ancient browsers without CSS.escape.- var safeName = (typeof CSS !== 'undefined' && typeof CSS.escape === 'function')- ? CSS.escape(name)- : name;- var agentTabBtn = document.querySelector('.t3-agent-tab-btn[data-tier3-agent="' + safeName + '"]');+ 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') {@@ -3934,7 +3955,10 @@// .t3-agent-panel could land the scroll on a transitional or// off-screen position.var scroll = function () {- anchor.scrollIntoView({ behavior: 'smooth', block: 'start' });+ 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);@@ -4290,6 +4314,12 @@<details class="run-metadata" id="run-metadata"><summary>Run details & provenance</summary><div class="metadata-grid">+ {% 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_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 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 %}@@ -4320,30 +4350,6 @@<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 toggleTheme() {- const html = document.documentElement;- const newTheme = html.getAttribute('data-theme') === 'dark' ? 'light' : 'dark';- html.setAttribute('data-theme', newTheme);- try { localStorage.setItem('skillevaluator-theme', newTheme); } catch (err) { /* Storage is optional for standalone files. */ }- updateThemeButton(newTheme);- if (window.rebuildTier3Charts) window.rebuildTier3Charts();- }- // The button is a "Dark theme" toggle: its name stays fixed and- // aria-pressed says whether the dark theme is on.- function updateThemeButton(theme) {- const toggle = document.querySelector('.theme-toggle');- if (toggle) toggle.setAttribute('aria-pressed', theme === 'dark' ? 'true' : 'false');- }- function initTheme() {- let savedTheme = null;- try { savedTheme = localStorage.getItem('skillevaluator-theme'); } catch (err) { /* Standalone reports work without storage. */ }- if (savedTheme !== 'dark' && savedTheme !== 'light') {- savedTheme = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';- }- document.documentElement.setAttribute('data-theme', savedTheme);- updateThemeButton(savedTheme);- if (window.rebuildTier3Charts) window.rebuildTier3Charts();- }function exportJSON() {let jsonData = document.getElementById('report-data').textContent;try {@@ -4362,25 +4368,7 @@document.body.removeChild(a);URL.revokeObjectURL(url);}- function showTab(tabId, btn) {- document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));- const tab = document.getElementById('tab-' + tabId);- if (tab) tab.classList.add('active');- // Tier cards in the hero double as the top-level navigation, so- // sync their selected state to whichever tab is now active.- document.querySelectorAll('.tier-card[data-target-tab]').forEach(card => {- card.classList.toggle('active', card.dataset.targetTab === tabId);- card.setAttribute('aria-pressed', card.dataset.targetTab === tabId ? 'true' : 'false');- });- // Keep the legacy ``btn`` arg working for any caller that still- // passes a clicked element (e.g. older bookmarks/anchors).- if (btn && btn.classList) {- btn.classList.add('active');- }- if (tab) {- tab.scrollIntoView({behavior: 'smooth', block: 'start'});- }- }+ function showTab(tabId, btn) { activateReportTier(tabId); }function filterValidators(status) {const cards = document.querySelectorAll('.validator-card');const rows = document.querySelectorAll('.summary-table tbody tr');@@ -4422,18 +4410,25 @@}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: 'smooth', block: 'start' });+ 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: 'smooth' }); }+ 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');@@ -4487,7 +4482,7 @@});}function scrollToSkill(skillName) {- const card = Array.from(document.querySelectorAll('.skill-card')).find(card => card.dataset.skillName === skillName);+ const card = _openSkillCard(skillName);if (!card) return;// Make sure it's visible (clear any active filter)card.style.display = '';@@ -4498,7 +4493,9 @@const arrow = card.querySelector('.expand-text');if (arrow) arrow.textContent = '▲';}- card.scrollIntoView({ behavior: 'smooth', block: 'start' });+ card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });+ card.tabIndex = -1;+ card.focus({preventScroll:true});// Brief highlightcard.style.boxShadow = '0 0 0 3px var(--secondary-color)';setTimeout(() => { card.style.boxShadow = ''; }, 2000);@@ -4538,13 +4535,15 @@for (let parent = target.parentElement; parent && parent !== card; parent = parent.parentElement) {if (parent.tagName === 'DETAILS') parent.open = true;}- target.scrollIntoView({ behavior: 'smooth', block: 'center' });+ 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: 'smooth', block: 'start' });+ card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });card.style.boxShadow = '0 0 0 3px var(--secondary-color)';setTimeout(() => { card.style.boxShadow = ''; }, 2000);}@@ -4557,11 +4556,13 @@if (!card) return;const block = card.querySelector('.quality-score-block');if (block) {- block.scrollIntoView({ behavior: 'smooth', block: 'center' });+ 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: 'smooth', block: 'start' });+ card.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });}}function filterToAffectedSkills(row) {@@ -4607,7 +4608,7 @@if (issueKey && affectedSkills.length > 0) {scrollToFinding(affectedSkills[0], issueKey);} else {- banner.scrollIntoView({ behavior: 'smooth', block: 'start' });+ banner.scrollIntoView({ behavior: reportScrollBehavior(), block: 'start' });}}function clearSkillFilter() {@@ -4657,7 +4658,7 @@r.style.display = show ? '' : 'none';});}- document.addEventListener('DOMContentLoaded', initTheme);+ document.addEventListener('DOMContentLoaded', initReportTheme);{% include "report_ui.js.j2" %}</script></body>diff --git a/src/skillevaluator/reporting/templates/report_ui.css.j2 b/src/skillevaluator/reporting/templates/report_ui.css.j2index 7b36c088..df564c7e 100644--- a/src/skillevaluator/reporting/templates/report_ui.css.j2+++ b/src/skillevaluator/reporting/templates/report_ui.css.j2@@ -17,6 +17,8 @@ button,input,summary{font:inherit}button{cursor:pointer}a{color:var(--secondary-@media(min-width:1600px){.container{padding-top:40px}}@media(max-width:1150px){body{padding-left:180px}.report-sidebar{width:180px}.report-sidebar .sidebar-brand{font-size:13px;gap:7px}.container{padding:25px}.header-content{padding:0 25px}.header-content{flex-wrap:wrap}.header-status-badge{display:inline-flex;white-space:normal}.dashboard-card{min-width:110px;padding:0 12px}.agent-hero-title{font-size:25px}.top-issues-table th,.top-issues-table td{padding:10px}.severity-filter-group{margin-left:0}}@media(max-width:760px){body{padding-left:0}.report-sidebar{position:relative;width:100%;padding:13px 18px;flex-direction:row;align-items:center;gap:6px;flex-wrap:wrap}.report-sidebar .sidebar-brand{padding:0;margin-right:auto;font-size:14px}.sidebar-brand small,.sidebar-label,.sidebar-footer{display:none}.report-sidebar>a:not(.sidebar-brand){margin:0;padding:8px 10px;white-space:nowrap}.report-sidebar{overflow-x:auto;flex-wrap:nowrap}.main-header{padding:10px 0}.header-content{padding:0 18px;gap:8px}.header-brand .header-subtitle{display:none}.header-meta{width:100%;justify-content:space-between}.header-controls{width:100%;justify-content:flex-end}.header-controls button{min-height:36px}.container{padding:20px 16px 40px}.agent-hero{padding:20px}.agent-hero-top{display:block}.agent-hero-title{font-size:25px}.agent-hero-score.verdict-text,.agent-hero-score,.agent-hero-detail,.verdict-caption{text-align:left}.agent-hero-score.verdict-text{margin-top:22px;font-size:22px}.agent-hero-detail{margin-top:8px}.verdict-caption{margin-bottom:5px}.tier-cards{display:block}.tier-card{margin-top:8px;min-width:0}.tier-card-stats{display:flex;flex-wrap:wrap;gap:8px}.scope-strip{gap:6px 12px;font-size:12px}.scope-strip span+span{padding-left:0;border:0}.scope-strip span:first-child{width:100%}.metadata-grid{grid-template-columns:1fr}.dashboard{gap:16px 0}.dashboard-card{min-width:45%;padding-left:14px}.dashboard-card:nth-child(2n){border-right:0}.dashboard-card-value{font-size:20px}.report-searchbar input{width:100%;flex-basis:100%;order:2}.report-searchbar label{flex:1}.report-searchbar #report-search-count{order:3}.filter-group{gap:6px}.filter-group .severity-filter-group{width:100%;padding-top:8px}.skill-header{display:block;padding:14px}.skill-name{font-size:12px;word-break:break-word}.skill-checks-summary{margin-top:12px}.skill-content.active{padding:12px}.top-issues-table{min-width:620px}.quality-score-block>div:first-child{flex-wrap:wrap;gap:8px}.validator-collapsible{flex-wrap:wrap}.workspace-heading h2{font-size:18px}.workspace-heading p{font-size:11px}.skip-link{left:10px}footer{padding:18px;font-size:11px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition:none!important;animation:none!important}}++@media print{body{padding-left:0;background:#fff;color:#111}.skip-link,.report-sidebar,.header-controls,.report-searchbar,.filter-group,.view-toggle-section,#backToTop,.report-no-matches{display:none!important}.container{max-width:none;padding:0}.tab-content,.results-view,.skill-card,.validator-card,.skill-content,.validator-content,.top-issues-content,.contributor-content,.summary-table-container{display:block!important;max-height:none!important;height:auto!important;overflow:visible!important}.skill-card,.validator-card,.top-issues-section{break-inside:auto}.skill-content,.validator-content{padding:12px!important}.scope-strip,.run-metadata{font-size:12px}.agent-hero{padding:15px}.run-metadata>.metadata-grid{display:grid!important}.finding-suggestion{max-height:none!important}footer{padding:12px}.dashboard-card{min-width:100px}.top-issues-table{min-width:0}.report-breadcrumb{margin-bottom:8px}a{color:inherit}}.quality-outcome-note{font-size:11px;color:var(--text-secondary);margin-bottom:12px}.export-btn{text-decoration:none}@@ -81,3 +83,232 @@ details.check-result>summary{cursor:pointer;list-style:none;margin-bottom:0}deta/* Tier 3 pills: the type floor and AA text in both themes. The Tier 3 tab has its own later style block, hence the .tab-content prefix. */.tab-content .t3-insight-source,.tab-content .t3-sug-cat{font-size:11px}.tab-content .insight-source-llm{color:var(--llm-tx)}++/* Native page scrolling and complete expanded evidence. */+:root{color-scheme:light;scrollbar-gutter:stable;--mobile-nav-height:0px;--tier3-nav-height:0px}+[data-theme="dark"]{color-scheme:dark}+html{scroll-behavior:auto}+.table-container.active,.summary-table-container.active{max-height:none;overflow-y:visible}+.skill-content.active,.validator-content.active,.top-issues-content.active,.contributor-content.active{overflow-y:visible}+.raw-output{max-height:320px;overflow:auto;scrollbar-gutter:stable}+.tab-content,.workspace-heading,.run-metadata,.t3-agent-anchor,.check-result,.check-finding{scroll-margin-top:calc(var(--mobile-nav-height) + 80px)}+.tab-content:focus,.container:focus{outline:none}+.theme-control{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--text-secondary)}+.theme-control select{font:inherit;color:var(--dark-text);background:var(--bg);border:1px solid var(--border-color);border-radius:5px;padding:7px;min-height:36px}+select:focus-visible{outline:3px solid var(--focus-ring);outline-offset:3px}+.tier-empty{padding:24px;border:1px solid var(--border-color);border-radius:8px;background:var(--bg)}+.tier-empty h2{font-size:18px}.tier-empty p{color:var(--text-secondary);margin-top:10px}+.mobile-tier-nav{display:none}+.agent-hero{padding:20px 24px}.agent-hero-detail{max-width:460px}+.t3-subtabs{top:var(--mobile-nav-height)!important;scrollbar-gutter:stable}+.t3-subtab,.t3-agent-tab-btn{min-height:40px}+.t3-agent-anchor{scroll-margin-top:calc(var(--mobile-nav-height) + 80px)}+@media(max-width:760px){+ .report-sidebar{position:relative;overflow:visible;flex-wrap:wrap;gap:6px}+ .report-sidebar [data-report-tier]{display:none}+ .report-sidebar .sidebar-brand{flex:1}+ .mobile-tier-nav{display:flex;position:sticky;top:0;z-index:100;gap:6px;padding:8px;background:var(--sidebar-bg);border-radius:6px;box-shadow:0 2px 4px #0001;margin-bottom:16px}+ .mobile-tier-nav a{flex:1;padding:7px 10px;border-radius:4px;font-size:12px;text-align:center;color:#dce3e8;text-decoration:none;white-space:nowrap}+ .mobile-tier-nav a[aria-current]{color:#c3e498;background:#30392b;box-shadow:inset 0 -2px #76b900}+ .tier-cards{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;padding-top:16px}+ .tier-card{flex:1 1 150px;margin:0;padding:10px;min-width:0}+ .tier-card-title,.tier-card-stats{font-size:11px}.agent-hero{padding:16px}+ .report-sidebar>a:not(.sidebar-brand){padding:6px;font-size:12px}+ .t3-subtabs{border-radius:0;max-width:100%;z-index:90}+ .t3-subtab{padding:10px;font-size:12px}+}+@media(forced-colors:active){+ .tier-card.active,.mobile-tier-nav a[aria-current],.report-sidebar .sidebar-current,[role="tab"][aria-selected="true"]{outline:2px solid Highlight;outline-offset:-2px}+ .theme-control select{border:1px solid ButtonText}+}+@media print{+ :root,[data-theme="dark"]{color-scheme:light;--mobile-nav-height:0px;--tier3-nav-height:0px}+ .mobile-tier-nav,.theme-control{display:none!important}+ .tab-content,.t3-page,.t3-agent-panel,.table-container,.summary-table-container{display:block!important;max-height:none!important;overflow:visible!important}+ .skill-card,.validator-card,.check-finding,.summary-table tr,.t3-trial-card{display:revert!important}+ .t3-filter-bar{display:none!important}+ .raw-output{max-height:none;overflow:visible}+}++.hero-decision-reason{font-size:12px;color:var(--text-secondary);margin-top:8px;max-width:420px}++@media screen and (prefers-color-scheme:dark){:root:not([data-theme]){color-scheme:dark;--light-bg:#151a1f;--bg:#1e252c;--bg-secondary:#252d35;--bg-tertiary:#303b46;--dark-text:#e1e6eb;--text-secondary:#aab5bf;--border-color:#3b454f;--secondary-color:#b0d684;--accent-color:#b0d684;--success-color:#a2cf72;--danger-color:#ffadb1;--warning-color:#e7c778;--critical-color:#ffadb1;--high-color:#f7b27a;--medium-color:#e7c778;--low-color:#aab5bf;--info-color:#8ccff0;--on-accent:#151a1f;--on-success:#151a1f;--on-danger:#151a1f;--on-warning:#151a1f;--focus-ring:#b0d684;--chart-grid:#4b5661;--chart-tick:#aab5bf;--chart-label:#e1e6eb;--table-header-bg:#252d35;--table-row-hover:#303b46;--badge-pass-bg:#293e27;--badge-pass-tx:#c4e7a0;--badge-fail-bg:#412a2d;--badge-fail-tx:#ffc1c4;--badge-warn-bg:#403826;--badge-warn-tx:#f4d792;--sev-critical-bg:#412a2d;--sev-critical-tx:#ffc1c4;--sev-high-bg:#45301f;--sev-high-tx:#ffcd9e;--sev-medium-bg:#403826;--sev-medium-tx:#f4d792;--sev-low-bg:#303b46;--sev-low-tx:#d0d7de;--sev-info-bg:#1d3646;--sev-info-tx:#a9d8f5;--llm-tx:#c4b5fd;--sidebar-bg:#151a1f;--se-logo-panel:#152117;--se-logo-panel-edge:#304631;--se-logo-ring-outer:#39523a;--se-logo-ring-middle:#6f9264;--se-logo-ring-inner:#dbe8d6;--se-logo-core:#76b900;--se-logo-core-edge:#9bdb34}}+/* Without JS there is no data-theme, so mirror the hard-coded dark overrides from+ report.html.j2 for system dark mode; test_nojs_dark_fallback keeps both in sync. */+@media screen and (prefers-color-scheme:dark){:root:not([data-theme]) .header-status-badge.fail { background: #450a0a; color: #fca5a5; border-color: #991b1b; } :root:not([data-theme]) .header-status-badge.warn { background: #451a03; color: #fcd34d; border-color: #92400e; } :root:not([data-theme]) .status-badge.pass { background: #14532d; color: #86efac; } :root:not([data-theme]) .status-badge.fail { background: #450a0a; color: #fca5a5; } :root:not([data-theme]) .status-badge.warn { background: #451a03; color: #fcd34d; } :root:not([data-theme]) .severity-critical, :root:not([data-theme]) .severity-high { background: #450a0a; color: #fca5a5; } :root:not([data-theme]) .severity-medium { background: #451a03; color: #fcd34d; } :root:not([data-theme]) .severity-low { background: #374151; color: #9ca3af; } :root:not([data-theme]) .severity-info { background: #1e3a8a; color: #93c5fd; } :root:not([data-theme]) .suggestion { background: #14532d; color: #bbf7d0; } :root:not([data-theme]) .check-finding .finding-suggestion { background: #14532d; color: #bbf7d0; } :root:not([data-theme]) .contributor-item-pill.pass { background: #14532d; color: #86efac; } :root:not([data-theme]) .contributor-item-pill.fail { background: #450a0a; color: #fca5a5; } :root:not([data-theme]) .skill-filter-banner { background: #1e3a5f; border-color: #2563eb; color: #93c5fd; } :root:not([data-theme]) .skill-filter-banner .clear-filter:hover { background: rgba(255,255,255,0.1); } :root:not([data-theme]) .confidence-badge.high-conf { background: #450a0a; color: #fca5a5; } :root:not([data-theme]) .confidence-badge.medium-conf { background: #451a03; color: #fcd34d; } :root:not([data-theme]) .confidence-badge.low-conf { background: #374151; color: #9ca3af; border-color: #4b5563; } :root:not([data-theme]) .finding-suggestion.truncatable::after { background: #14532d; } :root:not([data-theme]) .severity-breakdown-item.sev-critical, :root:not([data-theme]) .severity-breakdown-item.sev-high { background: #450a0a; color: #fca5a5; } :root:not([data-theme]) .severity-breakdown-item.sev-medium { background: #451a03; color: #fcd34d; } :root:not([data-theme]) .severity-breakdown-item.sev-low { background: #374151; color: #9ca3af; } :root:not([data-theme]) .severity-breakdown-label.advisory { color: #fcd34d; } :root:not([data-theme]) .dedup-finding-high { border-color: #991b1b; background: #450a0a; } :root:not([data-theme]) .dedup-finding-medium { border-color: #92400e; background: #451a03; }}++@media print{+ table{table-layout:fixed;width:100%!important;min-width:0!important}+ th,td{white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important}+ .skill-pill-group,.skill-pill,.quality-pill{white-space:normal;min-width:0;max-width:100%;flex-wrap:wrap}+ .table-scroll,.table-scroll-lg{overflow:visible;min-width:0;max-width:100%}+}++@media print{+ .metric-bar-cell,.metric-value,.t3-attempt-list,.t3-mad-cell,.t3-mad-bar,.t3-delta{min-width:0!important;max-width:100%;flex-wrap:wrap}+ .t3-attempt-chip{white-space:normal;overflow-wrap:anywhere}+}++@media(max-width:420px){.tier-cards .tier-card{flex-basis:100%}}++.tier2-scope-nav{display:flex;flex-wrap:wrap;gap:8px 16px;margin-bottom:16px}++/* Readability rhythm shared by every tier. Tier 3's conditional style block is+ emitted later, so scoped selectors retain these spacing rules there too. */+body{line-height:1.6}+.agent-hero{padding:24px 28px;margin-bottom:24px}+.agent-hero-top{gap:28px}+.agent-hero-title{line-height:1.3}+.agent-hero-subtitle,.hero-decision-reason,.hero-reason{font-size:14px;line-height:1.6;margin-top:12px}+.hero-side{gap:12px}+.agent-hero-detail,.publication-line{font-size:12px;line-height:1.6}+.hero-score-label{margin-top:8px;line-height:1.6}+.publication-reasons{line-height:1.6}+.tier-cards{gap:12px;margin-top:24px;padding-top:24px}+.tier-card{padding:16px 18px}+.tier-card-head{flex-wrap:wrap;gap:8px 12px}+.tier-card-title{font-size:14px;line-height:1.6;margin:12px 0 8px}+.tier-card-stats{gap:8px 16px;font-size:12px;line-height:1.6}+.tier-card-links,.tier-card-sev{gap:8px;margin-top:10px}+.scope-strip,.gate-policy{gap:10px 20px;font-size:12px;line-height:1.6;padding-bottom:20px}+.run-metadata{padding:16px 2px;margin-bottom:32px}+.metadata-grid{gap:20px 28px;margin-top:24px}+.metadata-grid p,.metadata-grid .header-meta-item{font-size:12px;line-height:1.6}+.metadata-grid strong{margin-bottom:8px}+.workspace-heading{margin-bottom:24px}+.workspace-heading h2{margin-bottom:8px}+.workspace-heading p{font-size:14px;line-height:1.6}+.exec-summary{padding:24px;margin-bottom:28px}+.exec-verdict{gap:12px 18px}+.exec-reason{line-height:1.6}+.kpis{gap:16px;margin:24px 0 12px}+.kpi{padding:16px 18px}+.kpi dt{line-height:1.6}+.kpi dd{margin-top:10px;line-height:1.6}+.kpi .kpi-sub{margin-top:10px}+.kpi-legend{line-height:1.6;margin-top:8px}+.fix-first{margin-top:24px;padding-top:20px}+.fix-first h3{margin-bottom:12px}+.fix-first li{padding:10px 0;font-size:14px;line-height:1.6}+.fix-meta{margin-top:6px;line-height:1.6}+.dashboard{padding:18px 0;margin:24px 0 28px;row-gap:20px}+.dashboard-card-title{font-size:12px;line-height:1.6}+.dashboard-card-value{margin:8px 0}+.dashboard-card-subtitle{line-height:1.6}+.report-searchbar{gap:12px;margin-bottom:20px}+.report-searchbar label,.skills-summary-bar{font-size:12px}+.view-toggle-section,.filter-group{gap:10px}+.view-toggle-btn,.filter-btn,.bulk-action-btn,.severity-filter-btn{font-size:12px;padding:8px 12px}+.skill-card,.validator-card{margin-bottom:16px}+.skill-header,.validator-collapsible{padding:18px 20px;gap:16px}+.skill-name,.validator-name{font-size:14px;line-height:1.6}+.skill-content.active,.validator-content.active{padding:20px}+.check-header{padding:14px 16px;gap:12px}+.check-name{font-size:14px;line-height:1.6}+.check-description{display:block;font-size:12px;line-height:1.6;margin:6px 0 0}+.check-details{padding:16px}+.check-detail-item{padding:8px 0;font-size:14px;line-height:1.6}+.check-finding{padding:16px;margin:12px 0}+.finding-message,.check-finding .finding-msg{font-size:14px;line-height:1.6}+.finding-meta{gap:8px 16px;margin-top:10px;font-size:12px;line-height:1.6}+.check-finding .finding-suggestion,.finding-suggestion{font-size:12px;line-height:1.6;padding:12px;margin-top:12px}+.quality-outcome-note,.findings-overflow-note{font-size:12px;line-height:1.6}+.summary-table th,.top-issues-table th{padding:14px 18px;font-size:12px;line-height:1.6}+.summary-table td,.top-issues-table td{padding:16px 18px;font-size:14px;line-height:1.6;vertical-align:top}+.raw-output>summary{padding:8px 0;line-height:1.6}+.tab-content .t3-subtabs{gap:8px;padding:8px;margin-bottom:24px;flex-wrap:wrap;overflow:visible}+.tab-content .t3-subtab{padding:10px 16px;font-size:14px;line-height:1.6;white-space:normal}+.tab-content .t3-page{line-height:1.6;min-width:0;overflow-wrap:anywhere}+.tab-content .t3-page p{line-height:1.6}+.tab-content .t3-section{margin-top:28px}+.tab-content .t3-section h3{margin-bottom:16px;line-height:1.6}+.tab-content .t3-section-hint{font-size:14px;line-height:1.6;margin-bottom:16px}+.tab-content .t3-agent-card,.tab-content .t3-finding-card,.tab-content .t3-eval-card,.tab-content .t3-sug-card,.tab-content .t3-harbor-panel,.tab-content .t3-next-steps{padding:20px}+.tab-content .t3-finding-card{margin:16px 0}+.tab-content .t3-overview-lead{padding:20px;line-height:1.6;margin-bottom:20px}+.tab-content .t3-agent-score{margin:10px 0}+.tab-content .t3-checks{margin-top:12px}+.tab-content .t3-checks li{padding:8px 0;font-size:14px;line-height:1.6}+.tab-content .t3-details,.tab-content .t3-collapsed{margin-top:20px}+.tab-content .t3-details>summary,.tab-content details.t3-ds-card>summary{padding:18px 20px;line-height:1.6}+.tab-content .t3-details-body{padding:20px}+.tab-content .t3-agent-tabs{gap:8px;padding:8px;margin-bottom:24px}+.tab-content .t3-agent-tab-btn{padding:10px 16px;gap:10px;white-space:normal;text-align:left;overflow-wrap:anywhere}+.tab-content .t3-agent-tab-btn .t3-tab-dot{flex-shrink:0}+.tab-content .t3-kpi-strip{gap:16px;margin-bottom:24px}+.tab-content .t3-kpi-card{padding:18px 20px;min-width:0}+.tab-content .t3-kpi-card .t3-kpi-label{font-size:12px;line-height:1.6}+.tab-content .t3-kpi-card .t3-kpi-value{margin-top:10px;line-height:1.35}+.tab-content .t3-kpi-card .t3-kpi-sub{font-size:12px;line-height:1.6;margin-top:10px}+.tab-content .t3-dim-strip{gap:12px;padding:16px;margin:20px 0 24px}+.tab-content .t3-dim-pill{padding:12px 14px;gap:8px;min-width:0}+.tab-content .t3-dim-pill .t3-dim-name,.tab-content .t3-dim-pill .t3-dim-lift{font-size:12px;line-height:1.6}+.tab-content .t3-eval-stack,.tab-content .t3-sug-stack{gap:16px}+.tab-content .t3-eval-desc,.tab-content .t3-dim-hint{font-size:12px;line-height:1.6;margin-top:8px}+.tab-content .t3-eval-bars{margin-top:16px;row-gap:12px}+.tab-content .t3-eval-evidence{margin-top:20px}+.tab-content .t3-eval-evidence>summary{padding:8px 0;font-size:12px;line-height:1.6}+.tab-content .t3-eval-evidence ul{gap:10px;margin-top:12px}+.tab-content .t3-eval-evidence li{padding:12px;gap:10px;font-size:12px;line-height:1.6}+.tab-content .t3-reasoning,.tab-content .t3-sug-body,.tab-content .t3-ds-value{font-size:14px;line-height:1.6}+.tab-content .t3-reasoning-list li{margin-bottom:8px}+.tab-content .t3-dataset-list{gap:20px}+.tab-content .t3-ds-field{margin:20px 0}+.tab-content .t3-ds-label{font-size:12px;line-height:1.6;margin-bottom:8px}+.tab-content .t3-ds-behaviors{gap:12px;margin-top:12px}+.tab-content .t3-ds-behaviors li{font-size:14px;line-height:1.6;grid-template-columns:24px minmax(0,1fr)}+.tab-content .t3-prov-grid{grid-template-columns:minmax(140px,.3fr) minmax(0,1fr) auto;gap:12px 20px;padding:8px 0}+.tab-content .t3-prov-grid .t3-prov-value{padding:10px 12px;line-height:1.6}+.tab-content .t3-download-grid{gap:12px}+.tab-content .t3-filter-bar{gap:12px;margin-bottom:20px}+.tab-content .t3-filter-input{min-width:0;padding:10px 14px}+.tab-content .t3-lift-grid{grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:16px}+.tab-content .t3-lift-row{padding:10px 0;gap:12px}+@media(max-width:760px){+ .agent-hero,.exec-summary{padding:20px}+ .hero-side{margin-top:24px}+ .tier-cards{gap:12px;margin-top:24px;padding-top:20px}+ .tier-card{padding:16px}+ .tier-card-title{font-size:14px}+ .tier-card-stats{font-size:12px}+ .skill-header,.validator-collapsible{padding:16px}+ .skill-content.active,.validator-content.active{padding:16px}+ .tab-content .t3-subtab{padding:10px 12px;font-size:12px}+ .tab-content .t3-prov-grid{grid-template-columns:minmax(0,1fr);gap:8px}+ .tab-content .t3-prov-grid .t3-prov-label:not(:first-child){margin-top:12px}+}+@media(max-width:420px){+ .agent-hero,.exec-summary{padding:18px}+ .summary-table th,.top-issues-table th,.summary-table td,.top-issues-table td{padding:14px}+ .tab-content .t3-agent-card,.tab-content .t3-finding-card,.tab-content .t3-eval-card,.tab-content .t3-sug-card,.tab-content .t3-harbor-panel,.tab-content .t3-next-steps,.tab-content .t3-details-body{padding:16px}+ .tab-content .t3-eval-evidence li{grid-template-columns:minmax(0,1fr);gap:8px}+ .tab-content .t3-sug-card{grid-template-columns:auto minmax(0,1fr)}+ .tab-content .t3-sug-actions{grid-column:2}+ .tab-content .t3-lift-row{grid-template-columns:minmax(0,1fr)}+ .tab-content .t3-agent-grid,.tab-content .t3-agent-scorecard-list{grid-template-columns:minmax(0,1fr)}+}+/* Semantic severity tokens also govern system themes when JavaScript is unavailable. */+@media screen and (prefers-color-scheme:dark){:root:not([data-theme]) .severity-critical{background:var(--sev-critical-bg);color:var(--sev-critical-tx)}:root:not([data-theme]) .severity-high{background:var(--sev-high-bg);color:var(--sev-high-tx)}:root:not([data-theme]) .severity-medium{background:var(--sev-medium-bg);color:var(--sev-medium-tx)}:root:not([data-theme]) .severity-low{background:var(--sev-low-bg);color:var(--sev-low-tx)}:root:not([data-theme]) .severity-info{background:var(--sev-info-bg);color:var(--sev-info-tx)}}++@media print{+ .tab-content .t3-subtabs,.tab-content .t3-agent-tabs{display:none!important}+ .agent-hero,.exec-summary{padding:16px;margin-bottom:20px}+ .summary-table th,.summary-table td,.top-issues-table th,.top-issues-table td{padding:10px 12px}+ .tab-content .t3-page{break-inside:auto}+}+/* Keep job actions and recorded metadata distinct when names wrap. */+.tier-card-link{padding:6px 10px;font-size:12px;line-height:1.6;max-width:100%;white-space:normal;overflow-wrap:anywhere}+.metadata-grid>div>div{margin-top:12px;line-height:1.6}+.metadata-grid>div>strong{margin-bottom:12px}+.tab-content .t3-harbor-actions{gap:12px;min-width:0}+.tab-content .t3-harbor-link{padding:10px 14px;font-size:12px;line-height:1.6;max-width:100%;white-space:normal;overflow-wrap:anywhere}+.tab-content .t3-harbor-panel>div{min-width:0}+.tab-content .t3-harbor-panel p{margin-top:8px;font-size:14px;line-height:1.6}+.tab-content dl:not(.kpis){row-gap:16px}+.tab-content dl:not(.kpis) dt{margin-top:8px;font-size:12px;line-height:1.6}+.tab-content dl:not(.kpis) dd{margin-top:8px;line-height:1.6;overflow-wrap:anywhere}+/* Measured heights clear every wrapped tab row, independent of breakpoints. */+.tab-content .t3-agent-anchor{scroll-margin-top:calc(var(--mobile-nav-height) + var(--tier3-nav-height) + 20px)}+/* Recorded provenance is a label/value list; action-column grids use DIVs. */+.tab-content dl.t3-prov-grid{grid-template-columns:minmax(140px,.3fr) minmax(0,1fr);align-items:start}+@media(max-width:760px){.tab-content dl.t3-prov-grid{grid-template-columns:minmax(0,1fr)}}diff --git a/src/skillevaluator/reporting/templates/report_ui.js.j2 b/src/skillevaluator/reporting/templates/report_ui.js.j2index f030851d..a7da84b7 100644--- a/src/skillevaluator/reporting/templates/report_ui.js.j2+++ b/src/skillevaluator/reporting/templates/report_ui.js.j2@@ -67,6 +67,7 @@ document.addEventListener('DOMContentLoaded', function() {// Evidence links intentionally reveal their destination even if a previous search hid it.const originalOpenSkillCard = _openSkillCard;_openSkillCard = function(name) {+ activateReportTier('tier1', {scroll:false, focus:false});reportAffectedSkills = null;document.getElementById('skill-filter-banner')?.classList.remove('visible');const query = document.getElementById('report-search');@@ -103,27 +104,232 @@ window.addEventListener('beforeprint', function() {window.addEventListener('afterprint', function() {reportPrintClosedDetails.forEach(detail => { detail.open = false; });reportPrintClosedDetails = [];+ reportMeasureNavigation();});// "Fix first" links open their check or finding: skill view, card expanded,// filters cleared. The id goes in the address so the link can be shared.function openFinding(id) {const target = document.getElementById(id);if (!target) return true;+ reportRevealTier(target);const card = target.closest('.skill-card');if (card) _openSkillCard(card.dataset.skillName);for (let node = target; node; node = node.parentElement) {if (node.tagName === 'DETAILS') node.open = true;}try { history.replaceState(null, '', '#' + id); } catch (err) { /* A file:// page may refuse; the jump still works. */ }- const reduceMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;- target.scrollIntoView({ behavior: reduceMotion ? 'auto' : 'smooth', block: 'center' });+ reportScrollTo(target, 'center');target.setAttribute('tabindex', '-1');target.focus({ preventScroll: true });target.classList.add('finding-flash');setTimeout(function() { target.classList.remove('finding-flash'); }, 2000);return false;}+// Sidebar sections and the skip link open at their top and take focus, like a native anchor.+function openReportSection(target) {+ if (target.tagName === 'DETAILS') target.open = true;+ target.tabIndex = -1;+ reportScrollTo(target);+ target.focus({preventScroll:true});+ reportCurrentSection(target.id);+}+// Share destination routing for initial URLs and clicks, including the alternate validator view.+function openReportDestination(id) {+ const target = document.getElementById(id);+ if (!target) return true;+ if (target.classList.contains('t3-agent-anchor') && typeof jumpToTier3Agent === 'function') {+ jumpToTier3Agent(id);+ try { history.replaceState(null, '', '#' + id); } catch (err) { /* file:// history is optional. */ }+ return false;+ }+ // Whole tiers and sections are not evidence: never centre a container taller than the viewport.+ if (/^tab-tier\d$/.test(id) && target.classList.contains('tab-content')) {+ activateReportTier(id.slice(4));+ try { history.replaceState(null, '', '#' + id); } catch (err) { /* file:// history is optional. */ }+ return false;+ }+ if (Array.from(document.querySelectorAll('[data-report-section]')).some(link => link.dataset.reportSection === id)) {+ openReportSection(target);+ try { history.replaceState(null, '', '#' + id); } catch (err) { /* file:// history is optional. */ }+ return false;+ }+ if (target.classList.contains('validator-card') && /^validator-\d+$/.test(id)) {+ scrollToValidator(id.slice('validator-'.length));+ try { history.replaceState(null, '', '#' + id); } catch (err) { /* file:// history is optional. */ }+ reportPressedButtons();+ return false;+ }+ return openFinding(id);+}// Run after load so the browser's own jump to the fragment does not override it.window.addEventListener('load', function() {- if (/^#[fc]-/.test(location.hash)) setTimeout(function() { openFinding(decodeURIComponent(location.hash.slice(1))); }, 0);+ if (location.hash.length > 1) setTimeout(function() {+ try { openReportDestination(decodeURIComponent(location.hash.slice(1))); } catch (err) { /* Ignore malformed fragments. */ }+ }, 0);+});++// All entry points (sidebar, tiles, mobile links and evidence) use this tier state.+function reportScrollBehavior() {+ return window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth';+}+function reportMeasureNavigation() {+ [['.mobile-tier-nav', '--mobile-nav-height'], ['.t3-subtabs', '--tier3-nav-height']].forEach(([selector, property]) => {+ const nav = document.querySelector(selector);+ const height = nav && nav.getClientRects().length ? nav.getBoundingClientRect().height : 0;+ document.documentElement.style.setProperty(property, height + 'px');+ });+}+function reportScrollTo(target, block = 'start') {+ // Tier activation and font/layout changes must be measured before scrolling,+ // without waiting for the next ResizeObserver delivery.+ reportMeasureNavigation();+ target.scrollIntoView({behavior: reportScrollBehavior(), block});+}+function reportCurrentSection(id) {+ document.querySelectorAll('.report-sidebar [data-report-section],.report-sidebar [data-report-tier]').forEach(link => {+ const current = (link.dataset.reportSection || 'tab-' + link.dataset.reportTier) === id;+ link.classList.toggle('sidebar-current', current);+ if (current) link.setAttribute('aria-current', 'location');+ else link.removeAttribute('aria-current');+ });+}+function activateReportTier(tierId, options = {}) {+ const panel = document.getElementById('tab-' + tierId);+ if (!panel) return false;+ document.querySelectorAll('.tab-content').forEach(item => item.classList.toggle('active', item === panel));+ document.querySelectorAll('.tier-card[data-target-tab]').forEach(tile => {+ const selected = tile.dataset.targetTab === tierId;+ tile.classList.toggle('active', selected);+ tile.setAttribute('aria-pressed', String(selected));+ });+ document.querySelectorAll('.mobile-tier-nav [data-report-tier]').forEach(link => {+ if (link.dataset.reportTier === tierId) link.setAttribute('aria-current', 'location');+ else link.removeAttribute('aria-current');+ });+ reportMeasureNavigation();+ reportCurrentSection(panel.id);+ if (options.scroll !== false) reportScrollTo(panel);+ if (options.focus !== false) panel.focus({preventScroll:true});+ return true;+}+function activateReportTabs(tabSelector, panelSelector, panelId, button) {+ const panel = document.getElementById(panelId);+ if (!panel) return;+ document.querySelectorAll(panelSelector).forEach(item => item.classList.toggle('active', item === panel));+ document.querySelectorAll(tabSelector).forEach(tab => {+ const selected = tab.getAttribute('aria-controls') === panelId;+ tab.classList.toggle('active', selected);+ tab.setAttribute('aria-selected', String(selected));+ tab.tabIndex = selected ? 0 : -1;+ });+ if (button) button.focus({preventScroll:true});+}+function reportTabKeyboard(event) {+ const tabs = Array.from(event.currentTarget.querySelectorAll('[role="tab"]'));+ const index = tabs.indexOf(event.target);+ if (index < 0) return;+ let next;+ if (event.key === 'ArrowRight') next = (index + 1) % tabs.length;+ if (event.key === 'ArrowLeft') next = (index + tabs.length - 1) % tabs.length;+ if (event.key === 'Home') next = 0;+ if (event.key === 'End') next = tabs.length - 1;+ if (next !== undefined) {+ event.preventDefault();+ tabs.forEach((tab, i) => { tab.tabIndex = i === next ? 0 : -1; });+ tabs[next].focus();+ } else if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ event.target.click();+ }+}+let reportThemePreference = 'system';+const reportColorScheme = window.matchMedia ? window.matchMedia('(prefers-color-scheme: dark)') : null;+function applyReportTheme() {+ const theme = reportThemePreference === 'system' ? (reportColorScheme?.matches ? 'dark' : 'light') : reportThemePreference;+ document.documentElement.setAttribute('data-theme', theme);+ const control = document.getElementById('report-theme');+ if (control) control.value = reportThemePreference;+ if (window.rebuildTier3Charts) window.rebuildTier3Charts();+}+function setReportTheme(preference) {+ reportThemePreference = ['light','dark'].includes(preference) ? preference : 'system';+ try {+ if (reportThemePreference === 'system') localStorage.removeItem('skillevaluator-theme');+ else localStorage.setItem('skillevaluator-theme', reportThemePreference);+ } catch (err) { /* Standalone reports work without storage. */ }+ applyReportTheme();+}+function initReportTheme() {+ try {+ const saved = localStorage.getItem('skillevaluator-theme');+ reportThemePreference = ['light','dark'].includes(saved) ? saved : 'system';+ } catch (err) { /* Follow system when storage is unavailable. */ }+ applyReportTheme();+ if (reportColorScheme?.addEventListener) reportColorScheme.addEventListener('change', function() {+ if (reportThemePreference === 'system') applyReportTheme();+ });+}+function reportRevealTier(target) {+ const panel = target.closest('.tab-content');+ if (panel) activateReportTier(panel.id.slice(4), {scroll:false, focus:false});+ const local = target.closest('.t3-page');+ if (local) activateReportTabs('.t3-subtab', '.t3-page', local.id);+ const agent = target.closest('.t3-agent-panel');+ if (agent) activateReportTabs('.t3-agent-tab-btn', '.t3-agent-panel', agent.id);+}+document.addEventListener('DOMContentLoaded', function() {+ document.querySelectorAll('[data-report-tier]').forEach(link => link.addEventListener('click', function(event) {+ event.preventDefault();+ activateReportTier(link.dataset.reportTier);+ }));+ document.querySelectorAll('[data-report-tier-tile]').forEach(tile => {+ tile.addEventListener('click', function() { activateReportTier(tile.dataset.targetTab); });+ tile.addEventListener('keydown', function(event) {+ if ((event.key === 'Enter' || event.key === ' ') && event.target === tile) {+ event.preventDefault();+ tile.click();+ }+ });+ });+ document.querySelectorAll('.t3-subtabs,.t3-agent-tabs').forEach(list => list.addEventListener('keydown', reportTabKeyboard));+ const initial = document.querySelector('.tab-content.active') || document.querySelector('.tab-content');+ if (initial) activateReportTier(initial.id.slice(4), {scroll:false, focus:false});+ reportCurrentSection('report-workspace');+ document.querySelectorAll('[data-report-section]').forEach(link => link.addEventListener('click', function(event) {+ event.preventDefault();+ const target = document.getElementById(link.dataset.reportSection);+ if (target) openReportSection(target);+ }));+ reportMeasureNavigation();+ if (window.ResizeObserver) {+ const observer = new ResizeObserver(reportMeasureNavigation);+ document.querySelectorAll('.mobile-tier-nav,.t3-subtabs').forEach(nav => observer.observe(nav));+ }+ window.addEventListener('resize', reportMeasureNavigation);+ let navigationFrame = null;+ window.addEventListener('scroll', function() {+ if (navigationFrame !== null) return;+ navigationFrame = requestAnimationFrame(function() {+ navigationFrame = null;+ const details = document.getElementById('run-metadata');+ const evidence = document.getElementById('report-evidence');+ const panel = document.querySelector('.tab-content.active');+ const offset = parseFloat(getComputedStyle(document.documentElement).getPropertyValue('--mobile-nav-height')) || 0;+ const atEnd = scrollY > 0 && scrollY + innerHeight >= document.documentElement.scrollHeight - 2;+ if (details && (details.getBoundingClientRect().top <= offset + 100 || (atEnd && document.activeElement === details))) reportCurrentSection('run-metadata');+ else if (evidence && panel && (evidence.getBoundingClientRect().top <= offset + 100 || atEnd)) reportCurrentSection(panel.id);+ else reportCurrentSection('report-workspace');+ });+ }, {passive:true});+ // Native fragment links also reveal their parent tier, with no name-based CSS selectors.+ document.addEventListener('click', function(event) {+ const link = event.target.closest('a[href^="#"]');+ if (!link || link.hasAttribute('onclick') || link.dataset.reportSection || link.dataset.reportTier) return;+ let id;+ try { id = decodeURIComponent(link.getAttribute('href').slice(1)); } catch (err) { return; }+ const target = document.getElementById(id);+ if (!target) return;+ event.preventDefault();+ openReportDestination(id);+ });});diff --git a/src/skillevaluator/reporting/tier2_views.py b/src/skillevaluator/reporting/tier2_views.pynew file mode 100644index 00000000..462e70e3--- /dev/null+++ b/src/skillevaluator/reporting/tier2_views.py@@ -0,0 +1,188 @@+# SPDX-License-Identifier: Apache-2.0+"""Read-only views of recorded Tier 2 scope and duplicate evidence."""++from __future__ import annotations++from dataclasses import dataclass+from typing import TYPE_CHECKING++from skillevaluator.reporting.base import additional_errors, is_cleanly_skipped++if TYPE_CHECKING:+ from skillevaluator.models import ValidationResult+++@dataclass(frozen=True)+class Tier2ScopeView:+ id: str+ label: str+ results: tuple[ValidationResult, ...]+ completed: int | None+ duplicates: int | None+ affected: int | None+ catalog_entries: int | None+ notes: tuple[str, ...]+ catalog_not_applicable: bool = False+ not_run: bool = False+++def _count(value: object) -> int | None:+ return value if type(value) is int and 0 <= value <= 2**63 - 1 else None+++def _scope(result: ValidationResult) -> str | None:+ name = " ".join(result.validator_name.casefold().replace("_", " ").replace("-", " ").split())+ if "similarity" in name:+ return "across"+ if "dedup" in name or "context optimization" in name:+ return "within"+ return None+++def tier2_scope_views(results: list[ValidationResult]) -> tuple[Tier2ScopeView, ...]:+ """Keep missing completion/count metadata unknown; never rewrite results.++ Workflow status describes scope, while a failed gate may still have finished+ comparison. Completion requires recorded comparison evidence and no incomplete+ scanner or execution error. Gate-derived workflow passes and findings alone+ do not prove it.+ """+ views = []+ for scope, label, stage in (+ ("within", "Within this skill", "intra_skill"),+ ("across", "Across skills", "catalog_comparison"),+ ):+ members = tuple(result for result in results if _scope(result) == scope)+ notes: list[str] = []+ stages = []+ for result in results:+ workflow = result.metadata.get("workflow")+ if not isinstance(workflow, dict) or workflow.get("tier") != 2:+ continue+ raw = workflow.get("stages")+ evidence = raw.get(stage) if isinstance(raw, dict) else None+ if isinstance(evidence, dict):+ stages.append(evidence)+ if evidence.get("status") == "skipped" and isinstance(evidence.get("reason"), str):+ notes.append(evidence["reason"])+ completed = 0+ unfinished = False+ known = bool(members) or any(item.get("status") == "skipped" for item in stages)+ all_complete = bool(members)+ catalog_counts: list[int] = []+ catalog_known = bool(members) and scope == "across"+ pairwise_only = bool(members) and scope == "across"+ for result in members:+ details = {detail.check_name: detail.metadata for detail in result.success_details}+ indexed = details.get("index_built")+ entries = _count(indexed.get("entry_count")) if isinstance(indexed, dict) else None+ analysis = result.metadata.get("llm_analysis")+ analysis_complete = (+ isinstance(analysis, dict)+ and _count(analysis.get("clusters_total")) is not None+ and _count(analysis.get("clusters_completed")) == analysis.get("clusters_total")+ and _count(analysis.get("clusters_failed")) == 0+ and _count(analysis.get("clusters_refused")) == 0+ )+ recorded_completion = bool(+ {"catalog_compared", "index_built", "similarity_check"} & details.keys()+ if scope == "across"+ else "context_dedup" in details or analysis_complete+ )+ insufficient = any(+ detail.check_name == "context_dedup"+ and detail.message in {"No text files found in skill directory", "Not enough content to compare"}+ for detail in result.success_details+ )+ if insufficient:+ notes.append(+ "Comparison not applicable: "+ + next(detail.message for detail in result.success_details if detail.check_name == "context_dedup")+ )+ # A collection index of fewer than two entries has nothing to compare pairwise.+ single_entry = (+ scope == "across" and entries is not None and entries < 2 and "catalog_compared" not in details+ )+ if single_entry:+ notes.append(f"Comparison not applicable: the collection index has {entries} entry; pairs need two.")+ clean_skip = is_cleanly_skipped(result) or insufficient or single_entry+ finished = (+ recorded_completion+ and (not isinstance(analysis, dict) or analysis_complete)+ and not result.is_incomplete+ and not additional_errors(result)+ and not clean_skip+ )+ completed += bool(finished)+ all_complete = all_complete and bool(finished)+ if not finished and not clean_skip:+ known = False+ unfinished = True+ compared = details.get("catalog_compared")+ compared = compared if isinstance(compared, dict) else {}+ total, excluded = _count(compared.get("catalog_entry_count")), _count(compared.get("self_matches_excluded"))+ if total is not None and excluded is not None and excluded <= total and finished:+ catalog_counts.append(total - excluded)+ notes.append(+ f"Compared one target against {total - excluded} catalog entries; {excluded} self entries excluded."+ )+ else:+ catalog_known = False+ pairwise_only = pairwise_only and entries is not None and "catalog_compared" not in details+ if scope == "across" and entries is not None and not single_entry:+ notes.append(f"Pairwise comparison of {entries} collection entries; no catalog used.")+ duplicates = []+ paths: set[str] = set()+ paths_known = True+ for result in members:+ for finding in result.findings:+ category = finding.category.casefold()+ if category not in ({"duplicate"} if scope == "within" else {"similarity"}):+ continue+ duplicates.append(finding)+ metadata = finding.metadata if isinstance(finding.metadata, dict) else {}+ recorded = (+ metadata.get("source_files")+ if scope == "within"+ else [metadata.get("path_a"), metadata.get("path_b")]+ )+ if (+ not isinstance(recorded, list)+ or not recorded+ or any(not isinstance(p, str) or not p for p in recorded)+ ):+ paths_known = False+ else:+ paths.update(recorded)+ duplicate_count = len(duplicates) if duplicates or all_complete else None+ affected = len(paths) if paths_known and duplicate_count is not None else None+ # No member and no recorded stage: this command never runs the scope.+ not_run = not members and not stages+ if not_run:+ notes.append("Not run by this command.")+ elif not members and not notes:+ notes.append("Comparison evidence unavailable; this scope was not recorded.")+ elif members and unfinished:+ notes.append("Comparison coverage is incomplete or unavailable; counts describe recorded findings only.")+ views.append(+ Tier2ScopeView(+ scope,+ label,+ members,+ completed if known else None,+ duplicate_count,+ affected,+ sum(catalog_counts) if catalog_known else None,+ tuple(dict.fromkeys(notes)),+ scope == "within" or pairwise_only,+ not_run,+ )+ )+ unknown = tuple(result for result in results if _scope(result) is None)+ if unknown:+ views.append(+ Tier2ScopeView(+ "other", "Other recorded checks", unknown, None, None, None, None, ("Comparison scope unavailable.",)+ )+ )+ return tuple(views)diff --git a/src/skillevaluator/tier3/result_display.py b/src/skillevaluator/tier3/result_display.pyindex 7071dc2d..c7de3bb6 100644--- a/src/skillevaluator/tier3/result_display.py+++ b/src/skillevaluator/tier3/result_display.py@@ -20,6 +20,7 @@ from rich.panel import Panelfrom rich.table import Tablefrom rich.text import Text+from skillevaluator.reporting.harbor_viewer import harbor_job_links, normalize_harbor_viewer_for_displayfrom skillevaluator.reporting.terminal_styles import AMBER, FAINT, GREEN, RED, TEXT, lift_stylefrom skillevaluator.tier3.harbor.metrics import (CUSTOM_ONLY_METRIC_SET,@@ -969,6 +970,30 @@ def render_evaluation_result()artifact_rows: list[tuple[str, str]] = []+ viewer_source = dict(result)+ raw_viewer = viewer_source.get("harbor_viewer")+ uploads = raw_viewer.get("uploads") if isinstance(raw_viewer, dict) else None+ if isinstance(raw_viewer, dict) and isinstance(uploads, list) and uploads:+ # Project raw uploads without replacing canonical jobs or run metadata.+ from skillevaluator.evaluation.tier3_report import _harbor_viewer_from_engine_result++ uploaded = _harbor_viewer_from_engine_result({"harbor_viewer": {"uploads": uploads}})+ jobs = normalize_harbor_viewer_for_display(viewer_source).get("jobs", [])+ by_url = {job["url"]: job for job in jobs}+ for job in uploaded.get("jobs", []):+ retained = by_url.get(job["url"])+ if retained is None:+ jobs.append(job)+ by_url[job["url"]] = job+ elif not retained.get("analysis_url") and job.get("analysis_url"):+ # Enrich only the same validated job; canonical metadata wins.+ retained["analysis_url"] = job["analysis_url"]+ viewer_source["harbor_viewer"] = {**raw_viewer, "jobs": jobs}+ for job in harbor_job_links(viewer_source):+ artifact_rows.append(("Harbor job", safe(job["name"])))+ for key, label in (("url", "Results"), ("analysis_url", "Analysis")):+ if job.get(key):+ artifact_rows.append((label, safe(job[key])))report_path = result.get("report_path")if report_path:raw_report_path = str(report_path)diff --git a/tests/ci/test_native_reports.py b/tests/ci/test_native_reports.pyindex 7817142e..6ccc6aa8 100644--- a/tests/ci/test_native_reports.py+++ b/tests/ci/test_native_reports.py@@ -10,10 +10,11 @@ from html import unescapefrom pathlib import Pathimport pytest-from ci.native_reports import _trusted_inline_code, constrain_native_html, render_native_reports+from ci.native_reports import _InlineCode, _trusted_inline_code, constrain_native_html, render_native_reportsfrom ci.run_tier1 import _summaryfrom skillevaluator.models import Finding, ValidationResult+from skillevaluator.reporting.html import HTMLReporterfrom skillevaluator.reporting.json_reporter import JSONReporter@@ -358,3 +359,16 @@ def test_index_dark_theme_never_applies_to_print():assert "@media screen and (prefers-color-scheme:dark)" in _STYLEassert "@media(prefers-color-scheme:dark)" not in _STYLEassert all(int(size) >= 11 for size in re.findall(r"font-size:(\d+)px", _STYLE))+++def test_native_tier_navigation_remains_within_static_trusted_code():+ document = HTMLReporter(requested_tiers=(1,), displayed_tiers=(1, 2, 3)).render_all(+ [ValidationResult(validator_name="Schema")]+ )+ parser = _InlineCode()+ parser.feed(document)+ assert set(parser.handlers + parser.scripts) <= _trusted_inline_code()+ constrained = constrain_native_html(document)+ for tier in (1, 2, 3):+ assert f'href="#tab-tier{tier}" data-report-tier="tier{tier}"' in constrained+ assert f'data-target-tab="tier{tier}"' in constraineddiff --git a/tests/reporting/browser_navigation_checks.py b/tests/reporting/browser_navigation_checks.pynew file mode 100644index 00000000..6fd58d58--- /dev/null+++ b/tests/reporting/browser_navigation_checks.py@@ -0,0 +1,379 @@+# SPDX-License-Identifier: Apache-2.0+"""Real-browser navigation, theme, print and layout checks for the HTML report.++Not collected by pytest. Run from the repository root, in an environment with the+project and Playwright installed (``pip install -e ".[dev]" playwright``):++ python tests/reporting/browser_navigation_checks.py OUTPUT_DIRECTORY++By default the script renders full.html, stress.html and absent.html with+``browser_navigation_fixtures.py`` into OUTPUT_DIRECTORY/fixtures, then writes+screenshots and navigation-results.json to OUTPUT_DIRECTORY. Pass+``--reports DIRECTORY`` to check reports that are already rendered instead.++The browser is Playwright's bundled Chromium (``python -m playwright install+chromium``). To use another Chromium-based browser, such as system Chrome, pass+``--browser PATH`` or set SKILLEVALUATOR_TEST_BROWSER to its executable. No live+evaluation or network access is needed.+"""++import argparse+import json+import os+import sys+from pathlib import Path++from playwright.sync_api import sync_playwright+++def check(page, condition, message):+ try:+ page.wait_for_function(condition, timeout=3000)+ except Exception as error:+ raise AssertionError(message) from error+++def severity_palette(page):+ return page.evaluate("""() => ['critical','high','medium','low','info'].map(severity => {+ const probe=document.createElement('span');+ probe.className='severity-' + severity;+ document.body.append(probe);+ const style=getComputedStyle(probe);+ const colors={background:style.backgroundColor,foreground:style.color};+ probe.remove();+ return colors;+ })""")+++BROWSER_ENV = "SKILLEVALUATOR_TEST_BROWSER"+++def render_default_fixtures(directory):+ sys.path.insert(0, str(Path(__file__).resolve().parent))+ from browser_navigation_fixtures import render_fixtures++ return render_fixtures(directory)+++def run(reports, output, browser_path=None):+ output.mkdir(parents=True, exist_ok=True)+ records = []+ with sync_playwright() as runtime:+ # None launches Playwright's bundled Chromium.+ browser = runtime.chromium.launch(executable_path=browser_path, headless=True)+ for width in (1440, 760, 390):+ for theme in ("light", "dark"):+ context = browser.new_context(+ viewport={"width": width, "height": 1000}, color_scheme=theme, reduced_motion="reduce"+ )+ # Task 2 owns chart-runtime offline behavior; navigation must work without it.+ context.route("https://**/*", lambda route: route.abort())+ context.add_init_script("""+ (() => {+ window._navigationScroll=[];+ const original=Element.prototype.scrollIntoView;+ Element.prototype.scrollIntoView=function(options) { window._navigationScroll.push(options.behavior); original.call(this,options); };+ })();+ """)+ page = context.new_page()+ errors = []+ page.on("pageerror", lambda error, errors=errors: errors.append(str(error)))+ page.goto((reports / "full.html").as_uri())+ page.select_option("#report-theme", "system")+ check(page, f"() => document.documentElement.dataset.theme === '{theme}'", "system theme")+ opposite = "light" if theme == "dark" else "dark"+ page.emulate_media(color_scheme=opposite)+ check(page, f"() => document.documentElement.dataset.theme === '{opposite}'", "live system theme")+ page.select_option("#report-theme", theme)+ page.reload()+ check(page, f"() => document.documentElement.dataset.theme === '{theme}'", "explicit theme persists")+ page.emulate_media(color_scheme=opposite)+ check(+ page,+ f"() => document.documentElement.dataset.theme === '{theme}'",+ "explicit preference ignores system",+ )+ check(+ page,+ "() => document.querySelector('.hero-command-status.verdict-chip.fail')?.innerText === 'Changes required' && document.querySelector('.hero-side .verdict-chip').innerText.startsWith('Tier 3 quality: ')",+ "visible outcome hierarchy",+ )+ page.screenshot(path=str(output / f"hierarchy-{width}-{theme}.png"))+ # Every entry point synchronizes all other surfaces and focuses its panel.+ for tier in ("tier2", "tier3", "tier1"):+ page.locator(f'.tier-card[data-target-tab="{tier}"]').click()+ check(+ page,+ f"""() => document.activeElement.id === 'tab-{tier}' &&+ document.querySelectorAll('.tab-content.active').length === 1 &&+ document.querySelector('.tab-content.active').id === 'tab-{tier}' &&+ document.querySelector('.tier-card[data-target-tab="{tier}"]').getAttribute('aria-pressed') === 'true' &&+ document.querySelector('.report-sidebar .sidebar-current').dataset.reportTier === '{tier}' &&+ document.querySelector('.mobile-tier-nav [aria-current]').dataset.reportTier === '{tier}'""",+ "tier synchronization",+ )+ tier_nav = ".mobile-tier-nav" if width <= 760 else ".report-sidebar"+ page.locator(f'{tier_nav} [data-report-tier="tier3"]').click()+ # Chart/table references need to reveal the containing local view as well.+ page.evaluate("""() => {+ activateReportTier('tier1');+ const ref=document.createElement('a'); ref.href='#t3-trials-table'; ref.id='test-trial-reference';+ ref.textContent='Trials evidence'; document.body.append(ref);+ }""")+ page.locator("#test-trial-reference").click()+ check(+ page,+ "() => document.querySelector('#t3-trials-table').getClientRects().length > 0 && document.activeElement.id === 't3-trials-table'",+ "generic local evidence link",+ )+ page.locator("#test-trial-reference").evaluate("(node) => node.remove()")+ # Manual-activation roving tabs: arrows move focus; Enter/Space changes view.+ overview = page.locator("#tier3-tab-overview")+ overview.click()+ overview.press("ArrowRight")+ check(+ page,+ "() => document.activeElement.id === 'tier3-tab-suggestions' && document.querySelector('#tier3-tab-overview').getAttribute('aria-selected') === 'true'",+ "arrow focus",+ )+ page.keyboard.press("Enter")+ check(+ page,+ "() => document.querySelector('#tier3-page-suggestions').classList.contains('active')",+ "enter activation",+ )+ page.keyboard.press("End")+ page.keyboard.press("Space")+ check(+ page,+ "() => document.querySelector('#tier3-page-provenance').classList.contains('active')",+ "end/space activation",+ )+ page.keyboard.press("Home")+ page.keyboard.press("ArrowLeft")+ check(page, "() => document.activeElement.id === 'tier3-tab-provenance'", "left wraps")+ page.locator("#tier3-tab-agents").click()+ agent_tabs = page.locator(".t3-agent-tab-btn")+ agent_tabs.first.focus()+ page.keyboard.press("End")+ page.keyboard.press("Enter")+ check(+ page,+ "() => document.querySelector('.t3-agent-panel.active').id === document.activeElement.getAttribute('aria-controls')",+ "agent keyboard",+ )+ # Deep links use stable panel IDs even when agent names contain selector syntax.+ page.evaluate("""() => {+ const anchor=document.querySelector('.t3-agent-anchor');+ anchor.dataset.tier3AgentName='agent"[雪]/name';+ document.querySelector('.t3-agent-tab-btn').dataset.tier3Agent=anchor.dataset.tier3AgentName;+ jumpToTier3Agent(anchor.id);+ }""")+ page.wait_for_timeout(50)+ check(+ page,+ "() => document.querySelector('.t3-agent-panel.active').id === document.querySelector('.t3-agent-anchor').dataset.tier3AgentPanelId",+ "unusual agent link",+ )+ # Focus lands on the named panel, never on the aria-hidden scroll anchor.+ check(+ page,+ "() => document.activeElement.id === document.querySelector('.t3-agent-anchor').dataset.tier3AgentPanelId",+ "agent link focus",+ )+ anchor_id = page.locator(".t3-agent-anchor").first.get_attribute("id")+ page.goto((reports / "full.html").as_uri() + "#" + anchor_id)+ page.reload()+ check(+ page,+ "() => document.activeElement.id === document.querySelector('.t3-agent-anchor').dataset.tier3AgentPanelId && document.activeElement.getAttribute('aria-hidden') !== 'true'",+ "agent fragment reload focus",+ )+ # Sticky tier and local navigation occupy separate vertical bands.+ page.evaluate("() => window.scrollBy(0, 350)")+ if width <= 760:+ check(+ page,+ "() => document.querySelector('.t3-subtabs').getBoundingClientRect().top >= document.querySelector('.mobile-tier-nav').getBoundingClientRect().bottom - 1",+ "sticky navigation overlap",+ )+ # A finding deep-link reveals Tier 1, resets incompatible filters, and focuses exact evidence.+ page.evaluate("""() => {+ document.querySelector('#report-search').value='no such finding';+ filterSkills('pass'); filterSeverity('critical-high'); applyReportSearch();+ openFinding(document.querySelector('.check-finding[id]').id);+ }""")+ check(+ page,+ """() => document.querySelector('.tab-content.active').id === 'tab-tier1' &&+ document.activeElement.classList.contains('check-finding') &&+ document.activeElement.getClientRects().length > 0 &&+ document.activeElement.classList.contains('finding-flash') &&+ document.querySelector('#report-search').value === ''""",+ "exact finding reveal",+ )+ page.evaluate("""() => {+ activateReportTier('tier3'); document.querySelector('#tier3-tab-overview').focus();+ const finding=document.querySelector('.check-finding[id]');+ scrollToFinding(finding.closest('.skill-card').dataset.skillName, finding.dataset.issueKey);+ }""")+ check(page, "() => document.activeElement.classList.contains('check-finding')", "legacy finding focus")+ check(+ page,+ "() => window._navigationScroll.length > 0 && window._navigationScroll.every(mode=>mode === 'auto')",+ "reduced motion navigation",+ )+ # Print exposes filtered evidence and all local pages; restores disclosures afterward.+ page.evaluate("""() => {+ document.querySelector('#report-search').value='no such finding'; applyReportSearch();+ window._closed = Array.from(document.querySelectorAll('details:not([open]):not(.raw-output)')).map(x=>x);+ dispatchEvent(new Event('beforeprint'));+ }""")+ page.emulate_media(media="print")+ check(+ page,+ """() => [...document.querySelectorAll('.t3-page,.t3-agent-panel,.check-finding')].every(e=>e.getClientRects().length > 0) && window._closed.every(e=>e.open)""",+ "print evidence",+ )+ page.emulate_media(media="screen")+ page.evaluate("() => dispatchEvent(new Event('afterprint'))")+ check(+ page,+ "() => window._closed.every(e=>!e.open) && document.querySelector('#report-search').value === 'no such finding'",+ "print restoration",+ )+ page.locator('.report-sidebar [data-report-section="run-metadata"]').click()+ page.wait_for_timeout(50)+ check(+ page,+ "() => document.querySelector('.report-sidebar .sidebar-current').dataset.reportSection === 'run-metadata'",+ "run details navigation",+ )+ page.locator('.report-sidebar [data-report-section="report-workspace"]').click()+ page.wait_for_timeout(50)+ check(+ page,+ "() => document.querySelector('.report-sidebar .sidebar-current').dataset.reportSection === 'report-workspace'",+ "summary navigation",+ )+ for fixture in ("full", "stress"):+ page.goto((reports / f"{fixture}.html").as_uri())+ check(+ page,+ "() => [...document.querySelectorAll('.tier-card')].every(tile=>tile.scrollWidth <= tile.clientWidth + 1)",+ "tier tile content clipping",+ )+ for tier in ("tier1", "tier2", "tier3"):+ page.evaluate("(tier) => activateReportTier(tier)", tier)+ check(+ page,+ "() => document.documentElement.scrollWidth <= innerWidth + 1",+ "page horizontal overflow",+ )+ page.screenshot(path=str(output / f"{fixture}-{width}-{theme}-{tier}.png"))+ page.evaluate("() => { activateReportTier('tier1'); toggleAllSkills(true); }")+ check(+ page,+ """() => [...document.querySelectorAll('.skill-content.active,.validator-content.active,.top-issues-content.active,.table-container.active')].every(e=>getComputedStyle(e).maxHeight === 'none')""",+ "expanded evidence cap",+ )+ # A real URL reload must use the same reveal/focus path as an in-page link.+ page.goto((reports / "full.html").as_uri() + "#validator-1")+ page.reload()+ check(+ page,+ "() => document.querySelector('#results-by-validator').classList.contains('active') && document.querySelector('#validator-1').getClientRects().length > 0 && document.activeElement.id === 'validator-1' && document.querySelector('#validator-1 .validator-content').classList.contains('active')",+ "validator fragment reload",+ )+ # Whole tiers and the skip link are sections: open at their top, never centred.+ page.goto((reports / "full.html").as_uri() + "#tab-tier3")+ page.reload()+ check(+ page,+ "() => document.querySelector('.tab-content.active').id === 'tab-tier3' && Math.abs(document.getElementById('tab-tier3').getBoundingClientRect().top) < 200",+ "tier fragment reload",+ )+ page.goto((reports / "full.html").as_uri())+ page.evaluate("() => window.scrollTo(0, document.documentElement.scrollHeight)")+ page.locator(".skip-link").focus()+ page.keyboard.press("Enter")+ check(+ page,+ "() => document.activeElement.id === 'report-workspace' && Math.abs(document.getElementById('report-workspace').getBoundingClientRect().top) < 2",+ "skip link",+ )+ page.goto((reports / "absent.html").as_uri())+ page.select_option("#report-theme", theme)+ contrast = page.evaluate(r"""() => {+ const rgb = value => (value.match(/[\d.]+/g) || []).map(Number);+ const luminance = color => color.slice(0,3).map(v=>v/255).map(v=>v<=0.04045?v/12.92:((v+0.055)/1.055)**2.4).reduce((sum,v,i)=>sum+v*[0.2126,0.7152,0.0722][i],0);+ return [...document.querySelectorAll('.tier-card.skipped .tier-card-label')].map(label=>{+ const tile=label.closest('.tier-card');+ let background=rgb(getComputedStyle(tile).backgroundColor);+ const foreground=rgb(getComputedStyle(label).color);+ let opacity=1;+ for(let node=label;node;node=node.parentElement) opacity*=Number(getComputedStyle(node).opacity);+ if(background[3] === 0) background=rgb(getComputedStyle(tile.parentElement.closest('section')).backgroundColor);+ const rendered=foreground.slice(0,3).map((v,i)=>v*opacity+background[i]*(1-opacity));+ const values=[luminance(rendered),luminance(background)].sort((a,b)=>a-b);+ return {tier:tile.dataset.targetTab,opacity,ratio:(values[1]+0.05)/(values[0]+0.05)};+ });+ }""")+ assert len(contrast) == 2 and all(value["ratio"] >= 4.5 for value in contrast), contrast+ page.screenshot(path=str(output / f"absent-{width}-{theme}.png"))+ explicit_palette = severity_palette(page)+ assert not errors, errors+ records.append(+ {"width": width, "theme": theme, "errors": errors, "checks": "passed", "absentContrast": contrast}+ )+ context.close()+ no_js = browser.new_context(+ viewport={"width": width, "height": 1000}, java_script_enabled=False, color_scheme=theme+ )+ page = no_js.new_page()+ page.goto((reports / "full.html").as_uri())+ check(+ page,+ "() => [...document.querySelectorAll('.t3-page,.t3-agent-panel,.check-finding')].every(e=>e.getClientRects().length > 0)",+ "no-JS evidence",+ )+ check(page, "() => document.documentElement.scrollWidth <= innerWidth + 1", "no-JS page overflow")+ check(+ page,+ f"() => getComputedStyle(document.documentElement).colorScheme === '{theme}'",+ "no-JS system theme",+ )+ assert severity_palette(page) == explicit_palette, "no-JS and explicit theme severity palette"+ no_js.close()+ storage_context = browser.new_context()+ storage_context.route("https://**/*", lambda route: route.abort())+ storage_context.add_init_script(+ "Object.defineProperty(window, 'localStorage', {get() { throw new Error('storage blocked'); }});"+ )+ storage_page = storage_context.new_page()+ storage_page.goto((reports / "full.html").as_uri())+ storage_page.select_option("#report-theme", "dark")+ check(storage_page, "() => document.documentElement.dataset.theme === 'dark'", "storage-independent theme")+ storage_context.close()+ browser.close()+ (output / "navigation-results.json").write_text(json.dumps(records, indent=2))+ print(json.dumps(records, indent=2)) # noqa: T201+++if __name__ == "__main__":+ parser = argparse.ArgumentParser(description="Run the HTML report's real-browser navigation checks.")+ parser.add_argument("output", type=Path, help="directory for screenshots and navigation-results.json")+ parser.add_argument(+ "--reports",+ type=Path,+ help="directory with full.html, stress.html and absent.html (default: render them into OUTPUT/fixtures)",+ )+ parser.add_argument(+ "--browser",+ default=os.environ.get(BROWSER_ENV) or None,+ help=f"Chromium-based browser executable (default: ${BROWSER_ENV}, else Playwright's bundled Chromium)",+ )+ args = parser.parse_args()+ output = args.output.resolve()+ reports = args.reports.resolve() if args.reports else render_default_fixtures(output / "fixtures")+ run(reports, output, args.browser)diff --git a/tests/reporting/browser_navigation_fixtures.py b/tests/reporting/browser_navigation_fixtures.pynew file mode 100644index 00000000..f743fe48--- /dev/null+++ b/tests/reporting/browser_navigation_fixtures.py@@ -0,0 +1,136 @@+# SPDX-License-Identifier: Apache-2.0+"""Render the HTML fixtures that ``browser_navigation_checks.py`` drives in a real browser.++Writes three reports into a directory:++- ``full.html``: every tier, with Tier 1 findings, a failing required quality check, a Tier 2+ similarity check and two Tier 3 agents (one with selector syntax in its name) with trials.+- ``stress.html``: the same tiers with long unbroken names, paths and messages, many findings+ and six agents, to catch clipped tiles and horizontal overflow.+- ``absent.html``: a Tier 1-only run that still displays Tiers 2 and 3 as not run.++Only project code is needed, so the fixtures match the checked-out templates.+"""++from pathlib import Path+from typing import Any++from skillevaluator.evaluation.tier3_report import build_agent_eval_payload+from skillevaluator.models import Finding, ValidationResult+from skillevaluator.reporting.html import HTMLReporter+from skillevaluator.tier3.harbor.metrics import DEFAULT_METRICS++ALL_TIERS = (1, 2, 3)+++def _finding(severity: str, message: str, file_path: str, line: int) -> Finding:+ return Finding(+ category="SECURITY",+ severity=severity,+ check_name="check",+ message=message,+ file_path=file_path,+ line_number=line,+ )+++def _tier1_results(path: str = "scripts/fetch.py", repeat: int = 1, suffix: str = "") -> list[ValidationResult]:+ pii = ValidationResult(validator_name="PII Scan", validator_description="Detect PII")+ secrets = ValidationResult(validator_name="Secrets Detection", validator_description="Detect secrets")+ risk = ValidationResult(validator_name="Code Risk Analysis", validator_description="Static analysis")+ lint = ValidationResult(validator_name="SCRIPT_LINT", validator_description="Lint scripts")+ for index in range(repeat):+ line = 11 + index * 10+ pii.add_finding(_finding("critical", f"Hardcoded key in code{suffix}", path, line))+ secrets.add_finding(_finding("critical", f"API key found{suffix}", path, line))+ risk.add_finding(_finding("medium", f"Request without timeout{suffix}", path, line + 4))+ risk.add_finding(_finding("high", f"Shell injection{suffix}", path, line + 10))+ lint.add_finding(_finding("low", f"Line too long{suffix}", path, line + 2))+ quality = ValidationResult(validator_name="QUALITY", validator_description="Quality dimensions")+ quality.add_error("Quality score 66.2/100 is below the required 70/100")+ quality.metadata["quality_config"] = {"source": "packaged", "min_score": 70}+ quality.metadata["quality_scores"] = {+ "skill_name": "demo",+ "overall_score": 66.2,+ "grade": "D",+ "skill_type": "script-based",+ "dimensions": {"correctness": {"score": 66.2, "weight": 1.0, "issues_count": 0, "issues": []}},+ }+ clean = ValidationResult(validator_name="License Compliance", validator_description="Licenses")+ clean.add_success("license", "License found")+ return [pii, secrets, risk, lint, quality, clean]+++def _similarity_result() -> ValidationResult:+ result = ValidationResult(validator_name="Similarity Check")+ result.add_success("similarity", "No duplicate skills found")+ result.metadata["gating"] = {"tier": 2, "blocking": True}+ return result+++def _reward(trial_id: str, entry_id: str, score: float, steps: int) -> dict[str, Any]:+ return {+ "trial_id": trial_id,+ "entry_id": entry_id,+ **dict.fromkeys(DEFAULT_METRICS, score),+ "_traj": {"steps": steps, "prompt_tokens": 100, "completion_tokens": 10, "cached_tokens": 0},+ }+++def _agent_result(skill_name: str, agent_names: list[str]) -> ValidationResult:+ cases = ("case-1", "case-2")+ with_skill = [_reward(f"{case}__attempt1", case, 0.8, 12) for case in cases]+ baseline = [_reward(f"{case}__baseline1", case, 0.4, 20) for case in cases]+ agents = {+ name: {+ "execution_status": "succeeded",+ "expected_attempts": len(with_skill) + len(baseline),+ "scored_attempts": len(with_skill) + len(baseline),+ "with_skill": dict.fromkeys(DEFAULT_METRICS, 0.8),+ "without_skill": dict.fromkeys(DEFAULT_METRICS, 0.4),+ "rewards": with_skill,+ "rewards_baseline": baseline,+ "num_trials": len(with_skill),+ "num_trials_baseline": len(baseline),+ }+ for name in agent_names+ }+ payload = build_agent_eval_payload(skill_name, agents, use_llm_judge=False)+ assert payload is not None+ result = ValidationResult(validator_name="AGENT_EVAL")+ result.metadata["agent_eval"] = payload+ return result+++def _render(skill_name: str, results: list[ValidationResult]) -> str:+ reporter = HTMLReporter(+ include_timestamp=False,+ explicit_skill_name=skill_name,+ requested_tiers=ALL_TIERS,+ displayed_tiers=ALL_TIERS,+ )+ return reporter.render_all(results)+++def render_fixtures(directory: Path) -> Path:+ """Write full.html, stress.html and absent.html into ``directory`` and return it."""+ directory.mkdir(parents=True, exist_ok=True)+ full = [*_tier1_results(), _similarity_result(), _agent_result("demo", ['agent"[one]/雪', "agent.two"])]+ stress_name = "stress-" + "very-long-unbroken-skill-name-" * 4 + "end"+ stress_path = "scripts/" + "deeply/nested/" * 12 + "module_with_an_extremely_long_unbroken_file_name.py"+ stress = [+ *_tier1_results(stress_path, repeat=12, suffix=" " + "x" * 120),+ _similarity_result(),+ _agent_result(stress_name, [f"agent-{index}-" + "long-provider/model-name-" * 3 for index in range(6)]),+ ]+ absent_reporter = HTMLReporter(include_timestamp=False, requested_tiers=(1,), displayed_tiers=ALL_TIERS)+ schema = ValidationResult(validator_name="Schema")+ schema.add_success("schema", "valid")+ pages = {+ "full.html": _render("demo", full),+ "stress.html": _render(stress_name, stress),+ "absent.html": absent_reporter.render_all([schema]),+ }+ for name, html in pages.items():+ (directory / name).write_text(html, encoding="utf-8")+ return directorydiff --git a/tests/reporting/test_evidence_views.py b/tests/reporting/test_evidence_views.pynew file mode 100644index 00000000..b0bca3ec--- /dev/null+++ b/tests/reporting/test_evidence_views.py@@ -0,0 +1,455 @@+# SPDX-License-Identifier: Apache-2.0+"""Recorded Tier 2 evidence stays separate from missing comparison coverage."""++from copy import deepcopy++import pytest++from skillevaluator.models import Finding, Severity, ValidationResult+from skillevaluator.reporting.html import HTMLReporter+++def _within():+ result = ValidationResult(validator_name="Context Deduplication")+ result.add_success("context_dedup", "Complete")+ result.metadata["workflow"] = {+ "tier": 2,+ "stages": {+ "intra_skill": {"status": "passed"},+ "catalog_comparison": {"status": "skipped", "reason": "No comparison catalog supplied."},+ },+ }+ return result+++def test_scope_projection_distinguishes_clean_zero_from_skipped():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = _within()+ original = deepcopy(result)+ within, across = tier2_scope_views([result])+ assert (within.label, within.completed, within.duplicates, within.affected) == ("Within this skill", 1, 0, 0)+ assert (across.label, across.completed, across.duplicates, across.catalog_entries) == (+ "Across skills",+ 0,+ None,+ None,+ )+ assert "No comparison catalog supplied." in across.notes+ assert result == original+++def test_catalog_counts_self_exclusion_and_pairwise_is_not_catalog():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ catalog = ValidationResult(validator_name="Similarity Check")+ catalog.add_success("catalog_compared", "Compared", catalog_entry_count=5, self_matches_excluded=1)+ across = tier2_scope_views([catalog])[1]+ assert (across.completed, across.duplicates, across.catalog_entries) == (1, 0, 4)+ assert any("target against" in note for note in across.notes)+ pairwise = ValidationResult(validator_name="Similarity Check")+ pairwise.add_success("index_built", "Indexed", entry_count=3, content_type="skill")+ across = tier2_scope_views([pairwise])[1]+ assert across.catalog_entries is None+ assert "Pairwise comparison of 3 collection entries; no catalog used." in across.notes+++def test_partial_and_unknown_evidence_does_not_claim_complete_or_zero():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ unknown = ValidationResult(validator_name="Context Deduplication")+ assert tier2_scope_views([unknown])[0].completed is None+ assert tier2_scope_views([unknown])[0].duplicates is None+ unknown.metadata["workflow"] = {"tier": 2, "stages": {"intra_skill": {"status": "failed"}}}+ unknown.add_error("Provider failed")+ assert tier2_scope_views([unknown])[0].completed is None+ unknown.mark_scan_incomplete("embedding-provider")+ assert tier2_scope_views([unknown])[0].duplicates is None+++def test_refused_and_safety_findings_are_not_duplicates_and_paths_are_distinct():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = _within()+ for category, check in (("CONTENT_DEDUP", "llm_refused"), ("SAFETY", "unsafe_file"), ("DUPLICATE", "duplicate")):+ result.add_finding(+ Finding(+ category=category,+ check_name=check,+ severity=Severity.MEDIUM,+ message="Recorded evidence",+ file_path="SKILL.md",+ metadata={"source_files": ["SKILL.md", "ref.md", "ref.md"]},+ )+ )+ within = tier2_scope_views([result])[0]+ assert (within.duplicates, within.affected) == (1, 2)+++def test_html_scopes_keep_kpis_and_findings_separate():+ output = HTMLReporter(include_timestamp=False).render_all([_within()])+ assert 'id="tier2-within"' in output+ assert 'id="tier2-across"' in output+ assert "Within this skill" in output and "Across skills" in output+ assert "Checks completed" in output and "Duplicate findings" in output+ assert "Affected files" in output and "Affected skills" in output+ assert "Catalog entries compared" in output+ assert "No comparison catalog supplied." in output+ assert "Unavailable" in output+++def test_insufficient_content_does_not_claim_zero_match_comparison():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = _within()+ result.success_details.clear()+ result.add_success("chunking", "Extracted", chunk_count=1)+ result.add_success("context_dedup", "Not enough content to compare")+ view = tier2_scope_views([result])[0]+ assert view.completed == 0+ assert view.duplicates is None+ assert any("Not enough content" in note for note in view.notes)+++def test_completed_failing_duplicate_check_is_still_completed():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = ValidationResult(validator_name="Similarity Check")+ result.add_success("catalog_compared", "Compared", catalog_entry_count=3, self_matches_excluded=0)+ result.add_finding(+ Finding(+ category="SIMILARITY",+ check_name="EXACT_DUPLICATE",+ severity=Severity.HIGH,+ message="Match",+ file_path="a",+ metadata={"path_a": "a", "path_b": "b"},+ )+ )+ view = tier2_scope_views([result])[1]+ assert result.passed is False+ assert (view.completed, view.duplicates, view.affected, view.catalog_entries) == (1, 1, 2, 3)+++def test_harbor_projection_preserves_unmatched_legacy_analysis_and_deduplicates():+ from skillevaluator.reporting.harbor_viewer import harbor_job_links++ payload = {+ "summary": {+ "harbor_viewer": {+ "analysis_url": "https://example.test/legacy",+ "jobs": [+ {"url": "https://example.test/a", "name": "a"},+ {"url": "https://example.test/a", "name": "copy"},+ {"url": "https://example.test/b", "analysis_url": "https://example.test/b/analysis"},+ {"url": "javascript:alert(1)"},+ ],+ }+ }+ }+ original = deepcopy(payload)+ jobs = harbor_job_links(payload)+ assert [job["name"] for job in jobs] == ["a", "Job 2", "Run analysis"]+ assert jobs[2]["analysis_url"] == "https://example.test/legacy"+ assert jobs[1]["analysis_url"] == "https://example.test/b/analysis"+ assert payload == original+ assert harbor_job_links({"harbor_viewer": {"analysis_url": "https://example.test/analysis"}}) == [+ {"name": "Run analysis", "analysis_url": "https://example.test/analysis"}+ ]+ assert harbor_job_links({}) == []+++def test_refused_workflow_does_not_claim_a_complete_zero_match_scan():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = _within()+ result.success_details.clear()+ result.metadata["llm_analysis"] = {+ "clusters_total": 1,+ "clusters_completed": 0,+ "clusters_failed": 0,+ "clusters_refused": 1,+ }+ view = tier2_scope_views([result])[0]+ assert view.completed is None+ assert view.duplicates is None+++def test_harbor_shared_analysis_is_linked_once_without_losing_results():+ from skillevaluator.reporting.harbor_viewer import harbor_job_links++ shared = "https://example.test/shared-analysis"+ jobs = harbor_job_links(+ {+ "harbor_viewer": {+ "jobs": [+ {"url": "https://example.test/a", "analysis_url": shared},+ {"url": "https://example.test/b", "analysis_url": shared},+ ]+ }+ }+ )+ assert len(jobs) == 2+ assert [job["url"] for job in jobs] == ["https://example.test/a", "https://example.test/b"]+ assert sum(job.get("analysis_url") == shared for job in jobs) == 1+++def test_compact_validate_summary_keeps_all_harbor_evidence_reachable(tmp_path):+ from io import StringIO++ from rich.console import Console++ from skillevaluator.cli import _finish_pipeline_view+ from skillevaluator.reporting.console_ui import ValidateView++ result = ValidationResult(validator_name="AGENT_EVAL")+ result.metadata["agent_eval"] = {+ "summary": {"execution_status": "succeeded"},+ "harbor_viewer": {+ "jobs": [+ {"url": "https://example.test/a", "analysis_url": "https://example.test/analysis", "name": "[bad]"},+ {"url": "https://example.test/b"},+ ]+ },+ }+ original = deepcopy(result)+ output = StringIO()+ view = ValidateView("test", [], console=Console(file=output, width=1000, color_system=None))+ _finish_pipeline_view(+ view,+ tier_gate_results=[],+ tier3_result=result,+ gate_failed=False,+ output_dir=tmp_path,+ basename="report",+ report_formats=("html",),+ target_path=tmp_path,+ agent_eval=True,+ )+ text = output.getvalue()+ assert "https://example.test/a" in text+ assert "https://example.test/b" in text+ assert "https://example.test/analysis" in text+ assert "Job 2" in text+ assert result == original+++def test_catalog_kpi_marks_non_catalog_scopes_not_applicable():+ result = ValidationResult(validator_name="Similarity Check")+ result.add_success("index_built", "Indexed", entry_count=3, content_type="skill")+ output = HTMLReporter(include_timestamp=False).render_all([result])+ across = output.split('id="tier2-across"', 1)[1].split("</section>", 1)[0]+ catalog_card = across.split("Catalog entries compared</h3>", 1)[1].split("</div>", 1)[0]+ assert "Not applicable" in catalog_card+ # similarity-check never runs the within-skill scope: say so, without Unavailable KPIs.+ within = output.split('id="tier2-within"', 1)[1].split("</section>", 1)[0]+ assert "Not run by this command." in within+ assert "Unavailable" not in within and "dashboard-card" not in within+++def test_passing_workflow_stages_alone_do_not_prove_comparison_completion():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ for name, stage, index in (+ ("Context Deduplication", "intra_skill", 0),+ ("Similarity Check", "catalog_comparison", 1),+ ):+ result = ValidationResult(validator_name=name)+ result.metadata["workflow"] = {"tier": 2, "stages": {stage: {"status": "passed"}}}+ original = deepcopy(result)+ view = tier2_scope_views([result])[index]+ assert (view.completed, view.duplicates, view.affected) == (None, None, None)+ output = HTMLReporter(include_timestamp=False).render_all([result])+ assert "No semantic overlaps detected." not in output+ assert result == original+++def test_single_entry_collection_index_is_not_a_completed_comparison():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ single = ValidationResult(validator_name="Similarity Check")+ single.add_success("index_built", "Indexed", entry_count=1, content_type="skill")+ across = tier2_scope_views([single])[1]+ assert across.completed == 0+ assert across.duplicates is None+ assert not any("Pairwise comparison" in note for note in across.notes)+ assert any(note.startswith("Comparison not applicable") for note in across.notes)+++def test_insufficient_content_note_is_not_contradicted_by_incomplete_coverage():+ from skillevaluator.reporting.tier2_views import tier2_scope_views++ result = ValidationResult(validator_name="Context Deduplication")+ result.add_success("context_dedup", "Not enough content to compare")+ within = tier2_scope_views([result])[0]+ assert "Comparison not applicable: Not enough content to compare" in within.notes+ assert not any("incomplete" in note for note in within.notes)+++def test_across_scope_counts_similarity_matches_not_duplicates():+ result = ValidationResult(validator_name="Similarity Check")+ result.add_success("catalog_compared", "Compared", catalog_entry_count=5, self_matches_excluded=1)+ output = HTMLReporter(include_timestamp=False).render_all([result])+ across = output.split('id="tier2-across"', 1)[1].split("</section>", 1)[0]+ assert "Similarity matches</h3>" in across and "Duplicate findings" not in across+++def test_harbor_legacy_pair_stays_one_job_and_bad_shapes_do_not_crash():+ from skillevaluator.reporting.harbor_viewer import harbor_job_links, normalize_harbor_viewer_for_display++ viewer = {+ "job_url": "https://example.test/legacy",+ "analysis_url": "https://example.test/legacy/analysis",+ "jobs": [{"url": "https://example.test/a", "name": "a"}],+ }+ jobs = harbor_job_links({"harbor_viewer": viewer})+ assert [(job["name"], job.get("analysis_url")) for job in jobs] == [+ ("a", None),+ ("Job 2", "https://example.test/legacy/analysis"),+ ]+ assert normalize_harbor_viewer_for_display({"harbor_viewer": {"jobs": 1, "evidence_links": "x"}}) == {}+++def test_terminal_lists_harbor_jobs_from_engine_uploads():+ from skillevaluator.tier3.result_display import render_result++ engine = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "uploads": [+ {"viewer_url": "https://hv.example.test/jobs/with", "uploaded_job_name": "with-skill"},+ {"viewer_url": "https://hv.example.test/jobs/base", "uploaded_job_name": "baseline"},+ ]+ },+ }+ output = render_result(engine)+ assert "hv.example.test/jobs/with" in output and "hv.example.test/jobs/base" in output++[email protected]("uploads", [1, True, {}, "malformed", None, []])+def test_terminal_bad_or_empty_uploads_preserve_normalized_jobs_and_run_analysis(uploads):+ from skillevaluator.tier3.result_display import render_result++ result = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "uploads": uploads,+ "jobs": [+ {+ "url": "https://example.test/results/retained",+ "name": "Retained job",+ "analysis_url": "https://example.test/analysis/retained",+ }+ ],+ "analysis_url": "https://example.test/run-analysis",+ },+ }+ before = deepcopy(result)+ output = render_result(result)+ assert "Retained job" in output+ for url in (+ "https://example.test/results/retained",+ "https://example.test/analysis/retained",+ "https://example.test/run-analysis",+ ):+ assert output.count(url) == 1+ assert "Run analysis" in output+ assert result == before+++def test_terminal_upload_projection_merges_with_canonical_jobs_without_reattribution():+ from skillevaluator.tier3.result_display import render_result++ result = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "jobs": [+ {+ "url": "https://example.test/results/retained",+ "name": "Retained job",+ "analysis_url": "https://example.test/analysis/retained",+ }+ ],+ "analysis_url": "https://example.test/run-analysis",+ "uploads": [+ {+ "viewer_url": "https://example.test/results/uploaded",+ "uploaded_job_name": "Uploaded job",+ "analysis_url": "https://example.test/analysis/uploaded",+ },+ {"viewer_url": "https://example.test/results/uploaded", "uploaded_job_name": "Duplicate upload"},+ {+ "viewer_url": "https://example.test/results/retained",+ "uploaded_job_name": "Renamed retained job",+ "analysis_url": "https://example.test/analysis/retained",+ },+ {"viewer_url": "javascript:alert(1)"},+ ],+ },+ }+ before = deepcopy(result)+ output = render_result(result)+ assert "Retained job" in output and "Uploaded job" in output+ assert "Renamed retained job" not in output and "Duplicate upload" not in output+ for url in (+ "https://example.test/results/retained",+ "https://example.test/analysis/retained",+ "https://example.test/results/uploaded",+ "https://example.test/analysis/uploaded",+ "https://example.test/run-analysis",+ ):+ assert output.count(url) == 1+ assert "Run analysis" in output+ assert "javascript:" not in output+ assert result == before++[email protected]("existing_analysis", [None, "https://example.test/analysis/canonical"])[email protected]("padded_url", [False, True])+def test_terminal_matching_upload_fills_only_missing_canonical_analysis(existing_analysis, padded_url):+ from skillevaluator.tier3.result_display import render_result++ url = "https://example.test/results/retained"+ job = {"url": f" {url} " if padded_url else url, "name": "Retained job"}+ if existing_analysis:+ job["analysis_url"] = existing_analysis+ uploaded_analysis = "https://example.test/analysis/uploaded"+ result = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "jobs": [job],+ "uploads": [{"viewer_url": url, "analysis_url": uploaded_analysis, "uploaded_job_name": "Upload name"}],+ },+ }+ before = deepcopy(result)+ output = render_result(result)+ assert "Retained job" in output and "Upload name" not in output+ assert output.count(url) == 1+ assert output.count(existing_analysis or uploaded_analysis) == 1+ if existing_analysis:+ assert uploaded_analysis not in output+ assert result == before+++def test_terminal_upload_analysis_never_fills_a_different_canonical_job():+ from skillevaluator.tier3.result_display import render_result++ result = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "jobs": [{"url": "https://example.test/results/retained", "name": "Retained job"}],+ "uploads": [+ {+ "viewer_url": "https://example.test/results/uploaded",+ "uploaded_job_name": "Uploaded job",+ "analysis_url": "https://example.test/analysis/uploaded",+ }+ ],+ },+ }+ before = deepcopy(result)+ output = render_result(result)+ assert output.index("Retained job") < output.index("Uploaded job")+ assert output.index("Uploaded job") < output.index("https://example.test/analysis/uploaded")+ assert output.count("https://example.test/analysis/uploaded") == 1+ assert result == beforediff --git a/tests/reporting/test_report_navigation.py b/tests/reporting/test_report_navigation.pynew file mode 100644index 00000000..408af59c--- /dev/null+++ b/tests/reporting/test_report_navigation.py@@ -0,0 +1,229 @@+# SPDX-License-Identifier: Apache-2.0+"""Navigation contracts on the actual rendered, standalone report."""++from html.parser import HTMLParser++import pytest+from browser_navigation_fixtures import render_fixtures++from skillevaluator.evaluation.tier3_report import build_agent_eval_payload+from skillevaluator.models import ValidationResult+from skillevaluator.reporting.html import HTMLReporter+++class Document(HTMLParser):+ def __init__(self, html):+ super().__init__()+ self.elements = []+ self.stack = []+ self.feed(html)++ def handle_starttag(self, tag, attrs):+ element = dict(attrs)+ element["tag"] = tag+ element["parents"] = tuple(self.stack)+ self.elements.append(element)+ if tag not in {+ "area",+ "base",+ "br",+ "col",+ "embed",+ "hr",+ "img",+ "input",+ "link",+ "meta",+ "param",+ "source",+ "track",+ "wbr",+ }:+ self.stack.append(element)++ def handle_endtag(self, tag):+ for i in range(len(self.stack) - 1, -1, -1):+ if self.stack[i]["tag"] == tag:+ del self.stack[i:]+ break++ def by_id(self, name):+ return next(element for element in self.elements if element.get("id") == name)+++def static_result():+ result = ValidationResult(validator_name="Schema Check")+ result.add_success("schema", "valid")+ return result+++def agent_result():+ result = ValidationResult(validator_name="AGENT_EVAL")+ result.metadata["agent_eval"] = build_agent_eval_payload(+ "demo",+ {name: {"overall_with_skill": 0.8, "overall_without_skill": 0.4} for name in ['agent"[one]/雪', "agent.two"]},+ )+ return result+++def test_displayed_absent_tiers_are_navigable_without_fabricated_checks():+ html = HTMLReporter(include_timestamp=False, requested_tiers=(1, 2), displayed_tiers=(1, 2, 3)).render_all(+ [static_result()]+ )+ doc = Document(html)+ tiles = [element for element in doc.elements if "tier-card" in element.get("class", "").split()]+ assert [tile["data-target-tab"] for tile in tiles] == ["tier1", "tier2", "tier3"]+ assert "Not run (not requested)" in html+ for tile in tiles:+ assert doc.by_id(tile["aria-controls"])["id"] == "tab-" + tile["data-target-tab"]+ assert "No check evidence was recorded for this tier." in html+++def test_targeted_reports_keep_only_their_tier_navigation():+ doc = Document(HTMLReporter(include_timestamp=False).render_all([static_result()]))+ assert {element["data-report-tier"] for element in doc.elements if "data-report-tier" in element} == {"tier1"}+++def test_evidence_destination_is_outside_hidden_tier_panels():+ doc = Document(HTMLReporter(include_timestamp=False).render_all([static_result(), agent_result()]))+ evidence = doc.by_id("report-evidence")+ assert not any("tab-content" in parent.get("class", "").split() for parent in evidence["parents"])+ assert sum(element.get("id") == "report-evidence" for element in doc.elements) == 1+++def test_subtabs_and_unusual_agent_names_have_complete_relationships():+ html = HTMLReporter(include_timestamp=False).render_all([agent_result()])+ doc = Document(html)+ tabs = [element for element in doc.elements if element.get("role") == "tab"]+ assert len(tabs) == 8+ for tab in tabs:+ panel = doc.by_id(tab["aria-controls"])+ assert panel["role"] == "tabpanel"+ assert panel["aria-labelledby"] == tab["id"]+ assert tab["aria-selected"] in {"true", "false"}+ assert tab["tabindex"] == ("0" if tab["aria-selected"] == "true" else "-1")+ assert {tab["data-tier3-agent"] for tab in tabs if "data-tier3-agent" in tab} == {'agent"[one]/雪', "agent.two"}+++def test_theme_control_includes_system_and_no_js_exposes_local_evidence():+ html = HTMLReporter(include_timestamp=False).render_all([agent_result()])+ doc = Document(html)+ assert doc.by_id("report-theme")["tag"] == "select"+ assert {element["value"] for element in doc.elements if element["tag"] == "option"} >= {"system", "light", "dark"}+ no_js = html.split("<noscript>", 1)[1].split("</noscript>", 1)[0]+ assert ".t3-page" in no_js and ".t3-agent-panel" in no_js+++def test_overall_command_badge_is_prominent_and_agent_quality_is_named():+ source = static_result()+ source.add_error("Schema failed")+ html = HTMLReporter(include_timestamp=False).render_all([source, agent_result()])+ doc = Document(html)+ badge = next(element for element in doc.elements if "hero-command-status" in element.get("class", "").split())+ assert {"verdict-chip", "fail"} <= set(badge["class"].split())+ assert "Tier 3 quality: " in html.split('<div class="hero-side">', 1)[1].split("</div>", 1)[0]+++def _gated(result, tier, blocking=True):+ result.metadata["gating"] = {"tier": tier, "blocking": blocking}+ return result+++def _hero_reasons(html):+ import re++ return re.findall(r'<p class="hero-decision-reason">([^<]*)</p>', html)+++def test_hero_reason_counts_advisory_failures_apart_from_the_required_result():+ passed = ValidationResult(validator_name="License Compliance")+ passed.add_success("license", "License found")+ advisory = ValidationResult(validator_name="Similarity Check")+ advisory.add_error("Similarity provider failed")+ html = HTMLReporter(include_timestamp=False).render_all([_gated(passed, 1), _gated(advisory, 2, blocking=False)])+ assert "Passed required checks" in html+ assert _hero_reasons(html) == [+ "1 advisory check(s) failed or incomplete; advisory checks do not change the required result."+ ]++ clean = ValidationResult(validator_name="License Compliance")+ clean.add_success("license", "License found")+ assert _hero_reasons(HTMLReporter(include_timestamp=False).render_all([_gated(clean, 1)])) == []++ required = ValidationResult(validator_name="Schema")+ required.add_error("Missing name")+ html = HTMLReporter(include_timestamp=False).render_all([_gated(required, 1)])+ assert _hero_reasons(html) == ["1 failed · 0 incomplete required check(s). See tier evidence for reasons."]++[email protected]("tier", [1, 2, 3])[email protected]("incomplete", [False, True])+def test_hero_reason_keeps_advisory_results_separate_within_a_mixed_tier(tier, incomplete):+ required = ValidationResult(validator_name="Required check")+ required.add_success("required", "Required check passed")+ advisory = ValidationResult(validator_name="Advisory check")+ if incomplete:+ advisory.mark_scan_incomplete("optional comparison")+ else:+ advisory.add_error("Optional comparison failed")+ html = HTMLReporter(include_timestamp=False).render_all(+ [_gated(required, tier), _gated(advisory, tier, blocking=False)]+ )+ assert "Passed required checks" in html+ assert _hero_reasons(html) == [+ "1 advisory check(s) failed or incomplete; advisory checks do not change the required result."+ ]+++def test_nojs_dark_fallback_mirrors_every_hard_coded_dark_override():+ import re+ from pathlib import Path++ templates = Path(__file__).resolve().parents[2] / "src/skillevaluator/reporting/templates"+ report = (templates / "report.html.j2").read_text(encoding="utf-8")+ styles = (templates / "report_ui.css.j2").read_text(encoding="utf-8")+ overrides = re.findall(r'^\s*@media screen \{ \[data-theme="dark"\] (.*\}) \}\s*$', report, re.MULTILINE)+ assert overrides, "expected hard-coded dark overrides in report.html.j2"+ fallback = next(+ block+ for block in re.findall(r"@media screen and \(prefers-color-scheme:dark\)\{(.*)\}$", styles, re.MULTILINE)+ if not block.startswith(":root:not([data-theme]){")+ )+ for rule in overrides:+ mirrored = ":root:not([data-theme]) " + rule.replace('[data-theme="dark"]', ":root:not([data-theme])")+ assert mirrored in fallback, rule+++def test_browser_check_fixtures_render_every_target_the_checks_use(tmp_path):+ # browser_navigation_checks.py needs a browser; this keeps its fixtures usable without one.+ render_fixtures(tmp_path)+ pages = {name: (tmp_path / f"{name}.html").read_text(encoding="utf-8") for name in ("full", "stress", "absent")}+ documents = {name: Document(html) for name, html in pages.items()}++ def classes(element):+ return set((element.get("class") or "").split())++ full = documents["full"]+ ids = {element.get("id") for element in full.elements}+ assert {+ "t3-trials-table",+ "validator-1",+ "results-by-validator",+ "report-workspace",+ "run-metadata",+ "tier3-tab-overview",+ "tier3-tab-suggestions",+ "tier3-tab-provenance",+ "tier3-tab-agents",+ } <= ids+ for required in ({"t3-agent-anchor"}, {"t3-agent-tab-btn"}, {"skip-link"}, {"hero-command-status", "fail"}):+ assert any(required <= classes(element) for element in full.elements), required+ assert any("check-finding" in classes(element) and element.get("id") for element in full.elements)+ assert "Changes required" in pages["full"] and "Tier 3 quality: " in pages["full"]+ for name in ("full", "stress"):+ tiles = {+ element.get("data-target-tab") for element in documents[name].elements if "tier-card" in classes(element)+ }+ assert tiles == {"tier1", "tier2", "tier3"}, name+ skipped = [element for element in documents["absent"].elements if {"tier-card", "skipped"} <= classes(element)]+ assert len(skipped) == 2diff --git a/tests/reporting/test_report_redesign.py b/tests/reporting/test_report_redesign.pyindex ce7ec513..4fb553ca 100644--- a/tests/reporting/test_report_redesign.py+++ b/tests/reporting/test_report_redesign.py@@ -316,7 +316,7 @@ def test_failing_advisory_tier3_is_labelled_advisory() -> None:html = HTMLReporter(include_timestamp=False).render_all(_gated([agent_eval], 3, blocking=False))assert _tier_card_verdicts(html) == [("Tier 3", "Failed (advisory)")]- assert '<span class="sr-only">Tier 3 verdict: </span>Failed (advisory)</span>' in html+ assert "Tier 3 quality: Failed (advisory)</span>" in htmlassert "Changes required" not in html.split("<main", 1)[1].split('id="tab-tier3"', 1)[0]@@ -373,15 +373,13 @@ def test_check_table_rows_are_keyboard_reachable_links() -> None:assert all(f'id="validator-{index}"' in html for index in links)-def test_theme_toggle_has_a_fixed_name_and_reports_the_dark_state() -> None:+def test_theme_selector_has_a_name_and_system_light_dark_choices() -> None:html = _render(_results())- button = html.split('class="theme-toggle"', 1)[1].split("</button>", 1)[0]-- assert 'aria-pressed="false"' in button- assert '<span id="theme-text">Dark theme</span>' in button- assert "toggle.setAttribute('aria-pressed', theme === 'dark' ? 'true' : 'false')" in html- assert "getElementById('theme-text').textContent" not in html+ assert '<label class="theme-control" for="report-theme">Theme' in html+ assert '<select id="report-theme"' in html+ assert all(f'<option value="{theme}">' in html for theme in ("system", "light", "dark"))assert "matchMedia('(prefers-color-scheme: dark)')" in html+ assert "localStorage.removeItem('skillevaluator-theme')" in htmldef test_tier3_charts_are_redrawn_with_print_colors() -> None:diff --git a/tests/reporting/test_reporters.py b/tests/reporting/test_reporters.pyindex fe091960..03abc54e 100644--- a/tests/reporting/test_reporters.py+++ b/tests/reporting/test_reporters.py@@ -937,7 +937,7 @@ def test_tier1_dashboard_reconciles_only_tier1_findings() -> None:tier_cards = html.split('class="tier-cards', 1)[1].split('<section class="exec-summary', 1)[0]assert re.search(r"<strong>1</strong> finding</span>", tier_cards)assert '<span class="tier-card-sev-pill high">1 high</span>' in tier_cards- assert re.search(r"<strong>1</strong> duplicate\(s\)</span>", tier_cards)+ assert re.search(r"<strong>1</strong> finding\(s\)</span>", tier_cards)# The gate policy counts each tier's unique findings.gate_policy = html.split('class="gate-policy"', 1)[1].split("</div>", 1)[0]assert "0 critical · 2 high · 0 medium · 0 low" in gate_policy@@ -2340,8 +2340,9 @@ class TestMarkdownReporter:"""Tier 3 Markdown should include compact Harbor and evidence links."""output = MarkdownReporter(include_timestamp=False).render_all([_tier3_harbor_result()])- assert "**Harbor logs:** [Open Harbor logs](" in output- assert "**Harbor analysis:** [Open Harbor analysis](" in output+ assert re.search(+ r"^- \*\*[^*]+:\*\* \[Harbor logs\]\(https://[^)]+\) · \[Harbor analysis\]\(", output, re.MULTILINE+ )assert "https://harbor.example.test/jobs/log-analyzer" in outputassert "Evidence: [View Step 9](" in outputassert "log-analyzer-001?step=9" in output@@ -2690,3 +2691,107 @@ class TestTopIssuesDeepLink:))return result++[email protected]("reporter", [CLIReporter, MarkdownReporter, HTMLReporter])+def test_all_harbor_jobs_are_navigable_without_attribution_guessing(reporter):+ from copy import deepcopy++ result = _tier3_harbor_result()+ viewer = result.metadata["agent_eval"]["harbor_viewer"]+ viewer["jobs"] += [+ {+ "url": "https://harbor.example.test/jobs/second",+ "analysis_url": "https://harbor.example.test/analysis/second",+ "name": "<job>[bad](x)",+ },+ {"url": "https://harbor.example.test/jobs/third"},+ {"url": "https://harbor.example.test/jobs/second", "name": "duplicate"},+ {"url": "javascript:alert(99)", "name": "unsafe"},+ ]+ original = deepcopy(result)+ output = reporter().render_all([result])+ assert "https://harbor.example.test/jobs/second" in output+ assert "https://harbor.example.test/analysis/second" in output+ assert "https://harbor.example.test/jobs/third" in output+ assert "Job 3" in output+ assert "Results" in output+ assert "javascript:alert(99)" not in output+ if reporter is HTMLReporter:+ assert "<job>[bad](x)" in output+ assert "<job>" not in output+ panel = output.split('class="t3-harbor-panel"', 1)[1].split("</div>\n </div>", 1)[0]+ assert panel.count('href="https://harbor.example.test/jobs/second"') == 1+ elif reporter is MarkdownReporter:+ assert "<job>[bad](x)" in output+ else:+ assert "<job>[bad](x)" in output+ assert result == original+++def test_html_discloses_only_recorded_validated_provenance_without_changing_payload():+ from copy import deepcopy++ result = _tier3_harbor_result()+ ae = result.metadata["agent_eval"]+ ae["evaluator_version"] = "recorded-evaluator-v1"+ ae["dataset_digest"] = "sha256:" + "a" * 64+ ae["dataset_digest_algorithm"] = "skill-evaluator-dataset-snapshot/1"+ ae["agents"] = {"agent": {"model": "recorded-model-v1"}}+ result.metadata["evaluated_source"] = {"repository": "org/skill", "commit": "b" * 40}+ original = deepcopy(result)+ output = HTMLReporter(include_timestamp=False).render_all([result])+ diagnostics = output.split('id="tier3-page-provenance"', 1)[1].split("</section>", 1)[0]+ assert "Recorded evaluation provenance" in diagnostics+ assert "recorded-evaluator-v1" in diagnostics+ assert "recorded-model-v1" in diagnostics+ assert "sha256:" + "a" * 64 in diagnostics+ assert "org/skill" in diagnostics and "b" * 40 in diagnostics+ assert result == original++[email protected]("reporter", [CLIReporter, MarkdownReporter, HTMLReporter])[email protected]("summary_only", [False, True])+def test_legacy_analysis_only_harbor_evidence_is_available(reporter, summary_only):+ result = _tier3_harbor_result()+ ae = result.metadata["agent_eval"]+ ae.pop("harbor_viewer", None)+ viewer = {"analysis_url": "https://harbor.example.test/analysis-only"}+ if summary_only:+ ae["summary"]["harbor_viewer"] = viewer+ else:+ ae["harbor_viewer"] = viewer+ output = reporter().render_all([result])+ assert "https://harbor.example.test/analysis-only" in output+ assert "Run analysis" in output++[email protected]("colored", [False, True])+def test_cli_harbor_job_labels_remain_neutral_and_literal(colored):+ from io import StringIO++ from rich.console import Console++ stream = StringIO()+ console = Console(+ file=stream, force_terminal=colored, color_system="standard" if colored else None, record=True, width=160+ )+ payload = {+ "harbor_viewer": {+ "jobs": [+ {+ "name": "Job 3 [bad]",+ "url": "https://example.test/jobs/3",+ "analysis_url": "https://example.test/analysis/3",+ }+ ]+ }+ }+ CLIReporter._print_harbor_artifacts(payload, console)+ output = stream.getvalue()+ assert "Job 3 [bad]" in output+ assert "Harbor logs: Results https://example.test/jobs/3" in output+ assert "Harbor analysis: https://example.test/analysis/3" in output+ assert "Job 3 [bad]" in console.export_text()+ if colored:+ assert "\x1b[1mJob 3 [bad]\x1b[0m" in outputdiff --git a/tests/test_tier3_result_display.py b/tests/test_tier3_result_display.pyindex b6ae4aa4..2a947f7f 100644--- a/tests/test_tier3_result_display.py+++ b/tests/test_tier3_result_display.py@@ -1206,3 +1206,22 @@ def test_result_panel_title_cannot_inject_rich_markup_or_links() -> None:assert "evil.example" in stream.getvalue()assert "\x1b]8;" not in stream.getvalue()+++def test_standalone_result_displays_all_normalized_harbor_links():+ result = {+ "execution_status": "succeeded",+ "harbor_viewer": {+ "jobs": [+ {"url": "https://example.test/a", "analysis_url": "https://example.test/analysis", "name": "[bad]"},+ {"url": "https://example.test/b"},+ ]+ },+ }+ original = deepcopy(result)+ output = render_result(result)+ assert "https://example.test/a" in output+ assert "https://example.test/b" in output+ assert "https://example.test/analysis" in output+ assert "Job 2" in output+ assert result == original