Repository navigation
v1.94.8.0 fix(approvals): no identifying approval text in public-repo PR bodies (GST-1160) - #3918
Merged
Merged
Conversation
…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>
|
😎 This pull request was merged. |
…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>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 rendernow 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-shotscould 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
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,listand the receipt's citation check don't change; the one caller isbin/gstack-approvals(grep over bin/ and lib/). Captain reports that pasterenderoutput 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.mdand two Captain templates still describe the full table. The first docs audit editeddocs/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 originand up to two read-onlygh repo view --json visibilitycalls, each with a 15-second timeout. It reads no secrets. gh gets the same environment as before, soGH_REPOand gh's own login still apply. An origin URL with credentials in it is cut down toowner/repobefore 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 renderasks gh for the visibility of two repositories. One is the repo gh acts on by default (GH_REPO, its default repo, anupstreamremote), and the other is theoriginrepo 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 onlyApproved: 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.--fullprints 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.mdand the Capy skill'scaptain.mdnow describe the one-line output.The review found that the first version asked only gh's default repo. If a private
upstreamorGH_REPOsat behind a publicorigin, the full table still went public. The second commit also checksoriginand 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%).
renderModebranch; redacted "Approved: yes" with no leaked strings; record id stable and changing when a row is added;--fullparse and the stderr note; private default repo behind a public origin stays redacted (added in review).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.
repoVisibilityasked gh's default repository, notorigin, so a privateGH_REPOorupstreambehind a publicoriginunlocked 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.
captain/templates/merge-ask.md:19Captain 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 overridelib/approval-record.ts:248redacted Approved: yes is true when any row is approved or standing, ignoring a later rejection or an agent-only decisionlib/approval-record.ts:250with --no-heading the redacted line starts with 'Approved', the prefix approvalLine() reads as approval evidence in a maintainer comment; no forge path foundbin/gstack-approvals:142stderr 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 repolib/approval-record.ts:241origin 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 tablelib/approval-record.ts:246a 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)lib/approval-record.ts:244git 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 repotest/approval-record.test.ts:105coverage gaps:internalvisibility, "Approved: no" for pending-only rows, redacted render of an empty or unavailable recordExploratory QA
Functional (CLI) smoke run of the branch's
bin/gstack-approvalsagainst an isolated state root holding one synthetic row. Status: pass (run-20261103T032952Z).renderprinted onlyApproved: yes (record r-b61ecc4a4259). No words, run id or hash.render --fullwith real gh: still redacted. Stderr names--full.Design Review
No frontend files changed — design review skipped.
Eval Results
Evals not run.
eval:selectpicked 113 behavioral probes and 24 quality judges becausebin/gstack-approvalsandlib/approval-record.tsare 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 inship/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:
renderchecks 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 renderbehavior; no edits were needed.Scope: base
d4bef0a6to head5a0db31dongarrytan/approvals-public-repo-privacy, 10 committed files (no staged, unstaged or new files). Product changes:bin/gstack-approvalsandlib/approval-record.ts(public or unknown-visibility repositories render onlyApproved: yes|no (record <id>); new--fullflag).Documentation health:
capy/skill/gstack/captain.md: current (updated by the branch)docs/skills.md: current (updated by the branch)ship/sections/capy-pr.mdandship/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) andcaptain/templates/report.md(line 35) still sayrenderputs 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 thedocs/captain.mdwording off to a follow-up; the same follow-up should cover the other three.Coverage map:
render --fullhas reference coverage in the CLI help, the changelog fragment and the /ship Step 19 text. Public-repo redaction has reference and how-to coverage indocs/skills.md,capy/skill/gstack/captain.mdandship/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 failbun test --timeout=30000size, parity, context and module-size guards (7 files): 38 pass, 0 failbun run typecheck: exit 0test/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.