Skip to content

Keep local paths out of the approvals table and add render --redacted (GST-2048) - #4199

Merged
capy-ai[bot] merged 3 commits into
mainfrom
keep-local-paths-out-of-approvals-render
Nov 9, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
keep-local-paths-out-of-approvals-render

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

gstack-approvals render no longer prints local filesystem paths in the approvals table of a PR body, and --redacted forces the public form on any repository.

What changed

  • The Asked, Covers and Still pending columns show each local path as …/<file name>, and a bare home directory as ~. That covers absolute and home paths (~/, ~user/, $HOME/, /home/…, /Users/…), Windows-drive, UNC and file: paths in any case, Drive-relative .capy/drive/… paths, and paths glued onto a : or - such as ledger:/home/…. Only a :// scheme prefix keeps a slash path as written. Exact words stays verbatim because it is the owner's quote, and gstack-approvals list keeps the full record.
  • render --redacted prints the same bytes a public repository gets. --redacted with --full is a usage error (exit 2) with nothing on stdout.
  • The redacted line now ends "The full approval record stays private." so it stays true when --redacted is used on a private repository.

Why

On a private repository render printed the full table with each row's text as recorded. On garrytan/gstack-evals#289 that put a ledger path under /home/<user>/.capy/drive/… into 102 spend-cap rows. gstack-post flags that as internal.user_path, and because a PR description keeps its edit history, the path would stay readable after the repository went public.

Blast radius

pathLabels has one production caller, renderRecord, and the table stays display only: lib/ship-receipt-prose.ts finds the block by its header and footer and never parses cells, and labels never add a |. The ship-receipt-prose, plan-record and module-size tests pass on this head (51/0 with the spawnSync tripwire).

Review notes

These are below the blocking floor and are recorded here, not fixed in this PR.

  • Accepted: Asked and Still pending now get the same labels as Covers. Known false positive: a non-local slash path in those columns is relabelled too, for example /api/v1/users becomes …/users.
  • Known false positive from the last fix: a URL whose path has a segment ending in - or :, such as GitLab's https://gitlab.com/g/p/-/merge_requests/12, renders as …/12 after that segment.
  • ~2/3 style approximations render as …/3.
  • A home folder containing a space keeps the words after the space, for example C:\Users\Garry Tan\x.md becomes ~ Tan\x.md.
  • Mount-relative Drive paths without .capy/drive/ (project-user-<project>-<person>/x.md) and paths that end at a Drive scope or /var/home/<name> folder keep that folder name; ~user is ASCII only.
  • Exact words is never labelled, by design.
  • Codex outside review was unavailable (Codex CLI not installed on the review machine).

Documentation

Status: current. No documentation changes were needed.

Scope: base 68b1d05..6f58ad1 (3 commits). Changed files: bin/gstack-approvals, lib/approval-record.ts, test/approval-record.test.ts, docs/skills.md and changelog.d/keep-local-paths-out-of-approvals-render.md. There were no staged, unstaged or new files. I searched every doc and template that mentions gstack-approvals render.

Documentation health:

  • docs/skills.md: current. The branch already documents path labels, --redacted and the --full conflict.
  • changelog.d/keep-local-paths-out-of-approvals-render.md: current. It matches the code.
  • ship/sections/capy-pr.md.tmpl: current. It could also mention --redacted (optional).
  • capy/skill/gstack/captain.md, docs/ship-policy.md, docs/troubleshooting.md: current. Nothing quotes the old redacted sentence.

Coverage debt: render --redacted is covered in reference docs (docs/skills.md and the CLI help) but has no how-to guide. That is a common gap, not a critical one.

Diagram drift: none.

Test plan

  • Failing first on main 68b1d05: the private render fed to the real bin/gstack-post pr-body printed internal.user_path, and --redacted was an unknown argument.
  • bun test test/approval-record.test.ts at 6f58ad1: 47 pass, 0 fail. New cases post a private render through bin/gstack-post and assert no internal.user_path, including five colon-, dash- and file:-glued forms with an https control left unchanged.
  • bun run typecheck: 0 errors. typecheck:test: none new.
  • CI carry: free-tests run 42587500703 green at tree 56365a4; PREGATE remote gate and macos-named-regressions cleared from that run.

Not in scope: a ship-policy key such as approvals_render: redacted, and any /ship template change.

Agent notes

Approvals

Approved: yes (record r-84776ab9f1a6). The full approval record stays private: this repository is public or its visibility is unknown.

REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=5 fixed=4 scope=frozen unbound=1 fix_checks=1 dispatches=8
Gate edits: none detected (2 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 grant: a-5b68cd273658 (one scoped fix-check after round 2; fix-check found nothing blocking)

{
  "schema_version": 1,
  "pr": 4199,
  "head": "6f58ad119f130395e900c228679fbe022cf6e9d1",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "approval-record": {
      "pass": 47,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "56365a4c96cd0ff26c68bb26b21103d4ab78b920",
  "product_patch_id": "9ea1438c5d022bd3820825a7749fab2013c0e3ee",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "code",
    "runtime_lines": 48,
    "rules": "66e5174161eecc2c",
    "base": "68b1d056a4fcf300ca2b61a1406940c5dd336916",
    "registry": "68b1d056a4fcf300ca2b61a1406940c5dd336916",
    "gate_scan": {
      "tagged": 0,
      "head": "6f58ad119f130395e900c228679fbe022cf6e9d1"
    },
    "reasons": [
      "risk:security",
      "runtime=48"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @56365a4c96cd (8 checks, current for 6f58ad119f13)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42587500703/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=56365a4c96cd tests=36778 skipped=71 runs=42587500703/1 profiles=ci-reuse/free-tests heads=6f58ad119f13 verified=2026-11-09T08:46:26.912Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md and docs/ (140 files), plus changed bin/lib/changelog.d files and ship/sections/capy-pr.md.tmpl"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 5,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "unbound": 1,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  }
}

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 2 commits November 9, 2026 08:10
pathLabels now covers file:// URIs, ~user, $HOME, %USERPROFILE%, UNC and Drive-relative paths, and the approvals table runs it on Asked and Still pending as well as Covers. Exact words stays verbatim.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/specialist-batched#2 reader=testing
Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Only a :// scheme prefix now keeps a slash path unlabelled, so ledger:/home/..., user@host:/home/... and run-/home/... get file-name labels, and file:/ and FILE:/// paths match. Granted fix-check a-5b68cd273658.

Review-Finding: p2/adversarial-native#1 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