Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ All notable changes to SkillEvaluator are documented in this file.

### Changed

- Align final terminal and HTML command outcomes: Passed required checks,
Changes required, or Incomplete. Keep publication eligibility and Best agent
score separate. Tier counts exclude explicit N/A checks from execution;
Tier 3 trial summaries use recorded condition counters before retained rows.

- Name the shared OSS validation policy `default` for both public and private
repositories. Keep `--profile external`, `--external`, and the legacy
environment value as compatibility aliases without changing validation rules.
Expand Down
29 changes: 29 additions & 0 deletions docs/reports.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,35 @@ skillevaluator validate ./my-skill -r json,html,markdown,sarif -o reports

For gating a pipeline on the JSON output, see [Gate Your CI](ci-integration.mdx).

## Reading the final status

The compact terminal summary, full terminal report, and HTML header describe the
same command outcome: **Passed required checks**, **Changes required**, or
**Incomplete**. A confirmed failure takes precedence over missing evidence.
Advisory tiers retain their own findings and execution status without changing
the required gate or process exit code.

**Publication eligibility** is a separate, stricter assessment of the recorded
policy, provenance, and evidence coverage. A passed required gate does not imply
publication eligibility. Standalone Tier 3 reports show **Not assessed (Tier 3
only)**. **Best agent score** describes one evaluated agent, rather than approval
of the whole validation run.

Each tier counts its own passed, failed, incomplete, skipped, and N/A results.
Skipped and explicitly inapplicable checks are excluded from executed-check
denominators. A tier that produced no results is **Not run**; presentation of an
unrequested tier does not create evidence that it ran.

Tier 3 summaries prefer recorded per-condition counters: for example,
**188 scored trials: 101 with skill, 87 baseline**. Condition details retain
expected counts and execution status, so partial execution and early stopping
remain distinguishable. Missing or malformed counters are **unavailable**, and
explicitly skipped arms remain **skipped**. Legacy reports with trial rows but
no counters show **retained rows**, which are observations rather than complete
scored totals. Preview limits and physical retry rows do not replace recorded
attempt counts. These are display projections; canonical JSON and evaluation
payloads are unchanged.

## File naming

Report filenames follow two patterns, both under the output directory:
Expand Down
94 changes: 94 additions & 0 deletions docs/superpowers/plans/2026-11-05-professional-reporting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Professional NVIDIA Reporting Implementation Plan

> For agentic workers: implement task by task using subagent-driven development or executing-plans. Each task requires self-review, an independent review, and fixes for confirmed findings before its PR is ready.

**Goal:** Make GitHub SkillEvaluator's CLI and standalone HTML reports consistent, understandable, accessible, and professional with NVIDIA styling.

**Architecture:** Extend existing public status, presentation, provenance, resource, and Harbor-link abstractions. Keep canonical evaluation data and decision policies unchanged; render shared presentation projections into HTML and terminal views.

**Tech stack:** Python, Rich, Jinja2, vanilla browser JavaScript/CSS, packaged Chart.js 4.5.1, pytest, Ruff, Fern.

**Spec:** The user-approved Professional NVIDIA Reporting plan, reproduced as executable tasks below. GitHub repository only; no internal source or integrations are imported.

## Global Constraints

- Preserve scoring formulas, thresholds, publication policy, exit codes, CLI flags/defaults, artifact filenames, canonical JSON schemas, redaction, and report-size limits.
- Use latest GitHub main in isolated worktrees; preserve the existing checkout and its untracked duplicate directories.
- Extend existing shared status logic; no duplicate verdict resolver, fabricated measurements, inferred missing baselines, or mutated canonical payloads.
- Keep report_scope's existing decision semantics separate from requested/displayed tier context. Optional keyword-only presentation arguments must preserve existing callers and emit_reports()'s boolean return.
- Keep private integrations and internal plugin-specific code out of the public changes. Use only existing public recorded evidence and public upstream assets.
- Each PR includes focused behavioral tests, documentation/changelog, signed-off commits, root self-review, independent review, and fixes for confirmed findings.
- Publish five focused PRs; keep drafts during verification, mark ready when verified, and leave them open without merging main.

## Review Focus

- Confirmed failures plus missing evidence: command status must agree across terminal and HTML while retaining stricter publication assessment separately.
- Missing/N/A/skipped/baseline-only/retained/truncated evidence: unknown is not zero, N/A is not execution, and preview caps cannot change totals.
- Long hostile or Unicode names/paths: escape markup/HTML/control characters, preserve safe links, and fit narrow displays without losing numeric values.
- Offline and installed-wheel reports: all chart assets/licenses are packaged; generated reports make no runtime network requests for charts.
- Non-TTY interruption/closed streams: durable progress must stop cleanly without affecting evaluation, duplicating events, or leaking workers.

### Task 1: Consistent status, scope, and execution accounting

Branch: naren/reporting-status-accounting, based on current main.

- [ ] Extend existing run_status and presentation helpers with an immutable final-render context: command outcome, separate publication assessment, tier status/counts, score scope, and per-condition coverage. Build once per final render and share across compact CLI, full CLI, HTML header/hero/tiles.
- [ ] Preserve failure precedence and advisory gating. Use primary labels Passed required checks / Changes required / Incomplete. Keep publication eligibility separate; standalone Tier 3 publication remains Not assessed.
- [ ] Label agent scores explicitly (Best agent score); they are not whole-validation approval.
- [ ] Count each tier's own results; distinguish passed, failed, incomplete, skipped, not run and N/A, excluding N/A from executed denominators.
- [ ] Prefer recorded per-condition scored/expected counters before previews. Display N scored trials: X with skill, Y baseline. Missing/malformed remains unavailable, explicit skip stays skipped, legacy row counts are observed/retained rows, not complete totals. Handle retries, early stopping, skill-only/baseline-only, partial/failed arms and >64 preview rows.
- [ ] Add optional keyword-only requested/displayed presentation context where necessary in emit_reports and HTMLReporter, preserving defaults, decision report_scope, return values and JSON schemas. Do not synthesize ValidationResult evidence for missing tiles.
- [ ] Add meaningful failing tests first, implement, run focused reporting/status/CLI tests; prove payload immutability and status/count parity. Update user docs and changelog; signed-off commit; self-review and independent review.

### Task 2: Truly self-contained HTML charts

Branch: naren/reporting-offline-charts, independently based on current main.

- [ ] Vendor public Chart.js 4.5.1 UMD from public upstream; verify its original bytes using the existing SRI, record source/version/digests, retain applicable Chart.js/bundled dependency licenses in resources, notices and generated reports.
- [ ] Load fixed package resources with a cached loader and embed only when Tier 3 requires charts. Remove CDN/source-map dependencies. No new npm/Python runtime dependencies or lockfile churn.
- [ ] Preserve chart data, theme changes, print redraw and number formatting. Add accessible descriptions/table references and visible initialization-failure fallback instead of blank space.
- [ ] Package assets/licenses in wheel and sdist. Replace CDN tests with embedded-runtime/version/digest/license tests; confirm Tier 1 avoids asset bytes and installed-wheel render works without network.
- [ ] Update docs/changelog, run focused tests/build/package checks; signed-off commit; self-review and independent review.

### Task 3: Persistent HTML navigation and accessible NVIDIA styling

Branch: naren/reporting-workspace-navigation, based on reviewed Task 1.

- [ ] Retain existing logo, public dark sidebar and restrained surfaces. Compact hero to skill, overall decision/reason, labeled agent result; move environment/metrics/provenance details into existing disclosures.
- [ ] Comprehensive validate displays all 3 tier tiles with truthful absent/unrequested states; targeted reports keep focused scope. Sidebar has Summary, Tier 1/2/3 and Run details; mobile has compact sticky tier navigation.
- [ ] One activation function synchronizes sidebar, tiles, active panel, selected state and focus. Place evidence destination outside hidden tier panels; preserve exact finding links, clearing filters and highlighting/focus. Current sidebar follows real section navigation.
- [ ] Retain Overview/Insights/Agent Details/Trials/Dataset/Diagnostics. Associate tabs/panels and aria state; roving tabindex and Left/Right/Home/End/Enter/Space support for subtabs and agent tabs, including unusual names.
- [ ] Remove expanded height caps that hide findings or tables. One main page scroll, horizontal overflow only for wide tables, bounded nested vertical scrolling only for raw logs/JSON. Native theme-aware scrollbars, stable gutters, forced-colors fallback; no simulated scrollbars.
- [ ] Add System/Light/Dark control; persist explicit preferences, follow system by default. Respect reduced motion and print/no-JS evidence access and expansion restoration. Offset sticky mobile/local navigation without overlap.
- [ ] Use lime #76B900 for accents, dark green #3E6500 for light-theme text/actions, charcoal navigation, restrained borders/shadows, red/amber semantic states. Normal text 14px, secondary labels >=11px, WCAG AA text/controls.
- [ ] Add behavioral tests plus browser checks at 1440/760/390px, both themes, keyboard, long reports, reduced motion, no JS, and print. Update docs/changelog; signed-off commit; self-review and independent review.

### Task 4: Clearer Tier 2 summaries and complete evidence navigation

Branch: naren/reporting-evidence-views, based on reviewed Task 3.

- [ ] Split Tier 2 into Within this skill / Across skills using existing typed workflow and similarity metadata. KPIs: Checks completed, Duplicate findings, Affected files/skills, Catalog entries compared; explicit scope and unavailable values.
- [ ] Completed zero matches differs from skipped/unavailable comparison. Explain target-vs-catalog vs pairwise collections; retain self-exclusion and duplicate accounting. Context/token savings only if recorded.
- [ ] Expose every existing normalized Harbor job in HTML, CLI and Markdown, with Results and available Analysis. Preserve names or Job N fallback, legacy single-job/analysis-only, deduplication, URL safety and escaping; no inferred attribution.
- [ ] Surface existing sanitized scanner/model/evaluator/dataset/source provenance in appropriate disclosures. Retain both-arm resource comparisons, nulls, omission counts and full downloads. Explicit with-skill-only chart labels; no cached-token double counting.
- [ ] Test missing/skipped/zero-match workflows, 0/1/multiple/duplicate/unsafe job links, retained reports, nullable telemetry, limits and immutability. Update docs/changelog; signed-off commit; self-review and independent review.

### Task 5: Consistent responsive CLI and durable CI progress

Branch: naren/reporting-cli-polish, based on reviewed Task 1.

- [ ] Share lightweight semantic Rich styles across compact/full/direct Tier 3 reports. Preserve green/gray pipeline and amber numbered fixes; remove inconsistent decorative cyan/magenta in report views.
- [ ] Reuse grade mapping A/B green, C amber, D/F red with failed/incomplete/unavailable overrides. Displayed zero lift is neutral; preserve unavailability/inconclusive labels and all scoring thresholds.
- [ ] Keep each condition label/number/complete bar atomic; stack at narrow widths and preserve all numbers. Test 98/80/60 columns and long/wide Unicode labels.
- [ ] Add concise successful quality/lift evidence to existing full-report Details cells; do not expand every successful panel.
- [ ] Use actual producer-emitted paths/basenames, not hardcoded report.html. Safe hyperlinks only for capable interactive output; readable paths with no newly added OSC8 in plain/no-color/redirected/string-render APIs. Preserve escaping and control stripping.
- [ ] Final panels stdout; durable noninteractive progress stderr: tier/check starts, stage changes, measured completion milestones, completion. Deduplicate unchanged events; heartbeat after 60 seconds without progress. Reuse progress lifecycle, no invented percentages, clean interruption/closed-stream handling and no leaked workers.
- [ ] Fake-clock progress tests, artifact/escaping/color/layout/status parity tests, unchanged CLI surface and JSON/exit behavior. Update docs/changelog; signed-off commit; self-review and independent review.

## Validation and delivery

- Focused regressions per task, then repository-required make lint / make test / make build, Fern validation, OSS source/archive boundary, packaging and relevant compatibility tests. Record baseline environment failures separately from regressions; never claim unrun checks passed.
- Review identical synthetic/retained fixtures at desktop/mobile and terminal widths in both themes, no-color/pipes, offline, keyboard/reduced-motion/no-JS/print. No live provider evaluation needed for reporting changes.
- Optimize classify-once projections, immutable asset cache and repeated traversals only where justified; avoid broad rewrites and unnecessary polling/workers.
- PR dependencies: 1 first; 2 independent; 3 and 5 follow 1; 4 follows 3. Test an isolated assembled integration checkout with all five changes. Do not merge main.
- Deliver five PR links, CI statuses, before/after previews, and concise review/fix records. All commits signed off; PR template and changelog/docs updated.
60 changes: 45 additions & 15 deletions src/skillevaluator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from contextvars import ContextVar
from datetime import UTC, datetime
from pathlib import Path
from typing import Any
from typing import TYPE_CHECKING, Any

import click

Expand Down Expand Up @@ -77,6 +77,10 @@
today_utc,
)

if TYPE_CHECKING:
from skillevaluator.reporting.presentation import FinalRenderContext


CONTEXT_SETTINGS = {"help_option_names": ["-h", "--help"]}


Expand Down Expand Up @@ -1635,9 +1639,23 @@ def _finish_pipeline_view(
report_formats: tuple[str, ...],
target_path: Path,
agent_eval: bool,
presentation_context: FinalRenderContext | None = None,
) -> 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.presentation import build_final_render_context
from skillevaluator.reporting.run_status import Status

context = presentation_context or build_final_render_context(
[
*tier_gate_results,
*([tier3_result] if tier3_result is not None and tier3_result not in tier_gate_results else []),
]
)
details = tuple(f"Tier {number}: {tier.summary}" for number, tier in context.tiers.items() if tier.displayed)
if context.tiers[3].status != Status.NOT_RUN:
details += (context.coverage.text, *context.coverage.details)
details += (f"Publication eligibility: {context.publication_label}",)

ext = {"html": ".html", "json": ".json", "markdown": ".md", "sarif": ".sarif.json"}
links: list[tuple[str, str]] = [
Expand All @@ -1649,21 +1667,13 @@ def _finish_pipeline_view(
summary = payload.get("summary") or payload

if not gate_failed:
ran = sum(1 for block in view.blocks if block.status not in ("pending", "skip"))
advisory_failed = any(block.status == "fail" and block.number in {2, 3} for block in view.blocks)
if advisory_failed:
headline = "gating tiers passed · advisory tier reported findings (see report)"
else:
headline = f"all {ran} tier{'s' if ran != 1 else ''} passed"
skipped = sum(
1 for r in tier_gate_results if isinstance(r.metadata, dict) and r.metadata.get("skipped_by_user")
)
if skipped:
headline += f" · {skipped} check{'s' if skipped != 1 else ''} skipped"
lift = summary.get("overall_lift")
if agent_eval and isinstance(lift, (int, float)):
headline += f" · skill lift {lift:+.2f}"
view.finish(Verdict(passed=True, headline=headline), links)
details += ("advisory tier reported findings (see report)",)
lift = summary.get("overall_lift")
if agent_eval and isinstance(lift, int | float) and not isinstance(lift, bool) and math.isfinite(lift):
details += (f"skill lift {lift:+.2f}",)
view.finish(Verdict(passed=True, headline=context.command_label, details=details), links)
return

failed = [result for result in tier_gate_results if not result.passed and not _is_skipped(result)]
Expand All @@ -1689,7 +1699,17 @@ def _finish_pipeline_view(
headline = " · ".join(parts) or "validation failed"
rerun = _rerun_hint(target_path, agent_eval)
fix = [("see what to fix above, then rerun", MUTED)] if failed else first_fix(tier_gate_results)
view.finish(Verdict(passed=False, headline=headline, fix=fix, rerun=rerun), links)
view.finish(
Verdict(
passed=False,
headline=f"{context.command_label}: {headline}",
fix=fix,
rerun=rerun,
incomplete=context.command_status == Status.INCOMPLETE,
details=details,
),
links,
)


def _print_tier_banner(title: str) -> None:
Expand Down Expand Up @@ -2553,8 +2573,17 @@ def _on_case_rows(rows: list[TierRow]) -> None:
# "cli", which renders the full Rich report below the pipeline view.
effective_formats = _effective_report_formats(report_formats, quiet=quiet)
report_basename_value = make_timestamped_basename(f"{REPORT_PREFIX}-output")
from skillevaluator.reporting.presentation import build_final_render_context

presentation_context = build_final_render_context(
results,
requested_tiers=tuple(number for number, enabled in ((1, True), (2, dedup), (3, agent_eval)) if enabled),
displayed_tiers=(1, 2, 3),
expected_skill_name=publication_name,
)
emit_reports(
results,
presentation_context=presentation_context,
report_formats=effective_formats,
output_dir=output_dir,
basename=report_basename_value,
Expand Down Expand Up @@ -2611,6 +2640,7 @@ def _on_case_rows(rows: list[TierRow]) -> None:
report_formats=effective_formats,
target_path=target_path,
agent_eval=agent_eval,
presentation_context=presentation_context,
)
if gate_failed:
raise click.ClickException("validation failed")
Expand Down
Loading
Loading