vigiles 38.2.0 → 39.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/claude-code/event-capability.js +24 -8
- package/dist/adapters/claude-code/hook-protocol.js +2 -1
- package/dist/adapters/codex/hook-protocol.js +2 -1
- package/dist/cli-flag-check.d.ts +36 -0
- package/dist/cli-flag-check.js +72 -1
- package/dist/cli-main.d.ts +2 -2
- package/dist/cli-main.js +548 -379
- package/dist/core/bash-effects.d.ts +0 -57
- package/dist/core/bash-effects.js +0 -147
- package/dist/core/compile-generator.d.ts +6 -6
- package/dist/core/compile-generator.js +4 -4
- package/dist/core/compile.d.ts +72 -8
- package/dist/core/compile.js +276 -133
- package/dist/core/config-schema.d.ts +40 -10
- package/dist/core/config-schema.js +139 -16
- package/dist/core/coverage.d.ts +16 -0
- package/dist/core/coverage.js +22 -0
- package/dist/core/doc-refs.d.ts +3 -2
- package/dist/core/doc-refs.js +2 -2
- package/dist/core/enforce-marker.d.ts +28 -0
- package/dist/core/enforce-marker.js +34 -0
- package/dist/core/eslint-inventory.d.ts +96 -0
- package/dist/core/eslint-inventory.js +251 -0
- package/dist/core/event-capability.d.ts +5 -1
- package/dist/core/frame.d.ts +43 -2
- package/dist/core/frame.js +85 -2
- package/dist/core/generate-schema.d.ts +3 -2
- package/dist/core/generate-schema.js +2 -2
- package/dist/core/generate-types.d.ts +11 -2
- package/dist/core/generate-types.js +12 -5
- package/dist/core/hook-command.d.ts +172 -0
- package/dist/core/hook-command.js +277 -0
- package/dist/core/hook-delivery.d.ts +133 -0
- package/dist/core/hook-delivery.js +150 -0
- package/dist/core/hook-paths.d.ts +14 -0
- package/dist/core/hook-paths.js +22 -0
- package/dist/core/hook-program.d.ts +4 -4
- package/dist/core/hook-program.js +13 -25
- package/dist/core/hook-state.d.ts +1 -1
- package/dist/core/hook-state.js +1 -1
- package/dist/core/instruction-remedies.d.ts +35 -0
- package/dist/core/instruction-remedies.js +70 -1
- package/dist/core/integrity-header.d.ts +54 -0
- package/dist/core/integrity-header.js +90 -0
- package/dist/core/integrity.d.ts +1 -25
- package/dist/core/integrity.js +16 -74
- package/dist/core/linter-adapter.d.ts +27 -3
- package/dist/core/linters.d.ts +8 -1
- package/dist/core/linters.js +116 -81
- package/dist/core/orphans.d.ts +3 -5
- package/dist/core/orphans.js +9 -10
- package/dist/core/presets.d.ts +19 -7
- package/dist/core/presets.js +19 -6
- package/dist/core/rule-catalog.d.ts +11 -12
- package/dist/core/rule-catalog.js +25 -94
- package/dist/core/rule-meta.d.ts +12 -0
- package/dist/core/rule-meta.js +47 -10
- package/dist/core/source-refs.d.ts +3 -23
- package/dist/core/source-refs.js +3 -27
- package/dist/core/test-utils.d.ts +13 -0
- package/dist/core/test-utils.js +40 -1
- package/dist/core/types.d.ts +18 -26
- package/dist/core/validate.d.ts +1 -2
- package/dist/core/validate.js +60 -47
- package/dist/coverage-evidence.js +2 -3
- package/dist/deprecated-key-files.d.ts +6 -0
- package/dist/deprecated-key-files.js +7 -6
- package/dist/exclude.d.ts +3 -1
- package/dist/exclude.js +9 -33
- package/dist/harness-assert.d.ts +18 -0
- package/dist/harness-assert.js +38 -0
- package/dist/hook-check-install.js +15 -6
- package/dist/hook-check.d.ts +1 -3
- package/dist/hook-check.js +3 -5
- package/dist/hook-install.d.ts +7 -41
- package/dist/hook-install.js +29 -96
- package/dist/hook-runtime.js +2 -1
- package/dist/load-hook.d.ts +3 -2
- package/dist/load-hook.js +28 -6
- package/dist/overrides.d.ts +25 -0
- package/dist/overrides.js +51 -0
- package/dist/plugin-loader.d.ts +23 -0
- package/dist/plugin-loader.js +42 -12
- package/dist/root-globs.d.ts +9 -0
- package/dist/root-globs.js +48 -0
- package/dist/rule-routing.js +6 -3
- package/dist/run-hook.d.ts +26 -2
- package/dist/run-hook.js +48 -12
- package/dist/scan-core.d.ts +96 -20
- package/dist/scan-core.js +171 -176
- package/dist/scan-files.d.ts +0 -8
- package/dist/scan-files.js +78 -20
- package/dist/scan.d.ts +12 -12
- package/dist/scan.js +33 -10
- package/dist/setup-plan.d.ts +15 -9
- package/dist/setup-plan.js +26 -18
- package/dist/test-coverage.d.ts +3 -8
- package/dist/test-coverage.js +6 -6
- package/dist/test.d.ts +1 -1
- package/dist/vigilesrc.schema.json +1329 -118
- package/package.json +1 -1
- package/skills/adopt-spec/SKILL.md +2 -1
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.claudeCodeEventCapabilities = void 0;
|
|
4
|
+
/*
|
|
5
|
+
* `halt` (doc, § JSON output, read 2026-10-12): `continue` is a universal field
|
|
6
|
+
* — "If `false`, Claude stops processing entirely after the hook runs" — and
|
|
7
|
+
* "Every event accepts them, but some events discard them [...]. Each event's
|
|
8
|
+
* section says so." The six rows that carry `halt` have no such sentence in
|
|
9
|
+
* their sections (and § JSON output names PreToolUse and PostToolUse: "the stop
|
|
10
|
+
* applies even when the tool call fails"). § PreCompact and § Notification
|
|
11
|
+
* each say they discard `continue`; SessionEnd has no turn left to stop.
|
|
12
|
+
* https://code.claude.com/docs/en/hooks
|
|
13
|
+
*/
|
|
4
14
|
exports.claudeCodeEventCapabilities = {
|
|
5
15
|
capturedFrom: "code.claude.com/docs/en/hooks (claude-code 2.1.273) + inject/veto measured 2026-09-16 headless",
|
|
6
16
|
events: {
|
|
7
17
|
// doc: SessionStart context is prepended to the session. MEASURED 2026-09-16:
|
|
8
18
|
// inject lands; exit 2 is ignored entirely (it is in noEffectHookEvents).
|
|
19
|
+
// doc (§ Exit code 0, read 2026-10-11): plain stdout is context here — "The
|
|
20
|
+
// exceptions are `UserPromptSubmit`, `UserPromptExpansion`, `SessionStart`,
|
|
21
|
+
// and `PostModelSwitch`, where Claude Code adds plain-text stdout as context".
|
|
9
22
|
SessionStart: {
|
|
10
23
|
carries: "session",
|
|
11
|
-
honours: ["inject"],
|
|
24
|
+
honours: ["inject", "stdout-context", "halt"],
|
|
12
25
|
matcher: false,
|
|
13
26
|
denyShape: "exit-code",
|
|
14
27
|
},
|
|
15
|
-
// doc: exit 2 blocks the prompt and erases it; stdout becomes context
|
|
28
|
+
// doc: exit 2 blocks the prompt and erases it; plain stdout becomes context
|
|
29
|
+
// (the same § Exit code 0 sentence as SessionStart).
|
|
16
30
|
UserPromptSubmit: {
|
|
17
31
|
carries: "prompt",
|
|
18
|
-
honours: ["veto", "inject"],
|
|
32
|
+
honours: ["veto", "inject", "stdout-context", "halt"],
|
|
19
33
|
matcher: false,
|
|
20
34
|
denyShape: "exit-code",
|
|
21
35
|
},
|
|
@@ -26,16 +40,18 @@ exports.claudeCodeEventCapabilities = {
|
|
|
26
40
|
// assumption nobody had run.
|
|
27
41
|
PreToolUse: {
|
|
28
42
|
carries: "tool",
|
|
29
|
-
honours: ["veto", "ask", "inject"],
|
|
43
|
+
honours: ["veto", "ask", "inject", "halt"],
|
|
30
44
|
matcher: true,
|
|
31
45
|
denyShape: "permission-decision",
|
|
32
46
|
},
|
|
33
47
|
// doc: exit 2 feeds stderr back to the MODEL but the tool has already run —
|
|
34
|
-
// feedback, never a veto.
|
|
48
|
+
// feedback, never a veto. NOT `stdout-context`, and NOT stderr at exit 0:
|
|
49
|
+
// "Claude never sees stderr from a hook that exits 0" (§ Exit code 0) — the
|
|
50
|
+
// channel a downstream KB linter used for weeks, delivering nothing. This distinction is why `hook-block-ineffective`
|
|
35
51
|
// does not flag PostToolUse and would cry wolf if it did.
|
|
36
52
|
PostToolUse: {
|
|
37
53
|
carries: "tool",
|
|
38
|
-
honours: ["feedback", "inject"],
|
|
54
|
+
honours: ["feedback", "inject", "halt"],
|
|
39
55
|
matcher: true,
|
|
40
56
|
denyShape: "exit-code",
|
|
41
57
|
},
|
|
@@ -43,7 +59,7 @@ exports.claudeCodeEventCapabilities = {
|
|
|
43
59
|
// shape). MEASURED 2026-09-16: inject lands too.
|
|
44
60
|
Stop: {
|
|
45
61
|
carries: "stop",
|
|
46
|
-
honours: ["veto", "inject"],
|
|
62
|
+
honours: ["veto", "inject", "halt"],
|
|
47
63
|
matcher: false,
|
|
48
64
|
denyShape: "exit-code",
|
|
49
65
|
},
|
|
@@ -51,7 +67,7 @@ exports.claudeCodeEventCapabilities = {
|
|
|
51
67
|
// it was not measured, and Stop's behaviour is not evidence about it.
|
|
52
68
|
SubagentStop: {
|
|
53
69
|
carries: "stop",
|
|
54
|
-
honours: ["veto"],
|
|
70
|
+
honours: ["veto", "halt"],
|
|
55
71
|
matcher: false,
|
|
56
72
|
denyShape: "exit-code",
|
|
57
73
|
},
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.claudeCodeHookProtocol = void 0;
|
|
4
4
|
const hook_condition_js_1 = require("./hook-condition.js");
|
|
5
5
|
const hook_install_js_1 = require("../../hook-install.js");
|
|
6
|
+
const layout_js_1 = require("./layout.js");
|
|
6
7
|
exports.claudeCodeHookProtocol = {
|
|
7
8
|
name: "claude-code",
|
|
8
9
|
blockExitCode: 2,
|
|
@@ -55,7 +56,7 @@ exports.claudeCodeHookProtocol = {
|
|
|
55
56
|
// step the core cannot take: `CompiledHooks` is the application layer's type,
|
|
56
57
|
// and a core port may not name it.
|
|
57
58
|
mergeRegistrations(existing, compiled, managedBy) {
|
|
58
|
-
return (0, hook_install_js_1.mergeHooksJson)(existing, compiled, managedBy);
|
|
59
|
+
return (0, hook_install_js_1.mergeHooksJson)(existing, compiled, managedBy, layout_js_1.claudeCodeLayout.projectRootTokens ?? []);
|
|
59
60
|
},
|
|
60
61
|
};
|
|
61
62
|
//# sourceMappingURL=hook-protocol.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.codexHookProtocol = void 0;
|
|
4
4
|
const hook_install_js_1 = require("../../hook-install.js");
|
|
5
|
+
const layout_js_1 = require("./layout.js");
|
|
5
6
|
exports.codexHookProtocol = {
|
|
6
7
|
name: "codex",
|
|
7
8
|
blockExitCode: 2,
|
|
@@ -35,7 +36,7 @@ exports.codexHookProtocol = {
|
|
|
35
36
|
return { hooks: { [on]: [entry] } };
|
|
36
37
|
},
|
|
37
38
|
mergeRegistrations(existing, compiled, managedBy) {
|
|
38
|
-
return (0, hook_install_js_1.mergeHooksToml)(existing, compiled, managedBy);
|
|
39
|
+
return (0, hook_install_js_1.mergeHooksToml)(existing, compiled, managedBy, layout_js_1.codexLayout.projectRootTokens ?? []);
|
|
39
40
|
},
|
|
40
41
|
};
|
|
41
42
|
//# sourceMappingURL=hook-protocol.js.map
|
package/dist/cli-flag-check.d.ts
CHANGED
|
@@ -70,4 +70,40 @@ export declare function unknownFlags(command: string, argv: readonly string[]):
|
|
|
70
70
|
export declare function nearestFlag(unknown: string, known: readonly FlagSpec[]): string | undefined;
|
|
71
71
|
/** The message printed to stderr for one unrecognised flag. */
|
|
72
72
|
export declare function formatUnknownFlag(command: string, flag: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Which of a verb's arguments name a PATH. The CLI runs every command from the
|
|
75
|
+
* project root it resolves once (`findProjectRoot`), but a path the user types
|
|
76
|
+
* means "from where I typed it"; these are the arguments re-expressed from the
|
|
77
|
+
* root before the command runs. One table beside the flag table, so a new
|
|
78
|
+
* path-valued flag is declared where flags are.
|
|
79
|
+
*/
|
|
80
|
+
interface PathArguments {
|
|
81
|
+
/**
|
|
82
|
+
* Which directory the verb runs from. `project`: the resolved project root.
|
|
83
|
+
* `invocation`: where it was typed — `init` makes THAT directory a project
|
|
84
|
+
* (a workspace member it sets up must not become its monorepo's root), and
|
|
85
|
+
* `hook-runtime` takes its root from the harness event, not from a directory.
|
|
86
|
+
*/
|
|
87
|
+
readonly root: "project" | "invocation";
|
|
88
|
+
/** Positionals that are paths: all of them, all after the first (a kind), or none. */
|
|
89
|
+
readonly positionals: "all" | "after-first" | "none";
|
|
90
|
+
/** `--flag=` specs whose value is a path. */
|
|
91
|
+
readonly flags: readonly FlagSpec[];
|
|
92
|
+
}
|
|
93
|
+
export declare const PATH_ARGUMENTS: Readonly<Record<Verb, PathArguments>>;
|
|
94
|
+
/**
|
|
95
|
+
* Whether `command` runs from the resolved project root. A word that is not a
|
|
96
|
+
* verb (`--version`, a typo) runs nowhere in particular: it is answered where
|
|
97
|
+
* it was typed.
|
|
98
|
+
*/
|
|
99
|
+
export declare function runsFromProjectRoot(command: string): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* The verb's arguments (everything after the verb) with each path argument
|
|
102
|
+
* passed through `rebase`. Flags that do not take a path, words, and `--`
|
|
103
|
+
* itself are returned unchanged. After `--` every word is an operand: a path
|
|
104
|
+
* among them is rebased like any other positional, and a dash-led one is never
|
|
105
|
+
* mistaken for a path-valued flag.
|
|
106
|
+
*/
|
|
107
|
+
export declare function rebasePathArgs(command: string, argv: readonly string[], rebase: (path: string) => string): readonly string[];
|
|
108
|
+
export {};
|
|
73
109
|
//# sourceMappingURL=cli-flag-check.d.ts.map
|
package/dist/cli-flag-check.js
CHANGED
|
@@ -39,11 +39,13 @@
|
|
|
39
39
|
* rejection in a user's face.
|
|
40
40
|
*/
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.COMMAND_FLAGS = exports.SHARED_FLAGS = void 0;
|
|
42
|
+
exports.PATH_ARGUMENTS = exports.COMMAND_FLAGS = exports.SHARED_FLAGS = void 0;
|
|
43
43
|
exports.knownFlagsFor = knownFlagsFor;
|
|
44
44
|
exports.unknownFlags = unknownFlags;
|
|
45
45
|
exports.nearestFlag = nearestFlag;
|
|
46
46
|
exports.formatUnknownFlag = formatUnknownFlag;
|
|
47
|
+
exports.runsFromProjectRoot = runsFromProjectRoot;
|
|
48
|
+
exports.rebasePathArgs = rebasePathArgs;
|
|
47
49
|
/**
|
|
48
50
|
* Flags every verb accepts: the config overrides applied in `main()` before
|
|
49
51
|
* dispatch (see `applyConfigFlags`) plus the harness override, which the shared
|
|
@@ -203,4 +205,73 @@ function formatUnknownFlag(command, flag) {
|
|
|
203
205
|
lines.push(` Flags for \`${command}\`: ${[...known].sort().join(" ")}`, ` \`vigiles ${command} --help\` lists them with descriptions.`);
|
|
204
206
|
return lines.join("\n");
|
|
205
207
|
}
|
|
208
|
+
exports.PATH_ARGUMENTS = {
|
|
209
|
+
init: { root: "invocation", positionals: "none", flags: ["--target="] },
|
|
210
|
+
compile: { root: "project", positionals: "all", flags: [] },
|
|
211
|
+
eject: { root: "project", positionals: "all", flags: [] },
|
|
212
|
+
lint: { root: "project", positionals: "all", flags: ["--json-out="] },
|
|
213
|
+
test: { root: "project", positionals: "all", flags: [] },
|
|
214
|
+
eval: { root: "project", positionals: "all", flags: [] },
|
|
215
|
+
audit: {
|
|
216
|
+
root: "project",
|
|
217
|
+
positionals: "all",
|
|
218
|
+
flags: ["--out=", "--capability-diff=", "--prompts="],
|
|
219
|
+
},
|
|
220
|
+
// `generate <kind> [out]`: the kind is a word, the rest are paths.
|
|
221
|
+
generate: { root: "project", positionals: "after-first", flags: [] },
|
|
222
|
+
// The harness supplies its argv; its paths are already what it means.
|
|
223
|
+
"hook-runtime": { root: "invocation", positionals: "none", flags: [] },
|
|
224
|
+
};
|
|
225
|
+
/** The verb's row, or undefined for a word that is not a verb. */
|
|
226
|
+
function pathArgumentsOf(command) {
|
|
227
|
+
return Object.entries(exports.PATH_ARGUMENTS).find(([verb]) => verb === command)?.[1];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Whether `command` runs from the resolved project root. A word that is not a
|
|
231
|
+
* verb (`--version`, a typo) runs nowhere in particular: it is answered where
|
|
232
|
+
* it was typed.
|
|
233
|
+
*/
|
|
234
|
+
function runsFromProjectRoot(command) {
|
|
235
|
+
return pathArgumentsOf(command)?.root === "project";
|
|
236
|
+
}
|
|
237
|
+
/** Which of the positional argument indexes are paths, per the verb's spec. */
|
|
238
|
+
function pathPositionalIndexes(positionals, indexes) {
|
|
239
|
+
switch (positionals) {
|
|
240
|
+
case "all":
|
|
241
|
+
return indexes;
|
|
242
|
+
case "after-first":
|
|
243
|
+
return indexes.slice(1);
|
|
244
|
+
case "none":
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
/** A positional word: before `--`, one not led by a dash; after it, every word. */
|
|
249
|
+
function isOperand(arg, index, end) {
|
|
250
|
+
if (index < end)
|
|
251
|
+
return !arg.startsWith("-");
|
|
252
|
+
return index > end;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The verb's arguments (everything after the verb) with each path argument
|
|
256
|
+
* passed through `rebase`. Flags that do not take a path, words, and `--`
|
|
257
|
+
* itself are returned unchanged. After `--` every word is an operand: a path
|
|
258
|
+
* among them is rebased like any other positional, and a dash-led one is never
|
|
259
|
+
* mistaken for a path-valued flag.
|
|
260
|
+
*/
|
|
261
|
+
function rebasePathArgs(command, argv, rebase) {
|
|
262
|
+
const spec = pathArgumentsOf(command);
|
|
263
|
+
if (!spec)
|
|
264
|
+
return [...argv];
|
|
265
|
+
const end = argv.includes("--") ? argv.indexOf("--") : argv.length;
|
|
266
|
+
const positionalIndexes = argv.flatMap((a, i) => isOperand(a, i, end) ? [i] : []);
|
|
267
|
+
const pathPositionals = new Set(pathPositionalIndexes(spec.positionals, positionalIndexes));
|
|
268
|
+
return argv.map((arg, i) => {
|
|
269
|
+
if (pathPositionals.has(i))
|
|
270
|
+
return rebase(arg);
|
|
271
|
+
if (i >= end)
|
|
272
|
+
return arg;
|
|
273
|
+
const flag = spec.flags.find((f) => arg.startsWith(f));
|
|
274
|
+
return flag ? `${flag}${rebase(arg.slice(flag.length))}` : arg;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
206
277
|
//# sourceMappingURL=cli-flag-check.js.map
|
package/dist/cli-main.d.ts
CHANGED
|
@@ -58,6 +58,8 @@ interface LintReport {
|
|
|
58
58
|
mcpToolErrors: number;
|
|
59
59
|
hookScriptIssues: number;
|
|
60
60
|
hookScriptErrors: number;
|
|
61
|
+
handWrittenHookIssues: number;
|
|
62
|
+
handWrittenHookErrors: number;
|
|
61
63
|
disallowedToolIssues: number;
|
|
62
64
|
disallowedToolErrors: number;
|
|
63
65
|
descriptionOverlapIssues: number;
|
|
@@ -68,8 +70,6 @@ interface LintReport {
|
|
|
68
70
|
frontmatterValidErrors: number;
|
|
69
71
|
mcpHookIssues: number;
|
|
70
72
|
mcpHookErrors: number;
|
|
71
|
-
preferCompiledHookIssues: number;
|
|
72
|
-
preferCompiledHookErrors: number;
|
|
73
73
|
lethalTrifectaIssues: number;
|
|
74
74
|
lethalTrifectaErrors: number;
|
|
75
75
|
skillResourceIssues: number;
|