Repository navigation
ci(store): add a Linux proxy gate for ASC marketing-frame drift - #1005
Merged
Merged
Conversation
Twice now (#995, #998) a snapshot baseline moved and the committed ASC frames under docs/app-store/screenshots-ascspec/ were not regenerated to match, so stale marketing screenshots reached App Store Connect (#998's stale mac frames were live for six days). The obvious fix — run scripts/build-ascspec-screenshots.py and `git diff --exit-code` — cannot run on this repo's CI: all five existing workflows run ubuntu-latest, and the generator loads macOS system fonts by absolute path (Hiragino Sans GB / PingFang / AppleSDGothicNeo / Ayuthaya), so it fails at import time on Linux. The per-locale font choice is deliberate, not incidental, so substituting Linux fonts would silently change glyph shapes on exactly the CJK/th locales this pipeline exists to protect. Add the Linux proxy gate instead (option 3 from the issue discussion): a pure git/grep check that fails a PR when it changes a snapshot baseline mapped by the generator's SLOTS table without touching anything under docs/app-store/screenshots-ascspec/ in the same PR. The mapping is parsed fresh out of scripts/build-ascspec-screenshots.py on every run (BASELINES_SUDOKU/BASELINES_MS + every Slot(...) entry), not hardcoded, so it cannot silently rot as slots are added/removed. Deliberately does not fire on every __Snapshots__ change — only on the subset the SLOTS table actually maps to a store frame. Escape hatch for the legitimate case (a baseline change that provably doesn't alter the frame): PR label `frame-drift-verified`, or a `Frame-Drift-Verified: <reason>` commit-message trailer. Both are documented directly in the gate's own failure message. Changed: - mise-tasks/scan/store_frame_drift: the gate itself (new mise task). - .github/workflows/lint.yml: wire it as a 6th job on the existing Lint workflow (ubuntu-latest, matches the other 4 source-reading jobs' style); add labeled/unlabeled to the trigger types so the escape-hatch label can actually turn a red check green. - .claude/skills/mise-task-operations/SKILL.md: index the new task. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…sed header Code review on #1005 found a structural flaw: `device`/`app` in mise-tasks/scan/store_frame_drift were only ever assigned when a header regex matched (`"<device>": {` / `"sudoku": [` / `"minesweeper": [`). If a header line is ever reformatted so the regex misses it, the loop neither errors nor drops the row — device/app silently keep the value from the PREVIOUS matched block, so every Slot(...) under the unrecognized header gets attributed to the wrong device/app. Because `baselines_root` is selected by `$app`, a wrong app produces a non-existent path and the row for a REAL baseline drops out of the table entirely — the gate then goes vacuously green if that baseline changes, which is worse than having no gate. Reviewer reproduced this against a scratch copy of the real script with two mutations (`"mac": {` and the mac-block `"sudoku": [` each getting an extra space): both left the row count at 30 while silently misattributing rows. Fix: track block boundaries, not just block starts. The token stream now also captures bare `]`/`}` characters; leaving an app's Slot list (`]`) clears `app`, leaving a device's dict (`}`) clears `device` and `app`. A header line that fails to match for ANY reason now leaves the context EMPTY rather than STALE, which trips the existing "Slot(...) found before a device/app context" guard — a loud failure instead of silent misattribution. Verified against both reported mutations on a scratch copy (script under review untouched). Also fixes a dead diagnostic the reviewer flagged as a cheap nit: under `set -o pipefail`, `VAR=$(grep ... | sed ...)` with no grep match exits the script immediately at that line (pipefail propagates grep's nonzero), so the "-z" checks that were supposed to print "could not parse ... — script format changed" never ran. Added `|| true` to each such pipeline so the intended diagnostic actually prints. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a CI gate for the drift #995 and #998 both hit: a snapshot baseline that
feeds an ASC marketing frame changes, but
docs/app-store/screenshots-ascspec/doesn't get regenerated to match (#998's stale mac frames were live on App
Store Connect for six days).
Why not the obvious
python3 scripts/build-ascspec-screenshots.py && git diff --exit-codegate. All five existing workflows runubuntu-latest. Thegenerator loads macOS system fonts by absolute path — Hiragino Sans GB /
PingFang / AppleSDGothicNeo / Ayuthaya (see the header comment at
scripts/build-ascspec-screenshots.py:606-643) — so it fails at import timeon Linux, not just renders differently. The per-locale font choice is
deliberate (Hiragino has no Hangul, SFNS has no Thai), so swapping in Linux
fonts would silently change glyph shapes on exactly the CJK/th locales this
pipeline protects. A
macos-latestrunner would work but bills 10x Linuxminutes for ~210 render slots, unmeasured; that tradeoff is left for a future
PR if this proxy proves insufficient (see the issue's option 1/2 discussion).
What this does instead — the Linux proxy (option 3 in the issue). A pure
git/grep check, no Python/Pillow/fonts, that fails a PR when it changes a
snapshot baseline mapped by the generator's
Slot()table without touchinganything under
docs/app-store/screenshots-ascspec/in the same PR. Itcannot verify pixel equality — only the real generator can — but it catches
the actual observed failure mode: a baseline moved, the frames didn't.
Precision. Most
__Snapshots__baselines feed no store frame at all,so the gate only fires on the subset the
SLOTStable inscripts/build-ascspec-screenshots.pyactually maps to a slot. That mapping(30 baseline→slot rows) is parsed fresh out of the script on every run —
BASELINES_SUDOKU/BASELINES_MSplus everySlot(...)entry — instead ofbeing hardcoded, so it can't silently rot as slots are added/removed
(
mise run scan:store_frame_drift --listprints the live table).Escape hatch for the legitimate case (a baseline change that provably
doesn't alter the frame): PR label
frame-drift-verified, or a committrailer
Frame-Drift-Verified: <reason>. Both are documented in the gate'sown failure message. Added
labeled/unlabeledto the workflow's PRtrigger types so applying the label actually turns a red check green.
Changed
mise-tasks/scan/store_frame_drift— the gate (new mise task, bash 3.2compatible, shellcheck-clean).
.github/workflows/lint.yml— wired as job 6 on the existingLintworkflow (
ubuntu-latest, matches the other source-reading jobs' style)..claude/skills/mise-task-operations/SKILL.md— indexed the new task.Test plan
Ran locally against throwaway commits (deleted after, not pushed) diffed
against this branch as base:
(
HomeViewTests/snapshotIPhoneLight...png, feedsiphone-6.9/sudoku/01-home)with no
screenshots-ascspec/change → gate FAILS (exit 1) with theactionable message (baseline path, fed slot, fix command, escape hatch).
This reproduces the exact fix(store): mac 01-home frames drift from current baselines (pre-existing, unrelated to #997) #998 shape.
(
StatsViewTests/snapshotIPhoneLight...png) → gate PASSES.together with its corresponding
screenshots-ascspec/sudoku/iphone-6.9/en/01-home.png→ gate PASSES.
Frame-Drift-Verified:commit trailerand
FRAME_DRIFT_LABEL_OVERRIDE=1env (the PR-label path) both turn thetrue-positive case into a WARN + exit 0.
--list, 30 rows) cross-checked by eye againstscripts/build-ascspec-screenshots.py:491-593— exact match.shellcheckclean (viamise exec shellcheck -- shellcheck mise-tasks/scan/store_frame_drift).fetch-depth: 0merge-base availability) — only the underlying mise taskwas exercised locally; the workflow YAML was validated for syntax only.
closes #1001
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 5 (1M context) [email protected]