Skip to content

fix(refresh): run the mirror after the source's weekly run, not an hour before it - #4

Merged
RelayStack merged 1 commit into
mainfrom
fix/mirror-refresh-ordering
Oct 13, 2026
Merged

RelayStack merged 1 commit into
mainfrom
fix/mirror-refresh-ordering

Conversation

@RelayStack

Copy link
Copy Markdown
Owner

The mirror's declared schedule runs one hour before the source it mirrors, so the
public dataset always carried the build the source was about to supersede.

Measured 2026-10-13 (before this PR, cache-busted live vs raw mirror):

live   /api/panels.json  generated_at 2026-10-13T08:29Z  data_built_at 2026-10-12T11:36:05.417Z
mirror data/panels.json  generated_at 2026-10-12T10:31:58Z data_built_at 2026-10-12T01:51:34.109Z
panels whose published score differs (mirror vs live): 59 of 129
response_ms differs: 114 of 129; liveness.state differs: 0

Cause: refresh.yml was cron: '0 3 * * 1'; the source
RelayStack/smmscout/.github/workflows/weekly-maintenance.yml is cron: '0 4 * * 1'
and publishes ~15 min into its run. Scheduled runs on this account start hours late
(source starts: 2026-10-12T11:29Z, 2026-10-05T11:01Z for a 04:00 schedule), so the
03:00 mirror always pulled the previous build; with no out-of-band dispatch it ends
up a full cycle (~7 days) behind.

What changes

  • cron: '0 20 * * 1' — ~8 h past the latest observed source start, with margin
    for GitHub's schedule delay. A comment block in the workflow records the ordering
    constraint and the measurement that set it.
  • New step "Report which build was mirrored" — every run now prints the mirrored
    data_built_at against the committed copy and emits a ::warning:: when the pull
    is not newer than what is already committed. That was the silent failure mode:
    an early run produced no diff, committed nothing and reported green.
  • README "Refreshing" section: Mondays 03:00 → 20:00 UTC with the reason.

Not changed (per the card)

Pull URL stays https://smmscout.com/api/panels.json (Function-derived operational);
the dataset writer is untouched (indent=1, same CSV header, same derived files).

Verification in this PR

  • node scripts/validate.mjs → OK 129 panels · node scripts/stats.mjs + git diff --exit-code -- data/stats.json → clean · node scripts/verify-consistency.mjs --report
    → OK (the three verify.yml steps).
  • New step rehearsed against the real live payload (::notice::mirrored data_built_at 2026-10-12T11:36:05.417Z (committed copy was 2026-10-12T01:51:34.109Z)) and against
    the committed payload (::warning title=Stale mirror pull::…), exit 0 both times.
  • verify run on this PR: see checks below.

Closes kanban t_23be34f6. Acceptance for "one Monday after" (mirror data_built_at
== live, 0 score diffs) lands on the first Monday 20:00 run; a manual workflow_dispatch
right after this merges pulls the current live build immediately and is the same check.

…ur before it

`refresh.yml` pulled https://smmscout.com/api/panels.json at Monday 03:00 UTC
while the source repo (RelayStack/smmscout, weekly-maintenance.yml) is scheduled
for Monday 04:00 UTC and publishes its new payload ~15 min into the run. GitHub
fires scheduled runs hours late on this account (source starts observed
2026-10-12T11:29Z and 2026-10-05T11:01Z), so the mirror always pulled the build
the source was about to supersede: on 2026-10-13 the dataset carried
data_built_at 2026-10-12T01:51:34Z while live was 2026-10-12T11:36:05Z, and 59
of 129 published scores differed. In a week with no out-of-band dispatch the
mirror is a full cycle (~7 days) behind the live API.

- schedule moves to `0 20 * * 1`: ~8 h past the latest observed source start,
  with margin for the schedule delay. The comment block in the workflow records
  why the ordering matters so the slot cannot be moved back by accident.
- new step "Report which build was mirrored" prints the mirrored `data_built_at`
  against the committed copy on every run, and emits a `::warning::` when the
  pull is not newer than what is already committed — the silent-staleness case
  that hid this bug for weeks (no diff, green run, nothing to notice).
- README refreshing section updated (Mondays 03:00 -> 20:00 UTC, with the reason).

The pull URL and the dataset shape are unchanged: the job still consumes the
live Function-derived payload (with `operational`), and the python writer is
untouched (`indent=1`, same CSV header, same derived files).

Verified locally: `node scripts/validate.mjs`, `node scripts/stats.mjs` +
`git diff --exit-code -- data/stats.json` and
`node scripts/verify-consistency.mjs --report` all pass; the new step was
rehearsed against the real live payload (notice) and the committed one (warning).

Refs kanban t_23be34f6.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 08:31

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@RelayStack
RelayStack merged commit b74ff53 into main Oct 13, 2026
2 checks passed
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