vdelta 0.2.2 → 0.3.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/run.js CHANGED
@@ -4,126 +4,103 @@
4
4
  * errors — held lock, capture failure, store trouble — degrade to
5
5
  * transparent raw passthrough (INV-5): veridelta is never worse than its
6
6
  * absence. Diagnostics go to stderr and never interleave with the report.
7
+ *
8
+ * Which runner is being recorded is decided by the adapter registry (§4.3),
9
+ * never here: an explicit `--adapter` always wins, otherwise every adapter's
10
+ * `detect` is evaluated and only an unambiguous single match may instrument
11
+ * the child's argv. Recording does not depend on that match — every adapter's
12
+ * capture-channel env reaches the child regardless, so a reporter configured
13
+ * in the project itself still records (spec §4.2 ambient recording), and the
14
+ * capture that lands in the channel names its own author. No runner vocabulary
15
+ * lives in this module — instrumenting the child, splitting inclusion intent
16
+ * and reading the capture channel all happen behind the {@link Adapter}
17
+ * descriptor.
7
18
  */
8
19
  import { spawn } from 'node:child_process';
9
20
  import { randomUUID } from 'node:crypto';
10
- import { readFileSync, rmSync } from 'node:fs';
21
+ import { rmSync } from 'node:fs';
11
22
  import { createRequire } from 'node:module';
12
23
  import { tmpdir } from 'node:os';
13
- import { dirname, join } from 'node:path';
14
- import { fileURLToPath } from 'node:url';
15
- import { buildRunRecord, } from './adapters/vitest/recorder.js';
24
+ import { join } from 'node:path';
25
+ import { adapterNames, ambientChannelEnv, claimCapture, detectAdapter, resolveAdapter, } from './adapters/registry.js';
16
26
  import { buildComparisonReport } from './compare.js';
17
27
  import { canonicalDigest } from './digest.js';
18
28
  import { defaultGcPolicy, LockHeldError, RunStore } from './store.js';
19
29
  import { dirtyDiffMaterial, gitBranch, gitHead, gitRepoRoot, treeDigest, } from './tree-digest.js';
30
+ /**
31
+ * Public API freeze (§8.2): the split itself now belongs to the vitest
32
+ * adapter's CLI surface, but the export stays on this path for Step 1 so
33
+ * consumers keep their import. The core calls it through the resolved
34
+ * descriptor, never through this binding.
35
+ */
36
+ export { splitCommandSelector } from './adapters/vitest/adapter.js';
20
37
  const pkg = createRequire(import.meta.url)('../package.json');
21
38
  export const VDELTA_VERSION = pkg.version;
22
- function reporterModulePath() {
23
- return join(dirname(fileURLToPath(import.meta.url)), 'adapters', 'vitest', 'reporter.js');
24
- }
25
- /** Locate the vitest invocation inside the child argv; null when absent. */
26
- function findVitestToken(cmd) {
27
- for (let i = 0; i < cmd.length; i++) {
28
- const token = cmd[i];
29
- if (/(^|[\\/])vitest(\.mjs|\.js)?$/.test(token) || token === 'vitest')
30
- return i;
31
- }
32
- return null;
33
- }
34
39
  /**
35
- * vitest 4.x CLI flags that always take their value as a *separate* argv
36
- * token (`--flag value`), never combined into the flag token itself. Used
37
- * by {@link splitCommandSelector} to recognize `--flag value` pairs and fold
38
- * them into a single `--flag=value` canonical token so that space-separated
39
- * and `=`-joined invocations normalize to the same command array (and
40
- * therefore the same stream key — see `streamKey` in src/compare.ts).
41
- *
42
- * Deliberately excludes flags whose value is *optional*
43
- * (`--changed`, `--silent`, `--coverage`, `--browser`, `--inspect`, etc.):
44
- * for those, the token following the flag cannot be distinguished from a
45
- * positional selector without vitest's own arg-parsing rules, so folding
46
- * them here would risk silently swallowing a selector token. Flags outside
47
- * this list keep the historical (pre-fix) behavior: a space-separated value
48
- * is treated as a selector token, which may cause selector-based stream
49
- * splitting and an abstain (`comparability: 'none'`) rather than a
50
- * false-positive comparison.
51
- *
52
- * Maintenance: this list targets vitest 4.x. Revisit when bumping the
53
- * vitest minor/major version (see issue #15 Open Question — no automated
54
- * mechanism keeps this in sync with vitest's own CLI surface).
40
+ * Why a run degraded when no adapter claimed the child argv (§4.3-2).
41
+ * Frozen at the pre-seam wording: Step 1 moves structure only and changes no
42
+ * diagnostic byte, and with a single registered adapter this sentence is
43
+ * still the accurate guidance. Phase 2 replaces it with the `--adapter` hint
44
+ * §4.3-2 describes, once naming an adapter is a real choice.
55
45
  */
56
- const VITEST_VALUE_FLAGS = new Set([
57
- '--project',
58
- '--config',
59
- '-c',
60
- '--root',
61
- '-r',
62
- '--dir',
63
- '--reporter',
64
- '--outputFile',
65
- '--pool',
66
- '--maxWorkers',
67
- '--minWorkers',
68
- '--environment',
69
- '--testNamePattern',
70
- '-t',
71
- '--testTimeout',
72
- '--hookTimeout',
73
- '--teardownTimeout',
74
- '--retry',
75
- '--bail',
76
- '--maxConcurrency',
77
- '--shard',
78
- '--exclude',
79
- '--mode',
80
- '--workspace',
81
- ]);
46
+ const NO_ADAPTER_DIAGNOSTIC = 'no capture from the vitest reporter — is the child a vitest invocation?';
82
47
  /**
83
- * The invocation's selector is its inclusion intent (§6.4): the vitest CLI
84
- * positional filters. The canonical command excludes them (§5.1).
48
+ * The adapter that will read this run's capture channel, whether it also gets
49
+ * to instrument the child argv, and the reason to degrade with if no capture
50
+ * ever arrives.
85
51
  *
86
- * `--flag value` pairs for known value-taking flags (see
87
- * {@link VITEST_VALUE_FLAGS}) are folded into a single `--flag=value`
88
- * canonical token so that this form and the pre-joined `--flag=value` form
89
- * produce byte-identical `command` arrays (and thus the same stream key).
52
+ * `adapter: null` is not "do not record": it only means the argv named no
53
+ * runner, so who reads the channel is decided afterwards from the capture
54
+ * itself ({@link claimCapture}). Detection failure is never fatal (INV-5)
55
+ * the child always runs verbatim.
90
56
  */
91
- export function splitCommandSelector(cmd) {
92
- const idx = findVitestToken(cmd);
93
- if (idx === null)
94
- return { command: cmd, selector: [] };
95
- const command = cmd.slice(0, idx + 1);
96
- const selector = [];
97
- for (let i = idx + 1; i < cmd.length; i++) {
98
- const token = cmd[i];
99
- if (token === 'run' && i === idx + 1) {
100
- command.push(token);
101
- continue;
102
- }
103
- if (!token.startsWith('-')) {
104
- selector.push(token);
105
- continue;
106
- }
107
- if (token.includes('=')) {
108
- command.push(token);
109
- continue;
110
- }
111
- const next = cmd[i + 1];
112
- if (VITEST_VALUE_FLAGS.has(token) &&
113
- next !== undefined &&
114
- !next.startsWith('-')) {
115
- command.push(`${token}=${next}`);
116
- i++;
117
- continue;
57
+ function chooseAdapter(cmd, opts) {
58
+ if (opts.adapter !== undefined) {
59
+ // §4.3-4: the explicit name wins over detection for *reading* the channel.
60
+ // Argv injection still requires the adapter to recognize its own argv:
61
+ // `--reporter=…` handed to a child that is not that runner aborts it
62
+ // before it does any work, and INV-5 forbids veridelta making a run worse
63
+ // than its absence. The wrapper case loses nothing either way — §4.3-7
64
+ // already states injected flags cannot reach the runner through a wrapper.
65
+ const adapter = resolveAdapter(opts.adapter);
66
+ return {
67
+ adapter,
68
+ instrumentArgv: adapter.detect(cmd) !== null,
69
+ why: NO_ADAPTER_DIAGNOSTIC,
70
+ };
71
+ }
72
+ const detection = detectAdapter(cmd);
73
+ switch (detection.kind) {
74
+ case 'unique':
75
+ return {
76
+ adapter: detection.adapter,
77
+ instrumentArgv: true,
78
+ why: NO_ADAPTER_DIAGNOSTIC,
79
+ };
80
+ case 'ambiguous': {
81
+ // Registry order must not silently pick a winner (§4.3-2): the
82
+ // candidates are disclosed and the user names one. Nothing is injected
83
+ // into the argv, so any capture that still shows up came from an
84
+ // ambiently configured reporter and identifies its own author.
85
+ const candidates = detection.candidates.map((a) => a.name).join(', ');
86
+ return {
87
+ adapter: null,
88
+ instrumentArgv: false,
89
+ why: `several adapters claim this command (${candidates}) — pick one with --adapter <${adapterNames().join('|')}>`,
90
+ };
118
91
  }
119
- command.push(token);
92
+ case 'none':
93
+ return {
94
+ adapter: null,
95
+ instrumentArgv: false,
96
+ why: NO_ADAPTER_DIAGNOSTIC,
97
+ };
120
98
  }
121
- return { command, selector };
122
99
  }
123
- function runChild(cmd, captureFile) {
100
+ function runChild(cmd, env) {
124
101
  return new Promise((resolve, reject) => {
125
102
  const child = spawn(cmd[0], cmd.slice(1), {
126
- env: { ...process.env, VDELTA_CAPTURE_FILE: captureFile },
103
+ env: { ...process.env, ...env },
127
104
  stdio: ['inherit', 'pipe', 'pipe'],
128
105
  });
129
106
  const out = [];
@@ -156,19 +133,31 @@ function signalNumber(signal) {
156
133
  };
157
134
  return table[signal] ?? 15;
158
135
  }
159
- export async function runAndRecord(cmd, cwd) {
136
+ export async function runAndRecord(cmd, cwd, opts = {}) {
160
137
  const diagnostics = [];
161
- const captureFile = join(tmpdir(), `vdelta-capture-${randomUUID()}.json`);
162
- const vitestIdx = findVitestToken(cmd);
163
- const childCmd = vitestIdx !== null
164
- ? [
165
- ...cmd,
166
- '--reporter=default',
167
- `--reporter=${reporterModulePath()}`,
168
- '--includeTaskLocation',
169
- ]
170
- : cmd;
171
- const child = await runChild(childCmd, captureFile);
138
+ // The channel's creation and teardown stay on the core's side of the seam
139
+ // for now (§4.1): a single capture file is the only kind that exists, so
140
+ // there is nothing to abstract yet. F-2 moves both into the adapter when
141
+ // per-process channels arrive.
142
+ const channel = {
143
+ kind: 'single-file',
144
+ path: join(tmpdir(), `vdelta-capture-${randomUUID()}.json`),
145
+ };
146
+ const { adapter: namedAdapter, instrumentArgv, why: noAdapterReason, } = chooseAdapter(cmd, opts);
147
+ const instrumented = instrumentArgv
148
+ ? namedAdapter?.instrument(cmd, channel)
149
+ : undefined;
150
+ // Every adapter's channel env goes to the child even when none claimed the
151
+ // argv. A reporter registered in the project's own config (spec §4.2 ambient
152
+ // recording, the RECOMMENDED deployment) finds the channel through this and
153
+ // nothing else, so gating it on detection silently severs recording for
154
+ // every wrapper invocation — `vdelta run -- npm test` and friends. Pre-seam
155
+ // this env was set on every child unconditionally; only argv injection was
156
+ // ever conditional.
157
+ const child = await runChild(instrumented?.argv ?? cmd, {
158
+ ...ambientChannelEnv(channel),
159
+ ...instrumented?.env,
160
+ });
172
161
  const degraded = (why) => {
173
162
  diagnostics.push(`vdelta: degraded to raw passthrough (${why})`);
174
163
  return {
@@ -180,21 +169,21 @@ export async function runAndRecord(cmd, cwd) {
180
169
  rawStderr: child.stderr,
181
170
  };
182
171
  };
183
- let capture;
184
- try {
185
- capture = JSON.parse(readFileSync(captureFile, 'utf8'));
186
- }
187
- catch {
188
- return degraded('no capture from the vitest reporter — is the child a vitest invocation?');
189
- }
190
- finally {
191
- rmSync(captureFile, { force: true });
192
- }
193
172
  try {
173
+ // Who reads the channel: the adapter the argv (or `--adapter`) named, or
174
+ // failing that whichever adapter recognizes the capture that actually
175
+ // landed there. The second case is ambient recording (spec §4.2): the
176
+ // reporter came from the project's configuration, so the argv never
177
+ // mentioned a runner but a capture exists all the same. Pre-seam this was
178
+ // implicit — the capture was read unconditionally, before anything looked
179
+ // at the argv — and dropping it would throw away evidence already in hand.
180
+ const adapter = namedAdapter ?? claimCapture(channel);
181
+ if (adapter === null)
182
+ return degraded(noAdapterReason);
194
183
  const worktree = await gitRepoRoot(cwd);
195
184
  if (worktree === null)
196
185
  return degraded('not inside a git worktree');
197
- const { command, selector } = splitCommandSelector(cmd);
186
+ const { command, selector } = adapter.splitCommandSelector(cmd);
198
187
  const ctx = {
199
188
  worktree,
200
189
  repoIdentity: worktree,
@@ -211,7 +200,10 @@ export async function runAndRecord(cmd, cwd) {
211
200
  adapterVersion: VDELTA_VERSION,
212
201
  recordedAtMs: Date.now(),
213
202
  };
214
- const record = buildRunRecord(capture, ctx);
203
+ // Reading, validating and parsing the channel belong to the adapter; an
204
+ // unusable capture arrives here as an AdapterCaptureError and lands in
205
+ // the same degraded passthrough as every other unrecordable state below.
206
+ const record = adapter.record(channel, ctx);
215
207
  const store = new RunStore(worktree);
216
208
  store.ensure();
217
209
  const { reclaimed } = store.acquireLock();
@@ -268,5 +260,8 @@ export async function runAndRecord(cmd, cwd) {
268
260
  }
269
261
  return degraded(err instanceof Error ? err.message : String(err));
270
262
  }
263
+ finally {
264
+ rmSync(channel.path, { force: true });
265
+ }
271
266
  }
272
267
  //# sourceMappingURL=run.js.map
package/dist/run.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,M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,uBAAuB,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CACrE,CAAA;QACH,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,MAAM;YACN,QAAQ,EAAE,KAAK;YACf,WAAW;YACX,SAAS,EAAE,KAAK,CAAC,MAAM;YACvB,SAAS,EAAE,KAAK,CAAC,MAAM;SACxB,CAAA;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,YAAY,aAAa,EAAE,CAAC;YACjC,sEAAsE;YACtE,kEAAkE;YAClE,uEAAuE;YACvE,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAC9B,CAAC;QACD,OAAO,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;IACnE,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;IACvC,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vdelta",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Reference implementation of veridelta/1 — proof-carrying verification deltas for coding-agent development loops",
5
5
  "license": "MIT",
6
6
  "repository": {