Repository navigation
test(ci): check the store frame-drift gate per slot instead of silencing it on any ascspec change - #1113
Conversation
…#1112) Adds mise-tasks/test/store_frame_drift, a self-contained bash harness that drives mise-tasks/scan/store_frame_drift with real git commits in a disposable git repo, instead of hand-waving about what the gate "should" do. It copies scripts/build-ascspec-screenshots.py into the throwaway repo, derives the baseline/capture -> (device, app, slot) mapping from the gate's own `--list` output, seeds placeholder fixture files for every mapped baseline/capture and every 7-locale ascspec frame, commits that as a main branch, then branches off main once per scenario to make a real diff and run the gate against it with `--base main`. Nine scenarios are covered: three reproduce the #1112 gap (the gate treats "any file under docs/app-store/screenshots-ascspec/ changed" as proof the right frame was regenerated, so a drifted baseline paired with a regenerated-but-wrong slot, or only 6 of 7 locales for #998, both pass silently), and six confirm existing intended behavior still holds: an honest snapshot or capture regeneration, an unmapped baseline, the straightforward no-regeneration case (#995), and both escape hatches (commit trailer and the PR-label env override). This phase only writes the test — it does not touch the gate itself. Run twice for verification: once against the gate in this worktree, once against the identical copy fetched from origin/main (part of #1112), both times via the harness's --gate flag. Both runs produce the same result: cross-slot-snapshot, cross-slot-capture, and partial-locale FAIL (the gate wrongly passes them today), the other six PASS, overall exit 1 — pinning down the bug as a failing test ahead of the fix. One deviation from the original case list: escape-trailer and escape-label use the same diff as the no-frames case (baseline-only, no ascspec change) rather than the cross-slot-snapshot diff, because a cross-slot diff already satisfies the gate's coarse "ascspec/ changed" check and returns PASS before the escape-hatch code path is ever reached — using it would never exercise the escape hatch and would never print WARN. The no-frames diff is the only shape that reaches the escape-hatch branch at all. Related: #998, #995, #1054, #1001. Co-Authored-By: Claude Fable 5.1 <[email protected]>
#1112) mise-tasks/scan/store_frame_drift used to pass a PR as soon as ANY file under docs/app-store/screenshots-ascspec/ changed, so a drifted baseline paired with a regenerated-but-wrong slot (or only some locales, #998) went through silently and could get frozen by ASC on the next submission. The gate's ROWS now carry a 5th column, locale: "*" for a Slot() (one baseline feeds every locale's frame) or the specific locale for a CaptureSlot() row (a live capture only feeds its own locale, #1054). The coarse `grep -F docs/app-store/screenshots-ascspec/ <<<"$CHANGED"` check is gone. For every changed, mapped baseline/capture, the gate now expands every frame path it feeds (docs/app-store/screenshots-ascspec/<app>/ <device>/<locale>/<slot>.png, over ALL_LOCALES when locale is "*") and requires that exact path to also be in the diff — but only when the frame already exists at HEAD, since a locale the generator SKIPPED-NO-COPY never had one to begin with (`git cat-file -e HEAD:<path>`). Anything stale is named explicitly as `device/app/slot`, its missing frame path, and the baseline that changed — in the WARN (escape hatch used) and FAIL messages alike. `--list` gained a LOCALE column; its row count is unchanged (36: 22 Slot rows + 2 CaptureSlot x 7 locales). mise-tasks/test/store_frame_drift (#1112's self-test harness, added in a prior commit on this branch) now passes 10/10: the three scenarios that exposed the bug (cross-slot-snapshot, cross-slot-capture, partial-locale) correctly FAIL today and now correctly PASS once a slot's own frames are regenerated; a new case 10 (escape-trailer-cross-slot) confirms the escape hatch still works now that a cross-slot diff reaches that branch at all, which it never did under the old coarse check. Re-running the same harness against the pre-fix gate (origin/main's copy) still reproduces cases 1-3 as FAIL, proving the harness still catches the original regression. Back-tested against three real historical frame-regeneration commits in detached worktrees (`--base <sha>^`), confirming no false positives under the new per-slot logic: - 383b088 (store:capture 03-board frames, #1111): PASS - 34c3b03 (macOS 27 snapshot re-baseline): PASS - 93bdc18 (part of #1106, iPad board viewport): PASS .github/workflows/lint.yml's frame-drift-gate job runs the self-test (`mise run test:store_frame_drift`) as a step before the gate itself, and its header comment now describes the per-slot/per-locale check. The mise-task-operations skill's task table reflects both the updated gate description and the new test:store_frame_drift task. Related: #998, #995, #1054, #1001, #1111, #1104, #1106. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…on paths (#1112) The FAIL and WARN output now print one block per (device, app, slot, baseline) with one "missing: <frame path>" line per stale frame, so the fix is copy-pasteable; the previous form repeated the "fed by" baseline once per frame (14 lines for a Slot() missing all 7 locales). The Fix section names both resolution paths explicitly: (a) regenerate on macOS and commit every listed frame, or (b) when regeneration produces a byte-identical frame (the compositor downscales, so a small baseline change can vanish), use the frame-drift-verified label or the Frame-Drift-Verified: trailer and say why. A strict gate without a documented honest exit is the kind that gets an escape hatch bolted on later and loses the check entirely. Harness: case 1 (cross-slot-snapshot) now also asserts the failure text points at the escape trailer and lists the en frame in the "missing:" form; case 3 (partial-locale) asserts the th frame in the same form. Verification (all on this commit): - bash mise-tasks/test/store_frame_drift -> 10 passed, 0 failed, exit 0 - same harness against the origin/main gate -> cases 1-3 FAIL (the hole is still detected), escape-trailer-cross-slot FAIL (old gate never reaches the hatch), 6 PASS - new gate in detached worktrees at 383b088 (#1111), 34c3b03 (#1104), 93bdc18 (#1106), each diffed against its parent -> PASS, exit 0 - shellcheck on both task files -> exit 0 part of #1112 Co-Authored-By: Claude Fable 5.1 <[email protected]>
T6 acceptance report — PR #1113 (issue #1112)Verified read-only on worktree 1. Reproduce before fix — PASS
Saved Matches the claim: cross-slot-snapshot, cross-slot-capture, partial-locale all wrongly PASS on the old main gate. 2. Per-slot checking, named in failure — PASSRead 3. Both Slot() and CaptureSlot() covered — PASS36 data rows = 22 4. Positive/negative tests committed, full harness green — PASSHarness commits every scenario via Exit code 0. 5. No false positives on real history — PASSUsed the existing detached worktrees under 6. Runs on ubuntu-latest — PASS
7. PR hygiene — PASS
8. PM failure-message shape — PASS (independently reproduced, not using the author's artifacts)Built a fresh throwaway repo in scratchpad from scratch ( Grouped by slot (one block per device/app/slot/baseline), one 9. Diff scope — PASS
Exactly 4 files: gate, harness, workflow, skill doc. No PNG/baseline/capture/generator ( 10. No unexplained TODO/FIXME/stub/placeholder — PASS
SummaryAll 10 PM done-when items independently verified, several by building fresh throwaway repros rather than trusting the author's reported output (items 1, 5, 8 re-run from scratch; item 6 re-run shellcheck myself after activating it via 總判定:ACCEPT |
Code review (sonnet, fresh context) — head 70574a1BLOCKER — Reproduced by the reviewer in a throwaway repo with real commits. Deleting only some of the seven still fails (the rest are present and stale), so the hole is exactly the "delete the flagged files instead of regenerating" shape. None of the 10 harness cases delete a frame. Note on the fix: requiring the frame when it exists at HEAD or merge-base is not enough on its own, because Verified clean by the reviewer (each backed by a command run or a direct read of the head): per-slot/per-locale mapping matches the Not verified by the reviewer: a slot rename inside the same PR (out of scope here), an actual ubuntu run (CI has since run green with the self-test step: |
…#1112) Code review on #1113 flagged a BLOCKER: the per-slot drift gate read "HEAD:${frame} doesn't exist" as "the generator SKIPPED-NO-COPY this locale", so a diff that changes a baseline and `git rm`'s every frame it feeds passed the gate clean — the exact shape someone would use to make a red gate green without actually regenerating anything. Replace the single existence check with three explicit rules per expected frame: 1. missing at both HEAD and MERGE_BASE -> skip (never had a frame). 2. present at HEAD and present (non-deleted) in the diff -> fresh. 3. anything else -> STALE, including present-at-HEAD-but-untouched and present-at-MERGE_BASE-but-deleted-at-HEAD (the latter gets a "(deleted in this diff)" suffix on its "missing:" line so a reviewer can tell a drop apart from a plain stale frame). Rule 2 needs CHANGED_PRESENT (`git diff --name-only --diff-filter=d`) instead of the existing CHANGED, because CHANGED already lists deleted paths — matching a deleted frame against it would have made the fix a no-op. Harness: added case 11 (`deleted-frames`) — baseline A drifts, every frame it feeds is `git rm`'d. Confirmed red against the pre-fix gate (10 passed, 1 failed: deleted-frames, exit 0 instead of 1) before applying the fix, green after (11 passed, 0 failed). Cross-check against the 383b088 (pre-#1112) gate: cross-slot-snapshot, cross-slot-capture, partial-locale, and deleted-frames all correctly FAIL (the gate wrongly passes a diff that should be rejected), confirming the harness still discriminates old gates from the fixed one. Back-tested the fixed gate against three real historical commits — 383b088, 34c3b03, 93bdc18 — each `--base <sha>^`: all PASS, exit 0, no false positives introduced. Part of #1112, following #1111, #1104, #1106. Co-Authored-By: Claude Fable 5.1 <[email protected]>
7b7e4ed to
881be1f
Compare
…-gate harness (#1112) Two more cases requested after the deleted-frames gap was plugged (part of #1112), to pin two more boundaries of the "HEAD vs MERGE_BASE existence" rules: Case 12 (slot-retired): deleting the Slot() line itself out of the generator's SLOTS table — not just letting a baseline drift — must stay a PASS even though baseline A still drifts and all 7 of its old frames are gone too. The gate derives its mapping from the checked-out working tree's copy of scripts/build-ascspec-screenshots.py (== HEAD in CI), so once that Slot() line is gone from HEAD, its baseline is no longer "mapped" and none of its frames are required. Sudoku's and minesweeper's iphone-6.9 01-home Slot() calls share byte-identical arguments (they differ only by which BASELINES_SUDOKU/BASELINES_MS root they resolve against), so the case retires sudoku's copy specifically by line number and asserts the signature's count drops from 2 to 1, not to 0. Case 13 (deleted-frames-partial): baseline A drifts, 6 of 7 locale frames are honestly regenerated, and only the th frame is `git rm`'d. The gate must flag exactly th as stale (with "(deleted in this diff)") and must not flag any of the 6 honestly-regenerated locales. Verified: all 13 cases PASS against the fixed gate (13 passed, 0 failed). Against 70574a1 (the previous commit, pre-deleted-frame-fix): cases 11 (deleted-frames) and 13 (deleted-frames-partial) FAIL — th being absent at HEAD was read as "never generated" and wrongly passed — while 12 (slot-retired) still PASSes, since that case doesn't touch the existence-check logic at all. Against 383b088 (origin/main, pre-#1112 per-slot check, 7 passed, 6 failed overall): cross-slot-snapshot, cross-slot-capture, partial-locale, deleted-frames, and deleted-frames-partial all FAIL as required; slot-retired still PASSes there too (escape-trailer-cross-slot also fails, as already established before this change — that gate predates per-slot checking entirely). Back-tested the fixed gate against 383b088^, 34c3b03^, 93bdc18^: all PASS, exit 0, no false positives. shellcheck clean on both scripts. Part of #1112, following #1111, #1104, #1106. Co-Authored-By: Claude Fable 5.1 <[email protected]>
881be1f to
1b6abc5
Compare
|
T6 re-acceptance, head 1b6abc5 1–7, 9: unchanged, not re-run
8. Scope and hygiene — re-verified on the new head
VerdictTree unchanged and already fully verified; item 8 is now clean under both the loose and strict keyword-adjacency checks, with the PR body's sanctioned 總判定:ACCEPT |
|
PM merge record, head What it fixes. The reproduction came first. Commit 1 is the harness alone: 3 of 9 cases red against the then-current gate — cross-slot for both The review found a second hole and the fix was sharpened past the reviewer's suggestion. Deleting every frame a changed baseline feeds also passed. The proposed one-liner (require presence at HEAD or merge-base) would not have closed it, because Both directions are tested, red-first:
Verified: harness 13/13 on the new gate, 7 pass / 6 fail on PM ref check: 4 files, no PNG, baseline, capture or generator touched; no close/fix/resolve keyword before any #NNN in the body or any commit (the acceptance caught two such phrasings in commit prose and they were amended — the same trap that auto-closed #1054 earlier); and the harness now runs in CI before the gate, so the gate has its own regression cover. |
Closes #1112
part of #1014
What
scan:store_frame_driftused to pass a diff as soon as any file underdocs/app-store/screenshots-ascspec/changed. A PR that changed baseline A and regenerated only slot B's frames was green. The gate now checks per slot and per locale: for every changed mapped baseline, every frame it feeds must be regenerated in the same diff, and the failure names the slot and the exact missing frames.Slot()rows feed every locale from one baseline, so all 7 frames are required.CaptureSlot()rows (blocker(store): ASC 03-board frames cannot render Liquid Glass — snapshot pipeline is structurally unable to show G4 #1054) are per-locale, so only that locale's frame is required.SLOTStable on every run (the existing parser gained alocalecolumn;--listshows it). No second table.HEADvs the merge-base: absent at both → never generated (SKIPPED-NO-COPY), not required; present atHEADand in the non-deletion diff (--diff-filter=d) → regenerated; anything else → stale, and a frame deleted in the diff is listed asmissing: … (deleted in this diff). Deleting the flagged frames instead of regenerating them does not satisfy the gate (review BLOCKER on the first head).scripts/build-ascspec-screenshots.pyin the checkout, i.e. atHEADin CI. So a PR that retires a slot (removes itsSlot()row) and deletes its frames passes: the baseline is no longer mapped atHEAD.frame-drift-verified/ trailerFrame-Drift-Verified:) is unchanged and now actually reachable from a cross-slot diff; the WARN lists the slots it is covering for.Commits, in order: the failing reproduction (harness, 3 of 9 cases red on the old gate), the per-slot fix (10/10), the PM-requested failure-message shape (grouped by slot, both resolution paths named), the deleted-frame rule from the code review (case
deleted-framesred-first), and the two PM casesslot-retired/deleted-frames-partial.Self-test harness (
mise run test:store_frame_drift)Pure bash + git. Seeds a disposable repo from the gate's own
--list, then drives the gate through real commits (the gate compares refs, so a working-tree mutation would be a false pass). It is wired into theframe-drift-gatejob before the gate itself, so the negative tests stay pinned onubuntu-latest.iphone-6.9/sudoku/01-home, listsmissing: …/en/01-home.png, points atFrame-Drift-Verified:iphone-6.9/minesweeper/03-board, requires only the ja framemissing: …/th/01-home.png__Snapshots__PNG no slot mapsFrame-Drift-Verified:trailerFRAME_DRIFT_LABEL_OVERRIDE=1git rmall 7 of its framesmissing: … (deleted in this diff)01-homeSlot()row removed from the generator + baseline A changed + its 7 frames deletedHEAD)git rm'dBack-test on real history (no false positives)
New gate file run inside detached worktrees at each merge, diffed against its parent:
PASS … every store frame fed by a changed baseline was regenerated, exit 0Sample failure output (case 1 shape)
Scope
Gate, its self-test, one CI step, one skill-table row. No baseline, frame, capture, or generator change. Python/git only, no Swift build, no simulator.
shellcheckclean on both task files.🤖 Generated with Claude Code