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.
Files changed (97) hide show
  1. package/README.md +1 -8
  2. package/dist/agent-blackboard/feedback-journal-audit.mjs +14 -6
  3. package/dist/agent-blackboard/feedback-journal-sandbox.d.mts +4 -2
  4. package/dist/agent-blackboard/feedback-journal-sandbox.mjs +14 -6
  5. package/dist/agent-blackboard/snapshot-cleanup-receipt.d.mts +2 -2
  6. package/dist/agent-blackboard/snapshot-cleanup-receipt.mjs +20 -12
  7. package/dist/agent-blackboard/snapshot-partition-cleanup.d.mts +1 -0
  8. package/dist/agent-blackboard/snapshot-partition-cleanup.mjs +3 -0
  9. package/dist/agent-blackboard/snapshot-partitions.mjs +1 -1
  10. package/dist/agent-blackboard/snapshot-types.d.mts +8 -0
  11. package/dist/audit-journal/audit-block.d.mts +2 -0
  12. package/dist/audit-journal/audit-block.mjs +13 -8
  13. package/dist/audit-journal/ci-failures.d.mts +6 -2
  14. package/dist/audit-journal/ci-failures.mjs +12 -6
  15. package/dist/audit-journal/journal.d.mts +2 -0
  16. package/dist/audit-journal/journal.mjs +18 -3
  17. package/dist/audit-journal/scope.d.mts +25 -0
  18. package/dist/audit-journal/scope.mjs +47 -0
  19. package/dist/audit-journal/types.d.mts +3 -0
  20. package/dist/cli/index.mjs +0 -6
  21. package/dist/cli/parse-forwarded-commands.d.mts +1 -1
  22. package/dist/cli/parse-forwarded-commands.mjs +0 -2
  23. package/dist/cli/parse.d.mts +1 -7
  24. package/dist/cli/parse.mjs +0 -1
  25. package/dist/cli/script-paths.mjs +0 -1
  26. package/dist/cli/usage-text.d.mts +1 -1
  27. package/dist/cli/usage-text.mjs +0 -6
  28. package/dist/gh-cli/exec.d.mts +8 -2
  29. package/dist/gh-cli/exec.mjs +3 -3
  30. package/dist/gha-review-payload/index.d.mts +0 -2
  31. package/dist/gha-review-payload/index.mjs +0 -1
  32. package/dist/index.d.mts +2 -8
  33. package/dist/index.mjs +1 -4
  34. package/dist/mcp-server/dispatch.mjs +1 -1
  35. package/dist/mcp-server/handlers-pr.mjs +1 -1
  36. package/dist/mcp-server/handlers-snapshot-cleanup.mjs +8 -0
  37. package/dist/mcp-server/handlers-snapshot-partition.mjs +6 -1
  38. package/dist/mcp-server/install-info.d.mts +2 -2
  39. package/dist/mcp-server/install-info.mjs +10 -6
  40. package/dist/mcp-server/pr-diff-size.d.mts +16 -0
  41. package/dist/mcp-server/pr-diff-size.mjs +49 -0
  42. package/dist/mcp-server/pr-live.d.mts +3 -0
  43. package/dist/mcp-server/pr-live.mjs +8 -2
  44. package/dist/mcp-server/pr-prepare.mjs +20 -12
  45. package/dist/mcp-server/server.mjs +2 -1
  46. package/dist/mcp-server/snapshot-recovery.d.mts +8 -0
  47. package/dist/mcp-server/snapshot-recovery.mjs +76 -0
  48. package/dist/mcp-server/snapshot-registry.d.mts +3 -1
  49. package/dist/mcp-server/snapshot-registry.mjs +3 -1
  50. package/dist/mcp-server/tools-pr.mjs +2 -1
  51. package/dist/mcp-server/tools.mjs +16 -5
  52. package/dist/mcp-server/worktree.mjs +4 -1
  53. package/docs/mcp-server.md +43 -10
  54. package/package.json +1 -16
  55. package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
  56. package/skills/agent-workflow/SKILL.md +7 -1
  57. package/skills/dependabot/SKILL.md +4 -3
  58. package/skills/final-review/references/orchestrator.md +3 -3
  59. package/skills/manifest.json +25 -33
  60. package/skills/planning/SKILL.md +3 -0
  61. package/skills/retrospective/SKILL.md +2 -1
  62. package/skills/review-ci-logs/SKILL.md +2 -0
  63. package/skills/stacked-prs/SKILL.md +8 -2
  64. package/skills/stacked-prs/references/drain.md +3 -1
  65. package/skills/triage-loop/SKILL.md +125 -21
  66. package/skills/triage-loop/references/shepherd.md +45 -0
  67. package/skills/triage-prs/SKILL.md +15 -18
  68. package/skills/triage-prs/references/rubric.md +2 -2
  69. package/skills/triage-sweep/SKILL.md +40 -12
  70. package/dist/gha-check-run/cli.d.mts +0 -2
  71. package/dist/gha-check-run/cli.mjs +0 -81
  72. package/dist/gha-check-run/github.d.mts +0 -30
  73. package/dist/gha-check-run/github.mjs +0 -63
  74. package/dist/gha-check-run/index.d.mts +0 -2
  75. package/dist/gha-check-run/index.mjs +0 -2
  76. package/dist/gha-claude-post-review/index.d.mts +0 -3
  77. package/dist/gha-claude-post-review/index.mjs +0 -2
  78. package/dist/gha-post-review/claude-token.d.mts +0 -25
  79. package/dist/gha-post-review/claude-token.mjs +0 -109
  80. package/dist/gha-post-review/cli.d.mts +0 -1
  81. package/dist/gha-post-review/cli.mjs +0 -22
  82. package/dist/gha-post-review/github.d.mts +0 -13
  83. package/dist/gha-post-review/github.mjs +0 -58
  84. package/dist/gha-post-review/index.d.mts +0 -13
  85. package/dist/gha-post-review/index.mjs +0 -8
  86. package/dist/gha-post-review/post.d.mts +0 -24
  87. package/dist/gha-post-review/post.mjs +0 -39
  88. package/dist/gha-post-review/pull-io.d.mts +0 -13
  89. package/dist/gha-post-review/pull-io.mjs +0 -88
  90. package/dist/gha-post-review/token.d.mts +0 -9
  91. package/dist/gha-post-review/token.mjs +0 -21
  92. package/dist/gha-review-payload/cli.d.mts +0 -1
  93. package/dist/gha-review-payload/cli.mjs +0 -24
  94. package/dist/gha-review-payload/file.d.mts +0 -7
  95. package/dist/gha-review-payload/file.mjs +0 -62
  96. package/scripts/gha/materialize-pr-context.sh +0 -123
  97. 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.