Skip to content

feat(asc-register): CLI to bootstrap Game Center via ASC API - #2

Merged
wei18 merged 1 commit into
mainfrom
feat/asc-register
May 19, 2026
Merged

wei18 merged 1 commit into
mainfrom
feat/asc-register

Conversation

@wei18

@wei18 wei18 commented May 19, 2026

Copy link
Copy Markdown
Owner

Summary

Phase 10 helper: a SwiftPM executable that registers the 3 daily leaderboards + 8 achievements in App Store Connect via the ASC API.

  • swift run ASCRegister validate — parse xcstrings + config, no network
  • swift run ASCRegister plan — dry-run, prints every body that would POST/PATCH
  • swift run ASCRegister apply — execute against ASC (env: ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY_PATH, ASC_APP_ID)

Implementation

  • JWT.swift — ES256 P256 signer via CryptoKit (no external deps)
  • ASCClient.swift + ASCClient+Achievements.swift — actor URLSession client (split for swiftlint type_body_length budget)
  • Config.swift — 3 leaderboards + 8 achievements matching design.md §How.3.1 / §How.3.2 (points sum = 550)
  • XCStringsParser.swift — gc.* key extraction from App/Resources/Localizable.xcstrings
  • Reconciler.swift — idempotent GET-first orchestrator (create / update / unchanged)
  • main.swift — validate / plan / apply entry points

L10n source: gc.* xcstrings fragment proposed in Sources/ASCRegister/Strings/gc-strings.xcstrings.patch as a side file. Production Localizable.xcstrings not touched — Leader merges per ai-translated-localization skill, then re-runs translation for ja / zh-Hans / es / th / ko.

Tests

16 new (full suite 319 → 335, 0 regression):

  • JWT ES256 sign/verify roundtrip + invalid PEM throws
  • Config consistency: 3 LB + 8 achievement ids strict-equal; prefix matches GameCenterSink.achievementPrefix; points sum == 550; 2h score cap
  • XCStringsParser: gc.* filtering, <TRANSLATE> drop, invalid JSON throws
  • Reconciler: empty / full / partial remote, locale coverage, phase ordering

Verified prerequisites

  • Zero external deps: Foundation + CryptoKit only (FoundationNetworking guard for Linux throws unsupportedOnLinux)
  • Swift 6 strict + complete concurrency + InternalImportsByDefault + ExistentialAny: clean
  • All 4 build layers pass: swift build, swift test, tuist generate, xcodebuild iOS scheme

Open items (resolved on first real plan run)

5 // UNCONFIRMED: markers inline for ASC API shape details that need a real GET response to lock:

  1. scoreFormatType enum value for mm:ss.SSS
  2. recurrenceRule nesting shape
  3. getGameCenterDetail endpoint exact path
  4. listLeaderboards relationship path
  5. createLeaderboard body field names

These surface as 4xx responses in plan mode without risk of mis-creating resources.

Not in this PR

  • Achievement icon upload (icons not yet authored — placeholder will be obvious in ASC)
  • Production xcstrings merge of the gc.* keys (deferred until Leader reviews the side-file)
  • ja / zh-Hans / es / th / ko translations of gc.* keys (follow-up AI translation pass)
  • Resolving the 12 pre-existing public import warnings (separate PR per Leader plan)
  • Auto-managed signing + DEVELOPMENT_TEAM secret (separate PR per Leader plan)

File-level swiftlint disables

JSON-construction code uses short locals (s, t, lb, k, l, v, i) per local idiom. Per-file // swiftlint:disable <rule> annotations name the suppressed rules explicitly so reviewers see the scope. Each is removable when someone wants to take a rename pass.

🤖 Generated with Claude Code

New SwiftPM executable target ASCRegister + ASCRegisterTests for Phase 10
bootstrap of 3 daily leaderboards + 8 achievements in App Store Connect.

Commands:
- swift run ASCRegister validate — parse xcstrings + config, no network
- swift run ASCRegister plan     — dry-run; prints what would POST/PATCH
- swift run ASCRegister apply    — calls ASC API

Env vars: ASC_KEY_ID, ASC_ISSUER_ID, ASC_PRIVATE_KEY_PATH, ASC_APP_ID

Implementation:
- JWT.swift: ES256 P256 signer via CryptoKit, no external deps
- ASCClient.swift + ASCClient+Achievements.swift: actor URLSession client
- Config.swift: 3 leaderboards + 8 achievements (points sum = 550)
- XCStringsParser.swift: gc.* key extraction from Localizable.xcstrings
- Reconciler.swift: idempotent GET-first orchestrator (create/update/unchanged)
- main.swift: validate/plan/apply CLI
- Strings/gc-strings.xcstrings.patch: side-file with en + zh-Hant seed for
  the ~27 gc.* keys (other 5 locales <TRANSLATE> placeholder for follow-up
  AI translation pass per ai-translated-localization skill)

Tests (16, all green; full suite 335/335):
- JWT ES256 sign/verify
- Config consistency: 3 LB + 8 achievement ids strict-equal,
  prefix matches GameCenterSink, points sum == 550
- XCStringsParser: gc.* filtering, <TRANSLATE> drop, invalid JSON throws
- Reconciler: empty/full/partial remote, locale coverage, phase ordering

Zero external deps: Foundation + CryptoKit. 0 build warnings.

5 UNCONFIRMED ASC API shape items marked inline; resolve on first real
plan run against the ASC tenant.

File-level swiftlint disables added for JSON-construction code where
short locals (s, t, lb, k, l, v, i) are legitimate per local idiom.
Each disable annotation names the specific rules suppressed; can be
removed later if a refactor pass renames the identifiers.
@wei18
wei18 merged commit b60b901 into main May 19, 2026
@wei18
wei18 deleted the feat/asc-register branch May 19, 2026 16:52
wei18 added a commit that referenced this pull request May 21, 2026
Phase v2.1 complete. LiveStoreKit2IAPClient + StoreKitBridge seam +
Purchase flow + Restore + Transaction observer. 22 new tests, 57 total.

- LiveStoreKit2IAPClient (113 lines, public actor): availableProducts,
  purchase, restorePurchases, purchaseUpdates AsyncStream
- StoreKitBridge protocol seam (lifted from v2.1.2 → v2.1.1 because
  StoreKit.Product has no public init; testing requires the bridge)
- LiveStoreKitBridge adapter — only file importing StoreKit
- IAPProductMapper pure function (independently testable)
- IAPProductIDs.removeAds = com.wei18.sudoku.iap.remove_ads
- FakeStoreKitBridge with scripting + counters

v2.0 inherited §未決 #2 (recordRefund()) RESOLVED at v2.1's scope:
purchaseUpdates() correctly emits .revoked from Transaction.updates
events with non-nil revocationDate. AdGate wiring still deferred to
v2.3 as planned.

New §未決 (non-blocking):
- Empty products(for:) behavior on ASC catalog drift (returns [], not throws)
- @unknown default on Product.PurchaseResult (silent SDK forward-compat)
- Task.detached priority .background on observer (may want .utility v2.3)

Isolation audit: import StoreKit only in LiveStoreKitBridge.swift
(1 hit, internal import). MonetizationCore StoreKit-free. Package.swift
not modified.

Build clean, 57/57 tests in 10 suites, TODO sweep 0 hits.

impl-notes: meetings/2026-05-21_v2.1-iap-storekit2.impl-notes.md
wei18 added a commit that referenced this pull request May 22, 2026
Fixes #86. PR #76 fixed mise bootstrap; build #2 then hit:
  xcodebuild: error: '/Volumes/workspace/repository/Sudoku.xcworkspace'
  does not exist.

Repo uses Tuist; .xcworkspace is gitignored. Append `tuist install` +
`tuist generate --no-open` after the gitleaks block so the workspace
exists before Xcode Cloud's resolve_package_dependencies step.

bash -n: OK.

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 23, 2026
iOS + macOS Archive warnings from commit 83a5d53:

1. macOS — No App Category → Y
   Info.plist += LSApplicationCategoryType = public.app-category.puzzle-games

2. AppIcon "3 unassigned children" → DEFERRED
   Needs per-platform image sets (iOS universal + macOS multi-size) OR
   migration to Xcode 16 .icon document format. Out of scope for plist
   pass; filed as §未決 (see impl-notes).

3. iOS — All interface orientations required → Y
   Info.plist += UISupportedInterfaceOrientations~ipad: 4 orientations
   (Portrait, PortraitUpsideDown, LandscapeLeft, LandscapeRight). iPhone
   key unchanged (no upside-down per HIG).

4. AdPresentationAnchorRegistry public import Foundation unused → Y
   public import → internal import (no public decl uses Foundation types)

Verification:
- AppMonetizationKit swift test: 97/97 pass
- iOS BUILD project-owned warnings: 18 → ~1 (only #2 remains;
  upstream GoogleMobileAds umbrella warnings unchanged)
- macOS BUILD project-owned warnings: 7 → ~1

Project.swift NOT touched — repo uses `infoPlist: .file(...)` so the
.plist file is the source-of-truth, not a Tuist-generated dict.

§未決: AppIcon multi-platform structure (Xcode 16 .icon format
candidate); recommend design-team task.

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request May 26, 2026
… 3 jobs (#159)

* ci(github-actions): consolidate 3 workflows into single lint.yml with 3 jobs

Per user request 2026-05-26:
- Merge pr-metadata.yml + docs-link-check.yml + lint.yml → single
  lint.yml with 3 sibling jobs (pr-metadata / docs-link-check /
  swift-lint). Simpler required-status-check setup when branch
  protection lands (one workflow name, three job names).

Key changes vs prior 3-file setup:
- pr-metadata job: ubuntu-latest (was already; no change)
- docs-link-check job: ubuntu-latest; gh api fetches changed
  markdown files (per user: drop fetch-depth: 0)
- swift-lint job: macos-latest (toolchain requirement);
  gh api replaces `git diff --diff-filter` (per user: drop
  fetch-depth: 0); strict swiftlint + hard-fail swiftformat
  preserved

All 3 jobs now use `gh api repos/.../pulls/<num>/files` to enumerate
changed files instead of `git diff` against the base ref. Benefits:
- Faster checkout (no full history)
- Smaller runner workspace
- Single canonical source of changed-file list (the PR API)
- No risk of merge-base resolution edge cases

Workflow-level path filter removed so the consolidated workflow always
runs; per-job logic decides what to do based on changed-files list
(empty → skip with explanatory log line).

Closes user 2026-05-26 requests:
- #2 pr-metadata: linux + drop fetch-depth + use gh api ✓
- #3 consolidate to single lint.yml with 3 jobs ✓
- #1 docs-link-check failure (apple.com 403?): NOT addressed in this PR
  — will need .lycheeignore follow-up after first run shows actual
  failing URLs

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* ci+chore: remove swiftformat entirely + swift-lint job → ubuntu (user 2026-05-26)

Per user decision 2026-05-26:
- swiftlint coverage sufficient; swiftformat is redundant + double-tool
  maintenance cost not justified
- swift-lint job runner: macos-latest → ubuntu-latest (swiftlint has linux
  x86_64 binary via mise; no Swift toolchain needed for lint-only)

### Removed
- `.swiftformat` (config file, deleted)
- `.mise.toml` swiftformat pin
- `lefthook.yml` swiftformat hook
- `.github/workflows/lint.yml` SwiftFormat lint step
- `docs/foundations.md §7.5.1` option-b doc (strikethrough + obsolete note;
  historical impl-notes preserved at meetings/2026-05-26_swiftformat-option-b.impl-notes.md)
- `docs/foundations.md §Backlog` "swiftformat 加入 lefthook" entry
  (strikethrough + CANCELLED tag)

### Updated foundations §4 Phase 1 GH Actions description
- Reflects consolidated lint.yml (3 jobs in one workflow)
- Reflects swift-lint on ubuntu + swiftformat removal
- Cross-refs issues #156 #157 #158 for Phase 2/3 follow-ups

Co-Authored-By: Claude Opus 4.7 <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…ings (ms phase 3) (#259)

Closes Phase 3 of MS monetization wire (per
meetings/2026-06-02_minesweeper-monetization-wire-proposal.md). MS
app now has full monetization composition modulo banner UI (deferred
to U15 follow-up). Mirrors Sudoku's wire shape per
feedback/minesweeper-mirrors-sudoku.

Code:
- MinesweeperAppComposition bag extended with persistence / iapClient /
  adProvider / adGate / monetizationStateStore / monetizationController /
  toastController
- Live.swift `.live()` wires:
    * LivePersistence(ckConfig: .minesweeper)
    * LiveStoreKit2IAPClient(knownProductIds: [minesweeperRemoveAdsProductId])
    * NoopAdProvider  (LiveAdMobBridge deferred to U15)
    * AdGate + MonetizationStateController(productId: ..., ...)
    * ToastController
- `.preview()` mirrors with MonetizationTesting fakes (matches Sudoku
  precedent of linking MonetizationTesting into production target)
- LiveRouteFactory threads monetizationController to the Settings route
- SettingsView mounts Section("Purchases") with shared MonetizationUI
  rows (RemoveAdsRow / RestorePurchasesRow / AdsRemovedRow)
- minesweeperRemoveAdsProductId published at module level for parity
  with removeAdsProductId in MonetizationUI

MonetizationStateController parameterization (CR-recommended option a):
- Added `productId: String = removeAdsProductId` default param
- 4 internal direct-ref to constant swapped to self.productId
- All 4 Sudoku test sites + Sudoku Live.swift + Preview.swift compile
  byte-identically (no arg = picks up defaulted Sudoku constant)
- Docstring updated to reflect MS Phase 3 landing

Tests:
- MinesweeperKit: 30/30 pass (+ extended AppCompositionTests + new
  MinesweeperSettingsViewTests)
- SudokuKit: 209/209 pass — Sudoku byte-identicality verified by CR

CR ACCEPT (round 1). Cosmetic C3 (docstring tense) applied inline.
Open follow-ups deferred to backlog:
- Toast overlay on MinesweeperRoot (CR Important #1 — defer per CR
  recommendation; MS has no live monetization surface until U15)
- FakePersistence target for MS Preview (CR Important #2)
- Hardened MS productId test (CR Important #3)

Refs:
- meetings/2026-06-02_minesweeper-monetization-wire-proposal.md §Phase 3
- meetings/2026-06-03_ms-monetization-phase3.impl-notes.md
- prereqs: #257 (.minesweeper config), #258 (multi-app iap config)
- closes mirror-monetization-loop (modulo banner U15)

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
Skill CR (2026-06-03) found:
- description: starts 'Default pattern…' not 'Use when…' (CSO rule)
- Cross-ref to architect review file (missing — landed separately 8f8af17)
- Multi-app CI_PRODUCT dispatch absent
- Smoke-test scope ambiguity (source plist passes against literal $())
- No 'as!' anti-pattern warning
- No Project.swift wiring example
- No non-Tuist carve-out
- No Iron Law disclosure
- Migration playbook simplified without disclosure
- Anti-pattern 2 vs Migration step 3 internal conflict (fatalError)
- Outer .gitignore Tuist/*.xcconfig rule not explicit
- Rationalization counters thin

Full rewrite:
1. description leads with 'Use when…' + adds GADApplicationIdentifier /
   GADBannerUnitID / .p8 search keywords (~ 500 chars, under ceiling)
2. New 'Known testing gap' section discloses Iron Law violation
3. New 'Smoke test scope' section with ❌/✅ example showing source-plist
   trap + runtime-guard fix
4. New 'Multi-app dispatch' section with concrete CI_PRODUCT case-switch
   bash snippet
5. New 'Non-Tuist projects' carve-out
6. New 'Project.swift wiring' concrete snippet
7. New 'Verification checklist' (parallels apple-public-repo-security)
8. New 'Rationalizations table' with 6 explicit counters (memo + comment +
   private repo + small-app + 1-time + fatalError-grace)
9. Anti-pattern `as!` force-cast added (#5)
10. Anti-pattern Tuist clobbering unmanaged xcconfigs added (#8)
11. Anti-pattern #2 'fatalError forbidden long-term, allowed as transitional
    during xcconfig migration cycle' — resolves internal conflict with
    Migration step 3
12. Migration playbook disclosed as PR1's compressed reality, not
    Architect's 7-stage plan; cross-references architect review file
13. Cross-refs labelled REQUIRED / SIBLING

CR's Critical #1 (broken architect-review cross-reference) addressed
via 8f8af17 landing the file separately.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
Round 2 inline fixes from PR #265 CR (verdict: ACCEPT with cosmetics):

1. `.gitignore` `secrets/*` → `secrets/**` — covers subdirectory contents
   (e.g. a future `secrets/p8/` or `secrets/keys/`); current `*` form
   only matches top-level files.

2. `secrets/README.md` created — the .gitignore allowlist
   `!secrets/README.md` was forward-looking to a missing file; the
   README now exists with one-time setup + daily-use instructions
   pointing at memory `asc-api-credentials`.

3. Collapsed duplicate comment paragraphs in both Live.swift files
   (subagent had paste-stacked two adjacent explanations of the same
   substitution chain). Now a single tight paragraph mentioning
   smoke-test (`InfoPlistAdMobKeysTests`) + runtime guard role.

CR Important #1 (pre-existing prod-ID leaks in docs/ and meetings/) +
Important #2 (`AppInfo.plist` drift risk) deferred to follow-up backlog
issues — file separately.

Build: clean on both packages.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…#265)

* feat(secrets): xcconfig + Info.plist substitution for AdMob ids (PR1)

Migrates Sudoku + Minesweeper AdMob configuration from
hardcoded-with-fatalError-gate to build-time xcconfig substitution.

Mechanism (mirrors existing Tuist/Signing.xcconfig precedent):
- Tuist/AdMob.xcconfig (gitignored) — local real values
- Tuist/AdMob.xcconfig.example (committed) — Google sandbox + docstring
  explaining both XCC env var source + local fill flow
- Tuist/Config-{Debug,Release}.xcconfig wrappers — #include? both
  Signing + AdMob (optional include keeps fresh clone buildable)
- Project.swift per-target xcconfig wiring (Sudoku + Minesweeper)
- Both Info.plist files use $(ADMOB_APP_ID) + $(ADMOB_BANNER_UNIT_ID)
  substitution (latter is a custom key we invented for app-side reads)
- Live.swift both apps: removed #if DEBUG / #else fatalError gate;
  reads GADBannerUnitID via Bundle.main.object(forInfoDictionaryKey:)
  through a guard that catches missing/empty/unresolved tokens
- ci_post_clone.sh: appended AdMob.xcconfig generation step that
  selects per-workflow env vars from $CI_PRODUCT / $CI_XCODE_SCHEME
  (fail-loud if missing)

Safety net (3 layers):
1. Smoke tests (InfoPlistAdMobKeysTests.swift) verify both keys exist
   in each app's source Info.plist — catches accidental key deletion
2. Runtime guard in both Live.swift — preconditionFailure on missing,
   empty, or literal $() token. Catches unresolved substitution at
   app launch before AdMob SDK rejects.
3. Subsequent PRs will add a build-phase substitution-resolution check
   to catch earlier than runtime

Tooling secrets (ASCRegister CLI, scope: scaffolding only):
- secrets/.env.example (committed) — KEY=VALUE structure + docstring
- secrets/ gitignore deny-by-default: * + !*.example + !README.md
- secrets/ASCAPI_AuthKey_*.p8 — user moves cert here post-merge
- ASCRegister CLI unchanged; user pattern: source secrets/.env
  before invoking, then pass via existing flags

Sudoku byte-identicality:
- DEBUG: literal banner-unit value unchanged (sandbox both before + after)
- Release: behavior changed from fatalError crash → preconditionFailure
  crash + smoke test pre-archive. Equivalent fail-loud safety.

AdMob SDK isolation audit: still exactly 1 import GoogleMobileAds
(LiveAdMobBridge.swift).

Tests:
- SudokuKit: 211/211 (existing 209 + 2 new smoke)
- MinesweeperKit: 33/33 (existing 31 + 2 new smoke)

Out of scope (subsequent PRs):
- Build-phase substitution-resolution check (Open Q1)
- gitleaks rule for prod AdMob IDs
- ADR / foundations.md update
- Removing precondition guard after one full prod release cycle

User-side post-merge (one-time):
1. cp Tuist/AdMob.xcconfig.example Tuist/AdMob.xcconfig + fill real
   values from project memory admob-production-ids +
   minesweeper-admob-ids
2. mv ~/GitHub/ASCAPI_AuthKey_*.p8 secrets/
3. ASC → Xcode Cloud → Workflow → Environment Variables: add
   SUDOKU_ADMOB_APP_ID / _BANNER_UNIT_ID +
   MINESWEEPER_ADMOB_APP_ID / _BANNER_UNIT_ID (mark Secret)

Refs:
- meetings/2026-06-03_admob-secret-injection-architect-review.md
- meetings/2026-06-03_admob-secret-injection-pr1.impl-notes.md
- .claude/skills/build-time-secret-injection/ (new project skill)

Co-Authored-By: Claude Opus 4.7 <[email protected]>

* fix(secrets): apply PR1 CR cosmetic findings

Round 2 inline fixes from PR #265 CR (verdict: ACCEPT with cosmetics):

1. `.gitignore` `secrets/*` → `secrets/**` — covers subdirectory contents
   (e.g. a future `secrets/p8/` or `secrets/keys/`); current `*` form
   only matches top-level files.

2. `secrets/README.md` created — the .gitignore allowlist
   `!secrets/README.md` was forward-looking to a missing file; the
   README now exists with one-time setup + daily-use instructions
   pointing at memory `asc-api-credentials`.

3. Collapsed duplicate comment paragraphs in both Live.swift files
   (subagent had paste-stacked two adjacent explanations of the same
   substitution chain). Now a single tight paragraph mentioning
   smoke-test (`InfoPlistAdMobKeysTests`) + runtime guard role.

CR Important #1 (pre-existing prod-ID leaks in docs/ and meetings/) +
Important #2 (`AppInfo.plist` drift risk) deferred to follow-up backlog
issues — file separately.

Build: clean on both packages.

Co-Authored-By: Claude Opus 4.7 <[email protected]>

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
Per issue #267 (PR #265 CR Important #2), document option (c): accept the
verbatim-copy drift risk in InfoPlistAdMobKeysTests since the test only
guards the two AdMob keys (not plausibly deleted by accident). Escalate to
a byte-for-byte sync sentinel only on a real drift incident.

Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…0) (#282)

* fix(minesweeper): scale board + add reveal/flag mode toggle (refs #278)

Tier-0 UX blockers from the Designer critique (#278), all in
MinesweeperBoardView. Three coupled fixes, one dispatch:

#1 Board scaling. The cell button was hardcoded frame(30,30) inside a
naked VStack/HStack with no GeometryReader, so Expert (16x30 ~ 960pt)
overflowed every iPhone and most Mac windows. The grid is now wrapped in
a GeometryReader that derives a single square cell side fitting the
NON-square board by its longer axis:
  cellSide = floor(min(availW/cols, availH/rows))
where availW/availH subtract the inter-cell spacing first. The cell
frame and the number/flag/mine glyph (font ~ cellSide * 0.55, replacing
the literal 16) both scale from it.

#2 Tap-target floor. minCellSide = 32pt. When the fitted side would drop
below the floor (e.g. Expert on iPhone fits ~10pt), cellSide is clamped
to 32 and the board scrolls (ScrollView([.horizontal,.vertical]))
instead of shrinking into an un-tappable grid. When it fits, the
ScrollView is inert.

#3 Discoverable reveal/flag toggle. Added an on-screen segmented Picker
(Reveal / Flag) above the board, modeled on Sudoku's pencil-mode toggle.
In Flag mode a tap flags; in Reveal mode a tap reveals. Long-press (iOS)
and right-click contextMenu (Mac) stay as flag accelerators in either
mode — Mac users no longer depend on an invisible right-click. Mode is
view-local @State (no engine semantics). Added .contentShape(Rectangle)
so the whole cell square is hit-testable.

Deferred: Tier-1 theme tokens, Tier-2 Mac side-rail (#6), win/lose
overlay (#7), VoiceOver (#10), .task loop cleanup (#9) — separate
dispatches.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

* fix(minesweeper): address #278 Tier-0 CR — flag double-toggle + fit centering

CR REQUEST-CHANGES:
- iOS .flag-mode long-press double-toggle: in .flag mode the button tap +
  long-press both fired onToggleFlag, netting a no-op. Long-press now only
  flags in .reveal mode (redundant in .flag mode where tap already flags).
- Fitted board was pinned top-leading; now center the floored grid in the
  offered rect (mirrors Sudoku BoardView), only scrolling when clamped to floor.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
wei18 added a commit that referenced this pull request Jun 16, 2026
…inite spinner online+signed-out (#536) (#537)

* fix(daily-hub): stabilise VM ownership via @State to fix infinite spinner (#536)

`DailyHubView` and `MinesweeperDailyHubView` stored the injected VM via
`@Bindable` (plain property assignment). When SwiftUI's `.navigationDestination`
closure re-invoked `LiveRouteFactory.view(for:)` during an AdMob banner WebView
load, the factory minted a fresh `.idle` DailyHubViewModel. The view's `@Bindable`
var was reassigned to this new instance; because SwiftUI kept the same view
identity, `.task { bootstrap() }` did NOT re-fire — leaving the new VM stuck at
`.idle` forever (infinite spinner). The original bootstrapped VM was orphaned.

Fix: change `@Bindable` → `@State` with `_viewModel = State(wrappedValue:)` in
both views. `@State` first-value-wins semantics mean SwiftUI retains the FIRST
bootstrapped instance for the navigation entry's lifetime; subsequent factory
invocations that mint fresh idle VMs are ignored by SwiftUI's property-wrapper
diffing. No change to VM logic, factory, or navigation wiring.

Adds `DailyHubViewOwnershipTests` pinning the model invariants the fix relies on
(bootstrapped VM keeps .loaded; factory re-mints start .idle; both are distinct
objects). Both packages green: SudokuKit 251/251, MinesweeperKit 179/179.

Co-Authored-By: Claude <[email protected]>

* style(tests): rename vm → viewModel to satisfy identifier_name lint gate

SwiftLint --strict: identifier_name requires ≥ 3 chars; `vm` tripped the
warning in DailyHubViewOwnershipTests. Rename to `viewModel` to match the
convention used throughout the suite. No logic change.

Co-Authored-By: Claude <[email protected]>

* docs(test-plans): Phase 3 v6 — #536 found+fixed, +4 MS/dark/a11y passes

Daily Hub cases #1/#2 flipped pend→pass after the #536 fix (transient
DailyHubViewModel orphaned by destination re-render → infinite spinner
when online + iCloud signed out). Also marks this session's independent
sim verifications: MS Loss Boom overlay, MS dark-mode cell tri-state,
MS per-cell VoiceOver labels. Now 20 pass / 0 fail / 23 pend.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
wei18 added a commit that referenced this pull request Jun 17, 2026
…es filed) (#542)

Records this session's drivable-case sweep on the current sim:
- pass: #5 rapid double-tap Leave, #28 zh-Hant strings (+ earlier #1/#2/#10/
  #18/#25/#39 from #536 work)
- fail: #22 Dynamic-Type header clip (#540), #34 timer accrues background
  time (#539)
- pend w/ findings: #8 (near-win harness can't model home-return),
  #23 (digit-pad frames ≥44pt but glyphs render blank, #540),
  #29 (no tofu, but Purchases section unlocalized, #541)

New issues: #539 (solve timer counts background time — leaderboard fairness),
#540 (Dynamic Type AX3+ header/digit-pad breakage), #541 (Purchases/IAP
section unlocalized; L10n gate misses catalog-less literals).

Co-authored-by: Claude Opus 4.8 <[email protected]>
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.

1 participant