@vibe-agent-toolkit/cli 0.1.41-rc.6 → 0.1.41-rc.8
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 +4 -3
- package/dist/bin/vat +25 -2
- package/dist/bin/vat.js +25 -2
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +12 -1
- 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/hierarchical-output.d.ts +6 -2
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -1
- package/dist/commands/audit/hierarchical-output.js +93 -50
- package/dist/commands/audit/hierarchical-output.js.map +1 -1
- package/dist/commands/audit-settings.d.ts +35 -0
- package/dist/commands/audit-settings.d.ts.map +1 -1
- package/dist/commands/audit-settings.js +121 -51
- package/dist/commands/audit-settings.js.map +1 -1
- package/dist/commands/audit.d.ts +97 -2
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +505 -231
- 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 +126 -32
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.d.ts +39 -2
- package/dist/commands/claude/marketplace/license-utils.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/license-utils.js +114 -68
- package/dist/commands/claude/marketplace/license-utils.js.map +1 -1
- package/dist/commands/claude/marketplace/publish.js +5 -4
- package/dist/commands/claude/marketplace/publish.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts +97 -0
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +157 -49
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +11 -3
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +70 -20
- package/dist/commands/claude/org/skills.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 +116 -0
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +173 -40
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/marketplace-json.d.ts +36 -0
- package/dist/commands/claude/plugin/marketplace-json.d.ts.map +1 -0
- package/dist/commands/claude/plugin/marketplace-json.js +34 -0
- package/dist/commands/claude/plugin/marketplace-json.js.map +1 -0
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts +30 -1
- package/dist/commands/claude/plugin/plugin-json-merge.d.ts.map +1 -1
- package/dist/commands/claude/plugin/plugin-json-merge.js +107 -14
- package/dist/commands/claude/plugin/plugin-json-merge.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +0 -1
- 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 +55 -48
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/doctor.d.ts +57 -8
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +142 -67
- 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 +240 -11
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +352 -15
- package/dist/commands/phase-utils.js.map +1 -1
- 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 +38 -13
- 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 +121 -68
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +40 -23
- 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 +140 -0
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +348 -94
- 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 +17 -0
- package/dist/commands/skills/package.d.ts.map +1 -1
- package/dist/commands/skills/package.js +72 -43
- package/dist/commands/skills/package.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +9 -1
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +22 -6
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +79 -0
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +268 -79
- 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 +79 -66
- package/dist/commands/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +38 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +247 -84
- 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/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +0 -2
- package/dist/utils/config-loader.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-anchor.d.ts +26 -0
- package/dist/utils/issue-anchor.d.ts.map +1 -0
- package/dist/utils/issue-anchor.js +39 -0
- package/dist/utils/issue-anchor.js.map +1 -0
- package/dist/utils/issue-rendering.d.ts +149 -0
- package/dist/utils/issue-rendering.d.ts.map +1 -0
- package/dist/utils/issue-rendering.js +229 -0
- package/dist/utils/issue-rendering.js.map +1 -0
- package/dist/utils/output.d.ts +80 -9
- package/dist/utils/output.d.ts.map +1 -1
- package/dist/utils/output.js +138 -23
- package/dist/utils/output.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +2 -2
- package/dist/utils/project-root-policy.js +2 -2
- 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/validate-help-files.d.ts +3 -2
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +48 -5
- package/dist/utils/validate-help-files.js.map +1 -1
- package/dist/utils/verdict-helpers.d.ts +14 -5
- package/dist/utils/verdict-helpers.d.ts.map +1 -1
- package/dist/utils/verdict-helpers.js +19 -16
- package/dist/utils/verdict-helpers.js.map +1 -1
- package/docs/audit.md +40 -14
- package/docs/doctor.md +46 -10
- package/docs/index.md +1 -1
- package/docs/rag.md +9 -4
- package/docs/resources.md +54 -22
- package/docs/skills.md +11 -7
- package/package.json +12 -12
|
@@ -1,14 +1,98 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared utilities for top-level phase orchestration commands (vat build, vat verify).
|
|
2
|
+
* Shared utilities for top-level phase orchestration commands (vat build, vat verify, vat validate).
|
|
3
3
|
*/
|
|
4
|
+
import { type SeverityCounts } from '@vibe-agent-toolkit/agent-schema';
|
|
5
|
+
import { type Command } from 'commander';
|
|
4
6
|
import { createLogger } from '../utils/logger.js';
|
|
5
7
|
export interface Phase {
|
|
6
8
|
name: string;
|
|
7
9
|
args: string[];
|
|
8
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Declare `--only` on a command that has RETIRED it, solely so the command can
|
|
13
|
+
* explain itself instead of emitting Commander's bare `error: unknown option
|
|
14
|
+
* '--only'`.
|
|
15
|
+
*
|
|
16
|
+
* This is **not** a backward-compatibility shim — the pre-1.0 policy forbids
|
|
17
|
+
* those and this obeys it. The flag does not work: {@link rejectRetiredOnly}
|
|
18
|
+
* fails the run before any phase is selected, so no caller can keep depending
|
|
19
|
+
* on the old behaviour. What it buys is a diagnosis. An unknown-option error
|
|
20
|
+
* names the flag and nothing else; the reader cannot tell a typo from a removal
|
|
21
|
+
* and has no way to learn what replaced it, so the next move is a bug report or
|
|
22
|
+
* a version pin. Naming the removal, the measurement behind it, and the command
|
|
23
|
+
* where `--only` still exists turns a dead end into a one-line fix.
|
|
24
|
+
*
|
|
25
|
+
* Hidden from `--help` on purpose: a retired flag is not a feature to discover,
|
|
26
|
+
* and listing it would suggest it still selects something.
|
|
27
|
+
*/
|
|
28
|
+
export declare function addRetiredOnlyOption(command: Command): Command;
|
|
29
|
+
/**
|
|
30
|
+
* Fail the run when a caller passed the retired `--only`, naming what changed.
|
|
31
|
+
*
|
|
32
|
+
* Exit 1, matching both Commander's usage-error convention and the exit code an
|
|
33
|
+
* unroutable `--only` already produced on these commands, so a CI gate that was
|
|
34
|
+
* failing on a bad `--only` keeps failing rather than flipping to green.
|
|
35
|
+
*
|
|
36
|
+
* @param only - The parsed `--only` value; `undefined` when it was not passed.
|
|
37
|
+
* @param command - Command name for the message, e.g. `vat validate`.
|
|
38
|
+
* @param seconds - The measured full-run duration that made the flag not worth
|
|
39
|
+
* its coverage risk. Cited so the removal reads as a decision with evidence
|
|
40
|
+
* rather than a preference.
|
|
41
|
+
*/
|
|
42
|
+
export declare function rejectRetiredOnly(only: string | undefined, command: string, seconds: number): void;
|
|
43
|
+
/**
|
|
44
|
+
* Outcome of one orchestrated phase.
|
|
45
|
+
*
|
|
46
|
+
* `system-error` is a value of its own because **a phase that could not RUN is
|
|
47
|
+
* not a phase that found problems.** Collapsing it into `error` (which is what
|
|
48
|
+
* `result.status === 0 ? 'passed' : 'failed'` did) made the documented exit
|
|
49
|
+
* code 2 unreachable from every orchestrator, so a CI script could not tell an
|
|
50
|
+
* invalid config or a killed child from a broken link.
|
|
51
|
+
*
|
|
52
|
+
* `warning` reaches a subprocess phase through the child's own reported
|
|
53
|
+
* `status`, NOT through its exit code — `vat skills validate` exits 0 while
|
|
54
|
+
* reporting `status: warning`, so an exit-code-only mapping answered `success`
|
|
55
|
+
* on the very tree where the child said otherwise. In-process phases (e.g.
|
|
56
|
+
* verify's consistency check) emit it directly.
|
|
57
|
+
*/
|
|
58
|
+
export type PhaseStatus = 'success' | 'warning' | 'error' | 'system-error';
|
|
59
|
+
/** The phase outcome for "we did not learn what this phase would have said". */
|
|
60
|
+
export declare const SYSTEM_ERROR: PhaseStatus;
|
|
9
61
|
export interface PhaseResult {
|
|
10
62
|
name: string;
|
|
11
|
-
status:
|
|
63
|
+
status: PhaseStatus;
|
|
64
|
+
/** Child exit code, when the child ran and exited on its own. */
|
|
65
|
+
exitCode?: number;
|
|
66
|
+
/** POSIX signal that killed the child, when one did (then `exitCode` is absent). */
|
|
67
|
+
signal?: string;
|
|
68
|
+
/** Why the phase could not run at all (the spawn itself failed). */
|
|
69
|
+
error?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Per-severity distribution for in-process phases that hold their own
|
|
72
|
+
* findings. Absent for subprocess phases: the child owns its own findings,
|
|
73
|
+
* and inventing counts here would be a second, weaker answer — the child's
|
|
74
|
+
* are carried verbatim in {@link PhaseResult.report} instead.
|
|
75
|
+
*/
|
|
76
|
+
issueCounts?: SeverityCounts;
|
|
77
|
+
/**
|
|
78
|
+
* The child's own YAML document, parsed and folded in.
|
|
79
|
+
*
|
|
80
|
+
* The child used to write this straight onto the parent's stdout (`stdio:
|
|
81
|
+
* 'inherit'`), which concatenated N documents with no `---` between them: two
|
|
82
|
+
* phases produced one map carrying `status:` and `durationSecs:` twice, and
|
|
83
|
+
* `YAML.parse()` threw "Map keys must be unique". Nesting each child's
|
|
84
|
+
* document under its own phase makes the parent's stdout one parseable
|
|
85
|
+
* document again and loses nothing.
|
|
86
|
+
*/
|
|
87
|
+
report?: unknown;
|
|
88
|
+
}
|
|
89
|
+
/** The subset of a `spawnSync` return that decides a phase's outcome. */
|
|
90
|
+
export interface PhaseSpawnOutcome {
|
|
91
|
+
status: number | null;
|
|
92
|
+
signal: NodeJS.Signals | null;
|
|
93
|
+
error?: Error | undefined;
|
|
94
|
+
/** The child's captured stdout, when it was piped rather than inherited. */
|
|
95
|
+
stdout?: string | null | undefined;
|
|
12
96
|
}
|
|
13
97
|
/**
|
|
14
98
|
* Resolve the absolute path to the vat binary.
|
|
@@ -21,19 +105,164 @@ export interface PhaseContext {
|
|
|
21
105
|
binPath: string;
|
|
22
106
|
}
|
|
23
107
|
/**
|
|
24
|
-
* Create the shared phase command context: logger, startTime, and
|
|
25
|
-
*
|
|
108
|
+
* Create the shared phase command context: logger, startTime, and bin path.
|
|
109
|
+
*
|
|
110
|
+
* It used to THROW when the phase list came out empty — and it was called
|
|
111
|
+
* before the command's try block, so an unroutable `--only` reached the user as
|
|
112
|
+
* a raw Node stack trace with zero bytes of stdout and an exit 1 that looked
|
|
113
|
+
* like "validation errors". `--only` routing is decided by
|
|
114
|
+
* {@link decidePhaseSelection} and reported by {@link applyPhaseSelection} now,
|
|
115
|
+
* which emit the command's normal structured document.
|
|
116
|
+
*/
|
|
117
|
+
export declare function createPhaseContext(debugFlag: boolean | undefined): PhaseContext;
|
|
118
|
+
/**
|
|
119
|
+
* The decision an orchestrator reaches about what `--only` asked for.
|
|
120
|
+
*
|
|
121
|
+
* Three arms, because the three answers carry different exit codes and none of
|
|
122
|
+
* them may be collapsed into another:
|
|
123
|
+
* - `run` — go ahead with these phases.
|
|
124
|
+
* - `fail` — the caller named a phase that is unrecognized, or recognized but
|
|
125
|
+
* not configured. Exit 1: a CI gate asked for coverage that cannot
|
|
126
|
+
* run and must not stay green.
|
|
127
|
+
* - `noop` — a bare run in a project that configures nothing. Exit 0, but
|
|
128
|
+
* WARNED, so a config typo is not indistinguishable from success.
|
|
129
|
+
*/
|
|
130
|
+
export type PhaseSelection = {
|
|
131
|
+
kind: 'run';
|
|
132
|
+
phases: Phase[];
|
|
133
|
+
} | {
|
|
134
|
+
kind: 'fail';
|
|
135
|
+
message: string;
|
|
136
|
+
} | {
|
|
137
|
+
kind: 'noop';
|
|
138
|
+
warning: string;
|
|
139
|
+
note: string;
|
|
140
|
+
};
|
|
141
|
+
/** How one orchestrator names the things `--only` selects, for its messages. */
|
|
142
|
+
export interface PhaseVocabulary {
|
|
143
|
+
/** Capitalized singular: 'Phase' (build, verify) or 'Surface' (validate). */
|
|
144
|
+
noun: 'Phase' | 'Surface';
|
|
145
|
+
/** The verb in "nothing to <verb>": 'build', 'verify', 'validate'. */
|
|
146
|
+
verb: string;
|
|
147
|
+
/** Every name `--only` accepts, in help order. */
|
|
148
|
+
validNames: readonly string[];
|
|
149
|
+
/** Stderr warning + stdout note for a bare run with nothing configured. */
|
|
150
|
+
noop?: {
|
|
151
|
+
warning: string;
|
|
152
|
+
note: string;
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Decide what an orchestrator should do with its `--only` value and the phase
|
|
157
|
+
* list its config produced.
|
|
158
|
+
*
|
|
159
|
+
* Shared by all three orchestrators because they used to disagree: `vat verify`
|
|
160
|
+
* built its phase list without consulting the config at all, so `vat verify
|
|
161
|
+
* --only skills` in a project with no `skills:` block exited 0 while `vat
|
|
162
|
+
* validate --only skills` on the same project exited 1 — opposite verdicts on
|
|
163
|
+
* the same question. (`vat verify` has since retired `--only` entirely and now
|
|
164
|
+
* always passes `only: undefined`; `vat validate` and `vat build` still route
|
|
165
|
+
* their own `--only` through here.)
|
|
166
|
+
*
|
|
167
|
+
* There used to be a third option, `emptyIsValid`, which existed solely so
|
|
168
|
+
* `vat verify --only consistency` could run with an empty SUBPROCESS list
|
|
169
|
+
* (consistency runs in-process). It was checked BEFORE `unreadableConfig`, so
|
|
170
|
+
* `vat verify --only consistency` against an unparseable config answered the
|
|
171
|
+
* confidently-wrong "no skills: block" instead of reporting the config error.
|
|
172
|
+
* `--only` is gone from verify, `emptyIsValid` went with it, and that ordering
|
|
173
|
+
* hazard cannot recur: nothing short-circuits ahead of the config-error arm.
|
|
174
|
+
*
|
|
175
|
+
* @param unreadableConfig - The config-load error, when the config exists but
|
|
176
|
+
* could not be parsed. A broken config is NOT "the phase is unconfigured":
|
|
177
|
+
* we do not know what it declares, so we must not answer with a confident
|
|
178
|
+
* "not configured". Only `vat verify` passes it, and only defensively — its
|
|
179
|
+
* phase builder pushes every subprocess phase when the config is unreadable
|
|
180
|
+
* (so the CHILD reports the real error), which makes the list non-empty and
|
|
181
|
+
* this arm unreachable by construction today. It is kept because the arm that
|
|
182
|
+
* would otherwise catch an empty list is the "not configured" lie.
|
|
183
|
+
*/
|
|
184
|
+
export declare function decidePhaseSelection(only: string | undefined, phases: Phase[], vocab: PhaseVocabulary, options?: {
|
|
185
|
+
unreadableConfig?: string | undefined;
|
|
186
|
+
}): PhaseSelection;
|
|
187
|
+
/**
|
|
188
|
+
* Act on a {@link PhaseSelection}: return the phases to run, or emit the
|
|
189
|
+
* command's normal structured document and exit.
|
|
26
190
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* @param validPhaseNames - Human-readable list of valid phase names (for error message)
|
|
31
|
-
* @returns Initialized phase context
|
|
32
|
-
* @throws Error if phases list is empty
|
|
191
|
+
* Both terminal arms go through `writeYamlOutput` deliberately. A `--only`
|
|
192
|
+
* failure used to be an uncaught throw, so the one output a scripted caller
|
|
193
|
+
* parses — the YAML document on stdout — was never written at all.
|
|
33
194
|
*/
|
|
34
|
-
export declare function
|
|
195
|
+
export declare function applyPhaseSelection(selection: PhaseSelection, logger: ReturnType<typeof createLogger>, startTime: number): Phase[];
|
|
196
|
+
/** The worse of two phase statuses, per {@link PHASE_STATUS_ORDER}. */
|
|
197
|
+
export declare function worseOf(a: PhaseStatus, b: PhaseStatus): PhaseStatus;
|
|
198
|
+
/**
|
|
199
|
+
* Map a spawn outcome to a phase outcome. The pure core of {@link runPhase}.
|
|
200
|
+
*
|
|
201
|
+
* Every branch that is NOT "the child ran and told us what it found" is a
|
|
202
|
+
* system error, because the orchestrator learned nothing about the artifact:
|
|
203
|
+
*
|
|
204
|
+
* | spawn outcome | phase status | why |
|
|
205
|
+
* |--------------------------|----------------|--------------------------------------------|
|
|
206
|
+
* | `error` set | `system-error` | the child never ran |
|
|
207
|
+
* | killed by a signal | `system-error` | the child was cut off mid-answer |
|
|
208
|
+
* | no exit code, no signal | `system-error` | there is no answer to read |
|
|
209
|
+
* | stdout not parseable | `system-error` | the child's answer cannot be read |
|
|
210
|
+
* | exit 0 | `success` | ran, found nothing actionable |
|
|
211
|
+
* | exit 1 | `error` | ran, found validation errors |
|
|
212
|
+
* | exit 2 (or any other) | `system-error` | the child itself reported a system error |
|
|
213
|
+
*
|
|
214
|
+
* The exit code is then reconciled with the child's OWN reported `status`,
|
|
215
|
+
* worst-wins. An exit code has three values and cannot express `warning`, so
|
|
216
|
+
* `vat skills validate` — which exits 0 while reporting `status: warning` —
|
|
217
|
+
* was being recorded as `success` by every orchestrator, including the one
|
|
218
|
+
* VAT's CI dogfoods on VAT itself.
|
|
219
|
+
*/
|
|
220
|
+
export declare function phaseResultFromSpawn(name: string, outcome: PhaseSpawnOutcome): PhaseResult;
|
|
35
221
|
/**
|
|
36
222
|
* Run a single phase by spawning the vat binary with the phase args.
|
|
223
|
+
*
|
|
224
|
+
* stdout is CAPTURED, not inherited: the child's YAML document belongs in this
|
|
225
|
+
* phase's `report`, and letting it stream onto the parent's stdout is what made
|
|
226
|
+
* `vat validate`'s output a run of documents with no `---` between them.
|
|
227
|
+
* stderr stays inherited — progress output is on stderr by design and must keep
|
|
228
|
+
* streaming live rather than arriving in one lump at the end.
|
|
37
229
|
*/
|
|
38
230
|
export declare function runPhase(binPath: string, phase: Phase): PhaseResult;
|
|
231
|
+
/**
|
|
232
|
+
* Worst-wins aggregate across phases. `system-error` outranks `error`: "we could
|
|
233
|
+
* not determine the answer" must never be filed under "we determined it is bad".
|
|
234
|
+
*/
|
|
235
|
+
export declare function aggregatePhaseStatus(results: readonly PhaseResult[]): PhaseStatus;
|
|
236
|
+
/**
|
|
237
|
+
* One phase's per-severity distribution, wherever that phase keeps it.
|
|
238
|
+
*
|
|
239
|
+
* An in-process phase holds its own findings and publishes {@link
|
|
240
|
+
* PhaseResult.issueCounts}. A subprocess phase deliberately does not — the child
|
|
241
|
+
* owns its findings, and its document rides verbatim in {@link
|
|
242
|
+
* PhaseResult.report}. Reading only the former is why an orchestrator's header
|
|
243
|
+
* could report `{0, 0, 0}` over children that had just reported 12 warnings.
|
|
244
|
+
*
|
|
245
|
+
* Absent or malformed counts read as zero rather than throwing: a phase that
|
|
246
|
+
* published no distribution contributes nothing to the total, which is the same
|
|
247
|
+
* answer as before this function existed — just no longer the answer for phases
|
|
248
|
+
* that DID publish one.
|
|
249
|
+
*/
|
|
250
|
+
export declare function phaseIssueCounts(result: PhaseResult): SeverityCounts;
|
|
251
|
+
/**
|
|
252
|
+
* Sum every phase's distribution, so an orchestrator's header total reconciles
|
|
253
|
+
* against the phases printed beneath it.
|
|
254
|
+
*
|
|
255
|
+
* The companion to {@link aggregatePhaseStatus}: status has always been
|
|
256
|
+
* worst-wins ACROSS phases, and a header whose `status` can see the children
|
|
257
|
+
* while its `issueCounts` cannot is the same contradiction in one document —
|
|
258
|
+
* `status: warning` beside `warnings: 0`.
|
|
259
|
+
*/
|
|
260
|
+
export declare function aggregatePhaseIssueCounts(results: readonly PhaseResult[]): SeverityCounts;
|
|
261
|
+
/**
|
|
262
|
+
* The process exit code for a set of phase outcomes, per the exit-code contract
|
|
263
|
+
* every orchestrator's help text documents: 0 pass, 1 validation failure,
|
|
264
|
+
* 2 system error. Warnings do not fail a run — they are published in the status
|
|
265
|
+
* and counts instead.
|
|
266
|
+
*/
|
|
267
|
+
export declare function exitCodeForPhases(results: readonly PhaseResult[]): 0 | 1 | 2;
|
|
39
268
|
//# sourceMappingURL=phase-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase-utils.d.ts","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"phase-utils.d.ts","sourceRoot":"","sources":["../../src/commands/phase-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,WAAW,CAAC;AAGjD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGlD,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAI9D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAclG;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,cAAc,CAAC;AAE3E,gFAAgF;AAChF,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