A base branch with too many review_exclude_paths patterns no longer stops every /ship (GST-3399) (#4637)

When the base branch's ship policy fails only because of its
`review_exclude_paths` or `review_content_patterns` list (for example 65
patterns, one over the limit of 64), /ship now reviews every file
instead of stopping.

Why: harness-evals main went to 65 patterns, and every /ship there
stopped with POLICY_INVALID, including the PR that shortens the list.

Nothing to do: the plan prints a `REVIEW_EXCLUDE: fallback (WARNING:
...)` line naming the error and the fix, and `gstack-ship-policy
validate` still reports the list.

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=testing
Review-Finding: lib/ship-receipt-depth.ts:69:stale-comment reader=core
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-21 23:28:07 +00:00
1 parent 2887261a47
commit dd611038ca
15 files changed
+211 -19

No files matched your search

+3
View File
@@ -17,6 +17,7 @@ import * as fs from 'node:fs';
import * as path from 'node:path';
import { EXIT, exitTableHelp } from '../lib/headless-artifacts';
import { resultLine } from '../lib/result-codes';
import { fallbackLine } from '../lib/review-exclude';
import {
BUMP_NEVER_KEY_VERSION, POLICY_KEYS, POLICY_KEY_INTRODUCED, SHIP_POLICY_PATH, examplePolicyJson, explainPolicy, isUnavailable, loadPolicyFromBase, loadPolicyFromHead,
minimumReader, policyUnavailableLine, renderEffective, resolveBaseBranch, type LoadedPolicy,
@@ -91,6 +92,8 @@ function main(argv: string[]): number {
if (cmd === 'validate' || cmd === 'show-effective') {
const loaded = load(root, rest, cmd === 'validate' ? 'head' : 'base');
if (typeof loaded === 'number') return loaded;
if (loaded.setAside && cmd === 'validate') loaded.errors = loaded.setAside;
else if (loaded.setAside) process.stderr.write(`gstack-ship-policy: ${fallbackLine({ state: 'fallback', source: loaded.source.label, errors: loaded.setAside.map(e => `${e.path}: ${e.message}`) }, flag(rest, '--base') ?? resolveBaseBranch(root))}\n`);
const floor: ReturnType<typeof floorAgainstStable> = cmd === 'validate' && loaded.present ? floorAgainstStable(loaded.policy.min_gstack_version, newestStableRelease()) : {};
if (floor.error) loaded.errors.push(floor.error);
const set = POLICY_KEYS.filter(k => loaded.values[k] && loaded.values[k] !== 'default');