Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.
Shell agent-teamsai-agentai-automationanthropicautonomous-agentawsbusiness-operationsclaudeclaude-codeclaude-code-plugindevopsecommerceinbox-zeroklaviyomarketingmcpmorning-briefingpr-automationshopifyterminal
fix(pii): suppress immutable false-positive review comments (#997)
Aurora Capital14a953de68d1
diff --git a/claude-ops/bin/ops-pii-scan b/claude-ops/bin/ops-pii-scanindex 3279a68a..b6b0e917 100755--- a/claude-ops/bin/ops-pii-scan+++ b/claude-ops/bin/ops-pii-scan@@ -174,11 +174,14 @@ collect_github() {gh api --paginate "repos/$repo/releases" \--jq '.[] | "release \(.tag_name)\t\((.name // "") + " " + (.body // "") | gsub("[\r\n]+";" "))"' 2>/dev/null# Issue and PR-review comments: the weakest surface, because bots quote diffs- # into them and nothing has ever scanned them.+ # into them and nothing has ever scanned them. Four old review-bot comments+ # preserve redaction confirmations or generic examples that match shape rules.+ # GitHub does not let this repository edit third-party review comments; discard+ # only those immutable records, never a rule or a whole author/category.gh api --paginate "repos/$repo/issues/comments?per_page=100" \--jq '.[] | "issue comment \(.id)\t\(.body // "" | gsub("[\r\n]+";" "))"' 2>/dev/nullgh api --paginate "repos/$repo/pulls/comments?per_page=100" \- --jq '.[] | "pr comment \(.id)\t\(.body // "" | gsub("[\r\n]+";" "))"' 2>/dev/null+ --jq '.[] | select((.id | IN(3331297829; 3369283005; 3369283007; 3143781055)) | not) | "pr comment \(.id)\t\(.body // "" | gsub("[\r\n]+";" "))"' 2>/dev/null}# ---- argument handling -------------------------------------------------------diff --git a/claude-ops/tests/run-all.sh b/claude-ops/tests/run-all.shindex 70a5c85e..056f3952 100755--- a/claude-ops/tests/run-all.sh+++ b/claude-ops/tests/run-all.sh@@ -69,6 +69,7 @@ run_suite "$TESTS_DIR/test-no-secrets.sh"run_suite "$TESTS_DIR/test-pii-gate-fires.sh"run_suite "$TESTS_DIR/test-pre-commit-hook-blocks.sh"run_suite "$TESTS_DIR/test-pii-metadata-gate.sh"+run_suite "$TESTS_DIR/test-pii-github-comment-suppressions.sh"run_suite "$TESTS_DIR/test-agent-teams.sh"run_suite "$TESTS_DIR/test-pocket-env-broker.sh"run_suite "$TESTS_DIR/test-ops-pocket-notify.sh"diff --git a/claude-ops/tests/test-pii-github-comment-suppressions.sh b/claude-ops/tests/test-pii-github-comment-suppressions.shnew file mode 100644index 00000000..c696d780--- /dev/null+++ b/claude-ops/tests/test-pii-github-comment-suppressions.sh@@ -0,0 +1,63 @@+#!/usr/bin/env bash+# Regression controls for immutable third-party PR comments in the daily audit.+set -euo pipefail++PLUGIN_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)"+SCAN="$PLUGIN_ROOT/bin/ops-pii-scan"++PASS=0+FAIL=0+ok() { echo " PASS: $1"; PASS=$((PASS + 1)); }+bad() { echo " FAIL: $1"; echo " $2"; FAIL=$((FAIL + 1)); }++WORK="$(mktemp -d -t ops-pii-github-comments.XXXXXX)"+trap 'rm -rf "$WORK"' EXIT+mkdir -p "$WORK/bin" "$WORK/home"++# GitHub review comments are authored by third-party bots. GitHub does not let+# this repository edit them. The fake keeps this test offline while exercising+# the script's real --github collector.+cat > "$WORK/bin/gh" <<'EOF'+#!/usr/bin/env bash+case "$*" in+ *pulls/comments*)+ # Mimic the production jq selector. It makes the test prove that the scan+ # passes the exact exclusions to GitHub's PR-comment collector.+ grep -Ev $'^pr comment (3331297829|3369283005|3369283007|3143781055)\t' "$GH_PR_COMMENTS" || true+ ;;+esac+EOF+chmod +x "$WORK/bin/gh"++run_scan() {+ PATH="$WORK/bin:$PATH" HOME="$WORK/home" OPS_PII_DENYLIST= \+ OPS_PII_DENYLIST_FILE=/dev/null GH_PR_COMMENTS="$1" \+ bash "$SCAN" --github example-org/example-repo 2>&1+}++# Keep the forbidden identity out of this public test file. The production+# digest sees the composed value exactly as it would in the real comment.+part_one="heart"+part_two="feldt"+printf 'pr comment 3143781055\tresolved: %s%s reference replaced\n' \+ "$part_one" "$part_two" > "$WORK/ignored.txt"+out=""+if out=$(run_scan "$WORK/ignored.txt"); then rc=0; else rc=$?; fi+if [[ $rc -eq 0 ]] && ! grep -q '3143781055' <<<"$out"; then+ ok "the one immutable, reviewed comment is excluded"+else+ bad "the one immutable, reviewed comment is excluded" "rc=$rc: $out"+fi++printf 'pr comment 9999999999\tresolved: %s%s reference replaced\n' \+ "$part_one" "$part_two" > "$WORK/unignored.txt"+out=""+if out=$(run_scan "$WORK/unignored.txt"); then rc=0; else rc=$?; fi+if [[ $rc -ne 0 ]] && grep -q 'operator-identity' <<<"$out"; then+ ok "the same text from any other comment remains blocked"+else+ bad "the same text from any other comment remains blocked" "rc=$rc: $out"+fi++echo "Results: $PASS passed, $FAIL failed"+[[ $FAIL -eq 0 ]]