pr-shepherd 2.4.0 → 2.5.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 (76) hide show
  1. package/.claude-plugin/plugin.json +3 -3
  2. package/.grok-plugin/marketplace.json +1 -1
  3. package/README.md +7 -9
  4. package/bin/classify/apply.d.mts +8 -1
  5. package/bin/classify/apply.mjs +37 -47
  6. package/bin/classify/items.d.mts +7 -0
  7. package/bin/classify/items.mjs +57 -0
  8. package/bin/classify/standard/coderabbit-notices.d.mts +2 -1
  9. package/bin/classify/standard/coderabbit-notices.mjs +33 -1
  10. package/bin/classify/standard/index.d.mts +2 -1
  11. package/bin/classify/standard/index.mjs +2 -1
  12. package/bin/classify/types.d.mts +8 -3
  13. package/bin/cli/iterate-lean.mjs +3 -0
  14. package/bin/cli/list-formatters.d.mts +1 -0
  15. package/bin/cli/list-formatters.mjs +3 -1
  16. package/bin/cli/triage-formatter.mjs +6 -1
  17. package/bin/commands/check-activity.mjs +2 -1
  18. package/bin/commands/check-fingerprint.mjs +1 -0
  19. package/bin/commands/check.mjs +39 -9
  20. package/bin/commands/iterate/check-instructions.d.mts +2 -0
  21. package/bin/commands/iterate/check-instructions.mjs +14 -0
  22. package/bin/commands/iterate/classify.d.mts +17 -3
  23. package/bin/commands/iterate/classify.mjs +105 -66
  24. package/bin/commands/iterate/escalate.mjs +6 -1
  25. package/bin/commands/iterate/index.mjs +16 -24
  26. package/bin/commands/iterate/render.d.mts +2 -11
  27. package/bin/commands/iterate/render.mjs +10 -19
  28. package/bin/commands/iterate/stall.mjs +3 -0
  29. package/bin/commands/iterate/triage.d.mts +1 -0
  30. package/bin/commands/iterate/triage.mjs +18 -13
  31. package/bin/commands/poll-summary-instructions.d.mts +1 -1
  32. package/bin/commands/poll-summary-instructions.mjs +2 -2
  33. package/bin/commands/poll-summary.mjs +1 -1
  34. package/bin/commands/resolve-mutate.mjs +39 -4
  35. package/bin/commands/resolve-review-guard.d.mts +19 -0
  36. package/bin/commands/resolve-review-guard.mjs +61 -0
  37. package/bin/commands/stack-merge-escalations.d.mts +6 -0
  38. package/bin/commands/stack-merge-escalations.mjs +17 -0
  39. package/bin/commands/stack-merge-plan.mjs +10 -6
  40. package/bin/comments/resolve.mjs +4 -4
  41. package/bin/comments/review-thread-markers.d.mts +1 -1
  42. package/bin/comments/review-thread-markers.mjs +23 -9
  43. package/bin/comments/superseded-approvals.d.mts +28 -0
  44. package/bin/comments/superseded-approvals.mjs +99 -0
  45. package/bin/config/schema.d.mts +2 -0
  46. package/bin/config/schema.mjs +1 -0
  47. package/bin/github/batch-parsers.mjs +31 -0
  48. package/bin/github/batch-raw-types.d.mts +3 -0
  49. package/bin/github/batch-viewer.d.mts +2 -2
  50. package/bin/github/batch.mjs +1 -1
  51. package/bin/github/gql/batch-pr-page.gql +8 -2
  52. package/bin/github/gql/batch-pr.gql +4 -1
  53. package/bin/github/poll-summary-review-helpers.d.mts +20 -0
  54. package/bin/github/poll-summary-review-helpers.mjs +81 -0
  55. package/bin/github/poll-summary-review.mjs +37 -46
  56. package/bin/github/poll-summary-rule-auto-resolve.mjs +1 -0
  57. package/bin/github/poll-summary-rule-items.d.mts +1 -1
  58. package/bin/github/poll-summary-rule-items.mjs +3 -2
  59. package/bin/github/rest-batch-snapshot.mjs +25 -1
  60. package/bin/github/review-unresolved-threads.d.mts +13 -0
  61. package/bin/github/review-unresolved-threads.mjs +152 -0
  62. package/bin/github/stack-handoff-page.mjs +5 -1
  63. package/bin/state/seen-comments.d.mts +3 -1
  64. package/bin/state/seen-comments.mjs +28 -2
  65. package/bin/types/escalate.d.mts +1 -0
  66. package/bin/types/github.d.mts +7 -1
  67. package/bin/types/iterate.d.mts +4 -2
  68. package/bin/types/report.d.mts +8 -0
  69. package/package.json +5 -5
  70. package/plugins/pr-shepherd/.claude-plugin/plugin.json +3 -3
  71. package/plugins/pr-shepherd/.codex-plugin/plugin.json +6 -6
  72. package/plugins/pr-shepherd/skills/setup-pr-shepherd/SKILL.md +1 -1
  73. package/plugins/pr-shepherd/skills/setup-pr-shepherd/references/classifiers.md +3 -3
  74. package/plugins/pr-shepherd/skills/setup-pr-shepherd/references/upstream-standard-rule.md +2 -2
  75. package/pr-shepherd.schema.json +4 -0
  76. package/src/classify/types.mts +9 -1
@@ -110,6 +110,8 @@ export interface ShepherdReport {
110
110
  editedSummaries: Review[];
111
111
  /** APPROVED reviews not yet minimized — opt-in minimize target. */
112
112
  approvedReviews: Review[];
113
+ /** Internal: APPROVED reviews superseded by a newer review from the same author, eligible for hiding when `iterate.minimize-superseded-approvals` is enabled. */
114
+ supersededApprovedReviews?: Review[];
113
115
  /**
114
116
  * Set only when `iterate.review-output-max-chars` held review items back this tick: `shown` of
115
117
  * `total` review items appear in this report. Held items are absent from every review list,
@@ -124,6 +126,12 @@ export interface ShepherdReport {
124
126
  * summaries are not minimized this tick. Not rendered.
125
127
  */
126
128
  heldThreadReviewIds?: string[];
129
+ /**
130
+ * Internal, iterate-only: parent review IDs of every unresolved review thread on the PR (after
131
+ * any in-run auto-resolve). Reviews in this set are not dismissed or minimized until their
132
+ * inline items are resolved. Not rendered.
133
+ */
134
+ unresolvedThreadReviewIds?: string[];
127
135
  /** COMMENTED review summary IDs matched by user rules with autoResolve:true — minimized without surfacing to agent. */
128
136
  ruleAutoResolveReviewSummaryIds?: string[];
129
137
  /** Branch protection rule for the PR's base branch. Null when no rule exists or the base ref is unavailable. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
5
5
  "keywords": [
6
6
  "automation",
@@ -12,15 +12,15 @@
12
12
  "github",
13
13
  "pull-request"
14
14
  ],
15
- "homepage": "https://jongleberry.com/pr-shepherd/",
15
+ "homepage": "https://jongleberry.github.io/pr-shepherd/",
16
16
  "bugs": {
17
- "url": "https://github.com/jonathanong/pr-shepherd/issues"
17
+ "url": "https://github.com/jongleberry/pr-shepherd/issues"
18
18
  },
19
19
  "license": "MIT",
20
20
  "author": "Jonathan Ong",
21
21
  "repository": {
22
22
  "type": "git",
23
- "url": "git+https://github.com/jonathanong/pr-shepherd.git"
23
+ "url": "git+https://github.com/jongleberry/pr-shepherd.git"
24
24
  },
25
25
  "bin": {
26
26
  "pr-shepherd": "bin/index.mjs",
@@ -88,7 +88,7 @@
88
88
  "husky": "^9.1.7",
89
89
  "knip": "^6.14.1",
90
90
  "marked": "^18.0.11",
91
- "oxfmt": "^0.78.0",
91
+ "oxfmt": "^0.79.0",
92
92
  "oxlint": "^1.60.0",
93
93
  "typescript": "^7.0.2",
94
94
  "vitest": "^5.0.0"
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
3
  "description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
4
- "version": "2.4.0",
4
+ "version": "2.5.0",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com"
8
8
  },
9
- "homepage": "https://github.com/jonathanong/pr-shepherd",
10
- "repository": "https://github.com/jonathanong/pr-shepherd",
9
+ "homepage": "https://github.com/jongleberry/pr-shepherd",
10
+ "repository": "https://github.com/jongleberry/pr-shepherd",
11
11
  "license": "MIT",
12
12
  "keywords": ["github", "pull-request", "ci", "code-review", "automation"],
13
13
  "skills": "./skills/",
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "pr-shepherd",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "Autonomous PR CI monitor and review-comment resolver for Codex.",
5
5
  "author": {
6
6
  "name": "Jonathan Ong",
7
7
  "email": "jonathanrichardong@gmail.com",
8
8
  "url": "https://github.com/jonathanong"
9
9
  },
10
- "homepage": "https://github.com/jonathanong/pr-shepherd",
11
- "repository": "https://github.com/jonathanong/pr-shepherd",
10
+ "homepage": "https://github.com/jongleberry/pr-shepherd",
11
+ "repository": "https://github.com/jongleberry/pr-shepherd",
12
12
  "license": "MIT",
13
13
  "keywords": ["github", "pull-request", "ci", "code-review", "automation", "codex"],
14
14
  "skills": "./skills/",
@@ -19,9 +19,9 @@
19
19
  "developerName": "Jonathan Ong",
20
20
  "category": "Coding",
21
21
  "capabilities": ["Interactive", "Write"],
22
- "websiteURL": "https://github.com/jonathanong/pr-shepherd",
23
- "privacyPolicyURL": "https://github.com/jonathanong/pr-shepherd",
24
- "termsOfServiceURL": "https://github.com/jonathanong/pr-shepherd",
22
+ "websiteURL": "https://github.com/jongleberry/pr-shepherd",
23
+ "privacyPolicyURL": "https://github.com/jongleberry/pr-shepherd",
24
+ "termsOfServiceURL": "https://github.com/jongleberry/pr-shepherd",
25
25
  "defaultPrompt": [
26
26
  "Check this PR with pr-shepherd",
27
27
  "Run pr-shepherd until this PR is ready",
@@ -14,7 +14,7 @@ Work through these steps in order. Skip any the request clearly does not need. `
14
14
  2. Match first against the bundled `classify.standard` rules and the existing config. Propose a custom rule only for what they do not cover. See [bot-comment classifiers](references/classifiers.md).
15
15
  3. Ask the user, in plain words, whether to put the config and any custom rules in this repository (`.pr-shepherdrc.yml`, `.pr-shepherd/classification/`) or in their own user configuration (`~/.pr-shepherdrc.yml`). Wait for the answer before writing files. Shared policy belongs in the repository; personal preferences belong in the home file.
16
16
  4. Configure with the smallest change that fits: `classify.standard`, `checks.never-cancel` for code-review workflows, and the polling, log, and comment-visibility settings in [noise settings](references/settings.md). Validate the result: Shepherd checks config before any GitHub call and exits 78 with the offending key on an invalid file, so a run against an open PR (or `pr-shepherd iterate <PR>`) confirms the file loads.
17
- 5. If a recurring bot comment is common enough to belong in the bundled set, offer to file an issue or open a PR on jonathanong/pr-shepherd. Only proceed with the user's OK; see [upstreaming a standard rule](references/upstream-standard-rule.md).
17
+ 5. If a recurring bot comment is common enough to belong in the bundled set, offer to file an issue or open a PR on jongleberry/pr-shepherd. Only proceed with the user's OK; see [upstreaming a standard rule](references/upstream-standard-rule.md).
18
18
 
19
19
  If the user asks only how to configure something, answer without editing files.
20
20
 
@@ -2,11 +2,11 @@
2
2
 
3
3
  Use a classification rule when the unwanted item has a recognizable author and message pattern. Inspect a representative item first so the rule does not hide other feedback from the same bot. Prefer an existing settings control for polling- or output-wide behavior.
4
4
 
5
- Check the bundled rules first. Under `classify.standard` in the active config file, `all: true` enables every rule, and a named boolean such as `codecov-report: false` overrides `all`. They cover vendor bot notices on conversation comments only: `claude-notices`, `coderabbit-notices`, `codecov-report`, `codex-notices`, `dependabot-notices`, `dependency-review-no-issues`, `gemini-notices`, `kilo-no-issues`, `snyk-no-issues`, `socket-reports`, `sonarqube-gate-passed`, `sourcery-notices`, and `sourcery-review-guide`. They do not match review summaries or inline review comments. Write a custom rule only when no bundled rule fits. If a name here is rejected as unknown, this list is stale for the installed version; trust the error.
5
+ Check the bundled rules first. Under `classify.standard` in the active config file, `all: true` enables every rule, and a named boolean such as `codecov-report: false` overrides `all`. They cover vendor bot notices on conversation comments (`claude-notices`, `coderabbit-notices`, `codecov-report`, `codex-notices`, `dependabot-notices`, `dependency-review-no-issues`, `gemini-notices`, `kilo-no-issues`, `snyk-no-issues`, `socket-reports`, `sonarqube-gate-passed`, `sourcery-notices`, and `sourcery-review-guide`), and `coderabbit-notices` also suppresses CodeRabbit chat rate-limit replies on review threads (`review-thread-reply`, suppress-only). They do not match review summaries or review-thread root comments. Write a custom rule only when no bundled rule fits. If a name here is rejected as unknown, this list is stale for the installed version; trust the error.
6
6
 
7
7
  Place an `.mjs` file in `.pr-shepherd/classification/` in the project. Shepherd uses the first classification directory on the working directory's ancestor chain; it stops at the home directory if reached, otherwise at the filesystem root. A home-level rule directory is not discovered when the project is outside the home tree. Rule directories do not merge. Files ending in `.ts`, `.mts`, `.mjs`, or `.js` load, except names beginning with `_` or `.`. Prefer `.mjs`; an `.mts` rule also works if it uses only erasable TypeScript syntax.
8
8
 
9
- Each file default-exports a `ClassifyRule` from `pr-shepherd/classify`. A rule receives one of `review-thread`, `pr-comment`, `review-summary`, or `changes-requested`, with `author`, `authorType`, `body`, `id`, and optional `url` or thread `path`. Match the observed `kind`, login, and distinctive body text. For example:
9
+ Each file default-exports a `ClassifyRule` from `pr-shepherd/classify`. A rule receives one of `review-thread`, `review-thread-reply`, `pr-comment`, `review-summary`, or `changes-requested`, with `author`, `authorType`, `body`, `id`, optional `url` or thread `path`, and `threadId` on `review-thread-reply`. Match the observed `kind`, login, and distinctive body text. For example:
10
10
 
11
11
  ```js
12
12
  /** @type {import("pr-shepherd/classify").ClassifyRule} */
@@ -20,6 +20,6 @@ const rule = (item) => {
20
20
  export default rule;
21
21
  ```
22
22
 
23
- `suppress: true` removes a matched item from agent output. Add `autoResolve: true` only when the requested policy also calls for resolving its thread or minimizing its comment or review summary. It is unsupported for `changes-requested` reviews, whose dismissal needs a message. Optional `reason` is printed and reported when the rule fires. With both flags, `actions.auto-minimize-suppressed: true` (the default) lets Shepherd perform the authorized mutation, then print a `## Classification auto-resolve` line and record `threads.autoResolved` / `comments.autoMinimized`. It does not append to the Shepherd Journal. Journal notes are optional agent-authored updates made only through an explicit `apply journal` call. Failed IDs stay on the generated `apply review` command and the failure is listed under that line. Set `actions.auto-minimize-suppressed: false` to keep the handoff without mutating or printing the line. When GitHub does not confirm capability, the item returns to normal first-look visibility. Matching rules combine their flags and keep every non-empty reason, so inspect existing rules before adding one.
23
+ `suppress: true` removes a matched item from agent output (on `review-thread-reply`, only that reply is removed from the thread). Add `autoResolve: true` only when the requested policy also calls for resolving its thread or minimizing its comment or review summary. It is unsupported for `changes-requested` reviews (whose dismissal needs a message) and `review-thread-reply` items. Optional `reason` is printed and reported when the rule fires. With both flags, `actions.auto-minimize-suppressed: true` (the default) lets Shepherd perform the authorized mutation, then print a `## Classification auto-resolve` line and record `threads.autoResolved` / `comments.autoMinimized`. It does not append to the Shepherd Journal. Journal notes are optional agent-authored updates made only through an explicit `apply journal` call. Failed IDs stay on the generated `apply review` command and the failure is listed under that line. Set `actions.auto-minimize-suppressed: false` to keep the handoff without mutating or printing the line. When GitHub does not confirm capability, the item returns to normal first-look visibility. Matching rules combine their flags and keep every non-empty reason, so inspect existing rules before adding one.
24
24
 
25
25
  Exercise the exported rule against the observed item and negative examples: a different author, kind, and substantive message from the same bot. Confirm only the intended item matches before enabling automatic resolution. After editing a rule, restart any long-running poll process; it caches loaded rule modules. A new CLI process loads the change. A classifier does not retroactively remove already displayed output.
@@ -2,12 +2,12 @@
2
2
 
3
3
  Use this when a recurring bot comment is common enough that most repositories would want it hidden, and no bundled `classify.standard` rule covers it. Do nothing here without the user's explicit OK, and let them review the text before it is sent.
4
4
 
5
- 1. Check for an existing proposal: `gh issue list --repo jonathanong/pr-shepherd --search "<bot login> in:title,body" --state all`. If one exists, tell the user instead of filing a duplicate.
5
+ 1. Check for an existing proposal: `gh issue list --repo jongleberry/pr-shepherd --search "<bot login> in:title,body" --state all`. If one exists, tell the user instead of filing a duplicate.
6
6
  2. Draft the proposal with:
7
7
  - the bot's author login and `authorType`;
8
8
  - the item `kind` (`pr-comment`, `review-summary`, `review-thread`);
9
9
  - a sanitized example body: remove secrets, private repository names, user names, internal URLs, and anything unrelated to the bot's boilerplate;
10
10
  - the match pattern you tested (the working custom rule from [bot-comment classifiers](classifiers.md) if one exists), plus a negative example that must stay visible;
11
11
  - how often it recurred and why it carries no actionable feedback.
12
- 3. Show the draft and ask the user whether to file an issue or open a PR. For an issue, run `gh issue create --repo jonathanong/pr-shepherd --title "<title>" --body-file <file>`. A PR needs a fork and a checkout of that repository, which this skill does not set up; offer the issue unless the user already has a checkout.
12
+ 3. Show the draft and ask the user whether to file an issue or open a PR. For an issue, run `gh issue create --repo jongleberry/pr-shepherd --title "<title>" --body-file <file>`. A PR needs a fork and a checkout of that repository, which this skill does not set up; offer the issue unless the user already has a checkout.
13
13
  4. Report the resulting URL. Keep using the local custom rule meanwhile.
@@ -123,6 +123,10 @@
123
123
  "default": false,
124
124
  "type": "boolean"
125
125
  },
126
+ "minimize-superseded-approvals": {
127
+ "default": true,
128
+ "type": "boolean"
129
+ },
126
130
  "minimize-comments": {
127
131
  "default": "bots",
128
132
  "type": "string",
@@ -11,6 +11,7 @@ export type CommentAuthorAssociation =
11
11
 
12
12
  export type ClassifyItemKind =
13
13
  | "review-thread"
14
+ | "review-thread-reply"
14
15
  | "pr-comment"
15
16
  | "review-summary"
16
17
  | "changes-requested";
@@ -30,6 +31,12 @@ export interface ClassifyReviewThread extends ClassifyItemBase {
30
31
  readonly path?: string | null;
31
32
  }
32
33
 
34
+ export interface ClassifyReviewThreadReply extends ClassifyItemBase {
35
+ readonly kind: "review-thread-reply";
36
+ readonly threadId: string;
37
+ readonly path?: string | null;
38
+ }
39
+
33
40
  export interface ClassifyPrComment extends ClassifyItemBase {
34
41
  readonly kind: "pr-comment";
35
42
  }
@@ -44,12 +51,13 @@ export interface ClassifyChangesRequested extends ClassifyItemBase {
44
51
 
45
52
  export type ClassifyItem =
46
53
  | ClassifyReviewThread
54
+ | ClassifyReviewThreadReply
47
55
  | ClassifyPrComment
48
56
  | ClassifyReviewSummary
49
57
  | ClassifyChangesRequested;
50
58
 
51
59
  export interface ClassifyAction {
52
- /** When true, routes the item's ID to the appropriate resolve/minimize GitHub mutation. Not supported for changes-requested reviews. */
60
+ /** When true, routes the item's ID to the appropriate resolve/minimize GitHub mutation. Not supported for changes-requested reviews or review-thread replies. */
53
61
  readonly autoResolve?: boolean;
54
62
  /** When true, hides the item from agent output (seen marker is still written). */
55
63
  readonly suppress?: boolean;