vouchington-tooling 0.74.1 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -0
- package/dist/cli/commands/workspace-registry-check.d.mts +15 -0
- package/dist/cli/commands/workspace-registry-check.mjs +72 -0
- package/dist/cli/index.mjs +3 -6
- package/dist/cli/parse-forwarded-commands.d.mts +1 -1
- package/dist/cli/parse-forwarded-commands.mjs +1 -0
- package/dist/cli/parse.d.mts +3 -0
- package/dist/cli/policy-dispatch.d.mts +8 -0
- package/dist/cli/policy-dispatch.mjs +22 -0
- package/dist/cli/usage-text-policy.d.mts +2 -2
- package/dist/cli/usage-text-policy.mjs +10 -0
- package/dist/cli/usage-text.d.mts +1 -1
- package/dist/workspace-registry-check/check.d.mts +15 -0
- package/dist/workspace-registry-check/check.mjs +58 -0
- package/dist/workspace-registry-check/entries.d.mts +9 -0
- package/dist/workspace-registry-check/entries.mjs +23 -0
- package/dist/workspace-registry-check/globs.d.mts +7 -0
- package/dist/workspace-registry-check/globs.mjs +30 -0
- package/dist/workspace-registry-check/index.d.mts +4 -0
- package/dist/workspace-registry-check/index.mjs +2 -0
- package/dist/workspace-registry-check/load.d.mts +15 -0
- package/dist/workspace-registry-check/load.mjs +14 -0
- package/package.json +6 -1
- package/scripts/__pycache__/run_bounded_process.cpython-312.pyc +0 -0
package/README.md
CHANGED
|
@@ -407,6 +407,31 @@ The pure `findCoverageScopeMismatches(files, config, instrumentedScope)` and
|
|
|
407
407
|
`checkCoverageScope({ cwd, rulesFile, instrumentedScope, listFiles })` (which returns the
|
|
408
408
|
mismatches) are exported from `vouchington-tooling/coverage-scope`.
|
|
409
409
|
|
|
410
|
+
## Checking package registries against tracked manifests
|
|
411
|
+
|
|
412
|
+
`vouchington workspace-registry-check [--root <dir>] [--syncpack-config <path>]
|
|
413
|
+
[--workspace-file <path>] [--path-filters <path>] [--tooling-group <name>]
|
|
414
|
+
[--trigger-only-glob <glob>] [--runtime-prefix <prefix>]` reconciles every `package.json` listed by
|
|
415
|
+
`git ls-files` under `--root` (default the current directory) with three registry files (five checks) and
|
|
416
|
+
prints one line per violation to stderr (exit 1; 0 when clean, 2 on a usage error):
|
|
417
|
+
|
|
418
|
+
| Registry | Default path | Checks |
|
|
419
|
+
| --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
420
|
+
| syncpack `source` | `.syncpackrc.json` (`--syncpack-config`) | non-empty; every manifest matched; stale fixed entries (brace-expanded); unmatched wildcards |
|
|
421
|
+
| pnpm `packages` | `pnpm-workspace.yaml` (`--workspace-file`) | unmatched globs; negated globs rejected; every non-root manifest matched |
|
|
422
|
+
| CI path-filter groups | `.github/ci-path-filters.yml` (`--path-filters`) | every manifest matched by a real group; stale fixed and unmatched wildcard manifest entries |
|
|
423
|
+
| mirror groups | same file | each group named `<--runtime-prefix><name>` (default `runtime-`) has a primary group `<name>` whose brace-flattened positive globs equal its own |
|
|
424
|
+
| tooling reachability | same file | every manifest and wildcard workspace glob is matched by the `--tooling-group` group (default `tooling`) |
|
|
425
|
+
|
|
426
|
+
The `--trigger-only-glob` (default `**/package.json`) in the tooling group only triggers CI and does
|
|
427
|
+
not count as registering a manifest in the "real CI path-filter group" check; the tooling
|
|
428
|
+
reachability check still matches against the whole group, trigger-only glob included. The pure `checkRegistries(trackedFiles, files, names)` and
|
|
429
|
+
`loadRegistryFiles(root, paths)` are exported from `vouchington-tooling/workspace-registry-check`.
|
|
430
|
+
|
|
431
|
+
```bash
|
|
432
|
+
vouchington workspace-registry-check --path-filters .github/paths.yml --tooling-group ci
|
|
433
|
+
```
|
|
434
|
+
|
|
410
435
|
## Trivy policy and Docker Hub mirror checks
|
|
411
436
|
|
|
412
437
|
Two repository-file checks read the git-tracked files (`git ls-files -z`) under `--root` (default
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type SharedContext } from '../../shared-context/index.mts';
|
|
2
|
+
interface Dependencies {
|
|
3
|
+
readonly buildContext?: (root: string) => Promise<SharedContext>;
|
|
4
|
+
readonly stdout?: Pick<NodeJS.WritableStream, 'write'>;
|
|
5
|
+
readonly stderr?: Pick<NodeJS.WritableStream, 'write'>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* `vouchington workspace-registry-check [--root <dir>] [--syncpack-config <path>]
|
|
9
|
+
* [--workspace-file <path>] [--path-filters <path>] [--tooling-group <name>]
|
|
10
|
+
* [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]`: prints one line per violation of the
|
|
11
|
+
* package registries against tracked `package.json` manifests to stderr and exits 1; exits 2 on a
|
|
12
|
+
* usage error and 0 when every registry covers every manifest.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runWorkspaceRegistryCheckCommand(args: readonly string[], dependencies?: Dependencies): Promise<number>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { buildSharedContext } from "../../shared-context/index.mjs";
|
|
4
|
+
import { checkRegistries, loadRegistryFiles } from "../../workspace-registry-check/index.mjs";
|
|
5
|
+
import { commandUsage } from "../usage.mjs";
|
|
6
|
+
/**
|
|
7
|
+
* `vouchington workspace-registry-check [--root <dir>] [--syncpack-config <path>]
|
|
8
|
+
* [--workspace-file <path>] [--path-filters <path>] [--tooling-group <name>]
|
|
9
|
+
* [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]`: prints one line per violation of the
|
|
10
|
+
* package registries against tracked `package.json` manifests to stderr and exits 1; exits 2 on a
|
|
11
|
+
* usage error and 0 when every registry covers every manifest.
|
|
12
|
+
*/
|
|
13
|
+
export async function runWorkspaceRegistryCheckCommand(args, dependencies = {}) {
|
|
14
|
+
const stdout = dependencies.stdout ?? process.stdout;
|
|
15
|
+
const stderr = dependencies.stderr ?? process.stderr;
|
|
16
|
+
let values;
|
|
17
|
+
try {
|
|
18
|
+
values = parseArgs({
|
|
19
|
+
args: [...args],
|
|
20
|
+
allowPositionals: false,
|
|
21
|
+
options: {
|
|
22
|
+
root: { type: 'string' },
|
|
23
|
+
'syncpack-config': { type: 'string', default: '.syncpackrc.json' },
|
|
24
|
+
'workspace-file': { type: 'string', default: 'pnpm-workspace.yaml' },
|
|
25
|
+
'path-filters': { type: 'string', default: '.github/ci-path-filters.yml' },
|
|
26
|
+
'tooling-group': { type: 'string', default: 'tooling' },
|
|
27
|
+
'trigger-only-glob': { type: 'string', default: '**/package.json' },
|
|
28
|
+
'runtime-prefix': { type: 'string', default: 'runtime-' },
|
|
29
|
+
},
|
|
30
|
+
}).values;
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
stderr.write(`vouchington: ${error.message}\n${commandUsage('workspace-registry-check')}`);
|
|
34
|
+
return 2;
|
|
35
|
+
}
|
|
36
|
+
if (values['runtime-prefix'] === '') {
|
|
37
|
+
stderr.write(`vouchington: --runtime-prefix needs a non-empty value\n${commandUsage('workspace-registry-check')}`);
|
|
38
|
+
return 2;
|
|
39
|
+
}
|
|
40
|
+
const root = resolve(values.root ?? process.cwd());
|
|
41
|
+
try {
|
|
42
|
+
const context = await (dependencies.buildContext ?? buildSharedContext)(root);
|
|
43
|
+
if (!context.isInsideGitRepo) {
|
|
44
|
+
stderr.write(`vouchington: ${root} is not inside a git repository\n`);
|
|
45
|
+
return 1;
|
|
46
|
+
}
|
|
47
|
+
const syncpackConfig = values['syncpack-config'];
|
|
48
|
+
const workspaceFile = values['workspace-file'];
|
|
49
|
+
const files = loadRegistryFiles(context.repoRoot, {
|
|
50
|
+
syncpackConfig,
|
|
51
|
+
workspaceFile,
|
|
52
|
+
pathFilters: values['path-filters'],
|
|
53
|
+
});
|
|
54
|
+
const violations = checkRegistries(context.trackedFiles, files, {
|
|
55
|
+
syncpackConfig,
|
|
56
|
+
workspaceFile,
|
|
57
|
+
toolingGroup: values['tooling-group'],
|
|
58
|
+
triggerOnlyGlob: values['trigger-only-glob'],
|
|
59
|
+
runtimePrefix: values['runtime-prefix'],
|
|
60
|
+
});
|
|
61
|
+
if (violations.length === 0) {
|
|
62
|
+
stdout.write('Workspace registry coverage: ok\n');
|
|
63
|
+
return 0;
|
|
64
|
+
}
|
|
65
|
+
stderr.write(`${violations.join('\n')}\n`);
|
|
66
|
+
return 1;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
stderr.write(`vouchington: ${error.message}\n`);
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
package/dist/cli/index.mjs
CHANGED
|
@@ -36,12 +36,15 @@ import { runAstGrepPackCommand } from "./commands/ast-grep-pack.mjs";
|
|
|
36
36
|
import { runGhaWorkspacePolicy } from "./commands/gha-workspace-policy.mjs";
|
|
37
37
|
import { readInstalledVersion } from "./installed-version.mjs";
|
|
38
38
|
import { parseCli } from "./parse.mjs";
|
|
39
|
+
import { isPolicyCli, runPolicyCommand } from "./policy-dispatch.mjs";
|
|
39
40
|
import { SCRIPT_PATHS } from "./script-paths.mjs";
|
|
40
41
|
import { runStoryCoverageLazy } from "./story-coverage-lazy.mjs";
|
|
41
42
|
import { packageScriptPath } from "./script-path.mjs";
|
|
42
43
|
import { commandUsage, printUsage } from "./usage.mjs";
|
|
43
44
|
export function runCli(argv = process.argv) {
|
|
44
45
|
const parsed = parseCli(argv);
|
|
46
|
+
if (isPolicyCli(parsed))
|
|
47
|
+
return runPolicyCommand(parsed);
|
|
45
48
|
switch (parsed.kind) {
|
|
46
49
|
case 'help':
|
|
47
50
|
printUsage();
|
|
@@ -110,14 +113,8 @@ export function runCli(argv = process.argv) {
|
|
|
110
113
|
return import("./commands/transient-retry.mjs").then((command) => command.runTransientRetryCommand(parsed.args));
|
|
111
114
|
case 'sandbox-command-audit':
|
|
112
115
|
return import("./commands/sandbox-command-audit.mjs").then((command) => command.runSandboxCommandAuditCommand(parsed.args));
|
|
113
|
-
case 'coverage-scope-check':
|
|
114
|
-
return import("./commands/coverage-scope-check.mjs").then((command) => command.runCoverageScopeCheckCommand(parsed.args));
|
|
115
116
|
case 'cloc':
|
|
116
117
|
return import("./commands/cloc.mjs").then((command) => command.runClocCommand(parsed.args));
|
|
117
|
-
case 'trivy-policy':
|
|
118
|
-
return import("./commands/trivy-policy.mjs").then((command) => command.runTrivyPolicyCommand(parsed.args));
|
|
119
|
-
case 'docker-image-mirror':
|
|
120
|
-
return import("./commands/docker-image-mirror.mjs").then((command) => command.runDockerImageMirrorCommand(parsed.args));
|
|
121
118
|
case 'storybook-browser-runner':
|
|
122
119
|
return import("./commands/storybook-browser-runner.mjs").then((command) => command.runStorybookBrowserRunnerCommand(parsed.args));
|
|
123
120
|
case 'hook':
|
|
@@ -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", "dead-code", "swift-semantic-equal", "post-review", "stage-review-payload", "retrospective-transcript", "retrospective-facts", "agent-blackboard", "mcp", "hook", "worktree", "transient-retry", "sandbox-command-audit", "cloc", "coverage-scope-check", "trivy-policy", "docker-image-mirror", "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", "dead-code", "swift-semantic-equal", "post-review", "stage-review-payload", "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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ParsedCli } from './parse.mts';
|
|
2
|
+
type PolicyCli = Extract<ParsedCli, {
|
|
3
|
+
kind: 'coverage-scope-check' | 'trivy-policy' | 'docker-image-mirror' | 'workspace-registry-check';
|
|
4
|
+
}>;
|
|
5
|
+
export declare function isPolicyCli(parsed: ParsedCli): parsed is PolicyCli;
|
|
6
|
+
/** Lazily loads and runs a repository-file policy command. */
|
|
7
|
+
export declare function runPolicyCommand(parsed: PolicyCli): Promise<number> | number;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const POLICY_KINDS = new Set([
|
|
2
|
+
'coverage-scope-check',
|
|
3
|
+
'trivy-policy',
|
|
4
|
+
'docker-image-mirror',
|
|
5
|
+
'workspace-registry-check',
|
|
6
|
+
]);
|
|
7
|
+
export function isPolicyCli(parsed) {
|
|
8
|
+
return POLICY_KINDS.has(parsed.kind);
|
|
9
|
+
}
|
|
10
|
+
/** Lazily loads and runs a repository-file policy command. */
|
|
11
|
+
export function runPolicyCommand(parsed) {
|
|
12
|
+
switch (parsed.kind) {
|
|
13
|
+
case 'coverage-scope-check':
|
|
14
|
+
return import("./commands/coverage-scope-check.mjs").then((command) => command.runCoverageScopeCheckCommand(parsed.args));
|
|
15
|
+
case 'trivy-policy':
|
|
16
|
+
return import("./commands/trivy-policy.mjs").then((command) => command.runTrivyPolicyCommand(parsed.args));
|
|
17
|
+
case 'docker-image-mirror':
|
|
18
|
+
return import("./commands/docker-image-mirror.mjs").then((command) => command.runDockerImageMirrorCommand(parsed.args));
|
|
19
|
+
case 'workspace-registry-check':
|
|
20
|
+
return import("./commands/workspace-registry-check.mjs").then((command) => command.runWorkspaceRegistryCheckCommand(parsed.args));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -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";
|
|
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 run block (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\n";
|
|
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 run block (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";
|
|
@@ -2,6 +2,7 @@ import { COVERAGE_SCOPE_CHECK_USAGE } from "./usage-text-coverage-scope.mjs";
|
|
|
2
2
|
export const POLICY_COMMANDS = ` coverage-scope-check Check positive-threshold coverage rules against the Vitest scope
|
|
3
3
|
trivy-policy Check tracked Trivy workflow scans and the exception registry
|
|
4
4
|
docker-image-mirror Require tracked Docker images to come from a Docker Hub mirror
|
|
5
|
+
workspace-registry-check Check syncpack, pnpm workspace and CI path-filter registries against tracked manifests
|
|
5
6
|
`;
|
|
6
7
|
export const POLICY_USAGE = `
|
|
7
8
|
${COVERAGE_SCOPE_CHECK_USAGE}
|
|
@@ -28,4 +29,13 @@ docker-image-mirror [--root <dir>] [--mirror <host>] [--allow-registry <prefix>]
|
|
|
28
29
|
--allow-ref-expression (repeatable) is an audited escape hatch for dynamic job outputs: a reference
|
|
29
30
|
whose raw text exactly equals the value is accepted. Images the same file builds locally are exempt.
|
|
30
31
|
|
|
32
|
+
workspace-registry-check [--root <dir>] [--syncpack-config <path>] [--workspace-file <path>]
|
|
33
|
+
[--path-filters <path>] [--tooling-group <name>] [--trigger-only-glob <glob>] [--runtime-prefix <prefix>]
|
|
34
|
+
Reconciles git-tracked package.json manifests with the syncpack "source" globs (default
|
|
35
|
+
.syncpackrc.json), the pnpm "packages" globs (pnpm-workspace.yaml) and the dorny/paths-filter groups
|
|
36
|
+
(.github/ci-path-filters.yml) and prints one line per violation (exit 1). The --tooling-group group
|
|
37
|
+
(default tooling) must reach every manifest and wildcard workspace glob, and its --trigger-only-glob
|
|
38
|
+
(default **/package.json) does not count as registering a manifest. Each group named with
|
|
39
|
+
--runtime-prefix (default runtime-) must mirror the primary group of the same name.
|
|
40
|
+
|
|
31
41
|
`;
|
|
@@ -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 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 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 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...]\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_partition, 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 run block (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\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 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 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...]\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_partition, 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 run block (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";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { RegistryFiles } from './load.mts';
|
|
2
|
+
export interface RegistryNames {
|
|
3
|
+
/** Display name of the syncpack config, used in messages. */
|
|
4
|
+
syncpackConfig: string;
|
|
5
|
+
/** Display name of the pnpm workspace file, used in messages. */
|
|
6
|
+
workspaceFile: string;
|
|
7
|
+
/** Path-filter group that must reach every manifest. */
|
|
8
|
+
toolingGroup: string;
|
|
9
|
+
/** Glob in the tooling group that only triggers CI and does not register a manifest. */
|
|
10
|
+
triggerOnlyGlob: string;
|
|
11
|
+
/** Prefix of path-filter groups that mirror a primary group. */
|
|
12
|
+
runtimePrefix: string;
|
|
13
|
+
}
|
|
14
|
+
/** Validates the package registries against the tracked `package.json` manifests. */
|
|
15
|
+
export declare function checkRegistries(trackedFiles: readonly string[], files: RegistryFiles, names: RegistryNames): string[];
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import picomatch from 'picomatch';
|
|
2
|
+
import { staleEntries } from "./entries.mjs";
|
|
3
|
+
import { flattenBraceGlobs, isManifestPath, manifestGlob, sameSet } from "./globs.mjs";
|
|
4
|
+
function matchesAny(path, globs) {
|
|
5
|
+
return picomatch.isMatch(path, [...globs]);
|
|
6
|
+
}
|
|
7
|
+
function runtimeViolations(runtime, primary, prefix) {
|
|
8
|
+
const violations = [];
|
|
9
|
+
for (const [name, runtimeGlobs] of Object.entries(runtime)) {
|
|
10
|
+
const primaryGlobs = primary[name];
|
|
11
|
+
if (!Array.isArray(primaryGlobs)) {
|
|
12
|
+
violations.push(`${prefix}${name} has no primary CI path-filter group`);
|
|
13
|
+
}
|
|
14
|
+
const positive = flattenBraceGlobs(runtimeGlobs.filter((glob) => !glob.startsWith('!')));
|
|
15
|
+
if (!sameSet(positive, flattenBraceGlobs(primaryGlobs ?? []))) {
|
|
16
|
+
violations.push(`${prefix}${name} positive path filters differ from its primary group`);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return violations;
|
|
20
|
+
}
|
|
21
|
+
/** Validates the package registries against the tracked `package.json` manifests. */
|
|
22
|
+
export function checkRegistries(trackedFiles, files, names) {
|
|
23
|
+
const manifests = trackedFiles.filter(isManifestPath);
|
|
24
|
+
const { syncpackSource: sourceGlobs, workspacePackages } = files;
|
|
25
|
+
const primary = {};
|
|
26
|
+
const runtime = {};
|
|
27
|
+
for (const [name, globs] of Object.entries(files.pathFilters)) {
|
|
28
|
+
if (name.startsWith(names.runtimePrefix))
|
|
29
|
+
runtime[name.slice(names.runtimePrefix.length)] = globs;
|
|
30
|
+
else
|
|
31
|
+
primary[name] = globs;
|
|
32
|
+
}
|
|
33
|
+
const primaryEntries = Object.entries(primary).flatMap(([name, globs]) => name === names.toolingGroup ? globs.filter((glob) => glob !== names.triggerOnlyGlob) : globs);
|
|
34
|
+
const violations = [];
|
|
35
|
+
const record = (name, paths) => {
|
|
36
|
+
if (paths.length > 0)
|
|
37
|
+
violations.push(`${name}: ${paths.join(', ')}`);
|
|
38
|
+
};
|
|
39
|
+
const inWorkspace = (manifest) => workspacePackages.some((pattern) => picomatch.isMatch(manifest, manifestGlob(pattern)));
|
|
40
|
+
if (sourceGlobs.length === 0)
|
|
41
|
+
violations.push(`${names.syncpackConfig} source must not be empty`);
|
|
42
|
+
record(`tracked package manifests missing from ${names.syncpackConfig} source`, manifests.filter((manifest) => !matchesAny(manifest, sourceGlobs)));
|
|
43
|
+
const source = staleEntries(sourceGlobs, manifests);
|
|
44
|
+
record(`stale fixed ${names.syncpackConfig} source entries`, source.stale);
|
|
45
|
+
record(`unmatched wildcard ${names.syncpackConfig} source entries`, source.unmatched);
|
|
46
|
+
record('tracked package manifests missing from a real CI path-filter group', manifests.filter((manifest) => !matchesAny(manifest, primaryEntries)));
|
|
47
|
+
const ci = staleEntries(primaryEntries, manifests, isManifestPath);
|
|
48
|
+
record('stale fixed CI path-filter manifest entries', ci.stale);
|
|
49
|
+
record('unmatched wildcard CI path-filter manifest entries', ci.unmatched);
|
|
50
|
+
record(`unmatched ${names.workspaceFile} package globs`, workspacePackages.filter((pattern) => !manifests.some((manifest) => picomatch.isMatch(manifest, manifestGlob(pattern)))));
|
|
51
|
+
record(`negated ${names.workspaceFile} package globs need complete-set semantics`, workspacePackages.filter((pattern) => pattern.startsWith('!')));
|
|
52
|
+
record(`non-root tracked package manifests missing from ${names.workspaceFile}`, manifests.filter((manifest) => manifest !== 'package.json' && !inWorkspace(manifest)));
|
|
53
|
+
violations.push(...runtimeViolations(runtime, primary, names.runtimePrefix));
|
|
54
|
+
const toolingGlobs = primary[names.toolingGroup] ?? [];
|
|
55
|
+
record(`wildcard pnpm workspace globs unreachable from ${names.toolingGroup} CI`, workspacePackages.filter((pattern) => pattern.includes('*') && !matchesAny(manifestGlob(pattern), toolingGlobs)));
|
|
56
|
+
record(`tracked package manifests unreachable from ${names.toolingGroup} CI`, manifests.filter((manifest) => !matchesAny(manifest, toolingGlobs)));
|
|
57
|
+
return violations;
|
|
58
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StaleEntries {
|
|
2
|
+
stale: string[];
|
|
3
|
+
unmatched: string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Splits registry entries into fixed paths that no tracked manifest has and wildcard globs that
|
|
7
|
+
* match no tracked manifest. `applies` limits which entries are examined (default all).
|
|
8
|
+
*/
|
|
9
|
+
export declare function staleEntries(entries: readonly string[], manifests: readonly string[], applies?: (entry: string) => boolean): StaleEntries;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import picomatch from 'picomatch';
|
|
2
|
+
import { expandBraceAlternatives } from "./globs.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Splits registry entries into fixed paths that no tracked manifest has and wildcard globs that
|
|
5
|
+
* match no tracked manifest. `applies` limits which entries are examined (default all).
|
|
6
|
+
*/
|
|
7
|
+
export function staleEntries(entries, manifests, applies = () => true) {
|
|
8
|
+
const stale = [];
|
|
9
|
+
const unmatched = [];
|
|
10
|
+
for (const entry of entries) {
|
|
11
|
+
if (entry.includes('*')) {
|
|
12
|
+
if (applies(entry) && !manifests.some((manifest) => picomatch.isMatch(manifest, entry))) {
|
|
13
|
+
unmatched.push(entry);
|
|
14
|
+
}
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
for (const manifest of expandBraceAlternatives(entry)) {
|
|
18
|
+
if (applies(manifest) && !manifests.includes(manifest))
|
|
19
|
+
stale.push(manifest);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return { stale, unmatched };
|
|
23
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** `package.json` glob for a pnpm workspace package pattern. */
|
|
2
|
+
export declare function manifestGlob(workspacePattern: string): string;
|
|
3
|
+
export declare function isManifestPath(entry: string): boolean;
|
|
4
|
+
/** Members of a whole-glob brace set (`{a,b}`), or the glob itself. */
|
|
5
|
+
export declare function flattenBraceGlobs(globs: readonly string[]): Set<string>;
|
|
6
|
+
export declare function sameSet(left: Set<string>, right: Set<string>): boolean;
|
|
7
|
+
export declare function expandBraceAlternatives(pattern: string): string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** `package.json` glob for a pnpm workspace package pattern. */
|
|
2
|
+
export function manifestGlob(workspacePattern) {
|
|
3
|
+
return `${workspacePattern.replace(/\/$/, '')}/package.json`;
|
|
4
|
+
}
|
|
5
|
+
export function isManifestPath(entry) {
|
|
6
|
+
return entry === 'package.json' || entry.endsWith('/package.json');
|
|
7
|
+
}
|
|
8
|
+
/** Members of a whole-glob brace set (`{a,b}`), or the glob itself. */
|
|
9
|
+
export function flattenBraceGlobs(globs) {
|
|
10
|
+
const flattened = new Set();
|
|
11
|
+
for (const glob of globs) {
|
|
12
|
+
const match = /^\{(.*)\}$/.exec(glob);
|
|
13
|
+
const members = match === null ? [glob] : match[1].split(',');
|
|
14
|
+
for (const member of members)
|
|
15
|
+
flattened.add(member);
|
|
16
|
+
}
|
|
17
|
+
return flattened;
|
|
18
|
+
}
|
|
19
|
+
export function sameSet(left, right) {
|
|
20
|
+
return left.size === right.size && [...left].every((value) => right.has(value));
|
|
21
|
+
}
|
|
22
|
+
export function expandBraceAlternatives(pattern) {
|
|
23
|
+
const match = /\{([^{}]*)\}/.exec(pattern);
|
|
24
|
+
if (match === null)
|
|
25
|
+
return [pattern];
|
|
26
|
+
const [whole, alternatives] = match;
|
|
27
|
+
return alternatives
|
|
28
|
+
.split(',')
|
|
29
|
+
.flatMap((alternative) => expandBraceAlternatives(pattern.replace(whole, alternative)));
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface RegistryFiles {
|
|
2
|
+
/** `source` globs of the syncpack config. */
|
|
3
|
+
syncpackSource: string[];
|
|
4
|
+
/** `packages` globs of the pnpm workspace file. */
|
|
5
|
+
workspacePackages: string[];
|
|
6
|
+
/** Every group of the path-filter file, runtime groups included. */
|
|
7
|
+
pathFilters: Record<string, string[]>;
|
|
8
|
+
}
|
|
9
|
+
export interface RegistryFilePaths {
|
|
10
|
+
syncpackConfig: string;
|
|
11
|
+
workspaceFile: string;
|
|
12
|
+
pathFilters: string;
|
|
13
|
+
}
|
|
14
|
+
/** Reads the three registry files, each relative to `root`. */
|
|
15
|
+
export declare function loadRegistryFiles(root: string, paths: RegistryFilePaths): RegistryFiles;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
/** Reads the three registry files, each relative to `root`. */
|
|
5
|
+
export function loadRegistryFiles(root, paths) {
|
|
6
|
+
const syncpack = JSON.parse(readFileSync(join(root, paths.syncpackConfig), 'utf8'));
|
|
7
|
+
const workspace = parseYaml(readFileSync(join(root, paths.workspaceFile), 'utf8'));
|
|
8
|
+
const pathFilters = parseYaml(readFileSync(join(root, paths.pathFilters), 'utf8'));
|
|
9
|
+
return {
|
|
10
|
+
syncpackSource: syncpack.source ?? [],
|
|
11
|
+
workspacePackages: workspace?.packages ?? [],
|
|
12
|
+
pathFilters: pathFilters ?? {},
|
|
13
|
+
};
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vouchington-tooling",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.76.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": {
|
|
@@ -326,6 +326,11 @@
|
|
|
326
326
|
"import": "./dist/trivy-policy/index.mjs",
|
|
327
327
|
"default": "./dist/trivy-policy/index.mjs"
|
|
328
328
|
},
|
|
329
|
+
"./workspace-registry-check": {
|
|
330
|
+
"types": "./dist/workspace-registry-check/index.d.mts",
|
|
331
|
+
"import": "./dist/workspace-registry-check/index.mjs",
|
|
332
|
+
"default": "./dist/workspace-registry-check/index.mjs"
|
|
333
|
+
},
|
|
329
334
|
"./docker-image-mirror": {
|
|
330
335
|
"types": "./dist/docker-image-mirror/index.d.mts",
|
|
331
336
|
"import": "./dist/docker-image-mirror/index.mjs",
|
|
Binary file
|