Skip to content

Add the generated data-audit dashboard (gh-pages): audit + migration tracker#21

Merged
mmcky merged 4 commits into
mainfrom
audit/dashboard
Jul 17, 2026
Merged

Add the generated data-audit dashboard (gh-pages): audit + migration tracker#21
mmcky merged 4 commits into
mainfrom
audit/dashboard

Conversation

@mmcky

@mmcky mmcky commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Delivers #20 — the one-time, hand-built dataset audit becomes a generated, self-updating dashboard deployed to this repo's GitHub Pages site, extended into a first-class migration tracker showing exactly which data has moved here, via which PRs, and what's queued.

What's in the box

scripts/build_audit.py — two stages, kept separate so the data is reusable. scan greps each of the 8 synced Python-family repos on origin/main (clone + grep; gh search code cannot find URLs), resolves string-built URLs (f-strings, continuation lines, var + 'file' concatenation), reads only executed {code-cell} blocks (skipping skip-execution cells), classifies every reference into the hosting-pattern taxonomy, and emits audit.json. render writes the 3-page site.

Three pages (design system evolved from the 2026-07-15 artifact — same theme-aware palette and pills, plus nav, a migration meter with dataviz-validated series colors, and per-dataset lifecycle steppers):

Page Contents
Overview stat tiles, migration progress meter, hosting-pattern distribution, the what-moved-since-2026-07-15 story
Migration tracker per-dataset lifecycle pending → landed → repointed → final with the PRs that moved it, verified against a fresh scan; pending waves (P3/P4); consistency-check panel
Full audit the regenerated registries — hosting patterns, static files, %%file-embedded, live-API (with pedagogy classification), cross-series reuse, committed-but-unreferenced files, provenance classes, draft styleguide rules feeding QuantEcon.manual#108

Three sources of truth, reconciled on every build. Manifests (lectures/*.yml) own the migrated datasets; migration.yml (new) owns lifecycle + PR provenance — deliberately separate from the manifests so it can be archived when the migration programme completes; scripts/audit_annotations.yml (new) owns curated judgment for not-yet-migrated references. The strict build fails on an unannotated reference or a migration.yml status the scan contradicts — the dashboard cannot rot into the stale snapshot it replaces.

Pages workflow (.github/workflows/audit-dashboard.yml): push to main / weekly / manual dispatch; serves the dashboard at / and the published lectures/ tree at /lectures/ (checkout lfs: true), pre-staging Phase 4 so only the custom domain changes when the DNS question resolves. On PRs touching audit inputs it runs the strict build as a guardrail without deploying.

Fresh numbers (2026-07-17, vs the 2026-07-15 hand audit)

  • 36 distinct static files referenced (was 34): +2 genuinely new local-path datasets from lecture-python-intro#790 (us_adult_heights.csv, japan_population_by_age.xlsx), +graph.txt promoted from "shadowed" to load-bearing (lecture-wasm fetches intro's copy by URL), −test_table.csv (an exercise prose link, now annotated as such rather than a code read)
  • Legacy-repo URLs 8 → 0, branch-pinned refs 1 → 0 — the flags the last two days of PRs resolved, confirmed from live state
  • 4 datasets fully migrated (P1 lingcod, P2 pandas_panel trio), each verified: every consumer reads the data-lectures interim URL
  • 8th hosting pattern discovered (sibling repo URL — the wasm mirror), 35 committed-but-unreferenced files including wasm's 14 mirror-orphans

Notes for review

🤖 Generated with Claude Code

mmcky and others added 3 commits July 17, 2026 13:00
scripts/build_audit.py scans the 8 synced Python-family lecture repos on
origin/main (clone + grep — never gh search code, which cannot find URLs),
classifies every data reference into the hosting-pattern taxonomy, and
renders a 3-page static dashboard (overview / migration tracker / full
audit) via scripts/render_audit.py.

Three sources of truth, reconciled on every build:
- lectures/*.yml manifests — the migrated datasets
- migration.yml (new) — the migration lifecycle + PR provenance, kept
  separate from the manifests so it can be archived when the migration
  programme completes without touching the permanent dataset records
- scripts/audit_annotations.yml (new) — curated judgment (descriptions,
  provenance classes, live-API pedagogy) for not-yet-migrated references

The strict scan fails on an unannotated data reference or a migration.yml
status that disagrees with what the lectures actually read, so the
dashboard cannot silently rot — the failure mode that killed the
hand-built 2026-07-15 audit artifact within two days.

Part of #20; taxonomy and design system carried over from that artifact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
.github/workflows/audit-dashboard.yml builds the dashboard from shallow
clones of the 8 lecture repos and deploys the default Pages site:
dashboard at /, the published lectures/ tree at /lectures/, audit.json
alongside for reuse. Triggers: push to main, weekly cron, manual
dispatch; on PRs touching the audit inputs it runs the strict build as
a guardrail without deploying.

Serving lectures/ on Pages pre-stages PLAN Phase 4: when the
data.quantecon.org DNS question is resolved, only the custom domain
changes. Checkout uses lfs: true so LFS-tracked files publish as bytes,
never pointers.

Part of #20.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README gains the audit-dashboard section; AGENTS.md gains the
keep-it-truthful rules (migration.yml updated in the same PR as a
landing/repoint; annotations for new references; never commit site/ or
audit.json) and the expanded repo map; PLAN.md checks off the Pages
deploy (default domain — custom domain stays open), adds the Phase 5
workflow entry, and marks pilot P2 complete (#17,
QuantEcon/lecture-python-programming#578, QuantEcon/lecture-python.myst#973).

Part of #20.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 03:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a generated, CI-built data-audit dashboard (with a migration tracker) for the QuantEcon Python-family lecture repos, and deploys it via GitHub Pages alongside the published lectures/ dataset tree. It introduces a strict “truthfulness” contract across lectures/*.yml manifests, migration.yml, and scripts/audit_annotations.yml, and updates project docs/plans to reflect the new automation.

Changes:

  • Add scripts/build_audit.py (scan + strict reconciliation) and scripts/render_audit.py (HTML renderer) plus curated scripts/audit_annotations.yml.
  • Introduce migration.yml as a lifecycle/provenance tracker separate from manifests, and document the strict drift checks in AGENTS.md / README.md.
  • Add a GitHub Actions Pages workflow to rebuild and deploy the dashboard and lectures/ tree on main/schedule/dispatch (and run as a PR guardrail).

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/render_audit.py New HTML renderer for the dashboard pages (overview, migration tracker, full audit).
scripts/build_audit.py New scanner/reconciler producing audit.json and invoking the renderer; supports strict drift detection.
scripts/audit_annotations.yml New curated annotations for non-manifested datasets + live-API pedagogy notes + orphan classifications.
scripts/README.md Documents which scripts are builders vs generators/metadata inputs.
README.md Documents the audit dashboard purpose and how to run the strict build.
PLAN.md Marks Pages deploy and audit-dashboard automation as completed items.
migration.yml New migration lifecycle/provenance tracker for migrated datasets and pending waves.
AGENTS.md Adds repository rule: keep dashboard inputs consistent; don’t commit generated outputs.
.gitignore Ignores generated site/ and audit.json.
.github/workflows/audit-dashboard.yml New Pages workflow to build (strict) and deploy dashboard + lectures/ tree.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build_audit.py
Comment thread scripts/render_audit.py Outdated
Comment thread scripts/build_audit.py
- render_audit.py: add the external-web pattern to PATTERN_META so a
  non-GitHub data URL would surface in the hosting-pattern table and
  distribution chart instead of being silently omitted (no current ref
  triggers it; the failure mode was the point)
- build_audit.py: validate migration.yml status values in the scan-stage
  consistency check (an unknown status fails --strict with a clear
  message); render_audit.py's stepper raises a named error as backstop
- build_audit.py: flag any .ipynb under lectures/ outside _static/ as an
  unscanned_notebooks problem. Every lecture source today is MyST .md and
  the only notebooks are builder/figure helpers (deliberately not
  consumers); if a notebook-format lecture ever appears, the build now
  refuses to miss it silently

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mmcky
mmcky merged commit 8a04862 into main Jul 17, 2026
3 checks passed
@mmcky
mmcky deleted the audit/dashboard branch July 17, 2026 03:20
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