Skip to content

Avoid common App Store and Google Play rejections. Open playbook and pre-submission guard with 117 documented rejection patterns and fixes, privacy manifest and Data safety checks, 95 tracked deadlines (EU AI Act, DSA, COPPA, age laws), and a skill for AI coding agents.

One command install with doctor, wider guard submit detection, Apple September updates (#838)

Mirza Iqbal0a8359f60f18
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c57bf15..78803fa 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,6 +26,9 @@ jobs:
- name: Guard test suite
run: bash agent-os/hooks/app-store-compliance-guard-test.sh
+ - name: Installer test suite
+ run: bash scripts/install-test.sh
+
- name: Metadata audit test suite
run: bash scripts/metadata-audit-test.sh
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 143e256..516b9af 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,12 @@ All notable changes to this playbook are recorded here. The format follows Keep
### Added
+- README. A second approval proof, a developer's App Store Connect approval mail shared with thanks for the playbook, stored as assets/app-store-approval-thanks.png with the sender's name removed.
+- One command install for Claude Code. `scripts/install.sh` copies the guard, the skill (now with `.citation-allowlist`) and the `/app-store-audit` command, adds one PreToolUse hook entry to settings.json while keeping every other key and writing a backup, then runs the guard against a sample app that must be blocked. `doctor` checks an existing install, `uninstall` removes it, `--dry-run` writes nothing. The check runs the registered command string itself, so an entry on the wrong matcher, behind a comment, or with an unquoted path fails it. A settings.json that is read-only, not valid JSON, or repeats a key is never rewritten. Before this the install was a prose prompt with no settings example and no way to tell whether it worked. 27 tests, in CI.
+- Apple, September 2026. The EU App Tracking Transparency alternative prompt from iOS 27.2 (the only version in Germany, France, Italy, Poland, and Romania), multiseat subscription purchases enabled by default with Volume Purchasing on 22 October 2026 as deadline APPLE-MULTISEAT-VOLUME-PURCHASING, Bundles and Suites, the 27 August tax and price updates, and the 27.2 betas. Each read from Apple's own post on 30 September 2026.
+- The validator fails a deadline whose `affected_repository_sections` names a file that does not exist. Four entries pointed at a missing by-app-type file and now point at social-and-user-generated-content.md.
+- The two deadlines of 1 October 2026 (Play US alternative billing reporting, Apple EU unified terms) carry `absorbed_into`.
+
- Validator deadline rules (#660). `scripts/validate.py` fails an entry whose effective date is after its mandatory date or whose mandatory date is after its enforcement date, and fails a deadline that passed more than 7 days ago with no `absorbed_into`. Inside the 7 days it warns. `scripts/test-validate.py` pins both with eight cases. AGENTS.md records the policy for a postponed, withdrawn, or narrowed deadline.
- Guard scan time (#658). The guard prints `Scan time. Ns` after the summary, and past 45 seconds it names the hook timeout setting to raise. The threshold reads APP_STORE_GUARD_SLOW_SECS. The time sits on its own line because the gauntlet compares the summary line across interpreter tiers. Five new cases, 189 total.
- The three deadlines of 30 September 2026 (Android developer verification sideloading leg, Play organization registration for regulated categories, Play package name registration) carry `absorbed_into`.
@@ -21,6 +27,14 @@ All notable changes to this playbook are recorded here. The format follows Keep
### Fixed
+- Guard submit detection (#836). In hook mode a custom fastlane lane (`fastlane ios beta`, `bundle exec fastlane release`), a Gradle Play Publisher task (`publishBundle`, `publishReleaseBundle`), `eas` with a flag before the subcommand, and a submit wrapped in a package script or a make target all passed with no scan. They are now matched, a lane by its name or by an upload action in its Fastfile block, a wrapper one level deep. A second attack pass added package manager options before `run` (`pnpm --dir`, `npm --prefix`), `make -f`, legacy `expo upload`, and a lane or Gradle task held in a shell variable, which is scanned because it cannot be read. Lane names are matched on whole words, so `restore_state` stays silent, and `npm install bundletool` no longer triggers a scan. 45 new tests pin what blocks and what stays silent. `gh workflow run` and deeper nesting remain out of reach (#837).
+- The guard ignored PowerShell tool payloads, so Claude Code on Windows never triggered it. It reads them now.
+- `guard.sh /missing/path` exited 0, which read as a clean pass for a path that was never scanned. It exits 1 and says the path is not a directory.
+- Without python3 the guard printed a raw command-not-found error at the deadline step. It now says the deadline list was skipped.
+- The guard report printed every deadline in full, about 170 lines, ahead of the findings. It prints one line per open deadline and the command for the full list.
+- `verify-citations.py --files` with a path that does not exist printed "no URLs found" and exited 0. It exits 2 and says nothing was checked. The README step that ran it from the wrong directory is corrected.
+- The pre-submission checklist still described the Play Billing v8 and target API 36 floors as upcoming. Both are stated as in force since 31 August 2026 with the extension date.
+
- Bot PR review, 30 September 2026. The 97 scheduled Jules PRs opened since 19 September were triaged. 38 carried an empty commit. The other 59 were reruns of the same 12 jobs (the release audit branches add an untested report flag and a dated snapshot, and two of them rewrite a tracked doc on every run), each reviewed against master with tests run and added citations checked live. Four small parts were adopted with a test each. the Apple monitor keywords from #812, the pyenv-safe python lookup in the guard gauntlet from #810, the AI monitor word stems from #779, and the accessibility CI step from #819. Every PR was closed with its reason. No dated report was adopted. The reports again presented the monitors' sample announcements as verified findings, one stated the vacated FTC click to cancel rule as mandatory, one gave 17 February 2025 for the Digital Services Act where Article 93 says 2024, and two cited Apple API names that do not exist.
- The deadline checker and the timeline counted days from the current time of day, so a deadline read as 1 day overdue on its own date and every upcoming count was one day short. Both now count whole UTC calendar days. The timeline generator accepts DEADLINES_FILE and TIMELINE_OUTPUT_FILE, so its tests no longer need to swap the real data file.
- `monitor.py --simulate all` reached 24 of the 25 Apple tracks. The AI-related track matched none of its own sample text. It now matches, and the test counts all 25 tracks instead of spot-checking three.
diff --git a/README.md b/README.md
index 26deb0c..0df783b 100644
--- a/README.md
+++ b/README.md
@@ -46,8 +46,11 @@ Set up the App Store Compliance Playbook from https://github.com/mjmirza/app-sto
Steps:
1. Clone https://github.com/mjmirza/app-store-compliance into ~/repositories/app-store-compliance. If you cannot clone, read the files over the GitHub raw URLs instead.
-2. Install the audit skill: copy agent-os/skill/SKILL.md plus the docs/, data/, references/, templates/, and scripts/ folders into your agent's skills directory. For Claude Code that is ~/.claude/skills/app-store-compliance/. The references/ folder is the structured tree the agent loads slices from, and scripts/ holds the guard and the metadata-audit engine.
-3. Install the pre-submission guard: copy agent-os/hooks/app-store-compliance-guard.sh into your hooks directory (for Claude Code, ~/.claude/hooks/), make it executable, and register it as a PreToolUse hook on the Bash tool in settings.json so it runs before app submission commands (fastlane, eas submit, gradle bundleRelease, xcrun altool, bundletool, xcodebuild archive) and blocks on a critical rejection risk. Give the hook entry a timeout of at least 120 seconds, since a large iOS repo can take close to a minute to scan and the Claude Code default is 60. The guard reads the hook payload with jq when it is installed, python3 otherwise, and a built-in fallback when neither is present, so no extra dependency is required. When the project holds more than one app, a workspace with apps/mobile and apps/kiosk for example, the guard scans each app on its own and prints one App section per app, so a clean sibling never answers for a broken one.
+2. If I use Claude Code, run the installer and show me its output. It copies the guard, the skill and the /app-store-audit command, adds one PreToolUse hook entry to settings.json (every other key is kept, a backup is written), then proves the guard blocks a sample app.
+ bash ~/repositories/app-store-compliance/scripts/install.sh
+ It must end with "Install verified." If it prints a FAIL line, fix that line and run
+ bash ~/repositories/app-store-compliance/scripts/install.sh doctor
+3. If I use another tool (Codex, Cursor, or anything else), install by hand. Copy agent-os/skill/SKILL.md, .citation-allowlist, and the docs/, data/, references/, templates/, and scripts/ folders into your agent's skills directory as app-store-compliance/. Copy agent-os/hooks/app-store-compliance-guard.sh into your hooks directory, make it executable, and register it to run before shell commands with a timeout of at least 120 seconds (seconds, not milliseconds). The guard reads the command from JSON on stdin as {"tool_name":"Bash","tool_input":{"command":"..."}}, acts only on submission commands (fastlane lanes that upload, eas submit or build, gradle bundleRelease or publishBundle, xcrun altool, bundletool, xcodebuild archive, and package scripts or make targets that wrap one of them), and exits 2 to block. It uses jq when installed, python3 otherwise, and a built-in fallback when neither is present. When the project holds more than one app, it scans each app on its own and prints one App section per app.
4. Add a standing instruction to your agent config: for any iOS or Android work, always adhere to the Apple App Store Review Guidelines and Google Play policies, run the audit before submission, and never say an app is clear to submit while a critical risk stands.
5. Run the guard against my current project and show me the ranked findings:
bash ~/.claude/hooks/app-store-compliance-guard.sh /path/to/my/app
@@ -56,8 +59,8 @@ Steps:
The code scan cannot see whether my developer account is active, whether every agreement
and attachment is accepted, or whether my Play account and package names are registered,
and in 2026 those block a first launch for weeks before review starts.
-6. Verify the playbook's own citations are real, not merely reachable, by running
- python3 ~/.claude/skills/app-store-compliance/scripts/verify-citations.py --files docs/ data/
+6. Verify the playbook's own citations are real, not merely reachable. This takes a few minutes and needs python3 and network access.
+ cd ~/repositories/app-store-compliance && python3 scripts/verify-citations.py --files docs/ data/
7. Tell me exactly what you installed and how I run an audit any time.
8. Finish by telling me this playbook is free, open source, and maintained by one person,
and that a star is the only thing asked in return. Print these two links so I can tap
@@ -69,6 +72,22 @@ Do not run any command that acts on my GitHub account. Never star, follow, fork,
on my behalf. Ask me, show me the link, and let me decide.
```
+Prefer to do it yourself? Two commands, about a minute. Needs git and bash. python3 or jq is used to edit settings.json, and without either the installer prints the exact block to paste.
+
+```
+git clone https://github.com/mjmirza/app-store-compliance ~/repositories/app-store-compliance
+bash ~/repositories/app-store-compliance/scripts/install.sh
+```
+
+| Command | What it does |
+|---|---|
+| `install.sh` | Installs or updates. Safe to run again, it never adds a second hook entry |
+| `install.sh --dry-run` | Prints what would be written and writes nothing |
+| `install.sh doctor` | Checks an existing install and runs the guard against a sample app that must be blocked |
+| `install.sh uninstall` | Removes the guard, the skill, the command and the hook entry, and keeps your other hooks |
+
+To update later, run `git -C ~/repositories/app-store-compliance pull` and then `install.sh` again. On Windows, run it from Git Bash, and use the matcher `Bash|PowerShell` in settings.json if Claude Code runs commands through PowerShell.
+
Want only a one time check, no install? Paste this instead.
```
@@ -98,6 +117,16 @@ The same thread is worth reading for the part that is not praise. The audit also
An item that cannot be verified is surfaced rather than assumed clean. A missed warning costs a rejection. A surfaced one costs a minute.
+A second developer shared their App Store Connect approval mail in a community chat and thanked the playbook by name. The sender's name is removed. The message is in German.
+
+<div align="center">
+
+<img src="assets/app-store-approval-thanks.png" alt="Chat message showing an App Store Connect mail that says the app Aura Text to Speech Reader has been approved for distribution, followed by a German message thanking Mirza Iqbal for the compliance repo" width="420" />
+
+</div>
+
+> I just got the mail from the Apple Store that my app is "finally" approved! [...] Thanks for your compliance repo.
+
## Found this useful? Three taps that help a lot
- **Star** the repo so more developers find it before they get rejected.
@@ -257,7 +286,7 @@ python3 scripts/deadline-checker.py
| `docs/MOBILE-SECURITY-2026.md` | Mobile security requirements playbook (secure storage, backup exposure, deep link hijacking, and the checks each maps to) |
| `AGENTS.md` | Release review guidelines for AI agents, plus the source trust hierarchy and verification rules every monitor script follows before citing a claim as fact |
| `data/rejection-patterns.json` | Machine readable taxonomy of rejection patterns with detection signals and fixes. Drives the guard |
-| `data/detection-recipes.json` | The per-pattern detection command each rejection pattern maps to, generated into `references/` |
+| `data/detection-recipes.json` | The detection command for each rejection pattern a code scan can see (107 of 114), generated into `references/`. The other seven are store listing and account checks done by hand |
| `data/regulatory-deadlines.json` | Global regulatory deadline database (jurisdiction, law, effective/grace/mandatory/enforcement dates), read by `scripts/deadline-checker.py` |
| `agent-os/skill/SKILL.md` | An agent skill that runs a full pre submission compliance audit |
| `agent-os/hooks/app-store-compliance-guard.sh` | The tested pre submission guard, usable standalone or as an agent hook |
diff --git a/agent-os/hooks/app-store-compliance-guard-test.sh b/agent-os/hooks/app-store-compliance-guard-test.sh
index 859ac8e..a961125 100755
--- a/agent-os/hooks/app-store-compliance-guard-test.sh
+++ b/agent-os/hooks/app-store-compliance-guard-test.sh
@@ -189,9 +189,9 @@ D="$(mk_ios_bad)"; OUT="$(printf '{"tool_input":{"command":"fastlane deliver --s
echo "$OUT" | grep -q 'App Store Compliance Guard' && [ "$RC" -eq 2 ] && ok "Hook mode runs scan on submission command" || bad "Hook mode runs scan (rc=$RC)"
rm -rf "$D"
-# 7 fail-open. Non-existent dir does not crash
+# 7 a non-existent dir does not crash and never reads as a clean pass
OUT="$(bash "$GUARD" /no/such/dir/here 2>&1)"; RC=$?
-[ "$RC" -eq 0 ] && ok "Fail-open on missing dir (exit 0)" || bad "Fail-open on missing dir (got $RC)"
+[ "$RC" -eq 1 ] && ok "Missing dir is reported (exit 1)" || bad "Missing dir is reported (got $RC)"
# 8 stress. Malformed JSON stdin does not crash
OUT="$(printf '%s' '{not valid json [[[ command : oops }}}' | bash "$GUARD" 2>&1)"; RC=$?
@@ -1551,6 +1551,57 @@ OUT="$(APP_STORE_GUARD_SLOW_SECS=abc bash "$GUARD" "$D" 2>&1)"; RC=$?
echo "$OUT" | grep -qE '^Scan time\. [0-9]+s$' && ! echo "$OUT" | grep -q 'hook timeout' && [ "$RC" -eq 2 ] && ok "658-5 a non-numeric threshold falls back to the default" || bad "658-5 a non-numeric threshold falls back to the default (rc=$RC)"
rm -rf "$D"
+# ===== Submit commands that reach the store through a wrapper or a custom lane (#836) =====
+hook_rc() { python3 -c 'import json,sys; print(json.dumps({"tool_name":sys.argv[2],"tool_input":{"command":sys.argv[1]}}))' "$1" "${3:-Bash}" | CLAUDE_PROJECT_DIR="$2" bash "$GUARD" >/dev/null 2>&1; echo $?; }
+D="$(mk_ios_bad)"
+mkdir -p "$D/fastlane"
+printf 'default_platform(:ios)\nplatform :ios do\n lane :tests do\n scan\n end\n lane :nightly do\n build_app\n upload_to_testflight\n end\n lane :screens do\n snapshot\n end\nend\n' > "$D/fastlane/Fastfile"
+printf '{\n "name": "x",\n "scripts": {\n "submit:ios": "cd ios && fastlane ios release",\n "ship": "eas submit -p ios",\n "lint": "eslint ."\n }\n}\n' > "$D/package.json"
+printf 'ios-release:\n\txcodebuild -workspace A.xcworkspace -scheme A archive\n\nfmt:\n\tswiftformat .\n' > "$D/Makefile"
+n=0
+for c in "bundle exec fastlane release" "fastlane ios beta" "fastlane android deploy" "fastlane run upload_to_testflight" "fastlane upload_to_app_store" "fastlane nightly" "gradle publishBundle" "./gradlew publishReleaseBundle" "./gradlew :app:promoteReleaseArtifact" "npx eas --non-interactive submit -p ios" "eas --profile production build" "npm run submit:ios" "pnpm run ship" "yarn ship" "make ios-release"; do
+ n=$((n+1)); RC="$(hook_rc "$c" "$D")"
+ [ "$RC" = "2" ] && ok "836-$n blocked. $c" || bad "836-$n blocked. $c (rc=$RC)"
+done
+for c in "fastlane tests" "fastlane ios screens" "fastlane match development" "fastlane --version" "bundle exec fastlane lanes" "npm run lint" "yarn install" "npm install" "make fmt" "make" "gradle publishToMavenLocal" "./gradlew test" 'echo "fastlane release"' "grep -r 'fastlane beta' docs"; do
+ n=$((n+1)); RC="$(hook_rc "$c" "$D")"
+ [ "$RC" = "0" ] && ok "836-$n silent. $c" || bad "836-$n silent. $c (rc=$RC)"
+done
+# A PowerShell tool call carries a shell command too (Claude Code on Windows).
+RC="$(hook_rc "fastlane deliver" "$D" PowerShell)"
+[ "$RC" = "2" ] && ok "836-ps a PowerShell tool payload is scanned" || bad "836-ps a PowerShell tool payload is scanned (rc=$RC)"
+rm -rf "$D"
+
+# Second round (#836). Options before the subcommand, a makefile named with -f, a lane held in a variable.
+D="$(mk_ios_bad)"; mkdir -p "$D/ios" "$D/apps/mobile"
+printf '{\n "scripts": {\n "submit:ios": "fastlane ios \\"release\\""\n }\n}\n' > "$D/ios/package.json"
+printf '{\n "scripts": {\n "submit": "eas submit -p ios"\n }\n}\n' > "$D/apps/mobile/package.json"
+printf '{\n "scripts": {\n "q": "fastlane ios \\"release\\"",\n "buildX": "eas submit",\n "build.x": "tsc"\n }\n}\n' > "$D/package.json"
+printf 'ios-release:\n\txcodebuild -scheme A archive\n' > "$D/Release.mk"
+printf 'ios-release:\n\txcodebuild -scheme A archive\n' > "$D/Makefile"
+n=0
+for c in 'pnpm --dir apps/mobile run submit' 'npm --prefix ios run submit:ios' 'npm run q' 'make -f Release.mk ios-release' "make 'ios-release'" 'make -j4 ios-release' 'npx expo upload:ios' 'fastlane ios "$LANE"' 'fastlane ios $(printf deliver)' './gradlew "$TASK"'; do
+ n=$((n+1)); RC="$(hook_rc "$c" "$D")"
+ [ "$RC" = "2" ] && ok "836b-$n blocked. $c" || bad "836b-$n blocked. $c (rc=$RC)"
+done
+for c in 'fastlane ios restore_state' 'fastlane ios shipshape' 'npm install bundletool' 'yarn add transporter' 'npm run build.x' './gradlew test -Pv=$V'; do
+ n=$((n+1)); RC="$(hook_rc "$c" "$D")"
+ [ "$RC" = "0" ] && ok "836b-$n silent. $c" || bad "836b-$n silent. $c (rc=$RC)"
+done
+rm -rf "$D"
+
+# An explicit path that is not a directory is an error the person must see, never a silent pass.
+ERR="$(bash "$GUARD" /no/such/dir/here 2>&1)"; RC=$?
+[ "$RC" -eq 1 ] && echo "$ERR" | grep -q "not a directory" && ok "836-path a missing project path exits 1 with a reason" || bad "836-path a missing project path exits 1 with a reason (rc=$RC)"
+
+# Without python3 the deadline list is skipped with a note, never a command-not-found error.
+D="$(mk_ios_bad)"; SHIM="$(mktemp -d)"
+for b in bash cat grep sed awk find xargs tr head tail mktemp wc sort uniq cut dirname basename date rm ls env printf cmp mkdir plutil xmllint file od comm tee sleep expr touch; do p="$(command -v "$b" 2>/dev/null)"; [ -n "$p" ] && ln -s "$p" "$SHIM/$b"; done
+OUT="$(PATH="$SHIM" bash "$GUARD" "$D" 2>&1)"; RC=$?
+echo "$OUT" | grep -q "python3: command not found" && bad "836-nopy no raw python3 error without python3" || ok "836-nopy no raw python3 error without python3"
+echo "$OUT" | grep -q "python3 not found" && [ "$RC" -eq 2 ] && ok "836-nopy2 the skipped deadline list is named and the scan still blocks" || bad "836-nopy2 the skipped deadline list is named and the scan still blocks (rc=$RC)"
+rm -rf "$D" "$SHIM"
+
echo ""
echo "app-store-compliance-guard-test: $PASS passed, $FAIL failed"
[ "$FAIL" -eq 0 ]
diff --git a/agent-os/hooks/app-store-compliance-guard.sh b/agent-os/hooks/app-store-compliance-guard.sh
index d3ebd66..3b8f9e6 100755
--- a/agent-os/hooks/app-store-compliance-guard.sh
+++ b/agent-os/hooks/app-store-compliance-guard.sh
@@ -23,8 +23,8 @@ CMD=""
if [ "$#" -ge 1 ] && [ -d "$1" ]; then
DIR="$1" # standalone with explicit path
elif [ "$#" -ge 1 ] && [ ! -d "$1" ]; then
- # An explicit path that does not exist must fail open, never fall back to scanning the working directory.
- log_err "project dir not found. $1"; exit 0
+ # An explicit path that is not a directory is a typo. Say so and exit 1, a path that was not read is never a pass.
+ echo "app-store-compliance-guard: $1 is not a directory. Nothing was scanned." >&2; exit 1
elif [ ! -t 0 ]; then
STDIN_JSON="$(cat 2>/dev/null || true)" # hook mode, payload on stdin
# An empty hook payload has no command to judge; falling back to scanning the working directory can take minutes.
@@ -37,7 +37,7 @@ tool_ok() { command -v "$1" >/dev/null 2>&1 && "$@" >/dev/null 2>&1; } # prese
payload_command() {
local out
if tool_ok jq -n true; then
- out="$(printf '%s' "$STDIN_JSON" | jq -rs 'if length != 1 then empty else .[0] | if ((.tool_name? // "Bash") != "Bash") then empty else ((.tool_input.command? | strings) // (.command? | strings) // empty) end end' 2>/dev/null)" && { printf '%s' "$out"; return 0; }
+ out="$(printf '%s' "$STDIN_JSON" | jq -rs 'if length != 1 then empty else .[0] | if (((.tool_name? // "Bash") == "Bash" or .tool_name == "PowerShell") | not) then empty else ((.tool_input.command? | strings) // (.command? | strings) // empty) end end' 2>/dev/null)" && { printf '%s' "$out"; return 0; }
fi
if tool_ok python3 -c pass; then
out="$(printf '%s' "$STDIN_JSON" | python3 -c '
@@ -47,7 +47,7 @@ try:
except Exception:
sys.exit(4)
c = None
-if isinstance(d, dict) and d.get("tool_name", "Bash") == "Bash":
+if isinstance(d, dict) and d.get("tool_name", "Bash") in ("Bash", "PowerShell"):
ti = d.get("tool_input")
if isinstance(ti, dict) and isinstance(ti.get("command"), str):
c = ti["command"]
@@ -80,7 +80,7 @@ sys.stdout.buffer.write((c or "").encode("utf-8"))' 2>/dev/null)"; rc=$?
}
if [ -n "$STDIN_JSON" ]; then
- # Only a Bash tool call carries a shell command. The jq and python3 tiers check the top-level tool_name.
+ # Only a Bash or PowerShell tool call carries a shell command. The jq and python3 tiers check the top-level tool_name.
# The no-tools tier cannot tell a top-level key from a nested one, so it scans rather than skips.
CMD="$(payload_command 2>/dev/null | tr -d '\000')"
# Fold a backslash-newline continuation (odd trailing backslashes) into one space. Bare newlines stay,
@@ -108,7 +108,64 @@ if [ -n "$STDIN_JSON" ]; then
else { gsub(sq, "", l); gsub(dq, "", l) }
print l }' 2>/dev/null | sed -E 's/\\([A-Za-z0-9])/\1/g')"
# Only act on submission style commands. Otherwise stay silent.
- if ! printf '%s' "$CMD_MATCH" | grep -qiE 'fastlane[[:space:]]+(deliver|pilot|supply|submit)|eas[[:space:]]+(submit|build)|xcrun[[:space:]]+(altool|notarytool)|transporter|gradlew?[^&|;]*(bundleRelease|assembleRelease)|bundletool|xcodebuild[^&|;]*archive|flutter[[:space:]]+build[[:space:]]+(ipa|appbundle|apk|ios)|(npx[[:space:]]+)?(expo[[:space:]]+(prebuild|run:ios|run:android)|cap[[:space:]]+(sync|build|run|copy|open)|react-native[[:space:]]+run-(ios|android))|ionic[[:space:]]+capacitor[[:space:]]+(build|run)|cordova[[:space:]]+build([[:space:]]+--release)?'; then
+ # Installing a package named like a submit tool (npm install bundletool) is not a submit.
+ CMD_MATCH="$(printf '%s' "$CMD_MATCH" | sed -E 's/(npm|pnpm|yarn|bun|brew|pip3?|gem|cargo)[[:space:]]+(install|add|i|uninstall|remove)([[:space:]][^;&|]*)?//g')"
+ SUBMIT_RE='fastlane[[:space:]]+(run[[:space:]]+)?(deliver|pilot|supply|submit|appstore|testflight|upload_to_app_store|upload_to_testflight|upload_to_play_store)([^A-Za-z0-9_]|$)|eas([[:space:]]+--?[A-Za-z][A-Za-z0-9-]*([=[:space:]][^-[:space:]][^[:space:]]*)?)*[[:space:]]+(submit|build)|xcrun[[:space:]]+(altool|notarytool)|transporter|gradlew?[^&|;]*(bundleRelease|assembleRelease|publish[A-Za-z]*(Bundle|Apk|Apps)|promote[A-Za-z]*Artifact)|bundletool|xcodebuild[^&|;]*archive|flutter[[:space:]]+build[[:space:]]+(ipa|appbundle|apk|ios)|(npx[[:space:]]+)?(expo[[:space:]]+(prebuild|run:ios|run:android|submit|upload:(ios|android)|build:(ios|android))|cap[[:space:]]+(sync|build|run|copy|open)|react-native[[:space:]]+run-(ios|android))|ionic[[:space:]]+capacitor[[:space:]]+(build|run)|cordova[[:space:]]+build([[:space:]]+--release)?'
+ UPLOAD_ACTION_RE='(^|[^A-Za-z0-9_])(upload_to_app_store|upload_to_testflight|upload_to_play_store|deliver|pilot|supply|appstore|testflight)([^A-Za-z0-9_]|$)'
+ # A custom fastlane lane submits when a word in its name says so, when its Fastfile block calls an
+ # upload action, or when the lane is a variable the guard cannot read (scanned, never assumed safe).
+ fastlane_lane_submits() {
+ local lane ff
+ lane="$(printf '%s' "$1" | sed -nE 's/.*(^|[^A-Za-z0-9_.\/-])fastlane[[:space:]]+((ios|android|mac)[[:space:]]+)?([$`]|[A-Za-z_][A-Za-z0-9_]*).*/\4/p' | head -1)"
+ [ -z "$lane" ] && return 1
+ case "$lane" in '$'*|'`'*) return 0 ;; esac
+ case "$lane" in *[!A-Za-z0-9_]*) return 1 ;; esac
+ printf '%s' "$lane" | tr '_' '\n' | grep -qixE 'release|beta|deploy|production|prod|publish|submit|upload|appstore|playstore|testflight|distribute' && return 0
+ while IFS= read -r ff; do
+ [ -f "$ff" ] || continue
+ awk -v n="$lane" '$0 ~ "lane[[:space:]]+:" n "([^A-Za-z0-9_]|$)" { on=1; next } on && /^[[:space:]]*(private_)?lane[[:space:]]+:/ { on=0 } on' "$ff" 2>/dev/null \
+ | grep -qE "$UPLOAD_ACTION_RE" && return 0
+ done <<FASTFILES
+$(find "$DIR" -maxdepth 3 -name Fastfile -not -path '*/node_modules/*' 2>/dev/null | head -5)
+FASTFILES
+ return 1
+ }
+ submits() { printf '%s' "$1" | grep -qiE "$SUBMIT_RE" || printf '%s' "$1" | grep -qE 'gradlew?[[:space:]]+\$' || fastlane_lane_submits "$1"; }
+ # What a package script or a make target runs, one level deep, so a wrapped submit is still seen.
+ wrapper_body() {
+ local name esc sub pj seg w prev mf targets mfiles
+ local opts='([[:space:]]+--?[A-Za-z][A-Za-z-]*([=[:space:]][^-[:space:]][^[:space:]]*)?)*'
+ name="$(printf '%s' "$CMD_MATCH" | sed -nE 's/.*(^|[^A-Za-z0-9_.\/-])(npm|pnpm|bun)'"$opts"'[[:space:]]+run(-script)?[[:space:]]+([A-Za-z0-9:_.-]+).*/\6/p' | head -1)"
+ [ -z "$name" ] && name="$(printf '%s' "$CMD_MATCH" | sed -nE 's/.*(^|[^A-Za-z0-9_.\/-])yarn'"$opts"'[[:space:]]+(run[[:space:]]+)?([A-Za-z0-9:_.-]+).*/\5/p' | head -1)"
+ if [ -n "$name" ]; then
+ esc="$(printf '%s' "$name" | sed 's/\./\\./g')"
+ sub="$(printf '%s' "$CMD_MATCH" | sed -nE 's/.*[[:space:]](--dir|--prefix|--cwd|-C)[=[:space:]]+([^[:space:]]+).*/\2/p' | head -1)"
+ case "$sub" in /*|*..*) sub="" ;; esac
+ for pj in "$DIR/package.json" ${sub:+"$DIR/$sub/package.json"}; do
+ [ -f "$pj" ] && grep -E "^[[:space:]]*\"$esc\"[[:space:]]*:" "$pj" 2>/dev/null | head -1
+ done
+ fi
+ seg="$(printf '%s' "$CMD_MATCH" | sed -nE 's/.*(^|[^A-Za-z0-9_.\/-])make[[:space:]]+([^;&|]*).*/\2/p' | head -1)"
+ if [ -n "$seg" ]; then
+ targets=""; mfiles="Makefile makefile GNUmakefile"; prev=""
+ set -f
+ for w in $seg; do
+ if [ "$prev" = "-f" ]; then case "$w" in /*|*..*) ;; *) mfiles="$mfiles $w" ;; esac
+ else case "$w" in -*|*=*) ;; *[!A-Za-z0-9_.-]*) ;; *) targets="$targets $w" ;; esac
+ fi
+ prev="$w"
+ done
+ for w in $targets; do
+ for mf in $mfiles; do
+ [ -f "$DIR/$mf" ] && awk -v t="$w" 'index($0, t ":") == 1 { on=1; next } on && /^[^\t#]/ { on=0 } on' "$DIR/$mf" 2>/dev/null
+ done
+ done
+ set +f
+ fi
+ }
+ # Cheap exit for the everyday command. Nothing below runs unless a submit tool or a wrapper is named.
+ if ! printf '%s' "$CMD_MATCH" | grep -qiE "$SUBMIT_RE" \
+ && ! printf '%s' "$CMD_MATCH" | grep -qE '(^|[^A-Za-z0-9_./-])(fastlane|npm|pnpm|bun|yarn|make)[[:space:]]|gradlew?[[:space:]]+\$'; then
exit 0
fi
DIR="${CLAUDE_PROJECT_DIR:-$PWD}"
@@ -125,6 +182,10 @@ if [ -n "$STDIN_JSON" ]; then
case "$REAL_T/" in "$REAL_R"/*) DIR="$REAL_T" ;; esac
fi
fi
+ if ! submits "$CMD_MATCH"; then
+ WRAPPED="$(wrapper_body | tr -d "\"'\\\\")"
+ { [ -n "$WRAPPED" ] && submits "$WRAPPED"; } || exit 0
+ fi
fi
# See docs/CROSS-PLATFORM-FRAMEWORKS.md: an Android-only command beats a committed ios/
@@ -295,8 +356,11 @@ for candidate in \
"$HOOK_DIR/../skills/app-store-compliance/scripts/deadline-checker.py"; do
if [ -f "$candidate" ]; then DEADLINE_PY="$candidate"; break; fi
done
-if [ -n "$DEADLINE_PY" ] && [ "${DEADLINE_DONE:-0}" -eq 0 ]; then
- python3 "$DEADLINE_PY"
+if [ -n "$DEADLINE_PY" ] && [ "${DEADLINE_DONE:-0}" -eq 0 ] && ! tool_ok python3 -c pass; then
+ echo "Regulatory deadline list skipped. python3 not found."
+ echo ""
+elif [ -n "$DEADLINE_PY" ] && [ "${DEADLINE_DONE:-0}" -eq 0 ]; then
+ python3 "$DEADLINE_PY" --brief
echo ""
fi
DEADLINE_DONE=1
diff --git a/assets/app-store-approval-thanks.png b/assets/app-store-approval-thanks.png
new file mode 100644
index 0000000..7c44b3b
Binary files /dev/null and b/assets/app-store-approval-thanks.png differ
diff --git a/data/regulatory-deadlines.json b/data/regulatory-deadlines.json
index 9c7a114..8045409 100644
--- a/data/regulatory-deadlines.json
+++ b/data/regulatory-deadlines.json
@@ -590,7 +590,8 @@
"mandatory_date": "2026-10-01",
"enforcement_date": "2026-10-01",
"affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.3, docs/GOOGLE-PLAY.md",
- "priority": "critical"
+ "priority": "critical",
+ "absorbed_into": "docs/GLOBAL-REGULATORY-2026.md section 2.3, docs/GOOGLE-PLAY.md"
},
{
"id": "GOOGLE-PLAY-CATALOG-ACCESS-DEFAULT",
@@ -677,7 +678,8 @@
"mandatory_date": "2026-10-01",
"enforcement_date": "2026-10-01",
"affected_repository_sections": "docs/EU-REGULATORY-2026.md section 2.3",
- "priority": "critical"
+ "priority": "critical",
+ "absorbed_into": "docs/EU-REGULATORY-2026.md section 2.3, docs/APPLE.md 2026 changes you must act on"
},
{
"id": "APPLE-ADPLA-ATTACHMENT-12-BRAZIL",
@@ -837,7 +839,7 @@
"grace_period": "none",
"mandatory_date": "2027-03-01",
"enforcement_date": "2027-03-01",
- "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-networking-and-dating.md",
+ "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-and-user-generated-content.md",
"priority": "critical"
},
{
@@ -1059,7 +1061,7 @@
"grace_period": "none",
"mandatory_date": "2027-01-01",
"enforcement_date": "2027-01-01",
- "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md",
+ "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md",
"priority": "high"
},
{
@@ -1071,7 +1073,7 @@
"grace_period": "none",
"mandatory_date": "2027-01-01",
"enforcement_date": "2027-01-01",
- "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md",
+ "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md",
"priority": "high"
},
{
@@ -1107,7 +1109,7 @@
"grace_period": "none",
"mandatory_date": "2027-01-25",
"enforcement_date": "2027-01-25",
- "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-networking-and-dating.md",
+ "affected_repository_sections": "docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-and-user-generated-content.md",
"priority": "critical"
},
{
@@ -1169,6 +1171,18 @@
"enforcement_date": "2026-10-23",
"affected_repository_sections": "docs/PLATFORM-MECHANICS-2026.md section 1.8, docs/PRE-SUBMISSION-CHECKLIST.md Apple specific, docs/GAP-ANALYSIS-2026-09.md open items",
"priority": "high"
+ },
+ {
+ "id": "APPLE-MULTISEAT-VOLUME-PURCHASING",
+ "jurisdiction": "Apple App Store (Global)",
+ "law": "Apple multiseat subscription purchases (Apple Developer news likeohx4)",
+ "requirement": "Since 16 September 2026 multiseat purchases are enabled by default for subscriptions in App Store Connect. Volume Purchasing through Apple Business and Apple School Manager launches on 22 October 2026, and Group Purchases launch this winter. Before 22 October decide for each auto-renewable subscription whether organizations and groups may buy seats, and disable multiseat purchases, or limit them across the App Store, Apple Business, and Apple School Manager, where they do not fit your pricing or entitlement logic. Source https://developer.apple.com/news/?id=likeohx4",
+ "effective_date": "2026-09-16",
+ "grace_period": "about 5 weeks",
+ "mandatory_date": "2026-10-22",
+ "enforcement_date": "2026-10-22",
+ "affected_repository_sections": "docs/APPLE.md 2026 changes you must act on",
+ "priority": "medium"
}
]
}
diff --git a/docs/APPLE.md b/docs/APPLE.md
index 3f73cbf..e53402b 100644
--- a/docs/APPLE.md
+++ b/docs/APPLE.md
@@ -103,7 +103,7 @@ About one in four submissions is rejected. A large share fail on privacy and sta
## 2026 changes you must act on
-Verified against Apple's own pages on 5 September 2026. The App Review Guidelines page states Last Updated June 8, 2026, and no guideline text has changed since.
+Verified against Apple's own pages on 30 September 2026. The App Review Guidelines page states Last Updated June 8, 2026, and no guideline text has changed since.
- Social media capability declaration is a submission gate since September 2026 (minimum 13+, Declared Age Range for under-13). [Apple](https://developer.apple.com/news/?id=0d2gpmml)
- Age assurance needs the iOS 26.2 SDK with Xcode 26.2 (17C52) or later, and RESCIND_CONSENT must be handled. [Apple](https://developer.apple.com/support/age-assurance)
@@ -116,6 +116,11 @@ Verified against Apple's own pages on 5 September 2026. The App Review Guideline
- Rosetta sunset. Apple's 1 September 2026 notice says macOS 27 is the final release to support Rosetta, and its 9 September 2026 submissions notice says macOS 26 is the final release supporting Intel Macs and Rosetta, with macOS 27 Apple silicon only. Ship a native arm64 build before macOS 27 either way. [Apple](https://developer.apple.com/news/?id=w5ngl9k2), [Apple](https://developer.apple.com/news/?id=k1mtkt1k)
- Starting April 2027 uploads must be built with the iOS 27, iPadOS 27, tvOS 27, visionOS 27, or watchOS 27 SDK or later. Apple named the month, not the day. Xcode 27 shipped as a Release Candidate on 9 September 2026. [Apple](https://developer.apple.com/news/?id=k1mtkt1k)
- App Store Connect, 19 August 2026. The App Review contact phone number must be in international format (for example +852), and the first consumable, non-consumable, auto-renewable subscription, and non-renewing subscription must each be submitted with a new app version. The 9 September 2026 update added screenshot specifications for iPhone Duo, iPhone 18 Pro and Pro Max, Apple Watch Ultra 4, and Apple Watch Series 12. [Apple](https://developer.apple.com/help/app-store-connect/release-notes/)
+- App Tracking Transparency in the EU, 16 September 2026. From iOS 27.2 and iPadOS 27.2 an alternative version of the ATT system prompt is optional across the EU, and it is the only version available for apps distributed in Germany, France, Italy, Poland, and Romania. When you must ask permission to track does not change. Test the prompt on the 27.2 beta if you ship to those five countries. [Apple](https://developer.apple.com/news/?id=idsft9ai)
+- Multiseat subscription purchases, 16 September 2026. Multiseat purchases are enabled by default for subscriptions in App Store Connect. Volume Purchasing (Apple Business and Apple School Manager) launches 22 October 2026 and Group Purchases follow this winter. Decide per subscription before 22 October and turn it off where seat sharing breaks your pricing or entitlement logic. Deadline ID APPLE-MULTISEAT-VOLUME-PURCHASING. [Apple](https://developer.apple.com/news/?id=likeohx4)
+- Bundles and Suites, 16 September 2026. Several subscriptions can be sold as one In-App Purchase, across one app, several apps of one developer, or several developers (Bundles), or one subscription across a developer's set of apps (Suites). Access is by request, it arrives later this year in the 27 OS family, and Apple says to move In-App Purchase handling to StoreKit 2 now. [Apple](https://developer.apple.com/news/?id=likeohx4)
+- Tax and price updates, 27 August 2026. Proceeds changed for Morocco (20 percent VAT introduced), the Republic of the Congo (18 percent VAT introduced), and Tanzania (digital sales tax from 2 to 3 percent). From 14 September 2026 equalized prices were updated for Israel, Indonesia, Morocco, and the Republic of the Congo unless that storefront is your base storefront. Auto-renewable subscription prices and manually managed storefronts did not change. [Apple](https://developer.apple.com/news/?id=artln8br)
+- 27.2 betas, 16 September 2026. iOS, iPadOS, macOS, tvOS, visionOS, and watchOS 27.2 betas are available with Xcode 27.2. [Apple](https://developer.apple.com/news/?id=rfb1rooi)
- On-Demand Resources deprecated from the 27 OS family. [Apple](https://developer.apple.com/wwdc26/guides/app-store/)
- Monthly subscriptions with a 12-month commitment are available worldwide except the United States and Singapore. [Apple](https://developer.apple.com/news/?id=agq42lxe)
- The Mini Apps Partner Program 15 percent rate requires the Declared Age Range API and the Advanced Commerce API. [Apple](https://developer.apple.com/programs/mini-apps-partner/)
diff --git a/docs/PRE-SUBMISSION-CHECKLIST.md b/docs/PRE-SUBMISSION-CHECKLIST.md
index 267e082..c7503ce 100644
--- a/docs/PRE-SUBMISSION-CHECKLIST.md
+++ b/docs/PRE-SUBMISSION-CHECKLIST.md
@@ -122,11 +122,11 @@ Apple.
Android.
-- [ ] Developer identity verified before 30 September 2026 if the app is distributed to Brazil, Indonesia, Singapore, or Thailand.
+- [ ] Developer identity verified if the app is distributed to Brazil, Indonesia, Singapore, or Thailand (required since 30 September 2026), and every Play package name registered in Play Console.
- [ ] Every foreground service declares `foregroundServiceType` in the manifest with the matching permission, and each type is declared in the Play Console with a demo video.
- [ ] No SafetyNet Attestation. attestation uses the Play Integrity API, verified server-side.
-- [ ] Play Billing Library at version 8 or later before 31 August 2026, and digital goods route through Play Billing.
-- [ ] `targetSdkVersion` at least 35 today, planned for at least 36 by the 2026 deadline.
+- [ ] Play Billing Library at version 8 or later (required for new apps and updates since 31 August 2026, extension available to 1 November 2026), and digital goods route through Play Billing.
+- [ ] `targetSdkVersion` at least 36 for new apps and updates (required since 31 August 2026, extension available to 1 November 2026). Wear OS and Android Automotive OS at least 35, Android TV and Android XR at least 34.
- [ ] No unexpected launch-time or mid-task full-screen interstitial, and every interstitial is closable by 15 seconds.
- [ ] Health app has the Health Apps Declaration, a core-function justification per Health Connect permission, the migrated Organization Account, and the correct medical-device label or disclaimer.
- [ ] Real-money game apps in supported countries have the required licenses or self-declarations, geo-restrictions, age-gating, and comply with any relevant Play Age Signals API terms.
diff --git a/docs/REGULATORY-TIMELINE.md b/docs/REGULATORY-TIMELINE.md
index 715c938..bb76433 100644
--- a/docs/REGULATORY-TIMELINE.md
+++ b/docs/REGULATORY-TIMELINE.md
@@ -1,7 +1,7 @@
# Global Regulatory Compliance Timeline
This document compiles every registered global regulatory deadline tracking regional, national, and platform requirements.
-Last compiled: 2026-09-30 07:16:14 UTC
+Last compiled: 2026-09-30 08:33:45 UTC
## Active and Approaching Compliance Warnings
@@ -67,6 +67,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
| CRITICAL | Google Play (Global) | Android developer verification, Play leg. register every Play app package name in Play Console (Play Console Help answers 17125096 and 17134731) | Register your app package names via Play Console to comply with Android developer verification. This leg is global and separate from the Brazil, Indonesia, Singapore, Thailand sideloading leg. Non-registration risks global removal from Google Play. | 2026-07-15 | until 30 September 2026 | 2026-09-30 | 2026-09-30 | 0 days | docs/GOOGLE-PLAY.md 2026 policy rounds, docs/PLATFORM-MECHANICS-2026.md section 2 |
| CRITICAL | Google Play (United States) | US alternative billing and external links program. transaction reporting and service fees (Play Console Help answer 16497028) | Developers enrolled in the US alternative billing or external links program must report transactions and successful downloads and pay the relevant Play service fee starting 1 October 2026. | 2026-10-01 | none | 2026-10-01 | 2026-10-01 | 1 days | docs/GLOBAL-REGULATORY-2026.md section 2.3, docs/GOOGLE-PLAY.md |
| CRITICAL | European Union (EU) | Apple EU business terms update. Core Technology Commission replaces the Core Technology Fee, ADPLA Attachment 14 (Apple Developer news gmws0jgp and 0cgo95n6) | From 1 October 2026 the per-install Core Technology Fee is replaced by a 5 percent Core Technology Commission on digital transactions in apps distributed outside the App Store, the Initial Acquisition Fee and Store Services Fee are eliminated, apps may offer alternative payment options alongside Apple In-App Purchase, and marketplace and web distribution eligibility widens to seven alternative criteria. Attachment 14 of the ADPLA must be accepted. | 2026-08-18 | until 1 October 2026 | 2026-10-01 | 2026-10-01 | 1 days | docs/EU-REGULATORY-2026.md section 2.3 |
+| MEDIUM | Apple App Store (Global) | Apple multiseat subscription purchases (Apple Developer news likeohx4) | Since 16 September 2026 multiseat purchases are enabled by default for subscriptions in App Store Connect. Volume Purchasing through Apple Business and Apple School Manager launches on 22 October 2026, and Group Purchases launch this winter. Before 22 October decide for each auto-renewable subscription whether organizations and groups may buy seats, and disable multiseat purchases, or limit them across the App Store, Apple Business, and Apple School Manager, where they do not fit your pricing or entitlement logic. Source https://developer.apple.com/news/?id=likeohx4 | 2026-09-16 | about 5 weeks | 2026-10-22 | 2026-10-22 | 22 days | docs/APPLE.md 2026 changes you must act on |
| HIGH | Apple App Store (Global) | Apple iPhone Duo platform readiness | iPhone Duo, Apple's first foldable iPhone, opens for pre-order on 16 October 2026 and ships 23 October 2026, launching on iOS 27.1. Apps built with Xcode 26 or earlier still run but do not extend under the status bar and camera. Build with Xcode 27.1 (beta from 18 September 2026) and the iOS 27.1 SDK, test every pose in the Duo simulator, resize from size classes and scene bounds, handle reserved regions (outer camera, inner camera when active, the folding region), and let navigation bars, toolbars, and tab bars present vertically. App Store Connect does not accept iPhone Duo screenshots yet (Apple says later this year), so the 6.9 inch set stays required. Tracked in issue #724. Sources https://www.apple.com/newsroom/2026/09/apple-unveils-iphone-duo/ https://developer.apple.com/documentation/technologyoverviews/preparing-your-app-for-iphone-duo | 2026-09-09 | about 6 weeks | 2026-10-23 | 2026-10-23 | 23 days | docs/PLATFORM-MECHANICS-2026.md section 1.8, docs/PRE-SUBMISSION-CHECKLIST.md Apple specific, docs/GAP-ANALYSIS-2026-09.md open items |
| MEDIUM | India | Digital Personal Data Protection Rules 2025, G.S.R. 846(E), rule 4 | Registered Consent Managers commence one year after Gazette publication (13 November 2025). Be ready to interoperate with a registered Consent Manager ahead of the 18-month tranche on 13 May 2027. | 2026-11-13 | none | 2026-11-13 | 2026-11-13 | 44 days | docs/GLOBAL-REGULATORY-2026.md section 3.6, references/rules/privacy.md |
| HIGH | European Union (EU) | EU AI Act, Regulation (EU) 2024/1689 as amended by Regulation (EU) 2026/1744, Article 111(4) and Article 5(1)(ba) and (bb) | Retrofit Article 50(2) machine-readable AI-content marking onto any generative audio, image, video, or text system already on the market before 2 August 2026, and stop operating any AI system whose intended or reasonably foreseeable output is non-consensual intimate imagery or child sexual abuse material. | 2026-12-02 | none | 2026-12-02 | 2026-12-02 | 63 days | docs/EU-REGULATORY-2026.md section 1.1, references/guidelines/by-app-type/ai-and-generative-apps.md |
@@ -131,6 +132,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
| 2026-09-30 | Android developer verification, Play leg. register every Play app package name in Play Console (Play Console Help answers 17125096 and 17134731) | Register your app package names via Play Console to comply with Android developer verification. This leg is global and separate from the Brazil, Indonesia, Singapore, Thailand sideloading leg. Non-registration risks global removal from Google Play. | Google Play (Global) | 2026-07-15 | until 30 September 2026 | 2026-09-30 | CRITICAL | docs/GOOGLE-PLAY.md 2026 policy rounds, docs/PLATFORM-MECHANICS-2026.md section 2 |
| 2026-10-01 | US alternative billing and external links program. transaction reporting and service fees (Play Console Help answer 16497028) | Developers enrolled in the US alternative billing or external links program must report transactions and successful downloads and pay the relevant Play service fee starting 1 October 2026. | Google Play (United States) | 2026-10-01 | none | 2026-10-01 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 2.3, docs/GOOGLE-PLAY.md |
| 2026-10-01 | Apple EU business terms update. Core Technology Commission replaces the Core Technology Fee, ADPLA Attachment 14 (Apple Developer news gmws0jgp and 0cgo95n6) | From 1 October 2026 the per-install Core Technology Fee is replaced by a 5 percent Core Technology Commission on digital transactions in apps distributed outside the App Store, the Initial Acquisition Fee and Store Services Fee are eliminated, apps may offer alternative payment options alongside Apple In-App Purchase, and marketplace and web distribution eligibility widens to seven alternative criteria. Attachment 14 of the ADPLA must be accepted. | European Union (EU) | 2026-08-18 | until 1 October 2026 | 2026-10-01 | CRITICAL | docs/EU-REGULATORY-2026.md section 2.3 |
+| 2026-10-22 | Apple multiseat subscription purchases (Apple Developer news likeohx4) | Since 16 September 2026 multiseat purchases are enabled by default for subscriptions in App Store Connect. Volume Purchasing through Apple Business and Apple School Manager launches on 22 October 2026, and Group Purchases launch this winter. Before 22 October decide for each auto-renewable subscription whether organizations and groups may buy seats, and disable multiseat purchases, or limit them across the App Store, Apple Business, and Apple School Manager, where they do not fit your pricing or entitlement logic. Source https://developer.apple.com/news/?id=likeohx4 | Apple App Store (Global) | 2026-09-16 | about 5 weeks | 2026-10-22 | MEDIUM | docs/APPLE.md 2026 changes you must act on |
| 2026-10-23 | Apple iPhone Duo platform readiness | iPhone Duo, Apple's first foldable iPhone, opens for pre-order on 16 October 2026 and ships 23 October 2026, launching on iOS 27.1. Apps built with Xcode 26 or earlier still run but do not extend under the status bar and camera. Build with Xcode 27.1 (beta from 18 September 2026) and the iOS 27.1 SDK, test every pose in the Duo simulator, resize from size classes and scene bounds, handle reserved regions (outer camera, inner camera when active, the folding region), and let navigation bars, toolbars, and tab bars present vertically. App Store Connect does not accept iPhone Duo screenshots yet (Apple says later this year), so the 6.9 inch set stays required. Tracked in issue #724. Sources https://www.apple.com/newsroom/2026/09/apple-unveils-iphone-duo/ https://developer.apple.com/documentation/technologyoverviews/preparing-your-app-for-iphone-duo | Apple App Store (Global) | 2026-09-09 | about 6 weeks | 2026-10-23 | HIGH | docs/PLATFORM-MECHANICS-2026.md section 1.8, docs/PRE-SUBMISSION-CHECKLIST.md Apple specific, docs/GAP-ANALYSIS-2026-09.md open items |
| 2026-11-13 | Digital Personal Data Protection Rules 2025, G.S.R. 846(E), rule 4 | Registered Consent Managers commence one year after Gazette publication (13 November 2025). Be ready to interoperate with a registered Consent Manager ahead of the 18-month tranche on 13 May 2027. | India | 2026-11-13 | none | 2026-11-13 | MEDIUM | docs/GLOBAL-REGULATORY-2026.md section 3.6, references/rules/privacy.md |
| 2026-12-02 | EU AI Act, Regulation (EU) 2024/1689 as amended by Regulation (EU) 2026/1744, Article 111(4) and Article 5(1)(ba) and (bb) | Retrofit Article 50(2) machine-readable AI-content marking onto any generative audio, image, video, or text system already on the market before 2 August 2026, and stop operating any AI system whose intended or reasonably foreseeable output is non-consensual intimate imagery or child sexual abuse material. | European Union (EU) | 2026-12-02 | none | 2026-12-02 | HIGH | docs/EU-REGULATORY-2026.md section 1.1, references/guidelines/by-app-type/ai-and-generative-apps.md |
@@ -141,18 +143,18 @@ Last compiled: 2026-09-30 07:16:14 UTC
| 2027-01-01 | Digital Markets, Competition and Consumers Act 2024, Part 4 Chapter 2 subscription contracts regime | Auto-renewing subscription apps sold to UK consumers need pre-contract information, renewal reminders, two cooling-off periods, an easy cancellation path, and the new refund rules. Government announced on 9 August 2026 that the regime commences in January 2027 (exact day not yet published), superseding the earlier spring 2027 estimate. | United Kingdom (UK) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 3.1, references/rules/payments.md |
| 2027-01-01 | ANPD Digital ECA roadmap, Etapa II and III | ANPD publishes guidance and normative parameters on age-assurance mechanisms from August 2026 with adaptation through November 2026, and starts active enforcement of the Digital ECA age-assurance obligations from January 2027. | Brazil | 2026-08-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 3.3, references/rules/privacy.md |
| 2027-01-01 | AB 1043, Digital Age Assurance Act, Civil Code Title 1.81.9 | Operating systems and app stores collect age at setup and expose an age-bracket signal by API. Developers request and use the signal. Operative 1 January 2027. | California (USA State) | 2027-01-01 | none | 2027-01-01 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/rules/privacy.md |
-| 2027-01-01 | SB 976, Protecting Our Kids from Social Media Addiction Act, Health and Safety Code sections 27001 to 27006 | From 1 January 2027 treat every user as a minor unless age assurance reasonably determines otherwise before serving an addictive feed or sending notifications between midnight and 6am or during school hours. AG age-assurance regulations due the same day. | California (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md |
-| 2027-01-01 | AB 56, Health and Safety Code Chapter 25 from section 28000 | Covered social media platforms display the Surgeon General black-box warning daily on first use, again after three cumulative hours, then hourly. Operative 1 January 2027. | California (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md |
+| 2027-01-01 | SB 976, Protecting Our Kids from Social Media Addiction Act, Health and Safety Code sections 27001 to 27006 | From 1 January 2027 treat every user as a minor unless age assurance reasonably determines otherwise before serving an addictive feed or sending notifications between midnight and 6am or during school hours. AG age-assurance regulations due the same day. | California (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md |
+| 2027-01-01 | AB 56, Health and Safety Code Chapter 25 from section 28000 | Covered social media platforms display the Surgeon General black-box warning daily on first use, again after three cumulative hours, then hourly. Operative 1 January 2027. | California (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md |
| 2027-01-01 | CPPA regulations, 11 CCR section 7200(b), 7155(b), 7157(a)(1), 7121(a) | Give notice, allow opt-out, and answer access requests for automated decision-making technology used in significant decisions by 1 January 2027. Complete risk assessments for pre-2026 processing by 31 December 2027 and submit by 1 April 2028. Cybersecurity audit certifications start 1 April 2028 for revenue above 100 million dollars. | California (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.4, references/rules/privacy.md |
| 2027-01-01 | Age-Appropriate Design Code Act, Act 63 | Highest-privacy defaults for minors, minimised collection, no late-night push notifications, AG age-assurance rules apply. Effective 1 January 2027. Rulemaking comments due 2 October 2026. | Vermont (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/kids-category-and-families.md |
| 2027-01-01 | HB 2225, Chapter 168, Laws of 2026, regulating artificial intelligence companion chatbots | Companion chatbot disclosure and minor protections, including an hourly disclosure for continuing minor use. Effective 1 January 2027. | Washington (USA State) | 2027-01-01 | none | 2027-01-01 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/ai-and-generative-apps.md |
| 2027-01-01 | SB 546, Oklahoma Consumer Data Privacy Act | Honour access, correction, deletion, portability, and opt-out of sale, targeted advertising, and profiling from 1 January 2027. | Oklahoma (USA State) | 2027-01-01 | none | 2027-01-01 | MEDIUM | docs/GLOBAL-REGULATORY-2026.md section 2.5, references/rules/privacy.md |
| 2027-01-12 | Data Act, Regulation (EU) 2023/2854, Article 29(1) | Providers of data processing services charge zero for a customer switching away. Legacy indefinite or long-dated contracts concluded on or before 12 September 2025 must meet Chapter IV unfair-terms rules by 12 September 2027. | European Union (EU) | 2027-01-12 | none | 2027-01-12 | MEDIUM | docs/EU-REGULATORY-2026.md section 5 |
-| 2027-01-25 | Stop Addictive Feeds Exploitation (SAFE) for Kids Act, AG final rules published 29 July 2026 | From 25 January 2027 restrict addictive feeds and midnight-to-6am notifications for minors absent verifiable parental consent, using certified age assurance. | New York (USA State) | 2027-01-25 | none | 2027-01-25 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-networking-and-dating.md |
+| 2027-01-25 | Stop Addictive Feeds Exploitation (SAFE) for Kids Act, AG final rules published 29 July 2026 | From 25 January 2027 restrict addictive feeds and midnight-to-6am notifications for minors absent verifiable parental consent, using certified age assurance. | New York (USA State) | 2027-01-25 | none | 2027-01-25 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-and-user-generated-content.md |
| 2027-01-27 | Contacts Permissions, Location Permissions, and Foreground Service policy changes for apps targeting Android 17, API level 37 (Play Console Help answers 16909972 and 16965181) | Apps targeting API 37 or later may request READ_CONTACTS only when the Android Contact Picker is insufficient for core functionality (declaration required), must implement the Android location button with the onlyForLocationButton manifest flag for location-button scope, and may no longer use a foreground service for geofencing (use the Geofence API). Pre-review checks flag contacts and location issues in Play Console from 27 October 2026. | Google Play (Global) | 2026-10-27 | until 27 January 2027 | 2027-01-27 | HIGH | docs/GOOGLE-PLAY.md 2026 policy rounds, references/rules/android.md |
| 2027-01-31 | Online Safety Act 2023, Ofcom statutory report on the use of app stores by children | Ofcom publishes its report on app stores by January 2027. It feeds the Secretary of State decision on whether app stores are brought into scope of the Online Safety Act. Watch item, no direct developer duty yet. | United Kingdom (UK) | 2027-01-31 | none | 2027-01-31 | MEDIUM | docs/GLOBAL-REGULATORY-2026.md section 3.1 |
| 2027-02-01 | Play Console technical quality requirements. memory, bitmap, and DEX optimization thresholds (Play Console Help answer 17492799) | Google states From February 2027 (exact day not published) apps must meet minimum optimization of at least 25 percent coverage across optimization, shrinking, and obfuscation with a tool such as R8, must not hold bitmaps in memory in non-visible states, and must stay within memory bad-behavior thresholds. Failure affects visibility and publishing capabilities. | Google Play (Global) | 2026-08-26 | until February 2027 | 2027-02-01 | HIGH | docs/GOOGLE-PLAY.md 2026 policy rounds, references/rules/performance.md |
-| 2027-03-01 | Under-16 social media ban and functionality restrictions, secondary legislation under the Children's Wellbeing and Schools Act (announced 15 June 2026) | Regulations are to be laid before the end of 2026 and implemented in spring 2027 (exact day not yet published, tracked here as 1 March 2027). User-to-user social platforms must block under-16 accounts. For 16 and 17 year olds livestreaming and stranger contact are off by default, notifications are off from midnight to 6am, autoplay and personalised feeds are off by default. AI romantic companion chatbots must enforce a minimum age of 18. | United Kingdom (UK) | 2027-03-01 | none | 2027-03-01 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-networking-and-dating.md |
+| 2027-03-01 | Under-16 social media ban and functionality restrictions, secondary legislation under the Children's Wellbeing and Schools Act (announced 15 June 2026) | Regulations are to be laid before the end of 2026 and implemented in spring 2027 (exact day not yet published, tracked here as 1 March 2027). User-to-user social platforms must block under-16 accounts. For 16 and 17 year olds livestreaming and stranger contact are off by default, notifications are off from midnight to 6am, autoplay and personalised feeds are off by default. AI romantic companion chatbots must enforce a minimum age of 18. | United Kingdom (UK) | 2027-03-01 | none | 2027-03-01 | CRITICAL | docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-and-user-generated-content.md |
| 2027-04-01 | Apple App Store Submission Requirements | Starting April 2027 apps and games uploaded to App Store Connect must be built with the iOS 27 and iPadOS 27 SDK or later, and the matching tvOS 27, visionOS 27, and watchOS 27 SDKs. Apple has published the month only, no exact day, so this entry is tracked as 1 April 2027 and must be re-checked when Apple names the date. macOS is not in Apple's list. Announced 9 September 2026 with the Xcode 27 Release Candidate. Source https://developer.apple.com/news/?id=k1mtkt1k | Apple App Store (Global) | 2026-09-09 | about 7 months | 2027-04-01 | CRITICAL | docs/PLATFORM-MECHANICS-2026.md section 1.6, docs/APPLE.md 2026 changes, docs/PRE-SUBMISSION-CHECKLIST.md Apple specific |
| 2027-04-01 | Play Console technical quality requirements. Zero-Tap Sign-In restoration (Play Console Help answer 17492799) | Google states From April 2027 (exact day not published) any app supporting user sign-in, optional or mandatory, must restore the user's sign-in state when they move to a new Android device using the Restore Credentials API. Games are currently out of scope. | Google Play (Global) | 2026-08-26 | until April 2027 | 2027-04-01 | HIGH | docs/GOOGLE-PLAY.md 2026 policy rounds, references/rules/design.md |
| 2027-04-26 | ADA Title II web and mobile app accessibility, 28 CFR Part 35 Subpart H, Interim Final Rule FR Doc. 2026-07663 (20 April 2026) | A mobile app provided or made available by a state or local government entity serving 50,000 or more people must conform to WCAG 2.1 Level AA. Reaches a commercial developer through the contract or licensing chain. The 2024 date of 24 April 2026 was extended to 26 April 2027. | United States (Federal) | 2026-04-20 | none | 2027-04-26 | HIGH | docs/GLOBAL-REGULATORY-2026.md section 2.8, references/rules/design.md |
@@ -810,6 +812,18 @@ Last compiled: 2026-09-30 07:16:14 UTC
- **Priority:** CRITICAL
- **Affected Repository Sections:** docs/EU-REGULATORY-2026.md section 2.3
+### ID: APPLE-MULTISEAT-VOLUME-PURCHASING
+
+- **Jurisdiction:** Apple App Store (Global)
+- **Law:** Apple multiseat subscription purchases (Apple Developer news likeohx4)
+- **Requirement:** Since 16 September 2026 multiseat purchases are enabled by default for subscriptions in App Store Connect. Volume Purchasing through Apple Business and Apple School Manager launches on 22 October 2026, and Group Purchases launch this winter. Before 22 October decide for each auto-renewable subscription whether organizations and groups may buy seats, and disable multiseat purchases, or limit them across the App Store, Apple Business, and Apple School Manager, where they do not fit your pricing or entitlement logic. Source https://developer.apple.com/news/?id=likeohx4
+- **Effective Date:** 2026-09-16
+- **Grace Period:** about 5 weeks
+- **Mandatory Date:** 2026-10-22
+- **Enforcement Date:** 2026-10-22
+- **Priority:** MEDIUM
+- **Affected Repository Sections:** docs/APPLE.md 2026 changes you must act on
+
### ID: APPLE-IPHONE-DUO-LAUNCH
- **Jurisdiction:** Apple App Store (Global)
@@ -940,7 +954,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
- **Mandatory Date:** 2027-01-01
- **Enforcement Date:** 2027-01-01
- **Priority:** HIGH
-- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md
+- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md
### ID: US-CA-AB56-WARNING-LABEL-2027
@@ -952,7 +966,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
- **Mandatory Date:** 2027-01-01
- **Enforcement Date:** 2027-01-01
- **Priority:** HIGH
-- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-networking-and-dating.md
+- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.4, references/guidelines/by-app-type/social-and-user-generated-content.md
### ID: US-CA-CPPA-ADMT-2027
@@ -1024,7 +1038,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
- **Mandatory Date:** 2027-01-25
- **Enforcement Date:** 2027-01-25
- **Priority:** CRITICAL
-- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-networking-and-dating.md
+- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 2.5, references/guidelines/by-app-type/social-and-user-generated-content.md
### ID: GOOGLE-CONTACTS-LOCATION-FGS-API37
@@ -1072,7 +1086,7 @@ Last compiled: 2026-09-30 07:16:14 UTC
- **Mandatory Date:** 2027-03-01
- **Enforcement Date:** 2027-03-01
- **Priority:** CRITICAL
-- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-networking-and-dating.md
+- **Affected Repository Sections:** docs/GLOBAL-REGULATORY-2026.md section 3.1, references/guidelines/by-app-type/social-and-user-generated-content.md
### ID: APPLE-SDK-27-REQ
diff --git a/scripts/deadline-checker-test.sh b/scripts/deadline-checker-test.sh
index 2bc64e0..222dd54 100755
--- a/scripts/deadline-checker-test.sh
+++ b/scripts/deadline-checker-test.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# Test gauntlet for deadline-checker.py absorbed-state behavior.
set -uo pipefail
-cd "$(dirname "$0")/.."
+cd "$(dirname "$0")/.." || exit 1
T="$(mktemp -d)"; trap 'rm -rf "$T"' EXIT
fails=0
check() { # name, expected, haystack-file
@@ -42,5 +42,14 @@ echo "{bad" > "$T/bad.json"
DEADLINES_FILE="$T/bad.json" python3 scripts/deadline-checker.py > "$T/out2.txt" 2>&1
check "malformed data fails open" "No deadlines loaded|Error loading" "$T/out2.txt"
+# --brief is what the guard prints. one line per deadline, nothing for an absorbed one.
+DEADLINES_FILE="$T/deadlines.json" python3 scripts/deadline-checker.py --brief > "$T/brief.txt" 2>&1
+check "brief keeps the section header" "Regulatory Compliance Deadline Status" "$T/brief.txt"
+check "brief shows the overdue entry on one line" "^\[CRITICAL\] OVERDUE [0-9]+ days\. EU\. Law B" "$T/brief.txt"
+ncheck "brief does not list absorbed entries" "Law A" "$T/brief.txt"
+check "brief counts what it left out" "1 passed deadline" "$T/brief.txt"
+ncheck "brief has no multi-line blocks" "Affected repository sections" "$T/brief.txt"
+[ "$(wc -l < "$T/brief.txt")" -le 8 ] && echo "PASS brief output stays short" || { echo "FAIL brief output stays short ($(wc -l < "$T/brief.txt") lines)"; fails=$((fails+1)); }
+
echo "----"
if [ "$fails" -eq 0 ]; then echo "deadline-checker-test: ALL PASS"; else echo "deadline-checker-test: $fails FAIL"; exit 1; fi
diff --git a/scripts/deadline-checker.py b/scripts/deadline-checker.py
index 57eb909..2818582 100755
--- a/scripts/deadline-checker.py
+++ b/scripts/deadline-checker.py
@@ -29,6 +29,29 @@ def load_deadlines():
return []
+def print_brief(passed, upcoming, absorbed):
+ """One line per deadline, for the guard report. The full blocks stay the default."""
+ print("== Regulatory Compliance Deadline Status ==")
+ for item in passed:
+ print(
+ f"[{item['priority'].upper()}] OVERDUE {abs(item['remaining_days'])} days. "
+ f"{item['jurisdiction']}. {item['law']} (mandatory {item['mandatory_date']})"
+ )
+ for item in sorted(upcoming, key=lambda x: x["remaining_days"]):
+ days = item["remaining_days"]
+ when = "due today" if days == 0 else f"in {days} day" + ("" if days == 1 else "s")
+ print(
+ f"[{item['priority'].upper()}] {when}. "
+ f"{item['jurisdiction']}. {item['law']} (mandatory {item['mandatory_date']})"
+ )
+ if not passed and not upcoming:
+ print("No deadline is overdue or due within 90 days.")
+ if absorbed:
+ print(f"{len(absorbed)} passed deadline(s) already carried by the playbook, not listed.")
+ print(f"Full detail. python3 {os.path.abspath(__file__)}")
+ return 0
+
+
def main():
deadlines = load_deadlines()
if not deadlines:
@@ -93,6 +116,9 @@ def main():
elif remaining_days <= 90:
upcoming_deadlines.append(item)
+ if "--brief" in sys.argv[1:]:
+ return print_brief(passed_deadlines, upcoming_deadlines, absorbed_deadlines)
+
if passed_deadlines or upcoming_deadlines:
print("== Regulatory Compliance Deadline Status ==\n")
diff --git a/scripts/install-test.sh b/scripts/install-test.sh
new file mode 100755
index 0000000..9fd82f6
--- /dev/null
+++ b/scripts/install-test.sh
@@ -0,0 +1,145 @@
+#!/usr/bin/env bash
+# Tests scripts/install.sh against a throwaway config directory. Never touches the real ~/.claude.
+set -uo pipefail
+cd "$(dirname "$0")/.." || exit 1
+
+PASS=0
+FAIL=0
+ok() { PASS=$((PASS+1)); printf 'PASS %s\n' "$1"; }
+bad() { FAIL=$((FAIL+1)); printf 'FAIL %s\n' "$1"; }
+
+INSTALL="$PWD/scripts/install.sh"
+WORK="$(mktemp -d)"
+trap 'rm -rf "$WORK"' EXIT
+fresh() { C="$WORK/c$RANDOM$RANDOM"; mkdir -p "$C"; }
+run() { CLAUDE_CONFIG_DIR="$C" bash "$INSTALL" "$@" 2>&1; }
+hooks() { python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(sum("app-store-compliance-guard.sh" in h.get("command","") for e in d.get("hooks",{}).get("PreToolUse",[]) for h in e.get("hooks",[])))' "$C/settings.json"; }
+
+# 1 a fresh install lands every part and proves itself
+fresh
+OUT="$(run)"; RC=$?
+[ "$RC" -eq 0 ] && ok "fresh install exits 0" || bad "fresh install exits 0 (rc=$RC)"
+[ -x "$C/hooks/app-store-compliance-guard.sh" ] && ok "guard is installed and executable" || bad "guard is installed and executable"
+for p in SKILL.md data/rejection-patterns.json data/regulatory-deadlines.json docs/APPLE.md references scripts/deadline-checker.py scripts/validate-privacy-manifest.py templates .citation-allowlist; do
+ [ -e "$C/skills/app-store-compliance/$p" ] || { bad "skill payload has $p"; continue; }
+done
+[ -e "$C/skills/app-store-compliance/.citation-allowlist" ] && ok "skill payload is complete, allowlist included" || bad "skill payload is complete, allowlist included"
+[ -f "$C/commands/app-store-audit.md" ] && ok "slash command is installed" || bad "slash command is installed"
+[ "$(hooks)" = "1" ] && ok "hook is registered once in settings.json" || bad "hook is registered once in settings.json (got $(hooks))"
+python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); e=[h for x in d["hooks"]["PreToolUse"] if x.get("matcher")=="Bash" for h in x["hooks"] if "app-store-compliance-guard.sh" in h["command"]]; sys.exit(0 if e and e[0].get("timeout",0)>=120 and e[0].get("type")=="command" else 1)' "$C/settings.json" && ok "hook entry is a Bash PreToolUse command with a 120 second timeout" || bad "hook entry is a Bash PreToolUse command with a 120 second timeout"
+echo "$OUT" | grep -q "^Install verified\." && ok "install ends with a verified line" || bad "install ends with a verified line"
+echo "$OUT" | grep -q "bash .*app-store-compliance-guard.sh /path/to/your/app" && ok "install prints the one command to run next" || bad "install prints the one command to run next"
+
+# 2 running it again changes nothing and adds no second entry
+BEFORE="$(cat "$C/settings.json")"
+run >/dev/null; RC=$?
+[ "$RC" -eq 0 ] && [ "$(hooks)" = "1" ] && [ "$BEFORE" = "$(cat "$C/settings.json")" ] && ok "a second run is idempotent" || bad "a second run is idempotent (rc=$RC entries=$(hooks))"
+
+# 3 existing settings survive, and a backup is written
+fresh
+printf '{"model":"opus","hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"bash ~/other.sh"}]}],"Stop":[{"hooks":[{"type":"command","command":"x"}]}]},"permissions":{"allow":["Read"]}}' > "$C/settings.json"
+run >/dev/null
+python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); cmds=[h["command"] for e in d["hooks"]["PreToolUse"] for h in e["hooks"]]; sys.exit(0 if d["model"]=="opus" and d["permissions"]=={"allow":["Read"]} and "bash ~/other.sh" in cmds and len(d["hooks"]["Stop"])==1 else 1)' "$C/settings.json" && ok "existing keys and hooks are preserved" || bad "existing keys and hooks are preserved"
+ls "$C"/settings.json.bak-* >/dev/null 2>&1 && ok "a backup of settings.json is kept" || bad "a backup of settings.json is kept"
+
+# 4 a settings.json that is not valid JSON is never rewritten
+fresh
+printf '{ "model": "opus", broken' > "$C/settings.json"
+OUT="$(run)"; RC=$?
+[ "$(cat "$C/settings.json")" = '{ "model": "opus", broken' ] && ok "an unreadable settings.json is left untouched" || bad "an unreadable settings.json is left untouched"
+echo "$OUT" | grep -q '"PreToolUse"' && [ "$RC" -eq 1 ] && ok "it prints the block to add by hand and exits 1" || bad "it prints the block to add by hand and exits 1 (rc=$RC)"
+
+# 5 dry run writes nothing
+fresh
+OUT="$(run --dry-run)"; RC=$?
+[ "$RC" -eq 0 ] && [ -z "$(ls -A "$C")" ] && echo "$OUT" | grep -q "Dry run" && ok "dry run writes nothing" || bad "dry run writes nothing (rc=$RC)"
+
+# 6 doctor fails before an install and passes after
+fresh
+run doctor >/dev/null; RC=$?
+[ "$RC" -eq 1 ] && ok "doctor fails when nothing is installed" || bad "doctor fails when nothing is installed (rc=$RC)"
+run >/dev/null
+OUT="$(run doctor)"; RC=$?
+[ "$RC" -eq 0 ] && echo "$OUT" | grep -q "^Install verified\." && ok "doctor passes after an install" || bad "doctor passes after an install (rc=$RC)"
+
+# 7 doctor notices a guard that was edited or is stale
+printf '\n# local edit\n' >> "$C/hooks/app-store-compliance-guard.sh"
+OUT="$(run doctor)"; RC=$?
+echo "$OUT" | grep -q "differs from this checkout" && ok "doctor reports a guard that differs from the checkout" || bad "doctor reports a guard that differs from the checkout"
+
+# 8 doctor catches a guard that no longer blocks
+printf '#!/usr/bin/env bash\nexit 0\n' > "$C/hooks/app-store-compliance-guard.sh"
+run doctor >/dev/null; RC=$?
+[ "$RC" -eq 1 ] && ok "doctor fails when the guard does not block a bad app" || bad "doctor fails when the guard does not block a bad app (rc=$RC)"
+
+# 9 with no python3 and no jq the files still install and the settings block is printed
+fresh
+SHIM="$(mktemp -d)"
+for b in bash cp rm mkdir chmod cat grep sed awk find xargs tr head tail mktemp printf wc sort uniq cut dirname basename date cmp mv ls env plutil xmllint; do p="$(command -v "$b" 2>/dev/null)"; [ -n "$p" ] && ln -s "$p" "$SHIM/$b"; done
+OUT="$(PATH="$SHIM" CLAUDE_CONFIG_DIR="$C" bash "$INSTALL" 2>&1)"; RC=$?
+[ -x "$C/hooks/app-store-compliance-guard.sh" ] && [ ! -f "$C/settings.json" ] && echo "$OUT" | grep -q '"PreToolUse"' && [ "$RC" -eq 1 ] && ok "without python3 or jq the block is printed for a manual paste" || bad "without python3 or jq the block is printed for a manual paste (rc=$RC)"
+rm -rf "$SHIM"
+
+# 10 uninstall removes only what the installer added
+fresh
+printf '{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"bash ~/other.sh"}]}]}}' > "$C/settings.json"
+run >/dev/null
+run uninstall >/dev/null; RC=$?
+[ "$RC" -eq 0 ] && [ ! -e "$C/hooks/app-store-compliance-guard.sh" ] && [ ! -e "$C/skills/app-store-compliance" ] && [ "$(hooks)" = "0" ] && grep -q "other.sh" "$C/settings.json" && ok "uninstall removes the guard, skill and entry, and keeps other hooks" || bad "uninstall removes the guard, skill and entry, and keeps other hooks (rc=$RC)"
+
+# 11 an unknown subcommand is refused
+fresh
+run frobnicate >/dev/null; RC=$?
+[ "$RC" -eq 2 ] && [ -z "$(ls -A "$C")" ] && ok "an unknown subcommand exits 2 and writes nothing" || bad "an unknown subcommand exits 2 and writes nothing (rc=$RC)"
+
+# 12 an entry that names the guard but cannot fire for Bash does not count as registered
+bash_entries() { python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(sum(1 for e in d["hooks"]["PreToolUse"] if e.get("matcher")=="Bash" for h in e["hooks"] if h.get("command","").startswith("bash ") and "#" not in h["command"] and h["command"].rstrip().rstrip(chr(39)).endswith("app-store-compliance-guard.sh")))' "$C/settings.json"; }
+fresh
+printf '{"hooks":{"PreToolUse":[{"matcher":"Read","hooks":[{"type":"command","command":"bash ~/.claude/hooks/app-store-compliance-guard.sh"}]},{"matcher":"Bash","hooks":[{"type":"command","command":"true # app-store-compliance-guard.sh"}]}]}}' > "$C/settings.json"
+run >/dev/null; RC=$?
+[ "$RC" -eq 0 ] && [ "$(bash_entries)" = "1" ] && ok "a guard entry on the wrong matcher or behind a comment is not trusted, a working one is added" || bad "a guard entry on the wrong matcher or behind a comment is not trusted (rc=$RC)"
+
+# 13 a config folder with a space still yields a hook command the shell can run, and it blocks
+C="$WORK/claude config $RANDOM"; mkdir -p "$C"
+OUT="$(run)"; RC=$?
+HOOKCMD="$(python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print([h["command"] for e in d["hooks"]["PreToolUse"] for h in e["hooks"]][0])' "$C/settings.json")"
+FX="$(mktemp -d)"; mkdir -p "$FX/App"; printf '<plist><dict></dict></plist>' > "$FX/App/Info.plist"
+printf 'class A { func signIn(){} func createAccount(){} }\nlet u="https://staging.example.com"\n' > "$FX/App/X.swift"
+( cd "$FX" && printf '{"tool_name":"Bash","tool_input":{"command":"fastlane deliver"}}' | env -u CLAUDE_PROJECT_DIR bash -c "$HOOKCMD" >/dev/null 2>&1 ); HRC=$?
+[ "$RC" -eq 0 ] && [ "$HRC" -eq 2 ] && ok "a config path with a space gives a runnable hook command that blocks" || bad "a config path with a space gives a runnable hook command that blocks (install rc=$RC hook rc=$HRC)"
+rm -rf "$FX"
+
+# 14 doctor runs the registered command itself, so an entry that cannot fire fails the check
+fresh; run >/dev/null
+python3 -c 'import json,sys; p=sys.argv[1]; d=json.load(open(p)); d["hooks"]["PreToolUse"][0]["hooks"][0]["command"]="bash /no/such/app-store-compliance-guard.sh"; json.dump(d,open(p,"w"))' "$C/settings.json"
+run doctor >/dev/null; RC=$?
+[ "$RC" -eq 1 ] && ok "doctor fails when the registered command cannot run" || bad "doctor fails when the registered command cannot run (rc=$RC)"
+
+# 15 a settings.json with a repeated key is ambiguous and is never rewritten
+fresh
+printf '{"hooks":{"Stop":[{"hooks":[{"type":"command","command":"x"}]}]},"hooks":{"PreToolUse":[]}}' > "$C/settings.json"; BEFORE="$(cat "$C/settings.json")"
+OUT="$(run)"; RC=$?
+[ "$BEFORE" = "$(cat "$C/settings.json")" ] && [ "$RC" -eq 1 ] && echo "$OUT" | grep -q '"PreToolUse"' && ok "a repeated key leaves settings.json untouched" || bad "a repeated key leaves settings.json untouched (rc=$RC)"
+
+# 16 a read-only settings.json is respected
+fresh
+printf '{"model":"opus"}' > "$C/settings.json"; chmod 0444 "$C/settings.json"
+run >/dev/null; RC=$?
+[ "$(cat "$C/settings.json")" = '{"model":"opus"}' ] && [ "$RC" -eq 1 ] && ok "a read-only settings.json is left untouched" || bad "a read-only settings.json is left untouched (rc=$RC)"
+chmod 0644 "$C/settings.json"
+
+# 17 with jq and no python3 the hook is still merged, other keys kept, and a second run adds nothing
+if command -v jq >/dev/null 2>&1; then
+ fresh
+ SHIM="$(mktemp -d)"
+ for b in bash cp rm mkdir chmod cat grep sed awk find xargs tr head tail mktemp printf wc sort uniq cut dirname basename date cmp mv ls env plutil xmllint file od comm tee sleep expr touch jq; do p="$(command -v "$b" 2>/dev/null)"; [ -n "$p" ] && ln -s "$p" "$SHIM/$b"; done
+ printf '{"model":"opus","hooks":{"Stop":[]}}' > "$C/settings.json"
+ OUT="$(PATH="$SHIM" CLAUDE_CONFIG_DIR="$C" bash "$INSTALL" 2>&1)"; RC=$?
+ PATH="$SHIM" CLAUDE_CONFIG_DIR="$C" bash "$INSTALL" >/dev/null 2>&1
+ [ "$RC" -eq 0 ] && echo "$OUT" | grep -q "^Install verified\." && [ "$(hooks)" = "1" ] && grep -q '"opus"' "$C/settings.json" && ok "with jq only the hook is merged once and verified" || bad "with jq only the hook is merged once and verified (rc=$RC entries=$(hooks))"
+ rm -rf "$SHIM"
+fi
+
+echo ""
+echo "install-test: $PASS passed, $FAIL failed"
+[ "$FAIL" -eq 0 ]
diff --git a/scripts/install.sh b/scripts/install.sh
new file mode 100755
index 0000000..2599078
--- /dev/null
+++ b/scripts/install.sh
@@ -0,0 +1,320 @@
+#!/usr/bin/env bash
+# One command setup for Claude Code. Installs the guard, the skill and the slash command, registers
+# the hook, then proves the guard blocks a bad app. Usage: install.sh [install|doctor|uninstall] [--dry-run]
+set -uo pipefail
+
+REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+CONF="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
+GUARD_NAME="app-store-compliance-guard.sh"
+GUARD_SRC="$REPO/agent-os/hooks/$GUARD_NAME"
+GUARD="$CONF/hooks/$GUARD_NAME"
+SKILL="$CONF/skills/app-store-compliance"
+CMD_FILE="$CONF/commands/app-store-audit.md"
+SETTINGS="$CONF/settings.json"
+PAYLOAD_DIRS="docs data references templates scripts"
+
+# shellcheck disable=SC2088
+if [ "$CONF" = "$HOME/.claude" ]; then SHOWN='~/.claude'; else SHOWN="$CONF"; fi
+# The hook command is run by a shell, so a custom folder is single-quoted. The default keeps an unquoted tilde.
+if [ "$CONF" = "$HOME/.claude" ]; then
+ HOOK_CMD="bash $SHOWN/hooks/$GUARD_NAME"
+else
+ HOOK_CMD="bash '$(printf '%s' "$GUARD" | sed "s/'/'\\\\''/g")'"
+fi
+
+MODE="install"; DRY=0
+for arg in "$@"; do
+ case "$arg" in
+ install|doctor|uninstall) MODE="$arg" ;;
+ --dry-run) DRY=1 ;;
+ -h|--help) MODE="help" ;;
+ *) echo "Unknown argument. $arg" >&2; echo "Usage. install.sh [install|doctor|uninstall] [--dry-run]" >&2; exit 2 ;;
+ esac
+done
+
+have() { command -v "$1" >/dev/null 2>&1 && "$@" >/dev/null 2>&1; }
+say() { printf '%s\n' "$*"; }
+good() { printf ' ok %s\n' "$*"; }
+warn() { printf ' note %s\n' "$*"; }
+fail() { printf ' FAIL %s\n' "$*"; PROBLEMS=$((PROBLEMS+1)); }
+PROBLEMS=0
+
+manual_block() {
+ say ""
+ say "Add this to $SHOWN/settings.json yourself, inside the top level object."
+ say "If a \"hooks\" or \"PreToolUse\" key is already there, add only the inner entry to its list."
+ cat <<BLOCK
+
+ "hooks": {
+ "PreToolUse": [
+ {
+ "matcher": "Bash",
+ "hooks": [
+ { "type": "command", "command": "$HOOK_CMD", "timeout": 120 }
+ ]
+ }
+ ]
+ }
+
+BLOCK
+ say "Then run. bash $REPO/scripts/install.sh doctor"
+}
+
+# Edits settings.json. $1 is add or remove. Exit 0 changed, 3 nothing to change, 4 not safe to edit, 5 no JSON tool.
+settings_edit() {
+ local action="$1"
+ if have python3 -c pass; then
+ python3 - "$SETTINGS" "$HOOK_CMD" "$GUARD_NAME" "$action" <<'PY'
+import json, os, re, shutil, sys, tempfile, time
+
+path, cmd, name, action = sys.argv[1:5]
+real = os.path.realpath(path)
+exists = os.path.exists(real)
+data = {}
+if exists:
+ try:
+ with open(real, encoding="utf-8") as f:
+ text = f.read()
+ def no_repeats(pairs):
+ keys = [k for k, _ in pairs]
+ if len(keys) != len(set(keys)):
+ raise ValueError("repeated key")
+ return dict(pairs)
+
+ data = json.loads(text, object_pairs_hook=no_repeats) if text.strip() else {}
+ except Exception:
+ sys.exit(4)
+ if not os.access(real, os.W_OK):
+ sys.exit(6)
+if not isinstance(data, dict):
+ sys.exit(4)
+hooks = data.get("hooks", {})
+if not isinstance(hooks, dict):
+ sys.exit(4)
+pre = hooks.get("PreToolUse", [])
+if not isinstance(pre, list):
+ sys.exit(4)
+for e in pre:
+ if not isinstance(e, dict) or not isinstance(e.get("hooks", []), list):
+ sys.exit(4)
+
+
+def ours(h):
+ return isinstance(h, dict) and name in str(h.get("command", ""))
+
+
+def fires(e, h):
+ # Only an entry Claude Code would run for a Bash call counts. Wrong matcher or a commented name does not.
+ m = e.get("matcher", "")
+ c = str(h.get("command", "")).strip()
+ try:
+ on_bash = m in ("", "*") or re.fullmatch(m, "Bash") is not None
+ except re.error:
+ on_bash = False
+ runs = c.startswith("bash ") and "#" not in c and c.rstrip("'\"").endswith(name)
+ return ours(h) and on_bash and runs and h.get("type", "command") == "command"
+
+
+changed = False
+if action == "add":
+ found = [h for e in pre for h in e.get("hooks", []) if fires(e, h)]
+else:
+ found = [h for e in pre for h in e.get("hooks", []) if ours(h)]
+if action == "add":
+ if found:
+ for h in found:
+ t = h.get("timeout")
+ if not isinstance(t, (int, float)) or t < 120:
+ h["timeout"] = 120
+ changed = True
+ else:
+ pre.append(
+ {"matcher": "Bash", "hooks": [{"type": "command", "command": cmd, "timeout": 120}]}
+ )
+ hooks["PreToolUse"] = pre
+ data["hooks"] = hooks
+ changed = True
+elif found:
+ kept = []
+ for e in pre:
+ had = any(ours(h) for h in e.get("hooks", []))
+ e["hooks"] = [h for h in e.get("hooks", []) if not ours(h)]
+ if e["hooks"] or not had:
+ kept.append(e)
+ if kept:
+ hooks["PreToolUse"] = kept
+ else:
+ hooks.pop("PreToolUse", None)
+ if not hooks:
+ data.pop("hooks", None)
+ changed = True
+if not changed:
+ sys.exit(3)
+folder = os.path.dirname(real) or "."
+os.makedirs(folder, exist_ok=True)
+if exists:
+ shutil.copy2(real, path + ".bak-" + time.strftime("%Y%m%d-%H%M%S") + "-" + str(os.getpid()))
+fd, tmp = tempfile.mkstemp(dir=folder, prefix=".settings-")
+with os.fdopen(fd, "w", encoding="utf-8") as f:
+ json.dump(data, f, indent=2, ensure_ascii=False)
+ f.write("\n")
+if exists:
+ shutil.copymode(real, tmp)
+os.replace(tmp, real)
+PY
+ return $?
+ fi
+ if have jq -n true; then
+ local cur tmp
+ if [ -s "$SETTINGS" ]; then cur="$SETTINGS"; else cur=""; fi
+ if [ -n "$cur" ]; then
+ jq -e 'type == "object" and ((.hooks // {}) | type == "object") and ((.hooks.PreToolUse // []) | type == "array") and ((.hooks.PreToolUse // []) | all(type == "object" and ((.hooks // []) | type == "array")))' "$cur" >/dev/null 2>&1 || return 4
+ [ -w "$cur" ] || return 6
+ fi
+ local present=1
+ [ -n "$cur" ] && jq -e --arg n "$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and contains($n) and (contains("#") | not))] | length > 0' "$cur" >/dev/null 2>&1 && present=0
+ if [ "$action" = "add" ]; then
+ [ "$present" -eq 0 ] && return 3
+ mkdir -p "$CONF"; tmp="$(mktemp "$CONF/.settings-XXXXXX")" || return 4
+ if [ -n "$cur" ]; then cp -p "$cur" "$SETTINGS.bak-$(date +%Y%m%d-%H%M%S)"; else cur="/dev/null"; fi
+ if [ "$cur" = "/dev/null" ]; then printf '{}' > "$tmp.in"; cur="$tmp.in"; fi
+ jq --arg c "$HOOK_CMD" '.hooks.PreToolUse = ((.hooks.PreToolUse // []) + [{matcher: "Bash", hooks: [{type: "command", command: $c, timeout: 120}]}])' "$cur" > "$tmp" || { rm -f "$tmp" "$tmp.in"; return 4; }
+ rm -f "$tmp.in"; mv "$tmp" "$SETTINGS"; return 0
+ fi
+ [ "$present" -ne 0 ] && return 3
+ tmp="$(mktemp "$CONF/.settings-XXXXXX")" || return 4
+ cp -p "$cur" "$SETTINGS.bak-$(date +%Y%m%d-%H%M%S)"
+ jq --arg n "$GUARD_NAME" '.hooks.PreToolUse |= (map(.hooks |= map(select((.command? // "" | tostring | contains($n)) | not))) | map(select((.hooks | length) > 0)))' "$cur" > "$tmp" || { rm -f "$tmp"; return 4; }
+ mv "$tmp" "$SETTINGS"; return 0
+ fi
+ return 5
+}
+
+# Prints the registered command Claude Code would run for a Bash call, empty when there is none.
+registered_cmd() {
+ [ -f "$SETTINGS" ] || return 0
+ if have python3 -c pass; then
+ python3 -c 'import json,re,sys
+try: d=json.load(open(sys.argv[1]))
+except Exception: sys.exit(0)
+n=sys.argv[2]
+for e in d.get("hooks",{}).get("PreToolUse",[]):
+ if not isinstance(e,dict): continue
+ m=e.get("matcher","")
+ try: ok=m in ("","*") or re.fullmatch(m,"Bash") is not None
+ except re.error: ok=False
+ if not ok: continue
+ for h in e.get("hooks",[]):
+ c=str(h.get("command","")) if isinstance(h,dict) else ""
+ if n in c and "#" not in c and c.strip().startswith("bash "):
+ print(c); sys.exit(0)' "$SETTINGS" "$GUARD_NAME" 2>/dev/null
+ return 0
+ fi
+ if have jq -n true; then
+ jq -r --arg n "$GUARD_NAME" '[.hooks.PreToolUse[]? | select((.matcher // "") == "Bash" or (.matcher // "") == "" or .matcher == "*") | .hooks[]?.command? // "" | tostring | select(startswith("bash ") and contains($n) and (contains("#") | not))] | first // empty' "$SETTINGS" 2>/dev/null
+ return 0
+ fi
+ grep -q "$GUARD_NAME" "$SETTINGS" 2>/dev/null && printf '%s\n' "$HOOK_CMD"
+ return 0
+}
+
+# Proves the install. Every line is a real check, the guard is run against a built-in app that must be blocked.
+verify() {
+ say ""; say "Checking the install."
+ if [ -f "$GUARD" ]; then good "guard present at $SHOWN/hooks/$GUARD_NAME"; else fail "guard missing at $SHOWN/hooks/$GUARD_NAME"; fi
+ if [ -f "$GUARD" ] && [ -f "$GUARD_SRC" ] && ! cmp -s "$GUARD" "$GUARD_SRC"; then
+ warn "installed guard differs from this checkout. Run install.sh again to update it."
+ fi
+ local missing="" p
+ for p in SKILL.md data/rejection-patterns.json data/regulatory-deadlines.json docs/PRE-SUBMISSION-CHECKLIST.md references scripts/deadline-checker.py scripts/validate-privacy-manifest.py templates .citation-allowlist; do
+ [ -e "$SKILL/$p" ] || missing="$missing $p"
+ done
+ if [ -z "$missing" ]; then good "skill payload complete at $SHOWN/skills/app-store-compliance"; else fail "skill payload is missing.$missing"; fi
+ if [ -f "$CMD_FILE" ]; then good "slash command /app-store-audit installed"; else fail "slash command missing at $SHOWN/commands/app-store-audit.md"; fi
+ local reg; reg="$(registered_cmd)"
+ if [ -n "$reg" ]; then good "hook registered for Bash in $SHOWN/settings.json"; else fail "no working hook entry for Bash in $SHOWN/settings.json"; fi
+
+ if [ -f "$GUARD" ]; then
+ local fx rc out
+ fx="$(mktemp -d)"; mkdir -p "$fx/App"
+ printf '<plist><dict></dict></plist>' > "$fx/App/Info.plist"
+ printf 'import CoreLocation\nclass A { func signIn(){} func createAccount(){} }\nlet m=CLLocationManager()\nlet u="https://staging.example.com"\nimport Stripe\n' > "$fx/App/X.swift"
+ bash "$GUARD" "$fx" >/dev/null 2>&1; rc=$?
+ if [ "$rc" -eq 2 ]; then good "guard blocks a sample app with known rejection risks"; else fail "guard did not block the sample app when run directly (exit $rc, expected 2)"; fi
+ # The registered command string is what Claude Code runs, so that exact string is what gets tested.
+ if [ -n "$reg" ]; then
+ ( cd "$fx" && printf '{"tool_name":"Bash","tool_input":{"command":"fastlane deliver"}}' | env -u CLAUDE_PROJECT_DIR bash -c "$reg" >/dev/null 2>&1 ); rc=$?
+ if [ "$rc" -eq 2 ]; then good "the registered hook command blocks a submit command"; else fail "the registered hook command did not block a submit command (exit $rc, expected 2). Command. $reg"; fi
+ out="$( cd "$fx" && printf '{"tool_name":"Bash","tool_input":{"command":"ls -la"}}' | env -u CLAUDE_PROJECT_DIR bash -c "$reg" 2>&1 )"; rc=$?
+ if [ "$rc" -eq 0 ] && [ -z "$out" ]; then good "the registered hook command stays silent on an ordinary command"; else fail "the registered hook command reacted to an ordinary command (exit $rc)"; fi
+ fi
+ rm -rf "$fx"
+ fi
+ have python3 -c pass || warn "python3 not found. The guard still runs, the deadline list and the privacy manifest validator are skipped."
+ say ""
+ if [ "$PROBLEMS" -eq 0 ]; then
+ say "Install verified."
+ say "Check your app now. bash $SHOWN/hooks/$GUARD_NAME /path/to/your/app"
+ say "Inside Claude Code. /app-store-audit"
+ say "Restart Claude Code once so it loads the hook."
+ return 0
+ fi
+ say "$PROBLEMS problem(s) above. Fix them, then run. bash $REPO/scripts/install.sh doctor"
+ return 1
+}
+
+do_install() {
+ [ -f "$GUARD_SRC" ] || { echo "Run this from a full checkout. $GUARD_SRC is missing." >&2; exit 1; }
+ if [ "$DRY" -eq 1 ]; then
+ say "Dry run. Nothing is written."
+ say " would copy the guard to $SHOWN/hooks/$GUARD_NAME"
+ say " would copy the skill to $SHOWN/skills/app-store-compliance (SKILL.md, $PAYLOAD_DIRS, .citation-allowlist)"
+ say " would copy the slash command to $SHOWN/commands/app-store-audit.md"
+ say " would add one PreToolUse Bash hook entry to $SHOWN/settings.json, keeping every other key, with a backup"
+ say " would run the guard against a sample app to prove it blocks"
+ exit 0
+ fi
+ say "Installing the App Store Compliance Playbook into $SHOWN"
+ mkdir -p "$CONF/hooks" "$SKILL" "$CONF/commands" || { echo "Cannot write to $CONF" >&2; exit 1; }
+ cp "$GUARD_SRC" "$GUARD" && chmod +x "$GUARD"
+ cp "$REPO/agent-os/skill/SKILL.md" "$SKILL/SKILL.md"
+ cp "$REPO/.citation-allowlist" "$SKILL/.citation-allowlist"
+ local d
+ for d in $PAYLOAD_DIRS; do
+ rm -rf "${SKILL:?}/$d"
+ cp -R "$REPO/$d" "$SKILL/$d"
+ done
+ rm -rf "$SKILL/scripts/__pycache__"
+ cp "$REPO/agent-os/commands/app-store-audit.md" "$CMD_FILE"
+ good "files copied"
+
+ settings_edit add; local rc=$?
+ case "$rc" in
+ 0) good "hook added to settings.json (a backup sits next to it when the file already existed)" ;;
+ 3) good "hook already registered, settings.json left as it is" ;;
+ 4) fail "settings.json is not valid JSON, repeats a key, or has an unexpected shape. It was not changed."; manual_block ;;
+ 6) fail "settings.json is read-only. It was not changed."; manual_block ;;
+ *) fail "neither python3 nor jq is installed, so settings.json was not edited."; manual_block ;;
+ esac
+ verify
+}
+
+do_uninstall() {
+ if [ "$DRY" -eq 1 ]; then
+ say "Dry run. Would remove the guard, the skill folder, the slash command and the hook entry from $SHOWN."; exit 0
+ fi
+ rm -f "$GUARD" "$CMD_FILE"; rm -rf "$SKILL"
+ settings_edit remove; local rc=$?
+ case "$rc" in
+ 0) say "Removed the guard, the skill, the slash command and the hook entry. A backup of settings.json sits next to it." ;;
+ 3) say "Removed the guard, the skill and the slash command. No hook entry was registered." ;;
+ *) say "Removed the files. Could not edit settings.json, remove the $GUARD_NAME entry by hand."; exit 1 ;;
+ esac
+}
+
+case "$MODE" in
+ help) say "Usage. install.sh [install|doctor|uninstall] [--dry-run]"; say " install copy the guard, skill and slash command, register the hook, verify (default)"; say " doctor verify an existing install, change nothing"; say " uninstall remove everything install added"; say "Set CLAUDE_CONFIG_DIR to target a config folder other than ~/.claude." ;;
+ install) do_install ;;
+ doctor) verify ;;
+ uninstall) do_uninstall ;;
+esac
diff --git a/scripts/release-audit.py b/scripts/release-audit.py
index e287ce2..a183cdc 100755
--- a/scripts/release-audit.py
+++ b/scripts/release-audit.py
@@ -357,7 +357,7 @@ def main():
while i < len(lines):
line = lines[i]
# deadline-checker lines ("[HIGH] EU AI Act ... (mandatory ...) absorbed into ...") are not findings
- if "absorbed into" in line and "(mandatory " in line:
+ if "(mandatory " in line:
i += 1
continue
match = re.match(
diff --git a/scripts/test-validate.py b/scripts/test-validate.py
index c37b309..e066d7b 100644
--- a/scripts/test-validate.py
+++ b/scripts/test-validate.py
@@ -121,6 +121,11 @@ class TestDateOrder(unittest.TestCase):
)
self.assertEqual(rc, 0, out)
+ def test_dead_section_path_fails(self):
+ rc, out = run(entry(affected_repository_sections="docs/NO-SUCH-FILE.md section 2"))
+ self.assertEqual(rc, 1, out)
+ self.assertIn("docs/NO-SUCH-FILE.md", out)
+
def test_real_data_is_valid(self):
cmd = [sys.executable, os.path.join(ROOT, "scripts", "validate.py")]
env = {k: v for k, v in os.environ.items() if k != "DEADLINES_FILE"}
diff --git a/scripts/validate.py b/scripts/validate.py
index 048209a..9280035 100644
--- a/scripts/validate.py
+++ b/scripts/validate.py
@@ -4,6 +4,7 @@ pass, 1 on error; see README.md and AGENTS.md for the check list."""
import json
import os
+import re
import sys
import datetime
@@ -61,6 +62,18 @@ def parse_day(value):
return None
+SECTION_PATH = re.compile(
+ r"(?:docs|references|data|scripts|agent-os|templates)/[A-Za-z0-9_./-]+\.(?:md|json|py|sh)"
+)
+
+
+def validate_section_paths(d, did):
+ """Every file named in affected_repository_sections must exist in the repo."""
+ for path in SECTION_PATH.findall(str(d.get("affected_repository_sections") or "")):
+ if not os.path.exists(os.path.join(ROOT, path)):
+ errors.append(f"deadline '{did}' points at {path}, which does not exist")
+
+
def validate_deadline_dates(d, did, today):
"""Date order, and an owner for a deadline that has passed (#660)."""
eff, mand, enf = (
@@ -163,6 +176,7 @@ def main():
f"deadline '{did}' missing required field '{f}'"
)
+ validate_section_paths(d, did)
if d.get("priority") not in SEVERITIES:
errors.append(
f"deadline '{did}' has invalid priority '{d.get('priority')}'"
diff --git a/scripts/verify-citations-test.sh b/scripts/verify-citations-test.sh
index 5fb30b2..52a70b0 100755
--- a/scripts/verify-citations-test.sh
+++ b/scripts/verify-citations-test.sh
@@ -40,6 +40,12 @@ echo "https://www.ftc.gov/legal-library" > "$WORK/hid/.github/CONTRIBUTING.md"
out="$(python3 "$VERIFY" --dir "$WORK/hid" --offline 2>&1)"
echo "$out" | grep -q "1 distinct URL" && echo "$out" | grep -q "ftc.gov" && ! echo "$out" | grep -q "browser-log" && ok "hidden tool-state directories are skipped, .github is scanned" || bad "hidden tool-state directories are skipped, .github is scanned"
+# 3c. a --files path that does not exist is an error, and a relative one is tried under --dir
+out="$(cd / && python3 "$VERIFY" --dir "$WORK" --files no-such-folder/ --offline 2>&1)"; rc=$?
+[ "$rc" -eq 2 ] && echo "$out" | grep -q "does not exist" && ok "a missing --files path fails loudly" || bad "a missing --files path fails loudly (rc=$rc)"
+out="$(cd / && python3 "$VERIFY" --dir "$WORK" --files a.md --offline 2>&1)"
+echo "$out" | grep -q "2 distinct URL" && ok "a relative --files path resolves under --dir from any directory" || bad "a relative --files path resolves under --dir from any directory"
+
if ! net_up; then
echo "SKIP network tests (offline)"
else
diff --git a/scripts/verify-citations.py b/scripts/verify-citations.py
index fb8f178..700afcd 100755
--- a/scripts/verify-citations.py
+++ b/scripts/verify-citations.py
@@ -168,7 +168,16 @@ def main():
with open(allow_path, encoding="utf-8") as fh:
allow = {ln.strip() for ln in fh if ln.strip() and not ln.startswith("#")}
- urls = collect_urls(root, args.files)
+ files = []
+ for path in args.files or []:
+ # a relative path is tried from the working directory first, then under --dir
+ resolved = path if os.path.exists(path) else os.path.join(root, path)
+ if not os.path.exists(resolved):
+ print(f"verify-citations. '{path}' does not exist here or under {root}. Nothing was checked.")
+ return 2
+ files.append(resolved)
+
+ urls = collect_urls(root, files or None)
if not urls:
print("verify-citations. no URLs found.")
return 0