Skip to content

Keep deferred review findings on the PR instead of filing issues - #4208

Merged
capy-ai[bot] merged 4 commits into
mainfrom
keep-deferred-findings-on-the-pr
Nov 9, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
keep-deferred-findings-on-the-pr

Conversation

@garrytan

@garrytan garrytan commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

/ship and the crew docs stop filing deferred review findings as GitHub issues. A blocking finding in code a PR did not change now stays on that PR, in the body's ## Deferred findings section, so the issue tracker only holds follow-up work someone owns.

What changed

Step 9.4 no longer files an issue for a deferred finding; it stays on the PR

Step 9.4 no longer files an issue for a deferred finding; it stays on the PR.

Before/after as text: Step 9.4 no longer files an issue for a deferred finding; it stays on the PR
--- Before · ship/sections/review-army.md.tmpl § Step 9.4: Fix-First and persistence at 350d419 · source text
+++ After · ship/sections/review-army.md.tmpl § Step 9.4: Fix-First and persistence on this branch · source text
@@ ⋯ 61 unchanged ⋯ @@
    copied from the hunk, a test name or a commit message.
 
 3.5. **Defer and note the rest.** Run
+   `~/.claude/skills/gstack/bin/gstack-review-scope defer --findings <classified> --out <deferred.json>`.
+   It prints a `DEFERRED:` line per `scope: defer` finding and files no issue: a
+   deferred finding stays on this PR, and you never file one as an issue either.
-   `~/.claude/skills/gstack/bin/gstack-review-scope defer --findings <classified> --pr <pr-number> --out <deferred.json>`
-   (omit `--pr` before a PR exists). It files one issue per `scope: defer` finding,
-   reusing an open issue that carries the finding's marker, scanning the issue text
-   as the PR body is scanned, and prints `DEFERRED:` lines; `unfiled (<reason>)`
-   keeps the finding deferred when gh cannot file it or the scan refuses the text,
-   and the command still exits 0: the PR body carries the reason.
    Then `gstack-review-scope render --deferred <deferred.json> --findings <classified>`
    prints the `## Deferred findings` and `## Review notes` sections: save them for
    Step 19's PR body. Deferred and noted findings are never edited.
@@ ⋯ 1 unchanged ⋯ @@
    queued adversarial finding after this pass's items 5–6 were logged, append one
    row under its own skill (a tokenless `review` row would read UNVERIFIED):
    `~/.claude/skills/gstack/bin/gstack-review-log '{"skill":"review-late-defer","via":"ship","timestamp":"TIMESTAMP","status":"issues_found","issues_found":0,"critical":0,"informational":0,"pass":PASS,"review_scope":"SCOPE","findings":FINDINGS_JSON}'`
+   with `findings` holding only the deferred records (`action: "deferred"`,
-   with `findings` holding only the deferred records (`action: "deferred"`, `issue`,
    `locus`, `kind`, `blocking`, `ledger_id` as in item 6) and no `--finish` token. Log it in the
    program that decides the defer, with that moment's full ISO 8601 TIMESTAMP, never at Step 19.
 
@@ ⋯ 45 unchanged ⋯ @@
 - `findings`: checklist, specialist, exploratory QA and queued Steps 10–11 records with
   `{"fingerprint":"path:line:category","severity":"CRITICAL|INFORMATIONAL","action":"ACTION"}`.
   ACTION: `"auto-fixed"`, `"fixed"` (approved), `"skipped"` (explicit Skip),
+  `"deferred"` or `"noted"`. Copy
-  `"deferred"` (with `issue`, the filed number or `null`) or `"noted"`. Copy
   `locus`, `kind`, `blocking`, `raised_by` and `ledger_id` from the classified output onto every finding.
   Merge revalidated invocation decisions by identity and advisory/defect kind;
   preserve `advisory`, `evidence_paths` and `helper_target`.
  • gstack-review-scope defer files no issue. It used to run gh issue create once per scope: defer finding, with a marker search to reuse an open issue. It now only records the finding for the PR body and never calls gh. The --pr, --repo, --branch and --dry-run options are gone, and a deferred record no longer carries issue, url or reason. The severity the reviewer stated (Severity:, Blocks:) still shows next to the collected label, now on the PR-body line.
  • The PR-body section says so. ## Deferred findings now reads "They stay on this PR and are not filed as issues", and each line is - Deferred: <severity> \` ` with no issue number or "unfiled" reason.
  • Every instruction that told an agent to file one now says the opposite (inventory below).

Why

Garry's issue audit on 2026-11-09 closed 207 issues, and 59 of them came from gstack threads, most of them deferred review findings filed as Backlog issues nobody picked up. Deferred review and /ship findings now stay on the PR that found them, and real follow-up work gets one issue with a named owner.

Blast radius

The change touches gstack-review-scope defer and render, /ship Step 9.4, and the policy and crew docs that describe them; no other caller runs defer with the removed options, which the new prose guard and the ten files it scans confirm (test/review-scope.test.ts, script ran in CI run 42603965815). Reviewer brief bodies cut from ship/sections/review-army.md are byte-identical to their pins, so reviewer behavior does not change (brief-body pin test, script ran).

Summary

Deferred findings were turning into a pile of Backlog issues with no owner, because /ship filed one per deferred blocking finding through code, not just prose. This PR removes the filing path from gstack-review-scope defer, keeps the reviewer's stated severity on the PR-body line, and rewrites every instruction that told an agent to file such an issue. It also repins ship/sections/review-army.md under a brief-identity no-loss check and adds failing-first tests for the new behavior.

Inventory (line numbers at main 350d419)

Changed:

Place What it said Now
bin/gstack-review-scope:13, :43, :114, :228 defer files one GitHub issue per deferred finding through gh records it for the PR; no gh call
lib/review-scope.ts:9, :237, :256, :285 deferred findings "filed as issues"; issue title and body renderer stay on the PR; renderer removed
ship/sections/review-army.md.tmpl:159, :171, :223 (Step 9.4 item 3.5 and the review-log records) "It files one issue per scope: defer finding"; records carry issue files no issue, and the agent never files one either; no issue field
docs/review-policy.md:81, :691, :806, :810, :938 defer files it as a GitHub issue; "deferred issues pile up" kept on the PR under ## Deferred findings; deferred findings never become issues
docs/ship-policy.md:75, :1624, :1730 frozen files blocking findings in unchanged code as issues lists them as deferred in the PR body
docs/unattended.md deferred findings filed as issues deferred findings stay on the PR
lib/ship-policy.ts:38, :758 (show-effective text) defers unchanged code "to issues" "to the PR body"
captain/templates/READY.md:42 deferred: <items filed as issues, or none> deferred: <findings kept on the PR, or none>
crew/docs/captain.md:221 (Keep issues tidy), :641 nothing on deferred findings; "a tool fix filed as an issue" new bullet: deferred findings never become issues, stay on the PR and close when it merges, and real follow-up gets one issue with a named owner; "a tool fix as one issue with an owner"
capy/skill/gstack/factory.md:7, :8 "the rest goes in the PR body or next wave"; "Fold deferred findings and test follow-ups into one PR" "deferred findings stay on the PR and never become issues"; "Follow-ups get one issue with an owner and one PR"

Checked and left alone: ship/sections/tests.md:346 (pre-existing test failure triage assigns one issue to whoever broke the test, so it already has a named owner); ship/SKILL.md.tmpl:322-328 and ship/DRIVER.md Step 14 (TODOS.md entries, not issues); docs/captain.md, capy/skill/gstack/captain.md, the captain templates, captain/SKILL.md.tmpl and every review/ file (none tells an agent to file a finding as an issue).

Size and pins: capy/skill/gstack/factory.md is 3,465 bytes (cap 3,475; it was 3,455). The ship size ledger records -304 bytes for ship/sections/review-army.md, whose whole-file pin moves under the brief-identity no-loss check (replay GST-2073), as GST-986 and GST-1346 did.

Test Coverage

Coverage: deterministic (each of 10 changed runtime files has a changed test naming it; no audit reader).

  • New in test/review-scope.test.ts: defer with a logging gh stand-in on PATH never calls it and writes records with no issue fields; the rendered section says no issue was filed and has no #N or "unfiled"; deferredRecord keeps the reviewer's stated severity and flattens injected newlines; a prose guard over the ten files above finds no instruction to file a deferred finding as an issue and requires the rule in factory.md and crew/docs/captain.md. All three failed on main 350d419 before the fix.
  • Removed with the behavior: the gh issue-filing, marker-reuse, truncated-search, publication-scan and gh repo view tests. The PR body already goes through the publication scan, which is where the deferred text now lands.
  • Updated: test/review-loop-budget-wording.test.ts asserted the removed "the PR body carries the reason" clause and now asserts the replacement; the frozen-scope fixture and its free test stop expecting --dry-run, "unfiled (dry run)" and issue: null.

Tests ran: free 1652 (files; carried from CI run 42603965815/1 at tree dc285ed032e5, 36,762 tests)

Pre-Landing Review

No blocking issues found. One /ship pass at 7833603 (gate class, full depth, frozen scope): 3 specialists (testing, security, state-machines) with 0 findings, the targeted gate reader with 0 findings, the adversarial native voice with 4 findings below the blocking floor (noted, listed under Review notes), and the outside voice (openai/gpt-6.1-sol, certified configuration) completed with 0 findings. No fix round ran.

Gate edits: no gate finding is open. gstack-gate-diff for 350d419+dc285ed032e5: listed=14 eligible=12 inspected=12 unread=0 tagged={RH-1:2}. The two tagged hunks are the review-army.md pin moving to replay GST-2073 (the brief-identity no-loss check above) and the frozen-scope fixture actor's declared defer interaction, which follows the removed --dry-run option.

Outside review: completed (openai/gpt-6.1-sol), 0 findings.

Review notes

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

  • Medium bin/gstack-review-scope:157 defer --out rewrites .gstack/tmp/review-deferred.json each pass, so a later pass or a Step 11 late defer can leave the PR body's Deferred findings section partial; the review log rows still keep every deferred record
  • Low crew/docs/captain.md:222 a deferred blocking finding has no tracked owner once the PR merges; this is the owner's R85 rule (deferred findings stay on the PR), recorded as a note
  • Low lib/review-scope.ts:266 reviewer summary text in the Deferred findings and Review notes sections is not stripped of closing keywords before #N (predates this diff); the --help line still says references
  • Low bin/gstack-review-scope:171 render drops the issue and url fields of a deferred.json written by the previous binary, which matters only for a /ship run that spans the upgrade

Exploratory QA

No exploratory QA charter ran in this /ship: the change has no user interface, and the defer behavior is exercised by test/review-scope.test.ts with a logging gh stand-in.

Design Review

No frontend files changed — design review skipped.

Eval Results

No paid evals ran in this /ship. The only prompt change is the lead's Step 9.4 text; every reviewer brief cut from ship/sections/review-army.md is byte-identical to its pinned body.

Review bot comments

No review bot comments.

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

Pregate on the stamped tree: verify ok (typecheck, skill-size, parity-suite, context-budget, module-size, goldens and conflict-markers guards passed). Remote obligations cleared: macos-named-regressions (run 42603965815, its macos-named-regressions job) and windows-smoke (run 42605388303), both green at 7833603.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs match the change, which keeps deferred review findings on the PR instead of filing them as GitHub issues.

Scope: base 350d419 to head 7833603 (4 commits, 20 files, all committed; nothing staged, unstaged or untracked). I read the authored docs this branch changes (docs/review-policy.md, docs/ship-policy.md, docs/unattended.md, crew/docs/captain.md, captain/templates/READY.md, capy/skill/gstack/factory.md, ship/sections/review-army.md.tmpl and its generated output), the code that changed the contract (bin/gstack-review-scope, lib/review-scope.ts) and nearby docs (capy/README.md, docs/triage.md, ship/sections/pr-body.md.tmpl). I also searched every tracked doc and template for stale wording about filing deferred findings as issues and found none.

Documentation health:

  • docs/review-policy.md: current (updated in this branch)
  • docs/ship-policy.md: current (updated in this branch)
  • docs/unattended.md: current (updated in this branch)
  • crew/docs/captain.md: current (updated in this branch)
  • captain/templates/READY.md: current (updated in this branch)
  • capy/skill/gstack/factory.md: current (updated in this branch)
  • ship/sections/review-army.md.tmpl and ship/sections/review-army.md: current; the generated file matches its template
  • capy/README.md: current; its narrative fix-waves paragraph does not contradict the change

Coverage debt: gstack-review-scope defer's smaller interface (only --findings and --out, and a record that carries stated but no issue, url or reason) is covered by the reference docs (the command's help, docs/review-policy.md and docs/ship-policy.md) and the how-to doc (/ship Step 9.4). It has no tutorial, which is acceptable for an internal /ship helper.

Diagram drift: none; no diagram names the removed issue-filing path.

Test plan

  • bun run test: carried from CI (Free Tests run 42603965815/1 at 7833603, 1,652 files, 36,762 tests, 0 failed)
  • macos-named-regressions (run 42603965815, its macos-named-regressions job): success
  • windows-smoke (run 42605388303): success

🤖 Generated with Claude Code

Agent notes

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

Plan: exempt: fix under Garry's R85 process rule

Approvals

No approvals recorded for branch keep-deferred-findings-on-the-pr.
Plan: exempt: fix under Garry's R85 process rule
Plan check: PLAN_EXEMPT_UNKNOWN (gstack-approvals plan-check says why)

Refs GST-2073

{
  "schema_version": 1,
  "pr": 4208,
  "head": "7833603435ef156ca830881cc4ea2e8b605b8a96",
  "version": "1.98.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 36762,
      "fail": 0,
      "skip": null
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42603965815,
      "attempt": 1,
      "tree": "dc285ed032e5a5806c98b2ce22b513e292ce853a"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "dc285ed032e5a5806c98b2ce22b513e292ce853a",
  "product_patch_id": "0bfd0eea7a2cee36a09a7c9827214447b0244afd",
  "gstack_version": "1.98.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 226,
    "rules": "66e5174161eecc2c",
    "base": "c25580eb52332da26d505a34c5a283c74f2bb0c7",
    "registry": "c25580eb52332da26d505a34c5a283c74f2bb0c7",
    "gate_scan": {
      "tagged": 2,
      "head": "7833603435ef156ca830881cc4ea2e8b605b8a96"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=226"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @dc285ed032e5 (8 checks, current for 7833603435ef)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42603965815/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42605388303/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=dc285ed032e5 tests=36762 skipped=105 runs=42603965815/1 profiles=ci-reuse/free-tests heads=7833603435ef verified=2026-11-09T11:08:21.992Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "base 350d4196c344 to head 7833603435ef: docs/, crew/docs/, captain/templates/, capy/skill/gstack/, ship/sections/ (audit ship-4208b-docs1)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 2,
    "dispatches": {
      "specialist": 3
    }
  },
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "8811fd300bf305f0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "0bfd0eea7a2cee36a09a7c9827214447b0244afd",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

Open in Capy

garrytan and others added 4 commits November 9, 2026 08:48
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>
The reviewer's stated severity and Blocks text now sit in their own field, so a review-log row built from a deferred record keeps a severity the ledger can rank. The PR body renders the same line as before.

Review-Finding: p1/adversarial-native#2 reader=adversarial-native
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>
@capy-ai capy-ai Bot closed this Nov 9, 2026
@capy-ai capy-ai Bot reopened this Nov 9, 2026
@trunk-io

trunk-io Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

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