Skip to content

refactor(test-support): extract shared ASC-screenshot render into GameTestSupportKit - #784

Merged
wei18 merged 1 commit into
mainfrom
worktree-impl-750
Jul 12, 2026
Merged

wei18 merged 1 commit into
mainfrom
worktree-impl-750

Conversation

@wei18

@wei18 wei18 commented Jul 12, 2026

Copy link
Copy Markdown
Owner

What

Extracts the ASC-screenshot render machinery (ASCProfile / ASCScreenshotEmit / emitASCScreenshot / ascScreenshotsRoot) — previously duplicated and already drifting across SudokuUITests and MinesweeperUITests — into a new zero-dependency leaf package Packages/GameTestSupportKit (TimeKit/DeterminismKit shape), consumed ONLY by the two UI-test targets. Both old copies deleted outright; the one genuinely per-app piece (each target's hostingView theme injection) stays put and is passed in via a new host: closure parameter.

  • Production-leak proof at three layers: test-target-only wiring in both Package.swift files, zero references in Project.swift, zero references in the generated pbxproj after tuist generate
  • ascScreenshotsRoot's #filePath walk-up is location-independent — proven empirically: post-move ASC_EMIT_SCREENSHOTS=1 emit wrote a byte-identical PNG (zero git diff) at the identical path
  • CLAUDE.md architecture block gains the test-support line so the kit inventory stays drift-free

Verification

  • GameTestSupportKit 3/3 · MinesweeperKit full suite 240/240 (--no-parallel) · SudokuKit builds clean, ASCScreenshotEmitTests 9/9 env-gated, BoardViewTests 18/18 · swiftlint --strict 0 violations · tuist generate clean
  • Run independently four times: Developer, Leader, and both reviewers (the fact-check pass re-ran every claim live, including a clean-rebuild warning check)
  • Dual code review APPROVE

Closes #750

🤖 Generated with Claude Code

…eTestSupportKit

The ASC-screenshot render machinery (ASCProfile, ASCScreenshotEmit,
emitASCScreenshot, ascScreenshotsRoot) was duplicated across
SudokuUITests and MinesweeperUITests and had already started drifting
(divergent headers/doc-comments) — the exact failure mode the mirror
principle predicts (#750, found by the #713 upkeep round).

One shared implementation now lives in a new leaf package
Packages/GameTestSupportKit (shaped like TimeKit/DeterminismKit: one
library target, zero dependencies — the render code needs only
Foundation/AppKit/SwiftUI, so it does not belong in GameAppKit's
Persistence/GameCenter-heavy graph). It is referenced ONLY from the two
UI-test targets' dependency arrays, never a production target, so it
cannot leak into shipped binaries. Tuist needs no Project.swift change
(transitive package discovery; tuist generate verified).

Per-app seam: emitASCScreenshot gained a host: closure parameter — each
test target passes its own hostingView (theme/size-class injection),
which was the only genuinely per-app piece; the @testable imports in the
old copies were vestigial (nothing app-specific in the machinery). Both
old copies are deleted outright, no shim files. ASCProfile is now
explicitly Sendable (public cross-module type under strict concurrency).

ascScreenshotsRoot's #filePath-walk is location-independent (it walks up
to the unique docs/app-store/screenshots root); proven empirically, not
just argued: ASC_EMIT_SCREENSHOTS=1 emit of sudoku/iphone-6.9/en/01-home
after the move wrote a byte-identical PNG (zero git diff) at the
identical path, 1290x2796 no-alpha as before.

Also lists the new kit in CLAUDE.md's architecture block (test-support
line) so the inventory stays drift-free for the upkeep audit.

Verification: GameTestSupportKit 3/3; MinesweeperKit full suite 240/240
(--no-parallel); SudokuKit builds clean, ASCScreenshotEmitTests 9/9
(env-gate intact), BoardViewTests 18/18; swiftlint --strict 0
violations; tuist generate succeeds. Run by the Developer and re-run
independently by the Leader.

Closes #750

Co-Authored-By: Claude Fable 5 <[email protected]>
@wei18
wei18 enabled auto-merge (squash) July 12, 2026 13:16
@wei18
wei18 merged commit 2185bf8 into main Jul 12, 2026
4 checks passed
@wei18
wei18 deleted the worktree-impl-750 branch July 12, 2026 13: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.

extract shared ASC-screenshot render test-support target (dedupe SudokuUITests/MinesweeperUITests copies)

1 participant