Skip to content

Let an owner ruling close only the finding and head it names, on full passes and Step 11 findings (GST-2273) - #4435

Closed
garrytan wants to merge 9 commits into
mainfrom
capy/owner-rulings-close-only-what-they-name-gst-2273
Closed

garrytan wants to merge 9 commits into
mainfrom
capy/owner-rulings-close-only-what-they-name-gst-2273

Conversation

@garrytan

@garrytan garrytan commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

An owner's ruling now closes a finding on a round-2 full pass and on a cross-model (Step 11) finding, as docs/review-policy.md already promises, and it closes only the finding and the head the owner named. This supersedes #4272, which a cross-family audit held because rulings there could close more than the owner ruled.

Why

Before this change, only the narrow re-check after a fix read the owner's rulings. Crews parked #4248, #4266, #4257 and harness-evals#361 at the round cap with the owner's ruling recorded and nothing applying it. #4272 added that, but the audit of its head 36ce6ad (handoffs/GSTA-495/sol-audit-36ce6ad.md in the Captain's drive) showed three wrong closes. /ship's read-only review of the rebuilt head fa3e4a2 then found a fourth: a gate finding that only a dispatch ledger holds could be ruled. #4272 was at its review-round cap, so the fix ships here as a fresh PR with its own review.

Summary

  • Full passes and Step 11 findings. gstack-review-read applies each approved gstack-approvals rule made at the commit a review row read, so a round-2 full pass whose only blocker is ruled reads CURRENT. gstack-review-scope summary counts a ruled finding that no row records as noted instead of unrecorded.
  • Only the head the owner ruled. A ruling at an earlier head closes nothing on a later row, even when that head lies inside the row's range.
  • Only the finding the owner named. When two findings share a fingerprint (one line, one reviewer), a ruling by that fingerprint closes neither, so the owner rules each by its ledger id. A bare ledger id that repeats in every pass closes nothing.
  • Only /ship rows. The summary takes rulings from the run's newest via:ship review row. A manual review row logged later can't choose them.
  • Gate findings are never ruled. This now includes a gate finding only a dispatch ledger holds: ledgerBlockers carries gate and gate_id from the reader's line.
  • Other behavior from Let an owner ruling close findings on a full pass and a Step 11 voice, as the review policy says (GST-2273) #4272. On a fix-check, a finding the fix-check itself read as fixed no longer holds the row open. A stopped read is promoted only when it read one committed tree. Rulings read the same with or without GSTACK_CAPY=1.
  • Merged with main's gate dispositions (GST-2491). A gate finding still closes only by the owner's gate disposition row.

Blast radius

Review-binding code only: lib/review-evidence.ts, lib/ruled-notes.ts, lib/review-scope.ts, lib/review-ledger.ts, lib/ship-release.ts, lib/approval-record.ts, bin/gstack-review-read and bin/gstack-review-scope. What counts as blocking doesn't change, and every ruling still needs an approved owner row. test/ship-ruled-full-pass.test.ts holds the negative controls. Its five audit cases fail at #4272's 36ce6ad and pass here (script ran).

Supersedes #4272. Refs GST-2273.

Test Coverage

Coverage audit only (no tests written in /ship): every changed code file has a changed or referencing test; the five audit cases in test/ship-ruled-full-pass.test.ts fail at #4272's 36ce6ad and pass here.
Tests ran: free 37396 (from CI, free-tests run 44082060540 at e34f9b5)

Pre-Landing Review

Pass 1 (specialist, Red Team, second-model review by openai/gpt-6.1-sol) found 3 findings, all fixed in 1a51796: reviews keep reading when rulings can't be read, and the fix-check refusal names a finding the owner can actually rule (its ledger id when two share a fingerprint). Pass 2, a full pass over the fix, came back clean.
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=1 fixed=3 scope=frozen ledgers_read=4 dispatches=8
Second-model review: completed (openai/gpt-6.1-sol).

Review notes

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

  • INFORMATIONAL lib/ruled-notes.ts:58 a stopped read logged before reads captured their start commit now binds only when its commit is from an earlier second than the read's start; nothing tests that boundary.

Eval Results

No prompt-related files changed, so evals were skipped.

Plan Completion

Plan: exempt: bug fix

Issues

Refs #4271
Refs #4272
Refs #4360
Refs p1/red-team#1
Refs p1/specialist-batched#1
Refs p1/specialist-batched#2
Refs p1v/outside-voice#1

Documentation

Status: updated. One factual fix, no blockers.

Scope: base e9f38d6 to head 84261bf, 8 commits and 14 files (owner rulings close findings on full passes and Step 11 voices, GST-2273). No staged, unstaged or new files. Docs the diff touches were checked against lib/ruled-notes.ts, lib/review-evidence.ts, lib/review-scope.ts, lib/review-ledger.ts, lib/approval-record.ts, lib/ship-release.ts, bin/gstack-review-read and bin/gstack-review-scope.

Documentation health:

  • docs/ship-policy.md: Current. The new section #ruled-notes-any-row matches the code, and its link to review-policy.md resolves.
  • docs/troubleshooting.md: Updated. The #fix-check-open text now says FIX_CHECK_OPEN lists each finding's ledger id when two findings share a fingerprint, not only fingerprints.
  • docs/review-policy.md: Current. It already promised that a ruling closes findings on a full pass.
  • changelog.d/capy-owner-rulings-close-only-what-they-name-gst-2273.md: Current. Read only, not edited.

Coverage debt: gstack-review-read and gstack-review-scope summary now apply rulings: reference coverage is in ship-policy.md, how-to coverage is in troubleshooting.md, and no tutorial is needed. The new error text (rulings unreadable, none applied) has no troubleshooting entry. That is a minor gap.

Diagram drift: none. No diagrams cover these modules.

Test plan

  • bun run test (free lane): from CI, free-tests run 44082060540 at e34f9b5, green
  • bun test test/ship-ruled-full-pass.test.ts and the adjacent review-ledger, review-scope and ship-review-loop files: 106 pass, 0 fail at 914dc16
Agent notes

Approvals

No approvals recorded for branch capy/owner-rulings-close-only-what-they-name-gst-2273.
Plan: exempt: bug fix

{
  "schema_version": 1,
  "pr": 4435,
  "head": "e34f9b502a3702e7a84a1bebc207ab340d9513ce",
  "version": "1.99.5.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 37396,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44082060540,
      "attempt": 1,
      "tree": "f97c7c8bf443b0aba30a4a1dda545227ba1766dc"
    }
  ],
  "session_kind": "unattended",
  "run": "ship4435",
  "head_tree": "f97c7c8bf443b0aba30a4a1dda545227ba1766dc",
  "product_patch_id": "4da1970b31c9ea2213bef46d37b729c20e9584ea",
  "gstack_version": "1.99.5.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 185,
    "rules": "66e5174161eecc2c",
    "base": "2af3822f94a7889096b3b2c9878fee16feb9ab25",
    "registry": "2af3822f94a7889096b3b2c9878fee16feb9ab25",
    "gate_scan": {
      "tagged": 0,
      "head": "e34f9b502a3702e7a84a1bebc207ab340d9513ce"
    },
    "reasons": [
      "gate-class",
      "risk:money",
      "runtime=185"
    ],
    "risk": [
      "money"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @f97c7c8bf443 (8 checks, current for e34f9b502a37)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44082060540/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44063357664/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=f97c7c8bf443 tests=37396 skipped=89 runs=44082060540/1 profiles=ci-reuse/free-tests heads=e34f9b502a37 verified=2026-11-17T12:47:49.572Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4271,
      4272,
      4360
    ],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ and README.md (base e9f38d6f to the head; docs/ship-policy.md, docs/troubleshooting.md, docs/review-policy.md checked against the changed code)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 3,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 4,
    "dispatches": {
      "specialist": 6,
      "red-team": 2
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "money"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "4da1970b31c9ea2213bef46d37b729c20e9584ea",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

garrytan and others added 6 commits November 10, 2026 02:12
…, as the review policy says (GST-2273)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… 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>
…ulings (GST-2273)

ledgerBlockers now carries gate and gate_id from the reader's line (its JSON gate field, or an RH tag it names), and the review-loop summary never counts a ledger-only gate finding as noted. Found by the read-only /ship review of #4272 at fa3e4a2 (outside voice and Red Team).

Review-Finding: p1v/outside-voice#1
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

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 17, 2026 10:03
… a finding the owner can actually rule (GST-2273)

gstack-review-read and gstack-review-scope summary warn and apply no rulings when the approvals store can't be read, instead of crashing. FIX_CHECK_OPEN names each held finding by a key only it uses on the row, so two findings that share a fingerprint are named by their ledger ids. A legacy stopped read with no start commit binds only when its commit is from an earlier second than the read's start.

Review-Finding: p1/specialist-batched#1 reader=testing
Review-Finding: p1/specialist-batched#2 reader=state-machines
Review-Finding: p1/red-team#1 reader=red-team
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>
…two share a fingerprint (GST-2273)

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 #4446, which rebuilds this change off main with a narrower design: an owner's ruling closes only the one finding it names by ledger id, at the head it names. The three wrong closes the second-model audit found on this PR's head are tests there. This branch is kept.

@capy-ai capy-ai Bot closed this Nov 17, 2026
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