vouchington-tooling 0.88.0 → 1.1.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/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/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 +3 -1
- package/dist/mcp-server/worktree.mjs +1 -1
- package/dist/sql-ast/no-mistakes-peer.d.mts +7 -1
- package/docs/mcp-server.md +20 -3
- package/package.json +3 -18
- package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
- package/skills/manifest.json +23 -23
- package/skills/retrospective/SKILL.md +2 -1
- package/skills/triage-loop/SKILL.md +7 -3
- package/skills/triage-sweep/SKILL.md +30 -1
- 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
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { fileURLToPath } from 'node:url';
|
|
2
|
-
import { ReviewPayloadError } from "./payload.mjs";
|
|
3
|
-
import { stageReviewPayload, writeStagedOutput } from "./file.mjs";
|
|
4
|
-
export function runStageReviewPayloadCli(args) {
|
|
5
|
-
try {
|
|
6
|
-
const [requirement, source, destination] = args;
|
|
7
|
-
if (requirement !== 'optional' && requirement !== 'required') {
|
|
8
|
-
throw new ReviewPayloadError('payload requirement must be optional or required.');
|
|
9
|
-
}
|
|
10
|
-
if (!source || !destination || args.length !== 3) {
|
|
11
|
-
throw new ReviewPayloadError('Usage: vouchington stage-review-payload optional|required <source> <destination>');
|
|
12
|
-
}
|
|
13
|
-
writeStagedOutput('staged', stageReviewPayload(source, destination, requirement) ? 'true' : 'false');
|
|
14
|
-
return 0;
|
|
15
|
-
}
|
|
16
|
-
catch (error) {
|
|
17
|
-
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
18
|
-
return 1;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/* v8 ignore next 3 */
|
|
22
|
-
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
23
|
-
process.exitCode = runStageReviewPayloadCli(process.argv.slice(2));
|
|
24
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export type PayloadRequirement = 'optional' | 'required';
|
|
2
|
-
/** Reads a bounded regular file through an O_NOFOLLOW descriptor. */
|
|
3
|
-
export declare function readRegularReviewPayload(source: string, requirement: PayloadRequirement): Buffer | undefined;
|
|
4
|
-
/** Replaces a private staging directory and writes a 0600 payload from descriptor-read bytes. */
|
|
5
|
-
export declare function stageReviewPayload(source: string, destinationDirectory: string, requirement: PayloadRequirement): string | undefined;
|
|
6
|
-
/** Writes a single output value for a caller that exposes GitHub Actions outputs. */
|
|
7
|
-
export declare function writeStagedOutput(name: string, value: string, outputPath?: string | undefined): void;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { appendFileSync, chmodSync, closeSync, constants, fstatSync, mkdirSync, openSync, readFileSync, rmSync, writeFileSync, } from 'node:fs';
|
|
2
|
-
import { basename, join } from 'node:path';
|
|
3
|
-
import { MAX_REVIEW_PAYLOAD_BYTES, ReviewPayloadError } from "./payload.mjs";
|
|
4
|
-
/** Reads a bounded regular file through an O_NOFOLLOW descriptor. */
|
|
5
|
-
export function readRegularReviewPayload(source, requirement) {
|
|
6
|
-
let descriptor;
|
|
7
|
-
try {
|
|
8
|
-
descriptor = openSync(source, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
9
|
-
}
|
|
10
|
-
catch (error) {
|
|
11
|
-
const code = error.code;
|
|
12
|
-
if (code === 'ENOENT' && requirement === 'optional')
|
|
13
|
-
return undefined;
|
|
14
|
-
if (code === 'ENOENT')
|
|
15
|
-
throw new ReviewPayloadError('Review payload is required.');
|
|
16
|
-
if (code === 'ELOOP') {
|
|
17
|
-
throw new ReviewPayloadError('Review payload must be a regular non-symlink file.');
|
|
18
|
-
}
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
try {
|
|
22
|
-
const stat = fstatSync(descriptor);
|
|
23
|
-
if (!stat.isFile()) {
|
|
24
|
-
throw new ReviewPayloadError('Review payload must be a regular non-symlink file.');
|
|
25
|
-
}
|
|
26
|
-
if (stat.size === 0 || stat.size > MAX_REVIEW_PAYLOAD_BYTES) {
|
|
27
|
-
throw new ReviewPayloadError(`Review payload must be 1..${MAX_REVIEW_PAYLOAD_BYTES} bytes.`);
|
|
28
|
-
}
|
|
29
|
-
const bytes = readFileSync(descriptor);
|
|
30
|
-
if (bytes.length === 0 || bytes.length > MAX_REVIEW_PAYLOAD_BYTES) {
|
|
31
|
-
throw new ReviewPayloadError(`Review payload must be 1..${MAX_REVIEW_PAYLOAD_BYTES} bytes.`);
|
|
32
|
-
}
|
|
33
|
-
return bytes;
|
|
34
|
-
}
|
|
35
|
-
finally {
|
|
36
|
-
closeSync(descriptor);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/** Replaces a private staging directory and writes a 0600 payload from descriptor-read bytes. */
|
|
40
|
-
export function stageReviewPayload(source, destinationDirectory, requirement) {
|
|
41
|
-
rmSync(destinationDirectory, { force: true, recursive: true });
|
|
42
|
-
const bytes = readRegularReviewPayload(source, requirement);
|
|
43
|
-
if (!bytes)
|
|
44
|
-
return undefined;
|
|
45
|
-
mkdirSync(destinationDirectory, { recursive: true, mode: 0o700 });
|
|
46
|
-
const destination = join(destinationDirectory, basename(source));
|
|
47
|
-
writeFileSync(destination, bytes, { flag: 'wx', mode: 0o600 });
|
|
48
|
-
chmodSync(destination, 0o600);
|
|
49
|
-
return destination;
|
|
50
|
-
}
|
|
51
|
-
/** Writes a single output value for a caller that exposes GitHub Actions outputs. */
|
|
52
|
-
export function writeStagedOutput(name, value, outputPath = process.env.GITHUB_OUTPUT) {
|
|
53
|
-
if (!outputPath)
|
|
54
|
-
throw new ReviewPayloadError('GITHUB_OUTPUT is required.');
|
|
55
|
-
if (!/^[A-Za-z_][A-Za-z0-9_-]*$/u.test(name)) {
|
|
56
|
-
throw new ReviewPayloadError('Output name must contain only letters, numbers, underscores, and hyphens.');
|
|
57
|
-
}
|
|
58
|
-
if (/[\r\n]/u.test(value)) {
|
|
59
|
-
throw new ReviewPayloadError('Output value must not contain CR or LF characters.');
|
|
60
|
-
}
|
|
61
|
-
appendFileSync(outputPath, `${name}=${value}\n`);
|
|
62
|
-
}
|
|
@@ -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"
|