Skip to content

fix: finish counts a post-review fix-check chain's first link; review-plan plans the next chained fix-check (GST-1676) - #4093

Merged
capy-ai[bot] merged 2 commits into
mainfrom
capy/gst-1676-fix-check-chain-link-1
Nov 6, 2026
Merged

capy-ai[bot] merged 2 commits into
mainfrom
capy/gst-1676-fix-check-chain-link-1

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4093,
  "head": "6af3b9ccccf4e0410a8d9b2d800eee664b4f98f8",
  "version": "1.97.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1618,
      "fail": 0,
      "skip": 6
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42284958359,
      "attempt": 1,
      "tree": "bd81514c1eed0de9fb244382c85cb47aabeddc24"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "bd81514c1eed0de9fb244382c85cb47aabeddc24",
  "product_patch_id": "254b3b937e5f8b73a52ff5937a93a0bea32b3f2d",
  "gstack_version": "1.97.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 59,
    "rules": "70895942bb8a8ee2",
    "base": "a7585d0e74db25e861a92263fcae7e73a2e4d4ad",
    "registry": "a7585d0e74db25e861a92263fcae7e73a2e4d4ad",
    "gate_scan": {
      "tagged": 0,
      "head": "6af3b9ccccf4e0410a8d9b2d800eee664b4f98f8"
    },
    "reasons": [
      "gate-class",
      "runtime=59"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @bd81514c1eed (8 checks, current for 6af3b9ccccf4)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42284958359/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42284943859/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=bd81514c1eed tests=36041 skipped=92 runs=42284958359/1 profiles=ci-reuse/free-tests heads=6af3b9ccccf4 verified=2026-11-06T20:14:42.842Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md (141 docs) against the branch diff a19130d..6af3b9c"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 5,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changed

finish on the founderstar#634 chain: before, link 1's grant at its own commit was rejected and the chain read as not counted; after, the two-link chain counts

finish on the founderstar#634 chain: before, link 1's grant at its own commit was rejected and the chain read as not counted; after, the two-link chain counts. Captured by running the new GST-1676 test in test/ship-finish-ruled-notes.test.ts against the merge base (a19130d) and against this branch.

Before/after as text: finish on the founderstar#634 chain: before, link 1's grant at its own commit was rejected and the chain read as not counted; after, the two-link chain counts
--- Before · before.txt · captured output
+++ After · after.txt · captured output
+(pass) finish counts a post-review fix-check chain whose grants name each link's own commit (GST-1676) > #634: two post-review links, each granted at its own commit, and finish counts the chain [11102.92ms]
+(pass) finish counts a post-review fix-check chain whose grants name each link's own commit (GST-1676) > only link 1's grant: it goes to the newer link, and link 1 is ungranted [6663.16ms]
+ 2 pass
+ 0 fail
-FIX_CHECK: not counted (no approved review_loop_grant names a stop head inside its range_base..commit; fix-check at ed3e6a061af5, link 1 of 2)
-(fail) finish counts a post-review fix-check chain whose grants name each link's own commit (GST-1676) > #634: two post-review links, each granted at its own commit, and finish counts the chain [5615.51ms]
-(pass) finish counts a post-review fix-check chain whose grants name each link's own commit (GST-1676) > only link 1's grant: it goes to the newer link, and link 1 is ungranted [5912.67ms]
- 1 pass
- 1 fail
 

Why

founderstar#634 hit FIX_CHECK: not counted (… link 1 of 2): in the post-review flow each granted fix-check's grant names the commit that fix-check reads, so link 1's grant sits at link 2's range_base, and finish refused it, which routed the whole chain as a behavior change. Now a link's grant may name its own commit, and gstack-review-plan --post-review --last fix-check plans the next chained fix-check for a new grant instead of a stop that asked for the grant and then ignored it.

Blast radius

The change touches finish's fix-check chain accounting (lib/ship-release.ts fixChecked), one new transition in lib/review-depth.ts nextStep and the --grant binding in bin/gstack-review-plan. Grants are still assigned newest link first and one link per grant, so a lone grant at the boundary covers only the newer link; the GST-1676 tests run both cases (script ran), and the new nextStep branch fires only when --post-review sets postReview, which the deterministic GST-967 and GST-972 grids never set (replay GST-1676, hashes unchanged).

Approvals

No approvals recorded for branch capy/gst-1676-fix-check-chain-link-1.

Summary

Post-review fix-check chains now count their first link, and the planner plans the next link when the owner grants it, so lanes no longer hand-render the chained dispatch. The review pass also brought the CLI's --range-base help and usage errors in line with the chained case, so they now name the last fix-check's commit.

Test Coverage

lib/review-depth.ts nextStep: postReview chained fix-check [★★★ review-depth.test.ts GST-1676], gate voices precedence [★★★], negatives [★★★], non-stop path [★★]
bin/gstack-review-plan: chained grant plans fix-check [★★★ review-plan-cli.test.ts GST-1676], last link's grant refused exit 3 [★★★], no grant/blocking stop [★★★], non-chained stop [★★], postReview passthrough [★★]
lib/ship-release.ts fixChecked: own-commit grant counts [★★★ ship-finish-ruled-notes.test.ts GST-1676], boundary grant once [★★★]
flow post-review chain [★★ piecewise]
COVERAGE 11/11 (100%), value 100%, GAPS 0

Tests: 1743 → 1743 (+0 new in this /ship run; the GST-1676 tests were written failing-first before it)
Coverage: 100% value-weighted (100% 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).
Tests ran: free 1618 (test files, carried from Free Tests run 42284958359)

Pre-Landing Review

Pre-Landing Review: 1 issue — 1 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 0 noted

  • [AUTO-FIXED] bin/gstack-review-plan: the --range-base help and both usage errors named only this pass's / round 2's PASS_HEAD, so a lane following the CLI text in the chained post-review case could pass a stale base → they now also name the last fix-check's commit (6af3b9c). Raised by the red-team reader.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=1 scope=frozen ledgers_read=5 fix_checks=1 dispatches=4

Gate edits: none detected (5 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Outside review: completed (openai/gpt-6.1-sol via host subagent): no actionable findings. Native adversarial (Step 11): 2 findings, Medium and Low, both Blocks: no, recorded below as review notes.

Review notes

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

  • INFORMATIONAL bin/gstack-review-plan:158 Chained post-review mode trusts the --range-base the lane passes; it never checks it against the newest review-fix-check row, so a stale base lets link 1's grant plan another fix-check (same defect class as p1/red-team#1, whose CLI-text cause was fixed in 6af3b9c). finish then refuses the chain or counts one union read; fails safe.
  • INFORMATIONAL lib/ship-release.ts:283 fixChecked assigns grants newest link first by most-descendant stop head; on a tie the reduce takes the later candidate, so with grant Gx naming C1 and C2 and Gy naming only C2 (Gy first), link 2 takes Gx and link 1 is left ungranted although a valid assignment exists. Fails safe: the chain routes as behavior, nothing is wrongly counted.

Exploratory QA

Functional surface, 4 smoke probes on the tree of 7b46da8 (report-only, evidence under the run's QA dir): the chained CLI plan test (pass), the finish chain tests (pass), a chained run with an unknown grant (exit 3 refusal, pass) and --grant without --range-base (exit 2, pass). Verdict: pass. Not run: an end-to-end /ship Step 16 chain in a fixture repo, and a stale --range-base with a recorded grant.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

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.

Issues

Refs p1/red-team#1

Verification Results

No plan verification items (no plan bound; bug fix with failing-first tests).

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs already describe the fix-check chain change for GST-1676, and this audit made no edits.

Scope: the committed diff from a19130d to HEAD on capy/gst-1676-fix-check-chain-link-1, covering bin/gstack-review-plan, lib/review-depth.ts, lib/ship-release.ts, their tests and fixtures, docs/ship-policy.md, docs/review-policy.md and one changelog.d fragment. The worktree had no staged, unstaged or untracked changes. I searched all authored .md and .tmpl files for the superseded grant rule.

Documentation health

File Status
docs/ship-policy.md Current: the fix-check chain section and the post-review --range-base guidance were updated in this branch
docs/review-policy.md Current: the new post-review chain-link prose and transitions row were added, and the chain wording near line 696 is still accurate
docs/troubleshooting.md Current: no reference to the changed rule
changelog.d/capy-gst-1676-fix-check-chain-link-1.md Current: matches the shipped behavior (reviewed, not edited)
bin/gstack-review-plan (--help) Current: the --range-base, --grant and --post-review help text was updated

Coverage debt: none found. The behavior is covered by test/review-depth.test.ts, test/review-plan-cli.test.ts and test/ship-finish-ruled-notes.test.ts.

Diagram drift: none. No diagrams cover this flow.

Test plan

  • bun run test (Free Tests, workflow_dispatch run 42284958359 at 6af3b9c, tree bd81514c1eed): green, carried (36041 tests, 1618 files)
  • bun --no-env-file test test/review-plan-cli.test.ts test/module-size-ratchet.test.ts: 31 pass, 0 fail
  • gstack-pregate --allow-repo-commands: requires-remote cleared (typecheck, module-size, conflict-markers guards passed)

🤖 Generated with Claude Code

Open in Capy

… plans the next chained fix-check (GST-1676)

Replay: GST-1676 (repins lib/review-depth.ts)
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.

Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai capy-ai Bot changed the title finish counts a post-review fix-check chain's first link; review-plan plans the next chained fix-check (GST-1676) fix: finish counts a post-review fix-check chain's first link; review-plan plans the next chained fix-check (GST-1676) Nov 6, 2026
@capy-ai
capy-ai Bot marked this pull request as ready for review November 6, 2026 20:17
@capy-ai
capy-ai Bot merged commit 688e3ab into main Nov 6, 2026
64 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