@vibe-agent-toolkit/cli 0.1.41-rc.7 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/vat +24 -1
- package/dist/bin/vat.js +24 -1
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +23 -2
- package/dist/bin.js.map +1 -1
- package/dist/commands/agent/list.d.ts +11 -0
- package/dist/commands/agent/list.d.ts.map +1 -1
- package/dist/commands/agent/list.js +30 -11
- package/dist/commands/agent/list.js.map +1 -1
- package/dist/commands/audit/distributed-tree.d.ts +172 -0
- package/dist/commands/audit/distributed-tree.d.ts.map +1 -0
- package/dist/commands/audit/distributed-tree.js +319 -0
- package/dist/commands/audit/distributed-tree.js.map +1 -0
- package/dist/commands/audit.d.ts +69 -1
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +525 -174
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/build.d.ts +14 -0
- package/dist/commands/build.d.ts.map +1 -1
- package/dist/commands/build.js +103 -26
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/git-publish.js +21 -3
- package/dist/commands/claude/marketplace/git-publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts +125 -0
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +251 -44
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/stubs.d.ts +9 -1
- package/dist/commands/claude/org/stubs.d.ts.map +1 -1
- package/dist/commands/claude/org/stubs.js +11 -3
- package/dist/commands/claude/org/stubs.js.map +1 -1
- package/dist/commands/claude/plugin/build.d.ts +34 -4
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +187 -16
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-files.js +6 -2
- package/dist/commands/claude/plugin/plugin-files.js.map +1 -1
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-json-merge.js +15 -0
- package/dist/commands/claude/plugin/plugin-json-merge.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts +40 -0
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +100 -4
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +22 -4
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +1 -0
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +16 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +40 -22
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/inventory.d.ts +2 -0
- package/dist/commands/inventory.d.ts.map +1 -1
- package/dist/commands/inventory.js +45 -4
- package/dist/commands/inventory.js.map +1 -1
- package/dist/commands/phase-utils.d.ts +183 -14
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +294 -29
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/positional-args.d.ts +36 -0
- package/dist/commands/positional-args.d.ts.map +1 -0
- package/dist/commands/positional-args.js +52 -0
- package/dist/commands/positional-args.js.map +1 -0
- package/dist/commands/rag/query-command.d.ts +40 -0
- package/dist/commands/rag/query-command.d.ts.map +1 -1
- package/dist/commands/rag/query-command.js +47 -20
- package/dist/commands/rag/query-command.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +27 -9
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/scan.d.ts +37 -0
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +47 -32
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/commands/resources/validate.d.ts +136 -1
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +105 -66
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +5 -0
- package/dist/commands/skill/review-checklist.js.map +1 -1
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +7 -3
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/run.d.ts +1 -1
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +8 -6
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build.d.ts +349 -11
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +901 -97
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/command-helpers.d.ts +6 -10
- package/dist/commands/skills/command-helpers.d.ts.map +1 -1
- package/dist/commands/skills/command-helpers.js +6 -22
- package/dist/commands/skills/command-helpers.js.map +1 -1
- package/dist/commands/skills/list.d.ts +18 -0
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +41 -15
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/package.d.ts +15 -0
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +30 -20
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/scope-guard.d.ts +64 -0
- package/dist/commands/skills/scope-guard.d.ts.map +1 -0
- package/dist/commands/skills/scope-guard.js +86 -0
- package/dist/commands/skills/scope-guard.js.map +1 -0
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +41 -7
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +44 -3
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +217 -53
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/validate.d.ts +18 -0
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +89 -68
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +113 -6
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +440 -123
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/skill-resolution/index.d.ts +1 -1
- package/dist/skill-resolution/index.d.ts.map +1 -1
- package/dist/skill-resolution/index.js +1 -1
- package/dist/skill-resolution/index.js.map +1 -1
- package/dist/skill-resolution/packaging-config.d.ts +15 -2
- package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
- package/dist/skill-resolution/packaging-config.js +39 -2
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/utils/command-error.d.ts +34 -1
- package/dist/utils/command-error.d.ts.map +1 -1
- package/dist/utils/command-error.js +32 -1
- package/dist/utils/command-error.js.map +1 -1
- package/dist/utils/help-loader.d.ts +6 -2
- package/dist/utils/help-loader.d.ts.map +1 -1
- package/dist/utils/help-loader.js +9 -16
- package/dist/utils/help-loader.js.map +1 -1
- package/dist/utils/issue-rendering.d.ts +130 -0
- package/dist/utils/issue-rendering.d.ts.map +1 -1
- package/dist/utils/issue-rendering.js +147 -0
- package/dist/utils/issue-rendering.js.map +1 -1
- package/dist/utils/issue-severity.d.ts +51 -0
- package/dist/utils/issue-severity.d.ts.map +1 -0
- package/dist/utils/issue-severity.js +63 -0
- package/dist/utils/issue-severity.js.map +1 -0
- package/dist/utils/output.d.ts +54 -5
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +111 -17
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/relativize-paths.d.ts +45 -0
- package/dist/utils/relativize-paths.d.ts.map +1 -0
- package/dist/utils/relativize-paths.js +67 -0
- package/dist/utils/relativize-paths.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +21 -2
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +85 -11
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/skill-packaging-config.d.ts +22 -1
- package/dist/utils/skill-packaging-config.d.ts.map +1 -1
- package/dist/utils/skill-packaging-config.js +26 -0
- package/dist/utils/skill-packaging-config.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts +4 -3
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +6 -13
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/dist/version.d.ts +22 -2
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +31 -2
- package/dist/version.js.map +1 -1
- package/docs/index.md +12 -0
- package/docs/rag.md +9 -4
- package/docs/resources.md +30 -14
- package/docs/skills.md +25 -7
- package/package.json +12 -12
|
@@ -28,24 +28,48 @@ import { loadConfig } from '../utils/config-loader.js';
|
|
|
28
28
|
import { createLogger } from '../utils/logger.js';
|
|
29
29
|
import { writeYamlOutput } from '../utils/output.js';
|
|
30
30
|
import { requireProjectRoot } from '../utils/project-root-policy.js';
|
|
31
|
-
import { aggregatePhaseStatus, exitCodeForPhases, resolveBinPath, runPhase, } from './phase-utils.js';
|
|
31
|
+
import { addRetiredOnlyOption, aggregatePhaseIssueCounts, aggregatePhaseStatus, applyPhaseSelection, decidePhaseSelection, exitCodeForPhases, rejectRetiredOnly, resolveBinPath, runPhase, } from './phase-utils.js';
|
|
32
|
+
import { rejectPositionalArguments } from './positional-args.js';
|
|
32
33
|
/** Surfaces `vat validate` knows how to run, in stable execution order. */
|
|
33
34
|
const VALID_SURFACES = ['resources', 'skills'];
|
|
35
|
+
const VALIDATE_VOCABULARY = {
|
|
36
|
+
noun: 'Surface',
|
|
37
|
+
verb: 'validate',
|
|
38
|
+
validNames: VALID_SURFACES,
|
|
39
|
+
noop: {
|
|
40
|
+
// A bare run with nothing configured is a clean no-op (exit 0, per issue
|
|
41
|
+
// #128's "doesn't check what it doesn't know about") — but silent success
|
|
42
|
+
// on stdout alone is indistinguishable, to anyone watching only the exit
|
|
43
|
+
// code, from a run that actually validated something. Warn on stderr so a
|
|
44
|
+
// config typo (e.g. `recources:`) doesn't masquerade as "all good."
|
|
45
|
+
warning: 'No resources: or skills: block found in vibe-agent-toolkit.config.yaml — nothing to validate. If this is unexpected, check your config.',
|
|
46
|
+
note: 'No configured validators (no resources or skills block in vibe-agent-toolkit.config.yaml).',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Measured full-run duration on the 90-skill / 1,041-document adopter, cited by
|
|
51
|
+
* the retired-`--only` message: resources 13.9s + skills 19.3s.
|
|
52
|
+
*/
|
|
53
|
+
const VALIDATE_FULL_RUN_SECONDS = 35;
|
|
54
|
+
/** How this command names itself in every user-facing diagnostic. */
|
|
55
|
+
const COMMAND_NAME = 'vat validate';
|
|
34
56
|
export function createValidateTopLevelCommand() {
|
|
35
57
|
const command = new Command('validate');
|
|
36
|
-
command
|
|
58
|
+
addRetiredOnlyOption(command)
|
|
37
59
|
.description('Validate configured surfaces from source (resources + skills) — no build required')
|
|
38
|
-
.option('--only <surface>', 'Validate only a specific surface: resources, skills')
|
|
39
60
|
.option('--debug', 'Enable debug logging')
|
|
61
|
+
.option('-v, --verbose', 'Show every finding, not just the collapsed counts')
|
|
40
62
|
.action(validateTopLevelCommand)
|
|
41
63
|
.addHelpText('after', `
|
|
42
64
|
Description:
|
|
43
65
|
Runs the source-level validators (resources, skills) the project's config
|
|
44
66
|
declares — and only those. A surface whose config block is absent is skipped
|
|
45
67
|
(a project with no skills block does not run skill validation; no error, no
|
|
46
|
-
noise, but a stderr warning if nothing at all is configured).
|
|
47
|
-
|
|
48
|
-
|
|
68
|
+
noise, but a stderr warning if nothing at all is configured).
|
|
69
|
+
|
|
70
|
+
A run is a WHOLE run: '--only' was removed (a full run is ~35s, and the flag
|
|
71
|
+
let a renamed config key silently drop a CI gate's coverage). 'vat build'
|
|
72
|
+
keeps its '--only', where a phase costs minutes rather than seconds.
|
|
49
73
|
|
|
50
74
|
Source-level only. Unlike 'vat verify', this never inspects built dist
|
|
51
75
|
artifacts and never requires a build.
|
|
@@ -55,17 +79,28 @@ Description:
|
|
|
55
79
|
skills → SKILL.md frontmatter and packaging validation (when 'skills:' configured)
|
|
56
80
|
|
|
57
81
|
Output:
|
|
58
|
-
YAML
|
|
59
|
-
per surface: status (success | error | system-error) plus the
|
|
60
|
-
exitCode, signal, or spawn error — a surface that could not run is
|
|
61
|
-
reported as a surface that failed validation.
|
|
62
|
-
|
|
82
|
+
ONE YAML document → stdout
|
|
83
|
+
per surface: status (success | warning | error | system-error) plus the
|
|
84
|
+
child's exitCode, signal, or spawn error — a surface that could not run is
|
|
85
|
+
never reported as a surface that failed validation. The validator's own
|
|
86
|
+
report is captured and nested under 'report', so the whole run stays a
|
|
87
|
+
single parseable document ('vat validate | jq' works). A surface's status
|
|
88
|
+
comes from the validator's REPORTED status, not from its exit code — an
|
|
89
|
+
exit code cannot express 'warning'.
|
|
90
|
+
Progress and validation errors → stderr (streamed live)
|
|
63
91
|
|
|
64
92
|
Exit Codes:
|
|
65
93
|
0 - All configured validators passed (or nothing configured to validate)
|
|
66
|
-
1 - Validation errors found, or --only
|
|
94
|
+
1 - Validation errors found, or the retired '--only' flag was passed
|
|
67
95
|
2 - System error (this command's own, or propagated from a validator that
|
|
68
|
-
could not run: exited 2, was killed by a signal,
|
|
96
|
+
could not run: exited 2, was killed by a signal, was never spawned, or
|
|
97
|
+
wrote output that could not be parsed), or a usage error such as passing
|
|
98
|
+
a path
|
|
99
|
+
|
|
100
|
+
Arguments:
|
|
101
|
+
None. Scope comes from vibe-agent-toolkit.config.yaml, never from the command
|
|
102
|
+
line — a path argument is rejected (exit 2) rather than discarded. For a
|
|
103
|
+
path-scoped run use 'vat resources validate <path>' or 'vat audit <path>'.
|
|
69
104
|
|
|
70
105
|
Requirements:
|
|
71
106
|
projectRoot: required (errors if no vibe-agent-toolkit.config.yaml or .git/ ancestor)
|
|
@@ -75,76 +110,54 @@ Requirements:
|
|
|
75
110
|
|
|
76
111
|
Example:
|
|
77
112
|
$ vat validate # Validate every configured surface
|
|
78
|
-
$ vat validate --only skills # Validate skills only
|
|
79
113
|
`);
|
|
80
114
|
return command;
|
|
81
115
|
}
|
|
82
116
|
/**
|
|
83
|
-
*
|
|
117
|
+
* Decide which validation surfaces to run.
|
|
118
|
+
*
|
|
84
119
|
* A surface is included only when its config block is present, so coverage is
|
|
85
|
-
* discovered rather than hand-composed
|
|
86
|
-
*
|
|
87
|
-
*
|
|
120
|
+
* discovered rather than hand-composed — and with `--only` retired, config
|
|
121
|
+
* presence is now the ONLY input. There is no longer a way for a caller to
|
|
122
|
+
* narrow the run, so there is no longer a way for a CI gate to ask for coverage
|
|
123
|
+
* it cannot get; the class of silent-coverage-loss bug the `--only` failure arms
|
|
124
|
+
* existed to catch is now unreachable by construction rather than guarded.
|
|
125
|
+
*
|
|
126
|
+
* `only` is still passed to {@link decidePhaseSelection} as `undefined`: that
|
|
127
|
+
* helper is shared with `vat build`, which keeps its own `--only`.
|
|
88
128
|
*/
|
|
89
|
-
function
|
|
90
|
-
|
|
129
|
+
export function selectValidateSurfaces(config, verbose = false) {
|
|
130
|
+
// Forwarded to every surface, exactly as `vat verify` forwards its own. Both
|
|
131
|
+
// child validators already accept `-v, --verbose`; only this command lacked
|
|
132
|
+
// the flag, which made the collapsed warning/info detail unreachable HERE
|
|
133
|
+
// while the same findings were one `vat skills validate` away.
|
|
134
|
+
const detail = verbose ? ['--verbose'] : [];
|
|
91
135
|
const phases = [];
|
|
92
|
-
if (
|
|
93
|
-
phases.push({ name: 'resources', args: ['resources', 'validate'] });
|
|
136
|
+
if (config?.resources) {
|
|
137
|
+
phases.push({ name: 'resources', args: ['resources', 'validate', ...detail] });
|
|
94
138
|
}
|
|
95
|
-
if (
|
|
96
|
-
phases.push({ name: 'skills', args: ['skills', 'validate'] });
|
|
139
|
+
if (config?.skills) {
|
|
140
|
+
phases.push({ name: 'skills', args: ['skills', 'validate', ...detail] });
|
|
97
141
|
}
|
|
98
|
-
return phases;
|
|
142
|
+
return decidePhaseSelection(undefined, phases, VALIDATE_VOCABULARY);
|
|
99
143
|
}
|
|
100
|
-
async function validateTopLevelCommand(options) {
|
|
144
|
+
async function validateTopLevelCommand(options, command) {
|
|
145
|
+
// First, and before requireProjectRoot: `vat validate docs/` used to be
|
|
146
|
+
// accepted, have its path discarded, run wide over every configured surface
|
|
147
|
+
// and report success. Nothing below can un-tell that lie, so the run ends
|
|
148
|
+
// here. (`vat resources validate <path>` is the path-taking form.)
|
|
149
|
+
rejectPositionalArguments(command.args, COMMAND_NAME, 'validates every source surface vibe-agent-toolkit.config.yaml declares');
|
|
150
|
+
// Before requireProjectRoot: a retired flag is a usage error, and answering it
|
|
151
|
+
// with "no vibe-agent-toolkit.config.yaml found" would diagnose the wrong
|
|
152
|
+
// problem for anyone running the old invocation outside a project.
|
|
153
|
+
rejectRetiredOnly(options.only, COMMAND_NAME, VALIDATE_FULL_RUN_SECONDS);
|
|
101
154
|
// requireProjectRoot returns the discovered root; read config from there so a
|
|
102
155
|
// subdirectory invocation doesn't load an empty config and falsely pass.
|
|
103
|
-
const projectRoot = requireProjectRoot(process.cwd(),
|
|
156
|
+
const projectRoot = requireProjectRoot(process.cwd(), COMMAND_NAME);
|
|
104
157
|
const logger = createLogger(options.debug ? { debug: true } : {});
|
|
105
158
|
const startTime = Date.now();
|
|
106
|
-
// `--only` failures — an unrecognized surface name, or a recognized name
|
|
107
|
-
// that just isn't configured — are both "you asked for a surface that
|
|
108
|
-
// can't run." Both must exit 1 (not fall through to the generic exit-2
|
|
109
|
-
// system-error path), so a CI gate differentiating "validation failed"
|
|
110
|
-
// from "system error" doesn't miss one of the two.
|
|
111
|
-
const failOnly = (message) => {
|
|
112
|
-
logger.error(message);
|
|
113
|
-
writeYamlOutput({
|
|
114
|
-
status: 'error',
|
|
115
|
-
phases: [],
|
|
116
|
-
error: message,
|
|
117
|
-
duration: `${Date.now() - startTime}ms`,
|
|
118
|
-
});
|
|
119
|
-
return process.exit(1);
|
|
120
|
-
};
|
|
121
159
|
try {
|
|
122
|
-
|
|
123
|
-
failOnly(`Unknown surface: ${options.only}. Valid surfaces: ${VALID_SURFACES.join(', ')}`);
|
|
124
|
-
}
|
|
125
|
-
const phases = buildPhaseList(options.only, projectRoot);
|
|
126
|
-
if (phases.length === 0) {
|
|
127
|
-
// An explicit `--only <surface>` that isn't configured is a failure: the
|
|
128
|
-
// caller asked for a specific validator that can't run, so a CI gate must
|
|
129
|
-
// not stay green.
|
|
130
|
-
if (options.only) {
|
|
131
|
-
failOnly(`Surface '${options.only}' is not configured in vibe-agent-toolkit.config.yaml — nothing to validate.`);
|
|
132
|
-
}
|
|
133
|
-
// A bare run with nothing configured is a clean no-op (exit 0, per
|
|
134
|
-
// issue #128's "doesn't check what it doesn't know about") — but silent
|
|
135
|
-
// success on stdout alone is indistinguishable, to anyone watching only
|
|
136
|
-
// the exit code, from a run that actually validated something. Warn on
|
|
137
|
-
// stderr so a config typo (e.g. `recources:`) doesn't masquerade as
|
|
138
|
-
// "all good."
|
|
139
|
-
logger.warn('No resources: or skills: block found in vibe-agent-toolkit.config.yaml — nothing to validate. If this is unexpected, check your config.');
|
|
140
|
-
writeYamlOutput({
|
|
141
|
-
status: 'success',
|
|
142
|
-
phases: [],
|
|
143
|
-
note: 'No configured validators (no resources or skills block in vibe-agent-toolkit.config.yaml).',
|
|
144
|
-
duration: `${Date.now() - startTime}ms`,
|
|
145
|
-
});
|
|
146
|
-
process.exit(0);
|
|
147
|
-
}
|
|
160
|
+
const phases = applyPhaseSelection(selectValidateSurfaces(loadConfig(projectRoot), options.verbose === true), logger, startTime);
|
|
148
161
|
logger.info(`✅ vat validate (surfaces: ${phases.map((p) => p.name).join(' → ')})`);
|
|
149
162
|
const binPath = resolveBinPath();
|
|
150
163
|
const phaseResults = [];
|
|
@@ -155,8 +168,16 @@ async function validateTopLevelCommand(options) {
|
|
|
155
168
|
// A surface whose validator could not RUN (exit 2, killed, never spawned)
|
|
156
169
|
// is not a surface that failed validation: it exits 2, so a CI gate can
|
|
157
170
|
// tell a broken config from a broken link.
|
|
171
|
+
// `issueCounts` beside `status` because a status alone cannot express a
|
|
172
|
+
// three-valued distribution, and this document published none at all: a
|
|
173
|
+
// consumer that wanted "did anything need acting on" had to either trust a
|
|
174
|
+
// bare `status` or hand-sum the phases. `status: warning` on a warnings-only
|
|
175
|
+
// repo is correct and deliberate — `success` means "nothing to act on", not
|
|
176
|
+
// "nothing to see" — so gate on `issueCounts.errors` or the exit code, both
|
|
177
|
+
// of which stay 0 through any number of warnings.
|
|
158
178
|
writeYamlOutput({
|
|
159
179
|
status: aggregatePhaseStatus(phaseResults),
|
|
180
|
+
issueCounts: aggregatePhaseIssueCounts(phaseResults),
|
|
160
181
|
phases: phaseResults,
|
|
161
182
|
duration: `${Date.now() - startTime}ms`,
|
|
162
183
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OA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CAAC;AACH,CAAC"}
|
|
@@ -5,11 +5,24 @@
|
|
|
5
5
|
* 1. vat resources validate (link integrity, collection schemas)
|
|
6
6
|
* 2. vat skills validate (SKILL.md frontmatter validation)
|
|
7
7
|
* 3. vat claude marketplace validate (strict marketplace validation, when configured)
|
|
8
|
-
* 4.
|
|
8
|
+
* 4. files-config-dests (in-process; every `files:` dest exists in the built output)
|
|
9
|
+
* 5. packaged-content (in-process; built bundles carry nothing that must not ship)
|
|
10
|
+
* 6. consistency check (in-process; skill distribution integrity — package.json, plugin assignment)
|
|
11
|
+
*
|
|
12
|
+
* 1–3 are subprocess phases chosen by {@link selectVerifyPhases}; 4–6 run here and
|
|
13
|
+
* are chosen by `selectInProcessVerifyPhases`. Both sets are config-gated, and both
|
|
14
|
+
* are announced on startup.
|
|
9
15
|
*/
|
|
16
|
+
import { type ValidationIssue } from '@vibe-agent-toolkit/agent-schema';
|
|
17
|
+
import type { ProjectConfig } from '@vibe-agent-toolkit/resources';
|
|
10
18
|
import { Command } from 'commander';
|
|
19
|
+
import { type ConsistencyIssueSeverity } from './consistency-check.js';
|
|
20
|
+
import { type PhaseSelection } from './phase-utils.js';
|
|
21
|
+
import type { DiscoveredSkill } from './skills/command-helpers.js';
|
|
11
22
|
export interface VerifyCommandOptions {
|
|
23
|
+
/** Retired; declared only so {@link rejectRetiredOnly} can explain the removal. */
|
|
12
24
|
only?: string;
|
|
25
|
+
verbose?: boolean;
|
|
13
26
|
debug?: boolean;
|
|
14
27
|
}
|
|
15
28
|
export declare function createVerifyTopLevelCommand(): Command;
|
|
@@ -23,14 +36,108 @@ export interface FilesDestCheckResult {
|
|
|
23
36
|
/**
|
|
24
37
|
* Check that all dest paths from the merged files config exist in the built output.
|
|
25
38
|
*
|
|
26
|
-
* Checks each skill's dests in the location(s) where `vat build` actually wrote them:
|
|
27
|
-
* - Pool skills: `dist/skills/<fsName>/` (only when that dir exists)
|
|
28
|
-
* - Tree-copy skills: `dist/.claude/plugins/.../skills/<name>/` (only when that dir exists)
|
|
29
|
-
*
|
|
30
39
|
* A dest is "missing" ONLY when absent from a candidate dir that exists. If a skill
|
|
31
40
|
* has no existing candidate dir, it is not reported (build didn't run for that mode).
|
|
32
41
|
*
|
|
42
|
+
* @param discovered - The skills this run discovered from `skills.include`. See
|
|
43
|
+
* {@link collectBuiltSkillOutputs} for why it is required rather than optional.
|
|
33
44
|
* @returns One result per (skill, outputDir) pair where dests are absent.
|
|
34
45
|
*/
|
|
35
|
-
export declare function checkFilesConfigDests(cwd: string): FilesDestCheckResult[];
|
|
46
|
+
export declare function checkFilesConfigDests(cwd: string, discovered: readonly DiscoveredSkill[]): FilesDestCheckResult[];
|
|
47
|
+
/**
|
|
48
|
+
* Crawl every built skill bundle for repo-internal agent-instruction files.
|
|
49
|
+
*
|
|
50
|
+
* The built-skill-bundle arm of `PACKAGED_AGENT_INSTRUCTION_FILE`. Its description
|
|
51
|
+
* has always claimed three surfaces — a built skill bundle, an installed plugin, a
|
|
52
|
+
* plugin source directory — but only the two plugin arms had a producer: the skill
|
|
53
|
+
* lanes inspect SKILL.md plus what links reach from it, so a file that arrives in a
|
|
54
|
+
* bundle with no link at all was invisible to every command. Measured on an adopter
|
|
55
|
+
* bundle carrying two of them: `vat audit` reported `filesScanned: 1`, zero issues,
|
|
56
|
+
* and `vat verify` reported `warnings: 0`.
|
|
57
|
+
*
|
|
58
|
+
* UNCONDITIONAL here, with no provenance test: `vat verify` reads the built `dist/`
|
|
59
|
+
* tree by definition, so every tree this enumerates is distributed output. (`vat
|
|
60
|
+
* audit` takes an arbitrary path and therefore must answer the provenance question
|
|
61
|
+
* first — see `appendDistributedTreeFindings` in audit.ts.)
|
|
62
|
+
*
|
|
63
|
+
* Explicit `files:` dests are exempt (§8.2): here the config is knowable, and
|
|
64
|
+
* naming a dest is an instruction to ship that file. A glob match never earns the
|
|
65
|
+
* exemption — a glob is a net, not a declaration — which is why the exempt set
|
|
66
|
+
* comes from {@link explicitFilesConfigDests} rather than from every `files:` entry.
|
|
67
|
+
*
|
|
68
|
+
* Each bundle's findings are then resolved against that skill's effective
|
|
69
|
+
* `validation.severity` (see {@link resolveIssueSeverity}), so the opt-out the
|
|
70
|
+
* code's own `fix` text prescribes actually works here. It did not: this phase
|
|
71
|
+
* published `detectPackagedAgentInstructionFiles`' raw output straight into the
|
|
72
|
+
* document, so `severity.PACKAGED_AGENT_INSTRUCTION_FILE: ignore` changed nothing
|
|
73
|
+
* — measured `warnings: 1` with the override at `skills.defaults`, at
|
|
74
|
+
* `skills.config.<name>`, and with no override at all.
|
|
75
|
+
*
|
|
76
|
+
* `validation.allow` is deliberately NOT applied. Allow is a per-PATH suppression
|
|
77
|
+
* whose usage is only answerable across a whole run, and this phase would have to
|
|
78
|
+
* drain a ledger it is not the run of — reporting ALLOW_UNUSED for every entry the
|
|
79
|
+
* project declares for other lanes. Severity is answerable per unit of work; allow
|
|
80
|
+
* is not. See `AllowUsageLedger` in `@vibe-agent-toolkit/agent-schema`.
|
|
81
|
+
*
|
|
82
|
+
* Locations anchor at `cwd`, the run's stated root, so a reader can open them.
|
|
83
|
+
*
|
|
84
|
+
* @param discovered - The skills this run discovered from `skills.include`. See
|
|
85
|
+
* {@link collectBuiltSkillOutputs} for why it is required rather than optional.
|
|
86
|
+
*/
|
|
87
|
+
export declare function checkPackagedAgentInstructionFiles(cwd: string, discovered: readonly DiscoveredSkill[]): ValidationIssue[];
|
|
88
|
+
/**
|
|
89
|
+
* Decide which verification phases to run.
|
|
90
|
+
*
|
|
91
|
+
* Config-gated, exactly as `vat validate` is. It used to push `resources` and
|
|
92
|
+
* `skills` unconditionally, so `vat verify --only skills` in a project with no
|
|
93
|
+
* `skills:` block exited 0 while `vat validate --only skills` on the same
|
|
94
|
+
* project exited 1 — same question, opposite verdicts, and a CI gate pinned to
|
|
95
|
+
* the verify form stayed green forever the moment the config key was renamed.
|
|
96
|
+
*
|
|
97
|
+
* `--only` is gone from this command entirely. Measured on a 90-skill project a
|
|
98
|
+
* full `vat verify` is ~32s, of which the two slowest phases are ~28s — the
|
|
99
|
+
* filter bought at most ~18s and repeatedly bought a wrong answer with it. Every
|
|
100
|
+
* run is now a whole run, and `only` is passed to {@link decidePhaseSelection}
|
|
101
|
+
* as `undefined` (that helper still routes `--only` for `vat validate` and
|
|
102
|
+
* `vat build`).
|
|
103
|
+
*
|
|
104
|
+
* @param configError - The config-load failure, when the config could not be
|
|
105
|
+
* read. Every subprocess phase still runs so the CHILD reports the real
|
|
106
|
+
* config error (exit 2) instead of this command guessing.
|
|
107
|
+
* @param verbose - Forwarded to each subprocess phase as `--verbose`. The
|
|
108
|
+
* children own their own summarization; this command only relays the request.
|
|
109
|
+
*/
|
|
110
|
+
export declare function selectVerifyPhases(config: ProjectConfig | undefined, configError?: string, verbose?: boolean): PhaseSelection;
|
|
111
|
+
/**
|
|
112
|
+
* The startup announcement: every phase this run will inspect something with,
|
|
113
|
+
* in order. A phase that would consult nothing is not named.
|
|
114
|
+
*/
|
|
115
|
+
export declare function formatVerifyAnnouncement(subprocessPhaseNames: readonly string[], config: ProjectConfig | undefined): string;
|
|
116
|
+
/** An in-process phase's finding as it appears in the archived YAML. */
|
|
117
|
+
interface PublishedIssue {
|
|
118
|
+
severity: ValidationIssue['severity'] | ConsistencyIssueSeverity;
|
|
119
|
+
code: string;
|
|
120
|
+
message: string;
|
|
121
|
+
fix: string;
|
|
122
|
+
/** Project-relative path of the file to open. Absent when the finding has none. */
|
|
123
|
+
location?: string;
|
|
124
|
+
/** 1-based line within {@link PublishedIssue.location}. */
|
|
125
|
+
line?: number;
|
|
126
|
+
/** Doc link the code's registry entry carries. */
|
|
127
|
+
reference?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Project ONE finding into the archived YAML.
|
|
131
|
+
*
|
|
132
|
+
* The whole anchor rides along. This shape used to be `{severity, code, message,
|
|
133
|
+
* fix}` and the projection destructured exactly those four, so every
|
|
134
|
+
* `packaged-content` finding reached the document with no `location` — the same
|
|
135
|
+
* defect this PR fixed one command over in `vat skills build`, where a published
|
|
136
|
+
* count carried "no `code`, no location and no fix string at ANY verbosity". It
|
|
137
|
+
* looked survivable only because `materializeIssue` happens to interpolate the
|
|
138
|
+
* detail into `message` for this one code; that is a coincidence, not a contract,
|
|
139
|
+
* and stderr is not the document a CI consumer parses.
|
|
140
|
+
*/
|
|
141
|
+
export declare function toPublishedIssue(issue: ValidationIssue): PublishedIssue;
|
|
142
|
+
export {};
|
|
36
143
|
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAO1C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAWL,KAAK,cAAc,EAEpB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAGnE,MAAM,WAAW,oBAAoB;IACnC,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAYD,wBAAgB,2BAA2B,IAAI,OAAO,CAqFrD;AAED,iFAAiF;AACjF,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAyID;;;;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