pr-shepherd 2.4.1 → 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 (70) 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/resolve-mutate.mjs +39 -4
  32. package/bin/commands/resolve-review-guard.d.mts +19 -0
  33. package/bin/commands/resolve-review-guard.mjs +61 -0
  34. package/bin/comments/resolve.mjs +4 -4
  35. package/bin/comments/review-thread-markers.d.mts +1 -1
  36. package/bin/comments/review-thread-markers.mjs +23 -9
  37. package/bin/comments/superseded-approvals.d.mts +28 -0
  38. package/bin/comments/superseded-approvals.mjs +99 -0
  39. package/bin/config/schema.d.mts +2 -0
  40. package/bin/config/schema.mjs +1 -0
  41. package/bin/github/batch-parsers.mjs +31 -0
  42. package/bin/github/batch-raw-types.d.mts +3 -0
  43. package/bin/github/batch-viewer.d.mts +2 -2
  44. package/bin/github/batch.mjs +1 -1
  45. package/bin/github/gql/batch-pr-page.gql +8 -2
  46. package/bin/github/gql/batch-pr.gql +4 -1
  47. package/bin/github/poll-summary-review-helpers.d.mts +20 -0
  48. package/bin/github/poll-summary-review-helpers.mjs +81 -0
  49. package/bin/github/poll-summary-review.mjs +37 -46
  50. package/bin/github/poll-summary-rule-auto-resolve.mjs +1 -0
  51. package/bin/github/poll-summary-rule-items.d.mts +1 -1
  52. package/bin/github/poll-summary-rule-items.mjs +3 -2
  53. package/bin/github/rest-batch-snapshot.mjs +25 -1
  54. package/bin/github/review-unresolved-threads.d.mts +13 -0
  55. package/bin/github/review-unresolved-threads.mjs +152 -0
  56. package/bin/github/stack-handoff-page.mjs +5 -1
  57. package/bin/state/seen-comments.d.mts +3 -1
  58. package/bin/state/seen-comments.mjs +28 -2
  59. package/bin/types/escalate.d.mts +1 -0
  60. package/bin/types/github.d.mts +7 -1
  61. package/bin/types/iterate.d.mts +4 -2
  62. package/bin/types/report.d.mts +8 -0
  63. package/package.json +5 -5
  64. package/plugins/pr-shepherd/.claude-plugin/plugin.json +3 -3
  65. package/plugins/pr-shepherd/.codex-plugin/plugin.json +6 -6
  66. package/plugins/pr-shepherd/skills/setup-pr-shepherd/SKILL.md +1 -1
  67. package/plugins/pr-shepherd/skills/setup-pr-shepherd/references/classifiers.md +3 -3
  68. package/plugins/pr-shepherd/skills/setup-pr-shepherd/references/upstream-standard-rule.md +2 -2
  69. package/pr-shepherd.schema.json +4 -0
  70. package/src/classify/types.mts +9 -1
@@ -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;