Skip to content

Freshness badge: say "audit ran", document the floored-day thresholds#25

Merged
mmcky merged 2 commits into
mainfrom
dashboard/audit-run-badge
Jul 17, 2026
Merged

Freshness badge: say "audit ran", document the floored-day thresholds#25
mmcky merged 2 commits into
mainfrom
dashboard/audit-run-badge

Conversation

@mmcky

@mmcky mmcky commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #24 (already merged), covering two things:

"Last audit run" wording. Matt asked whether there's an indicator for the last audit run and whether it's automated. There is, and it is: every site build re-runs the full scan across the 8 lecture repos — the workflow has no deploy path that skips the scan — so the badge date is by construction the last audit run. The badge now says so explicitly (● audit up to date — last ran today (…)), and the tooltip spells out the schedule (every push to main, weekly cron, manual dispatch). Worth restating the failure-mode design here: if a scheduled run finds a new unannotated data reference or migration drift, it fails rather than deploys, the site keeps the last good audit, and the badge ages toward orange — so orange means "the audit has stopped succeeding", never "an unvetted audit was published".

Copilot's threshold comment on #24 (raw-ms comparison instead of floored days): pushed back, with the reasoning now recorded as a code comment. The run stamp is date-only (midnight UTC) and the cron fires Mondays 05:17 UTC, so comparing raw milliseconds against "7 days" would flip the badge orange every Monday between 00:00 and the cron completing — a built-in weekly false alarm. Flooring to full calendar days makes orange mean what it should: a full scheduled run has been missed.

🤖 Generated with Claude Code

Every build re-runs the full scan, so the badge date IS the last audit
run — the wording now says so ("audit ran / audit up to date — last ran
…"), answering the natural reader question of whether the audit itself
is automated (it is: weekly cron + on push + on dispatch).

Also documents why the age thresholds floor to full calendar days
rather than comparing raw milliseconds (Copilot's suggestion on #24):
the run stamp is date-only at midnight UTC and the cron fires Mondays
05:17 UTC, so raw-ms "> 7 days" would flip the badge orange every
Monday between 00:00 and the cron completing — a weekly false alarm.
Floored days means orange = a full scheduled run has been missed.

Follow-up to #24.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 04: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

Updates the audit dashboard “freshness” badge copy to explicitly communicate that the displayed date reflects the last successful audit scan run, and documents the rationale for using floored full-day thresholds when computing staleness in the browser.

Changes:

  • Reword the freshness badge label and tooltip to say “audit ran” / “audit up to date — last ran …” and clarify the automation schedule.
  • Add an inline code comment explaining why the badge age uses floored calendar days (avoiding predictable false-orange windows around the weekly cron).

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

Comment thread scripts/render_audit.py Outdated
The freshness tooltip and both page ledes hard-coded "8" repos; the
count now comes from audit["repos"], so a manifest change to the
scanned set cannot silently falsify the copy.

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