appstore-precheck 1.20.2 → 1.23.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; 77 static vectors, 9 artifact checks, 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,12 @@ 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. |
157
+ | 73 | **2.3.6 shared-location-descriptor** *(advisory)* | A location API (`CLLocationManager`, location usage keys) together with copy about sharing location with other people (live location, friends on a map, people nearby). App Store Connect added the "Shared Location" age-rating content descriptor in November 2026; every app must answer the new questions by 2027-01-12 or updates are blocked. The WARN says "answer it", not "you are rated wrong". |
158
+ | 74 | **2.3.6 dating-age-descriptor** *(advisory)* | Dating / matchmaking / AI-companion wording in store metadata (name, subtitle, description, keywords, promo). The "Dating and Relationships" descriptor sets the minimum rating to 18+ (Brazil A18), so the listing and the ASC rating must agree. "Updating", puzzle "match" and CRM "relationship" wording stay clean. |
159
+ | 75 | **2.1 on-demand-resources** *(advisory)* | `NSBundleResourceRequest` / `beginAccessingResources` in source or ODR build settings (`ENABLE_ON_DEMAND_RESOURCES = YES`, initial-install / prefetch tags, asset-pack manifest URL). App Store Connect stops accepting new apps that use On-Demand Resources in early 2027; Apple's replacement is Background Assets. Existing apps keep updating for now. |
160
+ | 76 | **2.4.1 required-device-capabilities** *(advisory)* | `UIRequiredDeviceCapabilities` in the main Info.plist lists something beyond architecture / baseline entries (`arm64`, `metal`, `wifi`, …): telephony, gps, cameras, sensors, nfc. App Review Help says to declare only what the core functionality cannot work without; each extra entry shrinks the eligible device set and reviewers test on a device that has it. |
161
+ | 77 | **2.1 review-notes-completeness** *(advisory)* | Three App Review Help expectations checked against `fastlane/metadata/review_information/`: a third-party AI provider in code (§47 list) is named in the notes; auto-renewable subscription code comes with a demo account in an expired state; when the app has more than one account type (teacher/student, driver/rider, …) the notes cover every type. Missing metadata is a SKIP gap, not a WARN. |
156
162
 
157
163
  New source checks skip compiled bundles and pruned dependencies. Unreadable or incomplete
158
164
  inputs produce additive coverage gaps: source/manifest reads are bounded to 2 MiB and
@@ -288,6 +294,7 @@ actually ships:
288
294
 
289
295
  | Class | Read from | Why it sits here |
290
296
  |---|---|---|
297
+ | `artifact` | a built `.app` / `.ipa` / `.xcarchive` (`--artifact`), read without executing it | The bundle that ships, or a sibling build of it: stronger than any repository read, but not an observation of behaviour, and a simulator `.app` is still not the archive. |
291
298
  | `metadata` | `fastlane/metadata/**` | Uploaded to App Store Connect verbatim. |
292
299
  | `manifest` | `Info.plist`, `*.entitlements`, `PrivacyInfo.xcprivacy` | Ship as authored. |
293
300
  | `resource` | String Catalogs, screenshot assets | Shipped / uploaded files. |
@@ -479,6 +486,21 @@ completeness test (`is_gap_record`, convention: ids ending in `-not-audited`).
479
486
  | 69 | `metadata-emoji` | resource | judgment-call | — |
480
487
  | 70 | `miniapp-native-bridge` | source | judgment-call | — |
481
488
  | 71 | `apple-endorsement-claims` | metadata | judgment-call | — |
489
+ | 72 | `review-mode-gate` | source | judgment-call | — |
490
+ | 73 | `shared-location-descriptor` | source | judgment-call | — |
491
+ | 74 | `dating-age-descriptor` | metadata | judgment-call | — |
492
+ | 75 | `on-demand-resources` | source | judgment-call | — |
493
+ | 76 | `required-device-capabilities` | manifest | judgment-call | — |
494
+ | 77 | `review-notes-completeness` | metadata | judgment-call | — |
495
+ | 78 | `artifact-entitlements` | artifact | judgment-call | — |
496
+ | 79 | `artifact-reason-api` | artifact | judgment-call | — |
497
+ | 80 | `artifact-private-api` | artifact | review-risk | — |
498
+ | 81 | `artifact-url-schemes` | artifact | judgment-call | — |
499
+ | 82 | `artifact-ats` | artifact | judgment-call | — |
500
+ | 83 | `artifact-sdk` | artifact | judgment-call | — |
501
+ | 84 | `artifact-embedded-sdk` | artifact | judgment-call | — |
502
+ | 85 | `artifact-executable-loading` | artifact | judgment-call | — |
503
+ | 86 | `artifact-debug` | artifact | judgment-call | — |
482
504
 
483
505
  *Generated from `scripts/evidence.sh`; `tests/test-evidence.sh` keeps it honest.*
484
506
 
@@ -580,6 +602,45 @@ which rules fire. Contribute an outcome via the "App Store outcome" issue templa
580
602
 
581
603
  ---
582
604
 
605
+ ### Artifact tier (`--artifact <path>`, alias `--ipa`)
606
+
607
+ Between the repository read and the dynamic tier sits a third kind of evidence: a **built bundle
608
+ read without being executed**. `scan.sh --artifact build/MyApp.ipa` (also a `.app` directory or an
609
+ `.xcarchive`) runs `scripts/lib/artifact-review.py` and files its nine checks as catalogued rules
610
+ §78–§86 with `evidence: artifact`:
611
+
612
+ | Rule | Guideline | What is read |
613
+ |---|---|---|
614
+ | `artifact-entitlements` | 2.1 | signed entitlements (`codesign -d --entitlements`) vs `Info.plist` and binary symbols (HealthKit, push) |
615
+ | `artifact-reason-api` | 5.1.1 | Required Reason API symbols in the Mach-O vs `PrivacyInfo.xcprivacy` declarations and approved reason codes |
616
+ | `artifact-private-api` | 2.5.1 | `otool -L` linkage against `/System/Library/PrivateFrameworks`, `nm -u` restricted symbols |
617
+ | `artifact-url-schemes` | 2.5.1 | `LSApplicationQueriesSchemes`: jailbreak-store schemes, malformed entries |
618
+ | `artifact-ats` | 1.6 | `NSAppTransportSecurity` exceptions as shipped |
619
+ | `artifact-sdk` | 2.1 | `MinimumOSVersion` vs `DTSDKName` |
620
+ | `artifact-embedded-sdk` | 5.1.1 | embedded frameworks: readable `PrivacyInfo.xcprivacy`, verified signatures |
621
+ | `artifact-executable-loading` | 2.5.2 | download + executable string pairs in the binary |
622
+ | `artifact-debug` | 2.1 | `get-task-allow`, stray `.mobileprovision`, dSYMs, test bundles, `.DS_Store` |
623
+
624
+ Status mapping: `PASS` stays PASS, `FINDING` and `NEEDS_REVIEW` become WARN (the tier says "this
625
+ bundle needs a look"; it never FAILs on its own), `SKIP` / `NOT_RUN` become SKIP with the reason
626
+ (no artifact, no `codesign` / `otool` / `nm`, unsigned simulator build). An IPA is unpacked into a
627
+ temporary directory with path-traversal and size guards; nothing is launched. The nine rules are
628
+ counted as *artifact checks*, apart from the static vectors, in the coverage inventory. Without
629
+ `--artifact` the scan output is byte-for-byte what it was.
630
+
631
+ ### Baseline (`--save-baseline <file>` / `--baseline <file>`)
632
+
633
+ A baseline is the list of FAIL/WARN findings a team has looked at and accepted for now. `scan.sh
634
+ --save-baseline .precheck-baseline.json` writes the live FAIL/WARN findings of the run as
635
+ `{rule_id, severity, file, message}`; `scan.sh --baseline .precheck-baseline.json` then treats a
636
+ finding that matches on all three of rule, file and message exactly like a `.precheck-ignore`
637
+ suppression: dropped from the text output and the verdict, kept in `--format json` with
638
+ `suppressed: true`, counted in `summary.baseline` and in the text footer `(N finding(s) matched the
639
+ baseline)`. PASS and SKIP are never baselined, so a baseline cannot hide a coverage gap. A baseline
640
+ that is missing, unreadable or not a findings file is reported on stderr and ignored. Matching is
641
+ exact on the message text on purpose: when a rule's wording changes, the finding resurfaces and is
642
+ triaged again.
643
+
583
644
  ### Optional local dynamic simulator tier
584
645
 
585
646
  Beyond the static scan and the agent-mode deep reviews, an **opt-in** local dynamic tier
@@ -616,6 +677,11 @@ Things the scanner cannot verify; confirm by hand before you submit:
616
677
  [ ] Paywall price matches App Store Connect EXACTLY (amount + currency formatting)
617
678
  [ ] Free trial is configured as an Introductory Offer in App Store Connect (not app-side only)
618
679
  [ ] Updated age-rating questionnaire (13+/16+/18+ tiers) completed in App Store Connect
680
+ [ ] November 2026 age-rating questions answered in App Store Connect: "Shared Location" and "Dating and Relationships" (Dating ⇒ 18+, Brazil A16/A18); mandatory for every app by 2027-01-12 (§73/§74 only flag the signal)
681
+ [ ] App Compliance page in App Store Connect answered where it applies (China ICP / AIGC declaration, game licence, medical device, security assessment) — no fastlane slot, human-only
682
+ [ ] Screenshots: more than half of each device set show the app in use (2 of 3, 3 of 56); vision check S4 counts, you decide
683
+ [ ] Review notes list every external service the app depends on, AI services included, and give a demo account per account type plus one with an expired subscription (§77 flags the gap)
684
+ [ ] Siri AI App Intents (developer preview, submissions from spring 2027): under-13 and EU users cannot use them — the app must still work without
619
685
  [ ] EU DSA trader status declared (required for EU distribution)
620
686
  [ ] If user data goes to a third-party AI provider: consent screen names the provider
621
687
  [ ] IPv6-only run: Internet Sharing > "Create NAT64 Network" on a Mac, every network feature works (2.5.5 — GUI-only, not automatable; §55 only greps the IPv4-literal subset)
@@ -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
 
@@ -174,7 +174,11 @@ A host with image access must directly inspect the supplied images and cite its
174
174
  `.appstore-precheck.json` → `reviewPrepNotes` if set.
175
175
  2. Flag empty notes, placeholder credentials (`test`, `demo`, `changeme`, `TBD`), or notes that
176
176
  do not explain how to reach core features (subscription paywall, Screen Time blocking, etc.).
177
- 3. If the app is not login-gated and has no account wall, mark not applicable.
177
+ 3. App Review Help (November 2026) adds three concrete expectations; scan §77 flags their absence,
178
+ you judge the substance: one working demo account per account type (teacher and student, driver
179
+ and rider); when subscriptions auto-renew, a second account whose subscription has expired; and
180
+ every external service the app depends on, AI services included, named in the notes.
181
+ 4. If the app is not login-gated and has no account wall, mark not applicable.
178
182
 
179
183
  ### 5 — 2.2 Beta / test language *(Tier B v1)*
180
184
 
@@ -202,6 +206,8 @@ A host with image access must directly inspect the supplied images and cite its
202
206
  1. Open ≥1 screenshot per primary locale.
203
207
  2. List visible features (tabs, paywall, login, maps, etc.).
204
208
  3. Flag screenshots showing features absent from the build or metadata.
209
+ 3b. Per device set, count the shots that show the app in use versus title / splash / marketing art:
210
+ App Review Help requires more than half in use (2 of 3, 3 of 4). Below that is a finding.
205
211
  4. For the full structured screenshot vision review (placeholder/empty-state, text overflow,
206
212
  wrong device frame, misleading marketing, metadata mismatch), follow
207
213
  `screenshot-vision-review.md` (sibling file in this same `references/` directory).
@@ -244,9 +250,14 @@ A host with image access must directly inspect the supplied images and cite its
244
250
  1. Read entitlements and Info.plist for push notifications and HomeKit.
245
251
  2. **Push:** if push entitlement present, scan metadata/UI for spam patterns ("notify every hour",
246
252
  "unlimited reminders") unrelated to user-initiated alerts.
247
- 3. **HomeKit:** if HomeKit framework imported, confirm home-automation UI exists; flag HomeKit
253
+ 3. **Live Activities:** if the scan reports `4.5.3 Live Activities` (ActivityKit import or
254
+ `NSSupportsLiveActivities`), confirm each activity tracks something the user started and is
255
+ time-bound; flag promotional, re-engagement or push-to-start activities that are not tied to a
256
+ user action (4.5.3 names Live Activities alongside push and Game Center as Apple Services that
257
+ may not carry spam or unsolicited messages).
258
+ 4. **HomeKit:** if HomeKit framework imported, confirm home-automation UI exists; flag HomeKit
248
259
  import with no home-related features (possible misuse).
249
- 4. If neither push nor HomeKit signals, mark not applicable.
260
+ 5. If neither push, Live Activities nor HomeKit signals, mark not applicable.
250
261
 
251
262
  ### 16 — 4.8 Sign in with Apple (context)
252
263
 
@@ -437,7 +448,7 @@ actual crashes belong to Phase 6 (the local simulator tier), not to a source rea
437
448
  1. Read metadata, source; record concrete evidence pointers.
438
449
  2. Establish the stated applicability and source scope; if unknown or conflicting, emit `REVIEW-SKIP`.
439
450
  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.
451
+ 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
452
  5. Emit a cited advisory FINDING, bounded NO-SIGNAL, or SKIP; never PASS.
442
453
 
443
454
  ### 39 — 1.4.2 drug-dosage-source *(Tier B)*
@@ -52,6 +52,7 @@ deep-review.
52
52
  ### S4 — Misleading marketing
53
53
  1. Determine whether each screenshot shows the app actually in use (real UI) vs pure title/splash/logo art.
54
54
  2. Flag shots that are marketing art rather than the app in use (2.3.3), or that depict a feature absent from the build (2.3.1(a)).
55
+ 3. Count per device set (iPhone, iPad): App Review Help requires more than half of the set to show the app in use (2 of 3, 3 of 4). A set below that ratio is a finding even when every single shot is defensible.
55
56
 
56
57
  ### S5 — Metadata ↔ screenshot mismatch
57
58
  1. Read the visible UI text/features and compare to the description, keywords, and promo text.
@@ -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.
@@ -39,6 +39,10 @@
39
39
  # usually in configuration (Debug from DerivedData). So a
40
40
  # runtime observation only clears needs_build_verification
41
41
  # when it came from a release build_config; see below.
42
+ # artifact a built .app / .ipa / .xcarchive read WITHOUT executing it (--artifact).
43
+ # Stronger than any repo read (it is the bundle that ships, or a sibling
44
+ # of it) but not an observation of behaviour, and a simulator .app is
45
+ # still not the archive: see runtime (b).
42
46
  # metadata fastlane/metadata/** — uploaded to App Store Connect verbatim.
43
47
  # manifest Info.plist, *.entitlements, PrivacyInfo.xcprivacy — ship as authored.
44
48
  # resource String Catalogs, screenshot assets — shipped/uploaded files.
@@ -46,7 +50,7 @@
46
50
  # so a repo-level read is a proxy for what the archive was built with.
47
51
  # source .swift/.m/.mm/.h greps — the weakest: presence in a file is not
48
52
  # proof of presence in the shipping binary.
49
- EVIDENCE_CLASSES="runtime metadata manifest resource build-setting source"
53
+ EVIDENCE_CLASSES="runtime artifact metadata manifest resource build-setting source"
50
54
 
51
55
  # Confidence levels — who acts on the finding, and how deterministically:
52
56
  # validator-blocking Apple's automated validation (upload or App Store Connect)
@@ -68,9 +72,11 @@ GUIDELINES_BASE_URL="https://developer.apple.com/app-store/review/guidelines/"
68
72
  # plist read was. A rule may refine this for one finding with set_evidence.
69
73
  rule_evidence() {
70
74
  case "$1" in
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 ;;
75
+ release-notes-specificity|apple-endorsement-claims|dating-age-descriptor|review-notes-completeness ) echo metadata ;;
76
+ 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|shared-location-descriptor|on-demand-resources ) echo source ;;
73
77
  metadata-emoji ) echo resource ;;
78
+ required-device-capabilities ) echo manifest ;;
79
+ artifact-* ) echo artifact ;;
74
80
  # --- metadata: read from fastlane/metadata/**, uploaded to ASC verbatim ---
75
81
  competitor-mentions|metadata-char-limits|locale-metadata-parity) echo metadata ;;
76
82
  subscription-eula-metadata|support-privacy-url|placeholder-metadata) echo metadata ;;
@@ -113,7 +119,10 @@ rule_evidence() {
113
119
  # a heuristic must never be graded above judgment-call.
114
120
  rule_confidence() {
115
121
  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 ;;
122
+ 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|shared-location-descriptor|dating-age-descriptor|on-demand-resources|required-device-capabilities|review-notes-completeness ) echo judgment-call ;;
123
+ # artifact tier: a linked private framework is what 2.5.1 rejects; the rest asks for a look.
124
+ artifact-private-api ) echo review-risk ;;
125
+ artifact-* ) echo judgment-call ;;
117
126
  # --- validator-blocking: Apple's machinery refuses the build or the submission ---
118
127
  # Missing purpose string / required-reason declaration / private API -> upload
119
128
  # validation. Metadata limits, missing localized metadata, missing screenshots,
@@ -42,6 +42,16 @@ 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 ;;
46
+ 73) echo shared-location-descriptor ;; 74) echo dating-age-descriptor ;;
47
+ 75) echo on-demand-resources ;; 76) echo required-device-capabilities ;;
48
+ 77) echo review-notes-completeness ;;
49
+ # 78–86: artifact tier (--artifact / --ipa), read from a built bundle, never executed.
50
+ 78) echo artifact-entitlements ;; 79) echo artifact-reason-api ;;
51
+ 80) echo artifact-private-api ;; 81) echo artifact-url-schemes ;;
52
+ 82) echo artifact-ats ;; 83) echo artifact-sdk ;;
53
+ 84) echo artifact-embedded-sdk ;; 85) echo artifact-executable-loading ;;
54
+ 86) echo artifact-debug ;;
45
55
  *) echo "" ;;
46
56
  esac
47
57
  }
@@ -174,7 +184,11 @@ _record() {
174
184
 
175
185
  # _record_suppressed <severity> <message> [<file>] [<line>]
176
186
  # Same JSONL record as _record but suppressed:true, and bumps the counter.
187
+ : "${_BASELINE_COUNT:=0}"
177
188
  _record_suppressed() {
189
+ # A --baseline match is a suppression with a different signer: count it on its own
190
+ # as well, so the footer and summary.baseline can say "accepted earlier", not "ignored".
191
+ [[ "${_SUPP_REASON:-}" == baseline ]] && _BASELINE_COUNT=$((_BASELINE_COUNT + 1))
178
192
  [[ -z "$FINDINGS_TMP" ]] && { _SUPPRESSED_COUNT=$((_SUPPRESSED_COUNT + 1)); return 0; }
179
193
  _emit "$1" "$2" "${3:-}" "${4:-}" true
180
194
  _SUPPRESSED_COUNT=$((_SUPPRESSED_COUNT + 1))
@@ -191,11 +205,11 @@ render_json() {
191
205
  . "$(dirname "${BASH_SOURCE[0]}")/thresholds.sh"
192
206
  [[ -s "$buf" ]] || { printf '%s\n' '{"findings":[]}' | jq \
193
207
  --arg v "$PRECHECK_VERSION" '{tool:"appstore-precheck",version:$v,verdict:"GREEN",
194
- summary:{fail:0,warn:0,pass:0,suppressed:0,
208
+ summary:{fail:0,warn:0,pass:0,suppressed:0,baseline:0,
195
209
  by_confidence:{"validator-blocking":0,"review-risk":0,"judgment-call":0,unclassified:0},
196
210
  needs_build_verification:0, not_audited:0},
197
211
  findings:[]}'; return 0; }
198
- jq -s --arg v "$PRECHECK_VERSION" \
212
+ jq -s --arg v "$PRECHECK_VERSION" --argjson b "${_BASELINE_COUNT:-0}" \
199
213
  --argjson fmin "$RED_FAIL_MIN" --argjson wmin "$YELLOW_WARN_MIN" '
200
214
  (map(select(.suppressed==false))) as $live
201
215
  | ($live|map(select(.severity=="FAIL"))|length) as $f
@@ -214,7 +228,7 @@ render_json() {
214
228
  | ($live|map(select(.severity=="FAIL" or .severity=="WARN"))) as $issues
215
229
  | ($issues|map(select(.needs_build_verification==true))|length) as $nb
216
230
  | {tool:"appstore-precheck", version:$v, verdict:$verdict,
217
- summary:{fail:$f, warn:$w, pass:$p, suppressed:$s,
231
+ summary:{fail:$f, warn:$w, pass:$p, suppressed:$s, baseline:$b,
218
232
  by_confidence:{
219
233
  "validator-blocking":($issues|map(select(.confidence=="validator-blocking"))|length),
220
234
  "review-risk":($issues|map(select(.confidence=="review-risk"))|length),
@@ -34,7 +34,7 @@ def scan_sources(skill):
34
34
  table = re.search(r"done <<'STATIC_GUIDELINE_TABLE'\n(.*?)\nSTATIC_GUIDELINE_TABLE", text, re.S)
35
35
  if table:
36
36
  for slug, guideline, evidence in re.findall(
37
- r'^([\w-]+)\|([1-5](?:\.\d+)+)\|(source|metadata|resource)$', table[1], re.M):
37
+ r'^([\w-]+)\|([1-5](?:\.\d+)+)\|(source|metadata|resource|manifest)$', table[1], re.M):
38
38
  if slug in slugs:
39
39
  add(result, guideline, '§%d' % slugs[slug])
40
40
  chunks = re.split(r'set_rule "([\w-]*)"', text)
@@ -44,7 +44,10 @@ def scan_sources(skill):
44
44
  continue
45
45
  for message in re.findall(r'\b(?:fail|warn|pass)\s+"((?:[^"\\]|\\.)*)"', chunks[index + 1]):
46
46
  add(result, message, '§%d' % slugs[slug])
47
- return result, len(slugs)
47
+ # The artifact tier (--artifact) is read from a built bundle, not the repository: its
48
+ # checks are catalogued rules but not static vectors, and are counted on their own.
49
+ artifact = [slug for slug in slugs if slug.startswith('artifact-')]
50
+ return result, len(slugs) - len(artifact), len(artifact)
48
51
 
49
52
 
50
53
  def table_sources(path, dynamic=False):
@@ -118,7 +121,7 @@ def deep_sources(skill, catalog):
118
121
 
119
122
 
120
123
  def sources(skill):
121
- scan, vectors = scan_sources(skill)
124
+ scan, vectors, artifact = scan_sources(skill)
122
125
  refs = skill / 'references'
123
126
  catalog = json.loads((refs / 'review-catalog.json').read_text())
124
127
  deep, deep_errors = deep_sources(skill, catalog)
@@ -133,7 +136,7 @@ def sources(skill):
133
136
  if len(numbers) != len(set(numbers)) or len(keys) != len(set(keys)):
134
137
  errors.append('duplicate deep-review number/key')
135
138
  return {'scan': scan, 'deep': deep, 'dynamic': dynamic, 'vision': vision}, {
136
- 'static_vectors': vectors, 'deep_checks': len(numbers),
139
+ 'static_vectors': vectors, 'artifact_checks': artifact, 'deep_checks': len(numbers),
137
140
  'dynamic_checks': len(registered), 'vision_checks': len(vision_ids),
138
141
  'catalog_version': catalog['version']}, errors
139
142
 
@@ -202,7 +205,7 @@ def source_details(pointers):
202
205
  def summary_line(report):
203
206
  return ('Coverage inventory: {covered}/{denominator} leaf sections ({percentage}%); '
204
207
  '{touched} touched, {positive_only} positive-only; '
205
- '{static_vectors} static vectors, {deep_checks} deep-review checks, '
208
+ '{static_vectors} static vectors, {artifact_checks} artifact checks, {deep_checks} deep-review checks, '
206
209
  '{dynamic_checks} dynamic checks, {vision_checks} vision checks, '
207
210
  '{human_only} human-only sections.').format(**report)
208
211
 
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env bash
2
+ # lib/scan-artifact.sh — the artifact tier of scan.sh (`--artifact <path>` / `--ipa <path>`).
3
+ # Runs lib/artifact-review.py (read-only: plists, entitlements, Mach-O linkage, embedded
4
+ # frameworks; nothing is launched) on a built .app, .ipa or .xcarchive and files its nine
5
+ # checks as catalogued rules §78–§86 with `artifact` evidence. Statuses map as:
6
+ # PASS -> PASS; FINDING / NEEDS_REVIEW -> WARN; SKIP / NOT_RUN -> SKIP.
7
+ # Nothing here FAILs on its own: the tier says "this bundle needs a look", the human decides.
8
+ # Sourced by scan.sh only when OPT_ARTIFACT is set. Bash 3.2; python3 + jq required.
9
+
10
+ ARTIFACT_JSON=""
11
+ if command -v python3 >/dev/null 2>&1 && command -v jq >/dev/null 2>&1; then
12
+ ARTIFACT_JSON="$(python3 -B "$SCRIPT_DIR/lib/artifact-review.py" --app "$OPT_ARTIFACT" --format json 2>/dev/null)" || ARTIFACT_JSON=""
13
+ fi
14
+
15
+ # artifact_row <check-id> -> sets ART_STATUS / ART_REASON / ART_EVIDENCE for that check.
16
+ artifact_row() {
17
+ ART_STATUS=SKIP ART_REASON="python3 or jq unavailable, or artifact-review failed" ART_EVIDENCE=""
18
+ [[ -n "$ARTIFACT_JSON" ]] || return 0
19
+ local row
20
+ row="$(printf '%s' "$ARTIFACT_JSON" | jq -c --arg id "$1" '.checks[]? | select(.check_id == $id)' 2>/dev/null | head -1)"
21
+ [[ -n "$row" ]] || { ART_REASON="artifact-review returned no row for $1"; return 0; }
22
+ ART_STATUS="$(printf '%s' "$row" | jq -r '.status')"
23
+ ART_REASON="$(printf '%s' "$row" | jq -jr '.reason' | tr '\n\r\t' ' ')"
24
+ ART_EVIDENCE="$(printf '%s' "$row" | jq -r '.evidence[]?' 2>/dev/null | head -5)"
25
+ }
26
+
27
+ # The guideline each check is filed under is literal here on purpose: the coverage
28
+ # derivation and the catalogue walk read these strings.
29
+ set_rule "artifact-entitlements"; artifact_row artifact-entitlements
30
+ case "$ART_STATUS" in PASS) pass "2.1 artifact-entitlements — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.1 artifact-entitlements — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.1 artifact-entitlements — $ART_REASON" ;; esac
31
+ set_rule "artifact-reason-api"; artifact_row artifact-reason-api
32
+ case "$ART_STATUS" in PASS) pass "5.1.1 artifact-reason-api — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "5.1.1 artifact-reason-api — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "5.1.1 artifact-reason-api — $ART_REASON" ;; esac
33
+ set_rule "artifact-private-api"; artifact_row artifact-private-api
34
+ case "$ART_STATUS" in PASS) pass "2.5.1 artifact-private-api — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.5.1 artifact-private-api — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.5.1 artifact-private-api — $ART_REASON" ;; esac
35
+ set_rule "artifact-url-schemes"; artifact_row artifact-url-schemes
36
+ case "$ART_STATUS" in PASS) pass "2.5.1 artifact-url-schemes — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.5.1 artifact-url-schemes — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.5.1 artifact-url-schemes — $ART_REASON" ;; esac
37
+ set_rule "artifact-ats"; artifact_row artifact-ats
38
+ case "$ART_STATUS" in PASS) pass "1.6 artifact-ats — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "1.6 artifact-ats — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "1.6 artifact-ats — $ART_REASON" ;; esac
39
+ set_rule "artifact-sdk"; artifact_row artifact-sdk
40
+ case "$ART_STATUS" in PASS) pass "2.1 artifact-sdk — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.1 artifact-sdk — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.1 artifact-sdk — $ART_REASON" ;; esac
41
+ set_rule "artifact-embedded-sdk"; artifact_row artifact-embedded-sdk
42
+ case "$ART_STATUS" in PASS) pass "5.1.1 artifact-embedded-sdk — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "5.1.1 artifact-embedded-sdk — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "5.1.1 artifact-embedded-sdk — $ART_REASON" ;; esac
43
+ set_rule "artifact-executable-loading"; artifact_row artifact-executable-loading
44
+ case "$ART_STATUS" in PASS) pass "2.5.2 artifact-executable-loading — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.5.2 artifact-executable-loading — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.5.2 artifact-executable-loading — $ART_REASON" ;; esac
45
+ set_rule "artifact-debug"; artifact_row artifact-debug
46
+ case "$ART_STATUS" in PASS) pass "2.1 artifact-debug — $ART_REASON" ;; FINDING|NEEDS_REVIEW) warn "2.1 artifact-debug — $ART_REASON (read from $(basename "$OPT_ARTIFACT"), not executed)" "$OPT_ARTIFACT"; [[ -n "$ART_EVIDENCE" ]] && detail "$ART_EVIDENCE" ;; *) skip "2.1 artifact-debug — $ART_REASON" ;; esac
@@ -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–§77: 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,12 @@ 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
80
+ shared-location-descriptor|2.3.6|source
81
+ dating-age-descriptor|2.3.6|metadata
82
+ on-demand-resources|2.1|source
83
+ required-device-capabilities|2.4.1|manifest
84
+ review-notes-completeness|2.1|metadata
79
85
  STATIC_GUIDELINE_TABLE
80
86
 
81
87
  if [[ "$STATIC_EMOJI_STATUS" != SKIP ]]; then
@@ -97,7 +97,7 @@ def context(root, metadata, main, excludes):
97
97
  except (OSError, UnicodeError, ValueError, plistlib.InvalidFileException, ExpatError) as exc:
98
98
  gaps.append(input_error(main, exc, root))
99
99
  extensions = {p: v for p, v in plists.items() if 'NSExtension' in v or 'NSAppClip' in v}
100
- return dict(root=root, metadata=metadata, main=main_data, files=files, gaps=gaps,
100
+ return dict(root=root, metadata=metadata, main=main_data, main_path=main if main_data else None, files=files, gaps=gaps,
101
101
  src=src, resources=resources, plists=plists, extensions=extensions)
102
102
 
103
103
 
@@ -314,6 +314,154 @@ 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
+
350
+ # §73–§77 — App Store Connect changes of November 2026. None of these is a guideline
351
+ # sentence; they are the submission-form and App Review Help rules Apple added around
352
+ # the October 16 guideline text: two new age-rating content descriptors (Shared
353
+ # Location, Dating and Relationships; every app must answer by 2027-01-12), the
354
+ # On-Demand Resources sunset for new apps in early 2027, and the App Review Help
355
+ # hub's review-notes expectations. All WARN, all judgment-call.
356
+ LOCATION_API = re.compile(r'\bCLLocationManager\b|\bimport\s+CoreLocation\b|request(?:WhenInUse|Always)Authorization|\bCLLocationUpdate\b')
357
+ LOCATION_KEYS = ('NSLocationWhenInUseUsageDescription', 'NSLocationAlwaysAndWhenInUseUsageDescription', 'NSLocationAlwaysUsageDescription')
358
+ LOCATION_SHARING = re.compile(
359
+ r'shar(?:e|ing)\s+(?:my\s+|your\s+|their\s+|live\s+|real-?time\s+|current\s+)*(?:location|whereabouts|position)|'
360
+ r'location\s+shar(?:e|ing)|live\s+location|(?:see|show|find|track)\s+(?:where\s+)?(?:your\s+|my\s+)?friends(?:\s+are)?(?:\s+on\s+the\s+map)?|'
361
+ r'friends?\s+(?:on\s+the\s+|nearby\s+)?map|nearby\s+(?:users|people|members|singles|friends)|people\s+(?:near|around)\s+you|'
362
+ r'share[A-Za-z]*Location|location[A-Za-z]*Shar', re.I)
363
+ DATING_TERMS = re.compile(
364
+ r'(?<![a-z])(?:dating|singles|matchmak\w*|soulmates?|hook-?ups?|flirt\w*|swipe\s+(?:right|left)|'
365
+ r'(?:ai|virtual)\s+(?:girlfriend|boyfriend|companion|partner|lover)|romantic\s+(?:partner|match(?:es)?|connections?)|'
366
+ r'find\s+(?:your\s+)?(?:love|a\s+partner|a\s+date)|meet\s+(?:local\s+)?singles)(?![a-z])', re.I)
367
+ ODR_SOURCE = re.compile(r'\bNSBundleResourceRequest\b|\b(?:conditionally)?[bB]eginAccessingResources\b|\bendAccessingResources\b')
368
+ ODR_BUILD = re.compile(r'ENABLE_ON_DEMAND_RESOURCES\s*=\s*YES|ON_DEMAND_RESOURCES_(?:INITIAL_INSTALL_TAGS|PREFETCH_ORDER)\s*=\s*"?[^;"\s]|'
369
+ r'ASSET_PACK_MANIFEST_URL_PREFIX|EMBED_ASSET_PACKS_IN_PRODUCT_BUNDLE\s*=\s*YES|\bKnownAssetTags\b')
370
+ # Capabilities every current device has, or that only state the binary's architecture.
371
+ BASELINE_CAPABILITIES = {'arm64', 'armv7', 'armv7s', 'metal', 'arkit', 'wifi', 'accelerometer', 'opengles-1', 'opengles-2', 'opengles-3'}
372
+ AI_PROVIDERS = (('OpenAI', r'api\.openai\.com|\bimport\s+OpenAI\b|\bOpenAIKit\b'),
373
+ ('Anthropic', r'api\.anthropic\.com|\bimport\s+Anthropic\b'),
374
+ ('Gemini', r'generativelanguage\.googleapis\.com|\bGoogleGenerativeAI\b|\bFirebaseVertexAI\b'),
375
+ ('Mistral', r'api\.mistral\.ai'), ('OpenRouter', r'openrouter\.ai'), ('Groq', r'api\.groq\.com'),
376
+ ('Perplexity', r'api\.perplexity\.ai'), ('Together', r'api\.together\.xyz'))
377
+ AI_IN_NOTES = re.compile(r'\bAI\b|\bLLM\b|language model|OpenAI|GPT|Anthropic|Claude|Gemini|Mistral|OpenRouter|Groq|Perplexity|Together|external service', re.I)
378
+ SUBSCRIPTION_API = re.compile(r'\.autoRenewable\b|SubscriptionInfo|\bRenewalInfo\b|subscriptionGroupIdentifier|SKProductSubscriptionPeriod|\bsubscriptionPeriod\b|Purchases\.shared\.|\bRevenueCat\b')
379
+ EXPIRED_IN_NOTES = re.compile(r'expired|lapsed|cancel+ed\s+subscription|non-?renewing|grace period|billing retry', re.I)
380
+ ROLE_WORDS = r'admin(?:istrator)?|teacher|student|parent|driver|rider|passenger|host|guest|coach|athlete|patient|doctor|clinician|therapist|provider|seller|buyer|merchant|vendor|employee|employer|manager|landlord|tenant|trainer|client|owner|moderator|organi[sz]er|attendee'
381
+ ROLE_SIGNAL = re.compile(r'(?:log\s*in|sign\s*in|log\s*on|continue|register|sign\s*up)\s+as\s+(?:an?\s+)?(' + ROLE_WORDS + r')\b|'
382
+ r'\b(' + ROLE_WORDS + r')\s+(?:account|login|log-?in|sign-?in|portal|mode|dashboard|role)\b', re.I)
383
+
384
+
385
+ def review_information(c):
386
+ folder = c['metadata'] / 'review_information'
387
+ texts = {}
388
+ if folder.is_dir() and not folder.is_symlink():
389
+ for name in ('notes', 'demo_user', 'demo_password'):
390
+ path = folder / (name + '.txt')
391
+ if path.is_file() and not path.is_symlink():
392
+ texts[name] = checked_text(path)
393
+ return folder, texts
394
+
395
+
396
+ def shared_location(c):
397
+ uses_location = hit_file(c['src'], LOCATION_API.pattern) or any(k in c['main'] for k in LOCATION_KEYS)
398
+ if not uses_location:
399
+ return outcome(reason='No location API or location usage key, so the Shared Location descriptor does not apply.')
400
+ copy = dict(c['src']); copy.update(c['resources'])
401
+ p = hit_file(copy, LOCATION_SHARING.pattern)
402
+ if not p:
403
+ for path in metadata_files(c, ['description', 'subtitle', 'promotional_text', 'keywords']):
404
+ if LOCATION_SHARING.search(checked_text(path)):
405
+ p = path
406
+ break
407
+ if p:
408
+ return outcome(True, 'Location API plus copy about sharing location with other people: App Store Connect added the "Shared Location" age-rating content descriptor in November 2026 and every app must answer the new questions by 2027-01-12 (updates are blocked until then); answer it honestly and check the resulting rating (2.3.6).', p)
409
+ return outcome(reason='Location API present but no location-sharing copy; still answer the Shared Location question in App Store Connect.')
410
+
411
+
412
+ def dating_descriptor(c):
413
+ files = metadata_files(c, ['name', 'subtitle', 'description', 'keywords', 'promotional_text'])
414
+ if not files:
415
+ return outcome(skip=True, reason='Store metadata unavailable.')
416
+ for p in files:
417
+ if DATING_TERMS.search(checked_text(p)):
418
+ return outcome(True, 'Dating / relationship / companion wording in store metadata: the "Dating and Relationships" age-rating content descriptor added in November 2026 sets the minimum rating to 18+ (Brazil A18) and every app must answer it by 2027-01-12; confirm the App Store Connect age rating and that the listing fits an 18+ app (2.3.6).', p)
419
+ return outcome(reason='No dating, matchmaking or AI-companion wording in store metadata.')
420
+
421
+
422
+ def on_demand_resources(c):
423
+ p = hit_file(c['src'], ODR_SOURCE.pattern)
424
+ if not p:
425
+ builds = {path: uncomment(text) for path, text in c['files'].items() if path.suffix == '.pbxproj'}
426
+ p = next((path for path, text in builds.items() if ODR_BUILD.search(text)), None)
427
+ if p:
428
+ return outcome(True, 'On-Demand Resources signal (NSBundleResourceRequest / asset-pack build settings): App Store Connect stops accepting new apps that use ODR in early 2027 and Apple directs developers to Background Assets; plan the migration before the first submission of a new app (2.1).', p)
429
+ return outcome(reason='No On-Demand Resources API or asset-pack build setting.')
430
+
431
+
432
+ def required_capabilities(c):
433
+ declared = c['main'].get('UIRequiredDeviceCapabilities')
434
+ if not declared:
435
+ return outcome(reason='No UIRequiredDeviceCapabilities entry; the app is offered to every compatible device.')
436
+ # Dictionary form: a false value means the capability must be ABSENT, which widens the set.
437
+ names = sorted(str(k) for k, v in declared.items() if v) if isinstance(declared, dict) else sorted(str(k) for k in declared) if isinstance(declared, list) else [str(declared)]
438
+ extra = [n for n in names if n not in BASELINE_CAPABILITIES]
439
+ if extra:
440
+ return outcome(True, 'UIRequiredDeviceCapabilities narrows the device set with ' + ', '.join(extra) + ': App Review Help says to list only capabilities the core functionality cannot work without, and reviewers test on devices that have them; drop any entry that is merely nice to have (2.4.1).', c['main_path'])
441
+ return outcome(reason='UIRequiredDeviceCapabilities lists only architecture / baseline entries.')
442
+
443
+
444
+ def review_notes(c):
445
+ if not c['metadata'].is_dir() or c['metadata'].is_symlink():
446
+ return outcome(skip=True, reason='Store metadata unavailable.')
447
+ folder, texts = review_information(c)
448
+ notes = texts.get('notes', '') # credentials files are values, not instructions
449
+ target = (folder / 'notes.txt') if 'notes' in texts else folder
450
+ provider = next((name for name, pattern in AI_PROVIDERS if hit_file(c['src'], pattern)), None)
451
+ if provider and not AI_IN_NOTES.search(notes):
452
+ return outcome(True, 'Code calls ' + provider + ' but the review notes (fastlane review_information/notes.txt) do not mention it: App Review Help asks for every external service the app depends on, AI services included, to be listed in the notes so the reviewer can exercise the feature (2.1).', target)
453
+ if hit_file(c['src'], SUBSCRIPTION_API.pattern) and not EXPIRED_IN_NOTES.search(notes):
454
+ return outcome(True, 'Auto-renewable subscription code without a demo account in an expired state: App Review Help asks for a second demo account whose subscription has expired so the reviewer can see the lapsed experience; add it to review_information/notes.txt (2.1).', target)
455
+ roles = set()
456
+ for text in list(c['src'].values()) + [checked_text(p) for p in metadata_files(c, ['description'])]:
457
+ for a, b in ROLE_SIGNAL.findall(text):
458
+ roles.add((a or b).lower())
459
+ missing = sorted(r for r in roles if not re.search(r'\b' + re.escape(r) + r'\b', notes, re.I))
460
+ if len(roles) >= 2 and missing:
461
+ return outcome(True, 'The app has more than one account type (' + ', '.join(sorted(roles)) + ') but the review notes cover only some of them; App Review Help asks for demo credentials for every account type, missing: ' + ', '.join(missing) + ' (2.1).', target)
462
+ return outcome(reason='Review notes cover the external services, subscription states and account types the code suggests.')
463
+
464
+
317
465
  CHECKS = {'release-notes-specificity': release_notes, 'device-restart-instructions': restart,
318
466
  'browser-engine': browser, 'intent-handler-parity': intents,
319
467
  'call-filter-controls': call_filter, 'face-authentication': face_auth,
@@ -321,20 +469,23 @@ CHECKS = {'release-notes-specificity': release_notes, 'device-restart-instructio
321
469
  'matter-extension': matter, 'extension-advertising': extension_ads,
322
470
  'ar-integration-depth': ar_depth, 'companion-app-required': companion,
323
471
  'game-center-id-sharing': game_ids, 'metadata-emoji': emoji,
324
- 'miniapp-native-bridge': miniapp, 'apple-endorsement-claims': endorsements}
472
+ 'miniapp-native-bridge': miniapp, 'apple-endorsement-claims': endorsements,
473
+ 'review-mode-gate': review_gate, 'shared-location-descriptor': shared_location,
474
+ 'dating-age-descriptor': dating_descriptor, 'on-demand-resources': on_demand_resources,
475
+ 'required-device-capabilities': required_capabilities, 'review-notes-completeness': review_notes}
325
476
 
326
477
 
327
478
  def evaluate(root, metadata, main, excludes):
328
479
  c = context(root, metadata, main, excludes)
329
480
  result = {}
330
- independent = {'release-notes-specificity', 'metadata-emoji', 'apple-endorsement-claims'}
481
+ independent = {'release-notes-specificity', 'metadata-emoji', 'apple-endorsement-claims', 'dating-age-descriptor'}
331
482
  if c['gaps']:
332
483
  result['_input_gaps'] = {'count': len(set(c['gaps'])), 'paths': sorted(set(c['gaps']))[:3]}
333
484
  for key, check in CHECKS.items():
334
485
  if key not in independent and not c['src']:
335
486
  result[key] = outcome(skip=True, reason='Source directory unavailable or no source files were read.')
336
487
  continue
337
- if key in {'intent-handler-parity', 'companion-app-required'} and not c['main']:
488
+ if key in {'intent-handler-parity', 'companion-app-required', 'required-device-capabilities'} and not c['main']:
338
489
  result[key] = outcome(skip=True, reason='Main Info.plist unavailable for manifest comparison.')
339
490
  continue
340
491
  try: