Skip to content

After a pull request's second review round, an approved extra check now leads to a /ship sign-off (GST-3546) - #4717

Merged
capy-ai[bot] merged 5 commits into
mainfrom
one-grant-path-after-round-cap
Nov 22, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
one-grant-path-after-round-cap

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

After a pull request's two review rounds, an approved extra check of the fixes now ends in a /ship sign-off instead of a dead end.
Why: three projects (gbrain #10068, gskills #23–#25, gstack #4712) had no way to finish after a ruling at the round limit and skipped the sign-off or bent their records.
Nothing to do: the next /ship uses it.

What changed
  • One kind of approval. The review planner, gstack-ship-receipt claim and write now accept both ways of recording the approval for one more scoped check after the round limit.
  • A ruling at the limit can finish. The approval no longer needs a stop record, so an edit made after review (such as a docs-audit edit) can get one, and a clean scoped check closes the open blockers it was asked to read. A blocker nothing covers still refuses.
  • A malformed check no longer uses up the approval. A check row that didn't finish or doesn't match the diff is ignored, so the run can log a correct one. A check that found issues still uses it, so the approval buys one round of fixes, as before. gstack now builds the diff the checker reads, from the approved commit to HEAD.
  • Long reasons fit. A reason longer than the 300-character limit is shortened in the summary, with the full words kept.
  • Finished runs stop blocking upgrades. A /ship run that finished, was abandoned, or whose process is gone no longer holds gstack upgrades on that machine. A stopped run still holds them, since it may resume.
  • Docs: docs/review-policy.md#one-grant-path and docs/troubleshooting.md.
Tests

New test/round-cap-ruling-path.test.ts has 13 cases, one per reported failure plus the review findings. Run against main at 2ab2aad, all 9 original cases that can load there fail; the upgrade-hold cases need the new module. Each review fix added a case that fails on the code before it (3 of 3 after round 1, 3 of 3 after the extra check). Focused suites at the final code: 118 tests pass. CI's full free run at 2b11ffa passed.

Approvals

Approvals

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

Review notes

Below the blocking floor; recorded here and not fixed in this PR.

  • INFORMATIONAL lib/ship-run-record.ts:62 thisRunOwner now returns null when the ancestor walk reaches a wrapper process (a shell or similar) whose parent is init (ppid<=1). Before this change it returned that orphaned wrapper as the owner. With no owner, ownerGone cannot prove the run ended, so the run keeps holding gstack upgrades and aba
  • INFORMATIONAL sf-784e06c66d90 security finding, details recorded privately
  • INFORMATIONAL sf-d5ee1d766831 security finding, details recorded privately
  • INFORMATIONAL bin/gstack-approvals:255 (targeted reader): the add guard's spelling gap, fixed in the extra check by matching any review_loop_grant mention.
  • INFORMATIONAL test/round-cap-ruling-path.test.ts (second-model review): the add guard's refusal had no negative test; the extra check added the spellings.
  • INFORMATIONAL lib/ship-release.ts:308 (second-model review): after a spent grant, release's fix-check chain and receipt clearing can print different lines; the receipt still refuses.
  • INFORMATIONAL lib/ship-run-live.ts:37 (second-model review): a budget ledger rebuilt by resume --rebuild-from-record keeps holding upgrades until it closes or ages out (fails safe).
  • INFORMATIONAL lib/fix-check-clearing.ts:107 (targeted reader on the final head): a legacy review_loop_grant row that an older run already spent through gstack-review-plan --grant (which wrote no claim) could be claimed again by a later run; a follow-up should check grantSpent at claim for legacy rows.
Documentation

Status: updated. One factual fix, no blockers.

Scope: base 2ab2aad to head 06ccb4b (3 commits, 23 files; nothing staged, unstaged or new). The branch's own docs (review-policy.md #one-grant-path, troubleshooting.md, the changelog.d fragment) were checked against the code and are accurate.

Documentation health:

  • docs/review-policy.md: Current (the new one-grant-path section matches the code)
  • docs/troubleshooting.md: Current (UPGRADE_BUSY, STOP_UNBOUND, abandon, GRANT_SPENT and GRANT_UNKNOWN updated in the branch)
  • docs/ship-policy.md: Updated (#what-ends-a-run now says abandon takes a run at any age once its harness process is provably gone)

Coverage debt: gstack-ship-run live has reference-only coverage (its --help text and troubleshooting.md). No critical gaps. No diagram drift.

Agent notes

Lane GSTA-815 for GStack Minder (GSTA-36). Grant kinds unified in lib/review-round-grant.ts (legacy review_loop_grant <head> rows parse as fix-check grants with pr 0); clearByGrant answers a no-stop grant through this run's claim and reads only the first counted row (a counted read that found issues spends the grant); gstack-approvals add refuses a self-recorded review_loop_grant row inside an open /ship run unless it carries --owner-ref and --words; grantSpent counts only counted rows; claimedFixCheckHunks builds the fix-check packet; lib/ship-run-live.ts plus gstack-ship-run live replace the Capy installer's file-age-only open-run check; abandonRefusal skips the 60-minute wait when the owner is provably gone. After round 2 the second-model review found 4 blockers; GStack Minder granted one scoped fix-check (a-20e83bf68893) at 16518df, which came back clean at 06ccb4b.

{
  "schema_version": 1,
  "pr": 4717,
  "head": "2b11ffa2cf2dd7280dfe2b426da5f2a2d4d9b927",
  "version": "1.102.2.0",
  "base": "main",
  "ci_carried": [
    {
      "lane": "tests",
      "run": 45067623344,
      "attempt": 1,
      "tree": "c89529efee9d5c07eaca0fdc12faaf9a6bebc845"
    }
  ],
  "calls": 118,
  "session_kind": "unattended",
  "run": "ship-4717",
  "head_tree": "c89529efee9d5c07eaca0fdc12faaf9a6bebc845",
  "product_patch_id": "5004e27d7bdad0b35472a50a55750469613c2db3",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 409,
    "rules": "33831f8248a814fd",
    "base": "9d758432eb1b8d18041eb3caa3d7ddac4b62866a",
    "registry": "9d758432eb1b8d18041eb3caa3d7ddac4b62866a",
    "gate_scan": {
      "tagged": 0,
      "head": "2b11ffa2cf2dd7280dfe2b426da5f2a2d4d9b927"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "risk:auth",
      "runtime=409"
    ],
    "risk": [
      "money",
      "auth"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @c89529efee9d (8 checks, current for 2b11ffa2cf2d)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45067623344/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/45067623426/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=c89529efee9d tests=39204 skipped=76 runs=45067623344/1 profiles=ci-reuse/free-tests heads=2b11ffa2cf2d verified=2026-11-22T21:18:59.885Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md and changelog.d/ against base 2ab2aad7..06ccb4b"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 6,
    "deferred": 0,
    "noted": 7,
    "fixed": 9,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "16518df948a7e25c41d1db82e1dc7328205658f2",
      "pr": 4717,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "Captain ruling at the round cap: fix the four blockers Step 11 found in this PR's delta",
      "at": "2026-11-22T20:08:25.065Z",
      "approval": "a-20e83bf68893",
      "stop_run": "ship-4717",
      "findings": [
        "p2/outside-voice#1",
        "p2/outside-voice#2",
        "p2/outside-voice#3",
        "p2/adversarial-native#1"
      ]
    }
  ],
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money",
      "auth"
    ],
    "rules": "e01517eddd4b2350",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "5004e27d7bdad0b35472a50a55750469613c2db3",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  }
}
{"head":"16518df948a7e25c41d1db82e1dc7328205658f2","run":"ship-4717","mark":"stop","tree":"371d171353366f4f582481247fb9564d5419cfb0","at":"2026-11-22T20:07:33.523Z"}
{"head":"16518df948a7e25c41d1db82e1dc7328205658f2","run":"ship-4717","mark":"grant","grant":"a-20e83bf68893","at":"2026-11-22T20:08:40.967Z"}

Open in Capy

…ow leads to a /ship sign-off (GST-3546)

The review planner, claim and write accept both ways of recording the
approval, the approval no longer needs a stop record, a check row that
doesn't count no longer uses it up, gstack builds the diff the checker
reads, long reasons fit, and finished or dead /ship runs stop blocking
gstack upgrades.

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 19:41
Review-Finding: p1/specialist-batched#1 reader=security
Review-Finding: p1/specialist-batched#2 reader=state-machines
Review-Finding: p1/specialist-batched#3 reader=state-machines
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p2/outside-voice#1 reader=outside-voice
Review-Finding: p2/outside-voice#2 reader=outside-voice
Review-Finding: p2/outside-voice#3 reader=outside-voice
Review-Finding: p2/adversarial-native#1 reader=adversarial-native
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… at any age

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