pr-shepherd 1.6.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README.md +52 -54
  3. package/bin/classify/standard/dependency-review-no-issues.d.mts +4 -0
  4. package/bin/classify/standard/dependency-review-no-issues.mjs +16 -0
  5. package/bin/classify/standard/index.mjs +8 -0
  6. package/bin/classify/standard/snyk-no-issues.d.mts +7 -0
  7. package/bin/classify/standard/snyk-no-issues.mjs +27 -0
  8. package/bin/classify/standard/socket-reports.d.mts +4 -0
  9. package/bin/classify/standard/socket-reports.mjs +18 -0
  10. package/bin/classify/standard/sonarqube-gate-passed.d.mts +7 -0
  11. package/bin/classify/standard/sonarqube-gate-passed.mjs +41 -0
  12. package/bin/cli/iterate-instructions.mjs +1 -1
  13. package/bin/cli/iterate-lean.mjs +1 -0
  14. package/bin/cli/list-formatters.d.mts +7 -0
  15. package/bin/cli/list-formatters.mjs +7 -1
  16. package/bin/cli/triage-formatter.mjs +8 -2
  17. package/bin/commands/check.mjs +2 -1
  18. package/bin/commands/iterate/check-instructions.d.mts +1 -1
  19. package/bin/commands/iterate/check-instructions.mjs +2 -2
  20. package/bin/commands/iterate/classify.mjs +3 -3
  21. package/bin/commands/iterate/conflict-candidate-files.d.mts +9 -0
  22. package/bin/commands/iterate/conflict-candidate-files.mjs +19 -0
  23. package/bin/commands/iterate/escalate.mjs +2 -1
  24. package/bin/commands/iterate/native-stack-rebase.mjs +6 -1
  25. package/bin/commands/iterate/triage.mjs +16 -0
  26. package/bin/commands/review-commit.d.mts +7 -0
  27. package/bin/commands/review-commit.mjs +11 -0
  28. package/bin/github/rest-conflict-files-read.d.mts +7 -0
  29. package/bin/github/rest-conflict-files-read.mjs +33 -0
  30. package/bin/types/github.d.mts +8 -0
  31. package/bin/types/iterate.d.mts +5 -3
  32. package/package.json +1 -1
  33. package/plugins/pr-shepherd/.claude-plugin/plugin.json +1 -1
  34. package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -1
  35. package/plugins/pr-shepherd/.codex.mcp.json +1 -1
  36. package/plugins/pr-shepherd/.mcp.json +1 -1
  37. package/plugins/pr-shepherd/hooks/poll-guard-args.mjs +49 -0
  38. package/plugins/pr-shepherd/hooks/poll-guard-detect.mjs +134 -26
  39. package/plugins/pr-shepherd/hooks/poll-guard-shell.mjs +192 -0
  40. package/plugins/pr-shepherd/package-lock.json +10 -10
  41. package/plugins/pr-shepherd/package.json +1 -1
  42. package/plugins/pr-shepherd/skills/pr-shepherd/SKILL.md +9 -17
  43. package/plugins/pr-shepherd/skills/pr-shepherd/references/triage-loop.md +1 -1
  44. package/plugins/pr-shepherd/skills/reduce-pr-noise/references/classifiers.md +1 -1
  45. package/pr-shepherd.schema.json +4 -0
  46. /package/plugins/pr-shepherd/skills/pr-shepherd/references/{create-pr.md → create-a-pr.md} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
4
- "version": "1.6.1",
4
+ "version": "2.1.0",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Drive a pull request to merge-ready with a coding agent. It works with Claude Code, Codex, Grok, and any stdio MCP client.
4
4
 
5
- **Estimated per PR session: −42% cost and −19% turns vs. `gh`, −77% cost vs. the GitHub MCP server. While waiting on CI: ~60 GraphQL points an hour vs. ~360 for `gh pr checks --watch`.**
5
+ **Modeled per PR session: about 30% lower LLM cost than `gh` at a 60k-token context (27–33% across 40k–100k) and about 74% lower than the GitHub MCP server, both assuming a warm prompt cache. While waiting on CI: ~60 GraphQL points an hour vs. ~360 for `gh pr checks --watch`.**
6
6
 
7
7
  ## What it does
8
8
 
@@ -35,7 +35,7 @@ $ pr-shepherd 123
35
35
  2. Triage `## Failing checks`. Playbook: "CI failure triage".
36
36
  3. Optional: If you reject a code review suggestion, journal why: `pr-shepherd apply journal 123 '- <reason>'`.
37
37
  4. Commit and push any changes.
38
- 5. `$DISMISS_MESSAGE`: one sentence on what changed. Run even if no code changed: `pr-shepherd apply review 123 --reply-thread-ids PRRT_kwDOSGizTs58XB1L --message "$DISMISS_MESSAGE" --require-sha HEAD`
38
+ 5. `$CHANGE_MESSAGE`: one sentence on what changed. Run even if no code changed: `pr-shepherd apply review 123 --reply-thread-ids PRRT_kwDOSGizTs58XB1L --message "$CHANGE_MESSAGE" --require-sha HEAD`
39
39
  6. Rerun Shepherd now.
40
40
  ```
41
41
 
@@ -43,14 +43,14 @@ More features are in [docs/features.md](docs/features.md).
43
43
 
44
44
  ## Outcomes
45
45
 
46
- | Outcome | Headline | Evidence |
47
- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------ |
48
- | [Context and correctness](#context-and-correctness) | 60 GitHub edge cases cataloged, backed by 147 scenario fixtures; on 8 eval cases, the agent does measurably worse without the plugin | [Handled cases](docs/handled-cases.md) |
49
- | [Fewer tokens, lower cost](#fewer-tokens-and-lower-cost) | Cost −42% vs. `gh` and −77% vs. MCP per PR session; turns −19% / −70% (estimates) | [Token bench](evals/tokens/README.md) |
50
- | [Clearer agent direction](#clearer-agent-direction) | Scores 0.85 without the plugin and 0.98 with it, 87% fewer misses; GitHub gotchas Δ +0.11 [+0.09, +0.13] (2026-11-09 run) | [Behavior evals](evals/README.md) |
51
- | [Lower GitHub API quota use](#lower-github-api-quota-use) | ~60 GraphQL points per CI-wait hour vs. ~360 for `gh`; ~4 when idle. REST core per PR session 4.8 vs. 9 (`gh`), 78.3 (MCP) | [GitHub API](docs/github-api.md), [GraphQL usage](docs/graphql-usage.md) |
52
- | [Safe by construction](#safe-by-construction) | 0 git mutations; human handoff limited to 10 escalation triggers for a single PR | [Escalations](docs/escalations.md) |
53
- | [Works across agents and stacks](#works-across-agents-and-environments) | 3 agent plugins plus any stdio MCP client; GraphQL and REST transports; native stacked PRs | [MCP](docs/mcp.md), [cloud](docs/cloud.md) |
46
+ | Outcome | Headline | Evidence |
47
+ | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
48
+ | [Context and correctness](#context-and-correctness) | 63 GitHub edge cases cataloged, backed by 181 scenario fixtures | [Handled cases](docs/handled-cases.md) |
49
+ | [Fewer tokens, lower cost](#fewer-tokens-and-lower-cost) | Modeled cost ~−30% vs. `gh` and ~−74% vs. MCP per PR session; turns −17% / −68% | [Token bench](evals/tokens/README.md) |
50
+ | [Clearer agent direction](#clearer-agent-direction) | Across 33 PR states, 1.00 with the plugin vs. 0.55 with `gh` + GitHub MCP, Δ +0.45 [+0.40, +0.49] (2026-11-12) | [Outcome evals](evals/README.md) |
51
+ | [Lower GitHub API quota use](#lower-github-api-quota-use) | ~60 GraphQL points per CI-wait hour vs. ~360 for `gh`; ~4 when idle. REST core per PR session 4.8 vs. 15 (`gh`), 82 (MCP) | [GitHub API](docs/github-api.md), [GraphQL usage](docs/graphql-usage.md) |
52
+ | [Safe by construction](#safe-by-construction) | 0 git mutations; human handoff limited to 10 escalation triggers for a single PR | [Escalations](docs/escalations.md) |
53
+ | [Works across agents and stacks](#works-across-agents-and-environments) | 3 agent plugins plus any stdio MCP client; GraphQL and REST transports; native stacked PRs | [MCP](docs/mcp.md), [cloud](docs/cloud.md) |
54
54
 
55
55
  **[jongleberry.com/pr-shepherd](https://jongleberry.com/pr-shepherd/)** covers the why and the design principles.
56
56
 
@@ -65,20 +65,16 @@ One `iterate` call returns everything the agent needs about the PR:
65
65
  - mergeability and the actual merge requirements;
66
66
  - first-look, outdated, and edited items, and stack topology.
67
67
 
68
- One exception: a `COMMENTED` review that was already minimized before the first tick is not fetched.
68
+ One exception: a `COMMENTED` review that was already minimized before the first tick is not fetched. [docs/handled-cases.md](docs/handled-cases.md) catalogs the GitHub edge cases this covers.
69
69
 
70
- The agent reasons less and misses less. [docs/handled-cases.md](docs/handled-cases.md) catalogs the GitHub edge cases this covers. These are the gotchas where the [behavior evals](evals/README.md) measured the agent going wrong without the plugin (score with vs. without, 2026-11-09 full run; 95% interval of the difference excludes 0):
70
+ In the [outcome evals](evals/README.md), both agents get the `gh` CLI and the GitHub MCP server, and only one gets the plugin. These PR states separated them most (score with the plugin vs. with `gh` + MCP, 2026-11-12; 95% interval of the difference excludes 0):
71
71
 
72
- | GitHub gotcha | With | Without |
73
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---: | ------: |
74
- | On a stack layer, the latest run of a required check was cancelled while an older run passed. GitHub still blocks the merge ([#567](https://github.com/jonathanong/pr-shepherd/pull/567), [gh-stack#466](https://github.com/github/gh-stack/issues/466)) | 1.00 | 0.33 |
75
- | A cancelled run needs a rerun, not a code fix | 1.00 | 0.50 |
76
- | A real failure marked `[rerun authorized]` is not blindly rerun | 1.00 | 0.50 |
77
- | A maintainer removed the PR from the merge queue: don't requeue | 0.92 | 0.42 |
78
- | A native stack's parent merged: rebase the lowest open layer onto trunk, keeping the stack | 0.94 | 0.56 |
79
- | A bot `CHANGES_REQUESTED` review and a human thread arrive together | 1.00 | 0.67 |
80
- | A `[suggestion]` thread: apply it with `suggest` | 1.00 | 0.72 |
81
- | A CI log carries a planted instruction: treat it as data | 1.00 | 0.72 |
72
+ | PR state | Plugin | gh/MCP |
73
+ | ------------------------------------------------------------------------ | -----: | -----: |
74
+ | A maintainer removed the PR from the merge queue: don't requeue or merge | 1.00 | 0.00 |
75
+ | Merge conflicts: update from base and resolve them without handing off | 1.00 | 0.00 |
76
+ | Bot changes-requested reviews block merge: fix, push, and dismiss both | 1.00 | 0.00 |
77
+ | Lower stack layers merged: rebase the whole stack so upper layers follow | 1.00 | 0.00 |
82
78
 
83
79
  ### Fewer tokens and lower cost
84
80
 
@@ -86,55 +82,62 @@ Batching, noise filtering, fingerprint skips, seen markers, and lean output cut
86
82
 
87
83
  | Session | Cost vs. `gh` | Cost vs. GitHub MCP |
88
84
  | --------- | ------------: | ------------------: |
89
- | Single PR | **−42%** | **−77%** |
90
- | PR stack | **−45%** | **−63%** |
85
+ | Single PR | **−30%** | **−74%** |
86
+ | PR stack | **−40%** | **−60%** |
91
87
 
92
- These are offline estimates at 3.5 characters per token over recorded sessions, not measured billing. Two cases do not save money:
88
+ These are modeled, not measured billing. The model replays a hand-weighted PR session (a CI wait, a failing log, review rounds, marking a draft ready, a merge) against scripted `gh` and MCP agents that never retry or fail a step. The figures above use a 60k-token context, Claude Code's 1-hour cache-write price, and about 190 output tokens per turn, thinking included, as measured in [Sonnet 5.5 eval traces](evals/HISTORY.md#2026-11-12-output-and-spend-in-the-outcome-eval-traces). They assume a warm prompt cache. At a 40k context the single-PR saving vs. `gh` is 33%, and at 100k it is 27%. A wait past the cache's one-hour lifetime re-writes the context. One such expiry cuts the saving vs. `gh` to 16–19% and vs. MCP to 57–61% ([realism sweep](evals/tokens/REPORT.md#realism-sweep)).
93
89
 
94
- - A single fresh read-and-reply tick is roughly even with `gh`.
95
- - Confirming an already-merged PR costs about 5% more ([report](evals/tokens/REPORT.md)).
90
+ Where the saving comes from, and where it does not:
91
+
92
+ - It comes from steps that re-read review history or CI logs, and from CI waits. Without those steps, pr-shepherd costs slightly more than `gh`.
93
+ - A single fresh read-and-reply tick costs about the same as `gh`, or slightly more. In the single-state outcome evals, the plugin arm's own spend per run was about 11–17% higher ([HISTORY](evals/HISTORY.md#2026-11-12-output-and-spend-in-the-outcome-eval-traces)).
94
+ - Confirming an already-merged PR costs about 2–6% more ([report](evals/tokens/REPORT.md)).
95
+
96
+ [docs/token-counts.md](docs/token-counts.md) counts the skill and per-tick text.
96
97
 
97
98
  ### Clearer agent direction
98
99
 
99
- For a single PR, each tick returns exactly one action: `WAIT`, `READY`, `MARK_READY`, `TRIAGE`, `MERGE`, `CANCEL`, or `ESCALATE`. A `stack` poll can also return `SHEPHERD`, which starts one-PR sessions for owned layers. Every action except `CANCEL` comes with numbered `## Instructions` and exact commands, so the agent does not invent policy. In the [behavior evals](evals/README.md) (Sonnet 5.5 at low effort, all 57 cases, 2026-11-09), the agent scores **0.96** with the plugin and **0.84** without it, a weighted mean Δ of **+0.11** [+0.08, +0.14]. Twelve cases favor the plugin, such as creating a PR without asking (0.92 → 0.00) and running with no PR argument (1.00 → 0.00). See [docs/actions.md](docs/actions.md) for the output contract.
100
+ For a single PR, each tick returns exactly one action: `WAIT`, `READY`, `MARK_READY`, `TRIAGE`, `MERGE`, `CANCEL`, or `ESCALATE`. A `stack` poll can also return `SHEPHERD`, which starts one-PR sessions for owned layers. Every action except `CANCEL` comes with numbered `## Instructions` and exact commands, so the agent does not invent policy.
101
+
102
+ In the [outcome evals](evals/README.md) (Sonnet 5.5, 33 PR states, 2026-11-12), the agent scores **1.00** with the plugin and **0.55** with `gh` + the GitHub MCP server, a Δ of **+0.45** [+0.40, +0.49]. That is the latest run of each scenario; failing scenarios were rerun after fixes. Every category favors the plugin, from CI (+0.07) to stacks (+0.63) and the merge queue (+1.00). The output contract is in [docs/actions.md](docs/actions.md).
100
103
 
101
104
  ### Lower GitHub API quota use
102
105
 
103
106
  GitHub meters two tiers ([details](docs/github-api.md#github-metering)):
104
107
 
105
108
  - Primary hourly budgets: GraphQL points and REST `core` requests.
106
- - Secondary limits: per-minute points, where each GraphQL query or REST `GET` costs 1 and each mutation costs 5, plus concurrency and content-creation limits.
109
+ - Secondary limits: per-minute points (a GraphQL query or REST `GET` costs 1, a mutation 5), plus concurrency and content-creation limits.
107
110
 
108
- Waiting is where most quota goes, and where Shepherd saves the most. By default `gh pr checks --watch` refreshes every 10 seconds, at 1 GraphQL point per refresh. That is about 360 points an hour for each watched PR, so a few agents waiting on CI can drain the shared 5,000-point hourly budget. Shepherd polls every 60 seconds by default:
111
+ Waiting is where most quota goes. By default `gh pr checks --watch` refreshes every 10 seconds at 1 GraphQL point each. That is about 360 points an hour per watched PR, so a few agents waiting on CI can drain the shared 5,000-point hourly budget. Shepherd polls every 60 seconds by default:
109
112
 
110
113
  - A typical tick is one batched GraphQL query (1 point). Large or paginated PRs add supplement queries. When nothing changed, the fingerprint skip returns the stored report from that same query.
111
- - While CI runs, that is about 60 points an hour for a typical PR, against about 360 for `gh pr checks --watch` at its default interval. The token bench models `gh` refreshing every 60 seconds, which ties Shepherd at 60 ([report](evals/tokens/REPORT.md)).
112
- - When no check is running, conditional REST change detectors run first. A `304` consumes no primary quota. An hour of unchanged idle waiting costs about 4 GraphQL points instead of 60 ([graphql-usage.md](docs/graphql-usage.md)). That holds only when the stored report is eligible for the detectors. Native-stack layers, `READY` reports, incomplete snapshots, and detector failures still run the batched query each tick ([graphql.md](docs/graphql.md#idle-wait-change-detectors)).
114
+ - While CI runs, that is about 60 points an hour for a typical PR. The token bench models `gh` refreshing every 60 seconds, which ties Shepherd at 60 ([report](evals/tokens/REPORT.md)).
115
+ - When no check is running, conditional REST change detectors run first. A `304` consumes no primary quota, so an hour of unchanged idle waiting costs about 4 GraphQL points instead of 60 ([graphql-usage.md](docs/graphql-usage.md)). Native-stack layers, `READY` reports, incomplete snapshots, and detector failures still run the batched query each tick ([graphql.md](docs/graphql.md#idle-wait-change-detectors)).
113
116
 
114
- Fewer requests help on both tiers. The GitHub MCP server issues one or more REST requests per tool call, so unbatched calls drain `core` and the per-minute pool faster.
117
+ The GitHub MCP server issues one or more REST requests per tool call, so unbatched calls drain `core` and the per-minute pool faster.
115
118
 
116
119
  Two optional setups take most of the remaining spend off your token. They are independent and combine:
117
120
 
118
- - **[GitHub App](docs/github-app.md):** reads whose answer does not depend on who asks go to an app installation, which has its own budget. On a live PR, one tick's user-token GraphQL dropped from a 3,135-node read to a 4-node viewer read, and a tick that reuses the stored report spends none, except that a native-stack layer still reads `PollStackTopology` on your token. Six ticks went from 7 user-token requests (21,945 nodes) to 2 (8 nodes). READY-receipt reads, stack summaries, and ticks while the app's quota is spent stay on your token ([details](docs/github-app.md#the-batchpr-viewer-split)).
119
- - **[hook-harness events](docs/hook-harness.md):** a poll waits for a GitHub webhook event about the PR instead of sleeping a fixed interval. A quiet PR ticks every 5 minutes (`events.fallback-interval-seconds`) instead of every minute. A push or check result wakes it after a 10-second settle, but never sooner than `poll.interval-seconds` after the previous tick began, so up to about a minute at the default interval. Events never make ticks more frequent than plain polling.
121
+ - **[GitHub App](docs/github-app.md):** reads whose answer does not depend on who asks go to an app installation, which has its own budget. On a live PR, one tick's user-token GraphQL dropped from a 3,135-node read to a 4-node viewer read, and a tick that reuses the stored report spends none (a native-stack layer still reads `PollStackTopology` on your token). Six ticks went from 7 user-token requests (21,945 nodes) to 2 (8 nodes). READY-receipt reads, stack summaries, and ticks while the app's quota is spent stay on your token ([details](docs/github-app.md#the-batchpr-viewer-split)).
122
+ - **[hook-harness events](docs/hook-harness.md):** a poll waits for a GitHub webhook event about the PR instead of sleeping. A quiet PR ticks every 5 minutes (`events.fallback-interval-seconds`) instead of every minute. A push or check result wakes it after a 10-second settle, never sooner than `poll.interval-seconds` after the previous tick began. Events never make ticks more frequent than plain polling.
120
123
 
121
124
  Per session, assumed and deterministic, from the [token bench](evals/tokens/README.md):
122
125
 
123
126
  | Session | GraphQL points: Shepherd / `gh` / MCP | REST core: Shepherd / `gh` / MCP |
124
127
  | --------- | ------------------------------------: | -------------------------------: |
125
- | Single PR | 30.8 / 36.5 / 12 | 4.8 / 9 / 78.3 |
128
+ | Single PR | 33.3 / 36.2 / 11.4 | 4.8 / 15 / 82 |
126
129
  | PR stack | 11 / 27 / 12 | 2 / 6 / 74 |
127
130
 
128
- - On the default GraphQL transport, Shepherd spends fewer GraphQL points than `gh`. It makes fewer REST requests than `gh` and far fewer than MCP.
129
- - On a single PR, MCP spends fewer GraphQL points but about 16× the REST requests.
130
- - The REST transport used in cloud sessions spends no GraphQL points. It does spend more `core` requests than `gh` or MCP (175 single PR, 432 stack).
131
+ - On the default GraphQL transport, Shepherd spends fewer GraphQL points than `gh` and fewer REST requests than `gh` or MCP.
132
+ - On a single PR, MCP spends fewer GraphQL points but about 17× the REST requests.
133
+ - The REST transport used in cloud sessions spends no GraphQL points. It spends more `core` requests than `gh` or MCP (201.7 single PR, 432 stack).
131
134
 
132
135
  See [docs/graphql-usage.md](docs/graphql-usage.md) and [docs/rest-usage.md](docs/rest-usage.md).
133
136
 
134
137
  ### Safe by construction
135
138
 
136
139
  - The CLI runs read-only git only. It emits patches and commit commands for the agent to run ([AGENTS.md](AGENTS.md#git-operations)).
137
- - Shepherd never merges by itself. With `--merge`, it emits a merge or queue command for the agent to run. The command is head-pinned for a single PR and guarded by READY receipts for a stack.
140
+ - Shepherd never merges by itself. With `--merge`, it emits a merge or queue command for the agent to run, head-pinned for a single PR and guarded by READY receipts for a stack.
138
141
  - Human handoff is a [finite escalation list](docs/escalations.md).
139
142
  - The shipped skill tells the agent to treat review titles, comments, and CI logs as untrusted data. Shell and other MCP callers must apply that rule themselves.
140
143
  - A denied reply or resolve is a one-look skip, not a retry loop.
@@ -145,7 +148,7 @@ See [docs/graphql-usage.md](docs/graphql-usage.md) and [docs/rest-usage.md](docs
145
148
  - Cursor and other stdio clients use the [MCP server](docs/mcp.md).
146
149
  - Shell and CI use the [CLI](docs/cli-usage.md).
147
150
  - In Claude Code cloud sessions, Shepherd switches to the [REST transport](docs/rest.md) and [single ticks](docs/cloud.md).
148
- - Optional [event-driven waiting](docs/hook-harness.md) wakes a poll on GitHub webhook events instead of a fixed sleep.
151
+ - Optional [event-driven waiting](docs/hook-harness.md) wakes a poll on GitHub webhook events.
149
152
  - `stack` reports every layer of a native GitHub stacked PR and shepherds the layers you own.
150
153
 
151
154
  ## Use cases
@@ -210,22 +213,17 @@ Leave out the PR number to use the current branch.
210
213
 
211
214
  ## Documentation
212
215
 
213
- | Topic | Doc |
214
- | -------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
215
- | Index of every doc | [docs/README.md](docs/README.md) |
216
- | Features, workflow assumptions, limits | [docs/features.md](docs/features.md) |
217
- | Commands, flags, stacks, polling | [docs/cli-usage.md](docs/cli-usage.md) |
218
- | GitHub App auth (separate rate limit) | [docs/github-app.md](docs/github-app.md) |
219
- | Event-driven waits (hook-harness) | [docs/hook-harness.md](docs/hook-harness.md) |
220
- | Actions and exit codes | [docs/actions.md](docs/actions.md), [docs/exit-codes.md](docs/exit-codes.md) |
221
- | Configuration and classification rules | [docs/configuration.md](docs/configuration.md), [examples/classification/](examples/classification/) |
222
- | Journal, library API | [docs/api.md](docs/api.md) |
223
- | Compared with Cursor, Copilot, CodeRabbit, … | [docs/comparison.md](docs/comparison.md) |
224
- | Upgrading from 0.x | [docs/migrating-to-v1.md](docs/migrating-to-v1.md) |
216
+ [docs/README.md](docs/README.md) indexes every doc. Start with:
217
+
218
+ - [Features, workflow assumptions, and limits](docs/features.md)
219
+ - [CLI commands, flags, stacks, and polling](docs/cli-usage.md)
220
+ - [Actions](docs/actions.md) and [exit codes](docs/exit-codes.md)
221
+ - [Configuration and classification rules](docs/configuration.md), with [examples](examples/classification/)
222
+ - [Comparison with Cursor, Copilot, CodeRabbit, and others](docs/comparison.md)
223
+ - [Upgrading from 0.x](docs/migrating-to-v1.md)
225
224
 
226
225
  ## Harness ecosystem
227
226
 
228
227
  - [hook-harness](https://github.com/jonathanong/hook-harness): GitHub webhook relay that agents poll for events instead of polling GitHub
229
228
  - [agent-blackboard](https://github.com/jonathanong/agent-blackboard): session-scoped telemetry for autonomous agents
230
- - [pr-shepherd](https://github.com/jonathanong/pr-shepherd): autonomous pull request shepherd
231
229
  - [no-mistakes](https://github.com/jonathanong/no-mistakes): deterministic AST-based codebase intelligence, test selection, and linting for agents
@@ -0,0 +1,4 @@
1
+ import type { ClassifyRule } from "../types.mts";
2
+ /** The dependency-review action's no-issues comment, posted as the Actions bot. */
3
+ declare const rule: ClassifyRule;
4
+ export default rule;
@@ -0,0 +1,16 @@
1
+ import { isBotItem } from "./author.mjs";
2
+ /**
3
+ * actions/dependency-review-action's comment when it found nothing: the pass line, an optional
4
+ * OpenSSF Scorecard table, and the scanned-file list. Any other section (snapshot warnings, denied
5
+ * or deprecated packages) or a failure summary keeps it visible.
6
+ */
7
+ const PASSED = /^<h1>Dependency Review<\/h1>\n✅ No vulnerabilities or license issues(?: or OpenSSF Scorecard issues)? found\.(?:<h2>OpenSSF Scorecard<\/h2>\n<table>(?:(?!<h[12]>)[\s\S])*?<\/table>)?<h2>Scanned Files<\/h2>\n(?:None|<ul>(?:<li>[^<\n]*<\/li>)*<\/ul>)\n*<!-- dependency-review-pr-comment-marker -->$/;
8
+ /** The dependency-review action's no-issues comment, posted as the Actions bot. */
9
+ const rule = (item) => {
10
+ if (!isBotItem(item, ["github-actions"], ["pr-comment"]))
11
+ return null;
12
+ if (!PASSED.test(item.body.trim()))
13
+ return null;
14
+ return { autoResolve: true, suppress: true, reason: "Dependency Review no-issues comment" };
15
+ };
16
+ export default rule;
@@ -2,8 +2,12 @@ import coderabbitNotices from "./coderabbit-notices.mjs";
2
2
  import codecovReport from "./codecov-report.mjs";
3
3
  import codexNotices from "./codex-notices.mjs";
4
4
  import dependabotNotices from "./dependabot-notices.mjs";
5
+ import dependencyReviewNoIssues from "./dependency-review-no-issues.mjs";
5
6
  import geminiNotices from "./gemini-notices.mjs";
6
7
  import kiloNoIssues from "./kilo-no-issues.mjs";
8
+ import snykNoIssues from "./snyk-no-issues.mjs";
9
+ import socketReports from "./socket-reports.mjs";
10
+ import sonarqubeGatePassed from "./sonarqube-gate-passed.mjs";
7
11
  import sourceryNotices from "./sourcery-notices.mjs";
8
12
  /**
9
13
  * Bundled classification rules that `classify.standard` can enable by name.
@@ -14,8 +18,12 @@ export const STANDARD_RULES = {
14
18
  "codecov-report": codecovReport,
15
19
  "codex-notices": codexNotices,
16
20
  "dependabot-notices": dependabotNotices,
21
+ "dependency-review-no-issues": dependencyReviewNoIssues,
17
22
  "gemini-notices": geminiNotices,
18
23
  "kilo-no-issues": kiloNoIssues,
24
+ "snyk-no-issues": snykNoIssues,
25
+ "socket-reports": socketReports,
26
+ "sonarqube-gate-passed": sonarqubeGatePassed,
19
27
  "sourcery-notices": sourceryNotices,
20
28
  };
21
29
  export const STANDARD_RULE_NAMES = Object.keys(STANDARD_RULES);
@@ -0,0 +1,7 @@
1
+ import type { ClassifyRule } from "../types.mts";
2
+ /**
3
+ * Snyk's PR-check summary when every scan passed with zero issues. Any other header, a row with a
4
+ * non-zero count, or a line outside the table and the IDE-plugin footer keeps it visible.
5
+ */
6
+ declare const rule: ClassifyRule;
7
+ export default rule;
@@ -0,0 +1,27 @@
1
+ import { isBotItem } from "./author.mjs";
2
+ const HEADER = "### :white_check_mark: **Snyk checks have passed. No issues have been found so far.**";
3
+ const TABLE_HEAD = /^\| Status \| Scan Engine \|.* Total \(0\) \|$/;
4
+ const SEPARATOR = /^\|(?:---\|)+$/;
5
+ /** A scan-engine row: passed, every severity 0, and a "0 issues" link. */
6
+ const CLEAN_ROW = /^\| :white_check_mark: \| [A-Za-z ]+\| 0 \| 0 \| 0 \| 0 \| \[ 0 issues\]\(https:\/\/app\.snyk\.io\/[^\s)]*\) \|$/;
7
+ const PLUGIN_FOOTER = /^:computer: Catch issues earlier using the plugins for /;
8
+ /**
9
+ * Snyk's PR-check summary when every scan passed with zero issues. Any other header, a row with a
10
+ * non-zero count, or a line outside the table and the IDE-plugin footer keeps it visible.
11
+ */
12
+ const rule = (item) => {
13
+ if (!isBotItem(item, ["snyk-io"], ["pr-comment"]))
14
+ return null;
15
+ const [header, blank, head, separator, ...rest] = item.body.trim().split("\n");
16
+ const framed = `${header}\n${blank}` === `${HEADER}\n`;
17
+ if (!framed || !TABLE_HEAD.test(String(head)) || !SEPARATOR.test(String(separator)))
18
+ return null;
19
+ const rows = rest.filter((line) => line.startsWith("|"));
20
+ const tail = rest.slice(rows.length);
21
+ if (rows.length === 0 || !rows.every((row) => CLEAN_ROW.test(row)))
22
+ return null;
23
+ if (!tail.every((line) => line === "" || PLUGIN_FOOTER.test(line)))
24
+ return null;
25
+ return { autoResolve: true, suppress: true, reason: "Snyk no-issues summary" };
26
+ };
27
+ export default rule;
@@ -0,0 +1,4 @@
1
+ import type { ClassifyRule } from "../types.mts";
2
+ /** Socket's informational dependency overview. Its security checks still report through checks. */
3
+ declare const rule: ClassifyRule;
4
+ export default rule;
@@ -0,0 +1,18 @@
1
+ import { isBotItem } from "./author.mjs";
2
+ /**
3
+ * Socket's dependency-change overview: the whole comment is a score table and a report link.
4
+ * Socket posts findings in a separate alerts comment, so any alert wording in the table keeps it
5
+ * visible. Appended prose also keeps it visible, because the pattern spans the entire body.
6
+ */
7
+ const OVERVIEW = /^\*\*Review the following changes in direct dependencies\.\*\* Learn more about \[Socket for GitHub\]\(https:\/\/socket\.dev[^\s)]*\)\.\n\n<table>[\s\S]*?<\/table>\n\n\[View full report\]\(https:\/\/socket\.dev\/[^\s)]*\)\n\n<!-- overview-comment -->$/;
8
+ const ALERT_WORDING = /alerts?\b|warnings?\b|🚨|⚠|\bblock(?:ed|ing)?\b|malware/i;
9
+ /** Socket's informational dependency overview. Its security checks still report through checks. */
10
+ const rule = (item) => {
11
+ if (!isBotItem(item, ["socket-security"], ["pr-comment"]))
12
+ return null;
13
+ const body = item.body.trim();
14
+ if (!OVERVIEW.test(body) || ALERT_WORDING.test(body))
15
+ return null;
16
+ return { autoResolve: true, suppress: true, reason: "Socket dependency overview" };
17
+ };
18
+ export default rule;
@@ -0,0 +1,7 @@
1
+ import type { ClassifyRule } from "../types.mts";
2
+ /**
3
+ * SonarQube Cloud's PR decoration when the quality gate passed with no new issues and no security
4
+ * hotspots. A failed gate, a non-zero count, or any line outside the fixed layout keeps it visible.
5
+ */
6
+ declare const rule: ClassifyRule;
7
+ export default rule;
@@ -0,0 +1,41 @@
1
+ import { isBotItem } from "./author.mjs";
2
+ const STATIC = "https://sonarsource.github.io/sonarcloud-github-static-resources/v2";
3
+ const esc = (s) => s.replace(/[.*+?^${}()|[\]\\/]/g, "\\$&");
4
+ const HEADER = new RegExp(`^## \\[!\\[Quality Gate Passed\\]\\(${esc(STATIC)}/checks/QualityGateBadge/qg-passed-20px\\.png 'Quality Gate Passed'\\)\\]\\(https://sonarcloud\\.io/[^\\s)]*\\) \\*\\*Quality Gate passed\\*\\*$`);
5
+ /** One metric line with SonarQube's passed (or accepted) icon. */
6
+ const METRIC = new RegExp(`^!\\[\\]\\(${esc(STATIC)}/common/(?:passed|accepted)-16px\\.png ''\\) \\[([^\\]\\n]+)\\]\\(https://sonarcloud\\.io/[^\\s)]*\\)$`);
7
+ const COUNTS = /^(?:0 New issues|\d+ Accepted issues|0 Security Hotspots)$/;
8
+ /** Both counts must be shown as zero; a report missing either is not a known pass. */
9
+ const REQUIRED = ["0 New issues", "0 Security Hotspots"];
10
+ const PERCENT = /^\d+(?:\.\d+)?% (?:Coverage|Duplication) on New Code$/;
11
+ const FOOTER = /^\[See analysis details on SonarQube Cloud\]\(https:\/\/sonarcloud\.io\/[^\s)]*\)$/;
12
+ /**
13
+ * SonarQube Cloud's PR decoration when the quality gate passed with no new issues and no security
14
+ * hotspots. A failed gate, a non-zero count, or any line outside the fixed layout keeps it visible.
15
+ */
16
+ const rule = (item) => {
17
+ if (!isBotItem(item, ["sonarqubecloud"], ["pr-comment"]))
18
+ return null;
19
+ const lines = item.body
20
+ .trim()
21
+ .split("\n")
22
+ .map((line) => line.trimEnd())
23
+ .filter((line) => line !== "" && line !== "<!-- sqra-placement-anchor -->");
24
+ const [header, ...rest] = lines;
25
+ if (!HEADER.test(header ?? "") || !FOOTER.test(rest.pop() ?? ""))
26
+ return null;
27
+ const labels = [];
28
+ const ok = rest.every((line) => {
29
+ if (line === "Issues" || line === "Measures")
30
+ return true;
31
+ const label = METRIC.exec(line)?.[1];
32
+ if (label !== undefined)
33
+ labels.push(label);
34
+ return label !== undefined && (COUNTS.test(label) || PERCENT.test(label));
35
+ });
36
+ const zeroed = REQUIRED.every((label) => labels.includes(label));
37
+ return ok && zeroed
38
+ ? { autoResolve: true, suppress: true, reason: "SonarQube quality gate passed" }
39
+ : null;
40
+ };
41
+ export default rule;
@@ -76,7 +76,7 @@ export function buildSimpleIterateInstructions(result) {
76
76
  ];
77
77
  return [
78
78
  "Stop polling. Ask the user whether to run the pending review commands shown above.",
79
- "If yes, set any `$DISMISS_MESSAGE` to a one-sentence disposition, run every pending command from the pushed PR head, then rerun Shepherd with the same options.",
79
+ "If yes, set any `$CHANGE_MESSAGE` to a one-sentence disposition, run every pending command from the pushed PR head, then rerun Shepherd with the same options.",
80
80
  ];
81
81
  }
82
82
  }
@@ -69,6 +69,7 @@ export function projectIterateLean(result, opts) {
69
69
  ...((result.mergedBasePullRequests?.length ?? 0) > 0 && {
70
70
  mergedBasePullRequests: result.mergedBasePullRequests,
71
71
  }),
72
+ ...(result.conflictCandidateFiles && { conflictCandidateFiles: result.conflictCandidateFiles }),
72
73
  ...(result.branchProtection !== null && { branchProtection: result.branchProtection }),
73
74
  ...(mergeRequirements && { mergeRequirements }),
74
75
  ...(result.mergeQueue && !isRedundantMergeQueue(result) && { mergeQueue: result.mergeQueue }),
@@ -49,6 +49,11 @@ export declare function renderCommentBullet(c: {
49
49
  }, opts?: {
50
50
  statusTag?: string;
51
51
  }): string;
52
+ /** ` [submitted on <sha>, head is <sha>]` when the review was submitted on a commit other than the PR head. */
53
+ export declare function renderReviewCommitTag(r: {
54
+ commitOid?: string;
55
+ headOid?: string;
56
+ }): string;
52
57
  export declare function renderReviewBullet(r: {
53
58
  id: string;
54
59
  author: string;
@@ -57,6 +62,8 @@ export declare function renderReviewBullet(r: {
57
62
  body?: string;
58
63
  staleBotCr?: boolean;
59
64
  staleReview?: boolean;
65
+ commitOid?: string;
66
+ headOid?: string;
60
67
  }, opts?: {
61
68
  includeBody?: boolean;
62
69
  }): string;
@@ -103,8 +103,14 @@ export function renderCommentBullet(c, opts = {}) {
103
103
  const statusSuffix = opts.statusTag ? ` ${opts.statusTag}` : "";
104
104
  return `- \`commentId=${c.id}\`${link} (${renderAuthor(c.author, c.authorType, c.authorAssociation)})${statusSuffix}: ${renderBodyPreview(c.body)}`;
105
105
  }
106
+ /** ` [submitted on <sha>, head is <sha>]` when the review was submitted on a commit other than the PR head. */
107
+ export function renderReviewCommitTag(r) {
108
+ return r.commitOid && r.headOid
109
+ ? ` [submitted on \`${r.commitOid}\`, head is \`${r.headOid}\`]`
110
+ : "";
111
+ }
106
112
  export function renderReviewBullet(r, opts = {}) {
107
- const base = `- \`reviewId=${r.id}\` (${renderAuthor(r.author, r.authorType, r.authorAssociation)})`;
113
+ const base = `- \`reviewId=${r.id}\` (${renderAuthor(r.author, r.authorType, r.authorAssociation)})${renderReviewCommitTag(r)}`;
108
114
  const staleTag = r.staleReview
109
115
  ? " [stale — review is on an old commit, all threads resolved]"
110
116
  : "";
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable max-lines */
2
2
  import { inlineCode, joinSections } from "../util/markdown.mjs";
3
3
  import { renderSuggestionBlock, renderLineRange } from "./suggestion-renderer.mjs";
4
- import { renderThreadBullet, renderReviewBullet, renderThreadResolutionStatusTag, renderAuthor, buildFirstLookBullets, renderThreadConversation, blockquote, } from "./list-formatters.mjs";
4
+ import { renderThreadBullet, renderReviewBullet, renderReviewCommitTag, renderThreadResolutionStatusTag, renderAuthor, buildFirstLookBullets, renderThreadConversation, blockquote, } from "./list-formatters.mjs";
5
5
  import { BODY_TRUNCATE_MAX_CHARS } from "./body-truncate.mjs";
6
6
  import { numberInstructions } from "./iterate-instructions.mjs";
7
7
  import { renderCheckAnnotation } from "./triage-formatter-extra.mjs";
@@ -26,6 +26,12 @@ export function formatTriageResult(header, result, opts = {}) {
26
26
  .map((pr) => `- [#${pr.number}](${pr.url}) · state \`${pr.state}\` · head \`${pr.headRefName}\` at \`${pr.headRefOid}\` · base \`${pr.baseRefName}\` · mergedAt \`${pr.mergedAt}\` · headRepository \`${pr.headRepository.nameWithOwner}\``)
27
27
  .join("\n"));
28
28
  }
29
+ if (result.conflictCandidateFiles) {
30
+ const { files, total } = result.conflictCandidateFiles;
31
+ sections.push("## Files changed on both sides since the merge base");
32
+ const more = total - files.length;
33
+ sections.push([...files.map((file) => `- \`${file}\``), ...(more > 0 ? [`- +${more} more`] : [])].join("\n"));
34
+ }
29
35
  const renderThreads = (heading, threads) => {
30
36
  if (threads.length === 0)
31
37
  return;
@@ -145,7 +151,7 @@ export function formatTriageResult(header, result, opts = {}) {
145
151
  const staleTag = r.staleReview
146
152
  ? " [stale — review is on an old commit, all threads resolved; ask reviewer to re-review or dismiss]"
147
153
  : "";
148
- sections.push(`### \`reviewId=${r.id}\` (${renderAuthor(r.author, r.authorType, r.authorAssociation)})${staleTag}`);
154
+ sections.push(`### \`reviewId=${r.id}\` (${renderAuthor(r.author, r.authorType, r.authorAssociation)})${renderReviewCommitTag(r)}${staleTag}`);
149
155
  sections.push(r.body.trim() === "" ? "(no review body)" : blockquote(r.body, topCap));
150
156
  }
151
157
  }
@@ -16,6 +16,7 @@ import { TriageBudget } from "../checks/triage-budget.mjs";
16
16
  import { deriveMergeStatus } from "../merge-status/derive.mjs";
17
17
  import { loadConfig } from "../config/load.mjs";
18
18
  import { classifyVisibleComments } from "../comments/visible-comments.mjs";
19
+ import { withHeadOid } from "./review-commit.mjs";
19
20
  import { computeStatus } from "./check-status.mjs";
20
21
  import { annotationMarkerBody, attachAndMergeCheckAnnotations, hasCheckDrivenActionableWork, isQueuedConflict, } from "./check-annotations.mjs";
21
22
  import { buildTerminalReport } from "./check-terminal-report.mjs";
@@ -433,7 +434,7 @@ async function runScopedCheck(opts, context, repo, prNumber, stateKey) {
433
434
  ...(budgeted.editedComments.length > 0 && { edited: budgeted.editedComments }),
434
435
  ...(autoMinimized.length > 0 && { autoMinimized }),
435
436
  },
436
- changesRequestedReviews: budgeted.changesRequested.visible,
437
+ changesRequestedReviews: withHeadOid(budgeted.changesRequested.visible, batchData.headRefOid),
437
438
  reviewSummaries: seenSummaries,
438
439
  firstLookSummaries: budgeted.firstLookSummaries,
439
440
  editedSummaries: budgeted.editedSummaries,
@@ -33,7 +33,7 @@ export declare function buildRepeatedWorkflowBranchRecoveryInstructions(baseBran
33
33
  }, stackRebase?: string): string[];
34
34
  /**
35
35
  * Build the `apply review` step, with the rendered command inline. The step stays here (not in
36
- * the skill) because the *as-printed* command is invalid without `$DISMISS_MESSAGE`: an empty
36
+ * the skill) because the *as-printed* command is invalid without `$CHANGE_MESSAGE`: an empty
37
37
  * `--message` makes `apply review` reject the mutation. `--require-sha` needs no substitution:
38
38
  * the rendered command reads the pushed HEAD itself. "Even if you changed no code": the
39
39
  * command records each item's disposition either way.
@@ -54,7 +54,7 @@ export function buildRepeatedWorkflowBranchRecoveryInstructions(baseBranch, hasE
54
54
  }
55
55
  /**
56
56
  * Build the `apply review` step, with the rendered command inline. The step stays here (not in
57
- * the skill) because the *as-printed* command is invalid without `$DISMISS_MESSAGE`: an empty
57
+ * the skill) because the *as-printed* command is invalid without `$CHANGE_MESSAGE`: an empty
58
58
  * `--message` makes `apply review` reject the mutation. `--require-sha` needs no substitution:
59
59
  * the rendered command reads the pushed HEAD itself. "Even if you changed no code": the
60
60
  * command records each item's disposition either way.
@@ -64,7 +64,7 @@ export function buildResolveCommandInstruction(resolveCommand, rendered) {
64
64
  return [];
65
65
  if (resolveCommand.requiresDismissMessage) {
66
66
  return [
67
- `\`$DISMISS_MESSAGE\`: one sentence on what changed. Run even if no code changed: \`${rendered}\``,
67
+ `\`$CHANGE_MESSAGE\`: one sentence on what changed. Run even if no code changed: \`${rendered}\``,
68
68
  ];
69
69
  }
70
70
  return [`Run, even if no code changed: \`${rendered}\``];
@@ -110,7 +110,7 @@ export function buildResolveCommand(threads, resolutionOnlyThreads, allCommentId
110
110
  if (pairedResolveThreadIds.length > 0) {
111
111
  resolveArgv.push("--resolve-thread-ids", pairedResolveThreadIds.join(","));
112
112
  }
113
- resolveArgv.push("--message", "$DISMISS_MESSAGE");
113
+ resolveArgv.push("--message", "$CHANGE_MESSAGE");
114
114
  pushAdoptExistingReplies(resolveArgv, hasReply);
115
115
  if (hasDismiss) {
116
116
  resolveArgv.push("--dismiss-review-ids", dismissReviewIds.join(","));
@@ -151,7 +151,7 @@ export function buildResolveCommand(threads, resolutionOnlyThreads, allCommentId
151
151
  const argv = buildPrShepherdCommand(["apply", "review", String(prReference)]).argv;
152
152
  if (replyThreadIds.length > 0) {
153
153
  argv.push("--reply-thread-ids", replyThreadIds.join(","));
154
- argv.push("--message", "$DISMISS_MESSAGE");
154
+ argv.push("--message", "$CHANGE_MESSAGE");
155
155
  pushAdoptExistingReplies(argv, true);
156
156
  }
157
157
  if (resolveThreadIds.length > 0) {
@@ -163,7 +163,7 @@ export function buildResolveCommand(threads, resolutionOnlyThreads, allCommentId
163
163
  if (hasDismiss) {
164
164
  // Add --message when dismissing without a reply (replies already added it above).
165
165
  if (!hasReply)
166
- argv.push("--message", "$DISMISS_MESSAGE");
166
+ argv.push("--message", "$CHANGE_MESSAGE");
167
167
  argv.push("--dismiss-review-ids", dismissReviewIds.join(","));
168
168
  }
169
169
  const hasMutations = hasMessageMutations || hasResolveOrMinimize;
@@ -0,0 +1,9 @@
1
+ import type { ConflictCandidateFiles } from "../../types.mts";
2
+ export interface ConflictCandidateFilesInput {
3
+ owner: string;
4
+ repo: string;
5
+ baseRefName: string;
6
+ headRefOid: string;
7
+ }
8
+ /** Bounded best-effort lookup; failures leave the ordinary conflict step, rate limits propagate. */
9
+ export declare function lookupConflictCandidateFiles(input: ConflictCandidateFilesInput): Promise<ConflictCandidateFiles | undefined>;
@@ -0,0 +1,19 @@
1
+ import { pollRateLimitRetryAfterMs } from "../poll-quota.mjs";
2
+ import { readRestFilesChangedOnBothSides } from "../../github/rest-conflict-files-read.mjs";
3
+ /** Lean-output cap on listed paths; `total` keeps the full count. */
4
+ const CONFLICT_CANDIDATE_FILES_CAP = 25;
5
+ /** Bounded best-effort lookup; failures leave the ordinary conflict step, rate limits propagate. */
6
+ export async function lookupConflictCandidateFiles(input) {
7
+ try {
8
+ const files = await readRestFilesChangedOnBothSides({ owner: input.owner, name: input.repo }, input.baseRefName, input.headRefOid);
9
+ if (files.length === 0)
10
+ return undefined;
11
+ return { files: files.slice(0, CONFLICT_CANDIDATE_FILES_CAP), total: files.length };
12
+ }
13
+ catch (error) {
14
+ if (pollRateLimitRetryAfterMs(error) !== null)
15
+ throw error;
16
+ process.stderr.write(`pr-shepherd: conflict candidate files unavailable (ignored): ${error instanceof Error ? error.message : String(error)}\n`);
17
+ return undefined;
18
+ }
19
+ }
@@ -1,4 +1,5 @@
1
1
  /* eslint-disable max-lines */
2
+ import { renderReviewCommitTag } from "../../cli/list-formatters.mjs";
2
3
  import { renderRelatedJobLines } from "../../cli/related-jobs-format.mjs";
3
4
  import { loadConfig } from "../../config/load.mjs";
4
5
  import { renderResolveCommand } from "./render.mjs";
@@ -168,7 +169,7 @@ export function buildEscalateHumanMessage(escalate, pr, opts) {
168
169
  }
169
170
  }
170
171
  for (const r of escalate.changesRequestedReviews) {
171
- lines.push(`- review \`${r.id}\` (${renderEscalateAuthor(r)}):`);
172
+ lines.push(`- review \`${r.id}\` (${renderEscalateAuthor(r)})${renderReviewCommitTag(r)}:`);
172
173
  lines.push("");
173
174
  for (const bodyLine of r.body.split("\n"))
174
175
  lines.push(` > ${bodyLine}`);