Repository navigation
Stop /ship asking for a money review of files the review policy leaves out (GST-1900) - #4159
Merged
Merged
Conversation
…s out (GST-1900) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/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.
Before/after as text: Receipt write now agrees with the review plan when the only money-looking file is excluded
Why
A ship on harness-evals#322 stopped with
REVIEW_TARGETED: required=moneyeven 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 areview_exclude_pathspattern, 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
excludedfield. When no exclusion is active the field is left unset and nothing changes. I checked this withtest/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=nonefrom the plan andrequired=moneyfrom the receipt at the same head.targetedClassesnow 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.
lib/ship-receipt-depth.ts:607targetedClassesSince 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)lib/ship-receipt-depth.ts:282headInputs 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 classExploratory QA
Functional smoke on fixture repos outside the checkout, branch head 1aa5373, 4 of 12 probes. Verdict: pass.
gstack-review-plan --base main --jsonwithprobe/**excluded and only an excluded SQLite ledger:targeted.classes=[], exclusion active. Pass.gstack-ship-receipt write --review-exclude <digest>at the same head: exit 0, receipt written (the reported bug). Pass.targeted.classes=[money]. Pass.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
Coverage debt: no new public surface. The only API change is the optional internal
excludedparameter ontargetedClassesandtargetedClassesSince; 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)