Skip to content

A folder marked as published data can no longer hide source code or agent files from /ship's review (GST-3158) - #4516

Merged
capy-ai[bot] merged 4 commits into
mainfrom
declared-content-folders-keep-code
Nov 19, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
declared-content-folders-keep-code

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

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.

What changed

A repo that marks a folder as published data could still have code in that folder skipped by review. That included a .java or .ps1 file, an AGENTS.md with a NUL byte, a CMakeLists.txt or .mdx page, or a data file that a kept script reads by full path. Now one rule in lib/review-exclude.ts decides when a declared file is data. Source by name (a broad, case-insensitive list of program extensions and build file names), agent prose, config, gate paths and .gstack/ or .github/ files stay code, in the text and binary branches alike, and a docs-looking name that is really source (CMakeLists.txt, .mdx) is no longer excluded as docs. A declared file that stays in review (kept in the range, or an executable or link in the tree) counts as code when the scan looks for files that name excluded data, so the data it reads stays in review too.

Blast radius

Only repos whose base policy sets review_content_patterns or review_exclude_paths see a difference, and every difference keeps more files in review, never fewer (file:line read at lib/review-exclude.ts contentKind and declaredData; 12 fixture cases in test/review-content-patterns.test.ts run the real plan command).

Test Coverage

Coverage: 5 of 9 new code paths have a test (56%), audit only, no tests generated. Gaps proposed as tests: a config file in a declared folder, a .github/ or gate path in a declared folder, a declared symlink as a reader of data, and a declared .java file naming a data file.
Tests ran: free 1704 (files)

Pre-Landing Review

Two full review passes. The first found two informational items, both fixed: CMakeLists.txt and .mdx were listed as source but still excluded as docs, and no test covered an unchanged declared executable on the base reading a data file. The second pass and the second-model review found nothing blocking.

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • lib/review-exclude.ts:270: the build-file names in SOURCE match any suffix, so docs/BUILD.md, guides/workspace.md and every .mdx page under an excluded docs folder stay in review as code. That is the safe direction, but a large docs PR could hit REVIEW_EXCLUDE_KEEP_TOO_LARGE; untested.
  • lib/review-exclude.ts:277: requirements.txt, constraints.txt and other dependency .txt files still count as docs, so a broad base exclude pattern can drop an unnamed root-level dependency file from review. Unchanged from main; a policy call.
  • A declared file kept only because something names it does not in turn protect the data it names (the kept-declared set is built before the named-by-code scan, so the scan is not transitive). The policy table wording slightly over-states this.
  • A text file named like results/BUILD.json or results/BUILD.log that both keys match still leaves review as data or log, even though the build-name rule matches it. Those lines are unchanged from main; the maintainer ruled this an open note.
  • A declared binary with a content extension, such as results/config/runtime.db, still leaves review through the binary rule.
TODOS

No TODO items completed in this PR.

Documentation

Status: updated. Two factual edits in docs/ship-policy.md; no blockers.

Scope: base f13dbb0 to head 50be17f (3 commits): changelog.d/declared-content-folders-keep-code.md, docs/ship-policy.md, lib/review-exclude.ts, test/review-content-patterns.test.ts. No staged, unstaged or new files. Cross-checked docs/troubleshooting.md and the earlier review_content_patterns changelog fragment.

Documentation health:

  • docs/ship-policy.md: updated. The policy key table row for review_content_patterns now says source code and the other keep rules still apply, and the named-by-code keep-reason row now counts declared files that stay in review as references that keep data.
  • docs/troubleshooting.md: current.
  • changelog.d/declared-content-folders-keep-code.md: current (read only).

Coverage debt: the declared-content keep rules have reference docs only (no how-to or explanation). Files with a source extension under a docs root are no longer excluded as docs, and no doc states this yet. No architecture diagrams are affected.

Tests
  • bun test test/review-content-patterns.test.ts test/review-exclude.test.ts test/review-exclude-secret-value.test.ts: green locally
  • bun run typecheck: clean
  • CI free tests at this tree (run 44506530679): green
Agent notes

Plan: exempt: bug fix (requested by the coordinator, GEVA-2)

Follow-up to #4511, split by the coordinator after the second-family trail read (reports/GSTA-636-decisions.tsv rows 21-26). The BUILD.json/BUILD.log note is GStack Minder's ruling A1.

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=3 fixed=2 scope=frozen dispatches=6

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

Approvals

No approvals recorded for branch declared-content-folders-keep-code.

Open in Capy

{
  "schema_version": 1,
  "pr": 4516,
  "head": "aa6dbcac6a8541b918eb2cc944add138ea14b608",
  "version": "1.101.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1704,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44506530679,
      "attempt": 1,
      "tree": "cb2ef9b0f948652c3bb393f726587dd66f49cfdd"
    }
  ],
  "calls": 48,
  "session_kind": "unattended",
  "run": "ship-4516",
  "head_tree": "cb2ef9b0f948652c3bb393f726587dd66f49cfdd",
  "product_patch_id": "be7bb44e35c345a0c7f86196a451efb2e674994e",
  "gstack_version": "1.101.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 56,
    "rules": "1afa38a4be3b5eef",
    "base": "f13dbb0d4a3e033cd086eadc8aed2ee1c91ac954",
    "registry": "f13dbb0d4a3e033cd086eadc8aed2ee1c91ac954",
    "gate_scan": {
      "tagged": 0,
      "head": "aa6dbcac6a8541b918eb2cc944add138ea14b608"
    },
    "reasons": [
      "gate-class",
      "runtime=56"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @cb2ef9b0f948 (8 checks, current for aa6dbcac6a85)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44506530679/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44506231157/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=cb2ef9b0f948 tests=37918 skipped=65 runs=44506530679/1 profiles=ci-reuse/free-tests heads=aa6dbcac6a85 verified=2026-11-19T11:08:13.620Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ and README.md (docs/ship-policy.md edited)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 6
    }
  },
  "gate_dispositions": []
}

…gent files from /ship's review (GST-3158)

Source code in any language, agent instruction files, config and data named by kept code stay in review inside review_content_patterns folders, in the binary branch too.

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 09:24
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A CMakeLists.txt or .mdx file in a declared folder now stays in review as code, and a data file named by an unchanged declared executable on the base is tested both ways.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=specialist-batched
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…what it names in review

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit ed26724 into main Nov 19, 2026
77 checks passed
@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