vouchington-tooling 0.87.1 → 1.0.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.
- package/README.md +1 -8
- package/dist/agent-blackboard/feedback-journal-audit.mjs +14 -6
- package/dist/agent-blackboard/feedback-journal-sandbox.d.mts +4 -2
- package/dist/agent-blackboard/feedback-journal-sandbox.mjs +14 -6
- package/dist/agent-blackboard/snapshot-cleanup-receipt.d.mts +2 -2
- package/dist/agent-blackboard/snapshot-cleanup-receipt.mjs +20 -12
- package/dist/agent-blackboard/snapshot-partition-cleanup.d.mts +1 -0
- package/dist/agent-blackboard/snapshot-partition-cleanup.mjs +3 -0
- package/dist/agent-blackboard/snapshot-partitions.mjs +1 -1
- package/dist/agent-blackboard/snapshot-types.d.mts +8 -0
- package/dist/audit-journal/audit-block.d.mts +2 -0
- package/dist/audit-journal/audit-block.mjs +13 -8
- package/dist/audit-journal/ci-failures.d.mts +6 -2
- package/dist/audit-journal/ci-failures.mjs +12 -6
- package/dist/audit-journal/journal.d.mts +2 -0
- package/dist/audit-journal/journal.mjs +18 -3
- package/dist/audit-journal/scope.d.mts +25 -0
- package/dist/audit-journal/scope.mjs +47 -0
- package/dist/audit-journal/types.d.mts +3 -0
- package/dist/cli/index.mjs +0 -6
- package/dist/cli/parse-forwarded-commands.d.mts +1 -1
- package/dist/cli/parse-forwarded-commands.mjs +0 -2
- package/dist/cli/parse.d.mts +1 -7
- package/dist/cli/parse.mjs +0 -1
- package/dist/cli/script-paths.mjs +0 -1
- package/dist/cli/usage-text.d.mts +1 -1
- package/dist/cli/usage-text.mjs +0 -6
- package/dist/gh-cli/exec.d.mts +8 -2
- package/dist/gh-cli/exec.mjs +3 -3
- package/dist/gha-review-payload/index.d.mts +0 -2
- package/dist/gha-review-payload/index.mjs +0 -1
- package/dist/index.d.mts +2 -8
- package/dist/index.mjs +1 -4
- package/dist/mcp-server/dispatch.mjs +1 -1
- package/dist/mcp-server/handlers-pr.mjs +1 -1
- package/dist/mcp-server/handlers-snapshot-cleanup.mjs +8 -0
- package/dist/mcp-server/handlers-snapshot-partition.mjs +6 -1
- package/dist/mcp-server/install-info.d.mts +2 -2
- package/dist/mcp-server/install-info.mjs +10 -6
- package/dist/mcp-server/pr-diff-size.d.mts +16 -0
- package/dist/mcp-server/pr-diff-size.mjs +49 -0
- package/dist/mcp-server/pr-live.d.mts +3 -0
- package/dist/mcp-server/pr-live.mjs +8 -2
- package/dist/mcp-server/pr-prepare.mjs +20 -12
- package/dist/mcp-server/server.mjs +2 -1
- package/dist/mcp-server/snapshot-recovery.d.mts +8 -0
- package/dist/mcp-server/snapshot-recovery.mjs +76 -0
- package/dist/mcp-server/snapshot-registry.d.mts +3 -1
- package/dist/mcp-server/snapshot-registry.mjs +3 -1
- package/dist/mcp-server/tools-pr.mjs +2 -1
- package/dist/mcp-server/tools.mjs +16 -5
- package/dist/mcp-server/worktree.mjs +4 -1
- package/docs/mcp-server.md +43 -10
- package/package.json +1 -16
- package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
- package/skills/agent-workflow/SKILL.md +7 -1
- package/skills/dependabot/SKILL.md +4 -3
- package/skills/final-review/references/orchestrator.md +3 -3
- package/skills/manifest.json +25 -33
- package/skills/planning/SKILL.md +3 -0
- package/skills/retrospective/SKILL.md +2 -1
- package/skills/review-ci-logs/SKILL.md +2 -0
- package/skills/stacked-prs/SKILL.md +8 -2
- package/skills/stacked-prs/references/drain.md +3 -1
- package/skills/triage-loop/SKILL.md +125 -21
- package/skills/triage-loop/references/shepherd.md +45 -0
- package/skills/triage-prs/SKILL.md +15 -18
- package/skills/triage-prs/references/rubric.md +2 -2
- package/skills/triage-sweep/SKILL.md +40 -12
- package/dist/gha-check-run/cli.d.mts +0 -2
- package/dist/gha-check-run/cli.mjs +0 -81
- package/dist/gha-check-run/github.d.mts +0 -30
- package/dist/gha-check-run/github.mjs +0 -63
- package/dist/gha-check-run/index.d.mts +0 -2
- package/dist/gha-check-run/index.mjs +0 -2
- package/dist/gha-claude-post-review/index.d.mts +0 -3
- package/dist/gha-claude-post-review/index.mjs +0 -2
- package/dist/gha-post-review/claude-token.d.mts +0 -25
- package/dist/gha-post-review/claude-token.mjs +0 -109
- package/dist/gha-post-review/cli.d.mts +0 -1
- package/dist/gha-post-review/cli.mjs +0 -22
- package/dist/gha-post-review/github.d.mts +0 -13
- package/dist/gha-post-review/github.mjs +0 -58
- package/dist/gha-post-review/index.d.mts +0 -13
- package/dist/gha-post-review/index.mjs +0 -8
- package/dist/gha-post-review/post.d.mts +0 -24
- package/dist/gha-post-review/post.mjs +0 -39
- package/dist/gha-post-review/pull-io.d.mts +0 -13
- package/dist/gha-post-review/pull-io.mjs +0 -88
- package/dist/gha-post-review/token.d.mts +0 -9
- package/dist/gha-post-review/token.mjs +0 -21
- package/dist/gha-review-payload/cli.d.mts +0 -1
- package/dist/gha-review-payload/cli.mjs +0 -24
- package/dist/gha-review-payload/file.d.mts +0 -7
- package/dist/gha-review-payload/file.mjs +0 -62
- package/scripts/gha/materialize-pr-context.sh +0 -123
- package/skills/ready-and-shepherd/SKILL.md +0 -110
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Materialize PR title, body, files, diff, comments, and linked issue/PR
|
|
3
|
-
# threads so a review agent does not need gh or bash.
|
|
4
|
-
set -euo pipefail
|
|
5
|
-
|
|
6
|
-
PR_NUMBER="${PR_NUMBER:?PR_NUMBER is required}"
|
|
7
|
-
GITHUB_REPOSITORY="${GITHUB_REPOSITORY:?GITHUB_REPOSITORY is required}"
|
|
8
|
-
GITHUB_WORKSPACE="${GITHUB_WORKSPACE:?GITHUB_WORKSPACE is required}"
|
|
9
|
-
MAX_MATERIALIZED="${MAX_MATERIALIZED:-20}"
|
|
10
|
-
MAX_SEEN="${MAX_SEEN:-40}"
|
|
11
|
-
|
|
12
|
-
case "$MAX_MATERIALIZED" in
|
|
13
|
-
*[!0-9]* | '')
|
|
14
|
-
echo "materialize-pr-context: MAX_MATERIALIZED must be a non-negative integer" >&2
|
|
15
|
-
exit 2
|
|
16
|
-
;;
|
|
17
|
-
esac
|
|
18
|
-
case "$MAX_SEEN" in
|
|
19
|
-
*[!0-9]* | '')
|
|
20
|
-
echo "materialize-pr-context: MAX_SEEN must be a non-negative integer" >&2
|
|
21
|
-
exit 2
|
|
22
|
-
;;
|
|
23
|
-
esac
|
|
24
|
-
|
|
25
|
-
review_context="${REVIEW_CONTEXT_DIR:-${GITHUB_WORKSPACE}/.review-context}"
|
|
26
|
-
rm -rf "$review_context"
|
|
27
|
-
mkdir -p "$review_context/issues"
|
|
28
|
-
|
|
29
|
-
extract_issue_numbers() {
|
|
30
|
-
grep -oE "(https://github.com/${GITHUB_REPOSITORY}/(issues|pull)/[0-9]+|#[0-9]+)" |
|
|
31
|
-
grep -oE '[0-9]+' ||
|
|
32
|
-
true
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
enqueue_from_text() {
|
|
36
|
-
local seen_file="$1"
|
|
37
|
-
local queue_file="$2"
|
|
38
|
-
local materialized_file="$3"
|
|
39
|
-
local number
|
|
40
|
-
while IFS= read -r number; do
|
|
41
|
-
[ -n "$number" ] || continue
|
|
42
|
-
[ "$number" = "$PR_NUMBER" ] && continue
|
|
43
|
-
grep -qxF "$number" "$seen_file" && continue
|
|
44
|
-
if [ "$(wc -l <"$materialized_file" | tr -d ' ')" -ge "$MAX_MATERIALIZED" ]; then
|
|
45
|
-
return 0
|
|
46
|
-
fi
|
|
47
|
-
if [ "$(wc -l <"$seen_file" | tr -d ' ')" -ge "$MAX_SEEN" ]; then
|
|
48
|
-
return 0
|
|
49
|
-
fi
|
|
50
|
-
printf '%s\n' "$number" >>"$seen_file"
|
|
51
|
-
printf '%s\n' "$number" >>"$queue_file"
|
|
52
|
-
done
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" \
|
|
56
|
-
--json title,body,url,author,baseRefName,headRefName,headRefOid \
|
|
57
|
-
>"$review_context/pr.json"
|
|
58
|
-
gh api --paginate --slurp "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files?per_page=100" |
|
|
59
|
-
jq 'add // []' >"$review_context/files.json"
|
|
60
|
-
if ! gh pr diff "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" >"$review_context/pr.diff"; then
|
|
61
|
-
printf 'PR diff unavailable (GitHub limits patch responses to 300 files). Use files.json.\n' \
|
|
62
|
-
>"$review_context/pr.diff"
|
|
63
|
-
fi
|
|
64
|
-
gh api --paginate --slurp "repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments?per_page=100" |
|
|
65
|
-
jq 'add // []' >"$review_context/pr-comments.json"
|
|
66
|
-
gh api --paginate --slurp "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/comments?per_page=100" |
|
|
67
|
-
jq 'add // []' >"$review_context/pr-review-comments.json"
|
|
68
|
-
gh api --paginate --slurp "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/reviews?per_page=100" |
|
|
69
|
-
jq 'add // []' >"$review_context/pr-reviews.json"
|
|
70
|
-
|
|
71
|
-
seen_file="${review_context}/.seen"
|
|
72
|
-
queue_file="${review_context}/.queue"
|
|
73
|
-
materialized_file="${review_context}/.materialized"
|
|
74
|
-
: >"$seen_file"
|
|
75
|
-
: >"$queue_file"
|
|
76
|
-
: >"$materialized_file"
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
jq -r '.body // ""' "$review_context/pr.json"
|
|
80
|
-
jq -r '.[].body // ""' "$review_context/pr-comments.json"
|
|
81
|
-
jq -r '.[].body // ""' "$review_context/pr-review-comments.json"
|
|
82
|
-
jq -r '.[].body // ""' "$review_context/pr-reviews.json"
|
|
83
|
-
} | extract_issue_numbers | enqueue_from_text "$seen_file" "$queue_file" "$materialized_file"
|
|
84
|
-
|
|
85
|
-
index=1
|
|
86
|
-
while true; do
|
|
87
|
-
if [ "$(wc -l <"$materialized_file" | tr -d ' ')" -ge "$MAX_MATERIALIZED" ]; then
|
|
88
|
-
break
|
|
89
|
-
fi
|
|
90
|
-
issue_number="$(sed -n "${index}p" "$queue_file")"
|
|
91
|
-
[ -n "$issue_number" ] || break
|
|
92
|
-
index=$((index + 1))
|
|
93
|
-
if ! gh api "repos/${GITHUB_REPOSITORY}/issues/${issue_number}" \
|
|
94
|
-
--jq '{number,title,body,url,pull_request}' \
|
|
95
|
-
>"$review_context/issues/${issue_number}.json"; then
|
|
96
|
-
rm -f "$review_context/issues/${issue_number}.json"
|
|
97
|
-
continue
|
|
98
|
-
fi
|
|
99
|
-
printf '%s\n' "$issue_number" >>"$materialized_file"
|
|
100
|
-
gh api --paginate --slurp \
|
|
101
|
-
"repos/${GITHUB_REPOSITORY}/issues/${issue_number}/comments?per_page=100" |
|
|
102
|
-
jq 'add // []' >"$review_context/issues/${issue_number}-comments.json" ||
|
|
103
|
-
printf '[]\n' >"$review_context/issues/${issue_number}-comments.json"
|
|
104
|
-
{
|
|
105
|
-
jq -r '.body // ""' "$review_context/issues/${issue_number}.json"
|
|
106
|
-
jq -r '.[].body // ""' "$review_context/issues/${issue_number}-comments.json"
|
|
107
|
-
if jq -e '.pull_request != null' "$review_context/issues/${issue_number}.json" >/dev/null; then
|
|
108
|
-
gh api --paginate --slurp \
|
|
109
|
-
"repos/${GITHUB_REPOSITORY}/pulls/${issue_number}/comments?per_page=100" |
|
|
110
|
-
jq 'add // []' >"$review_context/issues/${issue_number}-review-comments.json" ||
|
|
111
|
-
printf '[]\n' >"$review_context/issues/${issue_number}-review-comments.json"
|
|
112
|
-
gh api --paginate --slurp \
|
|
113
|
-
"repos/${GITHUB_REPOSITORY}/pulls/${issue_number}/reviews?per_page=100" |
|
|
114
|
-
jq 'add // []' >"$review_context/issues/${issue_number}-reviews.json" ||
|
|
115
|
-
printf '[]\n' >"$review_context/issues/${issue_number}-reviews.json"
|
|
116
|
-
jq -r '.[].body // ""' "$review_context/issues/${issue_number}-review-comments.json"
|
|
117
|
-
jq -r '.[].body // ""' "$review_context/issues/${issue_number}-reviews.json"
|
|
118
|
-
fi
|
|
119
|
-
} | extract_issue_numbers | enqueue_from_text "$seen_file" "$queue_file" "$materialized_file"
|
|
120
|
-
done
|
|
121
|
-
|
|
122
|
-
rm -f "$seen_file" "$queue_file" "$materialized_file"
|
|
123
|
-
printf 'Materialized PR #%s context in %s\n' "$PR_NUMBER" "$review_context"
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: ready-and-shepherd
|
|
3
|
-
description: Move an authorized, triaged PR to ready, steer it, arm auto-merge, and hand it to a shepherd.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Ready and shepherd
|
|
7
|
-
|
|
8
|
-
Read applicable `AGENTS.md` and their declared adapter alias, otherwise
|
|
9
|
-
`.agents/skills/ready-and-shepherd/SKILL.md` from the repository root if present.
|
|
10
|
-
Local policy overrides these defaults; do not reload an already-read adapter or canonical skill.
|
|
11
|
-
|
|
12
|
-
Internal mechanics for batch triage callers (`triage-prs`, `triage-sweep`, or a consumer's
|
|
13
|
-
security-triage adapter). It moves a PR
|
|
14
|
-
those callers already reviewed to ready and hands it to a shepherd. It is not a general "mark any
|
|
15
|
-
draft ready" tool: a session working its own single PR runs pr-shepherd directly under the
|
|
16
|
-
CANCEL/ESCALATE contract and lets pr-shepherd own the draft-to-ready transition.
|
|
17
|
-
|
|
18
|
-
Arguments: a PR number or URL, `--repo <owner>/<name>`, optional `--arm-auto-merge`, and optional
|
|
19
|
-
`--steer-file <path>`. Pass `--repo` on every `gh` command.
|
|
20
|
-
|
|
21
|
-
## Adapter parameters
|
|
22
|
-
|
|
23
|
-
Resolve these before Step 1 and stop to ask when one this run needs is missing; never guess.
|
|
24
|
-
|
|
25
|
-
- **Shepherd mode:** `comment` (post an exact trigger comment that starts a CI-dispatched
|
|
26
|
-
shepherd, fire-and-forget) or `local` (the caller runs pr-shepherd in a background worker until
|
|
27
|
-
CANCEL/ESCALATE). Repositories without a CI shepherd workflow use `local`.
|
|
28
|
-
- **Trigger comment and activation gates** (`comment` mode only): the exact trigger body and the
|
|
29
|
-
repository variables that must all read `true` before any mutation.
|
|
30
|
-
- **Automation label:** applied idempotently to every PR this skill readies.
|
|
31
|
-
- **Merge authority:** who authorizes `--arm-auto-merge` for which PR categories.
|
|
32
|
-
|
|
33
|
-
## Step 1 - Resolve and light review
|
|
34
|
-
|
|
35
|
-
Resolve the PR in `--repo`; reject one from another repository. Record `headRefOid`, read the diff
|
|
36
|
-
and CI state, and decide whether the shepherd needs direction (for example "prefer the general fix
|
|
37
|
-
over a narrow band-aid"). Write steering with a file-writing tool, never shell interpolation, and
|
|
38
|
-
read it back in full. With `--steer-file`, use that file instead.
|
|
39
|
-
|
|
40
|
-
## Step 2 - Activation preflight (fail closed)
|
|
41
|
-
|
|
42
|
-
Before any GitHub mutation, in `comment` mode read every adapter activation gate. An unset,
|
|
43
|
-
unreadable, empty, or non-`true` gate is disabled: stop before Step 3 and report
|
|
44
|
-
`activation disabled - unchanged`. Do not post steering, mark ready, add labels, arm, or trigger.
|
|
45
|
-
`local` mode has no gates; its preflight is that the caller can start a background worker.
|
|
46
|
-
|
|
47
|
-
Re-read `headRefOid` before every mutation below; if it moved, return to the caller for re-review.
|
|
48
|
-
|
|
49
|
-
## Step 3 - Steer (optional)
|
|
50
|
-
|
|
51
|
-
Post the reviewed steering file as an ordinary comment with `--body-file`, **before** arming or
|
|
52
|
-
triggering. Reject an empty file or one whose whole trimmed content equals the trigger comment.
|
|
53
|
-
|
|
54
|
-
## Step 4 - Mark ready and label
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
gh pr view <N> --repo <owner>/<name> --json isDraft --jq .isDraft # true -> gh pr ready
|
|
58
|
-
gh pr edit <N> --repo <owner>/<name> --add-label <automation-label>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Step 5 - Arm auto-merge (only with `--arm-auto-merge`)
|
|
62
|
-
|
|
63
|
-
Without the flag, skip this step; merge stays a human decision. Pass the flag only when the caller
|
|
64
|
-
holds merge authority for this PR's category under the adapter.
|
|
65
|
-
|
|
66
|
-
Check once per repository per run that auto-merge is allowed
|
|
67
|
-
(`gh api repos/<owner>/<name> --jq .allow_auto_merge`). When it is `false`, report
|
|
68
|
-
`manual merge required` and continue to Step 6. When the REST pull object has a `stack` field,
|
|
69
|
-
auto-merge is unavailable: report `stacked; needs explicit stack-merge authorization`, skip Steps 6
|
|
70
|
-
and 7, and follow [stacked-prs](../stacked-prs/SKILL.md) only under explicit human approval.
|
|
71
|
-
|
|
72
|
-
- **Unsteered:** arm now with exactly one bare command, never wrapped or compounded:
|
|
73
|
-
`gh pr merge <N> --repo <owner>/<name> --auto --squash`. Arming succeeds on a conflicting branch;
|
|
74
|
-
the shepherd resolves the conflict and the armed merge lands once checks pass.
|
|
75
|
-
- **Steered:** do not arm. Arming would race the shepherd before it consumes the steering. Leave the
|
|
76
|
-
PR ready and unarmed; report `manual-verification-required`.
|
|
77
|
-
|
|
78
|
-
## Step 6 - Hand off to the shepherd
|
|
79
|
-
|
|
80
|
-
Never run two shepherds on one PR. Before any handoff, skip the PR and report
|
|
81
|
-
`shepherd: already in flight` when either of these holds:
|
|
82
|
-
|
|
83
|
-
- **`comment` mode:** a trigger comment exists that is newer than the PR's latest commit.
|
|
84
|
-
- **`local` mode:** the caller's state lists an active worker for this PR.
|
|
85
|
-
|
|
86
|
-
Record every handoff (PR, head, mode, trigger comment id or worker id, time) in the caller's state
|
|
87
|
-
so the next pass sees it.
|
|
88
|
-
|
|
89
|
-
- **`comment` mode:** if the PR is still `OPEN`, post exactly the trigger body with
|
|
90
|
-
`gh api -X POST repos/<owner>/<name>/issues/<N>/comments -f body=<trigger> --jq .id` and record
|
|
91
|
-
the comment id. Dispatch is fire-and-forget: a `running` checkpoint proves acceptance, not
|
|
92
|
-
success. Never poll the dispatch workflow or arm later from a `queued` or `running` state.
|
|
93
|
-
- **`local` mode:** return `shepherd: local` to the caller, which starts one background worker in
|
|
94
|
-
an isolated worktree. The worker reruns `pr-shepherd <owner>/<name>#<N> --until-terminal` after
|
|
95
|
-
every result except CANCEL and ESCALATE:
|
|
96
|
-
- TRIAGE: fix the items, then rerun.
|
|
97
|
-
- READY or a quota warning: rerun after the delay the output names.
|
|
98
|
-
- MERGE: the worker never merges. It reports the PR as mergeable to the caller and stops.
|
|
99
|
-
|
|
100
|
-
On ESCALATE, it reports back to the caller, which escalates. Remove the worker from the caller's
|
|
101
|
-
state when it stops.
|
|
102
|
-
|
|
103
|
-
## Step 7 - Verify and report
|
|
104
|
-
|
|
105
|
-
`gh pr view <N> --repo <owner>/<name> --json isDraft,autoMergeRequest,state`. Report per PR:
|
|
106
|
-
`ready`, `steered`, `auto-merge armed` (yes, no, manual-verification-required, unavailable),
|
|
107
|
-
`shepherd` (comment id, local, or no), and the reason for any `no`.
|
|
108
|
-
|
|
109
|
-
Consumer wrapper owns: shepherd mode, trigger body and activation gates, the automation label, merge
|
|
110
|
-
authority by PR category, and any provider-specific handoff variants.
|