Skip to content

review-plan: a granted fix round after the targeted read plans one targeted-only reader (GST-1607) - #4064

Merged
capy-ai[bot] merged 3 commits into
mainfrom
gst-1607-granted-targeted
Nov 6, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
gst-1607-granted-targeted

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

After the owner granted a fix round past the loop cap, that round's fix moved the product patch the targeted record names, so the receipt asked for a fresh targeted read (GST-986), while the plan printed done once the granted fix-check came back clean. Every granted round then needed another manual grant (harness-evals #271).

{
  "schema_version": 1,
  "pr": 4064,
  "head": "0263cc16fed0de5a765eb9b7dbbb2c09cec02e42",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 476,
      "fail": 0,
      "skip": 0
    },
    "parity": {
      "pass": 2,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "60121485e264b380a57df666df3d4e120014fd23",
  "product_patch_id": "fa46a7ea9d33ce8caf76cb0ab3c2f27b0359dda4",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 35,
    "rules": "70895942bb8a8ee2",
    "base": "937b360fedcd8f2c3f2483090e93628767ca99e2",
    "registry": "937b360fedcd8f2c3f2483090e93628767ca99e2",
    "gate_scan": {
      "tagged": 0,
      "head": "0263cc16fed0de5a765eb9b7dbbb2c09cec02e42"
    },
    "reasons": [
      "gate-class",
      "runtime=35"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @60121485e264 (7 checks, current for 0263cc16fed0)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42215967633/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42215967919/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=60121485e264 tests=35906 skipped=111 runs=42215967633/1 profiles=ci-reuse/free-tests heads=0263cc16fed0 verified=2026-11-06T12:19:17.573Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "AGENTS.md, CLAUDE.md, README.md, docs/, ship/sections/ (174 docs inventoried; diff-touched and grant/targeted-read docs read in full)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 1,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "unrecorded": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changes

  • The GST-1598 route takes the grant. When the loop is done and --grant passes the existing check (an approved review_loop_grant row naming a stop head inside range_base..HEAD), any change since the targeted read except plain docs plans NEXT: targeted: one targeted reader on the merge-base diff at HEAD for the head's targeted classes, with TARGETED_DELTA printed and the grant named in the reason. Without a grant a code change keeps done as before. A head with no targeted class adds no reader. The receipt is unchanged.
  • The Capy pass program runs a targeted manifest's voices stage. It activated voices only for fix-check manifests, so a NEXT: targeted pass driven through lib/capy-review-pass.js created no reader (a gap in review-plan: a docs claim added after the loop plans one targeted-only reader (GST-1598) #4062).
  • docs/review-policy.md and /ship Step 19 name the --grant for this case.

Tests

test/review-plan-granted-targeted.test.ts: the #271 shape dispatches one targeted reader under the grant and then plans done, and parseReviewTargeted refuses the pre-fix record and binds the one read at HEAD; a granted fix on a head with no targeted class adds no reader; the same change with no grant keeps done; a fabricated grant refuses. test/review-pass.test.ts: a targeted-only manifest run through the pass program creates the one targeted reader. The #271 case and the program case failed before the change.

What changed

review-policy: a granted fix round after the targeted read now plans one targeted-only reader instead of done (GST-1607)

review-policy: a granted fix round after the targeted read now plans one targeted-only reader instead of done (GST-1607).

Before/after as text: review-policy: a granted fix round after the targeted read now plans one targeted-only reader instead of done (GST-1607)
--- Before · docs/review-policy.md § Targeted-only read after the loop (GST-1598) at 937b360 · source text
+++ After · docs/review-policy.md § Targeted-only read after the loop (GST-1598) on this branch · source text
@@ ⋯ 24 unchanged ⋯ @@
 `targeted_patch_id` and the plan is `done`.
 
 Every other case stays `done` and prints `SKIP: targeted-only read
+(<reason>)`. That covers a code or binary change with no `--grant` (the granted
+case is below), which takes the review loop as before; plain docs, which the record carries; a range_base the
-(<reason>)`. That covers a code or binary change, which takes the review loop
-as before; plain docs, which the record carries; a range_base the
 `--targeted-ran` patch doesn't match; and uncommitted edits. `--force
 targeted` refuses (exit 2) and names these flags, because the targeted reader
 is no specialist (`lib/review-targeted-delta.ts`,
 `test/review-plan-targeted-delta.test.ts`).
+
+A fix round the owner granted past the cap has the same problem in code
+(harness-evals #271, GST-1607). The granted round's fix moves the product
+patch the targeted record names, so the receipt asks for a fresh read once
+the loop is done. With that grant passed as `--grant` (checked as above:
+an approved `review_loop_grant` row naming a stop head inside
+range_base..HEAD), any change since the read except plain docs plans the
+same `NEXT: targeted`, and the reason names the grant. A head with no
+targeted class adds no reader, and the same change with no grant keeps
+`done` (`test/review-plan-granted-targeted.test.ts`). The Capy pass program
+runs a targeted manifest's voices stage, so this one reader runs there too.
 
 <a id="review-exclude-paths"></a>

Why

On harness-evals #271 the owner granted a fix round past the review-loop cap, and that fix moved the product patch the targeted record names. The receipt then asked for a fresh targeted read, but the plan printed done, so every granted round needed a second manual grant. Now the same --grant makes the plan print NEXT: targeted and run one targeted reader on the head, and the Capy pass program actually runs that reader.

Blast radius

The change touches gstack-review-plan (the post-loop targeted route now also opens under --grant), targetedDelta in lib/review-targeted-delta.ts (a granted flag that skips the docs-only filter) and one condition in lib/capy-review-pass.js. It is safe because the new branch runs only when --grant has already passed the existing approval check, --range-base and --targeted-ran are both given and the loop already says done; without a grant every path behaves as on main. The plan's grant check returns before line 238 on a missing or fabricated grant (read at bin/gstack-review-plan:138-155, and probed on the branch binary: exit 2 without --range-base, exit 3 for a fabricated id), and test/review-plan-granted-targeted.test.ts covers the granted, no-grant, no-class and fabricated cases (476 tests ran green in the targeted lane).

Approvals

APPROVALS_RENDER: redacted (repository visibility public); gstack-approvals list shows the full record

No approvals recorded for branch gst-1607-granted-targeted.

Summary

After an owner-granted fix round, the targeted record went stale with no route to refresh it. This PR lets the existing NEXT: targeted route take the grant, names the grant in the plan's reason, and makes the Capy pass program run a targeted manifest's reader. This /ship run added two commits: 17179e7 adds the changelog.d fragment, and 0263cc1 is the docs audit's one-clause correction in docs/review-policy.md (the skip list now says "with no --grant"), read clean by a scoped reader.

Test Coverage

Coverage audit (Step 7, audit-only, at a6b6715): 7/7 changed behaviors have a ★★ or ★★★ test (★★★ 3, ★★ 4). GAPS: 0.
Tests: no tests added by this run (audit-only).
Coverage: 100% value-weighted (the preflight map counts 4 of 6 runtime files with no changed test naming them: docs/review-policy.md, lib/review-targeted-delta.ts and the two pr-body files; lib/review-targeted-delta.ts is exercised through the plan binary in test/review-plan-granted-targeted.test.ts).
Tests ran: targeted 476
Tests ran: parity 2
Tests ran: typecheck count unavailable

Pre-Landing Review

Pre-Landing Review: 5 issues (2 CRITICAL by the voices' labels, 3 informational) — 0 auto-fixed, 0 asked, 0 deferred, 5 noted
REVIEW_LOOP: passes=1 blocking_found=1 deferred=0 noted=1 fixed=0 scope=frozen unrecorded=1 ledgers_read=2 dispatches=4
Gate edits: none detected (3 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: openai/gpt-6.1-sol (host subagent, certified configuration) completed. It found one finding it marked Blocks: yes, the same defect the red team and native adversarial voice reported (first note below).
Review plan: full panel (gate class, full depth, runtime_lines=31). Pass 1 ran the batched specialist (testing, security, state-machines: no findings), the red team, the native adversarial voice and the outside voice. The repeat plan printed NEXT: done (no edits), so there was no pass 2. A scoped reader (anthropic/claude-sonnet-5-5) read the post-review docs-audit edit: clean.
The two CRITICAL labels come from the voices' rules (Blocks: yes, or FIXABLE from the native voice). This run kept them as notes on the crew's blocking floor ("would fail a test, break production, or lose data or secrets"): the first fails closed to main's behavior (NEXT: stop, then the owner), and the second is caught by /ship's own reviewed-tree route (lib/ship-release.ts:337 stops on any behavior change since review). unrecorded=1: Step 11 logs the voices' row without findings, so the outside voice's Blocks: yes finding has no review-log row; it is listed below.

Review notes

Below the blocking floor ("would fail a test, break production, or lose data or secrets"). These are notes, not fixed here:

  • bin/gstack-review-plan:238 (outside voice Blocks: yes Medium, red team, native adversarial Fix project-local /browse installs and harden setup #4; three sources): a granted fix round that edits a gate-class path still stops before the targeted reader. --range-base (the targeted-read commit) also builds the fix range, so touched_gate turns the loop to stop and targetedDelta never runs. Reproduced by the red team and the outside voice in scratch repos (NEXT: stop, fix_range.touched_gate: true, targeted_delta: null). It fails closed, the same as main, but gstack's own merge-check paths are gate class, so this route won't clear the fix: add --local flag for project-scoped gstack install #271 shape for them. A fix is a separate --targeted-read <sha> baseline (the same note was left on review-plan: a docs claim added after the loop plans one targeted-only reader (GST-1598) #4062).
  • lib/review-targeted-delta.ts:46 (native adversarial, Medium, FIXABLE): the grant lifts the docs-only filter for every path in range_base..HEAD, including a code commit made after the granted fix-check, so the plan would print NEXT: targeted for unreviewed code. /ship's finish route still stops on behavior changed since the reviewed tree. A fix is to apply granted only up to the granted fix-check head. No test covers a commit after the fix-check.
  • lib/capy-review-pass.js:149 (native adversarial, Low): a targeted-only read started by the default stage spends Step 9's plain review start token, not a targeted or fix-check one.
  • ship/sections/pr-body.md:231 (native adversarial, Low): "run that one reader (pass, its voices stage, ...)" can read as two calls now that the default stage runs the reader; a second voices-stage call on its own --out would dispatch a second targeted reader.
  • lib/review-targeted-delta.ts:46 (native adversarial, Low): under a grant, binary paths reach the targeted reader, which the no-grant path excludes.
  • Docs audit coverage debt: no tutorial or explanation page for the granted targeted-read flow.

Exploratory QA

Functional CLI smoke on the branch binary at a6b6715 (abbreviated: QA's method sections were not read this run). ./bin/gstack-review-plan --base main exited 0 with NEXT: full; --grant without --range-base exited 2 with its usage line; a fabricated --grant exited 3 and named the missing review_loop_grant row. The granted NEXT: targeted dispatch is covered by the test file, not by a live probe.

Design Review

No frontend files changed — design review skipped.

Eval Results

No PR-pass evals were selected. The selector at origin/main 937b360 chose no quality judges, and its 152 selected behaviors remain scheduled or release coverage, not PR passes. Evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: let an owner-granted fix round refresh the targeted read without a second grant (GST-1607, harness-evals #271).
Delivered: the granted NEXT: targeted route, the pass program's targeted voices stage, docs, tests, a changelog fragment and one docs-audit clause.

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 harness-evals#271

Verification Results

No plan-specific verification items (no plan bound): VERIFY_RESULT=skipped.

Remote pregate

CI_CARRY: accepted ci-carry tree=60121485e264 tests=35906 runs=42215967633/1 profiles=ci-reuse/free-tests heads=0263cc16fed0 verified=2026-11-06T12:19:17.573Z
PREGATE: verify ok on the stamped tree (requires-remote cleared: macos-named-regressions run 42215967633/1, windows-smoke run 42215967919/1, remote_gate carried from run 42215967633/1)

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual correction made; no blockers.

Scope: base 937b360..HEAD 17179e7 (10 committed files, nothing staged, unstaged or untracked), plus the 174 candidate docs inventoried; docs touched by the diff or naming the targeted-read/grant contract were read in full. Banned terms: none.

Documentation health

  • docs/review-policy.md: updated. A stale 'code change takes the review loop as before' clause now excludes the granted case.
  • ship/sections/pr-body.md and pr-body.md.tmpl: current. Both carry the --grant hint.
  • changelog.d/gst-1607-granted-targeted.md: current. Accurate against code.
  • docs/ship-policy.md and docs/troubleshooting.md: current. No stale claims.

Coverage debt: no tutorial or explanation page for the granted targeted-read flow. Reference and how-to coverage is in docs/review-policy.md and the PR-body step. No diagram drift. No regeneration required.

Test plan

  • targeted lane (14 review-plan, depth, dispatch, targeted, ship-driver and skill-contract test files): 476 tests ran, exit 0
  • bun test test/parity-suite.test.ts: 2 tests ran, exit 0
  • bun run typecheck: exit 0
  • CI at 0263cc1: 31 checks passed, 0 failed, 0 pending, 12 skipped (free-tests run 42215967633)

🤖 Generated with Claude Code

Open in Capy

…rgeted-only reader (GST-1607)

After the owner granted a fix round past the loop cap, the granted round's
fix moved the product patch the targeted record names, so the receipt asked
for a fresh targeted read while the plan printed done (harness-evals #271).
With that --grant (checked against the approval record as before), any
change since the read except plain docs now plans NEXT: targeted on the
GST-1598 route: one targeted reader on HEAD for the head classes. A head
with no targeted class adds no reader; no grant keeps done.

The Capy pass program now runs a targeted manifest's voices stage, so a
NEXT: targeted pass driven through it creates its reader (it activated
voices only for fix-check).

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.

garrytan and others added 2 commits November 6, 2026 12:03
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…list (docs audit)

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