Skip to content

v1.94.8.0 fix(approvals): no identifying approval text in public-repo PR bodies (GST-1160) - #3918

Merged
capy-ai[bot] merged 5 commits into
mainfrom
garrytan/approvals-public-repo-privacy
Nov 3, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
garrytan/approvals-public-repo-privacy

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3918,
  "head": "5a0db31d80feda1d8871622aad6a8b7f95c8c0a0",
  "version": "1.93.39.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 43,
      "fail": 0,
      "skip": 0
    },
    "guards": {
      "pass": 38,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "c61eafa4d8dbd63b3457a9b01429784ad587a259",
  "product_patch_id": "452417779b6ffd8a7aaba4d1466e6aab147a8520",
  "gstack_version": "1.93.40.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 56,
    "rules": "b2272efd321ce7cb",
    "base": "e4e9913398e3b11a445bb5706bd387b4be5d38c4",
    "registry": "e4e9913398e3b11a445bb5706bd387b4be5d38c4",
    "gate_scan": {
      "tagged": 0,
      "head": "5a0db31d80feda1d8871622aad6a8b7f95c8c0a0"
    },
    "reasons": [
      "runtime=56"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @c61eafa4d8db (1 checks, current for 5a0db31d80fe)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41577559346/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41577559365/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=c61eafa4d8db tests=19040"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CONTRIBUTING.md, captain/, capy/skill/gstack/ (every doc naming gstack-approvals render or ## Approvals)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 8,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "unrecorded": 1,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 3,
      "red-team": 2
    }
  }
}

Why

"gstack-approvals rendered an Approvals row into a PR description on yc-software/qm, a public repo. The row held the owner's verbatim quote, the autoplan run id and the plan hash. GitHub keeps the original in the description's edit history and no API deletes it." (CAPY-1, via GST-1160) Now /ship on a public repo, or on one whose visibility gh can't read, publishes only "Approved: yes|no (record r-)". The full table still goes into private repos.

What changed

On a public repo, gstack-approvals render now prints only whether the plan was approved and an opaque record id. It no longer prints the owner's words, the autoplan run id or the plan hash. (No image: gstack-pr-shots could not start its renderer on this machine, PR_SHOTS_RENDER_FAILED, so the text version is below.)

Before/after as text: On a public repo, render now prints only whether the plan was approved and an opaque record id, not the owner's words, run id or plan hash
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ gstack-approvals render   # this branch, public repo
-$ gstack-approvals render   # main, public repo
 ## Approvals
 
+Approved: yes (record r-b61ecc4a4259). The full approval record stays private: this repository is public or its visibility is unknown.
-| Date | Asked | Exact words | Outcome | Covers | Still pending |
-|---|---|---|---|---|---|
-| 2026-11-03 | Approve the plan "QA synthetic probe" (autoplan run qa-run-001) | “qa synthetic words do it” (QA Probe) | approved | qa scope sha256 abcdef0123456789 | none |
-
-Source: gstack-approvals record for garrytan/approvals-public-repo-privacy (display only; not an approval citation).
 

Proof of the bug

The new tests in test/approval-record.test.ts (public repositories get no identifying approval text (GST-1160)) failed on main d4bef0a, 5 of 5. On main, a fake gh reporting PUBLIC still got the owner's words, the run id, the plan sha and the name in the output. They pass with this change.

Blast radius

The change only touches render. Storage, import, the Drive mirror, list and the receipt's citation check don't change; the one caller is bin/gstack-approvals (grep over bin/ and lib/). Captain reports that paste render output also get the one line on a public repo. The review notes below list that as an open item, and so does the Documentation section: docs/captain.md, capy/skill/gstack/SKILL.md and two Captain templates still describe the full table. The first docs audit edited docs/captain.md, but /ship treats that file as agent prose, so the edit would have needed a third review round. I reverted it in 5a0db31 and left it for a follow-up.

Security read

The change runs git remote get-url origin and up to two read-only gh repo view --json visibility calls, each with a 15-second timeout. It reads no secrets. gh gets the same environment as before, so GH_REPO and gh's own login still apply. An origin URL with credentials in it is cut down to owner/repo before gh sees it. Nothing here changes permissions, workflows, setup scripts or dependencies.

Approvals

No approvals recorded for branch garrytan/approvals-public-repo-privacy.

Summary

gstack-approvals render asks gh for the visibility of two repositories. One is the repo gh acts on by default (GH_REPO, its default repo, an upstream remote), and the other is the origin repo the PR is opened against. When every one of them is private (or internal), it prints the full table as before. When any is public, or gh can't tell, it prints only Approved: yes|no (record r-<12 hex>). The record id is a hash of the row ids. A stderr line, APPROVALS_RENDER: redacted (repository visibility …), says which mode was used. --full prints the table only when visibility is unknown and you know the repo is private. It never prints the table for a repo GitHub reports as public. /ship Step 19, docs/skills.md and the Capy skill's captain.md now describe the one-line output.

The review found that the first version asked only gh's default repo. If a private upstream or GH_REPO sat behind a public origin, the full table still went public. The second commit also checks origin and adds a regression test for that case.

The 5 new GST-1160 tests failed on main d4bef0a (5 of 5). The new origin test failed on 901defd (0 pass, 1 fail) and passes on d468ef8.

Test Coverage

Step 7 audit (audit only, no tests generated): 7 of 10 changed paths have tests (70%, value-weighted 70%).

  • Tested: gh fails → unknown; PUBLIC → public; PRIVATE → private; every renderMode branch; redacted "Approved: yes" with no leaked strings; record id stable and changing when a row is added; --full parse and the stderr note; private default repo behind a public origin stays redacted (added in review).
  • Gaps (open notes, not added in this PR): internal → private; "Approved: no" for pending-only rows; redacted render of an empty or unavailable record.

Tests ran: targeted (test/approval-record.test.ts, test/capy-captain-flow.test.ts, test/ship-receipt-prose.test.ts) 43
Tests ran: guards (skill-md-size-guard, skill-size-budget, size-ledger, parity-suite, context-budget-ratchet, catalog-budget, module-size-ratchet) 38
Tests ran: docs-referencing tests after the docs audit (10 files) 640

Pre-Landing Review

Pass 1 (light depth, as gstack-review-plan printed): the batched specialist (testing, security, state machines, red team) returned no findings. The native adversarial pass and the GPT-6.1 Sol outside voice both found the same blocker. repoVisibility asked gh's default repository, not origin, so a private GH_REPO or upstream behind a public origin unlocked the full table. It was fixed in d468ef8 with a failing-first test. Pass 2 (scoped to the fix): the fix-check, the red team and the native adversarial pass found nothing at the blocking floor.

Pre-Landing Review: 9 issues — 0 auto-fixed, 1 asked (1 fixed, 0 skipped), 0 deferred, 8 noted

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=8 fixed=1 scope=frozen unrecorded=1 ledgers_read=3 fix_checks=1 dispatches=5

Gate edits: none detected (8 listed, 6 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 (host subagent, certified configuration) completed with 1 finding (the blocker above, now fixed).

Review notes

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

  • INFORMATIONAL captain/templates/merge-ask.md:19 Captain templates and docs/captain.md say to paste the render table into reports that go to Drive or the owner; on a public repo they now get only the one line, with no private-destination override
  • INFORMATIONAL lib/approval-record.ts:248 redacted Approved: yes is true when any row is approved or standing, ignoring a later rejection or an agent-only decision
  • INFORMATIONAL lib/approval-record.ts:250 with --no-heading the redacted line starts with 'Approved', the prefix approvalLine() reads as approval evidence in a maintainer comment; no forge path found
  • INFORMATIONAL bin/gstack-approvals:142 stderr says --full applies only to a private repository, but --full applies when visibility is unknown; CLI tests that pass --full call the real gh and would flip under an inherited GH_REPO pointing at a public repo
  • INFORMATIONAL lib/approval-record.ts:241 origin slug drops the host, so on GitHub Enterprise the origin lookup asks the default host; fails closed (redacts), so a private Enterprise repo loses the full table
  • INFORMATIONAL lib/approval-record.ts:246 a fork with several remotes and no gh default makes the ambient lookup unknown, so render redacts even for a private origin; --full is the only way to the table there (intended fail-safe)
  • INFORMATIONAL lib/approval-record.ts:244 git remote get-url and up to two gh repo view calls run in sequence with 15 s timeouts each; render can stall about 45 s on a slow network, and the second call repeats the first when the slug is the default repo
  • INFORMATIONAL test/approval-record.test.ts:105 coverage gaps: internal visibility, "Approved: no" for pending-only rows, redacted render of an empty or unavailable record

Exploratory QA

Functional (CLI) smoke run of the branch's bin/gstack-approvals against an isolated state root holding one synthetic row. Status: pass (run-20261103T032952Z).

  • Real gh on garrytan/gstack (reports PUBLIC): render printed only Approved: yes (record r-b61ecc4a4259). No words, run id or hash.
  • render --full with real gh: still redacted. Stderr names --full.
  • No gh on PATH: redacted, and stderr says visibility unknown.
  • Not probed: the full table on a real private repo (only the fake-gh unit test covers it). An earlier probe run (run-20261103T032822Z) is inconclusive. Two of its captures ran the installed gstack-approvals (gstack v1.93.40, which predates this fix) and printed the full table, and one used a PATH that broke git. The later run repeats those probes correctly.

Design Review

No frontend files changed — design review skipped.

Eval Results

Evals not run. eval:select picked 113 behavioral probes and 24 quality judges because bin/gstack-approvals and lib/approval-record.ts are derived references. That spend is over this lane's $20 cap, so the merge train's paid gate covers it. The only prompt change is one sentence in ship/sections/capy-pr.md.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: keep the owner's words, run ids and plan hashes out of PR bodies on public repos (GST-1160).
Delivered: render checks visibility (default repo and origin) and redacts unless every one is private; tests; /ship Step 19 and two docs updated.

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, so per the crew's R65 rules there's no autoplan.

Verification Results

No plan-specific checks (no plan file). The smoke checks under Exploratory QA passed.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The four authored docs this branch edits match the new gstack-approvals render behavior; no edits were needed.

Scope: base d4bef0a6 to head 5a0db31d on garrytan/approvals-public-repo-privacy, 10 committed files (no staged, unstaged or new files). Product changes: bin/gstack-approvals and lib/approval-record.ts (public or unknown-visibility repositories render only Approved: yes|no (record <id>); new --full flag).

Documentation health:

  • capy/skill/gstack/captain.md: current (updated by the branch)
  • docs/skills.md: current (updated by the branch)
  • ship/sections/capy-pr.md and ship/sections/capy-pr.md.tmpl: current (updated by the branch, and the template and its output match)
  • changelog.d/garrytan-approvals-public-repo-privacy.md: accurate against the code (not edited)
  • docs/captain.md, capy/skill/gstack/SKILL.md, captain/templates/merge-ask.md, captain/templates/report.md: stale on public repositories (debt, see below)

Debt: docs/captain.md (line 370, and line 175 for the PR body), capy/skill/gstack/SKILL.md (line 70), captain/templates/merge-ask.md (line 19 placeholder) and captain/templates/report.md (line 35) still say render puts the full table, with the owner's exact words, into the PR body. On a public repository it now prints only one line. Commit 5a0db31 put the docs/captain.md wording off to a follow-up; the same follow-up should cover the other three.

Coverage map: render --full has reference coverage in the CLI help, the changelog fragment and the /ship Step 19 text. Public-repo redaction has reference and how-to coverage in docs/skills.md, capy/skill/gstack/captain.md and ship/sections/capy-pr.md; no doc beyond the changelog explains why redaction exists. No critical gaps. Diagram drift: none.

Test plan

  • bun test --timeout=30000 test/approval-record.test.ts test/capy-captain-flow.test.ts test/ship-receipt-prose.test.ts: 43 pass, 0 fail
  • bun test --timeout=30000 size, parity, context and module-size guards (7 files): 38 pass, 0 fail
  • bun run typecheck: exit 0
  • 10 test files that reference the edited docs: 640 pass, 0 fail
  • Failing first: the origin regression fails on 901defd and passes on d468ef8
  • CI at 5a0db31: 27 checks passed, 0 failed (Free Tests run 41577559346, windows-smoke run 41577559365)
  • Remote pregate (Ubicloud us-east-a2) on tree c61eafa4d8db: 19040 tests, 0 failed, $0.10. Two files failed once and passed on the serial retry (test/plan-seed-submission.test.ts, test/plan-count-timeout.test.ts); neither is touched here.

Known failure on main, not touched here: test/pr-shots.test.ts "captures inside the repo" times out launching the browser on main too.

…ories (GST-1160)

gstack-approvals render asks gh for the repo's visibility. A public repo, or one gh cannot read, gets only 'Approved: yes|no (record r-<id>)'; a PR description keeps every edit, so the owner's words, run ids and plan hashes stay in the private record. --full prints the rows only when the repo is not reported public.

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

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 3, 2026 03:35
…ty too, GST-1160)

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>
…prose (GST-1160)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(approvals): no identifying approval text in public-repo PR bodies (GST-1160) v1.94.8.0 fix(approvals): no identifying approval text in public-repo PR bodies (GST-1160) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit c197a13 into main Nov 3, 2026
45 checks passed
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