Skip to content

A used review grant can no longer be claimed again, plus two /ship finish fixes (GST-3560) - #4722

Merged
capy-ai[bot] merged 5 commits into
mainfrom
claim-checks-spent-legacy-grant
Nov 23, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
claim-checks-spent-legacy-grant

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

A grant for one follow-up review of a fix can no longer be claimed again once that review ran, so one grant still buys one round.
/ship finish no longer calls the docs audit stale for a file a clean follow-up review read, and the CI-record timeout no longer counts local test runs.
Nothing to do: the merge checks only get stricter, and the timeout setting keeps its name and default.

What changed
  • gstack-ship-receipt claim reads the review log before it writes a claim. For a grant for a follow-up review, if a counted follow-up review already read under that grant (a row that names the grant, or an unstamped row logged after the grant was recorded), claim refuses with GRANT_SPENT. A row stamped with a different grant never spends this one. This closes the gap where a read planned through gstack-review-plan --grant left no claim in the PR body, so the same grant (an owner's review_loop_grant row or a round grant) could be claimed for a second read. A run that already holds the claim can still claim again, and a malformed row still spends nothing.
  • gstack-ship-release finish: a path the follow-up review read, and that is byte-identical since that review, no longer stales the Step 14.5 docs audit. DOCS: fresh lists it as fix_checked=<n>. Before, DOCS: stale (<path>) stopped finish after a clean follow-up review at the current head, and no documented recovery applied.
  • ci_record_timeout_s now bounds only finding and verifying the CI run. record-ci prints CI_RECORD_PHASE: local before it runs CI-skipped files or an exception preflight here, and from that marker the caller allows up to an hour more. Before, harness-evals /office-hours -- kill the glazing in the final step #538's 445 remainder tests took about 880 s against a 900 s bound. A failure to start record-ci still returns record_failed.
  • Docs: troubleshooting GRANT_SPENT, review-policy (claim, and the docs check for reviewed paths), ship-policy and the merge-check reference page on ci_record_timeout_s, and a changelog fragment.
Tests

Each fix has a test that fails on main and passes here: test/round-cap-ruling-path.test.ts (claim refuses a spent legacy grant and a spent round grant; negative controls for an unspent grant, a row stamped with another grant, a malformed row and a re-claim by the same run), test/ship-finish-fixed-links.test.ts (a path the follow-up review read counts as reviewed; an unread or later-changed path still refuses), and test/ship-record-ci-reuse.test.ts (local runs past the bound still count the CI run; a CI phase past the bound stops and runs nothing here). Focused run: 18 files, 466 pass, 0 fail; bun run typecheck and typecheck:test clean. CI is the full run.

Agent notes

Follow-up to #4717 (GST-3546 attention 1) plus GST-3560 from HARN-64 (garrytan/harness-evals#538).

Approved: yes (record r-7a0f2abbc151). The full approval record stays private.
Plan: exempt: bug fix (GST-3560); bug fixes need no plan approval (R4)
Plan check: exempt bug fix

Open notes below the blocking floor, from the second-model and specialist reviews: no test yet for the base-merge patch-equivalence docs case; the 6 s bound in one record-ci test could flake on a slow runner; a timer kill races process exit, so the error path can report bound:false after a kill; a kill after the ledger write can make "nothing was recorded" untrue; a fix-check read is not a docs audit.

Ruled note: lib/ship-bin-common.ts:206:process-tree-kill at 4fb0441 ruled by Captain GStack Minder (GSTA-36) (relayed from GSTA-36:2026-11-23T00:23:26.892Z) at 2026-11-23T00:23:27.811Z: main's spawnSync timeout also kills only the direct child; a process-group kill with a Windows path is a separate fix. (approval a-53da98f10a97)

Open in Capy

{
  "schema_version": 1,
  "pr": 4722,
  "head": "27d10d7615efdeaa04b3f690c87f85482f97f70b",
  "version": "1.102.2.0",
  "base": "main",
  "ci_carried": [
    {
      "lane": "tests",
      "run": 45090365897,
      "attempt": 1,
      "tree": "378a6800a2f486123b7ae98dbf42d719ec2bf3df"
    }
  ],
  "calls": 155,
  "session_kind": "unattended",
  "run": "ship-20261122T225252-0c3766",
  "head_tree": "378a6800a2f486123b7ae98dbf42d719ec2bf3df",
  "product_patch_id": "86d71b11ef477dbcbc2adcd521972791ab1a6499",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 113,
    "rules": "33831f8248a814fd",
    "base": "50cc296700977b64c8c37ac0dbcb7e6250d1f302",
    "registry": "50cc296700977b64c8c37ac0dbcb7e6250d1f302",
    "gate_scan": {
      "tagged": 0,
      "head": "27d10d7615efdeaa04b3f690c87f85482f97f70b"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "runtime=113"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @378a6800a2f4 (8 checks, current for 27d10d7615ef)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45089670503/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45089670480/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=378a6800a2f4 tests=39215 skipped=89 runs=45090365897/1 profiles=ci-reuse/free-tests heads=27d10d7615ef verified=2026-11-23T00:48:49.816Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "README.md and docs/ (the branch diff 50cc2967..9d5fe29b: review-policy, ship-policy, troubleshooting, pregate)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 5,
    "deferred": 0,
    "noted": 12,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 2,
    "dispatches": {
      "specialist": 6
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "4fb044107b0d8ede71fe002fd2ceda320b786396",
      "pr": 4722,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "A spawn failure must return record_failed as before, never crash the tool.",
      "at": "2026-11-23T00:23:20.399Z",
      "approval": "a-d2c3188059d7",
      "stop_run": "ship-20261122T225252-0c3766",
      "findings": [
        "pass2/outside-voice#2"
      ]
    }
  ],
  "ruled_notes": [
    {
      "finding": "lib/ship-bin-common.ts:206:process-tree-kill",
      "head": "4fb044107b0d8ede71fe002fd2ceda320b786396",
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "main's spawnSync timeout also kills only the direct child; a process-group kill with a Windows path is a separate fix.",
      "at": "2026-11-23T00:23:27.811Z",
      "approval": "a-53da98f10a97",
      "relayed": "GSTA-36:2026-11-23T00:23:26.892Z"
    }
  ],
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "e01517eddd4b2350",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "86d71b11ef477dbcbc2adcd521972791ab1a6499",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}
{"head":"4fb044107b0d8ede71fe002fd2ceda320b786396","run":"ship-20261122T225252-0c3766","mark":"stop","tree":"886d0f1cf5406c0db141cf586797edacc219ff1d","at":"2026-11-23T00:21:20.249Z"}
{"head":"4fb044107b0d8ede71fe002fd2ceda320b786396","run":"ship-20261122T225252-0c3766","mark":"grant","grant":"a-d2c3188059d7","at":"2026-11-23T00:24:37.017Z"}

…nish fixes (GST-3560)

A grant for one follow-up review can no longer be claimed again once that review ran. /ship finish no longer calls the docs audit stale for a path a clean follow-up review read, and the CI-record timeout no longer counts local test runs.

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 22, 2026 22:57
A static import pulled the whole review module graph into every gstack-ship-receipt command, which a minimal skill install used by the docs command test does not ship.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The CI-record timeout now stops the CI lookup while it runs, a read stamped with another grant no longer uses up this grant, and the docs check counts only paths unchanged since a clean follow-up review read them.

Review-Finding: pass1/outside-voice#1 reader=outside-voice
Review-Finding: pass1/outside-voice#2 reader=outside-voice
Review-Finding: pass1/outside-voice#3 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
carryLane's async spawn had no error handler, so a launch failure crashed accept, finish and preflight instead of failing that lane.

Review-Finding: pass2/outside-voice#2 reader=outside-voice
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>
@capy-ai
capy-ai Bot merged commit ccd80de into main Nov 23, 2026
85 of 87 checks passed
garrytan added a commit that referenced this pull request Nov 23, 2026
…two tests are tighter (GST-3567)

Exploratory check on #4722's real run 45089670503: comparing whole files refused it, because main and the branch both edited docs/pregate.md and docs/troubleshooting.md in different places. The rule now uses ownLinesSame, the same own-lines comparison a base-only merge of a reviewed head meets, and lives in lib/pregate/run-check.ts. The red-run test checks the exit status, and a new test drives clear --run through the forwarded rule.

Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: lib/pregate/run-check.ts:70:functional-contract reader=qa
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 23, 2026
…it (GST-3567) (#4728)

/ship's final CI check (`gstack-ship-release accept`) now accepts a
green pull request run that tested your branch merged onto a newer main,
when main changed none of your lines.

Why: before, it refused that run and you had to merge main and rerun CI,
which never settles on a busy repo (harness-evals #576, gstack #4722).

Nothing to do. Repos with a land step still re-check the merged tree;
repos with `land: null` get no merged-tree check.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: lib/pregate/run-check.ts:70:functional-contract reader=qa
Review-Finding: p2/outside-voice#1 reader=outside-voice
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