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.

fix(guard): exit on an empty hook payload instead of scanning the working directory (#604)

Mirza Iqbal4e51811b842a
diff --git a/agent-os/hooks/app-store-compliance-guard-test.sh b/agent-os/hooks/app-store-compliance-guard-test.sh
index 137775f..cacd274 100755
--- a/agent-os/hooks/app-store-compliance-guard-test.sh
+++ b/agent-os/hooks/app-store-compliance-guard-test.sh
@@ -199,6 +199,11 @@ OUT="$(printf '%s' '{not valid json [[[ command : oops }}}' | bash "$GUARD" 2>&1
OUT="$(printf '' | bash "$GUARD" /tmp 2>&1)"; RC=$?
[ "$RC" -eq 0 ] || [ "$RC" -eq 2 ] && ok "Empty stdin handled" || bad "Empty stdin handled (got $RC)"
+# 9b fail-open. Hook mode with an empty payload must not fall back to scanning the working directory
+D="$(mk_ios_bad)"; OUT="$(cd "$D" && printf '' | bash "$GUARD" 2>&1)"; RC=$?
+[ "$RC" -eq 0 ] && [ -z "$OUT" ] && ok "Empty hook payload exits 0 without scanning cwd" || bad "Empty hook payload scanned cwd (rc=$RC)"
+rm -rf "$D"
+
# 10 precision. The four known false-positive scenarios must NOT fire (no false alarms).
D="$(mk_ios_precision_safe)"; OUT="$(bash "$GUARD" "$D" 2>&1)"; RC=$?
if echo "$OUT" | grep -Eq 'STAGING-BACKEND|MISSING-USAGE-DESCRIPTION|BOTH-PLACEHOLDER|MISSING-ATT' || [ "$RC" -ne 0 ]; then
diff --git a/agent-os/hooks/app-store-compliance-guard.sh b/agent-os/hooks/app-store-compliance-guard.sh
index 49628a2..560eb56 100755
--- a/agent-os/hooks/app-store-compliance-guard.sh
+++ b/agent-os/hooks/app-store-compliance-guard.sh
@@ -26,6 +26,8 @@ elif [ "$#" -ge 1 ] && [ ! -d "$1" ]; then
log_err "project dir not found. $1"; exit 0
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.
+ [ -z "$STDIN_JSON" ] && exit 0
fi
if [ -n "$STDIN_JSON" ]; then