Repository navigation
ship-receipt write: the targeted record survives a main merge (GST-1593) - #4058
Merged
Merged
Conversation
…s since the read cover the PR's own change (GST-1593) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…T-1593) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…lways voids the targeted record; isolate the GST-1593 tests' gate scan from the real home (GST-1593) ownChangeSince compared the PR's per-path hunks with line numbers stripped even when main had not moved the path's base content, so a branch commit after the targeted read that relocated the PR's money line to an identical-context block read as unchanged and the record bound (red-team, /ship #4058 pass 1). Hunk comparison now applies only when the base blob moved. The four direct targetedClassesSince calls in the GST-1593 tests now run with the fixture's env, so gstack-gate-diff no longer writes under the real ~/.gstack (CI run 42179129702, free-suite (4): FREE_SUBSHARD_REJECTED real home changed). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
ownChangeSince: a path whose base content main also changed now moves unless replaying main's change onto the read's content (git merge-file) gives HEAD's content exactly, so relocating the PR's money hunk to an identical context after a main merge voids the targeted record; position-free hunk comparison is gone. The built commit carries the branch's first-parent messages since the read, so a [skip ci] commit stays RH-14 gate class. Two red-first tests cover both. Review-Finding: v1/outside-voice#1 reader=outside-voice Review-Finding: v1/adversarial-native#1 reader=adversarial-native Review-Finding: v1/outside-voice#2 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The built commit now carries the message of every commit since the read that origin/main does not hold, so a CI-skip marker on a side-branch commit merged with --no-ff still tags RH-14. A path whose mode at HEAD is not the replayed mode now moves, so a mode-only change after a main merge to the PR's own file voids the record. Two red-first tests cover both. Review-Finding: fc1/fix-check#1 reader=fix-check Review-Finding: fc1/fix-check#2 reader=fix-check Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…lint) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
garrytan
added a commit
that referenced
this pull request
Nov 6, 2026
…#4058) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
4 tasks done
capy-ai Bot
added a commit
that referenced
this pull request
Nov 6, 2026
…y reader (GST-1598) (#4062) * test: failing-first repro for GST-1598 (post-review docs money delta has no targeted-only reader) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * review-plan: a docs claim added after the loop plans one targeted-only reader (GST-1598) After a finished review loop, a docs change with a money, security or numeric claim left the receipt unable to carry the targeted record and the plan at done, so nothing could dispatch the reader the receipt asks for (harness-evals #225). With --range-base naming the commit the targeted reader read and --targeted-ran its patch, a docs-only change since then now plans NEXT: targeted: one targeted reader on HEAD for the head classes, with TARGETED_DELTA printed. Code changes keep done; --force targeted refuses and names the route; gstack-review-dispatch pass builds the one-reader manifest. Repins lib/review-depth.ts under replay GST-1598 (one Step union member; the GST-967 and GST-972 grids hash unchanged). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * review-targeted-delta: pass the base to plainDocsSince (GST-1598 after #4058) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes targetedDelta counts a path whose branch hunks are unchanged and only the base moved lines beside them (comparePath context) as unchanged, so a main merge next to a reviewed hunk no longer hides the targeted-only read (GST-1598). Review-Finding: p1/outside-voice#1 reader=outside-voice Review-Finding: p1/adversarial-native#2 reader=adversarial-native Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * changelog: GST-1598 targeted-only read fragment 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>
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.
What changed
gstack-ship-receipt write --review-targetedcomputes "what changed since the targeted read" over the PR's own change instead of the merge-inclusive<read>..HEADrange. A main merge after the read that leaves the PR's diff alone no longer voids the record, whatever money- or secret-tagged files it brought in.Why
HARN-1 on harness-evals #293 (also #292 and #225): write refused with "the targeted reader read … the product changed after the read" though the product patch id was unchanged (f903d10bd327 before and after).
targetedClassesSince(<read>..HEAD)diffed across the merge commit, so main's budget-ledger, lane-spend and results files counted as changes since the read.How
ownChangeSince(lib/ship-receipt-depth.ts) finds the paths whose part of the PR's diff against its merge base withorigin/<base>differs between the read and HEAD (product_patch_id's basis, with tests and metadata kept), and builds a commit on the read with only those paths at HEAD's content. A path whose base content main left alone moves on any change. A path main also changed moves unless replaying main's change onto the read's content (git merge-file) gives HEAD's bytes and mode exactly. With no resolvable merge base every path in<read>..HEADmoves, the old behavior.origin/<base>does not hold, side-branch merges included, so a CI-skip marker after the read stays gate class (RH-14).targetedClassesSinceclassifies<read>..<that commit>and runs the gate scan withgstack-gate-diff --commitover it.plainDocsSince(GST-1195's docs carry) had the same merge-inclusive range and uses the same basis.baseto both (one line in bin/gstack-ship-receipt).Blast radius
Only write's targeted-record binding moves. The patch-id check in
parseReviewTargetedis unchanged, so any product change still refuses on its own; the classes check stays the extra guard for tests and metadata. A branch-side money, secret, auth or gate change after the read, a hunk moved to an identical context, a mode-only change, a CI-skip commit message, or a merge resolution that changes the PR's own hunks still moves its path and refuses (tests below). Every new failure path fails closed: git errors, conflicts and missing blobs move the path.Tests
New cases in
test/review-targeted-record.test.ts, each failing first against the code before its fix:lib/budget-ledger.tsandlib/secrets.ts: write binds, classes since the read are none (main gavemoney,secret);money,gate);src/charge.ts: refused, classesmoneyonly;money);gate), and the same commit on a side branch merged with--no-ff: refused;money).The GST-1593 cases call
targetedClassesSincein-process under the fixture's env, so the gate scan they spawn writes nothing under the real~/.gstack(CI run 42179129702'sFREE_SUBSHARD_REJECTED).Siblings checked
targetedClassesSincehas one caller (write);plainDocsSincefixed here.writeExcludeBinds(<snapshot>..HEADwithin one /ship run), ship-release's fix-check and review-loop-exception routing (already compares the PR's own sides,comparePath/ own-paths intersection), and the queue'sacceptedReceiptHeads(classifies merge parents against the base).Approvals
Approved: yes (record r-85abf98a6119). The full approval record stays private: this repository is public or its visibility is unknown.
Review-loop exception: accepted by GStack Minder 2026-11-06 via Captain ruling relayed to lane GSTA-334, approval a-934d8c892682: A1 granted: one more scoped fix-check on #4058 covering the first-parent skip-CI regression plus the mode-only-change check; the last one for this PR (fix-check at e6e99dd, 1 finding)
Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=3 fixed=5 scope=frozen unbound=1 ledgers_read=6 fix_checks=2 dispatches=8
Gate class, full panel. Pass 1 (8ac95c0): red-team CRITICAL (identical-context relocation with no main merge), fixed in 2f769b4. Pass 2 (range 8ac95c0..2f769b4): one test-gap note. Step 11 (2f769b4): outside voice (openai/gpt-6.1-sol) two CRITICAL and adversarial one Medium, fixed in c462483. Fix-check 1 (3d009c1): one CRITICAL (side-branch CI-skip messages) and one INFORMATIONAL (mode-only change), both fixed in e6e99dd under the exception above. Fix-check 2 and targeted reader (e6e99dd): one fail-closed note, no findings. Step 11 rebind at e6e99dd (tree 08b2d50c): adversarial five findings, all Blocks: no; outside voice and targeted reader clean.
Gate edits: 3 listed, 2 read, 0 findings. The RH-14 hit is commit c462483, whose message quoted a CI-skip marker in prose; CI then ran at 3d009c1 on the identical tree, so it silences nothing.
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:540The message source<read>..<head> ^origin/<base>also picks up messages of base commits the localorigin/<base>ref does not cover; a CI-skip marker there refuses (fails closed).lib/ship-receipt-depth.ts~577: skill directories forplainDocsSincecome from the built tree, so a branch edit to prose under a skill directory main added after the read can ride the docs-only carry; the claim-word filter and the queue's verdict at head still apply. Follow-up.origin/<base>trust is unchanged.Exploratory QA
Functional, smoke budget 300 s, report-only. Captures 001-002 at 8ac95c0 reproduced the real-home leak and the red-team relocation bypass; 003-004 at 2f769b4 passed (relocation reports money; the focused file passes with the home fixture count unchanged). Verdict: pass. checkpoint 002 checkpoint 003 checkpoint 004
Documentation
Status: current. No documentation edits needed.
Scope: base 4b1a115 to head e71ea97 on gst-1593-targeted-merge (6 committed files; no staged, unstaged or untracked content), plus 168 discovered docs. Changed:
lib/ship-receipt-depth.ts(targeted classes and plain-docs carry computed over the PR's own change against its merge base),bin/gstack-ship-receipt(passes the base), a test file, a changelog fragment, and two docs.Documentation health:
Coverage debt: no new public commands, flags or env vars; the changed functions are internal. No gaps. Diagram drift: none (no diagrams reference these functions).
Debt note: one very long run-on sentence in docs/review-policy.md (~line 489) could be reflowed; cosmetic, not changed in read-only mode.
Test plan
bun test --timeout=30000 test/review-targeted-record.test.tsat e6e99dd: 20 pass, 0 fail; every new case failed first against the code before its fixbun run typecheck: exit 0;test/module-size-ratchet.test.ts: 6 pass; conflict markers: none