Skip to content

Fewer false privacy holds when posting PRs and running pre-merge checks (GST-2047) - #4198

Merged
capy-ai[bot] merged 6 commits into
mainfrom
run-numbers-in-pr-descriptions-are-not-phone-numbers
Nov 9, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
run-numbers-in-pr-descriptions-are-not-phone-numbers

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Posting a PR description and running the pre-merge checks now stop far less often on machine-written numbers that only look like personal data. Fewer false holds keep the privacy check meaningful, so a real phone number, IP address or key still gets a careful read.

What changed

Run numbers /ship writes and autoplan run ids no longer trip the phone-number hold; a 10-digit number still does

Run numbers /ship writes and autoplan run ids no longer trip the phone-number hold; a 10-digit number still does.

Before/after as text: Run numbers /ship writes and autoplan run ids no longer trip the phone-number hold; a 10-digit number still does
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+this branch (aa4f9a4): the same block
-main (68b1d05): a writer-rendered /ship summary block with three CI run numbers
 $ gstack-post pr-body (fake gh)
+exit 0 (posted)
+$ the same block with a 10-digit number as a run
 RULE: pii.phone.e164 LINE: 17 PART: body
+exit 2 (confirm: still held)
+$ gstack-approvals import --autoplan (the same run)
+imported 1 row
-RULE: pii.phone.e164 LINE: 28 PART: body
-RULE: pii.phone.e164 LINE: 36 PART: body
-exit 2 (confirm)
-$ gstack-approvals import --autoplan (minted run id ending in a thread number)
-APPROVAL_RECORD_SECRET field ask: pii.phone.e164
 
  • CI run numbers in /ship's summary block. gstack-post no longer reads GitHub Actions run numbers in the run fields of a gstack-ship-receipt block (ci_carried[].run, flaky_exception[].runs, issues.flakes[].run) as phone numbers. Only a block exactly as the writer renders it qualifies (closed fence, schema-valid, byte-identical to renderReceiptBlock), only those values, and only when the value is 11 to 20 digits with an optional /attempt.
  • Autoplan run ids on approval import. gstack-approvals import skips pii.phone.e164 and pii.cc findings that start inside a minted autoplan run id's time stamp, or the thread number right before it, at the two places import writes the id. A phone number in the rest of the name, the row's words or plan title, or the same id typed into add, still refuses.
  • Versions next to a VERSION file or a semver. pii.ip_public skips a four-part quad a short punctuation gap (or the word to) away from a VERSION file name or path, or from a three-part version, on the same line, and a VERSION file holding only the quad. This is the shared scanner, so it applies to gstack-post, the pregate secrets check and the push hook alike.
  • LOW findings. A home path already only notes in gstack-post and only warns in pregate; new tests pin that.

Why

Garry asked to "reduce the extreme privacy holds and false positives". CI run numbers in /ship's summary block cost extra confirmation stops on every ship with carried CI, a VERSION write warned as a public IP, and an approval import refused an autoplan run id. Those stops now go away, and the real cases still hold.

Blast radius

The change narrows three detectors shared by gstack-post, gstack-approvals, the pregate secrets check and the push hook. Every exemption is bound to an exact position and shape, and each still-held case has a test. Those cases are a key anywhere (refused, inside the summary block too), a phone number in prose, beside the block, under another key, in a forged or broken block, as a 10-digit or text run value, in an approval's words, title or the name half of a run id, and a public IP with no version beside it (tests ran: the four focused files, 376 pass, and CI's free suite carried at this tree).

Summary

The privacy scan held PRs and approvals on numbers gstack itself wrote. This PR teaches the three detectors those exact shapes, at their exact positions, and nothing else. Review found and closed two holes in the first version (a phone-shaped string in a run field, and a phone number in a run id's name half), then a 10-digit run value, each now pinned by a test.

Test Coverage

All new code paths have test coverage (7 of 7 paths, 100% value-weighted, from the Step 7 audit; 0 tests generated). The review fixes extended test/gstack-post.test.ts and test/approval-record.test.ts; the new cases fail on the earlier head and pass here.
Tests ran: free 1652 (files, carried from CI run 42586662534)

Pre-Landing Review

Pass 1: 2 issues, 2 fixed (asked; the recommended fix was taken unattended), 0 deferred, 0 noted. Pass 2: 1 issue, noted. Step 11: the outside voice (openai/gpt-6.1-sol) was clean; the native adversarial reader raised 2 findings: one fixed in the owner-granted fix-check, one noted. The fix-check reader found nothing.
Gate edits: none detected (5 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol, VERDICT: CLEAN.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL lib/approval-record.ts:157 The narrowed run-id window refuses (fails closed) minted ids whose name ends in two digit groups (GSTA-36-2-) about 10% of the time, when pii.cc reads both groups plus the stamp as a Luhn-valid card; none of 115 real autoplan run ids is affected. Nothing leaks.
  • INFORMATIONAL lib/approval-record.ts:155 INVESTIGATE: the 14-digit stamp of a minted run id is not checked to be a real YYYYMMDDhhmmss time, so a phone or card number placed in those digits of an agent-written run.json id is exempt. Narrower than before this PR. Reader: Low, Blocks: no.

Exploratory QA

Functional, library-level probes through runPost and importAutoplan with a fake gh/git environment (no real post). Before the fixes, 4 of 7 contracts failed (a phone-shaped run field posted; a phone number in a run id's name half imported), confirmed by replay; after the fixes all 7 pass, and after the fix-check the 4 gstack-post probes pass again, including a 10-digit run value that now holds. Verdict: pass. Limits: no real PR post.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped. The selector picked no quality judges; behavioral probes selected only through library references were not run under this PR's eval rule.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). This is a bug fix (exempt from plan review).

Verification Results

No Step 8.1 obligations (no plan). Focused tests, typecheck and the QA probes above passed on the final tree.

TODOS

No TODO items completed in this PR.

Documentation

Scope: 9 committed files between base 68b1d05 and head aa4f9a4. The code changes are in lib/approval-record.ts, lib/gstack-post.ts and lib/redact-patterns.ts, with 4 test files. Nothing is staged, unstaged or untracked.

Result: Current, with no edits. docs/troubleshooting.md already covers each new exemption next to its detector entry: the minted run-id stamp skip in gstack-approvals import --autoplan, the pii.ip exemption for a four-part version beside VERSION or a three-part version, and the run-id fields in a rendered gstack-ship-receipt block. The changelog fragment describes the user-facing effect. Other docs that mention approvals import or plan records (docs/ship-policy.md, docs/unattended.md) don't restate the changed behavior.

Debt: None found.

Test plan

  • bun run test (free suite): carried from CI run 42586662534 at this tree, tests_ran 1652 files, exit 0
  • Focused: bun --no-env-file test test/gstack-post.test.ts test/approval-record.test.ts test/redact-context-exemptions.test.ts test/pregate-secrets-source-context.test.ts: 376 pass, 0 fail
  • bun run typecheck: exit 0

🤖 Generated with Claude Code

Agent notes

Approvals

Approved: yes (record r-06551dabc29e). The full approval record stays private: this repository is public or its visibility is unknown.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix

REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=2 fixed=3 scope=frozen ledgers_read=5 fix_checks=1 dispatches=6 est_input_tokens=47679
Gate edits: none detected (5 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-09 via approval a-beaa5e25530e (review_loop_grant 62e2fc5): One scoped fix-check after the 2-round cap on #4198: tighten the receipt run-id shape to 11-20 digits and add a test (fix-check at aa4f9a4, 0 findings)

Failing-first on main 68b1d05: the receipt test held with pii.phone.e164 findings; import refused a minted run id ending in a thread number (phone) and one tripping pii.cc; the pregate fixture with the pv-sdk.ts line went warn. Replaces #4197, closed for a branch name that failed the plain-words check.

Refs GST-2047

{
  "schema_version": 1,
  "pr": 4198,
  "head": "aa4f9a48b0080041aec87b9aa8fa5417248d06cf",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1652,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42586662534,
      "attempt": 1,
      "tree": "dacdbb6fbaac7edba178a19e27b3764f29ca8d6b"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "dacdbb6fbaac7edba178a19e27b3764f29ca8d6b",
  "product_patch_id": "064e7abb9d9c97cd99f99aed332866db5823dc72",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 104,
    "rules": "66e5174161eecc2c",
    "base": "350d4196c3444d81590d36cc2d8752be71cf19b6",
    "registry": "350d4196c3444d81590d36cc2d8752be71cf19b6",
    "gate_scan": {
      "tagged": 0,
      "head": "aa4f9a48b0080041aec87b9aa8fa5417248d06cf"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=104"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @dacdbb6fbaac (8 checks, current for aa4f9a48b008)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42586662534/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42586662534/attempts/1",
    "free-tests.yml/cso-windows-launcher: https://github.com/garrytan/gstack/actions/runs/42586662534/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42585697623/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=dacdbb6fbaac tests=36777 skipped=92 runs=42586662534/1 profiles=ci-reuse/free-tests heads=aa4f9a48b008 verified=2026-11-09T08:38:50.427Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md, CLAUDE.md, AGENTS.md and the changelog.d fragment (audit docs-4198-1)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 3,
    "deferred": 0,
    "noted": 2,
    "fixed": 3,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "est_input_tokens": 47679,
    "ledgers_read": 5,
    "dispatches": {
      "specialist-batched": 2,
      "red-team": 2,
      "fix-check": 1
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-09",
    "via": "approval a-beaa5e25530e (review_loop_grant 62e2fc5dfec0ac632b70ad4bffcc7bab74923f19)",
    "reason": "One scoped fix-check after the 2-round cap on #4198: tighten the receipt run-id shape to 11-20 digits and add a test",
    "fix_check": {
      "head": "aa4f9a48b0080041aec87b9aa8fa5417248d06cf",
      "findings": 0,
      "files": [
        "lib/gstack-post.ts",
        "test/gstack-post.test.ts",
        "docs/troubleshooting.md",
        "changelog.d/run-numbers-in-pr-descriptions-are-not-phone-numbers.md"
      ]
    }
  }
}

…ST-2047)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 9, 2026 07:40
…ard numbers (GST-2047)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ic IPs (GST-2047)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot changed the title Stop flagging test run numbers in PR descriptions as phone numbers (GST-2047) Fewer false privacy holds when posting PRs and running pre-merge checks (GST-2047) Nov 9, 2026
garrytan and others added 2 commits November 9, 2026 08:05
… on run id names (GST-2047)

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=security
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he phone-number check (GST-2047)

Review-Finding: v1/adversarial-native#2 reader=adversarial-native
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant