Skip to content

Let an owner ruling close findings on a full pass and a Step 11 voice, as the review policy says (GST-2273) - #4272

Closed
garrytan wants to merge 5 commits into
mainfrom
capy/ruling-closes-full-pass-and-voice-findings
Closed

garrytan wants to merge 5 commits into
mainfrom
capy/ruling-closes-full-pass-and-voice-findings

Conversation

@garrytan

@garrytan garrytan commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

An owner's ruling now closes a finding on a round-2 full pass and on a Step 11 voice, the way docs/review-policy.md already says it does, instead of only on an extra review round the owner granted. This unblocks three crew PRs (#4248, #4266, #4257) and harness-evals#361, which all stopped with the owner's ruling recorded but ignored.

Why

The docs promised that a loop at its round cap finishes with "an owner-ruled note … closed and listed", but only finish's fix-check chain read rulings. Crews parked PRs at the cap with the owner's ruling recorded and nothing to apply it.

Blast radius

Review-binding code: lib/review-evidence.ts, lib/ruled-notes.ts, lib/review-scope.ts, lib/ship-release.ts (fix-check chain), lib/approval-record.ts (read roots), bin/gstack-review-read, bin/gstack-review-scope. The binding rules from #4260 stay: a ruling outside the reviewed range closes nothing, the lane's own row fields rule nothing, gate findings are never ruled, and an edit after the bound head still needs review. What counts as blocking does not change. The negative controls in test/ship-ruled-full-pass.test.ts and test/ship-finish-ruled-notes.test.ts hold on both main and this branch (script ran).

Summary

  • Full-pass rows. gstack-review-read now applies each approved gstack-approvals rule row whose head lies inside the range the row reviewed (range_base..commit, or the row's own commit when it names no range_base). A round-2 full pass whose only blocker is ruled reads CURRENT, so Step 11.5 can bind it (Stop a merge check from passing a test that was weakened after review (GST-2204) #4248's shape).
  • Step 11 voice findings. gstack-review-scope summary counts a ruled blocker that no row records, such as a Step 11 voice's ledger-only finding, as noted instead of unrecorded (Let an owner's grant swap the second full review for one short recheck, and say which grant field to fix (GST-2244) #4266, Stop gstack-pr-wait, the land gate and the release cut from calling a head green while a check on it failed (GST-2252) #4257). It reads rulings only from the run's newest row. A ruling names a finding by fingerprint, or a ledger-only finding by <path:line>:<reviewer>.
  • Fixed findings on a fix-check. A finding the fix-check itself read as fixed or auto-fixed no longer holds the row open (harness-evals#361's real row). FIX_CHECK_OPEN now also names findings no ruling can close, such as a gate finding, instead of leaving only the generic nonconverged reason.
  • One-tree binding for stopped reads. A stopped read (an incomplete binding) is promoted by rulings only if it read one committed tree: the start capture now records its commit, and the row must end there. Rows logged before this change must end at a commit made before the read began. A read that saw the tree change and then change back no longer binds just because its first and last trees match.
  • Same rulings in every shell. Approval reads now include the mounted Capy Drive mirror even without GSTACK_CAPY=1, so finish, the receipt and gstack-approvals rulings see the same rulings; only GSTACK_CAPY=1 writes the mirror.

Test Coverage

Coverage: 12 of 16 paths (75%), 4 gaps, audit only (Step 7 reader; no tests were written in /ship).
Tests ran: free 37027 (CI carry, free-tests run 42749804240 at 36ce6ad)
Tests ran: targeted 148

Pre-Landing Review

Pass 1 found 7 informational findings plus 2 blocking findings from the outside voice (openai/gpt-6.1-sol). Both blockers were fixed in f925d32: bin/gstack-review-scope now takes rulings only from the run's newest row, and lib/review-scope.ts no longer matches a ruling by bare id. Pass 2, a full pass over the fix range, came back clean.
REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=9 fixed=2 scope=frozen ledgers_read=4 dispatches=8
Outside review: completed (openai/gpt-6.1-sol, host subagent).

Review notes

These are below the blocking floor (advisory, informational, test-gap or wording items). They're recorded here and not fixed in this PR.

  • INFORMATIONAL bin/gstack-review-scope:220 stop row selected without the via:ship and dedup rules summarizeReviewLoop uses; a standalone /review row can become the stop and drop the owner's rulings silently
  • INFORMATIONAL lib/review-scope.ts:489 path:line:reviewer ruling key is not run-unique; one ruling notes every ledger-only finding at that locus by that reviewer
  • INFORMATIONAL lib/ruled-notes.ts:68 lane-written range_base widens which rulings apply
  • INFORMATIONAL lib/review-scope.ts:485 summary over-closes ledger-only findings (bare id, combined set)
  • INFORMATIONAL lib/review-scope.ts:488 no gate exclusion for ledger-only ruled findings
  • INFORMATIONAL bin/gstack-review-read:29 review-read depends on the approval record and exits on a read error
  • INFORMATIONAL lib/ruled-notes.ts:52 legacy readOneTree fallback still admits A-B-A
  • INFORMATIONAL lib/ruled-notes.ts:69 extra git spawns per row
  • INFORMATIONAL lib/approval-record.ts:88 tests can read real Drive approval rows

Exploratory QA

Smoke at 8bbdd02, 2 probes, both passed: the bin/gstack-review-read CLI contract (exit 0, one config line, empty stderr) and bun test test/ship-ruled-full-pass.test.ts (10 pass, 0 fail).

Eval Results

No prompt-related files changed, so evals were skipped (eval:select lists 0 PR passes).

Scope Drift

Scope Check: CLEAN

Plan Completion

Plan: exempt bug fix (failing-first tests in this PR).

Issues

Refs #4271

Documentation

Status: current. The branch's documentation already matches the code, so no edits were needed.

Scope: base 46d5149 to head c512fb6 (3 commits, 13 committed files; nothing staged, unstaged or untracked). The doc changes are the new ruled-notes-any-row paragraph in docs/ship-policy.md and a cannot be ruled paragraph in docs/troubleshooting.md. I checked both against lib/ruled-notes.ts, lib/ship-release.ts, lib/approval-record.ts and lib/review-scope.ts.

Documentation health:

  • docs/ship-policy.md: Current (the new paragraph matches rulingsFor, readOneTree and the mirror read rules)
  • docs/troubleshooting.md: Current (matches the FIX_CHECK_OPEN … cannot be ruled output)
  • docs/review-policy.md: Current (the anchor the new paragraph links to exists, and the text doesn't contradict it)
  • changelog.d/capy-ruling-closes-full-pass-and-voice-findings.md: Current (read only)

Coverage debt: owner rulings on full passes and Step 11 voices have reference coverage in ship-policy.md and troubleshooting.md, but no how-to or tutorial. No diagrams drifted.

Test plan

  • bun run test (free lane): carried from CI, free-tests run 42749804240 at 36ce6ad, green
  • bun test test/ship-ruled-full-pass.test.ts test/ship-finish-ruled-notes.test.ts test/approval-record.test.ts test/review-loop-binding.test.ts test/review-notes-only-pass.test.ts test/review-scope-followups.test.ts test/review-scope-ledger-count.test.ts test/review-fix-range.test.ts (targeted lane): 148 pass, 0 fail
Agent notes
  • GST-2273 (lane GSTA-495). Built on 46d5149 (Let an owner's ruling clear new blockers that an extra review round found, so /ship can finish (GST-2251) #4260). The review is bound at f925d32 (tree b69a1db3881f). 36ce6ad is a clean merge of main (b1702ee, Fix ship-queue ready tests after the pre-merge check got stricter (GST-2282) #4271) under the Captain's rule-19 grant, so CI picks up the ship-queue ready test fix. No edits beyond the merge.
  • Failing-first: 5 of 10 cases in test/ship-ruled-full-pass.test.ts and 3 new cases in test/ship-finish-ruled-notes.test.ts fail with lib/ and bin/ reverted to main; the rest are negative controls that hold on both.
  • Known limit: an edit and revert in the worktree with no commit during a read is still invisible; only commits during the read are detected.
  • Windows: the new test file is excluded in scripts/lib/windows-curation.ts (never run on windows-latest).
  • Possible flake, unconfirmed: review-fix-range.test.ts › "its row is fix-range scoped… never CURRENT" hit a TypeError once at f925d32, then passed on rerun (6/6) and in finish (148/148).
  • Remote lanes cleared: free-tests.yml/macos-named-regressions (run 42749792104), windows-smoke.yml/windows-smoke (run 42749791966).
  • REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=9 fixed=2 scope=frozen ledgers_read=4 dispatches=8
  • Refs GST-2273
{
  "schema_version": 1,
  "pr": 4272,
  "head": "36ce6add6b70ebc2a1b4b436c325e5c3f7306083",
  "version": "1.99.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 37027,
      "fail": 0,
      "skip": 0
    },
    "targeted": {
      "pass": 148,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42749804240,
      "attempt": 1,
      "tree": "df0b48761751d53d2b1a988f3ce8e8c5b4eae55b"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "df0b48761751d53d2b1a988f3ce8e8c5b4eae55b",
  "product_patch_id": "6bb1b7d5ec09f08f8798762eee8c1204ee1452cc",
  "gstack_version": "1.99.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 152,
    "rules": "66e5174161eecc2c",
    "base": "b1702eea91c1ea3496d267de331e1b75aa86df9d",
    "registry": "b1702eea91c1ea3496d267de331e1b75aa86df9d",
    "gate_scan": {
      "tagged": 0,
      "head": "36ce6add6b70ebc2a1b4b436c325e5c3f7306083"
    },
    "reasons": [
      "gate-class",
      "runtime=152"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @df0b48761751 (8 checks, current for 36ce6add6b70)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42749792104/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42749791966/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=df0b48761751 tests=37027 skipped=89 runs=42749804240/1 profiles=ci-reuse/free-tests heads=36ce6add6b70 verified=2026-11-10T03:47:55.084Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4271
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/ and README.md (140 docs files) against base 46d51496..c512fb6; reviewed docs/ship-policy.md, docs/troubleshooting.md, docs/review-policy.md and the changelog.d fragment"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 9,
    "fixed": 2,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  }
}
{"head":"fa3e4a206d021c6a85740a66115a1b8a77e13b78","run":"ship4272b","status":"started","review_loop":{"passes":1,"blocking_found":1,"deferred":0,"noted":5,"fixed":0,"scope":"frozen","rounds":1,"unrecorded":1,"ledgers_read":2,"dispatches":{"specialist":3,"red-team":1}}}

Open in Capy

…, as the review policy says (GST-2273)

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

trunk-io Bot commented Nov 10, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

garrytan and others added 3 commits November 10, 2026 02:46
… never by a bare ledger id (GST-2273)

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>
…273)

Merges main (e9f38d6, with #4360). Resolving the conflicts with GST-2491's gate dispositions also fixes the three wrong closes from the cross-family audit of 36ce6ad: a fingerprint two findings share closes neither (ruledFinding, summary key counts), a ruling applies only at the commit the row read (not anywhere in range_base..commit), and the summary takes rulings only from a via:ship row.

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

capy-ai Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Superseded by #4435. A cross-family audit held this head because rulings could close more than the owner ruled. The rebuild at fa3e4a2 fixed those, but /ship's read-only review there found one more blocker: a gate finding held only in a dispatch ledger could be ruled. This PR was at its review-round cap, so the fix ships in #4435 with its own review. The branch stays in place.

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