Skip to content

fix: the receipt and the review plan agree on stamp and docs carry for review_targeted (GST-1689) - #4099

Merged
capy-ai[bot] merged 2 commits into
mainfrom
capy/gst-1689-stamp-docs-carry
Nov 6, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
capy/gst-1689-stamp-docs-carry

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

GBRA-345 (gbrain #8727): after a clean money-class targeted read, /ship's Step 12 restamp plus the Step 14.5 docs audit changed only stamp, CHANGELOG and docs files. gstack-ship-receipt write refused review_targeted ("the product changed after the read"), while gstack-review-plan --range-base <read> --targeted-ran <patch> printed NEXT: done, so only --post-review (adversarial plus the outside voice) could finish: a third round over unchanged code.

{
  "schema_version": 1,
  "pr": 4099,
  "head": "95508477ec8ac26221d6ced0f118023ae9e85612",
  "version": "1.97.0.0",
  "base": "main",
  "gate": {
    "full": {
      "pass": 1621,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 5,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "full",
      "run": 42308464152,
      "attempt": 1,
      "tree": "cc11a9adcb44468914535af1ed31a8f1d3e09018"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "cc11a9adcb44468914535af1ed31a8f1d3e09018",
  "product_patch_id": "c3cf4675ebd67051a2d8d05e72579e0668f6eab0",
  "gstack_version": "1.97.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 161,
    "rules": "70895942bb8a8ee2",
    "base": "e325b6d160179488f848f3d1f86c0df985baad87",
    "registry": "e325b6d160179488f848f3d1f86c0df985baad87",
    "gate_scan": {
      "tagged": 0,
      "head": "95508477ec8ac26221d6ced0f118023ae9e85612"
    },
    "reasons": [
      "gate-class",
      "runtime=161"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "warn @cc11a9adcb44 (8 checks, current for 95508477ec8a)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ (137 files) plus README.md, CLAUDE.md, AGENTS.md and the changelog.d fragment, base e325b6d1 to head 95508477"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changed

A restamp after a base merge now keeps the targeted record: the new case fails at 8db9130 and all five pass at 9550847

A restamp after a base merge now keeps the targeted record: the new case fails at 8db9130 and all five pass at 9550847.

Before/after as text: A restamp after a base merge now keeps the targeted record: the new case fails at 8db9130 and all five pass at 9550847
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+$ bun test test/review-targeted-stamp-carry.test.ts   # at 9550847
+(pass) restamp plus a plain docs-audit edit: write binds the record and the plan is done
+(pass) restamp alone: write binds the record and the plan is done
+(pass) base merge with a sibling release, then restamp: write binds the record and the plan is done
+(pass) restamp plus a one-line code change: write refuses and the plan sends it to the review loop
+(pass) restamp plus a docs edit with a numeric claim on a money-class PR: write refuses and the plan dispatches the targeted reader
+ 5 pass
+ 0 fail
-$ bun test test/review-targeted-stamp-carry.test.ts -t 'base merge'   # at 8db9130
-error: gstack-ship-receipt write: ... the targeted reader read e785ecd8c407, whose product patch
-  a6ad231d8875 is not this receipt's 5927d82cf2bc: the product changed after the read ... (RECEIPT_INVALID)
-(fail) base merge with a sibling release, then restamp: write binds the record and the plan is done
- 0 pass
- 1 fail
 
  • One classifier. docsChangeSince in lib/ship-receipt-depth.ts decides what the PR's own change since the targeted read is: release stamps, plain docs, a docs claim, or code. gstack-ship-receipt write (through plainDocsSince) and the review plan's targeted-only read (lib/review-targeted-delta.ts) both call it, so they cannot disagree.
  • Stamps always carry. A path whose change is a release stamp under the base policy's stamp rule (classifyFiles in lib/tree-receipt.ts) is kept at the read's content before the docs rule and the targeted classes read the change. After a base merge, the CHANGELOG is compared against the read commit's CHANGELOG merged with the base's, so a sibling release's section is not counted as the PR's docs change.
  • Docs keep the existing rule. Docs and CHANGELOG edits carry only as plain docs (GST-1195). A code change still drops the record, and a docs claim beside a restamp gets the one targeted reader (NEXT: targeted) instead of a dead end.

Tests

test/review-targeted-stamp-carry.test.ts, on a fixture with a real gstack-restamp and real dispatch/verify: restamp plus a plain docs-audit edit binds at write and the plan is done (fails on main: write refuses); restamp plus a one-line code change refuses; restamp plus a docs edit with a numeric claim on a money-class PR refuses and the plan dispatches the targeted reader.

Out of scope: CI carry/pregate (GSTA-366), the review-loop exception (GSTA-365).

Why

"gstack-ship-receipt write and gstack-review-plan disagree on whether a change after the targeted read keeps review_targeted: the plan says done, the receipt refuses" (GBRA-345, gbrain #8727). A restamp plus a docs-audit edit could only finish through a third review round over unchanged code. Now the receipt and the plan read the change the same way, so a stamp or plain-docs change after the read finishes in one step.

Blast radius

The change touches the receipt's review_targeted check and the review plan's targeted-only read; both now go through docsChangeSince, and every unreadable or unmergeable input still falls back to the read commit, which refuses as before (walked failure paths in stampPathsSince and baseMergedChangelogCommit, plus the code-change and numeric-claim tests that still refuse).

Approvals

Approved: yes (record r-68dd10847872). The full approval record stays private: this repository is public or its visibility is unknown.

Summary

The receipt and the review plan now share one classifier for the change after a targeted read, release stamps always carry the record (including a slot restamp after a base merge), plain docs carry under the GST-1195 rule, and code drops it.

Test Coverage

Coverage: 62% (8 of 13 paths, Step 7 audit-only). Tests: 3 → 5 in test/review-targeted-stamp-carry.test.ts (+2 new: a restamp alone, and a base merge with a sibling release then a restamp).
Regression proof — fails at HEAD: yes (the base-merge case fails at 8db9130 with RECEIPT_INVALID) · passes at base: unavailable (new fixture case needs this branch's helpers) · passes after fix: yes.
Leftover gaps (proposed, not written): the null verdict when the read is not an ancestor; no policy or unreadable VERSION; the local-base fallback; a binary stamp path.
Tests ran: full 1621 (files, CI run 42308464152/1)
Tests ran: targeted 5

Pre-Landing Review

Pre-Landing Review: 7 issues — 2 auto-fixed, 0 asked, 0 deferred, 5 noted
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=1 fixed=2 scope=frozen 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)
Outside review: openai/gpt-6.1-sol (host subagent), completed. The first Step 11 attempt raised one Medium finding (listed under Review notes); the second attempt was clean.

Review notes

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

  • INFORMATIONAL test/review-targeted-stamp-carry.test.ts:101 The base-merge CHANGELOG baseline has only a positive test; no negative row shows a PR-own numeric CHANGELOG claim after a base merge still refuses (scratch probes show it does), and the unmergeable fallback is untested.
  • INFORMATIONAL lib/ship-receipt-depth.ts:688 mergeChangelogs is called without the merge-base CHANGELOG, so carryReleasedParent never runs; a stacked child whose [Unreleased] still holds a released parent's entry falls back to from and fails closed into an extra targeted reader.
  • INFORMATIONAL test/review-targeted-stamp-carry.test.ts:101 No negative control pins that a PR-own CHANGELOG edit riding a base merge plus restamp is still refused (probes by two readers show it is).
  • INFORMATIONAL lib/ship-receipt-depth.ts:681 baseMergedChangelogCommit duplicates ownChangeSince's git runner, pinned identity env and temp-index pattern; the copies can drift.
  • INFORMATIONAL lib/ship-receipt-depth.ts:688 Outside voice (openai/gpt-6.1-sol, first voices attempt) rated Medium/blocks: when the PR edited a released CHANGELOG section before the read, a base merge resolved by mergeChangelogs drops that edit, and the base-merged baseline then calls the CHANGELOG a stamp, so the record carries where the old code refused on the removed money line. Lead probe confirms (write exit 0). No unreviewed text reaches HEAD; the loss comes from the merge resolver. Below the floor by lead judgment.

The Captain (GStack Minder) accepted the outside voice's CHANGELOG-section finding as a note.

Exploratory QA

Smoke through the test harness only: the five stamp-carry cases on real gstack-restamp, gstack-ship-receipt write and gstack-review-plan bins, plus reviewer probes (a PR-own CHANGELOG claim after a base merge still refuses). QA method sections were not run.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

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/specialist-batched#1

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No doc edits were needed; the branch already documents the change.

Scope: the candidate base e325b6d to head 9550847 on capy/gst-1689-stamp-docs-carry: 6 committed files (lib/ship-receipt-depth.ts, lib/review-targeted-delta.ts, test/review-targeted-stamp-carry.test.ts, docs/review-policy.md, docs/troubleshooting.md and the changelog.d fragment). No staged, unstaged or new files.

Documentation health:

  • docs/review-policy.md: Current (the branch updated it for the release-stamp carry and the shared docsChangeSince classifier)
  • docs/troubleshooting.md: Current (the branch updated the RECEIPT_INVALID entry)
  • changelog.d/capy-gst-1689-stamp-docs-carry.md: Current (read for consistency only)
  • README.md / CLAUDE.md / AGENTS.md: Current (no changes needed)

Coverage debt: none from this branch. Pre-existing: docs/review-policy.md is not linked from README.md, CLAUDE.md or AGENTS.md. Diagram drift: none.

Test plan

  • bun run test: carried from CI run 42308464152/1 at tree cc11a9adcb44 (1621 files)
  • bun test test/review-targeted-stamp-carry.test.ts: 5 pass, 0 fail

Out of scope: CI carry/pregate (GSTA-366), the review-loop exception (GSTA-365).

Open in Capy

…r review_targeted (GST-1689)

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

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

A restamp after a base merge now carries the targeted record: the CHANGELOG is read against the read commit's merged with the base's, so a sibling release's section is not counted as the PR's docs change. Adds the stamps-only and base-merge restamp cases.

Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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