Skip to content

v1.91.358.0 review: targeted read-only pass on money, gate, auth and secret code (GST-257 part 1, report-only) - #3671

Merged
capy-ai[bot] merged 6 commits into
mainfrom
gst-257-targeted-review
Oct 31, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
gst-257-targeted-review

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3671,
  "head": "ac43a4a979e690f9dca79046b6d27efc39d27234",
  "version": "1.91.354.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "c0dfcb488fd5220a4bbed07cd030a30ebeaa837a",
  "product_patch_id": "6c36d95612635917c167b3f87942d5bcb95941d7",
  "gstack_version": "1.91.353.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 443,
    "rules": "1ef4ba88e39e688c",
    "base": "a77fae2837695ffc3e7937bb8f3e9dc5eb337fc4",
    "registry": "a77fae2837695ffc3e7937bb8f3e9dc5eb337fc4",
    "gate_scan": {
      "tagged": 0,
      "head": "ac43a4a979e690f9dca79046b6d27efc39d27234"
    },
    "reasons": [
      "gate-class",
      "runtime=443>50"
    ]
  },
  "pregate": "requires-remote cleared @c0dfcb488fd5 (1 checks, current for ac43a4a979e6)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41178619240/job/124471460924",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41178619259",
    "pregate.json/remote_gate: remote-gate tree=c0dfcb488fd5 tests=19850"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/review-policy.md (targeted pass section, receipt row, gate-path list), changelog.d fragment, ship Step 11 line"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 1,
    "fixed": 6,
    "scope": "frozen",
    "est_input_tokens": 57293,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  }
}

What changed

ship Step 11 before and after

Step 11 now also runs the read-only targeted reader when the review plan prints DISPATCH: targeted (money, gate, auth or secret code), on the merge base every pass. verify --targeted-out feeds the receipt's review_targeted. No other reviewer brief changed: 13 of 13 render byte-identical to main (see Verification).

  • lib/review-targeted.ts (new) names the classes a diff touches from added and deleted lines: money, gate (the gate scan's tagged hunks), auth (SCOPE_AUTH on an auth path) and secret. It is token-bounded, skips docs and tests, and fails closed to all four classes.
  • gstack-review-plan prints TARGETED: classes=… rules=… brief=… targeted_patch_id=… and, on a class hit, DISPATCH: targeted targeted effort=full at every depth; --targeted-ran <id> skips it only for the same whole diff.
  • review/specialists/targeted.md (new) is the reader's brief: one block per class, the blocking floor, and the checklist's Forced-CRITICAL uncapped-spend rule.
  • gstack-review-dispatch render --role targeted / verify --targeted-out, and gstack-ship-receipt write --review-targeted store review_targeted; a carry keeps it.
  • gstack-ship-queue ready and train build print REVIEW_TARGETED: required=… receipt=… verdict=ok|missing. Nothing refuses on it in this PR.

Why

Review depth decides how many reviewers read a diff, but not whether anyone reads the money, gate, auth or secret code with that code in mind. GST-257 adds one read-only reader with a short brief for exactly those hunks. This is PR 1 of 2: it writes and reports the record so we can measure it; PR 2 makes the queue refuse READY receipts without it.

Blast radius

  • Every /ship run on a diff with a class hit gets one more full-effort read-only reader in Step 11 (37 of the last 100 non-release commits on main would have; money 21, gate 18, auth 3, secret 8, measured at 8663c3d..8be7f21).
  • Receipts gain an optional review_targeted field; receipts without it read legacy. Queue output gains one line. No exit code changes.
  • Existing reviewer briefs, depth rules and the depth table are unchanged; lib/review-depth.ts and ship/sections/adversarial.md are repinned in test/review-packets-removed.test.ts under the GST-257 replay.
  • gbrain: report-only, nothing to declare yet (note at handoffs/GSTA-160/gst257/gbrain-note.md).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Approve the plan "Plan: a targeted review pass on money, gate, auth and secret code (GST-257, GSTA-160)" (autoplan run run-20261031012536, 7 decisions) “Do it” (Garry Tan, relayed by agent:jam_01M630HP2SHT9KMT83TV15H18Z) approved the reviewed plan (sha256 92bb322c53ef), every recommendation taken; PR 1 of 2 (writer, report-only) none

Source: gstack-approvals record for gst-257-targeted-review (display only; not an approval citation).

Summary

Plan: GST-257 autoplan run-20261031012536 (approved, gate_rev 2). Writer half only.

Test Coverage

test/review-targeted.test.ts (15 tests): classes with deleted lines, token boundaries, docs/tests exclusions, fail-closed, the dispatch at light/standard/full, --targeted-ran (same diff, test-only gate fix, dirty tree), the production path render → sent → collect → judge → verify → write → summary → REVIEW_TARGETED (including a later commit and a dirty tree turning the record failed, and the merge-base guard), carry, and attribution. No-loss evidence: its dispatch-superset test runs gstack-review-plan on 18 fixture diffs and requires every reviewer main dispatched, unchanged, plus only the targeted reader. Coverage audit: 83% of changed paths (gaps: queue-line wiring in ready()/train, AUTH_PATH_PREFIXES now covered).

Pre-Landing Review

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=1 fixed=6 scope=frozen

Pre-Landing Review: full depth (gate class). Pass 1: batched specialist (testing, security, api-contract, state-machines), Red Team, coverage audit, core checklist. Pass 2 on the range: batched specialist, Red Team. Fix-check, then Step 11: native adversarial (Opus) and outside voice (GPT-6.1 Sol, a Capy subagent; the Codex CLI is not available here). What was fixed and what was noted is listed under Review notes. Two deviations: pass 2's two below-floor findings and the fix-check's two were fixed rather than only noted, because PR 2 depends on that record; and pass 2's Red Team got pass 1's findings, not pass 2's specialist output, so the two ran in parallel.

Gate edits: 5 listed, 3 read, 0 findings (the two repins in test/review-packets-removed.test.ts, justified by the dispatch-superset test and the brief identity check, and the role-list pin in test/ship-budget-chain.test.ts).

Review notes

Below the blocking floor today, because REVIEW_TARGETED only reports in this release. The review loop stopped at its cap (frozen scope, pass 3), so these are named here, not fixed. Items 1 to 6 must be fixed before PR 2 starts refusing on the line.

  1. lib/ship-receipt-depth.ts:132 (outside voice and native adversarial, both): an exported --targeted-out record carries no patch identity, so write --review-targeted @old.json binds a stale record to a later product patch. Fix: carry the read patch in the record and compare at write.
  2. ship/DRIVER.md.tmpl (adversarial, outside the diff): the driver's Step 11.5 verify call does not pass --targeted-out, so a record written later, after the VERSION, CHANGELOG and docs commits, reads failed.
  3. lib/review-brief.ts:124 (outside voice): render --role targeted honors --exclude, so the reader could skip the very file its record covers.
  4. lib/review-targeted.ts:87 (outside voice): a Git-quoted filename leaves the added/removed line maps keyed differently from paths, so line classes miss without failing closed.
  5. bin/gstack-review-dispatch:152 (adversarial): verify writes done even when VERIFY: dirty, and leaves an old --targeted-out file in place when the ledger has no targeted render.
  6. lib/review-targeted.ts:70,72 (adversarial): pass the ledger's diff base after --end-of-options, and report git older than 2.39 the way carry does (RECEIPT_GIT_TOO_OLD) instead of quietly returning none.
  7. bin/gstack-ship-receipt:214 (adversarial): reviewedProduct() now runs outside the try, so a throw there prints a stack trace instead of a usage exit.
  8. lib/ship-receipt-depth.ts:160 (adversarial): bindShippedReceipt now runs collectCommit and gstack-diff-scope for legacy receipts too, which adds latency per slot.
  9. Secret-class precision (adversarial): ${{ secrets.X }} in workflows and process.env[name] are not matched; a carry keeps review_targeted across test-only changes.

Fixed during review (with failing-first tests): the --targeted-ran none skip on test-only gate diffs; the skip key now hashes the whole diff, tests included (targeted_patch_id, no longer named like the receipt's product_patch_id); the record is done only while the committed diff it was rendered on is unchanged; the targeted render refuses any diff base but the merge base (pass 2+ would have read only the fix range), takes --base, and accepts an abbreviated sha; Step 11 says so; the role-list pin in test/ship-budget-chain.test.ts that the first remote pregate caught.

Verification Results

Documentation

Docs audit (Sonnet, read docs/ and the fragment): updated docs/review-policy.md (gate-path list now names lib/review-targeted.ts and review/specialists/targeted.md). Targeted-pass section, receipt row and dispatch roles were already current. Debt: no how-to or tutorial covers the targeted reader yet.

Test plan

  • bun test test/review-targeted.test.ts (15 pass)
  • Remote free tier: 19850 tests, 0 failed
  • macOS and Windows requires-remote lanes via PR CI (runs 41178619240, 41178619259)

garrytan and others added 4 commits October 31, 2026 06:43
… (GST-257 part 1, report-only)

lib/review-targeted.ts classifies a diff's added and deleted lines into
money, gate, auth and secret (token-bounded, docs and tests excluded,
fails closed to all four). gstack-review-plan prints TARGETED and
dispatches one read-only targeted reader at full effort when a class
hits; review/specialists/targeted.md is its brief. The receipt records
review_targeted bound to product_patch_id, a carry keeps it, and
gstack-ship-queue ready / train build print a report-only
REVIEW_TARGETED line that refuses nothing.

No-loss evidence: the dispatch-superset test in
test/review-targeted.test.ts runs gstack-review-plan on 18 fixture diffs
and requires every reviewer main dispatched at 8be7f21, unchanged, plus
only the targeted reader. Brief identity: gstack-review-dispatch render
on this tree and origin/main 2356792 gives 13 of 13 existing reviewer
briefs byte-identical (handoffs/GSTA-160/gst257-briefcmp/SUMMARY.txt).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… binds the diff it read, role list pin)

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

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… Step 11 says the merge base; docs gate-path list

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

trunk-io Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits October 31, 2026 06:56
@github-actions github-actions Bot changed the title review: targeted read-only pass on money, gate, auth and secret code (GST-257 part 1, report-only) v1.91.358.0 review: targeted read-only pass on money, gate, auth and secret code (GST-257 part 1, report-only) Oct 31, 2026
@capy-ai
capy-ai Bot merged commit 89f2033 into main Oct 31, 2026
62 checks passed
garrytan added a commit that referenced this pull request Oct 31, 2026
…he targeted reader with the voices

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