Skip to content

Review exclusions stay in place when the repo's own policy test pins an excluded path (GST-3512) - #4699

Merged
capy-ai[bot] merged 4 commits into
mainfrom
review-exclude-keeps-names-from-real-code
Nov 22, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
review-exclude-keeps-names-from-real-code

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

An excluded data file no longer comes back into review just because the repo's own test for review_exclude_paths pins that exact path in its pattern list.
Results PRs that exclude a single data file and pin the list in a test now stay under the reader limit; code that reads the file, and example paths the test checks against the patterns, still keep it in review.

What changed
  • lib/review-exclude.ts: a test file that names review_exclude_paths no longer keeps a path as named-by-code when the path is itself one of the base policy's review_exclude_paths patterns and every mention of it in that file is a whole quoted array entry ('p', "p" or a backtick string). The bracket scan now reads forward and skips other strings and comments (# comments too in .py files), so a bracket inside a comment or string no longer changes the answer.
  • Everything else still keeps the file. That covers code that reads it, other tests, a quoted path passed to a call, held in an object or constant, joined or prefixed, and any array of paths that are not literal patterns (hit and near-miss examples, test.each tables, for…of lists).
  • docs/ship-policy.md: the named-by-code row says the same. Changelog fragment added.
Why

A results PR (GEVA-569) stayed at about 4.8 MB in review because its policy test pinned PATTERNS, which lists the literal path of a large sessions.jsonl. That one quoted pin kept the excluded file in every reader's diff.

Blast radius

Only the named-by-code keep rule in lib/review-exclude.ts changes, and only for test files that name review_exclude_paths; every other file and keep reason reads as before. The new tests fail against the previous rule and pass now, and the negative-control test (code, another test, call argument, object value, joined path) keeps all six files (test/review-exclude-contract-test.test.ts, run in CI at this head).

Pre-Landing Review

Two review passes and one granted follow-up read of the fix. Pass 2's second-model review found two blocking gaps in the first version (an iterated example array was exempt, and the bracket scan counted brackets inside strings and comments); both are fixed here, with a failing-first test row for each, and the follow-up read found the fix clean apart from one informational note below.

Review notes

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

  • INFORMATIONAL sf-6db6d23b3421 security finding, details recorded privately
  • In a .py policy test, Python's floor division // is read as a comment start, so a list using // can leave a bracket open and a later top-level string equal to a single-file pattern reads as an array entry. Follow-up.
  • A policy test that loops over an array holding an exact single-file pattern (for example for p in ['wiki/b2/sessions.jsonl']: open(p)) still leaves that file out of review; the rule matches the pinned list by text and cannot tell a pin from a fixture with the same exact path.
Documentation

Status: current. The audit found no needed edits and no blockers.

Scope: base 3cff6a4 to head 0a793acb (four commits; nothing staged, unstaged or untracked). Changed files: lib/review-exclude.ts (the review exclusion's own contract test no longer counts as code that names an excluded file), test/review-exclude-contract-test.test.ts, docs/ship-policy.md (the named-by-code row) and a changelog fragment. Docs checked against the code: docs/ship-policy.md (the review_exclude_paths key row, the keep-reason table, the name-scan paragraphs and the declared-content rules), docs/review-policy.md (what readers read under review_exclude_paths, and the list of files it maps to code), docs/troubleshooting.md (REVIEW_EXCLUDE_KEEP_TOO_LARGE), README.md and CLAUDE.md.

Result: The new named-by-code row matches contractExample and arrayEntries. Only test files are exempt, and only when the file contains review_exclude_paths, the path exactly equals one of the base policy's patterns, and every place the path appears is a whole quoted entry inside an array; the scan skips past other strings and comments. A call argument, an object value, a constant, a joined or prefixed path, or a mention in a comment still keeps the file in review.

Documentation health:

  • docs/ship-policy.md: Current (this branch's row is accurate)
  • docs/review-policy.md: Current (its file list is representative; it already omits four other review-exclude tests)
  • docs/troubleshooting.md: Current
  • README.md: Current (no user-facing feature list affected)
  • CLAUDE.md: Current
  • CHANGELOG.md: Not touched (the changelog fragment is accurate)
  • TODOS.md: Not audited (step skipped for /ship-run audits)

Documentation debt: none. Reference coverage for the refined exclusion is the docs/ship-policy.md row, which also gives the reason for the rule. No how-to or tutorial is needed for an internal review-scoping rule.

Diagram drift: none. No architecture diagram names lib/review-exclude.ts.

Tests
  • bun test test/review-exclude-contract-test.test.ts test/review-exclude.test.ts test/module-size-ratchet.test.ts test/review-exclude-vendored.test.ts: green, 72 tests with no failures
  • Failing first: with the previous lib/review-exclude.ts and the new tests, 3 of 4 contract-test cases fail
  • free-tests at this head: run 45023987733 green (1,760 files); macOS named regressions and windows-smoke green
  • bun run typecheck: clean; trial merge with Review and ship tools: read Codex numbered severities, check Remote Control sessions, see every worktree #4681: clean, typecheck clean, review-exclude tests green (56 tests)
Agent notes

GST-3512, relayed by GEVA-2 from GEVA-569. Their tests/ci/review-exclude-policy.test.ts pins PATTERNS including the literal wiki/board/.../sessions.jsonl; that pin no longer keeps the file. Their quick/laneb/arms/manifests/b2/*.files.tsv hits and any example arrays of non-pattern paths still keep files.

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=4 fixed=4 scope=frozen fix_checks=1 dispatches=6
Gate edits: none detected (GATE_SCAN tagged=0 at 7dabdad)
Second-model review: completed (openai/gpt-6.2-sol); 2 blocking findings fixed under grant a-9c520e4373a1.
Fix-check row reused evidence: the reader's prompt was re-rendered byte-identical (sha256 cd170debfc86) at tree 43ff01d2b229 under a fresh token, because the first token predated the fix commit.

Approvals

Approved: yes (record r-0313babb8c21). The full approval record stays private.
Plan: exempt: bug fix (GST-3512 repro on main 3cff6a4)
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4699,
  "head": "7dabdad48dc62a5a3966b64c4d256728db15f1d7",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1760,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 45023987733,
      "attempt": 1,
      "tree": "476236029256ec89abe65d7d0810c632572ca85f"
    }
  ],
  "session_kind": "unattended",
  "run": "ship-4699",
  "head_tree": "476236029256ec89abe65d7d0810c632572ca85f",
  "product_patch_id": "55094f077d91abac6de1e24f61f7f771a4e1ac5f",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 55,
    "rules": "33831f8248a814fd",
    "base": "7530280407b9a466fc4a546f026f1cc3eff8211a",
    "registry": "7530280407b9a466fc4a546f026f1cc3eff8211a",
    "gate_scan": {
      "tagged": 0,
      "head": "7dabdad48dc62a5a3966b64c4d256728db15f1d7"
    },
    "reasons": [
      "gate-class",
      "runtime=55"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @476236029256 (8 checks, current for 7dabdad48dc6)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45023983372/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45023983297/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=476236029256 tests=38964 skipped=65 runs=45023987733/1 profiles=ci-reuse/free-tests heads=7dabdad48dc6 verified=2026-11-22T12:52:51.803Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (ship-policy, review-policy, troubleshooting checked against lib/review-exclude.ts)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 4,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "dispatches": {
      "specialist": 6
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "9712d01d365e71b643601bbad53959616e31ea9f",
      "pr": 4699,
      "by": "GSTA-36",
      "reason": "narrow the contract-test exemption to quoted array entries equal to a base pattern, scanning past strings and comments",
      "at": "2026-11-22T12:13:31.118Z",
      "approval": "a-9c520e4373a1",
      "stop_run": "ship-4699",
      "findings": [
        "p2/outside-voice#1",
        "p2/outside-voice#2"
      ]
    }
  ],
  "gate_dispositions": []
}

…s an excluded path (GST-3512)

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 22, 2026 12:06
Only quoted array entries in the exclusion's contract test are exempt; a quoted call argument, object value or constant still keeps the file.

Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/specialist-batched#2 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…comments

Only a quoted array entry that is itself a base-policy review_exclude_paths pattern is exempt; the bracket scan now skips strings and comments.

Review-Finding: p2/outside-voice#1 reader=outside-voice
Review-Finding: p2/outside-voice#2 reader=outside-voice
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>
@capy-ai capy-ai Bot changed the title Review exclusions stay in place when the repo's own policy test quotes an excluded path (GST-3512) Review exclusions stay in place when the repo's own policy test pins an excluded path (GST-3512) Nov 22, 2026
@capy-ai
capy-ai Bot merged commit 44e244d into main Nov 22, 2026
76 of 77 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