Skip to content

feat(minesweeper): wire liveadmobadprovider + boardview banner + toast overlay (u15) - #263

Merged
wei18 merged 2 commits into
mainfrom
feat/ms-admob-wire-u15
Jun 3, 2026
Merged

wei18 merged 2 commits into
mainfrom
feat/ms-admob-wire-u15

Conversation

@wei18

@wei18 wei18 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Closes U15 — Minesweeper monetization mirror complete modulo production-ID swap (deferred to v1 release per Sudoku precedent).

What landed

  • `MinesweeperAppComposition.live()` wires LiveAdMobAdProvider on iOS (DEBUG = test banner, Release = `fatalError("REPLACE_IN_MS_V1:...")` gate per Sudoku safety pattern) / NoopAdProvider on macOS
  • `LiveRouteFactory` threads adProvider + adGate to MinesweeperBoardView
  • `MinesweeperBoardView` mounts new `MinesweeperBannerSlotView` below grid (suppressed on .won/.lost)
  • `MinesweeperRoot` attaches `.toastOverlay` — closes part of feat(minesweeper): attach toastOverlay to MinesweeperRoot for monetization purchase feedback #260
  • `Minesweeper/Info.plist` gets `GADApplicationIdentifier` (Google universal test App ID, mirrors Sudoku convention) + `NSUserTrackingUsageDescription`

CR ACCEPT (round 2 inline)

Round 1 NEEDS_WORK on 2 critical:

  • C1 production App ID in plist → Leader pre-fixed to test ID (CR saw stale state)
  • C2 Release hardcoded banner unit ID → applied Sudoku's `fatalError` gate inline

Stale docstrings updated. Remaining Important findings accepted as Karpathy-minimal (preview path rationale).

AdMob SDK isolation

```
$ rg '^.*import GoogleMobileAds' Packages/
Packages/AppMonetizationKit/Sources/AdsAdMob/LiveAdMobBridge.swift:internal import GoogleMobileAds
```
Exactly 1 hit ✓

Test plan

  • 30/30 MS tests pass (+ `liveAdProviderIsLiveOnIOSNoopOnMac`)
  • SudokuKit byte-identical (209 tests + zero file diffs in Sudoku/SudokuKit/AppMonetizationKit)
  • swift build both packages clean
  • User: smoke test in Xcode iOS simulator (banner placeholder visible mid-game, hidden on win/lose)

Refs

wei18 and others added 2 commits June 3, 2026 13:38
…t overlay (U15)

Closes the MS monetization mirror loop. With #259 wiring the
composition stack and this PR wiring the AdMob bridge + banner UI +
toast surface, MS now has full monetization parity with Sudoku
modulo the production-ID swap (gated to v1 release per Sudoku
precedent).

Code:
- `MinesweeperAppComposition.live()`:
  * #if os(iOS): LiveAdMobAdProvider(bannerAdUnitID:) wired
    - DEBUG: Google universal test banner unit
    - RELEASE: fatalError("REPLACE_IN_MS_V1: ...") gate, mirrors
      Sudoku's REPLACE_IN_v2.5.3 safety pattern (production
      Release builds crash at composition root until the real
      banner unit id is explicitly wired per v1 release checklist)
  * #if os(macOS): NoopAdProvider unchanged (AdMob SDK iOS-only)
- LiveRouteFactory threads adProvider + adGate through to
  MinesweeperBoardView (suppressed on .won / .lost terminal states)
- MinesweeperBoardView mounts new MinesweeperBannerSlotView below
  the grid (mirror of Sudoku's BannerSlotView placement)
- MinesweeperRoot.init takes toastController; body attaches
  .toastOverlay(controller: toastController, successTint:, failureTint:)
- MinesweeperAppComposition.rootView passes toastController through
- MinesweeperBannerSlotView (NEW): mirrors Sudoku's BannerSlotView
  using AdProvider protocol (no GoogleMobileAds direct import).
  Sudoku's slot couples to SudokuUI theme env so a clean shared
  extraction is deferred to a future MonetizationUI consolidation
  (impl-notes D1).

Info.plist:
- `GADApplicationIdentifier` = Google universal test App ID
  `ca-app-pub-3940256099942544~1458002511` (mirrors Sudoku
  convention — defer production App ID swap to v1 release per
  project memory `admob-production-ids` / `minesweeper-admob-ids`)
- `NSUserTrackingUsageDescription` added (ATT prompt copy)

AdMob SDK isolation audit: `rg '^.*import GoogleMobileAds' Packages/`
returns exactly 1 hit (LiveAdMobBridge.swift). Contract preserved
per skill `admob-isolation-audit`.

Sudoku byte-identicality: zero changes under Sudoku/ or SudokuKit/
or AppMonetizationKit/. All 10 edits scoped to Minesweeper/ +
MinesweeperKit/ + meetings/.

Tests:
- MinesweeperKit: 30/30 pass (incl. new
  liveAdProviderIsLiveOnIOSNoopOnMac)
- SudokuKit: 209 root + board tests unchanged green

Code Reviewer round 1 verdict NEEDS_WORK on 2 critical:
- C1 Info.plist production App ID (Leader pre-fixed to test App ID
  before CR; CR saw stale state). Verified test ID now in plist.
- C2 Live.swift hardcoded production banner unit ID (Release
  builds would silently serve real creatives). Applied Sudoku's
  fatalError gate inline; Release build now crashes until v1
  release checklist wires the real id.

Cosmetic stale docstrings updated inline. Remaining CR Important
findings (optional adProvider/adGate/toastController in
LiveRouteFactory + MinesweeperRoot) accepted as Karpathy-minimal
since the #Preview path is the sole rationale.

Follow-up backlog items already filed:
- #260 toast overlay (this PR addresses it for MS Root)
- #261 FakePersistence for MS Preview
- #262 hardened MS productId test

Refs:
- meetings/2026-06-02_minesweeper-monetization-wire-proposal.md (full proposal)
- meetings/2026-06-03_ms-admob-wire-u15.impl-notes.md (this round's notes)
- project memory `minesweeper-admob-ids` (production IDs, held until ship)
- closes MS monetization mirror loop modulo production-ID swap

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@wei18
wei18 merged commit f6dde06 into main Jun 3, 2026
3 checks passed
@wei18
wei18 deleted the feat/ms-admob-wire-u15 branch June 3, 2026 05:52
wei18 added a commit that referenced this pull request Jun 3, 2026
PR #263's Info.plist comment block hardcoded the MS production App ID
as a string literal inside the explanatory comment. Even though the
actual GADApplicationIdentifier value uses Google's universal test ID,
the production ID leaked into git history via the comment.

Violates project-memory convention (`minesweeper-admob-ids`) of
holding production AdMob IDs OUT of the public repo until v1 ships —
Sudoku Info.plist's comment makes no reference to its own production
id.

Scrubbed; comment now just points readers at the memory file by name.
No behavior change — Info.plist value field unchanged.

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

PR #263's Info.plist comment block hardcoded the MS production App ID
as a string literal inside the explanatory comment. Even though the
actual GADApplicationIdentifier value uses Google's universal test ID,
the production ID leaked into git history via the comment.

Violates project-memory convention (`minesweeper-admob-ids`) of
holding production AdMob IDs OUT of the public repo until v1 ships —
Sudoku Info.plist's comment makes no reference to its own production
id.

Scrubbed; comment now just points readers at the memory file by name.
No behavior change — Info.plist value field unchanged.

Co-authored-by: Claude Opus 4.7 <[email protected]>
wei18 added a commit that referenced this pull request Jun 3, 2026
…et injection

Captures 5 PRs merged today (#256 grace inversion / #257 .minesweeper CK
config / #258 multi-app IAP / #259 MS AppComposition wire / #263 U15
LiveAdMobAdProvider + banner + toast / #264 prod-ID comment scrub /
#265 AdMob secret injection PR1) plus 5 issues filed for follow-up
(#260 #261 #262 #266 #267).

Records decisions, rejected alternatives, Architect review hand-off,
and the spec inversion (7-day grace removed). Notes Iron Law violation
on skill writing + remediation via post-hoc CR.

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

The toastOverlay wire described by #260 already landed in PR #263 (U15):
`composition.rootView` constructs `MinesweeperRoot(routeFactory:, toastController:)`
and the Root attaches `.toastOverlay(...)`. Two comments still said the wire
was "pending U15" / "U15 follow-up" — corrected to reflect the shipped state.

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