vigiles 29.0.0 → 30.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.
Files changed (106) hide show
  1. package/dist/adapter-conformance.d.ts +1 -1
  2. package/dist/adapter-conformance.js +106 -25
  3. package/dist/adapter-registry.d.ts +61 -14
  4. package/dist/adapter-registry.js +78 -10
  5. package/dist/adapter.d.ts +23 -2
  6. package/dist/adapter.js +13 -1
  7. package/dist/adapters/claude-code/adapter.d.ts +32 -2
  8. package/dist/adapters/claude-code/adapter.js +44 -23
  9. package/dist/adapters/claude-code/dialect.js +87 -21
  10. package/dist/adapters/claude-code/hook-protocol.js +16 -0
  11. package/dist/adapters/claude-code/instruction-chain.d.ts +25 -0
  12. package/dist/adapters/claude-code/instruction-chain.js +626 -0
  13. package/dist/adapters/claude-code/layout.d.ts +2 -2
  14. package/dist/adapters/claude-code/layout.js +42 -8
  15. package/dist/adapters/claude-code/model-access.d.ts +41 -0
  16. package/dist/adapters/claude-code/model-access.js +46 -0
  17. package/dist/adapters/claude-code/skill-reachability.d.ts +125 -0
  18. package/dist/adapters/claude-code/skill-reachability.js +111 -0
  19. package/dist/adapters/codex/adapter.d.ts +39 -2
  20. package/dist/adapters/codex/adapter.js +29 -29
  21. package/dist/adapters/codex/dialect.js +11 -6
  22. package/dist/adapters/codex/eval.d.ts +10 -0
  23. package/dist/adapters/codex/eval.js +48 -1
  24. package/dist/adapters/codex/hook-protocol.d.ts +2 -1
  25. package/dist/adapters/codex/hook-protocol.js +10 -0
  26. package/dist/adapters/codex/instruction-chain.d.ts +40 -0
  27. package/dist/adapters/codex/instruction-chain.js +105 -0
  28. package/dist/adapters/codex/layout.d.ts +1 -1
  29. package/dist/adapters/codex/layout.js +41 -14
  30. package/dist/adapters/opencode/adapter.d.ts +33 -2
  31. package/dist/adapters/opencode/adapter.js +36 -36
  32. package/dist/adapters/opencode/dialect.js +2 -2
  33. package/dist/adapters/opencode/instruction-chain.d.ts +37 -0
  34. package/dist/adapters/opencode/instruction-chain.js +70 -0
  35. package/dist/adapters/opencode/layout.d.ts +19 -0
  36. package/dist/adapters/opencode/layout.js +34 -15
  37. package/dist/adoptability.d.ts +31 -1
  38. package/dist/adoptability.js +57 -0
  39. package/dist/cli-main.js +180 -102
  40. package/dist/core/adapter.d.ts +213 -61
  41. package/dist/core/compile.d.ts +2 -2
  42. package/dist/core/compile.js +57 -38
  43. package/dist/core/compose.d.ts +5 -3
  44. package/dist/core/compose.js +5 -3
  45. package/dist/core/config-schema.d.ts +14 -2
  46. package/dist/core/config-schema.js +24 -3
  47. package/dist/core/dialect.d.ts +54 -12
  48. package/dist/core/dialect.js +56 -0
  49. package/dist/core/eval-driver.d.ts +194 -0
  50. package/dist/core/eval-driver.js +3 -0
  51. package/dist/core/frontmatter-read.d.ts +10 -0
  52. package/dist/core/frontmatter-read.js +30 -3
  53. package/dist/core/hook-program.d.ts +27 -2
  54. package/dist/core/hook-program.js +29 -24
  55. package/dist/core/hook-protocol.d.ts +54 -0
  56. package/dist/core/install-reader.d.ts +18 -0
  57. package/dist/core/install-reader.js +88 -0
  58. package/dist/core/instruction-chain.d.ts +444 -0
  59. package/dist/core/instruction-chain.js +292 -0
  60. package/dist/core/instruction-weight.d.ts +96 -14
  61. package/dist/core/instruction-weight.js +65 -30
  62. package/dist/core/layout.d.ts +220 -33
  63. package/dist/core/layout.js +115 -1
  64. package/dist/core/lethal-trifecta.d.ts +12 -7
  65. package/dist/core/lethal-trifecta.js +13 -8
  66. package/dist/core/live-driver.d.ts +137 -0
  67. package/dist/core/live-driver.js +14 -0
  68. package/dist/core/markdown.d.ts +23 -0
  69. package/dist/core/markdown.js +77 -28
  70. package/dist/core/orphans.js +9 -7
  71. package/dist/core/settings-codec.d.ts +17 -0
  72. package/dist/core/settings-codec.js +56 -0
  73. package/dist/core/surface-discovery.d.ts +2 -2
  74. package/dist/core/surface-discovery.js +24 -8
  75. package/dist/core/surface-scopes.d.ts +26 -6
  76. package/dist/core/surface-scopes.js +52 -11
  77. package/dist/core/validate.js +16 -3
  78. package/dist/eval.d.ts +16 -108
  79. package/dist/eval.js +34 -1
  80. package/dist/harness-test.d.ts +3 -63
  81. package/dist/hook-install.d.ts +12 -1
  82. package/dist/hook-install.js +12 -1
  83. package/dist/plugin-loader.d.ts +1 -1
  84. package/dist/plugin-loader.js +43 -36
  85. package/dist/scan-behavioral.d.ts +34 -25
  86. package/dist/scan-behavioral.js +122 -58
  87. package/dist/scan-core.js +37 -18
  88. package/dist/scan-files.d.ts +1 -1
  89. package/dist/scan-files.js +53 -33
  90. package/dist/scan-trigger-suggest.d.ts +0 -21
  91. package/dist/scan-trigger-suggest.js +0 -23
  92. package/dist/scan.d.ts +4 -4
  93. package/dist/scan.js +120 -73
  94. package/dist/skill-harness.d.ts +21 -5
  95. package/dist/skill-harness.js +29 -11
  96. package/dist/surface-discovery-fs.d.ts +2 -0
  97. package/dist/surface-discovery-fs.js +108 -6
  98. package/dist/test-coverage-files.js +24 -17
  99. package/dist/test-coverage.d.ts +9 -3
  100. package/dist/test-coverage.js +32 -17
  101. package/dist/verify-plugin-guards.js +1 -1
  102. package/package.json +1 -1
  103. package/dist/skill-reachability.d.ts +0 -68
  104. package/dist/skill-reachability.js +0 -205
  105. /package/dist/{dialect-drift.d.ts → adapters/claude-code/dialect-drift.d.ts} +0 -0
  106. /package/dist/{dialect-drift.js → adapters/claude-code/dialect-drift.js} +0 -0
@@ -1,4 +1,11 @@
1
- import { type AgentRunner, type ModelOutputParser } from "./eval.js";
1
+ import { type AgentRunner, type ModelOutputParser, type EvalDriver, type RunOut } from "./eval.js";
2
+ /**
3
+ * The harness CLI did not run, as distinct from running and finding nothing.
4
+ * A named class so the caller can tell the two apart without matching prose.
5
+ */
6
+ export declare class DraftRunFailed extends Error {
7
+ constructor(reason: string);
8
+ }
2
9
  /** A reference the model proposes as machine-verifiable. */
3
10
  export interface DraftedRef {
4
11
  readonly kind: "enforce" | "file" | "cmd" | "dir";
@@ -36,9 +43,32 @@ export interface DraftOptions {
36
43
  readonly cwd?: string;
37
44
  readonly runner?: AgentRunner;
38
45
  readonly parse?: ModelOutputParser;
46
+ /**
47
+ * The driver's own reader for a failure the exit code does not carry — a
48
+ * refusal, or a turn error inside a zero-exit run. Supplied by
49
+ * {@link draftWith}; absent means the exit code is the only signal.
50
+ */
51
+ readonly runError?: (out: RunOut) => string | null;
39
52
  }
40
53
  /** Injectable drafter — the real one calls a model; tests pass a fake. */
41
54
  export type Drafter = (content: string) => Promise<DraftedRef[]>;
55
+ /**
56
+ * Build the real drafter from a harness's EVAL DRIVER, instead of the hard-wired
57
+ * `spawnAgent` + `parseClaudeRun` defaults above.
58
+ *
59
+ * 🔴 THIS IS WHY THE PREVIEW IS NOT CLAUDE-CODE-ONLY. `defaultDraft`'s two
60
+ * defaults ARE the two members of the Claude eval driver, and nothing else in
61
+ * the drafter is harness-specific: the prompt is over an instruction file's
62
+ * prose, and prose is prose. The VERIFIER is deterministic and harness-free
63
+ * ("LLM proposes, deterministic disposes", this file's header), so "M broken
64
+ * right now" is exactly as trustworthy driven by one harness as by another;
65
+ * only the draft's RECALL varies by model, which it already does across models
66
+ * of the same harness.
67
+ *
68
+ * `model` is passed through to whichever runner: the trigger tier already does
69
+ * this, and a runner that does not understand the alias ignores it.
70
+ */
71
+ export declare function draftWith(driver: EvalDriver, opts?: DraftOptions): Drafter;
42
72
  export interface AdoptabilityTierOptions {
43
73
  readonly instructionContent: string;
44
74
  readonly basePath: string;
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DraftRunFailed = void 0;
3
4
  exports.verifyDraftedRefs = verifyDraftedRefs;
4
5
  exports.parseDraftJson = parseDraftJson;
6
+ exports.draftWith = draftWith;
5
7
  exports.runAdoptabilityTier = runAdoptabilityTier;
6
8
  exports.formatAdoptability = formatAdoptability;
7
9
  /**
@@ -26,6 +28,17 @@ const linters_js_1 = require("./core/linters.js");
26
28
  const compile_js_1 = require("./core/compile.js");
27
29
  const hash_js_1 = require("./core/hash.js");
28
30
  const eval_js_1 = require("./eval.js");
31
+ /**
32
+ * The harness CLI did not run, as distinct from running and finding nothing.
33
+ * A named class so the caller can tell the two apart without matching prose.
34
+ */
35
+ class DraftRunFailed extends Error {
36
+ constructor(reason) {
37
+ super(`could not run the drafting model — ${reason}`);
38
+ this.name = "DraftRunFailed";
39
+ }
40
+ }
41
+ exports.DraftRunFailed = DraftRunFailed;
29
42
  /** Verify ONE drafted ref against the real repo; null = resolves, else the breakage. */
30
43
  function verifyOne(r, basePath) {
31
44
  switch (r.kind) {
@@ -163,8 +176,52 @@ async function defaultDraft(content, opts = {}) {
163
176
  timeoutMs: 120000,
164
177
  env: process.env,
165
178
  });
179
+ // 🔴 THE EXIT CODE IS READ, AND IT WAS NOT. A runner that could not start the
180
+ // harness binary returns code 1 with empty stdout; `parse` then yields no
181
+ // output, `parseDraftJson` yields `[]`, and the report prints "no
182
+ // machine-verifiable references found" — a valid-looking answer to a question
183
+ // nothing ever asked. Found on review of #265: the unconditional
184
+ // `subscription` on the Codex driver lets this path run with no binary
185
+ // present, and unlike the behavioral probe there is nothing here that
186
+ // self-reports unavailability.
187
+ //
188
+ // Thrown rather than returned empty, because "the run failed" and "the model
189
+ // found nothing" are different answers and the caller has to be able to say
190
+ // which. `runError` is the driver's own reader for a failure the exit code
191
+ // does not carry — a refusal or a turn error inside a zero-exit run.
192
+ if (out.code !== 0) {
193
+ throw new DraftRunFailed(`the harness CLI exited ${String(out.code)}${out.stderr ? `: ${out.stderr.trim().slice(0, 200)}` : " with no output"}`);
194
+ }
195
+ const driverError = opts.runError?.(out);
196
+ if (driverError !== null && driverError !== undefined) {
197
+ throw new DraftRunFailed(driverError);
198
+ }
166
199
  return parseDraftJson(parse(out).output);
167
200
  }
201
+ /**
202
+ * Build the real drafter from a harness's EVAL DRIVER, instead of the hard-wired
203
+ * `spawnAgent` + `parseClaudeRun` defaults above.
204
+ *
205
+ * 🔴 THIS IS WHY THE PREVIEW IS NOT CLAUDE-CODE-ONLY. `defaultDraft`'s two
206
+ * defaults ARE the two members of the Claude eval driver, and nothing else in
207
+ * the drafter is harness-specific: the prompt is over an instruction file's
208
+ * prose, and prose is prose. The VERIFIER is deterministic and harness-free
209
+ * ("LLM proposes, deterministic disposes", this file's header), so "M broken
210
+ * right now" is exactly as trustworthy driven by one harness as by another;
211
+ * only the draft's RECALL varies by model, which it already does across models
212
+ * of the same harness.
213
+ *
214
+ * `model` is passed through to whichever runner: the trigger tier already does
215
+ * this, and a runner that does not understand the alias ignores it.
216
+ */
217
+ function draftWith(driver, opts = {}) {
218
+ return (content) => defaultDraft(content, {
219
+ ...opts,
220
+ runner: driver.runner,
221
+ parse: driver.parse,
222
+ runError: driver.runError,
223
+ });
224
+ }
168
225
  /**
169
226
  * Run the preview: draft refs from the instruction file (model), then verify them
170
227
  * (deterministic). The composition root of "LLM proposes, deterministic disposes".