Skip to content

fix(reporting): make HTML charts self-contained and accessible - #350

Merged
rng1995 merged 8 commits into
mainfrom
naren/reporting-offline-charts
Nov 6, 2026
Merged

rng1995 merged 8 commits into
mainfrom
naren/reporting-offline-charts

Conversation

@rng1995

@rng1995 rng1995 commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Tier 3 charts disappear when the CDN is unavailable. Embed the verified Chart.js 4.5.1 runtime and both bundled MIT notices so reports work offline, with accessible tables and readable failure states.

  • Cache fixed package resources, include them in wheels/source distributions, and omit the chart payload from Tier 1-only reports.
  • Preserve theme, print redraw, numerical formatting, and exact verified asset bytes across Windows checkouts.
  • Reveal and focus the referenced evidence even inside collapsed disclosures; retain reports when an asset is unavailable and release context-less chart instances.

This PR is independent of the other reporting changes.

Scoring formulas, thresholds, publication policy, exit codes, command-line options, artifact filenames, canonical JSON, redaction, and report-size limits are preserved. No internal integrations or plugin-specific implementation were copied.

Verification

  • Familiar with the Contributing Guidelines; all commits signed off.
  • Added focused regressions and updated report documentation.
  • Root self-review and independent review; all confirmed findings fixed and re-reviewed.
  • Final assembled focused selection: 381 passed.
  • Ran make test on the final combined source; result below.
  • make lint and make build passed; wheel/source archives and package metadata verified.
  • Fern validation: zero errors and the existing unauthenticated redirects warning; OSS source/archive and public benchmark checks passed.
  • No credentials, private datasets, proprietary benchmark content, or internal integrations added.

Final assembled make test: 24,962 passed, 35 skipped, no failures, in 348.53 seconds on Python 3.14 with four workers and repository default marker exclusions. Exact clean integration: 25fd11aaf18033b5fdc287e83c0431a69acb34f3.

Actual installed-wheel verification covered 1440, 761, 760, 421 and 390px layouts in both themes, generous text spacing, paired provenance, mixed required/advisory summaries, section/agent links, print/no-JavaScript and keyboard behavior. The latest evidence delta passed 24 fixture observations; the final chart delta passed 14 browser/offline/native-CSP cases, including collapsed and missing-runtime data links, JSON downloads and 16 painted chart observations. No runtime/CSP errors, page-wide overflow or network attempts were observed. Shared navigation assets match the six-scenario verified source; broad earlier layout/evidence matrices were retained rather than needlessly repeated.

Current-head GitHub checks are not all complete; this PR remains draft. The PR checks tab shows live status.

Review

Verified upstream integrity, asset digests, licenses, package inclusion, offline rendering, context-less cleanup, and missing-asset fallback. Chart-reference regressions first failed, then passed after fixing nested disclosure reveal, focus, and fragment updates. Four actual standalone browser cases passed at desktop/mobile widths; the integrated path reuses shared navigation.

All five PR discussions and review threads were checked: there are no review comments or unresolved threads. The combined changes were validated in isolated integration 25fd11aaf18033b5fdc287e83c0431a69acb34f3 without merging any PR into main. Leave open for human review.

Release Impact

  • Updated CHANGELOG.md.

rng1995 and others added 3 commits November 5, 2026 18:57
Review follow-ups for the offline charts:

- Runs with no dimension scores linked both chart descriptions to the
  hidden Diagnostics sub-tab, so the link did nothing. They now target
  the JSON Downloads section, and a static helper reveals the sub-tab
  that holds any chart data link before jumping.
- Chart.js 4.5.1 registers a context-less instance with canvas=null, so
  Chart.getChart(canvas) never found it and each rebuild leaked one
  instance per chart. Destroy the constructed instance instead; the test
  fake now behaves like the real library.
- A missing vendored asset no longer aborts the whole Tier 3 report: the
  runtime and notices are skipped and each chart keeps its fallback.
- Mark the vendored assets -text so autocrlf checkouts keep the bytes
  the recorded digest describes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 marked this pull request as draft November 6, 2026 04:15

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the bundled chart assets, the offline fallback, the accessibility text and the packaging assertions. Nothing blocking: the charts render without network access, and the package test proves the assets ship in the wheel. I merged main into the branch to clear the conflict.

chrisknvidia and others added 2 commits November 6, 2026 07:36
Resolve the CHANGELOG.md conflict: main and this PR each started a
"### Changed" list under Unreleased after 0.8.0. Keep one heading, with
main's CI redaction entry (#348) first and this PR's entries after it.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review findings and fixes

An independent review of this PR found 4 P3 issues. It confirmed the vendored Chart.js provenance, digests, packaging, safe embedding, CSP and offline rendering. All four issues are fixed in 67349df.

# Severity Finding Fix
F1 P3 On runs with no dimension scores, both chart descriptions linked to #tier3-page-provenance. That is a hidden sub-tab, so the link did nothing. The link targets the JSON Downloads section (tier3-json-downloads), and openTier3Reference reveals the sub-tab that holds it before jumping.
F2 P3 Chart.js 4.5.1 registers a context-less instance with canvas = null, so Chart.getChart(canvas) never found it. Each rebuild leaked one instance per chart. createChart destroys the instance it constructed. The test fake now behaves like the real library.
F3 P3 A missing vendored asset made the whole Tier 3 report fail. _load_chart_assets returns empty strings on OSError, the runtime and notices are skipped, and each chart keeps its visible fallback.
F4 P3 On autocrlf checkouts (the GitHub Windows runner default) the asset bytes change, so the recorded digest no longer holds. .gitattributes marks src/skillevaluator/reporting/assets/** -text.

Two new tests are in tests/reporting/test_chart_dependency.py.

Resolve the CHANGELOG.md conflict: keep main's Unreleased "### Changed"
entries, including the verdict and trial accounting entry (#351), first
and this PR's entries after them.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@rng1995
rng1995 marked this pull request as ready for review November 6, 2026 19:10
@rng1995
rng1995 enabled auto-merge (squash) November 6, 2026 19:10
@rng1995
rng1995 merged commit 40d28e4 into main Nov 6, 2026
22 checks passed
@rng1995
rng1995 deleted the naren/reporting-offline-charts branch November 6, 2026 19:50
rng1995 added a commit that referenced this pull request Nov 7, 2026
Resolve conflicts with #350, #353 and #371:

- CHANGELOG.md: take main's Unreleased layout and add this branch's
  Tier 2 evidence, reading-room and navigation entries under Changed.
  The PII digest and outcome-alignment entries are already on main.
- docs/reports.mdx: keep the navigation, theme and spacing paragraphs
  and main's offline chart paragraph.
- reporting/cli.py: keep the per-job Harbor artifacts helper. Main's
  only change there replaced cyan URLs, which the helper never uses.
- tier3/result_display.py: keep both the Harbor viewer and terminal
  style imports.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants