Skip to content

Ship policy can mark published data as content, so /ship can review large data PRs (GST-3158) - #4511

Merged
capy-ai[bot] merged 4 commits into
mainfrom
review-content-patterns-for-published-data
Nov 19, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
review-content-patterns-for-published-data

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

A repo can now list published-data folders under a new review_content_patterns ship-policy key, so /ship leaves .patch diffs, MANIFEST.sha256 and extension-less licences out of review, while source files there stay reviewed.
Why: gstack-evals #352 is 13.8 MB, 13.6 MB of it published session data, and could never pass /ship's 2 MB review limit.
Nothing to do until a repo adds the key to its base-branch policy; a pattern that keeps too many files now stops with REVIEW_EXCLUDE_KEEP_TOO_LARGE instead of being dropped.

What changed
  • New key review_content_patterns (lib/ship-policy.ts, lib/ship-policy-keys.ts, lib/review-exclude.ts). Git glob pathspecs, validated like review_exclude_paths and read only from the base branch. A file both keys match is content (declared in the plan's content= field), whatever its extension, unless it is a source file (.ts, .js, .py, .rb, .sh, .go, .rs, .dart and the like, in any letter case), which stays in review on both the text and the binary path. The other keep rules still win: .gstack/ and .github/ files, gate paths, executables, links, agent prose, config, gate-tagged, secret-line and named-by-code files stay in review.
  • No more silent drop. A pattern whose kept files would need more than 24,000 argument bytes on the readers' read command used to be skipped with only a skipped= note, sending the whole folder to readers. It now stops the plan (exit 3) with REVIEW_EXCLUDE_KEEP_TOO_LARGE, naming the pattern, the kept count, the keep reasons and the bytes, and pointing at review_content_patterns.
  • Docs. docs/ship-policy.md#review-content-patterns (with the gstack-evals case as the example), a troubleshooting entry, the result-code registry and its generated doctor table, and a release note in changelog.d/.
Why

"Ship policy can't mark published data as content": gstack-evals #352 put 1,439 files of raw session data under one folder, and /ship counted every .patch and extension-less file as code, so the PR could never get under the 2 MB review limit. Now the repo owner names that folder once in the base policy and the reviewers read only the code the PR changes.

Blast radius

Only repos whose base-branch policy sets both keys see a change in what reviewers read; gstack's own policy sets neither, so its reviews are unchanged. The one behavior change everywhere is that an over-limit review_exclude_paths pattern now stops the plan instead of being skipped, which fails closed. Evidence: test/review-content-patterns.test.ts runs gstack-review-plan on a #352-shaped fixture repo, plus negative controls (a content pattern alone excludes nothing; a branch cannot add the key for itself; source files, NUL-bearing and upper-case ones included, stay in review; the secrets scan and sealed guard still read excluded files).

Documentation

Status: current. No documentation changes were needed.

Scope: 4 commits from 5afef04 to HEAD across 11 files (the review_content_patterns ship-policy key and the REVIEW_EXCLUDE_KEEP_TOO_LARGE refusal). The candidate has no staged, unstaged or untracked content. I searched all authored docs and templates for references to review_exclude_paths and to the removed skipped= exclusion behaviour.

Documentation health:

  • docs/ship-policy.md: current (key table row, the review-content-patterns section, the keep-limit refusal)
  • docs/troubleshooting.md: current (the REVIEW_EXCLUDE_KEEP_TOO_LARGE entry and the updated REVIEW_DIFF_TOO_LARGE fixes)
  • docs/review-policy.md: current (the readers-under-exclusion section and the owner map still hold)
  • changelog.d/review-content-patterns-for-published-data.md: current, read only

Coverage debt: review_content_patterns has reference, how-to and explanation docs but no tutorial (a common gap). REVIEW_EXCLUDE_KEEP_TOO_LARGE is covered by its troubleshooting entry and its result-code anchor. No critical gaps.

Diagram drift: none; no diagram covers this area.

Tests
  • CI free suite at 5978e6f (workflow_dispatch run 44485932177): green, 1,703 test files carried.
  • bun --no-env-file test test/review-content-patterns.test.ts: 7 pass, 0 fail.
  • test/review-exclude.test.ts, test/review-exclude-secret-value.test.ts, test/gstack-ship-policy.test.ts, test/module-size-ratchet.test.ts, test/ship-policy-compat.test.ts, test/policy-floor-stable.test.ts with the content-pattern tests: 100 pass, 0 fail.
  • bun run typecheck: 0 errors.
Test Coverage

Coverage audit (read-only): 13 of 16 changed paths have a test. Gaps: validatePolicy errors for the new key, the shipConsequences line, and a declared binary without an extension.

Pre-Landing Review

Two full review rounds plus one granted fix check. Round 1 fixed a source file in a declared folder leaving review; round 2 found the same gap on the binary path, fixed under the grant and confirmed by the fix check. The second-model review returned clean. Open notes (not blocking): the source-extension list covers the import-graph languages only (.php, .ps1, .java and others in a declared folder still leave review); an HLS media segment named .ts is now kept as code, which can stop a large media folder with REVIEW_EXCLUDE_KEEP_TOO_LARGE; a NUL-bearing source file is not read by the named-by-code grep.

Exploratory QA

Limited to the reproduction tests above (each failed before its fix) and the focused suites; no separate QA method run.

Scope Drift

Scope Check: CLEAN. Intent: GST-3158 review_content_patterns and the kept-file refusal. Delivered: the same, plus the generated doctor anchor.

Agent notes

Open in Capy

{"head":"bc9abf76adccd97e38c0380143e23a8acc2b864d","run":"ship-4511","status":"started","review_loop":{"passes":2,"blocking_found":1,"deferred":0,"noted":4,"fixed":1,"scope":"frozen","rounds":2,"dispatches":{"specialist":6,"red-team":2}}}
{"head":"bc9abf76adccd97e38c0380143e23a8acc2b864d","run":"ship-4511","mark":"stop","tree":"d08754bf0096ed2c6868d30125890db56efc7d35"}
{"head":"bc9abf76adccd97e38c0380143e23a8acc2b864d","run":"ship-4511","mark":"grant","grant":"a-ccec71be124c"}

Requested by gstack-evals' coordinator (GEVA-2); blocks garrytan/gstack-evals#352. Out of scope: the 2 MB review ceiling.

CI infrastructure rerun, not a flaky test: free-tests run 44477377653 attempt 1, job quick-bun-default, failed while installing Playwright Chromium because apt's dpkg lock was held ("Could not get lock /var/lib/dpkg/lock-frontend"); the failed jobs were rerun once and passed (attempt 2). The receipt carries workflow_dispatch run 44485932177 at the same head because the pull_request run's merged tree no longer matched after main moved.

Approvals

Approved: yes (record r-96dfcc2f61b1). The full approval record stays private.
Plan: exempt: bug fix (requested by the coordinator, GEVA-2)
Plan check: exempt bug fix

REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=6 fixed=2 scope=frozen fix_checks=1 dispatches=8
Gate edits: none detected (8 listed, 7 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-19 via round grant a-ccec71be124c: Declared-content binary arm can exclude NUL-bearing source files; 5-line fix granted (fix-check at 6ee408f, 2 findings)

{
  "schema_version": 1,
  "pr": 4511,
  "head": "5978e6fb4a818ebc46a5be5614b46a83a9dc10e6",
  "version": "1.101.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1703,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44485932177,
      "attempt": 1,
      "tree": "a3588fca60b13a9ca2010749228fae6d9d556628"
    }
  ],
  "calls": 64,
  "session_kind": "unattended",
  "run": "ship-4511",
  "head_tree": "a3588fca60b13a9ca2010749228fae6d9d556628",
  "product_patch_id": "574b07c566629f0bfc3087e015985e49af0664ce",
  "gstack_version": "1.101.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 161,
    "rules": "1afa38a4be3b5eef",
    "base": "b7022438597edd2b877449608f7449f5c13c3511",
    "registry": "b7022438597edd2b877449608f7449f5c13c3511",
    "gate_scan": {
      "tagged": 0,
      "head": "5978e6fb4a818ebc46a5be5614b46a83a9dc10e6"
    },
    "reasons": [
      "gate-class",
      "runtime=161"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @a3588fca60b1 (8 checks, current for 5978e6fb4a81)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44485932177/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44485932177/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44477377613/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a3588fca60b1 tests=37898 skipped=105 runs=44485932177/1 profiles=ci-reuse/free-tests heads=5978e6fb4a81 verified=2026-11-19T08:44:17.098Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (150 docs files) against the 11 changed files from merge base 5afef04e3"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 6,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-19",
    "via": "round grant a-ccec71be124c",
    "reason": "Declared-content binary arm can exclude NUL-bearing source files; 5-line fix granted",
    "fix_check": {
      "head": "6ee408f03d29b7fe5188211695eabe5e4e9719b5",
      "findings": 2
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "bc9abf76adccd97e38c0380143e23a8acc2b864d",
      "pr": 4511,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Declared-content binary arm can exclude NUL-bearing source files; 5-line fix granted",
      "at": "2026-11-19T07:02:12.763Z",
      "approval": "a-ccec71be124c",
      "stop_run": "ship-4511",
      "findings": [
        "p2full/red-team#1"
      ]
    }
  ],
  "gate_dispositions": []
}

…arge data PRs (GST-3158)

A new review_content_patterns key marks files review_exclude_paths also matches as content, whatever their extension.
A pattern whose kept files pass the argument bound now refuses the plan with REVIEW_EXCLUDE_KEEP_TOO_LARGE instead of being dropped.

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

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 19, 2026 06:49
…older

A .ts, .py or .sh file the branch puts under a review_content_patterns folder stays in review as code; the declaration now only reclassifies files that are not source code.

Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ontent folder

A .ts file with a NUL byte, or one named .TS, under a review_content_patterns folder now stays in review as code, like any other source file there.

Review-Finding: p2full/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eviewed

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit f13dbb0 into main Nov 19, 2026
104 of 106 checks passed
@capy-ai

capy-ai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Open notes after merge. A second-model read of this PR's decision trail (reports/GSTA-636-decisions.tsv, rows 21-26) found three ways a folder declared under review_content_patterns could still hide files from review:

  1. Source languages outside the 9-extension SOURCE_EXT list (.java, .php, .c, .ps1 and more) were excluded (lib/review-exclude.ts:276, :316).
  2. A NUL-bearing agent file (AGENTS.md, SKILL.md) took the binary branch before the agent-prose and config checks and was excluded (:316).
  3. A declared file kept for another reason, such as an executable, didn't count as a consumer, so a data file it names by full path could leave review (:326).

No base policy sets the key yet, so none of these can hide code today. Fixed in #4516, with one test per case; repos shouldn't turn the key on until it lands.

capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
…gent files from /ship's review (GST-3158) (#4516)

In a folder a repo marks as published data (`review_content_patterns`),
source code in any language, agent instruction files, config and data
that kept code names by full path now stay in /ship's review.

Why: #4511 let a `.java` file, a binary `AGENTS.md` or a file named by a
kept script leave review there, and reviewers must see every line of
code a PR changes.

Nothing to do: no base policy sets the key yet.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=specialist-batched
@garrytan garrytan mentioned this pull request Nov 19, 2026
capy-ai Bot added a commit that referenced this pull request Nov 19, 2026
- `gstack-artifact validate` no longer passes a run.json that gstack-autoplan never wrote. (#4494)
- /ship's changed-number check no longer stops on tests that only share a word with the change (#4478). (#4496)
- On Capy, /ship no longer edits or comments on pull requests as you. (#4518)
- The destructive-command check stops asking about scratch deletes and catches the real damage it used to miss. (#4513)
- The destructive-command check reads commands more carefully, closing gaps found after the last release. (#4525)
- The Codex readiness check and the second-model review now pick the same model for a custom Codex provider (GST-3089). (#4491)
- gstack's Codex hooks work when your Codex folder's path has a `(`, `&` or other shell character in it. (#4528)
- Uninstalling gstack keeps your own Codex hooks trusted. (#4528)
- Codex hook setup matches Codex more closely. (#4528)
- On Windows, setup copies the Claude Code hook code that gstack's Codex hooks import (#4528)
- /review's checklist on Codex reads shell commands more carefully. (#4528)
- On Codex, gstack now suggests the right skill for a prompt and stops destructive commands before they run. (#4512)
- On Codex, /review is now held once when it tries to finish without its adversarial pass or its report, as it already is on Claude Code. (#4522)
- On Codex, gstack's skill suggestion now names the skill the way Codex lists it. (#4523)
- On Codex, gstack's suggested prompts and docs now name skills the way Codex lists them. (#4524)
- /review on Codex with gpt-6.1-sol is no longer held back for a second-model pass it already ran. (#4526)
- On Codex, office-hours, plan-design-review and gstack-upgrade work again when you name them. (#4510)
- gstack knows when Codex is running unattended. (#4510)
- Codex reviewers start with a clean context. (#4510)
- Docs no longer say Codex has no hook support. (#4510)
- A command whose output was cut off no longer counts as a finished read. (#4492)
- A folder marked as published data can no longer hide source code or agent files from /ship's review. (#4516)
- Correction to the on-by-default helper hooks entry: the hook still routes only to /review, /qa and /verify, so skills you've installed yourself aren't suggested yet. With gstack's skills it routes 14 of 60 real bug reports (was 17), and long prompts are no longer skipped. (#4505)
- /sync-gbrain's read check now works when the first page in your code source is over 64 KB. (#4497)
- Free-suite CI no longer fails before any test runs when Ubuntu's package mirror is slow. (#4530)
- Syncing a second repo no longer makes the first one ask for /sync-gbrain again. (#4532)
- gstack's helper hooks are now on by default in Claude Code, OpenClaw and Hermes, and the prompt-routing hook fires on real bug reports. (#4503)
- `gstack-pregate clear --receipt` accepts a remote gate run from before a merged release when the release only regenerated a declared release output. (#4483)
- The second-model review now keeps the reviewer's own result, and reports a used-up budget as a budget stop. (#4515)
- When the reviewer wrote its review to the result file it was asked for, Codex then replaced that file with its short closing message ("Done, I wrote the review"), so the review was thrown away and reported as missing its markers. (#4515)
- When the provider refuses the call with HTTP 402 Payment Required (usually a metering proxy that hit its allowance, or an account out of credits or quota), gstack used to record only "exit 1". (#4515)
- The pre-commit /verify check now fails a check that times out, and its checks share one time budget (GST-3201). (#4527)
- /ship's review collector no longer reads a reviewer's own scope list or list of passed checks as findings (GST-3201). (#4527)
- Merge-queue stack tests fail when git cannot list a PR's added test files (GST-3201). (#4527)
- /ship can now review results PRs that publish raw session data. (#4511)
- /ship's review pass works when the checkout you ship isn't the project's default checkout. (#4507)
- A second review round no longer reports done when nothing was reviewed. (#4520)
- The prompt-routing hook now suggests skills you install yourself, and no longer sends ordinary bug reports to /qa (GST-3123). (#4506)
- gstack's script runner and merge-queue checks now also refuse cut-off output. (#4502)
- A failed second-model review reports the cause that actually stopped it, and the runner never deletes its own prompt. (#4519)
- `gstack-ship-queue ready` now fills in the trial merges and the second-model trail read instead of printing lines to fill. (#4529)
- Five small ship-tool fixes. (#4529)
- A ruling the owner gives while a `/ship` run is open can be relayed. (#4529)
- /ship no longer kills a working test run as stalled when the test command starts its workers in their own session. (#4533)
- /ship no longer stops a review because the state-machine reader started its reply the way its instructions say. (#4504)
- When Claude Code runs /verify right before a commit, it now gets a quick check instead of the full fix loop (GST-3150). (#4508)

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