Skip to content

ship finish: FIX_CHECK names the grant that covers the fix-check (GST-1610) - #4070

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1610-fix-check-grant
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1610-fix-check-grant

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

finish's FIX_CHECK: reviewed line credited a counted fix-check to the first approved review_loop_grant whose stop head fell anywhere in the fix-check's range_base..commit. A run with two granted fix-checks puts both stop heads in that range. On gstack-evals#244 the line credited fc4 to a-ab110530e792, the earlier fix-check's grant, but fc4's own grant was a-eaa651ef9ed3. The fix-check itself was valid; only the trail pointer was wrong.

finish now names the grant whose stop head is newest in the range, the stop the fix-check answered. Whether a fix-check counts, and which paths it covers, are unchanged.

A test written failing-first in test/ship-finish-ruled-notes.test.ts records two grants at different stop heads and two fix-checks. Before the change the line named the first grant; it now names the second. docs/review-policy.md states the rule.

Fixes GST-1610.

Open in Capy

{
  "schema_version": 1,
  "pr": 4070,
  "head": "e30dde8c5c3a017851323760ed995e15ee6ae5c4",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1608,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42219274099,
      "attempt": 1,
      "tree": "5e261301df0e753765d4954ddd0e0ff6dca6537b"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "5e261301df0e753765d4954ddd0e0ff6dca6537b",
  "product_patch_id": "fd7caa92b18c90f4b2fe5b99c6528b7ddc2c4994",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 9,
    "rules": "70895942bb8a8ee2",
    "base": "37f81cf19d21e63f54286fdda0e9be3bd48e1bb6",
    "registry": "37f81cf19d21e63f54286fdda0e9be3bd48e1bb6",
    "gate_scan": {
      "tagged": 0,
      "head": "e30dde8c5c3a017851323760ed995e15ee6ae5c4"
    },
    "reasons": [
      "runtime=9"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "pass @5e261301df0e (7 checks, current for e30dde8c5c3a)",
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md against 37f81cf..e30dde8"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "est_input_tokens": 2358,
    "ledgers_read": 2,
    "dispatches": {
      "specialist-batched": 1
    }
  }
}

What changed

finish's FIX_CHECK: reviewed line now names the approved review_loop_grant whose stop head is newest (by git ancestry) inside the fix-check's range_base..commit, instead of the first approved grant naming any commit in that range. Whether the fix-check counts, and which paths it covers, are unchanged.

Image: none. There is no visible surface, and the change is one selection rule in route(), so this is the text version.

Text before/after

The fixture in test/ship-finish-ruled-notes.test.ts records grant A at the pass head (fix-check fc3), commits the fc3 fix, records grant B at the fc3 head (fix-check fc4), commits the fc4 fix and logs the fc4 fix-check.

Before (the failing-first run):

FIX_CHECK: reviewed src/x.ts,test/x.test.ts (fix-check at <fc4 head>, range from <pass head>, grant <A>)

After:

FIX_CHECK: reviewed src/x.ts,test/x.test.ts (fix-check at <fc4 head>, range from <pass head>, grant <B>)

Why

On gstack-evals#244 the FIX_CHECK line credited fix-check fc4 to a-ab110530e792, the earlier fix-check's grant, when fc4's own grant was a-eaa651ef9ed3. The fix-check was valid, but the trail pointed at the wrong owner approval. Now the line names the grant for the stop the fix-check answered.

Blast radius

The change only picks which grant id the FIX_CHECK: reviewed line prints. The not-counted reason still asks only whether a covering grant exists, so counting and covered paths are unchanged. I read that at lib/ship-release.ts:301-315, and the 10 cases in test/ship-finish-ruled-notes.test.ts (including the GST-1537 single-grant cases) passed at this head. Nothing else reads the grant variable.

Approvals

No approvals recorded for branch capy/gst-1610-fix-check-grant.

Summary

When a branch had two granted fix-checks, finish credited the later one to the earlier grant, because it took the first approved grant whose stop head fell anywhere in the range. finish now takes the grant whose stop head is newest in the range. A failing-first test covers two grants at different stop heads, and docs/review-policy.md states the rule in one sentence.

Test Coverage

The Step 7 audit ran audit-only, because the PR already carries its failing-first test and the unattended run edits code only in review fix rounds.

[+] lib/ship-release.ts route() grant selection
  ├── [★★★ TESTED] newest stop among several grants — test/ship-finish-ruled-notes.test.ts:183
  ├── [★★ TESTED] single grant — :69, :84 (GST-1537)
  ├── [★★ TESTED] no fix row — existing finish cases
  ├── [GAP] one grant naming in-range and out-of-range SHAs
  └── [GAP] non-approved rows next to an approved one (proposed: a pending-grant row in the GST-1610 describe)
[+] docs/review-policy.md prose only
USER FLOW: [★★★ TESTED] finish FIX_CHECK names the covering grant — :183

Tests: 1733 → 1733 (+0 new)
Coverage: 67% value-weighted (67% including 0 weakly covered paths)
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered (weak = ★, gate-failing or unrated).
Regression proof — fails at HEAD: manual (the PR's failing-first run named the first grant) · passes at base: unavailable (audit-only) · passes after fix: yes
Tests ran: free 1608 (files), carried from CI run 42219274099/1 (35,913 tests at tree 5e261301df0e)

Pre-Landing Review

Review plan: class code at light depth (runtime_lines 9), 2 dispatches: one batched specialist (testing, security, state-machines, red-team checklists) and the native adversarial pass. The outside voice was skipped by the plan (code class, no numeric claims).

Pre-Landing Review: No issues found.

Step 11 native adversarial: 4 findings, all Severity Low and Blocks: no. They are below the blocking floor and are listed as review notes below.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=1 est_input_tokens=2358

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)

Outside review: skipped (review plan: code class, no numeric claims); the Codex CLI is not installed on this machine.

Review notes

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

  • INFORMATIONAL lib/ship-release.ts:300 Newest-stop pick is record-order dependent when stop heads are incomparable across a merge in the fix-check range; only the grant id on the FIX_CHECK line can differ, counting is unchanged. Lane branches are linear (no merges of main), so the case does not arise on this workflow.
  • INFORMATIONAL lib/ship-release.ts:300 Two approved grants naming the same stop head: the later row now wins (is-ancestor X X is true) where find() named the first; attribution only, counting unchanged.
  • INFORMATIONAL lib/ship-release.ts:299 Every 7-40 char hex token in a grant's ask/scope is a candidate stop head (pre-existing regex); newest-in-range across grants raises the chance a stray in-range hash outranks the real stop. Attribution only; an explicit stop= field would remove the guess.
  • INFORMATIONAL lib/ship-release.ts:299 finish now runs rev-parse plus is-ancestor for every hash in every approved grant instead of stopping at the first covering one; negligible at current record sizes.

Exploratory QA

Target: finish's FIX_CHECK grant choice in lib/ship-release.ts route() (functional surface, CLI through the real bins in an owned fixture). Smoke budget 300 s / 12 probes; 2 captures used. Writes limited to this probe directory and the fixture's own temp root. Report template not read (concise report; fields below).

  • checkpoint 002 (exploration-002.json, kept in the run directory)
  • 001 pass: bun test test/ship-finish-ruled-notes.test.ts, 10 pass 0 fail, exit 0 (the new GST-1610 two-grant case and the GST-1537 single-grant cases).
  • 002 pass: grants recorded in reverse ancestry order (later stop first, earlier stop last); finish named the later-stop grant (names_later_stop_grant=true, names_earlier_stop_grant=false) at the fix-check head.

Verdict from gstack-qa-evidence materialize: pass (open: none).

Limits: forked (non-comparable) stop heads not probed (a linear branch cannot produce them without a merge); a grant whose text names both an in-range and an out-of-range sha not probed end to end.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: the FIX_CHECK line names the grant that covered the fix-check when several grants fall in its range (GST-1610).
Delivered: the same, plus a failing-first test, one docs sentence and a changelog fragment.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Verification Results

No plan-specific verification items (no plan is bound). Automatic QA: 2 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No documentation edits were needed.

Scope: 37f81cf..e30dde8 on capy/gst-1610-fix-check-grant: 4 committed files, with nothing staged, unstaged or new. The audit searched the authored docs and templates for the FIX_CHECK grant contract.

Documentation health

  • docs/review-policy.md: current. The branch already documents that the FIX_CHECK line names the grant whose stop head is newest in the range (GST-1610).
  • changelog.d/capy-gst-1610-fix-check-grant.md: current. The fragment matches the change.
  • ship/sections/review-army.md.tmpl: current. It does not describe which grant is named.

Coverage debt: none. The changed behavior is internal finish routing and already has reference coverage in review-policy.md. Diagram drift: none.

Test plan

  • free=bun run test: carried from CI run 42219274099/1, 1608 files (35,913 tests) at tree 5e261301df0e, exit 0
  • bun test test/ship-finish-ruled-notes.test.ts: 10 pass, 0 fail (QA capture 001)

🤖 Generated with Claude Code

garrytan and others added 4 commits November 6, 2026 12:38
…s at different heads (GST-1610)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…x-check range (GST-1610)

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

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot marked this pull request as ready for review November 6, 2026 12:59
@capy-ai
capy-ai Bot merged commit 673a336 into main Nov 6, 2026
43 checks passed
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