vouchington-tooling 0.59.0 → 0.60.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 +59 -0
  2. package/dist/cli/commands/hook.d.mts +2 -0
  3. package/dist/cli/commands/hook.mjs +19 -0
  4. package/dist/cli/index.mjs +6 -0
  5. package/dist/cli/parse-forwarded-commands.d.mts +6 -0
  6. package/dist/cli/parse-forwarded-commands.mjs +4 -0
  7. package/dist/cli/parse.d.mts +6 -0
  8. package/dist/cli/usage-text.d.mts +1 -0
  9. package/dist/cli/usage-text.mjs +170 -0
  10. package/dist/cli/usage.d.mts +2 -1
  11. package/dist/cli/usage.mjs +2 -156
  12. package/dist/command-policy/engine.d.mts +7 -0
  13. package/dist/command-policy/engine.mjs +58 -0
  14. package/dist/command-policy/git-patterns.d.mts +20 -0
  15. package/dist/command-policy/git-patterns.mjs +82 -0
  16. package/dist/command-policy/git-process.d.mts +4 -0
  17. package/dist/command-policy/git-process.mjs +54 -0
  18. package/dist/command-policy/github-checkout-owners.d.mts +22 -0
  19. package/dist/command-policy/github-checkout-owners.mjs +122 -0
  20. package/dist/command-policy/github-command-context.d.mts +6 -0
  21. package/dist/command-policy/github-command-context.mjs +19 -0
  22. package/dist/command-policy/github-command-cwd.d.mts +8 -0
  23. package/dist/command-policy/github-command-cwd.mjs +130 -0
  24. package/dist/command-policy/github-command-position.d.mts +7 -0
  25. package/dist/command-policy/github-command-position.mjs +12 -0
  26. package/dist/command-policy/github-configured-base.d.mts +25 -0
  27. package/dist/command-policy/github-configured-base.mjs +59 -0
  28. package/dist/command-policy/github-invocation.d.mts +9 -0
  29. package/dist/command-policy/github-invocation.mjs +80 -0
  30. package/dist/command-policy/github-merge-authority.d.mts +21 -0
  31. package/dist/command-policy/github-merge-authority.mjs +86 -0
  32. package/dist/command-policy/github-option-flags.d.mts +3 -0
  33. package/dist/command-policy/github-option-flags.mjs +67 -0
  34. package/dist/command-policy/github-options.d.mts +12 -0
  35. package/dist/command-policy/github-options.mjs +73 -0
  36. package/dist/command-policy/github-stack-workflow.d.mts +9 -0
  37. package/dist/command-policy/github-stack-workflow.mjs +94 -0
  38. package/dist/command-policy/github-workflow.d.mts +7 -0
  39. package/dist/command-policy/github-workflow.mjs +50 -0
  40. package/dist/command-policy/hook/args.d.mts +11 -0
  41. package/dist/command-policy/hook/args.mjs +49 -0
  42. package/dist/command-policy/hook/harness.d.mts +26 -0
  43. package/dist/command-policy/hook/harness.mjs +119 -0
  44. package/dist/command-policy/hook/policy-module.d.mts +7 -0
  45. package/dist/command-policy/hook/policy-module.mjs +48 -0
  46. package/dist/command-policy/hook/post-tool-use.d.mts +9 -0
  47. package/dist/command-policy/hook/post-tool-use.mjs +51 -0
  48. package/dist/command-policy/hook/pre-tool-use.d.mts +21 -0
  49. package/dist/command-policy/hook/pre-tool-use.mjs +45 -0
  50. package/dist/command-policy/hook/run.d.mts +17 -0
  51. package/dist/command-policy/hook/run.mjs +69 -0
  52. package/dist/command-policy/hook/types.d.mts +33 -0
  53. package/dist/command-policy/hook/types.mjs +5 -0
  54. package/dist/command-policy/index.d.mts +29 -0
  55. package/dist/command-policy/index.mjs +23 -0
  56. package/dist/command-policy/path-references.d.mts +14 -0
  57. package/dist/command-policy/path-references.mjs +68 -0
  58. package/dist/command-policy/path-rules.d.mts +11 -0
  59. package/dist/command-policy/path-rules.mjs +37 -0
  60. package/dist/command-policy/payload.d.mts +8 -0
  61. package/dist/command-policy/payload.mjs +54 -0
  62. package/dist/command-policy/types.d.mts +77 -0
  63. package/dist/command-policy/types.mjs +1 -0
  64. package/dist/index.d.mts +2 -0
  65. package/dist/index.mjs +1 -0
  66. package/dist/tmux/cli-shared.d.mts +18 -0
  67. package/dist/tmux/cli-shared.mjs +8 -0
  68. package/dist/tmux/cli.d.mts +3 -0
  69. package/dist/tmux/cli.mjs +34 -0
  70. package/dist/tmux/config.d.mts +24 -0
  71. package/dist/tmux/config.mjs +91 -0
  72. package/dist/tmux/fake-tmux.test-helpers.d.mts +46 -0
  73. package/dist/tmux/fake-tmux.test-helpers.mjs +105 -0
  74. package/dist/tmux/hook-payload.d.mts +8 -0
  75. package/dist/tmux/hook-payload.mjs +39 -0
  76. package/dist/tmux/index.d.mts +9 -0
  77. package/dist/tmux/index.mjs +7 -0
  78. package/dist/tmux/launcher.d.mts +11 -0
  79. package/dist/tmux/launcher.mjs +127 -0
  80. package/dist/tmux/reminder-post-tool.d.mts +21 -0
  81. package/dist/tmux/reminder-post-tool.mjs +88 -0
  82. package/dist/tmux/runner.d.mts +11 -0
  83. package/dist/tmux/runner.mjs +26 -0
  84. package/dist/tmux/session-name.d.mts +5 -0
  85. package/dist/tmux/session-name.mjs +10 -0
  86. package/dist/tmux/shell-quote.d.mts +9 -0
  87. package/dist/tmux/shell-quote.mjs +16 -0
  88. package/dist/tmux/up.d.mts +2 -0
  89. package/dist/tmux/up.mjs +73 -0
  90. package/dist/tmux/windows.d.mts +18 -0
  91. package/dist/tmux/windows.mjs +50 -0
  92. package/package.json +11 -1
  93. package/scripts/__pycache__/run_bounded_process.cpython-312.pyc +0 -0
  94. package/scripts/tmux/tmux-agent-reminder.sh +68 -0
  95. package/scripts/tmux/tmux-name.sh +34 -0
  96. package/scripts/tmux/tmux-read-title.sh +13 -0
  97. package/scripts/tmux/tmux-target.sh +130 -0
package/README.md CHANGED
@@ -86,6 +86,11 @@ vouchington harness-assert-gates HARNESS_DISPATCH_ENABLED HARNESS_SHEPHERD_ENABL
86
86
  echo '[{"login":"octocat","type":"User"}]' | vouchington gha-collaborator-trust owner/repo --allow-bot github-actions[bot]
87
87
  vouchington nuget-central-version trusted.props candidate.props metadata.json out.props
88
88
  vouchington verify-workflow-secrets --repo owner/name --inventory .github/workflows/workflow-secrets-inventory.mts
89
+ vouchington tmux up --config tmux.json --no-attach
90
+ vouchington tmux name my-topic
91
+ vouchington tmux read-title
92
+ vouchington tmux agent-reminder session-start
93
+ vouchington tmux post-tool < hook-payload.json
89
94
  vouchington dead-code --baseline dead-code-baseline.json --config .jscpd.json --update
90
95
  vouchington swift-semantic-equal BASE HEAD App.swift
91
96
  vouchington post-review
@@ -390,6 +395,7 @@ import { runAstGrepExamples } from 'vouchington-tooling/ast-grep-examples'
390
395
  import { astGrepPackPaths } from 'vouchington-tooling/ast-grep-pack'
391
396
  import { validateNugetUpdate } from 'vouchington-tooling/nuget-central-version'
392
397
  import { runVerifyWorkflowSecretsCli } from 'vouchington-tooling/workflow-secrets-drift'
398
+ import { launchSession, loadTmuxConfig } from 'vouchington-tooling/tmux'
393
399
  import { runDeadCodeGate } from 'vouchington-tooling/dead-code'
394
400
  import { normalizeSwiftSource } from 'vouchington-tooling/swift-semantic-equal'
395
401
  import { parseUniqueSwiftBinaryTargetChecksum } from 'vouchington-tooling/swift-source-offset'
@@ -414,6 +420,24 @@ import { tokenizeShellWords } from 'vouchington-tooling/shell-parse'
414
420
 
415
421
  `vouchington-tooling/shell-parse` splits shell text into words, heredocs, redirections, and command prefixes. Callers pass the text. The parser does not decide which commands are allowed. `stripQuotedShellText` and `commandsToInspect*` do not scan `$(...)` substitutions in the command text: call `extractShellCommandSubstitutions` and inspect each result too.
416
422
 
423
+ `vouchington-tooling/command-policy` judges a tool call's shell command against a rule table the
424
+ caller supplies. `evaluateCommandPolicy(payload, policy, { automationContext })` returns a
425
+ `BlockDecision` or `null`. The `CommandPolicy` table holds typo paths, protected paths (blocked only
426
+ in automation), command and git regex rules (`standardGitPatterns()` is an opt-in preset), and an
427
+ optional `stack` section for `gh stack` workflow rules. Merge authority is generic: automation never
428
+ merges, and one plain interactive `gh pr merge` yields a `confirm` disposition. Every path, reason,
429
+ base branch, and guidance pointer is a parameter; the module has no repository-specific rules. The
430
+ GitHub command parsing it uses (invocations, options, command position and working directory,
431
+ checkout owners) is exported too.
432
+
433
+ `vouchington hook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module>`
434
+ runs that engine as a harness hook. Register it in each harness's hook configuration with the
435
+ repository's own policy module, which default-exports a `HookPolicy` (`defineHookPolicy`): a
436
+ `command` rule table, post-tool-use `checkers`, an optional `reminder`, and an optional `onPayload`
437
+ callback (for example to persist the harness session id). `pre-tool-use` exits 2 to block, including
438
+ when the module cannot load; `post-tool-use` is advisory and always exits 0, folding checker warnings
439
+ and the reminder into one `additionalContext`. `--root` defaults to the working directory. `--automation-env NAME` (repeatable) names an extra environment variable that marks the run unattended when it is set and not empty, `0`, or `false`; CI markers and `claude -p` always count. Register `post-tool-use` with an edit-only matcher (for example `Edit|Write|apply_patch`): the command treats every `file_path` it sees as an edit, and it emits the Claude/Codex `hookSpecificOutput` shape for every harness.
440
+
417
441
  `processDiffCommand` runs a caller-supplied `git diff` or `gh pr diff` executable and argv without
418
442
  a shell, emitting complete unified-diff file blocks without accumulating the whole patch. It keeps
419
443
  at most one file block (which can itself be large), preserves preambles and line content, and drains
@@ -946,3 +970,38 @@ The check preserves the existing nested SELECT/CTE, equality, inner-join, and co
946
970
  heuristics. It rejects weakened OR/NOT/boolean/CASE predicates and non-filtering left joins. Every
947
971
  recognized live source reader must be protected. Unparseable SQL fragments are skipped; malformed
948
972
  source returns false. These are bounded syntactic heuristics, not a general SQL safety proof.
973
+
974
+ ## tmux dev sessions
975
+
976
+ `vouchington tmux up --config <file>` starts the windows named in a JSON config inside one tmux
977
+ session per worktree (`<sessionPrefix>d<hash of the worktree path>`), reuses a running session,
978
+ and respawns dead windows. The config holds everything product-specific:
979
+
980
+ ```json
981
+ {
982
+ "sessionPrefix": "dev-",
983
+ "readyMarker": "ready",
984
+ "launcherPidVar": "TMUX_LAUNCHER_PID",
985
+ "env": { "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318" },
986
+ "summary": ["Web: http://localhost:3000"],
987
+ "windows": [
988
+ {
989
+ "name": "web",
990
+ "cwd": "web",
991
+ "command": "pnpm run dev",
992
+ "env": { "OTEL_SERVICE_NAME": "web" }
993
+ },
994
+ { "name": "api", "command": "node --watch api.mts" }
995
+ ]
996
+ }
997
+ ```
998
+
999
+ Windows run through `bash -lc '<command>; read'` (`"keepOpen": false` drops the `; read`).
1000
+ `--verbose` sets `TMUX_LOG_LEVEL=info` (default `error`) in every window. The tmux binary comes
1001
+ from `TMUX_TARGET_BIN`, the worktree from `TMUX_TARGET_ROOT` (default: current directory).
1002
+
1003
+ `tmux name`, `tmux read-title` and `tmux agent-reminder` verify that the pane (from
1004
+ `--socket/--pane/--worktree` or `AGENT_TMUX_SOCKET/PANE/WORKTREE`) belongs to the worktree before
1005
+ touching it. `tmux post-tool` reads an agent post-tool hook payload on stdin and prints a rename
1006
+ reminder at plan, PR, push and reset checkpoints; reminders name `TMUX_NAME_COMMAND` (default
1007
+ `vouchington tmux name`).
@@ -0,0 +1,2 @@
1
+ /** `vouchington hook pre-tool-use|post-tool-use`: see `runHook`. */
2
+ export declare function runHookCommand(args: string[]): Promise<number>;
@@ -0,0 +1,19 @@
1
+ import { runHook } from "../../command-policy/hook/run.mjs";
2
+ async function readStdin() {
3
+ if (process.stdin.isTTY)
4
+ return '';
5
+ const chunks = [];
6
+ for await (const chunk of process.stdin)
7
+ chunks.push(chunk);
8
+ return Buffer.concat(chunks).toString('utf8');
9
+ }
10
+ /** `vouchington hook pre-tool-use|post-tool-use`: see `runHook`. */
11
+ export function runHookCommand(args) {
12
+ return runHook(args, {
13
+ readStdin,
14
+ stdout: process.stdout,
15
+ stderr: process.stderr,
16
+ env: process.env,
17
+ cwd: process.cwd(),
18
+ });
19
+ }
@@ -23,8 +23,10 @@ import { runRetrospectiveTranscriptCommand } from "./commands/retrospective-tran
23
23
  import { runLinkSkill } from "./commands/link-skill.mjs";
24
24
  import { runRetrospectiveFactsCommand } from "./commands/retrospective-facts.mjs";
25
25
  import { runAgentBlackboardCommand } from "./commands/agent-blackboard.mjs";
26
+ import { runHookCommand } from "./commands/hook.mjs";
26
27
  import { runMcpCommand } from "./commands/mcp.mjs";
27
28
  import { runWorktreeCommand } from "./commands/worktree.mjs";
29
+ import { runTmuxCommand } from "../tmux/cli.mjs";
28
30
  import { runHostStoragePreflightCli } from "../host-storage/cli.mjs";
29
31
  import { runWithHostLock } from "./commands/with-host-lock.mjs";
30
32
  import { runFreshBase } from "./commands/fresh-base.mjs";
@@ -106,8 +108,12 @@ export function runCli(argv = process.argv) {
106
108
  return runMcpCommand(parsed.args);
107
109
  case 'transient-retry':
108
110
  return import("./commands/transient-retry.mjs").then((command) => command.runTransientRetryCommand(parsed.args));
111
+ case 'hook':
112
+ return runHookCommand(parsed.args);
109
113
  case 'worktree':
110
114
  return runWorktreeCommand(parsed.args);
115
+ case 'tmux':
116
+ return runTmuxCommand(parsed.args);
111
117
  case 'require-up-to-date':
112
118
  return runRequireUpToDate(parsed);
113
119
  case 'fresh-base':
@@ -46,12 +46,18 @@ type ForwardedCommand = {
46
46
  } | {
47
47
  kind: 'mcp';
48
48
  args: string[];
49
+ } | {
50
+ kind: 'hook';
51
+ args: string[];
49
52
  } | {
50
53
  kind: 'worktree';
51
54
  args: string[];
52
55
  } | {
53
56
  kind: 'transient-retry';
54
57
  args: string[];
58
+ } | {
59
+ kind: 'tmux';
60
+ args: string[];
55
61
  };
56
62
  export declare function parseForwardedCommand(command: string | undefined, args: string[]): ForwardedCommand | undefined;
57
63
  export {};
@@ -31,9 +31,13 @@ export function parseForwardedCommand(command, args) {
31
31
  return { kind: 'agent-blackboard', args };
32
32
  if (command === 'mcp')
33
33
  return { kind: 'mcp', args };
34
+ if (command === 'hook')
35
+ return { kind: 'hook', args };
34
36
  if (command === 'worktree')
35
37
  return { kind: 'worktree', args };
36
38
  if (command === 'transient-retry')
37
39
  return { kind: 'transient-retry', args };
40
+ if (command === 'tmux')
41
+ return { kind: 'tmux', args };
38
42
  return undefined;
39
43
  }
@@ -77,12 +77,18 @@ export type ParsedCli = {
77
77
  } | {
78
78
  kind: 'mcp';
79
79
  args: string[];
80
+ } | {
81
+ kind: 'hook';
82
+ args: string[];
80
83
  } | {
81
84
  kind: 'worktree';
82
85
  args: string[];
83
86
  } | {
84
87
  kind: 'transient-retry';
85
88
  args: string[];
89
+ } | {
90
+ kind: 'tmux';
91
+ args: string[];
86
92
  } | {
87
93
  kind: 'require-up-to-date';
88
94
  remote: string;
@@ -0,0 +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 materialize-pr-context Dump PR title/body/files/diff/comments and #N crawl\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 harness-assert-gates Fail if any named HARNESS_*_ENABLED gate is enabled\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 dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n post-review Post one COMMENT review from a staged payload file\n stage-review-payload Validate a review payload file into a staging directory\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\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...]\nmaterialize-pr-context\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>\nharness-assert-gates <gate>...\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]\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>\npost-review\nstage-review-payload optional|required <source> <destination>\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,\n snapshot_export, 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]\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\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";
@@ -0,0 +1,170 @@
1
+ export const USAGE = `Usage: vouchington <command> [options]
2
+
3
+ Commands:
4
+ runner-port-policy Print or validate a runner port policy
5
+ with-host-lock Run a command under a host-wide lock
6
+ host-storage Check free space on caller-supplied paths
7
+ gha-runtime-audit Audit successful GitHub Actions job runtimes
8
+ require-up-to-date Require HEAD to include a fetched remote branch
9
+ fresh-base Classify the worktree against a remote base branch
10
+ gitleaks-directory-scan Scan a directory with Gitleaks
11
+ ast-grep-examples Run AST-grep rule examples
12
+ ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON
13
+ gha-workspace-policy Check GitHub Actions workspace safety policy
14
+ gha-output Write a collision-safe multiline GITHUB_OUTPUT record
15
+ gha-needs-results Fail if required GitHub Actions job results failed
16
+ download-with-diagnostics Download a URL and report HTTP status on failure
17
+ download-optional-run-artifacts Download optional artifacts from the current run
18
+ host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot
19
+ allocate-browser-safe-ports Allocate Fetch-safe localhost ports
20
+ diagnose-port-collision Capture bounded localhost port diagnostics
21
+ prepare-trivy-db Download the Trivy vulnerability database
22
+ gha-artifacts-cleanup Delete classified GitHub Actions artifacts
23
+ agent-issue-labels Map changed paths to labels; create missing repository labels
24
+ http-origin Validate an optional HTTP(S) origin
25
+ vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file
26
+ vitest-report-attempt Write or read a Vitest report-attempt marker
27
+ prepare-vitest-reports Validate and select Vitest report JSON files
28
+ pnpm-install Install a pnpm workspace with retry and release-age fail-fast
29
+ check-cache-size Measure a path and decide whether to save a GHA cache
30
+ make-shard-matrix Emit a [1..N] GitHub Actions shard matrix
31
+ load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards
32
+ clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate
33
+ install-github-release Download a checksum-verified GitHub Release binary
34
+ run-with-timeout Run a command with GNU timeout or a Perl fallback
35
+ lint-links Two-pass lychee: internal links fail, external warn
36
+ materialize-pr-context Dump PR title/body/files/diff/comments and #N crawl
37
+ wait-for-apt-locks Wait until apt/dpkg lock files are free
38
+ install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json
39
+ ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)
40
+ harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out
41
+ harness-assert-gates Fail if any named HARNESS_*_ENABLED gate is enabled
42
+ gha-collaborator-trust Classify authors as write-access collaborators or not
43
+ nuget-central-version Validate a Directory.Packages.props PackageVersion delta
44
+ verify-workflow-secrets Check a secret inventory against live repository and environment secrets
45
+ dead-code Gate unused code against a committed jscpd baseline
46
+ swift-semantic-equal Compare Swift sources ignoring comments and whitespace
47
+ post-review Post one COMMENT review from a staged payload file
48
+ stage-review-payload Validate a review payload file into a staging directory
49
+ retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts
50
+ link-skill Link one packaged skill into an explicit consumer directory
51
+ retrospective-facts Gather immutable facts for a retrospective
52
+ agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots
53
+ mcp Serve the agent-blackboard journal tools over stdio (MCP)
54
+ hook Run a repository policy module as a pre/post tool-use hook
55
+ worktree Reclaim finished git worktrees (dry run unless --yes)
56
+ tmux Run configured dev windows in tmux; name panes; agent reminders
57
+ story-coverage Check component exports are imported by stories
58
+ transient-retry Rerun a failed GitHub Actions run when an injected rule matches
59
+
60
+ Options:
61
+ -h, --help Show this help
62
+ -v, --version Print the package version
63
+
64
+ runner-port-policy
65
+ (no args) Print the shipped policy as JSON
66
+ --file <path> Validate and print a policy file
67
+ --reserved <port> Print true if the port is reserved
68
+
69
+ with-host-lock
70
+ --name <family>
71
+ [--slots <n>]
72
+ --timeout-seconds <n>
73
+ [--command-timeout-seconds <n>]
74
+ [--failure-diagnostics <absolute-script>]
75
+ [--on-acquire-timeout fail|run-unlocked]
76
+ -- <command> [args...]
77
+
78
+ host-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]
79
+
80
+ gha-runtime-audit
81
+ [--repository owner/name] Default GITHUB_REPOSITORY
82
+ [--branch main]
83
+ [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling
84
+ [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this
85
+ --pr-workflow <name|/regex/> Repeatable
86
+ --push-workflow <name|/regex/> Repeatable
87
+
88
+ require-up-to-date --remote <name> --branch <name>
89
+ fresh-base [--remote <name>] [--branch <name>] [--skip-fetch]
90
+ gitleaks-directory-scan --config <path> [--directory <path>]
91
+ ast-grep-examples --rules <directory> --config <path>
92
+ ast-grep-pack
93
+ gha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]
94
+
95
+ gha-output <name>
96
+ gha-needs-results [label]
97
+ download-with-diagnostics <url> <destination> [-- curl-args...]
98
+ download-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>
99
+ host-pressure-diagnostics
100
+ allocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]
101
+ diagnose-port-collision [--ports "2200 2216"] [--output-dir PATH]
102
+ prepare-trivy-db
103
+ gha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]
104
+ gha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]
105
+ agent-issue-labels labels-from-paths [--labeler <path>] <path>...
106
+ agent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...
107
+ http-origin [--field NAME] [value]
108
+ vitest-blob-manifest <suite> [reports-directory]
109
+ vitest-report-attempt <write DIRECTORY SUITE|read ROOT>
110
+ prepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]
111
+ pnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false
112
+ check-cache-size <path> <max-bytes> <label>
113
+ make-shard-matrix <total>
114
+ load-runner-env
115
+ clean-workspace
116
+ install-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]
117
+ run-with-timeout <timeout-seconds> <kill-after-seconds> <command...>
118
+ lint-links [--offline] [--config PATH] [--glob PATTERN] [files...]
119
+ materialize-pr-context
120
+ wait-for-apt-locks
121
+ install-playwright-chromium-arm64 [name:archive...]
122
+ ghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]
123
+ harness-admission-lane <lanes>
124
+ harness-assert-gates <gate>...
125
+ gha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json
126
+ nuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>
127
+ verify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]
128
+ dead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...
129
+ swift-semantic-equal <base> <head> <file.swift>
130
+ post-review
131
+ stage-review-payload optional|required <source> <destination>
132
+ retrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]
133
+ link-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill
134
+ retrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]
135
+ agent-blackboard probe
136
+ agent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)
137
+ agent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601
138
+ agent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{"sessions":N,"entries":N,"records":N,"bytes":N}'
139
+ agent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]
140
+ mcp
141
+ (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,
142
+ session_ensure, retrospective_check, retrospective_save,
143
+ pr_validate, pr_create, pr_update,
144
+ snapshot_export, snapshot_cleanup, and session_archive over stdio.
145
+ Needs the optional @modelcontextprotocol/sdk peer (and zod).
146
+ Launch it from inside the repository's git worktree.
147
+
148
+ hook pre-tool-use|post-tool-use --harness claude|codex|cursor|grok --policy <module> [--root <dir>] [--automation-env NAME]...
149
+ Reads the harness hook payload on stdin. <module> default-exports a policy object (or a function
150
+ of the hook context returning one) with a command rule table, post-tool-use checkers, and an
151
+ optional reminder. pre-tool-use exits 2 to block, and also when the policy cannot load.
152
+ post-tool-use is advisory and always exits 0. --root defaults to the working directory.
153
+ Each --automation-env NAME (repeatable) marks the run unattended when that environment variable
154
+ is set, non-empty, and not 0 or false; CI markers and claude -p are always unattended.
155
+
156
+ worktree reclaim [--yes] [--json]
157
+ Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the
158
+ branch is merged or closed at exactly HEAD, using git worktree remove (never forced).
159
+ Skips the main checkout, the current worktree, and locked, bare or detached worktrees.
160
+
161
+ transient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>
162
+ Loads a module exporting "rules" (and optionally "limits"), evaluates them against the failed run,
163
+ and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.
164
+
165
+ tmux up --config <file> [--root <dir>] [--no-attach] [-v|--verbose]
166
+ tmux name [--socket PATH --pane %ID --worktree PATH] <name> | read-title | post-tool | agent-reminder <event>
167
+ Environment: TMUX_TARGET_BIN, TMUX_TARGET_ROOT, TMUX_NAME_COMMAND, AGENT_TMUX_SOCKET/PANE/WORKTREE.
168
+
169
+ story-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>]
170
+ `;
@@ -1,4 +1,5 @@
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 materialize-pr-context Dump PR title/body/files/diff/comments and #N crawl\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 harness-assert-gates Fail if any named HARNESS_*_ENABLED gate is enabled\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 dead-code Gate unused code against a committed jscpd baseline\n swift-semantic-equal Compare Swift sources ignoring comments and whitespace\n post-review Post one COMMENT review from a staged payload file\n stage-review-payload Validate a review payload file into a staging directory\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 worktree Reclaim finished git worktrees (dry run unless --yes)\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\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...]\nmaterialize-pr-context\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>\nharness-assert-gates <gate>...\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]\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>\npost-review\nstage-review-payload optional|required <source> <destination>\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,\n snapshot_export, 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\nworktree reclaim [--yes] [--json]\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\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
+ import { USAGE } from './usage-text.mts';
2
+ export { USAGE };
2
3
  export declare function printUsage(stream?: NodeJS.WritableStream): void;
3
4
  export declare function commandNames(usage?: string): string[];
4
5
  export declare function commandUsage(command: string, usage?: string): string;
@@ -1,159 +1,5 @@
1
- export const USAGE = `Usage: vouchington <command> [options]
2
-
3
- Commands:
4
- runner-port-policy Print or validate a runner port policy
5
- with-host-lock Run a command under a host-wide lock
6
- host-storage Check free space on caller-supplied paths
7
- gha-runtime-audit Audit successful GitHub Actions job runtimes
8
- require-up-to-date Require HEAD to include a fetched remote branch
9
- fresh-base Classify the worktree against a remote base branch
10
- gitleaks-directory-scan Scan a directory with Gitleaks
11
- ast-grep-examples Run AST-grep rule examples
12
- ast-grep-pack Print shipped unconditional AST-grep pack paths as JSON
13
- gha-workspace-policy Check GitHub Actions workspace safety policy
14
- gha-output Write a collision-safe multiline GITHUB_OUTPUT record
15
- gha-needs-results Fail if required GitHub Actions job results failed
16
- download-with-diagnostics Download a URL and report HTTP status on failure
17
- download-optional-run-artifacts Download optional artifacts from the current run
18
- host-pressure-diagnostics Print a bounded host memory/OOM/PSI snapshot
19
- allocate-browser-safe-ports Allocate Fetch-safe localhost ports
20
- diagnose-port-collision Capture bounded localhost port diagnostics
21
- prepare-trivy-db Download the Trivy vulnerability database
22
- gha-artifacts-cleanup Delete classified GitHub Actions artifacts
23
- agent-issue-labels Map changed paths to labels; create missing repository labels
24
- http-origin Validate an optional HTTP(S) origin
25
- vitest-blob-manifest Stamp a vitest-blob-manifest:v1 identity file
26
- vitest-report-attempt Write or read a Vitest report-attempt marker
27
- prepare-vitest-reports Validate and select Vitest report JSON files
28
- pnpm-install Install a pnpm workspace with retry and release-age fail-fast
29
- check-cache-size Measure a path and decide whether to save a GHA cache
30
- make-shard-matrix Emit a [1..N] GitHub Actions shard matrix
31
- load-runner-env Overlay a runner env file onto GITHUB_ENV with injection guards
32
- clean-workspace Reset a persistent-runner workspace with a fork-PR trust gate
33
- install-github-release Download a checksum-verified GitHub Release binary
34
- run-with-timeout Run a command with GNU timeout or a Perl fallback
35
- lint-links Two-pass lychee: internal links fail, external warn
36
- materialize-pr-context Dump PR title/body/files/diff/comments and #N crawl
37
- wait-for-apt-locks Wait until apt/dpkg lock files are free
38
- install-playwright-chromium-arm64 Install Playwright Chromium from browsers.json
39
- ghcr-package-retention Delete old GHCR package versions (KEEP_MIN or --main-history)
40
- harness-admission-lane Compute a GITHUB_RUN_ID admission lane for fleet fan-out
41
- harness-assert-gates Fail if any named HARNESS_*_ENABLED gate is enabled
42
- gha-collaborator-trust Classify authors as write-access collaborators or not
43
- nuget-central-version Validate a Directory.Packages.props PackageVersion delta
44
- verify-workflow-secrets Check a secret inventory against live repository and environment secrets
45
- dead-code Gate unused code against a committed jscpd baseline
46
- swift-semantic-equal Compare Swift sources ignoring comments and whitespace
47
- post-review Post one COMMENT review from a staged payload file
48
- stage-review-payload Validate a review payload file into a staging directory
49
- retrospective-transcript Format facts from Claude-compatible, Codex, or Grok transcripts
50
- link-skill Link one packaged skill into an explicit consumer directory
51
- retrospective-facts Gather immutable facts for a retrospective
52
- agent-blackboard Probe an Agent Blackboard deployment, classify distill sessions, manage snapshots
53
- mcp Serve the agent-blackboard journal tools over stdio (MCP)
54
- worktree Reclaim finished git worktrees (dry run unless --yes)
55
- story-coverage Check component exports are imported by stories
56
- transient-retry Rerun a failed GitHub Actions run when an injected rule matches
57
-
58
- Options:
59
- -h, --help Show this help
60
- -v, --version Print the package version
61
-
62
- runner-port-policy
63
- (no args) Print the shipped policy as JSON
64
- --file <path> Validate and print a policy file
65
- --reserved <port> Print true if the port is reserved
66
-
67
- with-host-lock
68
- --name <family>
69
- [--slots <n>]
70
- --timeout-seconds <n>
71
- [--command-timeout-seconds <n>]
72
- [--failure-diagnostics <absolute-script>]
73
- [--on-acquire-timeout fail|run-unlocked]
74
- -- <command> [args...]
75
-
76
- host-storage --path <path> [--path <path>...] [--minimum-free-bytes <bytes>] [--pnpm-store] [--docker-root] [--docker-desktop-path <path>] [--discovery-timeout-ms <ms>]
77
-
78
- gha-runtime-audit
79
- [--repository owner/name] Default GITHUB_REPOSITORY
80
- [--branch main]
81
- [--median-threshold-floor <seconds>] Off unless set. Must be below the ceiling
82
- [--median-threshold-ceiling <seconds>] Default 360. Flags a five-sample median above this
83
- --pr-workflow <name|/regex/> Repeatable
84
- --push-workflow <name|/regex/> Repeatable
85
-
86
- require-up-to-date --remote <name> --branch <name>
87
- fresh-base [--remote <name>] [--branch <name>] [--skip-fetch]
88
- gitleaks-directory-scan --config <path> [--directory <path>]
89
- ast-grep-examples --rules <directory> --config <path>
90
- ast-grep-pack
91
- gha-workspace-policy [--root <directory>] [--workflow-directory <directory>] [--action-directory <directory>]
92
-
93
- gha-output <name>
94
- gha-needs-results [label]
95
- download-with-diagnostics <url> <destination> [-- curl-args...]
96
- download-optional-run-artifacts (--name <name>... | --pattern <pattern>) --dir <directory>
97
- host-pressure-diagnostics
98
- allocate-browser-safe-ports <count> [--policy path] [--forbidden-ports path]
99
- diagnose-port-collision [--ports "2200 2216"] [--output-dir PATH]
100
- prepare-trivy-db
101
- gha-artifacts-cleanup run --run-id <id> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]
102
- gha-artifacts-cleanup sweep --older-than-hours <n> [--keep-pattern glob] [--delete-pattern glob] [--patterns-file json]
103
- agent-issue-labels labels-from-paths [--labeler <path>] <path>...
104
- agent-issue-labels ensure-labels [--repo owner/name] [--policy-file json] [--update] <label>...
105
- http-origin [--field NAME] [value]
106
- vitest-blob-manifest <suite> [reports-directory]
107
- vitest-report-attempt <write DIRECTORY SUITE|read ROOT>
108
- prepare-vitest-reports [primary-directory] [fallback-directory] [output-directory]
109
- pnpm-install --runner-lifecycle persistent|ephemeral|ephemeral-full --install-scripts true|false
110
- check-cache-size <path> <max-bytes> <label>
111
- make-shard-matrix <total>
112
- load-runner-env
113
- clean-workspace
114
- install-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]
115
- run-with-timeout <timeout-seconds> <kill-after-seconds> <command...>
116
- lint-links [--offline] [--config PATH] [--glob PATTERN] [files...]
117
- materialize-pr-context
118
- wait-for-apt-locks
119
- install-playwright-chromium-arm64 [name:archive...]
120
- ghcr-package-retention [--main-history] [--apply|--dry-run] [<url-encoded-package>...]
121
- harness-admission-lane <lanes>
122
- harness-assert-gates <gate>...
123
- gha-collaborator-trust <owner/repo> [--allow-bot <login>]... < authors.json
124
- nuget-central-version <trusted-props> <candidate-props> <metadata-json> <output-props>
125
- verify-workflow-secrets [--repo OWNER/NAME] [--confirm NAME,...] [--inventory MODULE] [--export NAME] [--branch NAME]
126
- dead-code --baseline PATH [--seed|--update] [--config PATH] [--binary PATH] [--repo-root PATH] [--entry GLOB]... [--snapshot-ignore GLOB]... [--exclude GLOB]...
127
- swift-semantic-equal <base> <head> <file.swift>
128
- post-review
129
- stage-review-payload optional|required <source> <destination>
130
- retrospective-transcript [--session-id ID] [--jsonl PATH] [--projects-dir PATH] [--codex-sessions-dir PATH] [--grok-sessions-dir PATH]
131
- link-skill <name> --source-root <skills-dir> --target-root <consumer-skills-dir> Link a packaged or repository-local skill
132
- retrospective-facts (--pr NUMBER | --branch NAME | --no-pr) [--repo OWNER/NAME] [--raw]
133
- agent-blackboard probe
134
- agent-blackboard session-start [--skip-env NAME] [--setup-hint TEXT] [--docs-path PATH] [--restore-hint TEXT] [--timeout-ms N] (SessionStart hook; payload on stdin)
135
- agent-blackboard distill classify <partition.jsonl> --retro-cutoff ISO8601 --session-cutoff ISO8601
136
- agent-blackboard snapshot partition --snapshot PATH --checksum SHA256 --counts '{"sessions":N,"entries":N,"records":N,"bytes":N}'
137
- agent-blackboard snapshot cleanup [--snapshot PATH] [--partition-directory PATH --receipt JSON]
138
- mcp
139
- (no args) Serve journal_append, journal_entries, outbox_status, outbox_flush,
140
- session_ensure, retrospective_check, retrospective_save,
141
- pr_validate, pr_create, pr_update,
142
- snapshot_export, snapshot_cleanup, and session_archive over stdio.
143
- Needs the optional @modelcontextprotocol/sdk peer (and zod).
144
- Launch it from inside the repository's git worktree.
145
-
146
- worktree reclaim [--yes] [--json]
147
- Dry run by default. Removes clean, fully pushed worktrees whose same-repository PR for the
148
- branch is merged or closed at exactly HEAD, using git worktree remove (never forced).
149
- Skips the main checkout, the current worktree, and locked, bare or detached worktrees.
150
-
151
- transient-retry --rules <module> [--repo owner/name] [--token-env NAME] [--dry-run] <run-id>
152
- Loads a module exporting "rules" (and optionally "limits"), evaluates them against the failed run,
153
- and reruns only on a match. Exits 0 on rerun, 2 when none is warranted, 1 on error.
154
-
155
- story-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>]
156
- `;
1
+ import { USAGE } from "./usage-text.mjs";
2
+ export { USAGE };
157
3
  export function printUsage(stream = process.stdout) {
158
4
  stream.write(USAGE);
159
5
  }
@@ -0,0 +1,7 @@
1
+ import type { BlockDecision, CommandPolicy, EvaluateOptions, HookPayload } from './types.mts';
2
+ /**
3
+ * Decides whether a tool call may run under a caller-supplied rule table. Every check that can
4
+ * block runs first; the interactive lone-merge confirm is the final return, so a block anywhere in
5
+ * the command always beats the merge allow. Returns null when the policy has no opinion.
6
+ */
7
+ export declare function evaluateCommandPolicy(payload: HookPayload, policy: CommandPolicy, options?: EvaluateOptions): BlockDecision | null;