appstore-precheck 1.20.1 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  # Methodology: App Store Precheck
2
2
 
3
- Coverage inventory: 93/102 leaf sections (91%); 93 touched, 2 positive-only; 71 static vectors, 56 deep-review checks, 20 dynamic checks, 5 vision checks, 9 human-only sections.
3
+ Coverage inventory: 94/104 leaf sections (90%); 94 touched, 2 positive-only; 72 static vectors, 56 deep-review checks, 20 dynamic checks, 5 vision checks, 10 human-only sections.
4
4
  Coverage means sections touched, not automatic verification.
5
5
 
6
6
  The detailed reference behind the skill. Read the section you need; you do not need to read this
@@ -153,6 +153,7 @@ citable like any sub-section; every link and citation resolves `N.0` back to `#N
153
153
  | 69 | **4.5.6 metadata-emoji** *(advisory)* | Low-confidence embedded emoji artwork filenames/assets require visual/license review. Metadata emoji characters are permitted; icon pixels remain unaudited. |
154
154
  | 70 | **4.7.2 miniapp-native-bridge** *(advisory)* | All four signals must coexist in one file: handler, remote JS URL, evaluation and native-sensitive API. Does not resolve bridge access control. |
155
155
  | 71 | **5.2.4 apple-endorsement-claims** *(advisory)* | Narrow English endorsement/official-product patterns; authorized claims still require human confirmation. Ordinary iPhone compatibility text stays clean. |
156
+ | 72 | **2.5.19 review-mode-gate** *(advisory)* | Review-detection / hide-for-review identifiers and remote-config keys, App Store build-flag branches, date-gated unlocks, and obfuscation tooling in dependencies or source. Store-review prompts (`SKStoreReviewController`, `requestReview`) and product-review vocabulary stay clean; a hit means "show the reviewer what ships", not proof of a hidden feature. |
156
157
 
157
158
  New source checks skip compiled bundles and pruned dependencies. Unreadable or incomplete
158
159
  inputs produce additive coverage gaps: source/manifest reads are bounded to 2 MiB and
@@ -479,6 +480,7 @@ completeness test (`is_gap_record`, convention: ids ending in `-not-audited`).
479
480
  | 69 | `metadata-emoji` | resource | judgment-call | — |
480
481
  | 70 | `miniapp-native-bridge` | source | judgment-call | — |
481
482
  | 71 | `apple-endorsement-claims` | metadata | judgment-call | — |
483
+ | 72 | `review-mode-gate` | source | judgment-call | — |
482
484
 
483
485
  *Generated from `scripts/evidence.sh`; `tests/test-evidence.sh` keeps it honest.*
484
486
 
@@ -150,10 +150,10 @@ A host with image access must directly inspect the supplied images and cite its
150
150
 
151
151
  ### 1 — 1.2 UGC moderation UI
152
152
 
153
- 1. Establish UGC scope (posts, comments, chat, uploads) from feature and runtime evidence. Mark not applicable only when sufficient evidence excludes UGC.
154
- 2. Search Swift for report/block/flag/moderate flows and screens reachable from content.
155
- 3. Compare to metadata promises ("community", "share", "chat").
156
- 4. Flag if UGC exists but moderation is only mentioned in text, not implemented in UI.
153
+ 1. Establish UGC scope (posts, comments, chat, uploads, and AI content generation — image/video/text generators count as "create, generate" since the October 16, 2026 wording) from feature and runtime evidence. Mark not applicable only when sufficient evidence excludes UGC.
154
+ 2. Search Swift for report/block/flag/moderate flows and screens reachable from content; for generators, also look for prompt/output safety filters and a path to report a generated result.
155
+ 3. Compare to metadata promises ("community", "share", "chat", "AI art", "generate").
156
+ 4. Flag if UGC exists but moderation is only mentioned in text, not implemented in UI. Call out generators with no safeguard against nonconsensual intimate imagery: Apple treats missing safeguards as a Developer Code of Conduct matter.
157
157
 
158
158
  ### 2 — 1.4.1 Health / medical claims
159
159
 
@@ -244,9 +244,14 @@ A host with image access must directly inspect the supplied images and cite its
244
244
  1. Read entitlements and Info.plist for push notifications and HomeKit.
245
245
  2. **Push:** if push entitlement present, scan metadata/UI for spam patterns ("notify every hour",
246
246
  "unlimited reminders") unrelated to user-initiated alerts.
247
- 3. **HomeKit:** if HomeKit framework imported, confirm home-automation UI exists; flag HomeKit
247
+ 3. **Live Activities:** if the scan reports `4.5.3 Live Activities` (ActivityKit import or
248
+ `NSSupportsLiveActivities`), confirm each activity tracks something the user started and is
249
+ time-bound; flag promotional, re-engagement or push-to-start activities that are not tied to a
250
+ user action (4.5.3 names Live Activities alongside push and Game Center as Apple Services that
251
+ may not carry spam or unsolicited messages).
252
+ 4. **HomeKit:** if HomeKit framework imported, confirm home-automation UI exists; flag HomeKit
248
253
  import with no home-related features (possible misuse).
249
- 4. If neither push nor HomeKit signals, mark not applicable.
254
+ 5. If neither push, Live Activities nor HomeKit signals, mark not applicable.
250
255
 
251
256
  ### 16 — 4.8 Sign in with Apple (context)
252
257
 
@@ -437,7 +442,7 @@ actual crashes belong to Phase 6 (the local simulator tier), not to a source rea
437
442
  1. Read metadata, source; record concrete evidence pointers.
438
443
  2. Establish the stated applicability and source scope; if unknown or conflicting, emit `REVIEW-SKIP`.
439
444
  3. Does a creator-content offering mislabel its content or move it outside the described in-app experience?
440
- 4. Do not infer observed behavior or external facts from source symbols alone.
445
+ 4. Do not infer observed behavior or external facts from source symbols alone. AI-generated creator content is still creator content under the October 16, 2026 wording of 1.2; moderation of it belongs to check 1, not here.
441
446
  5. Emit a cited advisory FINDING, bounded NO-SIGNAL, or SKIP; never PASS.
442
447
 
443
448
  ### 39 — 1.4.2 drug-dosage-source *(Tier B)*
@@ -171,7 +171,13 @@ hand with `xcrun simctl` when it drives the selector-based checks.
171
171
  is optional and off by default.)
172
172
  7. Between repeats: `xcrun simctl shutdown <udid>`, `xcrun simctl erase <udid>`, boot, step 2,
173
173
  install again — a fresh erase every time, only on the device this run created.
174
- 8. Teardown, always, at the end of the run: `xcrun simctl shutdown <udid>` then
174
+ 8. Warm the Maestro driver once after D0 and after each erase + boot + install, including
175
+ iPad setup and demo repeats: a discarded `maestro --device <udid> hierarchy` read,
176
+ bounded by `DYN_MAESTRO_WARMUP_TIMEOUT` (default 120 seconds; `0` disables it).
177
+ The transcript records `# NOTE: [dyn-maestro-warmup]`; this is never PASS/FINDING
178
+ evidence. Dry-run lists the warm-up without invoking Maestro. When driving MCP
179
+ checks by hand, do this after installation before the first `inspect_screen`.
180
+ 9. Teardown, always, at the end of the run: `xcrun simctl shutdown <udid>` then
175
181
  `xcrun simctl delete <udid>` — only for the device this tier created.
176
182
 
177
183
  ### D1 — Launch without crash (`dyn-launch`)
@@ -200,7 +206,9 @@ observations are SKIP with their counts. Signals that could not be read are name
200
206
 
201
207
  ### D2 — Core screen reachable (`dyn-first-screen`)
202
208
  Derived from the same repeats: a non-uniform screenshot with the process alive at the end of the
203
- window is a real first screen; a flat frame or a dead process is not. Same quorum. The
209
+ window is a real first screen; a flat frame or a dead process is not. Same quorum.
210
+ If no launch stayed up, D2 is SKIP with `not reached: app did not stay up on any launch`.
211
+ The
204
212
  degenerate-tree caveat applies: judge Flutter/Compose screens by the screenshot, not the tree.
205
213
 
206
214
  ### D3 — Paywall renders (`dyn-paywall-visible`)
@@ -265,7 +273,8 @@ resolve it (see the reconciliation table in `dynamic.sh`).
265
273
 
266
274
  After the last healthy repeat, `dynamic-run.sh` switches `xcrun simctl ui <udid> appearance dark`
267
275
  (D7), then `content_size accessibility-extra-extra-extra-large` (D8), takes a screenshot and one
268
- hierarchy read each, and applies three heuristics
276
+ hierarchy read each (one retry only when the read is `unread`, never for a readable
277
+ but degenerate tree), and applies three heuristics
269
278
  ([`lib/dyn-geometry.sh`](../scripts/lib/dyn-geometry.sh)) over the labelled nodes:
270
279
 
271
280
  - **clipped** — a labelled frame that leaves the screen rectangle;
@@ -349,7 +358,11 @@ bash skills/appstore-precheck/scripts/dynamic-run.sh --app <path>.app --repo /pa
349
358
  ```
350
359
 
351
360
  `tests/local/run-dynamic.sh` chains discovery → confirmation → runner → `dynamic.sh` on macOS; it is
352
- not part of `tests/all.sh`.
361
+ not part of `tests/all.sh`. It forwards `--explore`, `--authorized-navigation FILE`,
362
+ `--demo-login`, `--window`, `--repeats`, `--ipad` and `--pktap` unchanged.
363
+ With explicit `--app` and `--dry-run`, it prints the runner arguments and plan without
364
+ requiring macOS/Xcode or performing discovery, scanning or reconciliation; its argument
365
+ and shim regression tests run in the offline suite.
353
366
 
354
367
  ## Feeding the transcript to dynamic.sh
355
368
 
@@ -391,13 +404,19 @@ partial, a keyless D10 line aims at nothing); `att-usage ↔ dyn-shipped-bundle:
391
404
  `lib/dyn-guidelines.sh` invokes `dyn-guideline-capture.py` once per healthy launch,
392
405
  before demo login, only on a device created and freshly erased by this runner. The
393
406
  collector has a 240-second deadline; individual commands have 10–20-second deadlines.
407
+ Unread hierarchy commands retry once; driver failures remain SKIP if the retry fails.
394
408
  `dyn-guidelines.py` requires at least three distinct fresh observations with identical
395
409
  non-SKIP results. Missing repeats, mixed results, driver errors and degenerate UI
396
410
  semantics remain SKIP. Existing `--udid` and `--dry-run` sessions cannot establish this
397
411
  freshness. `run.json` links the private `guideline_observations` artifact directory.
398
412
 
399
- The CPU check verifies the PID's executable path against the installed bundle before
400
- sleeping or sampling. Host `ps` may report averaged process CPU; this is a performance
413
+ The CPU check resolves `xcrun simctl get_app_container <udid> <bundle-id> app` on
414
+ **every fresh repeat**, then compares `ps -p <pid> -o comm=` with that container's
415
+ executable. The basename must equal `CFBundleExecutable`, and the resolved path must
416
+ stay inside `~/Library/Developer/CoreSimulator/Devices/<udid>/data/`. It never compares
417
+ the running process with the original source `.app` path. An unavailable container
418
+ produces SKIP with `container path unavailable`; identity is checked again before each
419
+ sample. Only a verified process is allowed to reach the idle wait or sampling. Host `ps` may report averaged process CPU; this is a performance
401
420
  review hint, not a battery-use measurement. Missing tools, PID mismatch or incomplete
402
421
  samples remain SKIP. It does not need an accessibility tree.
403
422
 
@@ -112,10 +112,10 @@ An exact-quote mismatch is caught locally before inference. When verification fa
112
112
  retain the original scanner line and evidence pointer, revise the explanation or use
113
113
  a factual template; never modify the scanner finding.
114
114
 
115
- For Phase 4, prepare all 31 checks using `review-catalog.json` stable keys. Add narrow
115
+ For Phase 4, prepare every check in the current `review-catalog.json` (56 in catalog v4) using its stable keys. Add narrow
116
116
  copy, purpose, disclosure, comparison, and routing jobs as evidence becomes available.
117
117
  Keep full Pierre review during the experimental rollout. Supplementary workflow jobs
118
- are a separate shadow-results block, not extra checks in the "31 checks" denominator.
118
+ are a separate shadow-results block, not extra checks in the catalog-check denominator.
119
119
  `action: pierre_review` means
120
120
  the host agent continues the original checklist procedure; the standalone CLI does not
121
121
  launch an agent or bill a second model. Emit the existing advisory `REVIEW-*` report.
@@ -94,7 +94,7 @@ if [[ -n "$APP" ]]; then
94
94
  [[ -f "$APP/Info.plist" ]] || { echo "dynamic-run.sh: $APP has no Info.plist (not an installable bundle)" >&2; exit 66; }
95
95
  fi
96
96
  [[ -n "$REPO" && ! -d "$REPO" ]] && { echo "dynamic-run.sh: --repo is not a directory: $REPO" >&2; exit 66; }
97
- command -v xcrun >/dev/null 2>&1 || { echo "dynamic-run.sh: xcrun not found — this tier needs macOS with Xcode (it is permanently local-only)" >&2; exit 69; }
97
+ [[ "$DYN_DRY_RUN" == 1 ]] || command -v xcrun >/dev/null 2>&1 || { echo "dynamic-run.sh: xcrun not found — this tier needs macOS with Xcode (it is permanently local-only)" >&2; exit 69; }
98
98
  [[ -z "$FRAMEWORK" ]] && { if [[ -n "$REPO" ]]; then FRAMEWORK="$(detect_framework "$REPO")"; else FRAMEWORK=native; fi; }
99
99
  [[ -n "$OUT" ]] || OUT="$(mktemp -d "${TMPDIR:-/tmp}/precheck-dynamic.XXXXXX")"
100
100
  if [[ -n "$REPO" ]]; then
@@ -116,6 +116,10 @@ DYN_OWNED_LEDGER="$OUT/owned-simulators.txt"; : > "$DYN_OWNED_LEDGER"; export DY
116
116
  DYN_EXT_DIR="$(mktemp -d "$OUT/guideline-observations.XXXXXX")" || { echo "dynamic-run.sh: cannot create private observations directory" >&2; exit 66; }
117
117
  TRANSCRIPT="$OUT/transcript.txt"; : > "$TRANSCRIPT"
118
118
  DYN_PLAN_FILE="$OUT/plan.txt"; : > "$DYN_PLAN_FILE"; export DYN_PLAN_FILE
119
+ if [[ "$DYN_DRY_RUN" == 1 ]]; then
120
+ dyn_plan "options: --repeats $REPEATS --window $WINDOW; --explore=$EXPLORE --demo-login=$DEMO --ipad=$IPAD --pktap=$PKTAP"
121
+ [[ -z "$AUTH_NAV" ]] || dyn_plan "--authorized-navigation $(printf '%q' "$AUTH_NAV")"
122
+ fi
119
123
 
120
124
  # --- Transcript helpers -------------------------------------------------------------
121
125
  emit() { printf '%s\n' "$1" | tee -a "$TRANSCRIPT"; }
@@ -190,6 +194,7 @@ if [[ -n "$APP" ]]; then
190
194
  else
191
195
  emit "$(dyn_line PASS setup dyn-install "using user-supplied device $UDID for $BID (not created by this run: never erased, reset or deleted; repeats relaunch without a fresh erase, so they are less deterministic; build config unknown)")"
192
196
  fi
197
+ dyn_maestro_warmup "$UDID"
193
198
  INSTALLED="$(dyn_device_container "$UDID" "$BID")"
194
199
  [[ -n "$INSTALLED" && -d "$INSTALLED" ]] || INSTALLED="$APP"
195
200
 
@@ -231,6 +236,7 @@ else
231
236
  L_SKIP=$((L_SKIP+1)); S_SKIP=$((S_SKIP+1)); i=$((i+1)); continue
232
237
  fi
233
238
  dyn_device_prepare "$UDID"
239
+ dyn_maestro_warmup "$UDID"
234
240
  [[ "$DYN_DRY_RUN" == 1 ]] || FRESH_ERASES=$((FRESH_ERASES+1))
235
241
  fi
236
242
  r="$(dyn_repeat "$UDID" "$BID" "$EXE" "$WINDOW" "$OUT" "$i")"
@@ -251,6 +257,9 @@ else
251
257
  (( FRESH_ERASES == REPEATS && REPEATS >= 3 )) && FRESH_NOTE="fresh erase verified"
252
258
  emit "$(dyn_line "$LAUNCH_KIND" 2.1 dyn-launch "$(cut -f2 <<<"$q"); last repeat: $LAST_DETAIL; window ${WINDOW}s; screenshots $OUT/launch-*.png; $FRESH_NOTE")"
253
259
  q="$(dyn_quorum "$S_PASS" "$S_FIND" "$S_SKIP")"
260
+ if (( L_PASS == 0 )); then
261
+ q="$(printf 'SKIP\tnot reached: app did not stay up on any launch')"
262
+ fi
254
263
  emit "$(dyn_line "$(cut -f1 <<<"$q")" 2.1 dyn-first-screen "$(cut -f2 <<<"$q") (a non-blank screenshot with the process alive after ${WINDOW}s; a splash stuck as a flat frame counts as failed)")"
255
264
  fi
256
265
 
@@ -262,7 +271,7 @@ geometry_pass() { # geometry_pass <rule-id> <guideline> <label> <tag>
262
271
  png="$OUT/$tag.png"; hier="$OUT/$tag.json"
263
272
  [[ "$DYN_DRY_RUN" == 1 ]] || sleep 2
264
273
  dyn_signal_screenshot "$UDID" "$png" >/dev/null
265
- tree="$(dyn_signal_tree "$UDID" "$hier")"
274
+ tree="$(dyn_signal_tree_retry "$UDID" "$hier")"
266
275
  if [[ "$DYN_DRY_RUN" == 1 ]]; then emit "$(dyn_line SKIP "$g" "$id" "dry run: $label not observed")"; return 0; fi
267
276
  [[ "$tree" == unread ]] && { emit "$(dyn_line SKIP "$g" "$id" "$label: accessibility tree could not be read (Maestro missing or timed out); screenshot $png for a human eye")"; return 0; }
268
277
  emit "$(dyn_geometry_line "$(dyn_geometry_report "$hier" 0 0)" "$g" "$id" "$label" "$png")"
@@ -293,6 +302,7 @@ if (( IPAD )); then
293
302
  else
294
303
  dyn_device_boot "$CREATED_IPAD"; dyn_device_prepare "$CREATED_IPAD"
295
304
  if dyn_device_install "$CREATED_IPAD" "${APP:-}" >/dev/null 2>&1; then
305
+ dyn_maestro_warmup "$CREATED_IPAD"
296
306
  saved="$UDID"; UDID="$CREATED_IPAD"
297
307
  r="$(dyn_repeat "$UDID" "$BID" "$EXE" "$WINDOW" "$OUT" ipad)"
298
308
  if [[ "$DYN_DRY_RUN" == 1 ]]; then emit "$(dyn_line SKIP 2.4.1 dyn-ipad-layout "dry run: iPad layout not observed")"
@@ -318,6 +328,7 @@ run_demo_phase() {
318
328
  DEMO_SKIP=$((DEMO_SKIP+1)); i=$((i+1)); continue
319
329
  fi
320
330
  dyn_device_prepare "$UDID"
331
+ dyn_maestro_warmup "$UDID"
321
332
  fresh=$((fresh+1))
322
333
  r="$(dyn_repeat "$UDID" "$BID" "$EXE" "$WINDOW" "$OUT" "demo-$i")"
323
334
  kind="$(cut -f1 <<<"$r")"
@@ -69,7 +69,7 @@ GUIDELINES_BASE_URL="https://developer.apple.com/app-store/review/guidelines/"
69
69
  rule_evidence() {
70
70
  case "$1" in
71
71
  release-notes-specificity|apple-endorsement-claims ) echo metadata ;;
72
- device-restart-instructions|browser-engine|intent-handler-parity|call-filter-controls|face-authentication|document-browser-access|extension-bundle-parity|matter-extension|extension-advertising|ar-integration-depth|companion-app-required|game-center-id-sharing|miniapp-native-bridge ) echo source ;;
72
+ device-restart-instructions|browser-engine|intent-handler-parity|call-filter-controls|face-authentication|document-browser-access|extension-bundle-parity|matter-extension|extension-advertising|ar-integration-depth|companion-app-required|game-center-id-sharing|miniapp-native-bridge|review-mode-gate ) echo source ;;
73
73
  metadata-emoji ) echo resource ;;
74
74
  # --- metadata: read from fastlane/metadata/**, uploaded to ASC verbatim ---
75
75
  competitor-mentions|metadata-char-limits|locale-metadata-parity) echo metadata ;;
@@ -113,7 +113,7 @@ rule_evidence() {
113
113
  # a heuristic must never be graded above judgment-call.
114
114
  rule_confidence() {
115
115
  case "$1" in
116
- release-notes-specificity|device-restart-instructions|browser-engine|intent-handler-parity|call-filter-controls|face-authentication|document-browser-access|extension-bundle-parity|matter-extension|extension-advertising|ar-integration-depth|companion-app-required|game-center-id-sharing|metadata-emoji|miniapp-native-bridge|apple-endorsement-claims ) echo judgment-call ;;
116
+ release-notes-specificity|device-restart-instructions|browser-engine|intent-handler-parity|call-filter-controls|face-authentication|document-browser-access|extension-bundle-parity|matter-extension|extension-advertising|ar-integration-depth|companion-app-required|game-center-id-sharing|metadata-emoji|miniapp-native-bridge|apple-endorsement-claims|review-mode-gate ) echo judgment-call ;;
117
117
  # --- validator-blocking: Apple's machinery refuses the build or the submission ---
118
118
  # Missing purpose string / required-reason declaration / private API -> upload
119
119
  # validation. Metadata limits, missing localized metadata, missing screenshots,
@@ -42,6 +42,7 @@ rule_slug() {
42
42
  66) echo ar-integration-depth ;; 67) echo companion-app-required ;;
43
43
  68) echo game-center-id-sharing ;; 69) echo metadata-emoji ;;
44
44
  70) echo miniapp-native-bridge ;; 71) echo apple-endorsement-claims ;;
45
+ 72) echo review-mode-gate ;;
45
46
  *) echo "" ;;
46
47
  esac
47
48
  }
@@ -6,7 +6,8 @@ import shutil
6
6
  import subprocess
7
7
 
8
8
  EXCLUDED = {'.git', 'node_modules', 'Pods', 'build', 'DerivedData', '.build', '.dart_tool',
9
- '__pycache__', '.gradle', '.kotlin', '.idea'}
9
+ '__pycache__', '.gradle', '.kotlin', '.idea', '.claude', '.cursor', '.agents',
10
+ '.grok', '.codex', '.planning'}
10
11
  SECRETS = ('.env*', '.npmrc', '.netrc', '*.pem', '*.key', '*.jks', '*.keystore',
11
12
  'key.properties', '.sentryclirc', '*Secrets*.xcconfig', '*asc-key*.json',
12
13
  '*.p8', '*.p12', '*.mobileprovision', '.appstore-precheck.json',
@@ -18,6 +18,7 @@ def module(name):
18
18
 
19
19
 
20
20
  PLAN, EXEC, EVIDENCE = module('build-plan'), module('build-exec'), module('build-evidence')
21
+ SCHEMES = module('build-schemes')
21
22
 
22
23
 
23
24
  def arguments():
@@ -32,23 +33,6 @@ def arguments():
32
33
  return parser.parse_args()
33
34
 
34
35
 
35
- def scheme_list(output):
36
- schemes = set()
37
- decoder = json.JSONDecoder()
38
- for index, char in enumerate(output):
39
- if char != '{':
40
- continue
41
- try:
42
- data, _ = decoder.raw_decode(output[index:])
43
- except ValueError:
44
- continue
45
- if isinstance(data, dict):
46
- for value in data.values():
47
- if isinstance(value, dict) and isinstance(value.get('schemes'), list):
48
- schemes.update(s for s in value['schemes'] if isinstance(s, str))
49
- return sorted(schemes)
50
-
51
-
52
36
  def prepare_framework(args, copy, step):
53
37
  if args.framework != 'rn':
54
38
  return
@@ -87,15 +71,13 @@ def run_steps(args, copy, work, out, project):
87
71
  return 'debug', list((copy / 'build/ios/iphonesimulator').glob('*.app'))
88
72
  code, output = step(['xcodebuild', '-list', '-json'] + flags)
89
73
  if code:
90
- raise ValueError('scheme discovery failed; inspect build.log')
91
- schemes = scheme_list(output)
92
- if len(schemes) != 1:
93
- raise ValueError('select one shared scheme; candidates: ' + ', '.join(schemes))
74
+ raise ValueError('scheme discovery failed; candidates: ' + ', '.join(SCHEMES.scheme_list(output)) + '; inspect build.log')
75
+ scheme = SCHEMES.select(output, project, copy, PLAN.excluded)
94
76
  for config in ('Release', 'Debug'):
95
77
  if config == 'Debug' and args.framework == 'kmp' and (copy / 'gradlew').is_file():
96
78
  if step(['./gradlew', '--project-cache-dir', str(work / 'gradle-cache'), ':shared:linkDebugFrameworkIosSimulatorArm64'])[0]:
97
79
  raise ValueError('KMP framework preparation failed; inspect build.log')
98
- command = ['xcodebuild'] + flags + ['-scheme', schemes[0], '-sdk', 'iphonesimulator', '-configuration', config,
80
+ command = ['xcodebuild'] + flags + ['-scheme', scheme, '-sdk', 'iphonesimulator', '-configuration', config,
99
81
  '-derivedDataPath', str(work / 'dd'), 'CODE_SIGNING_ALLOWED=NO', 'build']
100
82
  if step(command)[0] == 0:
101
83
  return config.lower(), list((work / 'dd/Build/Products' / (config + '-iphonesimulator')).glob('*.app'))
@@ -0,0 +1,56 @@
1
+ """Choose a shared scheme using project identity, then verified application targets."""
2
+ import json
3
+ import os
4
+ from pathlib import Path
5
+ import subprocess
6
+
7
+
8
+ def listings(output):
9
+ decoder = json.JSONDecoder()
10
+ for index, char in enumerate(output):
11
+ if char != '{':
12
+ continue
13
+ try:
14
+ data, _ = decoder.raw_decode(output[index:])
15
+ except ValueError:
16
+ continue
17
+ if isinstance(data, dict):
18
+ for key in ('project', 'workspace'):
19
+ value = data.get(key)
20
+ if isinstance(value, dict) and isinstance(value.get('schemes'), list):
21
+ yield value
22
+
23
+
24
+ def scheme_list(output):
25
+ return sorted({s for value in listings(output) for s in value['schemes'] if isinstance(s, str)})
26
+
27
+
28
+ def application_targets(copy, excluded):
29
+ targets = set()
30
+ model = Path(__file__).resolve().parents[1] / 'project-model.sh'
31
+ for base, dirs, files in os.walk(copy):
32
+ dirs[:] = [d for d in dirs if not excluded(Path(base) / d) and not (Path(base) / d).is_symlink()]
33
+ if Path(base).suffix != '.xcodeproj' or 'project.pbxproj' not in files:
34
+ continue
35
+ result = subprocess.run(['bash', '-c', 'source "$1"; pm_app_targets "$2"',
36
+ 'build-schemes', str(model), str(Path(base) / 'project.pbxproj')],
37
+ capture_output=True, text=True, timeout=10)
38
+ if result.returncode == 0:
39
+ targets.update(result.stdout.splitlines())
40
+ return targets
41
+
42
+
43
+ def select(output, project, copy, excluded):
44
+ schemes = scheme_list(output)
45
+ if len(schemes) == 1:
46
+ return schemes[0]
47
+ name = Path(project).stem
48
+ if name in schemes:
49
+ return name
50
+ listed_targets = {t for value in listings(output) for t in value.get('targets', []) if isinstance(t, str)}
51
+ targets = application_targets(copy, excluded)
52
+ if listed_targets:
53
+ targets &= listed_targets
54
+ if len(targets) == 1 and targets.issubset(schemes):
55
+ return targets.pop()
56
+ raise ValueError('select one shared application scheme; candidates: ' + (', '.join(schemes) or '(none)'))
@@ -136,11 +136,15 @@ def safe_action(value):
136
136
 
137
137
 
138
138
  def hierarchy(udid):
139
- raw = command(['maestro', '--device', udid, 'hierarchy'], 15)
140
- try:
141
- return json.loads(raw)
142
- except (ValueError, TypeError):
143
- return {}
139
+ for _ in range(2):
140
+ raw = command(['maestro', '--device', udid, 'hierarchy'], 15)
141
+ try:
142
+ tree = json.loads(raw)
143
+ if isinstance(tree, (dict, list)):
144
+ return tree
145
+ except (ValueError, TypeError):
146
+ pass
147
+ return {}
144
148
 
145
149
 
146
150
  def tap(udid, bundle, text):
@@ -208,13 +212,19 @@ def applicability(app, repo):
208
212
  'miniapp': source_signal(repo)}
209
213
 
210
214
 
211
- def cpu_observation(pid, app, executable):
215
+ def cpu_observation(pid, udid, bundle_id, executable):
212
216
  obs = {'applicable': True, 'usable': False}
213
217
  if not str(pid).isdigit() or not executable or '/' in executable:
214
218
  return obs
215
- expected = str(Path(app).resolve() / executable)
219
+ container = command(['xcrun', 'simctl', 'get_app_container', udid, bundle_id, 'app']).strip()
220
+ if not container or not Path(container).is_absolute():
221
+ obs['reason'] = 'container path unavailable; CPU was not sampled'
222
+ return obs
223
+ expected = str(Path(container).resolve() / executable)
224
+ device_data = (Path.home() / 'Library/Developer/CoreSimulator/Devices' / udid / 'data').resolve()
216
225
  actual = command(['ps', '-p', str(pid), '-o', 'comm=']).strip()
217
- if actual != expected:
226
+ if (actual != expected or Path(actual).name != executable
227
+ or device_data not in Path(actual).resolve().parents):
218
228
  obs['reason'] = 'Process identity did not match the installed executable; CPU was not sampled'
219
229
  return obs
220
230
  time.sleep(20)
@@ -262,7 +272,7 @@ def action_observation(args, mode, initial):
262
272
  def observe(args):
263
273
  signals = applicability(args.app, args.repo)
264
274
  initial = screen_facts(load_tree(args.initial_tree))
265
- result = {'dyn-cpu-idle': cpu_observation(args.pid, args.app, args.executable)}
275
+ result = {'dyn-cpu-idle': cpu_observation(args.pid, args.udid, args.bundle_id, args.executable)}
266
276
  modes = {'capture': 'dyn-capture-indicator', 'music': 'dyn-musickit-auth',
267
277
  'miniapp': 'dyn-miniapp-index', 'location': 'dyn-location-timing'}
268
278
  for mode, rule in modes.items():
@@ -19,6 +19,7 @@
19
19
 
20
20
  : "${DYN_DRY_RUN:=0}"
21
21
  : "${DYN_MAESTRO_TIMEOUT:=45}"
22
+ : "${DYN_MAESTRO_WARMUP_TIMEOUT:=120}"
22
23
  DYN_LIB_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
23
24
 
24
25
  # dyn_with_timeout <secs> <argv…> — run with a wall-clock cap (macOS has no
@@ -98,6 +99,34 @@ dyn_signal_tree() {
98
99
  [[ "$n" =~ ^[0-9]+$ ]] && echo "$n" || echo unread
99
100
  }
100
101
 
102
+ # Warm-up is a discarded driver read, never observation evidence. Zero disables it.
103
+ dyn_maestro_warmup() {
104
+ local udid="$1" status=0
105
+ [[ "$DYN_MAESTRO_WARMUP_TIMEOUT" != 0 ]] || return 0
106
+ if [[ "$DYN_DRY_RUN" == 1 ]]; then
107
+ dyn_plan "maestro --device $udid hierarchy # warm-up; timeout ${DYN_MAESTRO_WARMUP_TIMEOUT}s; result discarded"
108
+ note 'NOTE: [dyn-maestro-warmup] planned discarded hierarchy read'
109
+ return 0
110
+ fi
111
+ if ! command -v maestro >/dev/null 2>&1; then
112
+ note 'NOTE: [dyn-maestro-warmup] unavailable: Maestro missing; no observation recorded'
113
+ return 0
114
+ fi
115
+ python3 -B "$DYN_LIB_DIR/dyn-process.py" --timeout "$DYN_MAESTRO_WARMUP_TIMEOUT" --grace 1 -- \
116
+ maestro --device "$udid" hierarchy >/dev/null 2>&1 || status=$?
117
+ note "NOTE: [dyn-maestro-warmup] discarded hierarchy read; exit $status; no observation recorded"
118
+ }
119
+
120
+ # Retry unread geometry once; a readable degenerate tree is still a real SKIP.
121
+ dyn_signal_tree_retry() {
122
+ local tree
123
+ tree="$(dyn_signal_tree "$1" "$2")"
124
+ if [[ "$tree" == unread && "$DYN_DRY_RUN" != 1 ]]; then
125
+ tree="$(dyn_signal_tree "$1" "$2")"
126
+ fi
127
+ printf '%s\n' "$tree"
128
+ }
129
+
101
130
  # dyn_repeat <udid> <bundle-id> <executable> <window-secs> <out-dir> <i>
102
131
  # -> "<verdict><TAB><detail><TAB><proc>,<shot>,<log>,<tree>" for dyn-launch; files in out-dir.
103
132
  dyn_repeat() {
@@ -48,7 +48,7 @@ static_guideline_gap() {
48
48
  fi
49
49
  }
50
50
 
51
- # §56–§71: slug | guideline | evidence class. Keep coverage-sections.py in sync.
51
+ # §56–§72: slug | guideline | evidence class. Keep coverage-sections.py in sync.
52
52
  while IFS='|' read -r _static_slug _static_guideline _static_evidence; do
53
53
  set_rule "$_static_slug"
54
54
  set_evidence "$_static_evidence"
@@ -76,6 +76,7 @@ game-center-id-sharing|4.5.5|source
76
76
  metadata-emoji|4.5.6|resource
77
77
  miniapp-native-bridge|4.7.2|source
78
78
  apple-endorsement-claims|5.2.4|metadata
79
+ review-mode-gate|2.5.19|source
79
80
  STATIC_GUIDELINE_TABLE
80
81
 
81
82
  if [[ "$STATIC_EMOJI_STATUS" != SKIP ]]; then
@@ -314,6 +314,39 @@ def endorsements(c):
314
314
  return outcome(reason='No matched Apple endorsement claim in metadata.')
315
315
 
316
316
 
317
+ # §72 — 2.5.19 hidden / dormant / undocumented features (October 16, 2026 guideline).
318
+ # Four narrow signal families, any one of which is a WARN: a review-detection or
319
+ # hide-for-review identifier (source or remote-config key), a build-flag branch named
320
+ # after the App Store / review build, a date-gated unlock, and obfuscation tooling.
321
+ # Store-review prompts (SKStoreReviewController, requestReview, reviewPrompt) and
322
+ # product/order review vocabulary are deliberately outside every pattern.
323
+ REVIEW_GATE_KEYS = re.compile(
324
+ r'(?<![A-Za-z0-9])(?:isAppStoreReview|isAppReview|appStoreReview|appReviewMode|reviewMode|isReviewMode|'
325
+ r'inReviewMode|isUnderReview|underReview|isReviewing|isReviewBuild|reviewBuild|reviewerMode|'
326
+ r'hideForReview|hiddenForReview|hide_for_review|hidden_for_review|review_mode|is_under_review|'
327
+ r'under_review|appstore_review|app_review_mode|is_review_build)(?![A-Za-z0-9])', re.I)
328
+ REVIEW_GATE_FLAG = re.compile(r'#if\s+!?\s*(?:APPSTORE|APP_STORE|APPSTORE_BUILD|APPSTORE_REVIEW|APP_REVIEW|REVIEW_BUILD|UNDER_REVIEW)\b')
329
+ REVIEW_GATE_DATE = re.compile(
330
+ r'(?:Date\(\)|Date\.now|\.timeIntervalSince1970)\s*[<>]=?\s*[A-Za-z_.]*(?:unlock|launch|golive|go_live|activation|enable|reveal|hidden|feature)[A-Za-z_.]*|'
331
+ r'[A-Za-z_.]*(?:unlock|launch|golive|go_live|activation|enable|reveal|hidden|feature)[A-Za-z_.]*\s*[<>]=?\s*(?:Date\(\)|Date\.now)', re.I)
332
+ REVIEW_GATE_OBFUSCATION = re.compile(r'SwiftShield|swift-?obfuscator|iXGuard|Guardsquare|Arxan|Verimatrix|Promon|obfuscat', re.I)
333
+
334
+
335
+ def review_gate(c):
336
+ signals = [(REVIEW_GATE_KEYS, 'review-detection or hide-for-review identifier'),
337
+ (REVIEW_GATE_FLAG, 'App Store / review build-flag branch'),
338
+ (REVIEW_GATE_DATE, 'date-gated feature unlock')]
339
+ for pattern, kind in signals:
340
+ p = next((p for p, text in c['src'].items() if pattern.search(text)), None)
341
+ if p:
342
+ return outcome(True, 'Hidden-feature gate signal (' + kind + '): 2.5.19 forbids hidden, dormant or undocumented features; verify the branch only drops debug tooling and that every shipped feature is visible to App Review.', p)
343
+ deps = {p: uncomment(t) for p, t in c['files'].items() if p.name in {'Podfile', 'Package.swift', 'Package.resolved'} or p.suffix == '.pbxproj'}
344
+ p = hit_file(deps, REVIEW_GATE_OBFUSCATION.pattern) or hit_file(c['src'], r'\b(?:SwiftShield|ObfuscatedString|StringObfuscator|Obfuscator)\b|import\s+\w*Obfuscat\w*')
345
+ if p:
346
+ return outcome(True, 'Code/string obfuscation tooling signal: 2.5.19 treats obfuscation used to hide undocumented features as grounds for removal and account termination; confirm nothing reviewable is concealed.', p)
347
+ return outcome(reason='No review-mode gate, App Store build-flag branch, date-gated unlock or obfuscation tooling signal.')
348
+
349
+
317
350
  CHECKS = {'release-notes-specificity': release_notes, 'device-restart-instructions': restart,
318
351
  'browser-engine': browser, 'intent-handler-parity': intents,
319
352
  'call-filter-controls': call_filter, 'face-authentication': face_auth,
@@ -321,7 +354,8 @@ CHECKS = {'release-notes-specificity': release_notes, 'device-restart-instructio
321
354
  'matter-extension': matter, 'extension-advertising': extension_ads,
322
355
  'ar-integration-depth': ar_depth, 'companion-app-required': companion,
323
356
  'game-center-id-sharing': game_ids, 'metadata-emoji': emoji,
324
- 'miniapp-native-bridge': miniapp, 'apple-endorsement-claims': endorsements}
357
+ 'miniapp-native-bridge': miniapp, 'apple-endorsement-claims': endorsements,
358
+ 'review-mode-gate': review_gate}
325
359
 
326
360
 
327
361
  def evaluate(root, metadata, main, excludes):
@@ -748,7 +748,7 @@ ext_purchase=""
748
748
  grep -rqE 'ExternalPurchase|ExternalPurchaseLink|ExternalPurchaseCustomLink' "${IOS_DIR:-.}" "${GREP_PRUNE[@]}" "${SRC_INC[@]}" 2>/dev/null && ext_purchase=1
749
749
  grep -rqE 'external-purchase' "${IOS_DIR:-.}" "${GREP_PRUNE[@]}" --include='*.entitlements' 2>/dev/null && ext_purchase=1
750
750
  if [[ -n "$ext_purchase" ]]; then
751
- warn "3.1.1(a) External purchase link detected — review the offering, storefront, distribution and applicable agreement before checking entitlement, disclosure and reporting duties. United States storefront links do not require these entitlements under 3.1.1(a); SDK presence alone is not a violation."
751
+ warn "3.1.1(a) External purchase link detected — the link may only lead to a permitted destination for that storefront (approved destinations vary by region), under a StoreKit External Purchase Link or, where permitted, Music Streaming Services entitlement; review the offering, storefront, distribution and applicable agreement before checking entitlement, disclosure and reporting duties. United States storefront links do not require these entitlements under 3.1.1(a); SDK presence alone is not a violation."
752
752
  fi
753
753
 
754
754
  # ===================================================================
@@ -875,14 +875,19 @@ fi
875
875
  # Apps with UGC must provide: a content filter, a report mechanism, the ability
876
876
  # to block abusive users, and published contact info. We detect a UGC signal and
877
877
  # warn when no report/block/moderation affordance is found anywhere in the source.
878
+ # Since October 16, 2026 the rule names apps that let users "create, generate,
879
+ # upload, share, or otherwise contribute content", explicitly including AI content
880
+ # creation apps, and adds nonconsensual intimate imagery to the harms; failing to
881
+ # implement safeguards is a Developer Code of Conduct matter. The signal list
882
+ # therefore also covers image/video generation endpoints and SDKs.
878
883
  set_rule "ugc-no-moderation"
879
884
  if [[ -n "$IOS_DIR" ]]; then
880
- ugc_signal=$(grep -rlE 'userGeneratedContent|\bUGC\b|StreamChat|MessageKit|SendbirdSDK|PubNub|postComment|submitComment|createPost|publishPost|uploadUserPhoto|uploadVideo' "$IOS_DIR" "${GREP_PRUNE[@]}" "${SRC_INC[@]}" 2>/dev/null | head -1)
885
+ ugc_signal=$(grep -rlE 'userGeneratedContent|\bUGC\b|StreamChat|MessageKit|SendbirdSDK|PubNub|postComment|submitComment|createPost|publishPost|uploadUserPhoto|uploadVideo|/images/generations|/images/edits|/v1/videos/generations|api\.replicate\.com|replicate\.run|api\.stability\.ai|stability\.ai|fal\.ai|fal\.run|api\.runwayml\.com|api\.dev\.runwayml\.com|import ImagePlayground|ImageCreator\b|ImagePlaygroundViewController|imagePlaygroundSheet|generateImage\b|generateVideo\b|imageGeneration\b|videoGeneration\b|textToImage\b|text-to-image|txt2img|StableDiffusion' "$IOS_DIR" "${GREP_PRUNE[@]}" "${SRC_INC[@]}" 2>/dev/null | head -1)
881
886
  if [[ -n "$ugc_signal" ]]; then
882
887
  if grep -rqiE 'report(Content|User|Abuse|Post|Comment|Message|Reason|ed)|block(ed)?User|unblockUser|moderat(e|ion|or)|flag(Content|Post|User|Comment|Message)|content.?filter' "$IOS_DIR" "${GREP_PRUNE[@]}" "${SRC_INC[@]}" 2>/dev/null; then
883
888
  pass "1.2 UGC — user-generated content with report/block/moderation affordances present"
884
889
  else
885
- warn "1.2 UGC — user-generated content detected (e.g. $(basename "$ugc_signal")) but no report/block/moderation mechanism found; UGC apps must offer content filtering, a report mechanism, user blocking, and published contact info (1.2)"
890
+ warn "1.2 UGC — user-generated or AI-generated content detected (e.g. $(basename "$ugc_signal")) but no report/block/moderation mechanism found; apps that let users create, generate, upload or share content (including AI content creation apps) must offer content filtering, a report mechanism, user blocking, and published contact info, and must guard against nonconsensual intimate imagery; missing safeguards are also a Developer Code of Conduct violation (1.2)"
886
891
  fi
887
892
  fi
888
893
  fi
@@ -1548,6 +1553,21 @@ if [[ -n "$IOS_DIR" ]]; then
1548
1553
  pass "4.5.4 Marketing push — SDK present and a notification-preferences signal exists; verify promotional pushes are consent-gated"
1549
1554
  fi
1550
1555
  fi
1556
+ # Live Activities (ActivityKit / NSSupportsLiveActivities) are an Apple Service under
1557
+ # 4.5.3 since the June 2026 rewrite: they may not carry spam, phishing or unsolicited
1558
+ # messages. Push-to-start Live Activities driven by a marketing-push SDK are the
1559
+ # risky combination; ActivityKit alone is a note for deep-review check 15.
1560
+ live_act=$(grep -rlE 'import ActivityKit|ActivityKit\.|Activity<[A-Za-z_]+Attributes>|ActivityAttributes\b' "$IOS_DIR" "${GREP_PRUNE[@]}" "${SRC_INC[@]}" 2>/dev/null | head -1)
1561
+ if [[ -z "$live_act" && -f "$INFO_PLIST" ]] && grep -qA1 'NSSupportsLiveActivities' "$INFO_PLIST" 2>/dev/null && grep -A1 'NSSupportsLiveActivities' "$INFO_PLIST" 2>/dev/null | grep -q '<true/>'; then
1562
+ live_act="$INFO_PLIST"
1563
+ fi
1564
+ if [[ -n "$live_act" ]]; then
1565
+ if [[ -n "$push_mkt" ]]; then
1566
+ warn "4.5.3 Live Activities — ActivityKit/NSSupportsLiveActivities ($(basename "$live_act")) coexists with a marketing-push SDK ($(basename "$push_mkt")); Live Activities may not be used to spam or send unsolicited promotional updates (4.5.3). Verify every Live Activity (including push-to-start) reflects a user-initiated, time-bound activity" "$live_act"
1567
+ else
1568
+ pass "4.5.3 Live Activities — ActivityKit/NSSupportsLiveActivities present without a marketing-push SDK; verify Live Activities stay tied to user-initiated activity and never carry promotions (4.5.3)"
1569
+ fi
1570
+ fi
1551
1571
  fi
1552
1572
 
1553
1573
  # ===================================================================