Skip to content

Stop mistaking ordinary text for Capy ids and check every part of a public PR body (GST-4105) - #4872

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/public-pr-body-follow-ups
Nov 28, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/public-pr-body-follow-ups

Conversation

@garrytan

@garrytan garrytan commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

On public repositories, /gstack-ship no longer refuses or rewrites ordinary text such as SHA-256:abc or test/jam_fix.ts as if it were a Capy id, and it now checks every part of the PR body it posts.
Why: these are the follow-ups #4868 left open. It made public PR bodies safe but caught too much and left a few corners unchecked.
Nothing to do: private repositories keep working with PR bodies written before #4868.

What changed

After #4868, a public PR body that mentioned a hash (SHA-256:abc), an encoding (UTF-8:x), an issue ref (PR-12:fix) or a file such as test/jam_fix.ts was refused or had that text swapped for "a private message". Now only real Capy ids count: jam_, icm_ and iev_ ids, and relay refs whose message part is one of those ids, a date or time, or epoch seconds. Every earlier catch stays in the tests, beside new tests for the look-alikes. A relayed ruling still reads "relayed from a private message" on a public repository, whatever its ref looks like, and a ruling whose reason merely says "relayed from" in its own words is no longer refused.

Writing the shipping record, moving it to a new commit and marking an abandoned run now also check the earlier-runs block they post, abandon reasons included, so a home folder path or Capy id there can't publish on a public repository.

Marking an abandoned run on a PR now touches only an open PR whose body records that run. It compares the PR's head with the repository the branch pushes to (its pushRemote or remote.pushDefault, else origin, at that remote's push URL), so contributors whose origin is upstream can use it.

The merge check accepts a private repository's Gate disposition: line written before ids were redacted again; public repositories still need the redacted line. A hand-edited earlier-runs entry whose run isn't text no longer crashes the review-round count, and a repeated abandon mark is placed only once. docs/troubleshooting.md documents the new refusals.

Why

Keeping private ids and home folders out of public PR bodies only works if the check is accurate. Over-catching blocked real work, and the unchecked corners could still let a path through.

Blast radius

The changes touch the shipping-record tool (writing a record, moving it to a new commit, marking an abandoned run), the Capy-id pattern its callers share, the merge check's gate-disposition line match and the review-round counter. Each new refusal fails closed and writes nothing. Private repositories keep every earlier behavior, and the new public-repo test file covers each path: 32 cases pass, and 16 new ones failed on the code before each fix.

Pre-Landing Review

Three full reviews ran, the last one read-only on the final code. The first found one informational gap in timestamp matching, which is fixed. A second-model review then found four real bugs in this PR's new code, fixed before the final review: abandon checked a different runs block from the one it edits, an epoch ref followed by a period slipped through, the fork check read the fetch URL instead of the push URL, and the relay check read the ruling's reason. The final review found no blockers.

Review notes

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

  • INFORMATIONAL sf-df554b2cbd19 security finding, details recorded privately
  • INFORMATIONAL sf-d0ea13941c40 security finding, details recorded privately
  • INFORMATIONAL sf-4b9448b0e63d security finding, details recorded privately
  • INFORMATIONAL sf-e722bb3f56d9 security finding, details recorded privately
  • INFORMATIONAL sf-f551079373c5 security finding, details recorded privately
Documentation

Status: current. The docs already describe the branch's behavior, so nothing was edited.

Scope: 7 committed files from bbe63d1 to c177903 (the shipping-record tool, lib/ruled-notes.ts, lib/gate-dispositions.ts, lib/pr-review-history.ts, a test, a changelog fragment and docs/troubleshooting.md), plus a repository-wide search of the authored docs and templates for the changed contracts (Capy id matching, relayed Ruled note refs, the runs-block leak refusals and abandon's PR checks).

Documentation health

  • docs/troubleshooting.md: current. The branch added the public-repository and abandon-refusal entries and updated the refusal text for writing and moving the record; all of it matches the code.
  • docs/ship-policy.md: current. Ruled notes already say a repository gh does not report private shows relayed from a private message.
  • changelog.d/capy-public-pr-body-follow-ups.md: matches the code (read only).

Coverage debt: reference and how-to coverage live in docs/troubleshooting.md. There is no explanation-level doc for how abandon picks the push remote (pushRemote, then remote.pushDefault, then origin); this is minor debt. Diagram drift: none, since no diagram covers these modules.

Tests
  • bun test test/ship-receipt-public-safe.test.ts: 32 pass, 0 fail (16 new cases each failed before its fix: 12 on main bbe63d1, 4 on 822c4ec)
  • bun test test/module-size-ratchet.test.ts test/troubleshooting-anchors.test.ts: pass
  • bun run typecheck clean; bun run typecheck:test: no new diagnostics
  • CI: the full free suite at the pushed head
Agent notes

Refs GST-4105. Follow-up to #4868.

Approvals

Approved: yes (record r-ec7300b481c5). The full approval record stays private.
Plan: exempt: bug fix follow-up to #4868 (R4, R65)
Plan check: exempt bug fix

REVIEW_LOOP: passes=3 blocking_found=4 deferred=0 noted=9 fixed=6 scope=frozen ledgers_read=4 dispatches=9

Gate edits: none detected (4 listed, 2 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4872,
  "head": "c1779037091782f3604d607eae924ee638ba3c67",
  "version": "1.104.2.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1736,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 46137277992,
      "attempt": 1,
      "tree": "911c086584802423b1e66fb49fe4fa46f9451e6e"
    }
  ],
  "calls": 26,
  "session_kind": "unattended",
  "run": "ship-4872",
  "head_tree": "911c086584802423b1e66fb49fe4fa46f9451e6e",
  "product_patch_id": "4ad2abaa0ac94b6399e3db8004f1ea5ef8e118fd",
  "gstack_version": "1.104.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 97,
    "rules": "d7f88d26d8f05e40",
    "base": "3af268b2b6137d01cbf9346287e0f1b2f89434e0",
    "registry": "3af268b2b6137d01cbf9346287e0f1b2f89434e0",
    "gate_scan": {
      "tagged": 0,
      "head": "c1779037091782f3604d607eae924ee638ba3c67"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=97"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @911c08658480 (8 checks, current for c17790370917)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/46137277992/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/46137278020/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=911c08658480 tests=38671 skipped=75 runs=46137277992/1 profiles=ci-reuse/free-tests heads=c17790370917 base_moved=3af268b2b613 verified=2026-11-28T11:00:13.072Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md; changed contract in docs/troubleshooting.md"
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 4,
    "deferred": 0,
    "noted": 9,
    "fixed": 6,
    "scope": "frozen",
    "rounds": 3,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 9
    }
  },
  "gate_dispositions": []
}

…ublic PR body (GST-4105)

Text like SHA-256:abc, PR-12:fix or test/jam_fix.ts no longer reads as a Capy id on public repositories, while
every real id and relay ref is still caught. Writing the shipping record, moving it to a new commit and marking an
abandoned run now also check the earlier-runs block and abandon reasons for home paths and ids. Marking an
abandoned run touches only an open PR that records the run, on the repository the branch pushes to. The merge
check accepts a private repository's pre-redaction gate disposition line again, and a hand-edited runs entry with
a non-text run no longer crashes the round count.

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

trunk-io Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 28, 2026 10:22
Review-Finding: p1/specialist-batched#1 reader=security
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ruling line

Review-Finding: p2/outside-voice#1 reader=outside-voice
Review-Finding: p2/outside-voice#2 reader=outside-voice
Review-Finding: p2/outside-voice#3 reader=outside-voice
Review-Finding: p2/outside-voice#4 reader=outside-voice
Review-Finding: p2/adversarial-native#1 reader=adversarial-native
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 merged commit dade7ca into main Nov 28, 2026
57 checks passed
@garrytan garrytan mentioned this pull request Nov 28, 2026
capy-ai Bot added a commit that referenced this pull request Nov 28, 2026
- Dependency and CI action updates, each checked against its publisher. (#4873)
- The PR body check no longer loses the closing Agent notes section when the text quotes a `<!--` comment opener in inline code or a code block, (#4874)
- `/gstack-ship` stops mistaking ordinary text for Capy ids, and checks every part of a public PR body it posts. (#4872)
- `/gstack-ship` no longer puts home folder paths or Capy thread and message ids into PR bodies on public repositories. (#4868)
- `/gstack-ship` no longer stops or blocks because of time and tokens that belong to something else. (#4877)
- /gstack-ship keeps its token cap and clock when its budget start reruns mid-run. (#4882)
- `/gstack-ship` stops reopening findings that were already settled, and a missing run folder no longer costs a docs-audit attempt. (#4875)
- `/gstack-ship` closes five gaps in how it records reviews, and `--for gstack-ship` now installs the ship skill on Capy. (#4867)
- The stable release no longer skips a fully tested commit because a report-only workflow failed on it. (#4865)
- A test that copies its own `bun` binary no longer stops `/gstack-ship` with a fetch violation. (#4876)
- The secrets check no longer reports an 11-digit GitHub Actions run id as a phone number when code names it with a camelCase run identifier (#4881)
- `/review` now always runs its Codex second-model review when Codex is ready, and runs the Red Team on diffs over 200 lines. (#4870)
- The factory scorecard's red-train rate now counts each train (one batch of PRs tested together) once per report, by its branch, so re-testing the same batch inside the report's window no longer moves the rate. (#4880)
- The secrets check catches more Google API keys in encoded text, reads each JavaScript and TypeScript declaration under its own name, reports a provider key once, and stops matching look-alike values against your environment's secrets. (#4871)
- The secrets check now catches keys in JavaScript, TypeScript and Go declarations, and stops flagging JSON key paths, run folders and base64 noise. (#4869)
- The paid shared-code review test no longer fails a correct review that printed a caller file with `cat -A`. (#4878)
- The weekly benchmark line in the stable release plan now also strips C1 control characters and the Unicode line and paragraph separators (U+2028, U+2029) from record text, (#4866)

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