vouchington-tooling 1.2.1 → 2.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/dist/cli/index.mjs +0 -2
- package/dist/cli/parse-forwarded-commands.d.mts +1 -1
- package/dist/cli/parse-forwarded-commands.mjs +0 -1
- package/dist/cli/parse.d.mts +0 -3
- package/dist/cli/usage-text-policy.d.mts +2 -2
- package/dist/cli/usage-text-policy.mjs +2 -3
- package/dist/cli/usage-text.d.mts +1 -1
- package/dist/mcp-server/run.d.mts +1 -1
- package/dist/mcp-server/run.mjs +13 -3
- package/package.json +1 -1
- package/scripts/__pycache__/run_bounded_process.cpython-314.pyc +0 -0
- package/skills/manifest.json +22 -28
- package/skills/triage-loop/SKILL.md +9 -3
- package/skills/triage-loop/references/shepherd.md +24 -7
- package/skills/triage-prs/SKILL.md +2 -0
- package/skills/triage-sweep/SKILL.md +6 -3
- package/dist/cli/commands/final-review.d.mts +0 -8
- package/dist/cli/commands/final-review.mjs +0 -70
- package/dist/cli/usage-text-final-review.d.mts +0 -2
- package/dist/cli/usage-text-final-review.mjs +0 -22
- package/dist/final-review/benchmark/cases.d.mts +0 -23
- package/dist/final-review/benchmark/cases.mjs +0 -89
- package/dist/final-review/benchmark/cli.d.mts +0 -12
- package/dist/final-review/benchmark/cli.mjs +0 -144
- package/dist/final-review/benchmark/judge-all.d.mts +0 -32
- package/dist/final-review/benchmark/judge-all.mjs +0 -50
- package/dist/final-review/benchmark/judge.d.mts +0 -18
- package/dist/final-review/benchmark/judge.mjs +0 -86
- package/dist/final-review/benchmark/runner.d.mts +0 -60
- package/dist/final-review/benchmark/runner.mjs +0 -85
- package/dist/final-review/benchmark/score.d.mts +0 -33
- package/dist/final-review/benchmark/score.mjs +0 -84
- package/dist/final-review/benchmark/snapshot.d.mts +0 -20
- package/dist/final-review/benchmark/snapshot.mjs +0 -107
- package/dist/final-review/benchmark/verifier-check.d.mts +0 -21
- package/dist/final-review/benchmark/verifier-check.mjs +0 -93
- package/dist/final-review/benchmark/verifier-cli.d.mts +0 -6
- package/dist/final-review/benchmark/verifier-cli.mjs +0 -141
- package/dist/final-review/benchmark/verifier-grade.d.mts +0 -42
- package/dist/final-review/benchmark/verifier-grade.mjs +0 -76
- package/dist/final-review/benchmark/verifier-input.d.mts +0 -21
- package/dist/final-review/benchmark/verifier-input.mjs +0 -47
- package/dist/final-review/benchmark/verifier-run.d.mts +0 -23
- package/dist/final-review/benchmark/verifier-run.mjs +0 -108
- package/dist/final-review/benchmark/verifier-score.d.mts +0 -39
- package/dist/final-review/benchmark/verifier-score.mjs +0 -70
- package/dist/final-review/build.d.mts +0 -21
- package/dist/final-review/build.mjs +0 -91
- package/dist/final-review/diff-files.d.mts +0 -16
- package/dist/final-review/diff-files.mjs +0 -44
- package/dist/final-review/finding.d.mts +0 -32
- package/dist/final-review/finding.mjs +0 -101
- package/dist/final-review/github.d.mts +0 -21
- package/dist/final-review/github.mjs +0 -105
- package/dist/final-review/index.d.mts +0 -11
- package/dist/final-review/index.mjs +0 -6
- package/dist/final-review/numbered-diff.d.mts +0 -9
- package/dist/final-review/numbered-diff.mjs +0 -52
- package/dist/final-review/post.d.mts +0 -33
- package/dist/final-review/post.mjs +0 -63
- package/dist/final-review/render.d.mts +0 -17
- package/dist/final-review/render.mjs +0 -81
- package/skills/final-review/SKILL.md +0 -95
- package/skills/final-review/references/dispatch.md +0 -40
- package/skills/final-review/references/orchestrator.md +0 -39
- package/skills/final-review/references/pillars/_contract.md +0 -61
- package/skills/final-review/references/pillars/blast-radius.md +0 -33
- package/skills/final-review/references/pillars/congruence.md +0 -25
- package/skills/final-review/references/pillars/correctness.md +0 -52
- package/skills/final-review/references/pillars/design.md +0 -30
- package/skills/final-review/references/pillars/history.md +0 -26
- package/skills/final-review/references/pillars/rules.md +0 -34
- package/skills/final-review/references/pillars/security.md +0 -28
- package/skills/final-review/references/verifier.md +0 -62
package/dist/cli/index.mjs
CHANGED
|
@@ -120,8 +120,6 @@ export function runCli(argv = process.argv) {
|
|
|
120
120
|
return runWorktreeCommand(parsed.args);
|
|
121
121
|
case 'tmux':
|
|
122
122
|
return runTmuxCommand(parsed.args);
|
|
123
|
-
case 'final-review':
|
|
124
|
-
return import("./commands/final-review.mjs").then((command) => command.runFinalReviewCommand(parsed.args));
|
|
125
123
|
case 'require-up-to-date':
|
|
126
124
|
return runRequireUpToDate(parsed);
|
|
127
125
|
case 'fresh-base':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const FORWARDED: readonly ["with-host-lock", "host-storage", "pnpm-install", "vitest-blob-manifest", "vitest-report-attempt", "prepare-vitest-reports", "nuget-central-version", "verify-workflow-secrets", "runner-policy", "dead-code", "swift-semantic-equal", "retrospective-transcript", "retrospective-facts", "agent-blackboard", "mcp", "hook", "worktree", "transient-retry", "sandbox-command-audit", "cloc", "coverage-scope-check", "trivy-policy", "docker-image-mirror", "workspace-registry-check", "storybook-browser-runner", "tmux"
|
|
1
|
+
declare const FORWARDED: readonly ["with-host-lock", "host-storage", "pnpm-install", "vitest-blob-manifest", "vitest-report-attempt", "prepare-vitest-reports", "nuget-central-version", "verify-workflow-secrets", "runner-policy", "dead-code", "swift-semantic-equal", "retrospective-transcript", "retrospective-facts", "agent-blackboard", "mcp", "hook", "worktree", "transient-retry", "sandbox-command-audit", "cloc", "coverage-scope-check", "trivy-policy", "docker-image-mirror", "workspace-registry-check", "storybook-browser-runner", "tmux"];
|
|
2
2
|
type Name = (typeof FORWARDED)[number];
|
|
3
3
|
type ForwardedCommand = {
|
|
4
4
|
[K in Name]: {
|
package/dist/cli/parse.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const POLICY_COMMANDS = " coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n
|
|
2
|
-
export declare const POLICY_USAGE = "\
|
|
1
|
+
export declare const POLICY_COMMANDS = " coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n";
|
|
2
|
+
export declare const POLICY_USAGE = "\ncoverage-scope-check [--rules <path>] [--scope-file <json>] [--include <glob>]... [--exclude <glob>]...\n Fails (exit 1) when a git-tracked file that a coverage rules file (default .coverage-rules.yml)\n gives a patch_coverage_min above 0, and its scope does not ignore, is outside the collector's\n scope. The collector scope is the repeated --include/--exclude globs plus, optionally, the\n include/exclude string arrays of a --scope-file JSON written from the Vitest coverage config.\n At least one include glob is required.\n\ntrivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]\n Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).\n Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or\n background). Vulnerability gates need --scanners vuln, --pkg-types os, --severity CRITICAL,HIGH,\n --ignore-unfixed, --skip-db-update, --quiet, table output to a file, --ignorefile <ignore-file>\n (default .trivyignore.yaml) and --exit-code \"$<NAME>\" (default TRIVY_FINDINGS_EXIT_CODE).\n CycloneDX SBOM scans must be unfiltered with --exit-code 0. At least --min-gates gates and\n --min-sboms SBOM scans (default 2 each) must exist. The tracked ignore registry needs purl-exact OS\n packages, a \"Not exploitable: ... Cleanup: <issue URL>\" statement (URL must start with\n --cleanup-url-prefix when given) and an expired_at between tomorrow and --max-expiry-days (30).\n\ndocker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]... [--require-digest]\n [--allow-ref-expression <text>]...\n Prints each Docker Hub image in git-tracked workflows, composite actions and Dockerfiles (exit 1):\n run, pull and create commands, containers, services, docker:// references, buildx drivers, FROM,\n COPY --from and # syntax. Images must name a registry host; --mirror (default mirror.gcr.io) is\n the host the message tells you to use. --allow-registry (repeatable) instead requires every image,\n including FROM and COPY --from, to start with one of the prefixes; a reference that expands a\n variable passes only when its literal text before the variable starts with a prefix. --require-digest\n requires @sha256: plus 64 lowercase hex characters. Stage aliases and scratch stay exempt.\n --allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference\n whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.\n\nworkspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]\n [--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]\n Reconciles git-tracked package.json manifests with the syncpack \"source\" globs (default\n .syncpackrc.json), the pnpm \"packages\" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups\n (.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group\n (default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob\n (default **/package.json) does not count as registering a manifest. Each group named with\n --runtime-prefix (default runtime-) must mirror the primary group of the same name.\n\n";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { COVERAGE_SCOPE_CHECK_USAGE } from "./usage-text-coverage-scope.mjs";
|
|
2
|
-
import { FINAL_REVIEW_COMMAND, FINAL_REVIEW_USAGE } from "./usage-text-final-review.mjs";
|
|
3
2
|
export const POLICY_COMMANDS = ` coverage-scope-check Check positive-threshold coverage rules against the Vitest scope
|
|
4
3
|
trivy-policy Check tracked Trivy workflow scans and the exception registry
|
|
5
4
|
docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror
|
|
6
5
|
workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests
|
|
7
|
-
|
|
6
|
+
`;
|
|
8
7
|
export const POLICY_USAGE = `
|
|
9
|
-
${
|
|
8
|
+
${COVERAGE_SCOPE_CHECK_USAGE}
|
|
10
9
|
trivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]
|
|
11
10
|
Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).
|
|
12
11
|
Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const USAGE = "Usage: vouchington <command> [options]\n\nCommands:\n runner-port-policy Print or validate a runner port policy\n with-host-lock Run a command under a host-wide lock\n host-storage Check free space on caller-supplied paths\n gha-runtime-audit Audit successful GitHub Actions job runtimes\n require-up-to-date Require HEAD to include a fetched remote branch\n fresh-base Classify the worktree against a remote base branch\n gitleaks-directory-scan Scan a directory with Gitleaks\n ast-grep-examples Run AST-grep rule examples\n ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON\n gha-workspace-policy Check GitHub Actions workspace safety policy\n gha-output Write a collision-safe multiline GITHUB_OUTPUT record\n gha-needs-results Fail if required GitHub Actions job results failed\n download-with-diagnostics Download a URL and report HTTP status on failure\n download-optional-run-artifacts Download optional artifacts from the current run\n host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot\n allocate-browser-safe-ports Allocate Fetch-safe localhost ports\n diagnose-port-collision Capture bounded localhost port diagnostics\n prepare-trivy-db Download the Trivy vulnerability database\n gha-artifacts-cleanup Delete classified GitHub Actions artifacts\n agent-issue-labels Map changed paths to labels; create missing repository labels\n http-origin Validate an optional HTTP(S) origin\n vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file\n vitest-report-attempt Write or read a Vitest report-attempt marker\n prepare-vitest-reports Validate and select Vitest report JSON files\n pnpm-install Install a pnpm workspace with retry and release-age fail-fast\n check-cache-size Measure a path and decide whether to save a GHA cache\n make-shard-matrix Emit a [1..N] GitHub Actions shard matrix\n load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards\n clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate\n install-github-release Download a checksum-verified GitHub Release binary\n run-with-timeout Run a command with GNU timeout or a Perl fallback\n lint-links Two-pass lychee: internal links fail, external warn\n wait-for-apt-locks Wait until apt/dpkg lock files are free\n install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json\n ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)\n harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out\n gha-collaborator-trust Classify authors as write-access collaborators or not\n nuget-central-version Validate a Directory.Packages.props PackageVersion delta\n verify-workflow-secrets Check a secret inventory against live repository and environment secrets\n runner-policy Check workflow runner labels and jobs against a config\n dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts\n link-skill Link one packaged skill into an explicit consumer directory\n retrospective-facts Gather immutable facts for a retrospective\n agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots\n mcp Serve the agent-blackboard journal tools over stdio (MCP)\n hook Run a repository policy module as a pre/post tool-use hook\n worktree Reclaim finished git worktrees (dry run unless --yes)\n tmux Run configured dev windows in tmux; name panes; agent reminders\n story-coverage Check component exports are imported by stories\n transient-retry Rerun a failed GitHub Actions run when an injected rule matches\n sandbox-command-audit Audit agent transcripts for sandbox escalations and denials\n cloc Count tracked lines of code by category and service with scc\n coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n final-review Post, revoke, check, or benchmark multi-pillar final reviews\n storybook-browser-runner Run the Storybook Vitest browser project with cache, retry and watchdog\n\nOptions:\n -h, --help Show this help\n -v, --version Print the package version\n\nrunner-port-policy\n (no args) Print the shipped policy as JSON\n --file <path> Validate and print a policy file\n --reserved <port> Print true if the port is reserved\n\nwith-host-lock\n --name <family>\n [--slots <n>]\n --timeout-seconds <n>\n [--command-timeout-seconds <n>]\n [--failure-diagnostics <absolute-script>]\n [--on-acquire-timeout fail|run-unlocked]\n -- <command> [args...]\n\nhost-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]\n\ngha-runtime-audit\n [--repository owner/name] Default GITHUB_REPOSITORY\n [--branch main]\n [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling\n [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this\n --pr-workflow <name|/regex/> Repeatable\n --push-workflow <name|/regex/> Repeatable\n\nrequire-up-to-date --remote <name> --branch <name>\nfresh-base [--remote <name>] [--branch <name>] [--skip-fetch]\ngitleaks-directory-scan --config <path> [--directory <path>]\nast-grep-examples --rules <directory> --config <path>\nast-grep-pack\ngha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]\n\ngha-output <name>\ngha-needs-results [label]\ndownload-with-diagnostics <url> <destination> [-- curl-args...]\ndownload-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>\nhost-pressure-diagnostics\nallocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]\ndiagnose-port-collision [--ports \"2200 2216\"] [--output-dir PATH]\nprepare-trivy-db\ngha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\ngha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\nagent-issue-labels labels-from-paths [--labeler <path>] <path>...\nagent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...\nhttp-origin [--field NAME] [value]\nvitest-blob-manifest <suite> [reports-directory]\nvitest-report-attempt <write DIRECTORY SUITE|read ROOT>\nprepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]\npnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false\ncheck-cache-size <path> <max-bytes> <label>\nmake-shard-matrix <total>\nload-runner-env\nclean-workspace\ninstall-github-release --repo owner/name --version X --asset 'name-{platform}.tar.gz' --bin name [--tag-prefix PREFIX] [--expected-sha256 SHA256] [--no-checksum] [--checksums-asset NAME] [--version-flag FLAG] [--bin-dir DIR]\nrun-with-timeout <timeout-seconds> <kill-after-seconds> <command...>\nlint-links [--offline] [--config PATH] [--glob PATTERN] [files...]\nwait-for-apt-locks\ninstall-playwright-chromium-arm64 [name:archive...]\nghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]\nharness-admission-lane <lanes>\ngha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json\nnuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>\nverify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]\nrunner-policy [--config FILE] [--root DIR]\ndead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...\nswift-semantic-equal <base> <head> <file.swift>\nretrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]\nlink-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill\nretrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]\nagent-blackboard probe\nagent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)\nagent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601\nagent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{\"sessions\":N,\"entries\":N,\"records\":N,\"bytes\":N}'\nagent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]\nmcp\n (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,\n session_ensure, retrospective_check, retrospective_save,\n pr_validate, pr_create, pr_update, snapshot_export, snapshot_partition,\n snapshot_archive, snapshot_cleanup, and session_archive over stdio.\n Needs the optional @modelcontextprotocol/sdk peer (and zod).\n Launch it from inside the repository's git worktree.\n\nhook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module> [--root <dir>] [--automation-env NAME]...\n Reads the harness hook payload on stdin. <module> default-exports a policy object (or a function\n of the hook context returning one) with a command rule table, post-tool-use checkers, and an\n optional reminder. pre-tool-use exits 2 to block, and also when the policy cannot load.\n post-tool-use is advisory and always exits 0. --root defaults to the working directory.\n Each --automation-env NAME (repeatable) marks the run unattended when that environment variable\n is set, non-empty, and not 0 or false; CI markers and claude -p are always unattended.\n\nworktree reclaim [--yes] [--json] [--max-worktrees N] [--timeout-ms N] [--pr-limit N] [--after PATH]\n Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the\n branch is merged or closed at exactly HEAD, using git worktree remove (never forced).\n Skips the main checkout, the current worktree, and locked, bare or detached worktrees.\n\ntransient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>\n Loads a module exporting \"rules\" (and optionally \"limits\"), evaluates them against the failed run,\n and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.\n\nsandbox-command-audit --rules <module> [--settings-path <file>] [--repo-root <dir>]... [--worktree-glob <glob>]... [--projects-dir <dir>] [--codex-sessions-dir <dir>] [--session-id <id>] [--limit N] [--since DAYS] [--json] [--raw]\n Scans Claude and Codex transcripts scoped to this repository (git roots plus any --worktree-glob\n layouts) and reports Bash escalations, denials and permission failures by command prefix.\n <module> exports an object (default or \"rules\") with loadPolicy({ settingsPath, cwd }), which\n returns { covers(list, commandOrPrefix) } for the allow/deny/excluded lists or { error }, and\n optionally classifyFailure(command, text, source), limits and worktreeGlobs. Transcript roots\n default to CLAUDE_CONFIG_DIR/projects and CODEX_HOME/sessions. --raw prints full command text.\n\ncloc --config <file> [--scc-bin <path>] [--json]\n Counts git-tracked lines with scc (SCC_BIN or --scc-bin, else \"scc\"), classified into\n source/tests/tooling and by service, and prints an aligned table (--json: rows). <file> is a .json\n file or a module whose default (or \"config\") export is the layout: services [{ name, match }],\n defaultService, categories, testPatterns, toolingPatterns, countedRoots, countedRootFiles,\n excludedDirs, ignoredDirs, sccBin, missingSccHint.\n\nfinal-review post --repo owner/name --pr N --head-sha SHA --input findings.json [--dry-run]\nfinal-review diff --repo owner/name --pr N\nfinal-review revoke --repo owner/name --pr N\nfinal-review status --repo owner/name --pr N\nfinal-review bench --cases cases.json --prompts DIR --out DIR [--pillar NAME]... [--case ID]... [--model NAME] [--jobs N] [--max-turns N] [--score-only] [--judge MODEL]\nfinal-review bench-verifier --cases cases.json --findings-from DIR --prompts DIR --out DIR [--case ID]... [--model NAME] [--jobs N] [--max-turns N] [--score-only] [--judge MODEL] [--checker MODEL]\n post renders verified findings as one or more COMMENT reviews (verdict, reviewed SHA and effort in\n the header; inline comments where the diff allows, the rest in the body) and adds the \"final\n approval\" label on Approve or removes it otherwise. It refuses when the head moved. diff prints the pull request\n diff with base and head line numbers on every line, for reviewers to cite. revoke removes\n the label before a re-review. status exits 0 only when the newest final review approved the current\n head and the label is present. bench runs each pillar prompt against labeled cases from a git-free\n snapshot of the pre-merge head and scores recall and precision; --judge grades by claim\n with a model instead of by location. bench-verifier runs only the verifier, one call per case\n and no subagents, on the pillar findings a bench --out DIR saved (each judged-real finding is\n also planted under a second pillar), and scores real findings kept, label recall, severity\n agreement, duplicates merged, and other blocking and high findings confirmed by --checker;\n --prompts is the skill's references directory.\n\ncoverage-scope-check [--rules <path>] [--scope-file <json>] [--include <glob>]... [--exclude <glob>]...\n Fails (exit 1) when a git-tracked file that a coverage rules file (default .coverage-rules.yml)\n gives a patch_coverage_min above 0, and its scope does not ignore, is outside the collector's\n scope. The collector scope is the repeated --include/--exclude globs plus, optionally, the\n include/exclude string arrays of a --scope-file JSON written from the Vitest coverage config.\n At least one include glob is required.\n\ntrivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]\n Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).\n Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or\n background). Vulnerability gates need --scanners vuln, --pkg-types os, --severity CRITICAL,HIGH,\n --ignore-unfixed, --skip-db-update, --quiet, table output to a file, --ignorefile <ignore-file>\n (default .trivyignore.yaml) and --exit-code \"$<NAME>\" (default TRIVY_FINDINGS_EXIT_CODE).\n CycloneDX SBOM scans must be unfiltered with --exit-code 0. At least --min-gates gates and\n --min-sboms SBOM scans (default 2 each) must exist. The tracked ignore registry needs purl-exact OS\n packages, a \"Not exploitable: ... Cleanup: <issue URL>\" statement (URL must start with\n --cleanup-url-prefix when given) and an expired_at between tomorrow and --max-expiry-days (30).\n\ndocker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]... [--require-digest]\n [--allow-ref-expression <text>]...\n Prints each Docker Hub image in git-tracked workflows, composite actions and Dockerfiles (exit 1):\n run, pull and create commands, containers, services, docker:// references, buildx drivers, FROM,\n COPY --from and # syntax. Images must name a registry host; --mirror (default mirror.gcr.io) is\n the host the message tells you to use. --allow-registry (repeatable) instead requires every image,\n including FROM and COPY --from, to start with one of the prefixes; a reference that expands a\n variable passes only when its literal text before the variable starts with a prefix. --require-digest\n requires @sha256: plus 64 lowercase hex characters. Stage aliases and scratch stay exempt.\n --allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference\n whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.\n\nworkspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]\n [--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]\n Reconciles git-tracked package.json manifests with the syncpack \"source\" globs (default\n .syncpackrc.json), the pnpm \"packages\" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups\n (.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group\n (default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob\n (default **/package.json) does not count as registering a manifest. Each group named with\n --runtime-prefix (default runtime-) must mirror the primary group of the same name.\n\nstorybook-browser-runner --project <name> [--command <cmd>] [--result-file <path>]... [--completion-file <path>] [--coverage-arg=<arg>]... [--optimize-deps-config <path>] [--env-prefix <PREFIX>] [--progress-prefix <text>] [-- <argv>...]\n Spawns <cmd> (default pnpm) in its own process group with <argv> (default \"exec vitest run\n --project <name>\") plus the coverage args (default --coverage) and supervises it: a Vite optimizer\n cache, retries on known Vite and browser start-up flakes, and stall, hang and session-budget\n watchdogs. --result-file paths are removed before each attempt and --completion-file is the one\n whose appearance is recorded. Tuned by <PREFIX>_STARTUP_ATTEMPTS, _OPTIMIZER_STALL_MS, _HANG_MS,\n _SESSION_BUDGET_MS, _DIAGNOSTICS_FILE, _PERSISTENT_CACHE, _PERSISTENT_CACHE_DIR and _COVERAGE\n (PREFIX defaults to STORYBOOK_BROWSER). Exits with the resolved test exit code.\n\ntmux up --config <file> [--root <dir>] [--no-attach] [-v|--verbose]\ntmux name [--socket PATH --pane %ID --worktree PATH] <name> | read-title | post-tool | agent-reminder <event>\n Environment: TMUX_TARGET_BIN, TMUX_TARGET_ROOT, TMUX_NAME_COMMAND, AGENT_TMUX_SOCKET/PANE/WORKTREE.\n\nstory-coverage --root <dir> --component-root <rel> --story-root <rel> --source-extension <ext> --component-extension <ext> --marker <regex> --story-pattern <regex> [--alias <prefix>=<path>] [--exclusions <json>] [--exclusions-label <text>]\n";
|
|
1
|
+
export declare const USAGE = "Usage: vouchington <command> [options]\n\nCommands:\n runner-port-policy Print or validate a runner port policy\n with-host-lock Run a command under a host-wide lock\n host-storage Check free space on caller-supplied paths\n gha-runtime-audit Audit successful GitHub Actions job runtimes\n require-up-to-date Require HEAD to include a fetched remote branch\n fresh-base Classify the worktree against a remote base branch\n gitleaks-directory-scan Scan a directory with Gitleaks\n ast-grep-examples Run AST-grep rule examples\n ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON\n gha-workspace-policy Check GitHub Actions workspace safety policy\n gha-output Write a collision-safe multiline GITHUB_OUTPUT record\n gha-needs-results Fail if required GitHub Actions job results failed\n download-with-diagnostics Download a URL and report HTTP status on failure\n download-optional-run-artifacts Download optional artifacts from the current run\n host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot\n allocate-browser-safe-ports Allocate Fetch-safe localhost ports\n diagnose-port-collision Capture bounded localhost port diagnostics\n prepare-trivy-db Download the Trivy vulnerability database\n gha-artifacts-cleanup Delete classified GitHub Actions artifacts\n agent-issue-labels Map changed paths to labels; create missing repository labels\n http-origin Validate an optional HTTP(S) origin\n vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file\n vitest-report-attempt Write or read a Vitest report-attempt marker\n prepare-vitest-reports Validate and select Vitest report JSON files\n pnpm-install Install a pnpm workspace with retry and release-age fail-fast\n check-cache-size Measure a path and decide whether to save a GHA cache\n make-shard-matrix Emit a [1..N] GitHub Actions shard matrix\n load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards\n clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate\n install-github-release Download a checksum-verified GitHub Release binary\n run-with-timeout Run a command with GNU timeout or a Perl fallback\n lint-links Two-pass lychee: internal links fail, external warn\n wait-for-apt-locks Wait until apt/dpkg lock files are free\n install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json\n ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)\n harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out\n gha-collaborator-trust Classify authors as write-access collaborators or not\n nuget-central-version Validate a Directory.Packages.props PackageVersion delta\n verify-workflow-secrets Check a secret inventory against live repository and environment secrets\n runner-policy Check workflow runner labels and jobs against a config\n dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts\n link-skill Link one packaged skill into an explicit consumer directory\n retrospective-facts Gather immutable facts for a retrospective\n agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots\n mcp Serve the agent-blackboard journal tools over stdio (MCP)\n hook Run a repository policy module as a pre/post tool-use hook\n worktree Reclaim finished git worktrees (dry run unless --yes)\n tmux Run configured dev windows in tmux; name panes; agent reminders\n story-coverage Check component exports are imported by stories\n transient-retry Rerun a failed GitHub Actions run when an injected rule matches\n sandbox-command-audit Audit agent transcripts for sandbox escalations and denials\n cloc Count tracked lines of code by category and service with scc\n coverage-scope-check Check positive-threshold coverage rules against the Vitest scope\n trivy-policy Check tracked Trivy workflow scans and the exception registry\n docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror\n workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests\n storybook-browser-runner Run the Storybook Vitest browser project with cache, retry and watchdog\n\nOptions:\n -h, --help Show this help\n -v, --version Print the package version\n\nrunner-port-policy\n (no args) Print the shipped policy as JSON\n --file <path> Validate and print a policy file\n --reserved <port> Print true if the port is reserved\n\nwith-host-lock\n --name <family>\n [--slots <n>]\n --timeout-seconds <n>\n [--command-timeout-seconds <n>]\n [--failure-diagnostics <absolute-script>]\n [--on-acquire-timeout fail|run-unlocked]\n -- <command> [args...]\n\nhost-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]\n\ngha-runtime-audit\n [--repository owner/name] Default GITHUB_REPOSITORY\n [--branch main]\n [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling\n [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this\n --pr-workflow <name|/regex/> Repeatable\n --push-workflow <name|/regex/> Repeatable\n\nrequire-up-to-date --remote <name> --branch <name>\nfresh-base [--remote <name>] [--branch <name>] [--skip-fetch]\ngitleaks-directory-scan --config <path> [--directory <path>]\nast-grep-examples --rules <directory> --config <path>\nast-grep-pack\ngha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]\n\ngha-output <name>\ngha-needs-results [label]\ndownload-with-diagnostics <url> <destination> [-- curl-args...]\ndownload-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>\nhost-pressure-diagnostics\nallocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]\ndiagnose-port-collision [--ports \"2200 2216\"] [--output-dir PATH]\nprepare-trivy-db\ngha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\ngha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]\nagent-issue-labels labels-from-paths [--labeler <path>] <path>...\nagent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...\nhttp-origin [--field NAME] [value]\nvitest-blob-manifest <suite> [reports-directory]\nvitest-report-attempt <write DIRECTORY SUITE|read ROOT>\nprepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]\npnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false\ncheck-cache-size <path> <max-bytes> <label>\nmake-shard-matrix <total>\nload-runner-env\nclean-workspace\ninstall-github-release --repo owner/name --version X --asset 'name-{platform}.tar.gz' --bin name [--tag-prefix PREFIX] [--expected-sha256 SHA256] [--no-checksum] [--checksums-asset NAME] [--version-flag FLAG] [--bin-dir DIR]\nrun-with-timeout <timeout-seconds> <kill-after-seconds> <command...>\nlint-links [--offline] [--config PATH] [--glob PATTERN] [files...]\nwait-for-apt-locks\ninstall-playwright-chromium-arm64 [name:archive...]\nghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]\nharness-admission-lane <lanes>\ngha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json\nnuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>\nverify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]\nrunner-policy [--config FILE] [--root DIR]\ndead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...\nswift-semantic-equal <base> <head> <file.swift>\nretrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]\nlink-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill\nretrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]\nagent-blackboard probe\nagent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)\nagent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601\nagent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{\"sessions\":N,\"entries\":N,\"records\":N,\"bytes\":N}'\nagent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]\nmcp\n (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,\n session_ensure, retrospective_check, retrospective_save,\n pr_validate, pr_create, pr_update, snapshot_export, snapshot_partition,\n snapshot_archive, snapshot_cleanup, and session_archive over stdio.\n Needs the optional @modelcontextprotocol/sdk peer (and zod).\n Launch it from inside the repository's git worktree.\n\nhook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module> [--root <dir>] [--automation-env NAME]...\n Reads the harness hook payload on stdin. <module> default-exports a policy object (or a function\n of the hook context returning one) with a command rule table, post-tool-use checkers, and an\n optional reminder. pre-tool-use exits 2 to block, and also when the policy cannot load.\n post-tool-use is advisory and always exits 0. --root defaults to the working directory.\n Each --automation-env NAME (repeatable) marks the run unattended when that environment variable\n is set, non-empty, and not 0 or false; CI markers and claude -p are always unattended.\n\nworktree reclaim [--yes] [--json] [--max-worktrees N] [--timeout-ms N] [--pr-limit N] [--after PATH]\n Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the\n branch is merged or closed at exactly HEAD, using git worktree remove (never forced).\n Skips the main checkout, the current worktree, and locked, bare or detached worktrees.\n\ntransient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>\n Loads a module exporting \"rules\" (and optionally \"limits\"), evaluates them against the failed run,\n and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.\n\nsandbox-command-audit --rules <module> [--settings-path <file>] [--repo-root <dir>]... [--worktree-glob <glob>]... [--projects-dir <dir>] [--codex-sessions-dir <dir>] [--session-id <id>] [--limit N] [--since DAYS] [--json] [--raw]\n Scans Claude and Codex transcripts scoped to this repository (git roots plus any --worktree-glob\n layouts) and reports Bash escalations, denials and permission failures by command prefix.\n <module> exports an object (default or \"rules\") with loadPolicy({ settingsPath, cwd }), which\n returns { covers(list, commandOrPrefix) } for the allow/deny/excluded lists or { error }, and\n optionally classifyFailure(command, text, source), limits and worktreeGlobs. Transcript roots\n default to CLAUDE_CONFIG_DIR/projects and CODEX_HOME/sessions. --raw prints full command text.\n\ncloc --config <file> [--scc-bin <path>] [--json]\n Counts git-tracked lines with scc (SCC_BIN or --scc-bin, else \"scc\"), classified into\n source/tests/tooling and by service, and prints an aligned table (--json: rows). <file> is a .json\n file or a module whose default (or \"config\") export is the layout: services [{ name, match }],\n defaultService, categories, testPatterns, toolingPatterns, countedRoots, countedRootFiles,\n excludedDirs, ignoredDirs, sccBin, missingSccHint.\n\ncoverage-scope-check [--rules <path>] [--scope-file <json>] [--include <glob>]... [--exclude <glob>]...\n Fails (exit 1) when a git-tracked file that a coverage rules file (default .coverage-rules.yml)\n gives a patch_coverage_min above 0, and its scope does not ignore, is outside the collector's\n scope. The collector scope is the repeated --include/--exclude globs plus, optionally, the\n include/exclude string arrays of a --scope-file JSON written from the Vitest coverage config.\n At least one include glob is required.\n\ntrivy-policy [--root <dir>] [--ignore-file <path>] [--findings-exit-code-env <NAME>] [--cleanup-url-prefix <url>] [--min-gates N] [--min-sboms N] [--max-expiry-days N]\n Reads git-tracked workflows, composite actions and shell scripts and prints each violation (exit 1).\n Every Trivy package scan must be an auditable CLI command in a workflow run block or shell script (no action, wrapper, substitution or\n background). Vulnerability gates need --scanners vuln, --pkg-types os, --severity CRITICAL,HIGH,\n --ignore-unfixed, --skip-db-update, --quiet, table output to a file, --ignorefile <ignore-file>\n (default .trivyignore.yaml) and --exit-code \"$<NAME>\" (default TRIVY_FINDINGS_EXIT_CODE).\n CycloneDX SBOM scans must be unfiltered with --exit-code 0. At least --min-gates gates and\n --min-sboms SBOM scans (default 2 each) must exist. The tracked ignore registry needs purl-exact OS\n packages, a \"Not exploitable: ... Cleanup: <issue URL>\" statement (URL must start with\n --cleanup-url-prefix when given) and an expired_at between tomorrow and --max-expiry-days (30).\n\ndocker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]... [--require-digest]\n [--allow-ref-expression <text>]...\n Prints each Docker Hub image in git-tracked workflows, composite actions and Dockerfiles (exit 1):\n run, pull and create commands, containers, services, docker:// references, buildx drivers, FROM,\n COPY --from and # syntax. Images must name a registry host; --mirror (default mirror.gcr.io) is\n the host the message tells you to use. --allow-registry (repeatable) instead requires every image,\n including FROM and COPY --from, to start with one of the prefixes; a reference that expands a\n variable passes only when its literal text before the variable starts with a prefix. --require-digest\n requires @sha256: plus 64 lowercase hex characters. Stage aliases and scratch stay exempt.\n --allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference\n whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.\n\nworkspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]\n [--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]\n Reconciles git-tracked package.json manifests with the syncpack \"source\" globs (default\n .syncpackrc.json), the pnpm \"packages\" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups\n (.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group\n (default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob\n (default **/package.json) does not count as registering a manifest. Each group named with\n --runtime-prefix (default runtime-) must mirror the primary group of the same name.\n\nstorybook-browser-runner --project <name> [--command <cmd>] [--result-file <path>]... [--completion-file <path>] [--coverage-arg=<arg>]... [--optimize-deps-config <path>] [--env-prefix <PREFIX>] [--progress-prefix <text>] [-- <argv>...]\n Spawns <cmd> (default pnpm) in its own process group with <argv> (default \"exec vitest run\n --project <name>\") plus the coverage args (default --coverage) and supervises it: a Vite optimizer\n cache, retries on known Vite and browser start-up flakes, and stall, hang and session-budget\n watchdogs. --result-file paths are removed before each attempt and --completion-file is the one\n whose appearance is recorded. Tuned by <PREFIX>_STARTUP_ATTEMPTS, _OPTIMIZER_STALL_MS, _HANG_MS,\n _SESSION_BUDGET_MS, _DIAGNOSTICS_FILE, _PERSISTENT_CACHE, _PERSISTENT_CACHE_DIR and _COVERAGE\n (PREFIX defaults to STORYBOOK_BROWSER). Exits with the resolved test exit code.\n\ntmux up --config <file> [--root <dir>] [--no-attach] [-v|--verbose]\ntmux name [--socket PATH --pane %ID --worktree PATH] <name> | read-title | post-tool | agent-reminder <event>\n Environment: TMUX_TARGET_BIN, TMUX_TARGET_ROOT, TMUX_NAME_COMMAND, AGENT_TMUX_SOCKET/PANE/WORKTREE.\n\nstory-coverage --root <dir> --component-root <rel> --story-root <rel> --source-extension <ext> --component-extension <ext> --marker <regex> --story-pattern <regex> [--alias <prefix>=<path>] [--exclusions <json>] [--exclusions-label <text>]\n";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type BlackboardClientDependencies } from '../agent-blackboard/client.mts';
|
|
3
3
|
import type { RunTextCommand } from '../gh-cli/exec.mts';
|
|
4
4
|
import { type SdkImporter } from './sdk.mts';
|
|
5
5
|
export type RunMcpServerOptions = {
|
package/dist/mcp-server/run.mjs
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import { loadClient } from "../agent-blackboard/client.mjs";
|
|
1
2
|
import { assertBlackboardInstalled, loadMcpSdk } from "./sdk.mjs";
|
|
2
3
|
import { captureInstall } from "./install-info.mjs";
|
|
3
4
|
import { createMcpServer } from "./server.mjs";
|
|
4
5
|
import { launchWorktreeRoot, runIsolatedGit } from "./worktree.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* Imports the agent-blackboard client once, at startup, and hands every tool call that module.
|
|
8
|
+
* Re-importing per call would break a running server whose install directory was evicted.
|
|
9
|
+
*/
|
|
10
|
+
async function importBlackboard(resolveFrom) {
|
|
11
|
+
assertBlackboardInstalled(resolveFrom);
|
|
12
|
+
// Resolve from this package's install, never the worktree, matching tool dispatch.
|
|
13
|
+
const client = await loadClient({ resolveFrom: resolveFrom ?? import.meta.url });
|
|
14
|
+
return { loadClient: () => Promise.resolve(client) };
|
|
15
|
+
}
|
|
5
16
|
/**
|
|
6
17
|
* Starts the server and resolves once it is connected. Nothing on this path may write to stdout:
|
|
7
18
|
* stdout is the protocol channel, so diagnostics go to stderr.
|
|
@@ -9,8 +20,7 @@ import { launchWorktreeRoot, runIsolatedGit } from "./worktree.mjs";
|
|
|
9
20
|
export async function runMcpServer(options) {
|
|
10
21
|
const runGit = options.runGit ?? runIsolatedGit;
|
|
11
22
|
const sdk = await loadMcpSdk(options.importSdk);
|
|
12
|
-
|
|
13
|
-
assertBlackboardInstalled(options.resolveFrom);
|
|
23
|
+
const blackboard = options.blackboard ?? (await importBlackboard(options.resolveFrom));
|
|
14
24
|
const launchRoot = await launchWorktreeRoot(options.cwd, runGit);
|
|
15
25
|
const environment = {
|
|
16
26
|
launchRoot,
|
|
@@ -18,7 +28,7 @@ export async function runMcpServer(options) {
|
|
|
18
28
|
runGit,
|
|
19
29
|
install: captureInstall(options.version),
|
|
20
30
|
...(options.resolveFrom === undefined ? {} : { resolveFrom: options.resolveFrom }),
|
|
21
|
-
|
|
31
|
+
blackboard,
|
|
22
32
|
};
|
|
23
33
|
const server = createMcpServer(sdk, environment, options.version);
|
|
24
34
|
/* v8 ignore next -- the stdio default is exercised by the spawned-process test */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Vouchington CLI and extractable tooling libraries.",
|
|
5
5
|
"homepage": "https://github.com/vouchington/vouchington-tooling/tree/main/packages/vouchington-tooling#readme",
|
|
6
6
|
"bugs": {
|
|
Binary file
|
package/skills/manifest.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"name": "agent-workflow",
|
|
6
6
|
"plugin": "vouchington-workflow",
|
|
7
|
-
"pluginVersion": "0.
|
|
7
|
+
"pluginVersion": "0.20.0",
|
|
8
8
|
"path": "agent-workflow/SKILL.md",
|
|
9
9
|
"prerequisites": [
|
|
10
10
|
"blackboard",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{
|
|
25
25
|
"name": "blackboard",
|
|
26
26
|
"plugin": "vouchington-workflow",
|
|
27
|
-
"pluginVersion": "0.
|
|
27
|
+
"pluginVersion": "0.20.0",
|
|
28
28
|
"path": "blackboard/SKILL.md"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"name": "dependabot",
|
|
38
38
|
"plugin": "vouchington-workflow",
|
|
39
|
-
"pluginVersion": "0.
|
|
39
|
+
"pluginVersion": "0.20.0",
|
|
40
40
|
"path": "dependabot/SKILL.md",
|
|
41
41
|
"prerequisites": ["github-actions-checklist"]
|
|
42
42
|
},
|
|
@@ -47,35 +47,29 @@
|
|
|
47
47
|
"path": "dotnet-test-authoring/SKILL.md",
|
|
48
48
|
"prerequisites": ["test-authoring"]
|
|
49
49
|
},
|
|
50
|
-
{
|
|
51
|
-
"name": "final-review",
|
|
52
|
-
"plugin": "vouchington-workflow",
|
|
53
|
-
"pluginVersion": "0.19.0",
|
|
54
|
-
"path": "final-review/SKILL.md"
|
|
55
|
-
},
|
|
56
50
|
{
|
|
57
51
|
"name": "git-commit-checklist",
|
|
58
52
|
"plugin": "vouchington-workflow",
|
|
59
|
-
"pluginVersion": "0.
|
|
53
|
+
"pluginVersion": "0.20.0",
|
|
60
54
|
"path": "git-commit-checklist/SKILL.md"
|
|
61
55
|
},
|
|
62
56
|
{
|
|
63
57
|
"name": "github-actions-authoring",
|
|
64
58
|
"plugin": "vouchington-workflow",
|
|
65
|
-
"pluginVersion": "0.
|
|
59
|
+
"pluginVersion": "0.20.0",
|
|
66
60
|
"path": "github-actions-authoring/SKILL.md",
|
|
67
61
|
"prerequisites": ["github-actions-checklist"]
|
|
68
62
|
},
|
|
69
63
|
{
|
|
70
64
|
"name": "github-actions-checklist",
|
|
71
65
|
"plugin": "vouchington-workflow",
|
|
72
|
-
"pluginVersion": "0.
|
|
66
|
+
"pluginVersion": "0.20.0",
|
|
73
67
|
"path": "github-actions-checklist/SKILL.md"
|
|
74
68
|
},
|
|
75
69
|
{
|
|
76
70
|
"name": "github-issue",
|
|
77
71
|
"plugin": "vouchington-workflow",
|
|
78
|
-
"pluginVersion": "0.
|
|
72
|
+
"pluginVersion": "0.20.0",
|
|
79
73
|
"path": "github-issue/SKILL.md"
|
|
80
74
|
},
|
|
81
75
|
{
|
|
@@ -94,26 +88,26 @@
|
|
|
94
88
|
{
|
|
95
89
|
"name": "npm-publishing",
|
|
96
90
|
"plugin": "vouchington-workflow",
|
|
97
|
-
"pluginVersion": "0.
|
|
91
|
+
"pluginVersion": "0.20.0",
|
|
98
92
|
"path": "npm-publishing/SKILL.md"
|
|
99
93
|
},
|
|
100
94
|
{
|
|
101
95
|
"name": "organize-github-issues",
|
|
102
96
|
"plugin": "vouchington-workflow",
|
|
103
|
-
"pluginVersion": "0.
|
|
97
|
+
"pluginVersion": "0.20.0",
|
|
104
98
|
"path": "organize-github-issues/SKILL.md",
|
|
105
99
|
"prerequisites": ["github-issue"]
|
|
106
100
|
},
|
|
107
101
|
{
|
|
108
102
|
"name": "package-json-checklist",
|
|
109
103
|
"plugin": "vouchington-workflow",
|
|
110
|
-
"pluginVersion": "0.
|
|
104
|
+
"pluginVersion": "0.20.0",
|
|
111
105
|
"path": "package-json-checklist/SKILL.md"
|
|
112
106
|
},
|
|
113
107
|
{
|
|
114
108
|
"name": "planning",
|
|
115
109
|
"plugin": "vouchington-workflow",
|
|
116
|
-
"pluginVersion": "0.
|
|
110
|
+
"pluginVersion": "0.20.0",
|
|
117
111
|
"path": "planning/SKILL.md",
|
|
118
112
|
"prerequisites": ["github-issue"]
|
|
119
113
|
},
|
|
@@ -145,53 +139,53 @@
|
|
|
145
139
|
{
|
|
146
140
|
"name": "pr-description",
|
|
147
141
|
"plugin": "vouchington-workflow",
|
|
148
|
-
"pluginVersion": "0.
|
|
142
|
+
"pluginVersion": "0.20.0",
|
|
149
143
|
"path": "pr-description/SKILL.md"
|
|
150
144
|
},
|
|
151
145
|
{
|
|
152
146
|
"name": "retrospective",
|
|
153
147
|
"plugin": "vouchington-workflow",
|
|
154
|
-
"pluginVersion": "0.
|
|
148
|
+
"pluginVersion": "0.20.0",
|
|
155
149
|
"path": "retrospective/SKILL.md"
|
|
156
150
|
},
|
|
157
151
|
{
|
|
158
152
|
"name": "retrospective-distill",
|
|
159
153
|
"plugin": "vouchington-workflow",
|
|
160
|
-
"pluginVersion": "0.
|
|
154
|
+
"pluginVersion": "0.20.0",
|
|
161
155
|
"path": "retrospective-distill/SKILL.md",
|
|
162
156
|
"prerequisites": ["github-issue"]
|
|
163
157
|
},
|
|
164
158
|
{
|
|
165
159
|
"name": "review-ci-logs",
|
|
166
160
|
"plugin": "vouchington-workflow",
|
|
167
|
-
"pluginVersion": "0.
|
|
161
|
+
"pluginVersion": "0.20.0",
|
|
168
162
|
"path": "review-ci-logs/SKILL.md",
|
|
169
163
|
"prerequisites": ["github-actions-checklist", "pr-description"]
|
|
170
164
|
},
|
|
171
165
|
{
|
|
172
166
|
"name": "review-github-issue-taxonomy",
|
|
173
167
|
"plugin": "vouchington-workflow",
|
|
174
|
-
"pluginVersion": "0.
|
|
168
|
+
"pluginVersion": "0.20.0",
|
|
175
169
|
"path": "review-github-issue-taxonomy/SKILL.md",
|
|
176
170
|
"prerequisites": ["github-issue"]
|
|
177
171
|
},
|
|
178
172
|
{
|
|
179
173
|
"name": "revisit-followups",
|
|
180
174
|
"plugin": "vouchington-workflow",
|
|
181
|
-
"pluginVersion": "0.
|
|
175
|
+
"pluginVersion": "0.20.0",
|
|
182
176
|
"path": "revisit-followups/SKILL.md",
|
|
183
177
|
"prerequisites": ["github-issue"]
|
|
184
178
|
},
|
|
185
179
|
{
|
|
186
180
|
"name": "stacked-prs",
|
|
187
181
|
"plugin": "vouchington-workflow",
|
|
188
|
-
"pluginVersion": "0.
|
|
182
|
+
"pluginVersion": "0.20.0",
|
|
189
183
|
"path": "stacked-prs/SKILL.md"
|
|
190
184
|
},
|
|
191
185
|
{
|
|
192
186
|
"name": "static-analysis-checklist",
|
|
193
187
|
"plugin": "vouchington-workflow",
|
|
194
|
-
"pluginVersion": "0.
|
|
188
|
+
"pluginVersion": "0.20.0",
|
|
195
189
|
"path": "static-analysis-checklist/SKILL.md",
|
|
196
190
|
"prerequisites": ["github-actions-checklist"]
|
|
197
191
|
},
|
|
@@ -218,14 +212,14 @@
|
|
|
218
212
|
{
|
|
219
213
|
"name": "triage-loop",
|
|
220
214
|
"plugin": "vouchington-workflow",
|
|
221
|
-
"pluginVersion": "0.
|
|
215
|
+
"pluginVersion": "0.20.0",
|
|
222
216
|
"path": "triage-loop/SKILL.md",
|
|
223
217
|
"prerequisites": ["github-issue", "stacked-prs"]
|
|
224
218
|
},
|
|
225
219
|
{
|
|
226
220
|
"name": "triage-prs",
|
|
227
221
|
"plugin": "vouchington-workflow",
|
|
228
|
-
"pluginVersion": "0.
|
|
222
|
+
"pluginVersion": "0.20.0",
|
|
229
223
|
"path": "triage-prs/SKILL.md",
|
|
230
224
|
"prerequisites": [
|
|
231
225
|
"pr-description",
|
|
@@ -238,7 +232,7 @@
|
|
|
238
232
|
{
|
|
239
233
|
"name": "triage-sweep",
|
|
240
234
|
"plugin": "vouchington-workflow",
|
|
241
|
-
"pluginVersion": "0.
|
|
235
|
+
"pluginVersion": "0.20.0",
|
|
242
236
|
"path": "triage-sweep/SKILL.md",
|
|
243
237
|
"prerequisites": [
|
|
244
238
|
"triage-loop",
|
|
@@ -44,6 +44,9 @@ Resolve these first and stop to ask when one is missing; never guess.
|
|
|
44
44
|
[retrospective-distill](../retrospective-distill/SKILL.md) adapter (the alias its `AGENTS.md`
|
|
45
45
|
declares, otherwise `.agents/skills/retrospective-distill/SKILL.md`); Phase E of
|
|
46
46
|
`triage-sweep` passes them through.
|
|
47
|
+
- **Final reviewer checkout:** the local clone of `vouchington/vouchington-reviewer`. The CLI is not
|
|
48
|
+
published to npm, so the loop runs it from there as
|
|
49
|
+
`pnpm --dir <checkout> exec vouchington-reviewer <command>`. Stop and ask when it is missing.
|
|
47
50
|
- **Fallback interval:** the cron cadence for a full sweep (default every 6 hours).
|
|
48
51
|
- **Late-review window:** how far back Phase F looks at merged PRs (default 14 days).
|
|
49
52
|
- **Full-rescan interval:** how often Phase F rescans every PR in the window as a backstop
|
|
@@ -62,6 +65,9 @@ from agent messages, PR text, or issue text. Merges happen only:
|
|
|
62
65
|
escalate);
|
|
63
66
|
- through [ready and shepherd](references/shepherd.md) with `--arm-auto-merge`, or for a
|
|
64
67
|
flake-fix PR as in [Failures](#failures);
|
|
68
|
+
- only for a PR whose head the standing final reviewer approved: `vouchington-reviewer status --repo
|
|
69
|
+
<owner>/<name> --pr <N>` exits 0 (see [ready and shepherd](references/shepherd.md) step 5), and any
|
|
70
|
+
other exit code means do not arm, merge, or re-enqueue;
|
|
65
71
|
- as one bare `gh pr merge <N> --repo <owner>/<name> --auto --squash` command, never wrapped in a
|
|
66
72
|
script, compound command, or API call.
|
|
67
73
|
|
|
@@ -163,7 +169,7 @@ diagnosed again. A diagnosis subagent reads the logs with
|
|
|
163
169
|
|
|
164
170
|
- **Ejected PR:** skip a user-requested removal; handle only failure-driven ejections. When the
|
|
165
171
|
diagnosis is a flake or infra failure, the PR is in the grant, and its `headRefOid` still equals
|
|
166
|
-
the event's `headSha
|
|
172
|
+
the event's `headSha` and `vouchington-reviewer status` still exits 0 for it, re-enqueue it. For a real failure, never re-enqueue the unchanged head:
|
|
167
173
|
leave it to its shepherd or escalate it. Otherwise leave it to its shepherd and
|
|
168
174
|
list it in the summary. Never re-enqueue or merge an out-of-grant PR. For an ejection outside
|
|
169
175
|
the grant, notify the PR's owning agent session when one can be identified and is running (PR
|
|
@@ -198,7 +204,7 @@ An agent delegates a PR with `/shepherd` as the [agent handoff](#agent-handoff).
|
|
|
198
204
|
native stack (the REST pull object's `stack` field, else `stacks?pull_request=<N>`) and shepherd
|
|
199
205
|
the whole stack with `pr-shepherd stack` per [stacked-prs](../stacked-prs/SKILL.md); an
|
|
200
206
|
unstacked PR gets `pr-shepherd <owner>/<name>#<N> --until-terminal`. Dispatch a local shepherd
|
|
201
|
-
subagent per [ready and shepherd](references/shepherd.md) step
|
|
207
|
+
subagent per [ready and shepherd](references/shepherd.md) step 7 and record it. The adapter may
|
|
202
208
|
name a terminal workspace manager agent as the dispatch target instead.
|
|
203
209
|
- **`/plan` on an issue or PR:** a planning subagent drafts a plan with
|
|
204
210
|
[planning](../planning/SKILL.md). This is interactive: ask the human the plan's open questions
|
|
@@ -208,7 +214,7 @@ An agent delegates a PR with `/shepherd` as the [agent handoff](#agent-handoff).
|
|
|
208
214
|
that links the issue. Loop-created PRs (this one and flake-fix PRs from [Failures](#failures))
|
|
209
215
|
get the adapter's automation label at creation, so Phase B and the grant see them.
|
|
210
216
|
- **`/fix` on a PR:** the subagent pushes the fix to that PR's branch, only when the branch is in the
|
|
211
|
-
same repository; never push to a fork.
|
|
217
|
+
same repository; never push to a fork. The loop disarms an armed PR first, as in [ready and shepherd](references/shepherd.md) step 7.
|
|
212
218
|
- A `/fix` result merges only when it falls in a grant category; otherwise escalate it.
|
|
213
219
|
|
|
214
220
|
### Agent handoff
|
|
@@ -19,9 +19,22 @@ and the merge authority per PR category; stop and ask when one is missing.
|
|
|
19
19
|
4. **Mark ready and label.**
|
|
20
20
|
`gh pr view <N> --repo <owner>/<name> --json isDraft --jq .isDraft` (true: `gh pr ready`), then
|
|
21
21
|
`gh pr edit <N> --repo <owner>/<name> --add-label <automation-label>`.
|
|
22
|
-
5. **
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
5. **Request final review and gate on it.** Request a review of the current head with
|
|
23
|
+
`gh api --method POST repos/<owner>/<name>/issues/<N>/labels -f 'labels[]=final-review:requested'`
|
|
24
|
+
(or message the `final-reviewer` session with `<owner>/<name>#<N>`); adding it again requests a
|
|
25
|
+
re-review after new commits. The standing reviewer lives in `vouchington/vouchington-reviewer`.
|
|
26
|
+
Run `pnpm --dir <reviewer-checkout> exec vouchington-reviewer status --repo <owner>/<name> --pr <N>`
|
|
27
|
+
before arming, merging, or re-enqueueing: exit 0 means the newest final review approved the
|
|
28
|
+
current head and the `final approval` label is present. Any other exit code means do not merge:
|
|
29
|
+
when `gh pr view <N> --repo <owner>/<name> --json autoMergeRequest --jq .autoMergeRequest` is
|
|
30
|
+
set (armed earlier), first run `gh pr merge <N> --repo <owner>/<name> --disable-auto`; then
|
|
31
|
+
leave the PR ready and unarmed, report `awaiting-final-review`, and let a later sweep rerun the
|
|
32
|
+
check. Nothing waits on the reviewer. This gate is procedural: GitHub enforces it only through a
|
|
33
|
+
required status check, or branch protection that dismisses stale approvals, which the consuming
|
|
34
|
+
repository's adapter owns.
|
|
35
|
+
6. **Arm auto-merge (only with `--arm-auto-merge`, and only when step 5 exited 0).** Pass the flag
|
|
36
|
+
only for a category the grant covers. Check once per repository per run that
|
|
37
|
+
`gh api repos/<owner>/<name> --jq .allow_auto_merge` is true; when `false`, report `manual merge required` and continue. When the
|
|
25
38
|
REST pull object has a `stack` field, auto-merge is unavailable: report `stacked; needs explicit
|
|
26
39
|
stack-merge authorization`, skip arming, and follow
|
|
27
40
|
[stacked-prs](../../stacked-prs/SKILL.md) under the grant or explicit human approval.
|
|
@@ -30,16 +43,20 @@ and the merge authority per PR category; stop and ask when one is missing.
|
|
|
30
43
|
branch; the shepherd resolves it and the armed merge lands once checks pass.
|
|
31
44
|
- **Steered:** do not arm; arming would race the shepherd before it consumes the steering. Leave
|
|
32
45
|
the PR ready and unarmed and report `manual-verification-required`.
|
|
33
|
-
|
|
46
|
+
7. **Start the shepherd.** Never run two shepherds on one PR. Start one background worker in an
|
|
34
47
|
isolated worktree (or a workspace agent the adapter names) that runs
|
|
35
48
|
`pr-shepherd <owner>/<name>#<N> --until-terminal` and reruns it after every result except CANCEL
|
|
36
49
|
and ESCALATE: TRIAGE means fix and rerun; READY or a quota warning means rerun after the printed
|
|
37
50
|
delay; MERGE means the worker never merges, it reports the PR mergeable and stops. For a stack,
|
|
38
51
|
use `pr-shepherd stack`. Record the handoff (PR, head, worker id, time) in `shepherds`. Nothing
|
|
39
52
|
waits on the worker; on ESCALATE it reports back and the loop escalates. Remove the entry when
|
|
40
|
-
the worker stops.
|
|
41
|
-
|
|
53
|
+
the worker stops. Before any push to an armed PR, the worker or loop runs
|
|
54
|
+
`gh pr merge <N> --repo <owner>/<name> --disable-auto` and confirms `autoMergeRequest` is now
|
|
55
|
+
null; if disarming fails, it does not push and reports instead. After the push it requests a new
|
|
56
|
+
final review (the label again, as in step 5). A later sweep re-arms only when
|
|
57
|
+
`vouchington-reviewer status` exits 0 for the new head.
|
|
58
|
+
8. **Verify and report.** `gh pr view <N> --repo <owner>/<name> --json
|
|
42
59
|
isDraft,autoMergeRequest,state`. Report per PR: ready, steered, auto-merge (armed, no,
|
|
43
|
-
manual-verification-required, unavailable), shepherd (local or no), and the reason for any `no`.
|
|
60
|
+
manual-verification-required, awaiting-final-review, unavailable), shepherd (local or no), and the reason for any `no`.
|
|
44
61
|
|
|
45
62
|
The loop never posts `/shepherd` to itself: `/shepherd` is how another agent delegates a PR to it.
|
|
@@ -130,6 +130,8 @@ Classify the outcome:
|
|
|
130
130
|
|
|
131
131
|
- **Unsteered and arming succeeds:** already armed. Auto-merge may complete once requirements pass
|
|
132
132
|
while the local shepherd independently checks the PR.
|
|
133
|
+
- **Final review not yet approved (`vouchington-reviewer status` exits non-zero):** the review was
|
|
134
|
+
requested; leave the PR ready and unarmed, report `awaiting-final-review`, and never merge it.
|
|
133
135
|
- **Steered, or arming fails on a conflict:** leave the PR ready and unarmed after the shepherd
|
|
134
136
|
starts. A human inspects the eventual state and decides whether to arm auto-merge.
|
|
135
137
|
- **Repository auto-merge disabled:** dispatch the shepherd, report that a manual merge is
|
|
@@ -51,12 +51,15 @@ and `headRefOid`. Skip a PR whose auto-merge is already armed (for example by a
|
|
|
51
51
|
auto-merge workflow) while its checks pass or are pending. Arming it again or dispatching a second
|
|
52
52
|
shepherd would race the merge that is already landing.
|
|
53
53
|
|
|
54
|
-
Steered handoffs stay unarmed (see [ready and shepherd](../triage-loop/references/shepherd.md) step
|
|
55
|
-
and are reported as `shepherding, manual-verification-required
|
|
54
|
+
Steered handoffs stay unarmed (see [ready and shepherd](../triage-loop/references/shepherd.md) step 6)
|
|
55
|
+
and are reported as `shepherding, manual-verification-required`; a PR still `awaiting-final-review`
|
|
56
|
+
stays unarmed too. A later sweep arms one only when:
|
|
56
57
|
|
|
57
58
|
- its shepherd is no longer in flight;
|
|
58
59
|
- its current head passes every required check;
|
|
59
|
-
- a fresh review of that head still fits the same category
|
|
60
|
+
- a fresh review of that head still fits the same category;
|
|
61
|
+
- `vouchington-reviewer status` exits 0 for that head, including after the push that followed a disarm (see
|
|
62
|
+
[ready and shepherd](../triage-loop/references/shepherd.md) step 5).
|
|
60
63
|
|
|
61
64
|
Arming then uses one bare `gh pr merge` command, as in the grant.
|
|
62
65
|
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type FinalReviewIo, type PullTarget } from '../../final-review/index.mts';
|
|
2
|
-
export type FinalReviewDeps = {
|
|
3
|
-
createIo(target: PullTarget): FinalReviewIo;
|
|
4
|
-
readFile(path: string): string;
|
|
5
|
-
runBench(args: string[]): Promise<number>;
|
|
6
|
-
runVerifierBench(args: string[]): Promise<number>;
|
|
7
|
-
};
|
|
8
|
-
export declare function runFinalReviewCommand(args: string[], deps?: FinalReviewDeps): Promise<number>;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'node:fs';
|
|
2
|
-
import { parseArgs } from 'node:util';
|
|
3
|
-
import { createGhFinalReviewIo, finalReviewStatus, parseFinalReviewInput, numberDiff, postFinalReview, revokeFinalApproval, } from "../../final-review/index.mjs";
|
|
4
|
-
const defaultDeps = {
|
|
5
|
-
createIo: (target) => createGhFinalReviewIo(target),
|
|
6
|
-
readFile: (path) => readFileSync(path, 'utf8'),
|
|
7
|
-
runBench: async (args) => (await import("../../final-review/benchmark/cli.mjs")).runFinalReviewBenchCli(args),
|
|
8
|
-
runVerifierBench: async (args) => (await import("../../final-review/benchmark/verifier-cli.mjs")).runFinalReviewVerifierBenchCli(args),
|
|
9
|
-
};
|
|
10
|
-
function target(values) {
|
|
11
|
-
if (values.repo === undefined || values.pr === undefined)
|
|
12
|
-
throw new Error('--repo and --pr are required.');
|
|
13
|
-
return { repo: values.repo, pr: Number(values.pr) };
|
|
14
|
-
}
|
|
15
|
-
function print(value) {
|
|
16
|
-
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
17
|
-
}
|
|
18
|
-
async function run(subcommand, args, deps) {
|
|
19
|
-
if (subcommand === 'bench')
|
|
20
|
-
return deps.runBench(args);
|
|
21
|
-
if (subcommand === 'bench-verifier')
|
|
22
|
-
return deps.runVerifierBench(args);
|
|
23
|
-
const { values } = parseArgs({
|
|
24
|
-
args,
|
|
25
|
-
strict: true,
|
|
26
|
-
options: {
|
|
27
|
-
repo: { type: 'string' },
|
|
28
|
-
pr: { type: 'string' },
|
|
29
|
-
'head-sha': { type: 'string' },
|
|
30
|
-
input: { type: 'string' },
|
|
31
|
-
'dry-run': { type: 'boolean' },
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
const io = deps.createIo(target(values));
|
|
35
|
-
switch (subcommand) {
|
|
36
|
-
case 'post': {
|
|
37
|
-
if (values['head-sha'] === undefined || values.input === undefined) {
|
|
38
|
-
throw new Error('post needs --head-sha and --input.');
|
|
39
|
-
}
|
|
40
|
-
const input = parseFinalReviewInput(JSON.parse(deps.readFile(values.input)));
|
|
41
|
-
const outcome = await postFinalReview(io, input, values['head-sha'], {
|
|
42
|
-
dryRun: values['dry-run'] === true,
|
|
43
|
-
});
|
|
44
|
-
print(values['dry-run'] === true ? outcome : { ...outcome, reviews: outcome.reviews.length });
|
|
45
|
-
return 0;
|
|
46
|
-
}
|
|
47
|
-
case 'diff':
|
|
48
|
-
process.stdout.write(numberDiff(await io.diff()));
|
|
49
|
-
return 0;
|
|
50
|
-
case 'revoke':
|
|
51
|
-
print({ removed: await revokeFinalApproval(io) });
|
|
52
|
-
return 0;
|
|
53
|
-
case 'status': {
|
|
54
|
-
const status = await finalReviewStatus(io);
|
|
55
|
-
print(status);
|
|
56
|
-
return status.approved ? 0 : 1;
|
|
57
|
-
}
|
|
58
|
-
default:
|
|
59
|
-
throw new Error('final-review needs post, diff, revoke, status, bench, or bench-verifier.');
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export async function runFinalReviewCommand(args, deps = defaultDeps) {
|
|
63
|
-
try {
|
|
64
|
-
return await run(args[0], args.slice(1), deps);
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
process.stderr.write(`final-review: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
68
|
-
return 2;
|
|
69
|
-
}
|
|
70
|
-
}
|