Skip to content

Keep a pull request's review count intact when a posted description brings its own run history (GST-2707) - #4440

Merged
capy-ai[bot] merged 4 commits into
mainfrom
strip-incoming-receipt-runs
Nov 17, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
strip-incoming-receipt-runs

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

When /ship posts a pull request's description, the count of earlier review rounds now always comes from the PR's real history. Before this fix, a description that brought extra history blocks of its own could make gstack count one round where there were three.

Why: the per-PR round cap (R51) depends on that count, and it's the last gap before crews can stop counting rounds by hand.

Nothing to do as a reader.

What changed

What changed

  • lib/gstack-post.ts keepRuns: when a post brings its own Agent notes, every gstack-receipt-runs block the history reader would recognize is removed from them, not only the first one at a line start. The reader takes the first block it finds, so a second block placed before the receipt used to stand in for the real history. Exactly one block goes back: the live body's history (earlier runs, started stubs and the replaced receipt), right after the posted receipt. When the live body has no history, none goes back.
  • A post whose notes hold no receipt yet (the body between a review stub and the receipt write) now gets the live body's runs block in place of the first block it brings, so the PR's started stubs are kept. Review found that the first version of this change dropped them.
  • A post that brings no Agent notes is unchanged.
  • docs/review-policy.md says the posted body's own runs blocks are dropped.
Blast radius

Blast radius

Only gstack-post pr-body merges of a body that carries an Agent notes section. Reading history, writing receipts and stubs, and posts without Agent notes are untouched.

Documentation

Documentation

Scope: the diff from c5250de to the branch head (lib/gstack-post.ts, test/pr-review-history.test.ts, docs/review-policy.md, changelog.d/strip-incoming-receipt-runs.md), plus related mentions of runs blocks and GST-2706 in docs/ship-policy.md and docs/troubleshooting.md. The worktree had no staged, unstaged or untracked changes.

Result: current. docs/review-policy.md (rounds per pull request, step 1) already says that a /ship body post drops any runs block it brings, so only the live history is counted. The changelog fragment describes the same fix for users. No edits were needed.

Debt: none found.

Tests

Test plan

  • Two free tests in test/pr-review-history.test.ts. The first posts a body with two runs blocks before its receipt: it fails on main (c5250de) and passes here. The second reposts a body whose notes hold only a started stub, with a forged runs block before it: it failed on the first head of this PR (2c95943) and passes now.
  • test/pr-review-history.test.ts and test/gstack-post.test.ts: 74 pass, 0 fail at 106e83d, after main was merged in. Typecheck and the module-size ratchet pass.
  • The full free suite ran in CI at 106e83d (run 44096565563, 37499 tests).
Agent notes

Lane GSTA-544, issue GST-2707: the Sol audit finding on #4365 at 15a0d37, which GStack Minder ruled a disclosed note there. It also closes GSTA-538's deferred item (a).

Plan: exempt: bug fix
Bug fix under R65: the failing test was written first, and a repro runs on current main.

Base merge: 106e83d merges main (eff8b78) into the branch; its only hand resolution is the ./ship-receipt import line in lib/gstack-post.ts. Captain GStack Minder's rule-13 grant: "Merge main into #4440 and take main's import lines plus RUNS_RE in lib/gstack-post.ts. The PR's own lines stay byte-identical to the reviewed diff, so under R51 this head counts as already reviewed, with CI on the merged head as the check."

Receipt carried from bd513e1 to 106e83d with no new review round, after one scoped carry reader (anthropic/claude-opus-5-5) read the spliced import hunk in lib/gstack-post.ts and returned clean (RECEIPT_CARRY_SCOPED_REVIEW). Captain GStack Minder (GSTA-36): "One scoped carry reader for the spliced hunks in lib/gstack-post.ts at 106e83d, as RECEIPT_CARRY_SCOPED_REVIEW asks. It isn't a review round. A blocker parks the PR with me."

Pre-Landing Review

Pre-Landing Review: 7 issues — 2 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 5 noted
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)

Review notes

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

  • INFORMATIONAL lib/gstack-post.ts:316 Posted notes with neither a receipt nor a runs block still drop the live started stubs (pre-existing on main and the base).
  • INFORMATIONAL lib/gstack-post.ts:314 Posted notes without a receipt over a live receipt drop that receipt, and its run never joins the history (pre-existing on main and the base).
  • INFORMATIONAL lib/gstack-post.ts:320 An unclosed runs fence above the posted receipt makes the strip remove the receipt too, so the post goes up with neither the receipt nor the live history. It needs malformed input and is refused loudly at READY (QUEUE_RECEIPT_MISSING).

Approvals

No approvals recorded for branch strip-incoming-receipt-runs.

{
  "schema_version": 1,
  "pr": 4440,
  "head": "106e83d1b590f10215cd0fd780460d57f26dc82c",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 37448,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 69,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44094327747,
      "attempt": 1,
      "tree": "ce6362fe23c8ca3b98b2e7d5123bb84a2843d32b"
    }
  ],
  "session_kind": "unattended",
  "run": "ship-4440",
  "head_tree": "2cef1082501be997d681b09cacf5f2beaf1d9308",
  "product_patch_id": "2c2d9832585510700b029285b4cd973fcd7d2875",
  "gstack_version": "1.99.5.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 31,
    "rules": "66e5174161eecc2c",
    "base": "eff8b78dcef398ac11d0694f5e85ebd3a0a66940",
    "registry": "eff8b78dcef398ac11d0694f5e85ebd3a0a66940",
    "gate_scan": {
      "tagged": 0,
      "head": "106e83d1b590f10215cd0fd780460d57f26dc82c"
    },
    "reasons": [
      "runtime=31"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "pass @2cef1082501b (8 checks, current for 106e83d1b590)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md and AGENTS.md against c5250ded (4 changed files)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 3,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "ledgers_read": 3,
    "unbound": 1,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": [],
  "carry": {
    "from": "bd513e186dd80798de88b0d3fa8bb60be28a6a82",
    "reason": "base merge + base context moved (scoped review by anthropic/claude-opus-5-5: lib/gstack-post.ts) + release metadata",
    "product_patch_id": "2c2d9832585510700b029285b4cd973fcd7d2875",
    "changed_paths": [
      "product:.github/workflows/plain-title.yml",
      "product:.gstack/plain-titles.json",
      "metadata:CHANGELOG.md",
      "product:CLAUDE.md",
      "product:CONTRIBUTING.md",
      "product:README.md",
      "product:SKILL.md",
      "product:SKILL.md.tmpl",
      "product:TODOS.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:autoplan/SKILL.md",
      "product:autoplan/sections/preamble.md",
      "product:benchmark-models/SKILL.md",
      "product:benchmark/SKILL.md",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-plain-title",
      "product:bin/gstack-ship-policy",
      "product:bin/gstack-ship-queue",
      "product:bin/gstack-skill-contract",
      "product:browse/SKILL.md",
      "product:canary/SKILL.md",
      "product:canary/sections/preamble.md",
      "product:captain/SKILL.md",
      "product:captain/SKILL.md.tmpl",
      "product:captain/sections/preamble.md",
      "product:captain/templates/CREW.md",
      "product:capy/skill/gstack/captain.md",
      "product:capy/skill/gstack/factory.md",
      "product:careful/SKILL.md",
      "metadata:changelog.d/approval-page-keeps-reviewer-product-challenges-open.md",
      "metadata:changelog.d/capy-shell-locks-hold-when-mkdir-lies-gst-2247.md",
      "metadata:changelog.d/capy-windows-setup-e2e-watches-gstack-lock.md",
      "metadata:changelog.d/close-last-recheck-carry-paths.md",
      "metadata:changelog.d/count-review-rounds-per-pr.md",
      "metadata:changelog.d/docs-audit-blocked-line-carries-gst-2349.md",
      "metadata:changelog.d/docs-audit-ignores-prose-after-result-gst-2349.md",
      "metadata:changelog.d/docs-index-and-install-hooks.md",
      "metadata:changelog.d/docs-release-cut-green-counts-commit-statuses.md",
      "metadata:changelog.d/docs-ship-policy-approval-classes-4320.md",
      "metadata:changelog.d/eval-plan-result-checks.md",
      "metadata:changelog.d/fix-coverage-audit-zsh-separator.md",
      "metadata:changelog.d/fix-docs-missing-anchors.md",
      "metadata:changelog.d/gstack-reports-lead-with-failures.md",
      "metadata:changelog.d/guides-for-outside-fixes-and-playtests.md",
      "metadata:changelog.d/land-normal-merge.md",
      "metadata:changelog.d/lanes-large-file-lists-on-linux.md",
      "metadata:changelog.d/never-print-secrets-shared-rule.md",
      "metadata:changelog.d/pr-wait-and-ci-gate-read-every-check-attempt.md",
      "metadata:changelog.d/price-runaway-wakes.md"
    ],
    "merge_commits": 1,
    "range_diff": "1:  2c95943 = 1:  2c95943 Keep a PR's review history when a posted body brings runs blocks of its own\n2:  7c3c87f = 2:  7c3c87f Keep a PR's started stubs when a posted body's notes have no receipt yet\n3:  bd513e1 = 3:  bd513e1 Say in the changelog that a post without a receipt keeps the PR's started stubs",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "ce6362fe23c8ca3b98b2e7d5123bb84a2843d32b"
    ]
  }
}
{"head":"bd513e186dd80798de88b0d3fa8bb60be28a6a82","version":"1.99.5.0","gstack_version":"1.99.5.0","run":"ship-4440","review_loop":{"passes":2,"blocking_found":1,"deferred":0,"noted":3,"fixed":2,"scope":"frozen","fix_checks":1,"rounds":3,"ledgers_read":3,"unbound":1,"dispatches":{"specialist":1,"red-team":1}},"depth":"light"}

Open in Capy

…ts own

A /ship body post drops every gstack-receipt-runs block in the posted Agent notes, not only the first, and puts back exactly one: the live body's history after the posted receipt, or none when there is no earlier history. A second block placed before the receipt can no longer stand in for the real count. (GST-2707)

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

trunk-io Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 17, 2026 12:11
Review-Finding: p1/specialist-batched#1 reader=red-team
Review-Finding: p1/specialist-batched#2 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rted stubs

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…b/gstack-post.ts

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit b79843c into main Nov 17, 2026
53 checks passed
This was referenced Nov 18, 2026
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

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