Skip to content

test(ci): check the store frame-drift gate per slot instead of silencing it on any ascspec change - #1113

Merged
wei18 merged 5 commits into
mainfrom
session/frame-drift-gate-1112
Oct 28, 2026
Merged

wei18 merged 5 commits into
mainfrom
session/frame-drift-gate-1112

Conversation

@wei18

@wei18 wei18 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Closes #1112
part of #1014

What

scan:store_frame_drift used to pass a diff as soon as any file under docs/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.
  • The mapping is still parsed from the generator's SLOTS table on every run (the existing parser gained a locale column; --list shows it). No second table.
  • Each expected frame is classified by existence at HEAD vs the merge-base: absent at both → never generated (SKIPPED-NO-COPY), not required; present at HEAD and in the non-deletion diff (--diff-filter=d) → regenerated; anything else → stale, and a frame deleted in the diff is listed as missing: … (deleted in this diff). Deleting the flagged frames instead of regenerating them does not satisfy the gate (review BLOCKER on the first head).
  • The mapping is read from scripts/build-ascspec-screenshots.py in the checkout, i.e. at HEAD in CI. So a PR that retires a slot (removes its Slot() row) and deletes its frames passes: the baseline is no longer mapped at HEAD.
  • The escape hatch (label frame-drift-verified / trailer Frame-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-frames red-first), and the two PM cases slot-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 the frame-drift-gate job before the gate itself, so the negative tests stay pinned on ubuntu-latest.

# case diff shape expected
1 cross-slot-snapshot (#1112) baseline A + all 7 frames of slot B FAIL, names iphone-6.9/sudoku/01-home, lists missing: …/en/01-home.png, points at Frame-Drift-Verified:
2 cross-slot-capture capture ms/iphone/ja 03-board + all 7 frames of slot B FAIL, names iphone-6.9/minesweeper/03-board, requires only the ja frame
3 partial-locale (#998) baseline A + 6 of its 7 frames FAIL, lists missing: …/th/01-home.png
4 honest-snapshot baseline A + all 7 of its frames PASS
5 honest-capture capture ja + its ja frame PASS
6 unmapped-baseline a __Snapshots__ PNG no slot maps PASS
7 no-frames (#995) baseline A alone FAIL
8 escape-trailer case 7 + Frame-Drift-Verified: trailer WARN, exit 0
9 escape-label case 7 + FRAME_DRIFT_LABEL_OVERRIDE=1 WARN, exit 0
10 escape-trailer-cross-slot case 1 + trailer WARN, exit 0
11 deleted-frames baseline A + git rm all 7 of its frames FAIL, 7 × missing: … (deleted in this diff)
12 slot-retired sudoku iPhone 01-home Slot() row removed from the generator + baseline A changed + its 7 frames deleted PASS (unmapped at HEAD)
13 deleted-frames-partial baseline A + 6 frames regenerated + th git rm'd FAIL, only th listed, marked deleted
$ bash mise-tasks/test/store_frame_drift
Summary: 13 passed, 0 failed (of 13)            # new gate

$ bash mise-tasks/test/store_frame_drift --gate <git show origin/main:mise-tasks/scan/store_frame_drift>
FAIL cross-slot-snapshot (expected exit 1, got 0)
FAIL cross-slot-capture (expected exit 1, got 0)
FAIL partial-locale (expected exit 1, got 0)
FAIL escape-trailer-cross-slot (expected exit 0, got 0)   # old gate never reaches the hatch
FAIL deleted-frames (expected exit 1, got 0)
FAIL deleted-frames-partial (expected exit 1, got 0)
Summary: 7 passed, 6 failed (of 13)             # the hole, reproduced

Back-test on real history (no false positives)

New gate file run inside detached worktrees at each merge, diffed against its parent:

merge what it touched result
383b088 (#1111) 14 captures + 14 frames (both apps, iPhone 03-board) PASS … every store frame fed by a changed baseline was regenerated, exit 0
34c3b03 (#1104) 21 mapped baselines re-baselined + 147 frames PASS, exit 0
93bdc18 (#1106) 1 baseline (MS iPad 03-board) + its 7 frames PASS, exit 0

Sample failure output (case 1 shape)

FAIL [store_frame_drift]: mapped snapshot baseline(s) changed without regenerating every store frame they feed (the #995/#998/#1112 failure mode).

Stale frame(s) — not updated in this diff:
  - iphone-6.9/sudoku/01-home  (baseline changed: Packages/SudokuKit/Tests/SudokuUITests/__Snapshots__/ProgressScreenTests/snapshotStoreIPhoneLight.ProgressScreen-iPhone-light-store.png)
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/en/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/es/01-home.png
      … (7 locales)

Fix — one of the following:
  (a) Regenerate: on macOS …, run python3 scripts/build-ascspec-screenshots.py
      then commit every "missing:" frame listed above …
  (b) Escape hatch — only if regenerating produces a byte-identical frame …:
      add the PR label 'frame-drift-verified', or add a commit-message trailer:
          Frame-Drift-Verified: <why the frame doesn't need regenerating>

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. shellcheck clean on both task files.

🤖 Generated with Claude Code

wei18 and others added 3 commits October 20, 2026 21:06
…#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]>
@wei18

wei18 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

T6 acceptance report — PR #1113 (issue #1112)

Verified read-only on worktree /Users/zw/GitHub/Wei18/Sudoku-spec-worktree-session-frame-drift-gate-1112, HEAD confirmed at 70574a184cf6a8af1330b686b5a62ee86e857b46 before running anything from the tree.

1. Reproduce before fix — PASS

git log --oneline 383b0886..70574a18:

70574a18 fix(ci): group the frame-drift failure by slot and name both resolution paths (#1112)
4905d5d4 fix(ci): check the store frame-drift gate per slot instead of per diff (#1112)
9fffecc7 test(ci): add a throwaway-repo harness for the store frame-drift gate (#1112)

git show 9fffecc7 --stat → only mise-tasks/test/store_frame_drift | 308 ++++++++++++++++++++++++++++++++++++++ (1 file changed, 308 insertions). The gate itself is untouched in this commit.

Saved git show 383b0886:mise-tasks/scan/store_frame_drift to scratchpad and ran the current harness against it:

FAIL cross-slot-snapshot (expected exit 1, got 0)
FAIL cross-slot-capture (expected exit 1, got 0)
FAIL partial-locale (expected exit 1, got 0)
PASS honest-snapshot / honest-capture / unmapped-baseline / no-frames / escape-trailer / escape-label
FAIL escape-trailer-cross-slot (expected exit 0, got 0)
Summary: 6 passed, 4 failed (of 10)

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 — PASS

Read mise-tasks/scan/store_frame_drift (head version) in full. For every changed mapped baseline it expands every frame the row feeds (ALL_LOCALES for a Slot() row's *, the row's own locale for a CaptureSlot() row), checks git cat-file -e HEAD:<frame> before requiring it, and collects stale ones keyed by (device, app, slot_name, baseline). print_stale_blocks() prints one header line - <device>/<app>/<slot> (baseline changed: <baseline>) followed by one missing: <frame> line per stale frame — independently reproduced below (item 8). No second hardcoded slot/baseline table exists in the gate; the only literal path fragments are ASCSPEC_PREFIX and the two generator-derived BASELINES_SUDOKU_REL/BASELINES_MS_REL roots, both parsed out of scripts/build-ascspec-screenshots.py at runtime.

3. Both Slot() and CaptureSlot() covered — PASS

$ bash mise-tasks/scan/store_frame_drift --list | wc -l   # incl. header
37
$ bash mise-tasks/scan/store_frame_drift --list | awk '{print $NF}' | sort | uniq -c
  22 *
   2 en / es / ja / ko / th / zh-Hans / zh-Hant   (2 each, 14 total)
   1 LOCALE   (header)

36 data rows = 22 Slot() rows (*) + 2 CaptureSlot() rows × 7 locales = 14. Matches the PM's "36 rows, 2 CaptureSlot × 7 locale = 14" expectation.

4. Positive/negative tests committed, full harness green — PASS

Harness commits every scenario via git commit -q --no-gpg-sign before invoking the gate (verified by reading all 10 case blocks — none mutate the working tree without committing first). Ran:

$ bash mise-tasks/test/store_frame_drift
PASS cross-slot-snapshot / cross-slot-capture / partial-locale / honest-snapshot /
PASS honest-capture / unmapped-baseline / no-frames / escape-trailer / escape-label /
PASS escape-trailer-cross-slot
Summary: 10 passed, 0 failed (of 10)

Exit code 0.

5. No false positives on real history — PASS

Used the existing detached worktrees under scratchpad/bt-<sha> (valid git repos, git -C <dir> rev-parse HEAD resolved correctly for all three), ran the head gate script against each with --base "<sha>^":

383b0886 (#1111): PASS [store_frame_drift]: every store frame fed by a changed baseline was regenerated in this diff.  EXIT=0
34c3b032 (#1104): PASS … EXIT=0
93bdc186 (#1106): PASS … EXIT=0

6. Runs on ubuntu-latest — PASS

grep -nE 'python|pip|Pillow|sips|osascript' mise-tasks/scan/store_frame_drift mise-tasks/test/store_frame_drift → every hit is either a comment/description string explaining why Python isn't used on this runner, or the literal string "python3 scripts/build-ascspec-screenshots.py" printed inside the Fix (a) instructions for the human doing the macOS regeneration — never executed by the gate/harness itself. No sips/osascript/pip/Pillow anywhere.

shellcheck (via mise exec [email protected] --, since no default was activated) on both files → exit 0, no findings.

.github/workflows/lint.yml, job frame-drift-gate (line 181+): steps in order are actions/checkout@v4 (fetch-depth 0) → jdx/mise-action@v2 install → "Self-test the drift gate (throwaway repo)" → mise run test:store_frame_drift → "Run ASC frame drift proxy gate" → mise run scan:store_frame_drift --base "origin/${{ base.ref }}". Self-test step precedes the gate step, as claimed, inside the same job.

7. PR hygiene — PASS

  • gh pr view 1113 --json body → starts with Closes #1112 then part of #1014.
  • Scanned PR body + all 3 commit messages for (close|closes|fix|fixes|resolve|resolves)…#[0-9]+: only hits are the one intended Closes #1112 line and the two commit subject lines fix(ci): … (#1112), where fix(ci): is the Conventional-Commits type prefix, not adjacent to the #1112 token (separated by a full subject clause) — this is the documented carve-out, not a stray close keyword.
  • gh pr view 1113 --json autoMergeRequest,state → {"autoMergeRequest":null,"state":"OPEN"}. Not merged, auto-merge not armed.

8. PM failure-message shape — PASS (independently reproduced, not using the author's artifacts)

Built a fresh throwaway repo in scratchpad from scratch (t6-repro.sh, not reusing any pre-existing sample-fail/bt-* dirs left by the dev agent), seeded it from the head gate's own --list output and the real scripts/build-ascspec-screenshots.py, committed a cross-slot-snapshot diff (baseline A changed, only slot B's 7 frames regenerated), and ran the head gate directly:

FAIL [store_frame_drift]: mapped snapshot baseline(s) changed without regenerating every store frame they feed (the #995/#998/#1112 failure mode).

Stale frame(s) — not updated in this diff:
  - iphone-6.9/sudoku/01-home  (baseline changed: Packages/SudokuKit/Tests/SudokuUITests/__Snapshots__/ProgressScreenTests/snapshotStoreIPhoneLight.ProgressScreen-iPhone-light-store.png)
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/en/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/es/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/ja/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/ko/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/th/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/zh-Hans/01-home.png
      missing: docs/app-store/screenshots-ascspec/sudoku/iphone-6.9/zh-Hant/01-home.png

Fix — one of the following:
  (a) Regenerate: on macOS (the generator needs system fonts not present
      on this runner), run
          python3 scripts/build-ascspec-screenshots.py
      then commit every "missing:" frame listed above under
      docs/app-store/screenshots-ascspec/.
  (b) Escape hatch — only if regenerating produces a byte-identical frame
      (the compositor can absorb a small baseline change, e.g. an
      unrelated test refactor, with no visible pixel difference, so
      there is nothing to commit): add the PR label 'frame-drift-verified',
      or add a commit-message trailer:
          Frame-Drift-Verified: <why the frame doesn't need regenerating>
EXIT=1

Grouped by slot (one block per device/app/slot/baseline), one missing: line per stale frame, and the Fix section lists both (a) regenerate and (b) escape hatch (label or Frame-Drift-Verified: trailer) with the byte-identical rationale. All PM conditions satisfied.

9. Diff scope — PASS

git diff --stat 383b0886 70574a18:

.claude/skills/mise-task-operations/SKILL.md |   3 +-
.github/workflows/lint.yml                   |  15 +-
mise-tasks/scan/store_frame_drift            | 143 ++++++++----
mise-tasks/test/store_frame_drift            | 329 +++++++++++++++++++++++++++
4 files changed, 435 insertions(+), 55 deletions(-)

Exactly 4 files: gate, harness, workflow, skill doc. No PNG/baseline/capture/generator (scripts/) changes. The SKILL.md diff is a 2-row table update matching the real behavior change plus a new row for test:store_frame_drift — consistent with the code.

10. No unexplained TODO/FIXME/stub/placeholder — PASS

rg -n 'TODO|FIXME|stub|placeholder' mise-tasks/scan/store_frame_drift mise-tasks/test/store_frame_drift → single hit, mise-tasks/test/store_frame_drift:13, inside a comment describing that the harness seeds "placeholder fixture files" for baselines/frames — this is accurate prose describing the harness's own fixture strategy (the fixture content literally is placeholder text, e.g. fixture baseline source: <path>), not a stub/TODO marker for unfinished work.


Summary

All 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 mise exec). No discrepancies found between the author's report and reproduced evidence. PR #1113 is open, not merged, auto-merge not armed, as required.

總判定:ACCEPT

@wei18

wei18 commented Oct 27, 2026

Copy link
Copy Markdown
Owner Author

Code review (sonnet, fresh context) — head 70574a1

BLOCKER — mise-tasks/scan/store_frame_drift:249. git cat-file -e "HEAD:${frame}" || continue treats "frame absent at HEAD" as "never generated", so a diff that changes baseline A and git rms all 7 frames it feeds passes:

=== gate output (deleting ALL frames for the slot) ===
PASS [store_frame_drift]: every store frame fed by a changed baseline was regenerated in this diff.
exit=0

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 git diff --name-only lists deletions, so the deleted frame would still match the "changed" check. The fix in flight uses three rules per expected frame: absent at both refs → skip (never generated); present at HEAD and in the non-deletion diff (--diff-filter=d) → regenerated; otherwise stale, with deleted ones marked (deleted in this diff). A harness case deleted-frames is added red-first.

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 SLOTS table (--list cross-checked); runs under macOS system bash 3.2.57; harness drives committed refs, and an independent mutant (check only en instead of all locales) turned partial-locale red; old gate via --gate <(git show 383b0886:…) → 6 passed, 4 failed; CI step order and prerequisites correct; mapping single-sourced with the 3 anchor paths pre-validated against --list; escape hatch reachable in the cross-slot shape; shellcheck 0 findings; back-tests 383b088 / 34c3b03 / 93bdc18 all PASS.

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: Summary: 10 passed, 0 failed (of 10)).

…#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]>
@wei18
wei18 force-pushed the session/frame-drift-gate-1112 branch from 7b7e4ed to 881be1f Compare October 28, 2026 13:44
…-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]>
@wei18
wei18 force-pushed the session/frame-drift-gate-1112 branch from 881be1f to 1b6abc5 Compare October 28, 2026 13:47
@wei18

wei18 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

T6 re-acceptance, head 1b6abc5

1–7, 9: unchanged, not re-run

git diff 7b7e4ed7 1b6abc57 --stat is empty — tree byte-identical to the fully-verified 7b7e4ed7. All content evidence from the original round (deletion-hole throwaway-repo tests, red-first harness runs against 70574a1 and 383b088, 13/13 self-test, slot-retired case-12 code read, 3-commit real-history back-test, shellcheck, TODO/FIXME scan) stands unchanged. Item 3's non-blocking paraphrase discrepancy (6 vs claimed 5 failures against 383b088) also stands, unaffected.

8. Scope and hygiene — re-verified on the new head

  • git rev-parse --short HEAD = 1b6abc57 (confirmed directly). git status --short clean.
  • gh pr view 1113 --json headRefOid,state,autoMergeRequest → headRefOid=1b6abc578123096a8871650a85ceaceadaa1c8b0, state=OPEN, autoMergeRequest=null. Matches HEAD. PASS.
  • PR body still starts with Closes #1112 / part of #1014, unchanged. PASS.
  • Commit message now reads: "Two more cases requested after the deleted-frames gap was plugged (part of test(ci): store frame-drift gate is silenced by any ascspec change, not checked per slot #1112), to pin two more boundaries..." — "fix" and "closed" are both gone from that clause.
  • Re-ran both greps myself over git log --format=%B 383b0886..1b6abc57:
    • Loose ((close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)[^.]{0,20}#[0-9]+, the pattern that still caught the previous round's "closed ... test(ci): store frame-drift gate is silenced by any ascspec change, not checked per slot #1112"): zero matches.
    • Strict GitHub-auto-close syntax (\b(close|closes|closed|fix|fixes|fixed|resolve|resolves|resolved)\b:?[[:space:]]+#[0-9]+): zero matches.
    • Confirmed the only remaining #NNN-adjacent occurrences across the full commit range are fix(ci): conventional-commit subject prefixes, which are not followed by any #NNN within their own scope token.
  • PASS, both the literal checklist wording and the stricter actual-risk reading are satisfied now.

Verdict

Tree 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 Closes #1112 intact and nothing else in range referencing #1112/any other #NNN with a close/fix/resolve word in the same clause. No outstanding findings.

總判定:ACCEPT

@wei18

wei18 commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

PM merge record, head 1b6abc57. Gate satisfied: code review (1 BLOCKER, fixed) plus two fresh-context acceptances, the second on this head, 總判定:ACCEPT.

What it fixes. scan:store_frame_drift was silenced by any change under docs/app-store/screenshots-ascspec/, so a PR could change baseline A, regenerate only slot B, and pass. It now checks per (device, app, slot, locale).

The reproduction came first. Commit 1 is the harness alone: 3 of 9 cases red against the then-current gate — cross-slot for both Slot() and CaptureSlot, plus a baseline regenerated in 6 of 7 locales (the #998 shape). The fix follows, so a reviewer can verify the hole existed rather than take it on trust.

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 git diff --name-only lists deletions and a deleted frame would still have counted as regenerated. The shipped rule classifies by existence at HEAD versus merge-base and counts a frame as regenerated only when it is present at HEAD and in the non-deletion diff; stale ones are listed, deleted ones marked as such.

Both directions are tested, red-first:

  • Dishonest: cross-slot (snapshot and capture), partial-locale, all-frames-deleted, partial deletion → FAIL, naming the slot and the exact missing paths.
  • Honest: a retired slot (mapping row removed, baseline changed, frames deleted) → PASS, so the gate cannot block legitimate removal. That was the PM condition: a strict gate that blocks honest work is how escape hatches get added and the check dies.
  • The failure message names both resolutions — regenerate, or use the documented escape when regeneration is genuinely byte-identical.

Verified: harness 13/13 on the new gate, 7 pass / 6 fail on origin/main's gate; back-tests against #1111, #1104 and #1106 all PASS, so no false positives on real history; shellcheck clean; CI 7/7.

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.

@wei18
wei18 merged commit 4461a6d into main Oct 28, 2026
7 checks passed
@wei18
wei18 deleted the session/frame-drift-gate-1112 branch October 28, 2026 13:49
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.

test(ci): store frame-drift gate is silenced by any ascspec change, not checked per slot

1 participant