Skip to content

Stop /ship asking for a money review of files the review policy leaves out (GST-1900) - #4159

Merged
capy-ai[bot] merged 2 commits into
mainfrom
ship-skips-money-review-of-excluded-files
Nov 8, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
ship-skips-money-review-of-excluded-files

Conversation

@garrytan

@garrytan garrytan commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

/ship now finishes on a branch whose only money-looking file is one the repo's review policy leaves out, instead of stopping to ask for a money review the plan said it didn't need. That keeps shipping a single command that works.

What changed

Receipt write now agrees with the review plan when the only money-looking file is excluded

Receipt write now agrees with the review plan when the only money-looking file is excluded.

Before/after as text: Receipt write now agrees with the review plan when the only money-looking file is excluded
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ gstack-review-plan --base main --json          # branch 1aa5373, same fixture
+  review_exclude: active, excluded=1; targeted.classes=[]
+$ gstack-ship-receipt write --review-exclude 2f05fb4f...
+  exit 0
+  receipt block written for the fixture's PR 7 at head 1a05b5ff4265
+$ bun test test/ship-receipt-targeted-exclude.test.ts
+6 pass, 0 fail
-$ bun test test/ship-receipt-targeted-exclude.test.ts   # on main 9100930
-(fail) an excluded money path gives no class at write, at the queue, or in the plan
-  gstack-review-plan --json   -> review_exclude: active, excluded=1; targeted.classes=[]
-  gstack-ship-receipt write   -> exit 1, REVIEW_TARGETED: required=money
-3 pass, 3 fail
 

Why

A ship on harness-evals#322 stopped with REVIEW_TARGETED: required=money even though the review plan at the same commit said no targeted review was needed. The only money-looking file was a committed SQLite ledger under a review_exclude_paths pattern, which no reviewer reads. The receipt write, the receipt carry and the merge queue now leave those files out the same way the plan does, so the run finishes.

Blast radius

The change touches the four places that work out which targeted reviews a commit needs. Those are the review plan, the receipt write, the receipt carry and the merge queue's check. Each one now passes the active exclusion through one optional excluded field. When no exclusion is active the field is left unset and nothing changes. I checked this with test/ship-receipt-targeted-exclude.test.ts (3 of 6 failed on main 9100930, 6 of 6 pass here) and with four CLI probes on fixture repos, including one where a money file outside the patterns still needs the money review.

Summary

The review plan already left excluded files out when it worked out targeted classes, but the receipt code ran its own classifier on every path. So a branch with an excluded SQLite ledger got classes=none from the plan and required=money from the receipt at the same head. targetedClasses now takes the exclusion and drops those paths, and every caller passes the exclusion that is active at the head. Exclusions that aren't active still exclude nothing. That covers a repo with no policy key, a pattern only the branch adds, and a gate scan the receipt doesn't bind to the head.

Test Coverage

CODE PATHS
[+] lib/review-targeted.ts targetedClasses()
├── [★★★ TESTED] excluded set filters paths/added/removed -> no class — ship-receipt-targeted-exclude.test.ts (plan + receipt tests 1,2)
└── [★★★ TESTED] no excluded -> unchanged behavior — tests 3,4 (no key / branch-only pattern => money)
[+] bin/gstack-review-plan
└── [★★★ TESTED] passes active.excluded to targetedClasses — tests 1,2 via --json
[+] lib/ship-receipt-depth.ts
├── targetedAt(): active vs inactive exclusion — [★★★ TESTED] tests 1,3,4
├── bindShippedReceipt via targetedAt — [★★ TESTED] test 1 (queue bind)
├── receiptTargetedAtHead headInputs(root,base,head,r) — [★★★ TESTED] tests 1 (narrows) + 5 (unbound gate scan fails closed)
└── targetedClassesSince(excluded?) — [★★★ TESTED] test 6 (with/without exclusion)
[+] bin/gstack-ship-receipt write --review-targeted
└── [GAP] passes review.exclude.excluded into the since read
Proposed: extend test 6 to run gstack-ship-receipt write --review-targeted <record at read> after an excluded-ledger-only commit; expect EXIT.ok.
Value: protects=a targeted record carries over a later commit that only touches an excluded path at the CLI; fails_when=write stops passing review.exclude to targetedClassesSince; why_new=test 6 calls the function directly; seam=none; no_claim=queue ready path

COVERAGE: 6/7 paths (86%) | QUALITY: ★★★:5 ★★:1 ★:0 | GAPS: 1 (0 E2E, 0 eval)

Tests: 1761 → 1761 (+0 new; the regression test shipped with the fix commit)
Coverage: 86% value-weighted (86% including 0 weakly covered paths)
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.
Tests ran: test 1642 (carried from CI run 42464070228/1 at tree 4bae1cddea5c; 36,469 tests)

Pre-Landing Review

Pre-Landing Review: No issues found.
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=3 dispatches=4
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Specialists (testing, security, state machines, batched): no findings. Red team: no additional issues found. Claude adversarial: two Low notes, neither blocks (below).
Outside review: unavailable. The Codex CLI isn't installed on this machine (CODEX_MODE: not_installed), so this is missing coverage, not a pass.

Review notes

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

  • INFORMATIONAL lib/ship-receipt-depth.ts:607 targetedClassesSince counts gate tags over the whole since-read change, including paths the head's exclusion drops, so a tagged hunk in an excluded file could falsely refuse a carried targeted record for gate (fail-closed, never a missed review)
  • INFORMATIONAL lib/ship-receipt-depth.ts:282 headInputs reads the receipt's recorded review_exclude.gate_tagged list when the scan is bound to the head; write and carry recompute it, and the queue already trusted it before this diff; a forged list cannot drop the gate class

Exploratory QA

Functional smoke on fixture repos outside the checkout, branch head 1aa5373, 4 of 12 probes. Verdict: pass.

  • 001 gstack-review-plan --base main --json with probe/** excluded and only an excluded SQLite ledger: targeted.classes=[], exclusion active. Pass.
  • 002 gstack-ship-receipt write --review-exclude <digest> at the same head: exit 0, receipt written (the reported bug). Pass.
  • 003 The same plan with a second ledger outside the pattern: targeted.classes=[money]. Pass.
  • 004 The receipt write there: exit 1, REVIEW_TARGETED: required=money receipt=legacy verdict=missing, no body written. Pass.
    Limits: carry and the queue's bind are covered by the unit test, not a CLI probe.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). This is a bug fix with a failing-first test.

Verification Results

No plan-specific checks: 0 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Documentation

Status: current — the docs already describe the fixed behavior, so nothing was edited.

Scope: base 9100930..head 1aa5373 plus the untracked changelog.d fragment: bin/gstack-review-plan, bin/gstack-ship-receipt, lib/review-targeted.ts, lib/ship-receipt-depth.ts, test/ship-receipt-targeted-exclude.test.ts, changelog.d/ship-skips-money-review-of-excluded-files.md. GST-1900 makes the receipt write, the receipt carry and the queue check leave excluded files out of the targeted classes, the same way gstack-review-plan already does.

Documentation health

File Status
docs/review-policy.md Current (the targeted pass section and the exclusion note at about line 603 already say excluded paths never trigger a targeted class)
docs/ship-policy.md Current ("Depth, numbers and the targeted pass" already names the plan, the receipt writer, carry and the queue)
docs/troubleshooting.md Current (RECEIPT_INVALID and QUEUE_RECEIPT_TARGETED_MISSING are still accurate)
review/specialists/targeted.md Current (no exclusion claim)
ship/DRIVER.md.tmpl Current (receipt write flags unchanged)
changelog.d/ship-skips-money-review-of-excluded-files.md Reviewed; consistent with the diff

Coverage debt: no new public surface. The only API change is the optional internal excluded parameter on targetedClasses and targetedClassesSince; it has reference coverage only through the policy prose, which is acceptable for an internal helper.

Diagram drift: none found.

Test plan

  • bun run test: carried from CI run 42464070228/1 at tree 4bae1cddea5c (36,469 tests, green)
  • bun test --timeout=30000 test/ship-receipt-targeted-exclude.test.ts: 6 pass, 0 fail (coverage audit run at 1aa5373)
  • gstack-pregate --allow-repo-commands: verify ok on tree 4bae1cddea5c

🤖 Generated with Claude Code

Agent notes

Refs GST-1900 (from HARN-1; unblocks harness-evals#322). Lane GSTA-411.

Approvals

No approvals recorded for branch ship-skips-money-review-of-excluded-files.
Plan: exempt: bug fix
Plan check: exempt bug fix

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=3 dispatches=4
Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

{
  "schema_version": 1,
  "pr": 4159,
  "head": "5e3620480ac93c8befac9fc32c8b14c653a776e3",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1642,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "4bae1cddea5ccc9e479dbbf112d7cd396f0eeccb",
  "product_patch_id": "0504e28c29deaf07467ce26853265a71bf6233cc",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 30,
    "rules": "c6a079fdf812f479",
    "base": "910093087dec4877f99dfaed6600784942ed7a7b",
    "registry": "910093087dec4877f99dfaed6600784942ed7a7b",
    "gate_scan": {
      "tagged": 0,
      "head": "5e3620480ac93c8befac9fc32c8b14c653a776e3"
    },
    "reasons": [
      "gate-class",
      "runtime=30"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @4bae1cddea5c (8 checks, current for 5e3620480ac9)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42464070228/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=4bae1cddea5c tests=36469 skipped=89 runs=42464070228/1 profiles=ci-reuse/free-tests heads=5e3620480ac9 verified=2026-11-08T08:48:40.172Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md for base 9100930..head 1aa5373 plus the changelog.d fragment"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

…s out (GST-1900)

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

trunk-io Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 8, 2026 08:51
@capy-ai
capy-ai Bot merged commit 9740bfd into main Nov 8, 2026
50 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