Repository navigation
ship finish chains granted fix-check rows; a pregate rerun at the same tree keeps its clears (GST-1627) - #4077
Merged
Merged
Conversation
…e tree keeps its clears (GST-1627) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…e clears keep only at the same head) Review-Finding: s11/outside-voice#1 reader=outside-voice Review-Finding: s11/outside-voice#2 reader=outside-voice Review-Finding: s11/adversarial-native#2 reader=adversarial-native Review-Finding: s11/adversarial-native#3 reader=adversarial-native Review-Finding: s11/adversarial-native#6 reader=adversarial-native Review-Finding: p1/red-team#1 reader=red-team Review-Finding: p1/red-team#2 reader=red-team Review-Finding: p1/specialist-batched#1 reader=security Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Contributor
|
Cross-family decision-trail read (openai/gpt-6.1-sol, rule 27) at 27d3bb5. Three items stay open as notes. None meets the blocking floor, because each one either fails closed or is caught by another gate:
Also, test/ship-accept-same-tree-clears.test.ts is excluded from the Windows-safe subset (bin shebangs; same cause as run 41607840098). |
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.
Two /ship tooling gaps from #4063 (GST-1627).
finish counts every granted fix-check in a chain. A second granted fix-check (a merge resolution) logs its range from the first fix-check's commit. finish read only the newest
review-fix-checkrow and refused any range that didn't start at the reviewed tree, so the later fix-check unbound the earlier one and lanes logged a synthetic combined row. finish now walks back from the newest row through earlier rows whose commit is the next row'srange_base, to a row whoserange_baseholds the reviewed tree. The chain counts only when every link is a clean committed read with its own approvedreview_loop_grant(an earlier link's stop head must sit before its commit, so one grant never covers two fix-checks). A gap or an ungranted link refuses, and nothing in the chain counts.A pregate rerun at the same tree keeps its clears. accept's final
gstack-pregaterewrote pregate.json and dropped themacos-named-regressionsandwindows-smokeclears made at the same tree, so accept never exited 0. The run writer now keeps an earlier receipt for the same lane, platform, workflow and job (tests covered) under the same tree, policy and base branch, and printsPREGATE_CLEAR_KEPT:, which accept relays. Another tree, or a rerun with a failed or unfinished check, keeps nothing.Tests: the #4063 shape (fc3, then fc4 over the merge resolution) counts both; a broken chain and an ungranted link refuse; accept at the same tree keeps the clear and exits 0; a changed tree drops it. /ship receipt to follow.
What changed
Before: main's accept drops the macOS clear made at the same tree and stops. After: this branch keeps a clear made at the same head and tree (accept exits 0 in the fixture), and one grant counts for one fix-check link.
Before/after as text: Before: main's accept drops the macOS clear made at the same tree and stops. After: this branch keeps a clear made at the same head and tree (accept exits 0 in the fixture), and one grant counts for one fix-check link
Why
On #4063, "finish read only the newest review-fix-check row", so a second granted fix-check unbound the first and the lane had to log a synthetic combined row, and accept "never exited 0" because its final pregate dropped the macOS and Windows clears made at the same tree. Now finish counts a chain of granted fix-checks back to the reviewed tree, one owner grant per link, and a pregate rerun at the same head and tree keeps the clears it already has.
Blast radius
The change touches
gstack-ship-release finish(its fix-check route),gstack-pregate's run writer andaccept's output. Both new paths fail closed: a gap, an ungranted link or a reused grant refuses the chain, and a clear is kept only for the same head, tree, policy, base branch and obligation in a rerun whose checks all finished (read at lib/ship-release.ts fixChecked and lib/pregate/index.ts keepSameTreeClears; covered by 17 passing cases in the two test files, and by the full free suite in CI run 42241538788 at 27d3bb5).Approvals
No approvals recorded for branch capy/gst-1627-fix-check-chain.
Summary
Two /ship tooling gaps from #4063 (GST-1627). finish now chains contiguous
review-fix-checkrows. Each row links to the earlier row whose commit is itsrange_base, back to one whoserange_baseholds the reviewed tree, and the chain counts only when every link is a clean committed read with its own approvedreview_loop_grant. A grant counts for one link only, so one grant naming two links' commits cannot cover both. Separately, agstack-pregatererun at the same head, tree, policy and base branch keeps each earlier receipt for the same obligation and printsPREGATE_CLEAR_KEPT:(after the record is written), which accept relays; another head or tree, or a rerun with a failed or unfinished check, keeps nothing. The /ship review's fixes landed in 27d3bb5.Test Coverage
Step 7 audit (pass 1, audit-only): 9 of 12 changed paths have a test, 7 of 12 a strong one. The gaps it named are an earlier stale link in a chain, the
--jsonstderr routing ofPREGATE_CLEAR_KEPT, and the git-diff failure stop infixChecked(needs a seam). docs/review-policy.md (prose) and scripts/lib/windows-curation.ts (one data row) need no naming test.Review fixes added two regression cases:
one grant naming both links' stop heads counts for one link, and the chain refuses(Regression proof — fails at HEAD: yes (run against 5220d42's lib/ship-release.ts) · passes at base: unavailable (the chain code does not exist at base) · passes after fix: yes) and a new-head row in thekeepSameTreeClearsunit test.Tests ran: tests 1611 (files, carried from CI run 42241538788/1, 35940 tests at tree 80cf0613838e)
Pre-Landing Review
Pre-Landing Review: 13 issues — 0 auto-fixed, 0 asked, 4 fixed (2 blocking, from the Step 11 queue, commit 27d3bb5), 0 deferred, 9 noted. The count merges duplicates across readers: two pass-1 notes and two native findings were the same defects as the two fixed outside-voice blockers.
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=7 fixed=5 scope=frozen unbound=3 ledgers_read=5 dispatches=8
Pass 1 (full panel at 5220d42: batched testing/security/state-machines specialist, Red Team) found four INFORMATIONAL items, all logged as notes. Step 11's outside voice (openai/gpt-6.1-sol, host subagent, completed) marked two findings Blocks: yes: one approved grant naming two commits counted for two chain links (lib/ship-release.ts), and a same-tree rerun at a new head carried a flaky exception bound to the old head, so accept passed while verify refused (lib/pregate/index.ts). The native adversarial pass and the Red Team found the same two. Both were fixed in 27d3bb5, with the native pass's print-after-write item. Pass 2 (full on the range 5220d42..27d3bb5) found three INFORMATIONAL items, all notes. The
unbound=3count is the three native-voice trailers on 27d3bb5, which duplicate the two outside-voice findings and the write-order note; no review row lists them.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)
Outside review: completed (openai/gpt-6.1-sol via host subagent), recommendation "request changes" on the two findings fixed in 27d3bb5.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/ship-release.ts:279Grant matching is greedy from the newest link back. Each link takes the unused grant whose stop head is latest in its own range, and nothing checks whether an earlier link still needs that grant. Example: grant A names a stop only in link 2. Grant B names a stop in link 1 and a later stop in link 2. Link 2 takes B, so link 1 finds no grant and finish refuses the chain, even though giving A to link 2 and B to link 1 is valid. This fails closed (a false refusal), so no data is lost, but a lane with valid grants could still be blocked.lib/ship-release.ts:278The new rule that one grant counts for one link is keyed on the approval row'sid. That id is a hash of source, date, ask, words and by (lib/approval-record.ts:169). The same owner approval recorded again on a later date or under another--sourcegets a new id and can cover a second fix-check link. That is the exact outcome the docs say cannot happen ('one grant never covers two fix-checks'). readRecord also unions read_also, the mirror and the local record (approval-record.ts:136), so one approval logged by two threads, or once by hand and once imported, shows up as two grants. In finish, this lets the chain pass where the rule says it should refuse. It does not lose data, and it needs a second approved review_loop_grant row with the owner's words in it.docs/ship-policy.md:1829The docs and the fixChecked JSDoc (lib/ship-release.ts:253) both say a grant counts for 'the newest link that names it'. The code does something else. The newest link takes whichever unused grant has the latest stop in its own range. If grant S names stops in links 1 and 2, and grant N names a later stop only in link 2, then link 2 takes N and S goes to link 1. So S counts for the earlier link, against what the docs say. Lanes that read the policy to work out which grant to ask the owner for will predict the wrong pairing. This is the docs side of the greedy-matching finding already reported, not a new bypass.test/ship-finish-ruled-notes.test.ts:250(pass 1, testing) The chain tests do not cover a stale earlier link while the newest is clean, an off-branch range_base, or a ruling at a boundary commit; keepSameTreeClears's substitution and exception carry and the policy_digest refusal have no case.lib/pregate/index.ts:500(Step 11, native) A kept receipt can still hide a fresh carry refusal (newer_run,run_changed) at the same head; only fail, incomplete and not_installed checks stop the keep.lib/pregate/index.ts:502(Step 11, native) keepSameTreeClears matches on lane, platform, workflow and job, while clearObligation writes to the first obligation with that lane name.lib/ship-release.ts:265(Step 11, native) The chain walk takes the newest row at a range_base commit, so a stale newest row there refuses even when an older clean row exists (fails closed).Exploratory QA
Functional surface (CLI: finish fix-check chain, gstack-pregate keepSameTreeClears), smoke bound 300 s. Pass 1 at 5220d42: the two focused test files passed 16/16, and a pure-function probe confirmed a same-tree record at a new head kept the old receipt (the finding fixed later). Revalidated at 27d3bb5: 17/17 pass, and the same probe now keeps the receipt only at the same head and tree, nothing at a new head or another tree. Verdict pass. Reports: .gstack/tmp/qa-reports/run-20261106T145515Z/functional/report.md and functional-p2/report.md (local to the /ship run). Limit: the probe exercises the pure function; the bin path is covered by the accept fixture tests.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN. Intent: count chained granted fix-checks in finish and keep same-tree pregate clears through accept (GST-1627). Delivered: that, plus one Windows curation row for the new bin-spawning test file (windows-latest fails bin spawns, run 41607840098).
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.
Issues
Refs p1/red-team#1
Refs p1/red-team#2
Refs p1/specialist-batched#1
Refs s11/adversarial-native#2
Refs s11/adversarial-native#3
Refs s11/adversarial-native#6
Refs s11/outside-voice#1
Refs s11/outside-voice#2
reference s11/outside-voice#1 ← commit 27d3bb5: Review-Finding: s11/outside-voice#1 reader=outside-voice
reference s11/outside-voice#2 ← commit 27d3bb5: Review-Finding: s11/outside-voice#2 reader=outside-voice
reference s11/adversarial-native#2 ← commit 27d3bb5: Review-Finding: s11/adversarial-native#2 reader=adversarial-native
reference s11/adversarial-native#3 ← commit 27d3bb5: Review-Finding: s11/adversarial-native#3 reader=adversarial-native
reference s11/adversarial-native#6 ← commit 27d3bb5: Review-Finding: s11/adversarial-native#6 reader=adversarial-native
reference p1/red-team#1 ← commit 27d3bb5: Review-Finding: p1/red-team#1 reader=red-team
reference p1/red-team#2 ← commit 27d3bb5: Review-Finding: p1/red-team#2 reader=red-team
reference p1/specialist-batched#1 ← commit 27d3bb5: Review-Finding: p1/specialist-batched#1 reader=security
Verification Results
No plan-specific verification items (no plan file). Automatic QA above: 2 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Scope: audited the committed diff against base 1a06afd (10 files) for GST-1627, covering the ship-policy, review-policy and pregate docs, the changelog.d fragment and the code they describe, plus a grep of all .md and .tmpl files for stale wording. There were no staged, unstaged or new-file changes beyond the committed diff.
Result: the docs are current. The chained fix-check behavior, including the grant-per-link rule, gap and ungranted-link refusals and the FIX_CHECK line format, and the same-tree PREGATE_CLEAR_KEPT behavior, match the implementation. Anchors
#fix-check-chainand#same-tree-clearsexist and are referenced from the right places.Debt: none found. The historical CHANGELOG entry about the newest row is intentionally unchanged.
Test plan
bun run test(tests lane): carried from CI run 42241538788/1 at tree 80cf0613838e, 1611 files, 35940 tests, 0 failedbun test test/ship-finish-ruled-notes.test.ts test/ship-accept-same-tree-clears.test.ts: 17 pass, 0 fail at 27d3bb5bun run typecheck: 0 errors;test/module-size-ratchet.test.ts: 6 passgstack-pregate verify: ok🤖 Generated with Claude Code