You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address review: trap, printf -v, r all, jq null guard, step order
- Fix trap overwrite in `f+i`: Step 10 now cleans up both `issue_body_file` and `summary_body_file` so the Step 9 temp file is not leaked (commands/address-review.md Step 10).
- Replace bash-only `printf -v` with plain variable assignment in the follow-up issue template (commands/address-review.md Step 9).
- Define bare `r` and bare `r all` handling in Action `r`: both are rejected with guidance instead of being silently ignored.
- Null-guard the summary-cutoff `jq ... | last` snippet so an empty result yields `""` (not JSON `null`) and document the empty-cutoff = full-history semantics; mirrored in prompts/address-review.md.
- Reorder Step 1/Step 2 in commands/address-review.md so input parsing runs before repo detection, matching prompts/address-review.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
If `gh repo view` fails, ensure `gh` CLI is installed and authenticated (`gh auth status`).
45
45
46
46
## Step 3: Determine Scan Window and Summary Cutoff
47
47
@@ -51,17 +51,21 @@ For full-PR scans (plain PR number or PR URL with no specific review/comment anc
51
51
- If the user explicitly said `check all reviews`, ignore the cutoff and scan the full PR history.
52
52
- If the input is a specific review URL or specific issue-comment URL, fetch that exact target even if it predates the latest summary comment.
53
53
54
-
Fetch the latest summary comment before collecting review data:
54
+
Fetch the latest summary comment before collecting review data. Extract only the timestamp, guarding against the empty-array case (`jq ... | last` emits JSON `null` when nothing matches):
# Empty string → no prior summary comment; scan full PR history.
58
62
```
59
63
60
64
Cutoff rules:
61
65
62
-
- If a summary comment exists and `CHECK_ALL_REVIEWS` is false, set `REVIEW_CUTOFF_AT` to that comment's `created_at` timestamp.
66
+
-`REVIEW_CUTOFF_AT` is empty when no summary comment exists; treat that as "scan full PR history" and do not filter by timestamp.
67
+
- If `REVIEW_CUTOFF_AT` is non-empty and `CHECK_ALL_REVIEWS` is false, use it as the cutoff.
63
68
- Use exact timestamps in user-facing status updates, for example: "Scanning review activity after 2026-04-01T20:14:33Z."
64
-
- If no summary comment exists, scan the full PR history.
65
69
- When a cutoff is active, keep enough older thread context to understand new replies, but only triage items whose own timestamp or latest thread activity is after `REVIEW_CUTOFF_AT`.
66
70
- If no items survive the cutoff, say that no new review feedback was found since the last summary comment and remind the user they can say `check all reviews` to rescan the full PR.
67
71
@@ -223,6 +227,9 @@ Present the requested items with full context and ask the user for a decision on
223
227
224
228
Post rationale replies to the specified items explaining why they are being deferred or skipped. By default, do not resolve threads in `r` unless the user explicitly asks to resolve them (for example, `r3,5 + resolve`). Accept only `SKIPPED`/`DISCUSS` item numbers, ranges, `r all skipped`, or `r all discuss`. If the selection includes any `MUST-FIX` item (including `r all must-fix`), do not post replies; direct the user to `f` or explicit deferral (`f+i` / `m`).
225
229
230
+
- Bare `r` (with no items and no `all` qualifier) is ambiguous. Do not reply to anything. Prompt the user to specify item numbers or ranges, or one of `r all skipped` / `r all discuss`.
231
+
- Bare `r all` (without `skipped` or `discuss`) is also ambiguous. Do not reply to anything. Respond with: `"r all" is ambiguous — use "r all skipped", "r all discuss", or run both: "r all skipped" then "r all discuss"`.
232
+
226
233
### Action `m` — Merge as-is
227
234
228
235
1. Create a follow-up GitHub issue (see Step 9) bundling `MUST-FIX`, `DISCUSS`, and non-trivial `SKIPPED` items.
- If a summary comment exists and `CHECK_ALL_REVIEWS` is false, set `REVIEW_CUTOFF_AT` to that comment's `created_at`.
64
+
- Fetch the latest summary comment before collecting review data. Use a null-safe extraction so an empty result becomes an empty string (not JSON `null`):
65
+
`REVIEW_CUTOFF_AT=$(gh api --paginate repos/${REPO}/issues/{PR_NUMBER}/comments | jq -rs '[.[].[] | select(((.body // "") | contains("<!-- address-review-summary -->"))) | {id: .id, created_at: .created_at, html_url: .html_url}] | sort_by(.created_at) | last | if . == null then "" else .created_at end')`
66
+
- An empty `REVIEW_CUTOFF_AT` means no prior summary comment; scan full history.
67
+
- If `REVIEW_CUTOFF_AT` is non-empty and `CHECK_ALL_REVIEWS` is false, use it as the cutoff.
67
68
- Use exact timestamps in user-facing status updates, for example `2026-04-01T20:14:33Z`.
68
69
- If no items survive the cutoff, tell me no new review feedback was found since that summary comment and remind me I can say `check all reviews`.
0 commit comments