pr-shepherd 0.46.4 → 0.46.6
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.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -2
- package/bin/api.d.mts +1 -1
- package/bin/checks/triage.mjs +12 -1
- package/bin/cli/api-usage-formatter.mjs +1 -1
- package/bin/cli/body-truncate.d.mts +12 -0
- package/bin/cli/body-truncate.mjs +123 -0
- package/bin/cli/fix-formatter-extra.d.mts +2 -1
- package/bin/cli/fix-formatter-extra.mjs +18 -3
- package/bin/cli/fix-formatter.d.mts +3 -1
- package/bin/cli/fix-formatter.mjs +39 -13
- package/bin/cli/iterate-checks-formatter.mjs +8 -6
- package/bin/cli/iterate-formatter.mjs +10 -9
- package/bin/cli/iterate-instructions.mjs +3 -3
- package/bin/cli/iterate-lean.mjs +2 -0
- package/bin/cli/iterate-merge-formatter.d.mts +3 -1
- package/bin/cli/iterate-merge-formatter.mjs +15 -0
- package/bin/cli/list-formatters.d.mts +4 -3
- package/bin/cli/list-formatters.mjs +22 -14
- package/bin/commands/check-annotations.d.mts +15 -0
- package/bin/commands/check-annotations.mjs +23 -1
- package/bin/commands/check.d.mts +1 -0
- package/bin/commands/check.mjs +68 -32
- package/bin/commands/iterate/check-instructions.mjs +4 -4
- package/bin/commands/iterate/index.mjs +18 -5
- package/bin/commands/iterate/merge-state.d.mts +6 -1
- package/bin/commands/iterate/merge-state.mjs +42 -1
- package/bin/commands/iterate/render.mjs +2 -2
- package/bin/config/load.d.mts +10 -0
- package/bin/config/load.mjs +17 -1
- package/bin/config.json +4 -2
- package/bin/mcp/server.mjs +18 -6
- package/bin/quota-warning.mjs +1 -1
- package/bin/types/iterate.d.mts +10 -0
- package/bin/types/merge-queue.d.mts +16 -0
- package/package.json +9 -6
- package/plugins/pr-shepherd/.codex-plugin/plugin.json +1 -1
- package/plugins/pr-shepherd/.codex.mcp.json +1 -1
- package/plugins/pr-shepherd/.mcp.json +1 -1
- package/plugins/pr-shepherd/skills/pr-shepherd/SKILL.md +11 -11
|
@@ -11,3 +11,19 @@ export interface MergeQueueReport {
|
|
|
11
11
|
/** The current PR head is not a parent of the removed synthetic queue commit. */
|
|
12
12
|
headUpdatedAfterRemoval?: true;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Raw counts of actionable work held back while the PR sits in the merge queue
|
|
16
|
+
* (`actions.workWhileQueued` is `false`, the default) — a Shepherd-initiated push
|
|
17
|
+
* or mutation right now would eject the PR. Omitted entirely once every count is
|
|
18
|
+
* zero. Not emitted for checks/annotations/conflicts: those always surface via
|
|
19
|
+
* `fix_code` immediately regardless of queue membership.
|
|
20
|
+
*/
|
|
21
|
+
export interface IterateDeferredWork {
|
|
22
|
+
/** Unique review threads across actionable, resolution-only, first-look, and rule-auto-resolve. */
|
|
23
|
+
threads: number;
|
|
24
|
+
/** Unique PR comments across actionable, minimize-queued, and first-look. */
|
|
25
|
+
comments: number;
|
|
26
|
+
changesRequestedReviews: number;
|
|
27
|
+
/** Unique review summaries across the minimize queue, first-look, edited, and (if opted in) surfaced approvals. */
|
|
28
|
+
reviewSummaries: number;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pr-shepherd",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.6",
|
|
4
4
|
"description": "Autonomous PR CI monitor and review-comment resolver for agentic coding tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"automation",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"github",
|
|
13
13
|
"pull-request"
|
|
14
14
|
],
|
|
15
|
-
"homepage": "https://
|
|
15
|
+
"homepage": "https://jongleberry.com/pr-shepherd/",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/jonathanong/pr-shepherd/issues"
|
|
18
18
|
},
|
|
@@ -67,12 +67,14 @@
|
|
|
67
67
|
"knip": "knip",
|
|
68
68
|
"knip:production": "knip --production",
|
|
69
69
|
"lint:dead-code": "npm run --silent knip && npm run --silent knip:production",
|
|
70
|
-
"lint": "oxlint src/ test-helpers/ fixtures/*.mts test-cases/ plugins/ .agents/plugins/ && npm run --silent lint:dead-code",
|
|
71
|
-
"format": "oxfmt src/ test-helpers/ fixtures/*.mts test-cases/*.mts plugins/ .agents/plugins/ docs/ README.md",
|
|
72
|
-
"format:check": "oxfmt --check src/ test-helpers/ fixtures/*.mts test-cases/*.mts plugins/ .agents/plugins/ docs/ README.md",
|
|
70
|
+
"lint": "oxlint src/ test-helpers/ fixtures/*.mts test-cases/ plugins/ .agents/plugins/ site/build.mjs site/serve.mjs site/lib/ && npm run --silent lint:dead-code",
|
|
71
|
+
"format": "oxfmt src/ test-helpers/ fixtures/*.mts test-cases/*.mts plugins/ .agents/plugins/ docs/ README.md site/build.mjs site/serve.mjs site/lib/",
|
|
72
|
+
"format:check": "oxfmt --check src/ test-helpers/ fixtures/*.mts test-cases/*.mts plugins/ .agents/plugins/ docs/ README.md site/build.mjs site/serve.mjs site/lib/",
|
|
73
73
|
"test": "vitest run",
|
|
74
74
|
"test:coverage": "vitest run --coverage && node scripts/strip-lcov-branches.mjs",
|
|
75
|
-
"test:watch": "vitest"
|
|
75
|
+
"test:watch": "vitest",
|
|
76
|
+
"site:build": "node site/build.mjs",
|
|
77
|
+
"site:serve": "node site/serve.mjs"
|
|
76
78
|
},
|
|
77
79
|
"dependencies": {
|
|
78
80
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
@@ -86,6 +88,7 @@
|
|
|
86
88
|
"@vitest/coverage-v8": "^4.1.4",
|
|
87
89
|
"husky": "^9.1.7",
|
|
88
90
|
"knip": "^6.14.1",
|
|
91
|
+
"marked": "^18.0.11",
|
|
89
92
|
"oxfmt": "^0.64.0",
|
|
90
93
|
"oxlint": "^1.60.0",
|
|
91
94
|
"typescript": "^7.0.2",
|
|
@@ -8,7 +8,7 @@ allowed-tools: ["MCP", "Bash", "Read", "Grep", "Glob", "Edit", "Write"]
|
|
|
8
8
|
|
|
9
9
|
# pr-shepherd
|
|
10
10
|
|
|
11
|
-
Thin dispatcher for creating or iterating a PR. Poll with the CLI; use MCP `iterate` only when the CLI is unavailable.
|
|
11
|
+
Thin dispatcher for creating or iterating a PR. Poll with the CLI; use MCP `iterate` only when the CLI is unavailable. Keep invoking until `[CANCEL]` or `[ESCALATE]`. Do not wait for CI to finish before the next Shepherd step — fetching check logs is fine; blocking on `gh pr checks`, `gh pr watch`, `gh run watch`, or equivalent GitHub MCP check waiters is not. Shepherd already returns CI plus review comments, and waiting for CI before applying review feedback wastes CI.
|
|
12
12
|
|
|
13
13
|
## PR creation authorization
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ If the requested PR does not exist yet, review and commit the in-scope changes,
|
|
|
24
24
|
|
|
25
25
|
3. Print the full result and follow every returned `## Instructions` step exactly. For CLI output, run each printed mutation command when instructed. For MCP output, use MCP `apply` and `build_suggestion_patches` with the same qualified PR reference; do not run a shell `pr-shepherd apply` command.
|
|
26
26
|
|
|
27
|
-
4. After completing the returned instructions, repeat step 2 with the same target and canonical options unless the action is `[CANCEL]` or `[ESCALATE]`, or the human directs you to stop. Preserve `--until-terminal` and any requested `--merge`; apply any polling-cadence adjustment printed by the CLI. Every other action is non-terminal: complete its instructions and rerun without asking whether to continue. `[FIX_CODE]` is always non-terminal, and only `[ESCALATE]` hands work to a human.
|
|
27
|
+
4. After completing the returned instructions, immediately repeat step 2 with the same target and canonical options unless the action is `[CANCEL]` or `[ESCALATE]`, or the human directs you to stop. Preserve `--until-terminal` and any requested `--merge`; apply any polling-cadence adjustment printed by the CLI. Every other action is non-terminal: complete its instructions and rerun without asking whether to continue. `[FIX_CODE]` is always non-terminal, and only `[ESCALATE]` hands work to a human. After a push or `rerun:`, do not wait for CI to finish first — you may pull check logs, but do not poll with `gh pr checks`, `gh pr watch`, `gh run watch`, or equivalent GitHub MCP check waiters.
|
|
28
28
|
|
|
29
29
|
## Playbooks
|
|
30
30
|
|
|
@@ -50,15 +50,15 @@ A `[rerun authorized]` tag with a `rerun:` command means the viewer's repository
|
|
|
50
50
|
|
|
51
51
|
When several bullets share one runId (matrix jobs from the same run), the `rerun:` command is printed once, on the first bullet; every bullet for that runId still carries `[rerun authorized]` and is covered by that single command — do not run it more than once.
|
|
52
52
|
|
|
53
|
-
| Tag / kind | Do
|
|
54
|
-
| ------------------------------------------------------------------------ |
|
|
55
|
-
| GitHub Actions failure (has a run ID, not `CANCELLED`/`STARTUP_FAILURE`) | Read the included log excerpt. Apply a warranted code fix, or run the printed `rerun:` command when the evidence indicates a transient failure, then iterate
|
|
56
|
-
| Transient infrastructure failure | Run the `rerun:` command when present, then iterate
|
|
57
|
-
| Real test or build failure | Apply a code fix — do not rerun, even if `[rerun authorized]` is shown.
|
|
58
|
-
| `[conclusion: CANCELLED]` | No log excerpt is rendered. Run the printed `rerun:` command, then iterate
|
|
59
|
-
| `[conclusion: STARTUP_FAILURE]` | No log excerpt is rendered. Run the printed `rerun:` command, then iterate
|
|
60
|
-
| `[conclusion: ACTION_REQUIRED]` | This appears in `[FIX_CODE]` only alongside other autonomous work. Complete that work and iterate; Shepherd returns `[ESCALATE]` if manual workflow approval remains necessary.
|
|
61
|
-
| `external` (no run ID, has a URL) | Treat the URL as an autonomous investigation path: inspect the provider or reproduce the failure locally, apply any warranted fix, and iterate. A non-empty external URL does not trigger `[ESCALATE]` by itself.
|
|
53
|
+
| Tag / kind | Do |
|
|
54
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
55
|
+
| GitHub Actions failure (has a run ID, not `CANCELLED`/`STARTUP_FAILURE`) | Read the included log excerpt. Apply a warranted code fix, or run the printed `rerun:` command when the evidence indicates a transient failure, then iterate immediately. Missing autonomous follow-up becomes `[ESCALATE]` when no other work remains. |
|
|
56
|
+
| Transient infrastructure failure | Run the `rerun:` command when present, then iterate immediately. Do not wait for the rerun to finish. If no command is present, complete any other surfaced work and iterate; Shepherd owns any later `[ESCALATE]`. |
|
|
57
|
+
| Real test or build failure | Apply a code fix — do not rerun, even if `[rerun authorized]` is shown. |
|
|
58
|
+
| `[conclusion: CANCELLED]` | No log excerpt is rendered. Run the printed `rerun:` command, then iterate immediately. Do not wait for the rerun to finish. Without a command, complete any other work and iterate; Shepherd escalates when this remains the only blocker. |
|
|
59
|
+
| `[conclusion: STARTUP_FAILURE]` | No log excerpt is rendered. Run the printed `rerun:` command, then iterate immediately. Do not wait for the rerun to finish. Without a command, complete any other work and iterate; Shepherd escalates when this remains the only blocker. |
|
|
60
|
+
| `[conclusion: ACTION_REQUIRED]` | This appears in `[FIX_CODE]` only alongside other autonomous work. Complete that work and iterate; Shepherd returns `[ESCALATE]` if manual workflow approval remains necessary. |
|
|
61
|
+
| `external` (no run ID, has a URL) | Treat the URL as an autonomous investigation path: inspect the provider or reproduce the failure locally, apply any warranted fix, and iterate. A non-empty external URL does not trigger `[ESCALATE]` by itself. |
|
|
62
62
|
|
|
63
63
|
### Review-mutation mechanics
|
|
64
64
|
|