Skip to content

Stop false phone-number holds on /ship run ids and name interactive /autoplan runs - #4747

Merged
capy-ai[bot] merged 7 commits into
mainfrom
privacy-check-skips-run-ids
Nov 23, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
privacy-check-skips-run-ids

Conversation

@garrytan

@garrytan garrytan commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Posting a PR body that lists earlier /ship runs no longer stops for a "phone number" that is really a run id, and an interactive /autoplan approval is imported under its own run id instead of autoplan.
Every /ship that rewrote a body holding earlier runs waited for a confirmation (#4725; about 1 in 10 run ids also reads as a card number and still asks, fixed in a follow-up), and interactive /autoplan runs could not be cited by run id (#4402).
Nothing to do after merge.

Issues

Fixes #4402
Refs #4725 (partly fixed: run ids no longer read as phone numbers; a run id that also reads as a card number still asks for confirmation until the follow-up PR)

Refs #4729 (outside PR by @thomsjack; its idea is rebuilt here on current main, with credit)

What changed
  • gstack-post skips /ship's run ids in the run history block. In each closed run history block that /ship writes into a PR body, a line that is a JSON object byte-identical to its JSON.stringify rendering, with a 40-hex head and a run shaped like a /ship session id (<pid>-<epoch>-<8 hex or digits>), has the column span of that top-level run value skipped for pii.phone.e164 only. Repro on main c4cfe6d: the reporter's body exits 2 with RULE: pii.phone.e164 LINE: 4; on this branch it scans clean.
  • gstack-approvals import --autoplan uses the run id written on its gate rows. With no run.json (an interactive run), the import takes the newest run written on its decisions.jsonl rows and only that run's rows, instead of the folder name autoplan. A Plan: approved: <folder> line resolves the same way.
  • Interactive /autoplan run ids read cleanly. The id was <branch>-<YYYYMMDD-HHMMSS>; on a branch like fix-4402 the privacy check read 4402-20261122-093321 as a phone and card number, so the import was refused and a Plan: line citing it would be held. The id is now <branch>-autoplan-<YYYYMMDD-HHMMSS>, which scans clean in the import and in a PR body. No scanner exemption was widened for this; the restore file name is unchanged.
Security read

This adds an exemption to a privacy check, so it is additive only: the existing catch is unchanged, and the new code only adds skip spans.

  • Only the top-level run value is skipped, only for pii.phone.e164 (a card-number or any other finding there still reports), only inside a closed fence whose opening line is exactly the run history block's fence line, only on a canonical JSON line with a 40-hex head, and only when the value matches the session-id shape the PR body's other /ship record already uses.
  • Commit ids were checked and need no exemption: 40-hex commit fields, including all-digit ones, raise no finding.
  • Negative controls in the new test, each still held: a phone number in reason on the same line as a valid run; a phone number as the run; a truncated id; a session id under another key (grant) and nested under review_loop; non-canonical spacing; a duplicated run key; a missing head; a non-sha head; an unclosed block; the same id in prose after the block; the same line in a json block.
  • The /autoplan change touches no exemption: an imported run id still goes through the full scan.
Tests
  • test/gstack-post.test.ts: the new runs-block test fails on main's lib/gstack-post.ts and passes here.
  • test/approval-record.test.ts: the new numbered-branch test fails on main's autoplan/SKILL.md.tmpl and passes here; the interactive import tests and the plan-record path test pass.
  • Targeted: gstack-post, approval-record, plan-record, the run history block tests, pr-review-history, autoplan-owned-read, parity-suite, module-size ratchet, spawnsync tripwire; bun run typecheck and typecheck:test clean. CI is the full run.
  • No paid eval ran. The eval selector picked paid cases only because shared libraries changed, and the one prompt line that changed is covered by the free autoplan-owned-read test.
Documentation
  • docs/troubleshooting.md: the run-id-as-phone entry now says run ids in the run history block are skipped for the phone check, and that a run id which also reads as a card number still asks. The approval-record entry names the interactive /autoplan run id shape, and a new paragraph explains PLAN_UNRESOLVED when a run folder holds several runs or an unreadable log.
  • changelog.d/privacy-check-skips-run-ids.md: the release note, including the known card-number gap.
  • The docs audit checked these against lib/gstack-post.ts, lib/approval-record.ts and lib/plan-record.ts; docs/review-policy.md and docs/unattended.md need no change.
Agent notes

Lane GSTA-802 (GST-3484). The run history block is the gstack-receipt-runs fence; the session-id shape is SESSION_ID in lib/gstack-post.ts, already used for the ship receipt's run. Commit fields checked: head, tree, carried_from. The outside PR #4729 was read as text only; nothing from its branch was fetched or run. The approval import change returns from e91936b, which moved it out of #4681.

Plan: exempt: bug fix

REVIEW_LOOP: passes=3 blocking_found=12 deferred=0 noted=12 fixed=7 scope=frozen open=5 ledgers_read=6 dispatches=12

Ruled note: lib/gstack-post.ts:593:outside-voice at c2eb4bb ruled by GSTA-36 (relayed from GSTA-36:2026-11-23T16:54:58Z) at 2026-11-23T16:54:58.520Z: below the R12 floor: fails closed (false privacy hold only); a Markdown-exact fence rule would loosen main's receipt-line check (approval a-544dbb01d3b6)
Ruled note: lib/approval-record.ts:407:outside-voice at 253c73c ruled by GSTA-36 (relayed from GSTA-36:2026-11-23T17:05:23Z) at 2026-11-23T17:05:23.709Z: below R12 floor: rows stay filtered to their own run id (approval a-d585882213ba)
Ruled note: lib/plan-record.ts:157:outside-voice at 253c73c ruled by GSTA-36 (relayed from GSTA-36:2026-11-23T17:05:23Z) at 2026-11-23T17:05:23.877Z: below R12 floor: a folder citation is a pointer; main pooled runs (approval a-69038737011f)
Ruled note: lib/approval-record.ts:228:outside-voice at 253c73c ruled by GSTA-36 (relayed from GSTA-36:2026-11-23T17:05:23Z) at 2026-11-23T17:05:24.019Z: below R12 floor: long or non-ASCII branches fail closed, no leak (approval a-4d80d33705be)
Ruled note: lib/gstack-post.ts:655:outside-voice at 253c73c ruled by GSTA-36 (relayed from GSTA-36:2026-11-23T17:05:23Z) at 2026-11-23T17:05:24.160Z: partial-fix gap (1 in 10 ids trip pii.cc); follow-up PR (approval a-27581ab5d275)

{
  "schema_version": 1,
  "pr": 4747,
  "head": "f29ff9788a54edf2d1b22067170bd76b0061b976",
  "version": "1.103.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 158,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 36,
  "session_kind": "unattended",
  "run": "ship4747",
  "head_tree": "61588df60cfee7efc4f83c3633d865cd6fe77c31",
  "product_patch_id": "26dbb91220b63b37d424327b595aeb5f9acbda78",
  "gstack_version": "1.103.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 62,
    "rules": "33831f8248a814fd",
    "base": "cb06a6dec1514fe38432518d8cb7414b8d218cd7",
    "registry": "cb06a6dec1514fe38432518d8cb7414b8d218cd7",
    "gate_scan": {
      "tagged": 1,
      "head": "f29ff9788a54edf2d1b22067170bd76b0061b976"
    },
    "reasons": [
      "gate-class",
      "runtime=62"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @61588df60cfe (8 checks, current for f29ff9788a54)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45225790001/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45225790087/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=61588df60cfe tests=39259 skipped=104 runs=45225790001/1 profiles=ci-reuse/free-tests heads=f29ff9788a54 base_moved=cb06a6dec151 verified=2026-11-23T17:36:20.583Z"
  ],
  "issues": {
    "fixes": [
      4402
    ],
    "refs": [
      4725
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md and docs/ (re-audit after the owner approved two docs/troubleshooting.md edits)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 5,
    "deferred": 0,
    "noted": 4,
    "fixed": 5,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "ruled_notes": [
    {
      "finding": "lib/gstack-post.ts:593:outside-voice",
      "head": "c2eb4bb12d38248144c94116eb1b280a7ed4159b",
      "by": "GSTA-36",
      "reason": "below the R12 floor: fails closed (false privacy hold only); a Markdown-exact fence rule would loosen main's receipt-line check",
      "at": "2026-11-23T16:54:58.520Z",
      "approval": "a-544dbb01d3b6",
      "relayed": "GSTA-36:2026-11-23T16:54:58Z"
    },
    {
      "finding": "lib/approval-record.ts:407:outside-voice",
      "head": "253c73c5d9b0c5c8525c868c7d5d66dc9d5dc67b",
      "by": "GSTA-36",
      "reason": "below R12 floor: rows stay filtered to their own run id",
      "at": "2026-11-23T17:05:23.709Z",
      "approval": "a-d585882213ba",
      "relayed": "GSTA-36:2026-11-23T17:05:23Z"
    },
    {
      "finding": "lib/plan-record.ts:157:outside-voice",
      "head": "253c73c5d9b0c5c8525c868c7d5d66dc9d5dc67b",
      "by": "GSTA-36",
      "reason": "below R12 floor: a folder citation is a pointer; main pooled runs",
      "at": "2026-11-23T17:05:23.877Z",
      "approval": "a-69038737011f",
      "relayed": "GSTA-36:2026-11-23T17:05:23Z"
    },
    {
      "finding": "lib/approval-record.ts:228:outside-voice",
      "head": "253c73c5d9b0c5c8525c868c7d5d66dc9d5dc67b",
      "by": "GSTA-36",
      "reason": "below R12 floor: long or non-ASCII branches fail closed, no leak",
      "at": "2026-11-23T17:05:24.019Z",
      "approval": "a-4d80d33705be",
      "relayed": "GSTA-36:2026-11-23T17:05:23Z"
    },
    {
      "finding": "lib/gstack-post.ts:655:outside-voice",
      "head": "253c73c5d9b0c5c8525c868c7d5d66dc9d5dc67b",
      "by": "GSTA-36",
      "reason": "partial-fix gap (1 in 10 ids trip pii.cc); follow-up PR",
      "at": "2026-11-23T17:05:24.160Z",
      "approval": "a-27581ab5d275",
      "relayed": "GSTA-36:2026-11-23T17:05:23Z"
    }
  ],
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "e01517eddd4b2350",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "26dbb91220b63b37d424327b595aeb5f9acbda78",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{"head":"c2eb4bb12d38248144c94116eb1b280a7ed4159b","run":"ship4747","mark":"stop","tree":"0d5732ddb8281b9abd30d7d37363613f399d218a","at":"2026-11-23T16:52:25.592Z"}

…autoplan runs

gstack-post read the run id on each line of a PR body's gstack-receipt-runs block as a phone number, so every /ship that rewrote a body holding earlier runs stopped for a confirmation (#4725). The run value of a well-formed runs line (canonical JSON, 40-hex head, a /ship session id) is now skipped, and a phone number anywhere else is still caught.

gstack-approvals import --autoplan now records an interactive /autoplan run under the run id its gate rows carry instead of the folder name "autoplan" (#4402). Interactive run ids put "autoplan" between the branch name and the time stamp, so a branch name ending in digits no longer reads as a phone or card number.

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

trunk-io Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 6 commits November 23, 2026 16:24
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>
The run history exemption now applies only to a block that opens outside any other code fence, and a line that cannot be re-serialized is skipped instead of stopping the post. A Plan line naming a shared interactive /autoplan folder that holds several runs no longer resolves to the newest one. Run ids that interactive /autoplan minted before this change still import on branch names ending in digits.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/outside-voice#3 reader=outside-voice
Review-Finding: p1/outside-voice#4 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A Plan line naming a shared interactive /autoplan folder that holds several runs now resolves to no run at all, so approvals imported before this change under the shared id autoplan cannot stand in for it.

Review-Finding: p2/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
An interactive run id minted before #4402 is exempt only when its stamp is a real calendar time, and a Plan line naming an interactive /autoplan folder whose decision log cannot be read resolves to no run.

Review-Finding: p2/outside-voice#1 reader=outside-voice
Review-Finding: p2/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The privacy check's troubleshooting entries now say which run ids it skips in the run history block and which older interactive /autoplan run ids import, and that a run id that also reads as a card number still asks. The changelog entry says the same.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 0d6cc1b into main Nov 23, 2026
61 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
Posting a PR body that lists earlier /ship runs, or the /ship result
record, no longer stops for a "card number" that is really a /ship run
id.

About 1 in 10 run ids passes the card-number checksum, so those bodies
still waited for a confirmation after #4747's phone-number fix (#4725).

Nothing to do after merge.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@garrytan garrytan mentioned this pull request Nov 24, 2026
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
- `/ship` now tells you what to change when GitHub refuses a push for email privacy. (#4748)
- The release gate's /cso check accepts the low-confidence hypotheses /cso now reports. (#4753)
- /cso reports every security finding the code supports instead of dropping most of them. (#4739)
- /cso can search the whole repository in one call, and a daily report now lists its low-confidence hypotheses. (#4742)
- A first version's plan and try-it message now open with the owner's own words, and the build is tried the same way he will try it before he is asked. (#4759)
- A first version's public export now keeps out the owner's short quotes and his reasons to leave something out, and a phone first-use check installs a build the cloud phone can actually run. (#4772)
- Three intermittent test failures are fixed. (#4745)
- Free Tests runs its shards on 8-core runners again. (#4749)
- A land that waits on an earlier CI run now decides on what that run actually did. (#4763)
- Landing a PR no longer starts a new CI run when one for the same merged code is already running or has passed. (#4760)
- /ship no longer misses a file-mode change from main on files whose names start with `:`. (#4774)
- make-pdf keeps quotes in alt text, link titles and raw HTML attributes inside the attribute, so a Markdown file can no longer add an `onerror`, `onload` or `javascript:` link that runs in the print browser. (#4761)
- Posting a PR body that lists earlier /ship runs no longer stops for a phone number that isn't there. (#4747)
- A first version's public export now catches a short owner quote whose padding or quote marks are encoded. (#4778)
- A first version's public export now also keeps out a short owner quote written with spaces just inside its quote marks. (#4776)
- Posting a PR body that lists earlier /ship runs no longer stops for a card number that isn't there. (#4751)
- /ship no longer asks for an extra reader when you merge the base branch next to code that was already reviewed. (#4754)
- /ship no longer plans narrow re-checks after a fix. (#4741)
- /ship can't quietly gain new refusals. (#4740)
- `gstack-upgrade` no longer refuses to run after you disable skills. (#4743)
- The free test suite splits its shards from this week's recorded test times. (#4744)
- gstack now writes up a failed or shelved attempt before closing it. (#4735)

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

1 participant