@descryy/runtime-controller 0.3.7 → 0.3.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.
Files changed (73) hide show
  1. package/package.json +5 -5
  2. package/dist/attach-fencing.d.ts +0 -109
  3. package/dist/attach-fencing.d.ts.map +0 -1
  4. package/dist/attach-fencing.js +0 -215
  5. package/dist/attach-fencing.js.map +0 -1
  6. package/dist/capability-registry.d.ts +0 -9
  7. package/dist/capability-registry.d.ts.map +0 -1
  8. package/dist/capability-registry.js +0 -32
  9. package/dist/capability-registry.js.map +0 -1
  10. package/dist/collector-version.d.ts +0 -3
  11. package/dist/collector-version.d.ts.map +0 -1
  12. package/dist/collector-version.js +0 -5
  13. package/dist/collector-version.js.map +0 -1
  14. package/dist/container-sandbox.d.ts +0 -104
  15. package/dist/container-sandbox.d.ts.map +0 -1
  16. package/dist/container-sandbox.js +0 -152
  17. package/dist/container-sandbox.js.map +0 -1
  18. package/dist/controller.d.ts +0 -138
  19. package/dist/controller.d.ts.map +0 -1
  20. package/dist/controller.js +0 -449
  21. package/dist/controller.js.map +0 -1
  22. package/dist/dependency-version-check.d.ts +0 -36
  23. package/dist/dependency-version-check.d.ts.map +0 -1
  24. package/dist/dependency-version-check.js +0 -72
  25. package/dist/dependency-version-check.js.map +0 -1
  26. package/dist/env.d.ts +0 -10
  27. package/dist/env.d.ts.map +0 -1
  28. package/dist/env.js +0 -12
  29. package/dist/env.js.map +0 -1
  30. package/dist/environment-metadata.d.ts +0 -15
  31. package/dist/environment-metadata.d.ts.map +0 -1
  32. package/dist/environment-metadata.js +0 -63
  33. package/dist/environment-metadata.js.map +0 -1
  34. package/dist/environment-version-check.d.ts +0 -40
  35. package/dist/environment-version-check.d.ts.map +0 -1
  36. package/dist/environment-version-check.js +0 -176
  37. package/dist/environment-version-check.js.map +0 -1
  38. package/dist/execution-safety.d.ts +0 -96
  39. package/dist/execution-safety.d.ts.map +0 -1
  40. package/dist/execution-safety.js +0 -140
  41. package/dist/execution-safety.js.map +0 -1
  42. package/dist/index.d.ts +0 -31
  43. package/dist/index.d.ts.map +0 -1
  44. package/dist/index.js +0 -17
  45. package/dist/index.js.map +0 -1
  46. package/dist/orchestration.d.ts +0 -55
  47. package/dist/orchestration.d.ts.map +0 -1
  48. package/dist/orchestration.js +0 -219
  49. package/dist/orchestration.js.map +0 -1
  50. package/dist/preflight.d.ts +0 -121
  51. package/dist/preflight.d.ts.map +0 -1
  52. package/dist/preflight.js +0 -163
  53. package/dist/preflight.js.map +0 -1
  54. package/dist/process-collector.d.ts +0 -20
  55. package/dist/process-collector.d.ts.map +0 -1
  56. package/dist/process-collector.js +0 -116
  57. package/dist/process-collector.js.map +0 -1
  58. package/dist/process-identity.d.ts +0 -46
  59. package/dist/process-identity.d.ts.map +0 -1
  60. package/dist/process-identity.js +0 -186
  61. package/dist/process-identity.js.map +0 -1
  62. package/dist/process-manager.d.ts +0 -137
  63. package/dist/process-manager.d.ts.map +0 -1
  64. package/dist/process-manager.js +0 -365
  65. package/dist/process-manager.js.map +0 -1
  66. package/dist/readiness.d.ts +0 -122
  67. package/dist/readiness.d.ts.map +0 -1
  68. package/dist/readiness.js +0 -214
  69. package/dist/readiness.js.map +0 -1
  70. package/dist/sandbox.d.ts +0 -94
  71. package/dist/sandbox.d.ts.map +0 -1
  72. package/dist/sandbox.js +0 -228
  73. package/dist/sandbox.js.map +0 -1
@@ -1,449 +0,0 @@
1
- /**
2
- * Runtime controller (§4/§5/§6/§45 "Core"). Owns Execution lifecycle, spawns every
3
- * configured service, waits for each one's real readiness (never "process exists"),
4
- * guarantees cleanup on partial/total failure and timeout. Knows nothing about any
5
- * specific language or framework (principle 8).
6
- */
7
- import { randomUUID } from "node:crypto";
8
- import { isTerminalExecutionState, isValidExecutionTransition, } from "@descryy/runtime-contracts";
9
- import { spawnProcess, attachManagedProcess, allocateEphemeralPort } from "./process-manager.js";
10
- import { awaitReadiness, createProcessOutputReader } from "./readiness.js";
11
- import { withDefaultProcessEnv } from "./env.js";
12
- import { validateServicesConfiguration, substitutePortPlaceholders, tokenizeCommand } from "./orchestration.js";
13
- import { resourceLimitCapability, networkPolicyCapability } from "./execution-safety.js";
14
- import { filesystemIsolationCapability, unsupportedNetworkPolicyReason } from "./sandbox.js";
15
- import { containerFilesystemIsolationCapability, containerNetworkIsolationCapability, unsupportedContainerNetworkPolicyReason, } from "./container-sandbox.js";
16
- import { captureEnvironmentMetadata } from "./environment-metadata.js";
17
- /**
18
- * RT-024: binds every `tcp-port`/`http` check this controller runs to the
19
- * pid of the process it just spawned or attached to, unless the caller
20
- * already declared one. Applied automatically so a caller does not have to
21
- * opt in per check to get the stronger guarantee — see `readiness.ts`'s
22
- * `identityCheckedConnection` for what happens with it.
23
- *
24
- * **Not applied for `sandboxBackend: "container"`.** A published Docker port
25
- * is commonly fronted by a host-side `docker-proxy` process, not the pid
26
- * this function would bind to — auto-injecting there would produce a false
27
- * `"mismatch"` refusal against a perfectly healthy container. Disclosed as
28
- * `identity: "unverified"` for that backend instead of a wrong verdict.
29
- */
30
- function bindChecksToProcessIdentity(checks, pid, sandboxBackend) {
31
- if (pid === null || sandboxBackend === "container")
32
- return checks;
33
- return checks.map((check) => {
34
- if ((check.kind === "tcp-port" || check.kind === "http") && check.expectedPid === undefined) {
35
- return { ...check, expectedPid: pid };
36
- }
37
- return check;
38
- });
39
- }
40
- // `run()`'s timeout timer and a caller's stop()/cancel() can race to move a
41
- // finishing execution to a terminal state. Every transition after an `await` uses
42
- // `#tryTransition` (returns false) rather than the throwing `#transition`, so the
43
- // losing path degrades to a no-op instead of an unhandled rejection.
44
- export class ExecutionController {
45
- #execution;
46
- #processes = new Map();
47
- #timeoutHandle = null;
48
- #serviceStartResults = [];
49
- #validationError = null;
50
- constructor(execution) {
51
- this.#execution = execution;
52
- }
53
- static create(input) {
54
- const execution = {
55
- executionId: randomUUID(),
56
- application: input.application,
57
- repository: input.repository,
58
- commit: input.commit,
59
- environmentMetadata: null,
60
- configuration: input.configuration,
61
- state: "CREATED",
62
- startedAt: null,
63
- endedAt: null,
64
- processes: [],
65
- browserSessions: [],
66
- eventIds: [],
67
- traceIds: [],
68
- failureIds: [],
69
- correlationIds: [],
70
- findingIds: [],
71
- };
72
- return new ExecutionController(execution);
73
- }
74
- get execution() {
75
- return this.#execution;
76
- }
77
- /** One entry per configured service, in spawn order, including never-attempted ones (`stage: "not-attempted"`). Empty until `run()` returns its first result. */
78
- get serviceStartResults() {
79
- return this.#serviceStartResults;
80
- }
81
- /** Non-null only when `run()` refused before spawning anything. */
82
- get validationError() {
83
- return this.#validationError;
84
- }
85
- /** Combined stdout+stderr of the named service's process so far, or "" if it was never spawned. */
86
- readProcessOutput(serviceName) {
87
- return this.#processes.get(serviceName)?.readOutput() ?? "";
88
- }
89
- #transition(to) {
90
- if (!isValidExecutionTransition(this.#execution.state, to)) {
91
- throw new Error(`invalid execution transition: ${this.#execution.state} -> ${to}`);
92
- }
93
- this.#execution = { ...this.#execution, state: to };
94
- }
95
- #tryTransition(to) {
96
- if (!isValidExecutionTransition(this.#execution.state, to)) {
97
- return false;
98
- }
99
- this.#transition(to);
100
- return true;
101
- }
102
- #recordProcesses() {
103
- const handles = [];
104
- for (const managed of this.#processes.values()) {
105
- handles.push(managed.handle());
106
- }
107
- this.#execution = { ...this.#execution, processes: handles };
108
- }
109
- /**
110
- * Starts every service in dependency order, spawned (each on its own ephemeral
111
- * port unless fixed) or attached (`service.attach`, for an already-running
112
- * pid/log file). Reaches RUNNING only if every service starts and reaches
113
- * readiness. On first failure, every started service is killed in reverse order
114
- * (no-op for attached ones) and remaining services are recorded "not-attempted" --
115
- * `serviceStartResults` always distinguishes "never tried" from "tried and failed".
116
- *
117
- * Configuration is validated atomically first -- a bad `dependsOn`, a cycle, an
118
- * undeclared placeholder, ambiguous `command`/`attach`, or a missing readiness
119
- * entry refuses before anything spawns.
120
- *
121
- * Every **spawned** service gets `PORT` (its resolved port) unconditionally --
122
- * load-bearing (matches the fixture apps), not incidental: a command reading its
123
- * port from anywhere else won't be reachable via readiness checks built from the
124
- * same `port`. An **attached** service gets no env/port allocation -- it's already
125
- * running on whatever it bound at launch.
126
- */
127
- async run(options) {
128
- this.#transition("STARTING");
129
- this.#armTimeout();
130
- const services = this.#execution.configuration.services;
131
- const validation = validateServicesConfiguration(services);
132
- if (!validation.valid) {
133
- return this.#refuseToStart(validation.reason, Object.keys(services));
134
- }
135
- // §21/RT-070: refuse atomically before spawning, same discipline as
136
- // tokenizeCommand -- finding out only when spawnProcess() throws would mean
137
- // earlier services are already running by the time of refusal.
138
- const resourceLimits = this.#execution.configuration.resourceLimits;
139
- if (resourceLimits !== undefined) {
140
- const capability = resourceLimitCapability();
141
- if (capability.availability !== "available") {
142
- return this.#refuseToStart(`resourceLimits was configured but cannot be enforced on this platform: ${capability.reason}`, Object.keys(services));
143
- }
144
- }
145
- // Which real mechanism backs filesystemPolicy/networkPolicy -- absent means "bwrap".
146
- const sandboxBackend = this.#execution.configuration.sandboxBackend ?? "bwrap";
147
- // RT-193, same atomic-refusal placement. networkPolicyCapability() is real on
148
- // Linux (bwrap network namespace), unavailable on macOS/Windows, and only
149
- // implements full denial even where it exists -- both refused here before
150
- // spawning. "container" checks the container mechanism's own functions instead.
151
- const networkPolicy = this.#execution.configuration.networkPolicy;
152
- if (networkPolicy !== undefined) {
153
- const shapeReason = sandboxBackend === "container" ? unsupportedContainerNetworkPolicyReason(networkPolicy) : unsupportedNetworkPolicyReason(networkPolicy);
154
- if (shapeReason !== null) {
155
- return this.#refuseToStart(`networkPolicy was configured but cannot be enforced: ${shapeReason}`, Object.keys(services));
156
- }
157
- const capability = sandboxBackend === "container" ? containerNetworkIsolationCapability() : networkPolicyCapability();
158
- if (capability.availability !== "available") {
159
- return this.#refuseToStart(`networkPolicy was configured but cannot be enforced on this platform: ${capability.reason}`, Object.keys(services));
160
- }
161
- }
162
- // Filesystem half, same atomic-refusal placement -- real on Linux via bwrap's
163
- // mount namespace, refused where it doesn't exist. "container" checks Docker's
164
- // own capability instead.
165
- const filesystemPolicy = this.#execution.configuration.filesystemPolicy;
166
- if (filesystemPolicy !== undefined) {
167
- const capability = sandboxBackend === "container" ? containerFilesystemIsolationCapability() : filesystemIsolationCapability();
168
- if (capability.availability !== "available") {
169
- return this.#refuseToStart(`filesystemPolicy was configured but cannot be enforced on this platform: ${capability.reason}`, Object.keys(services));
170
- }
171
- }
172
- for (const name of validation.order) {
173
- if (options.readiness[name] === undefined) {
174
- return this.#refuseToStart(`service "${name}" has no matching RunOptions.readiness entry`, validation.order);
175
- }
176
- }
177
- // RT-193: captured once spawning is committed, from the real host.
178
- const environmentMetadata = await captureEnvironmentMetadata(services);
179
- this.#execution = { ...this.#execution, startedAt: new Date().toISOString(), environmentMetadata };
180
- const resolvedPorts = new Map();
181
- for (let i = 0; i < validation.order.length; i++) {
182
- const name = validation.order[i];
183
- if (name === undefined)
184
- continue;
185
- if (isTerminalExecutionState(this.#execution.state)) {
186
- // A concurrent timeout/stop/cancel already finished this execution.
187
- return this.#execution;
188
- }
189
- const service = services[name];
190
- if (service === undefined)
191
- continue;
192
- const readinessSpec = options.readiness[name];
193
- if (readinessSpec === undefined)
194
- continue;
195
- let managed;
196
- let port;
197
- if (service.attach !== undefined) {
198
- // Attach mode: the target is already running and bound to whatever it
199
- // bound at launch -- nothing here can allocate a port for it, only record
200
- // the one the caller already knows. `0` when unsupplied, so a readiness
201
- // check needing a port fails legibly ("nothing answered") rather than
202
- // this function inventing an ephemeral port unrelated to the real target.
203
- // resourceLimits/filesystemPolicy/networkPolicy/sandboxBackend never pass
204
- // through -- they can't apply to a process this runtime didn't spawn.
205
- port = service.port ?? 0;
206
- try {
207
- managed = attachManagedProcess({
208
- processId: randomUUID(),
209
- attach: service.attach,
210
- serviceName: name,
211
- ...(service.port === undefined ? {} : { port: service.port }),
212
- });
213
- }
214
- catch (err) {
215
- this.#serviceStartResults.push({
216
- serviceName: name,
217
- stage: "spawn",
218
- succeeded: false,
219
- readiness: null,
220
- error: err instanceof Error ? err.message : String(err),
221
- });
222
- this.#markRemainingNotAttempted(validation.order, i + 1);
223
- this.#tryTransition("FAILED_START");
224
- await this.#cleanup();
225
- this.#finish();
226
- throw err;
227
- }
228
- }
229
- else {
230
- port = service.port ?? (await allocateEphemeralPort());
231
- const env = withDefaultProcessEnv({
232
- PORT: String(port),
233
- ...substitutePortPlaceholders(service.env, resolvedPorts),
234
- });
235
- // validateServicesConfiguration already proved this, so both branches
236
- // below are unreachable in practice -- kept over a non-null assertion
237
- // that would crash for real if the two ever drift apart.
238
- if (service.command === undefined) {
239
- return this.#refuseToStart(`service "${name}": neither "command" nor "attach" is set`, validation.order);
240
- }
241
- const tokenized = tokenizeCommand(service.command);
242
- if (!tokenized.ok) {
243
- return this.#refuseToStart(`service "${name}": ${tokenized.reason}`, validation.order);
244
- }
245
- const { command, args } = tokenized;
246
- // Instrumentation flags (`--import <preload>`) go through NODE_OPTIONS, not
247
- // spliced into the spawned command's own argv. `command` is a raw
248
- // user-supplied token (`tokenizeCommand`'s output) with no proof it is
249
- // literally `node` -- it may be a shebang-wrapped CLI ("next", "vite")
250
- // that the kernel resolves to `node <script>` transparently, in which case
251
- // anything appended to `args` lands in THAT CLI's own argv, not Node's.
252
- // Frameworks fronted by a strict argv parser (cac, used by next/vite) then
253
- // refuse to start. NODE_OPTIONS is consumed by Node itself before the
254
- // target ever sees `process.argv`, so it works whether `command` is `node`,
255
- // a shebang script, or anything else -- and appends to (never clobbers) any
256
- // NODE_OPTIONS the caller already declared, in `env` or inherited from this
257
- // process's own environment.
258
- if (service.interpreterArgs !== undefined && service.interpreterArgs.length > 0) {
259
- const existing = env.NODE_OPTIONS ?? process.env.NODE_OPTIONS;
260
- const addition = service.interpreterArgs.join(" ");
261
- env.NODE_OPTIONS = existing === undefined || existing === "" ? addition : `${existing} ${addition}`;
262
- }
263
- try {
264
- managed = spawnProcess({
265
- processId: randomUUID(),
266
- command,
267
- args,
268
- cwd: service.cwd,
269
- env,
270
- serviceName: name,
271
- port,
272
- ...(resourceLimits === undefined ? {} : { resourceLimits }),
273
- ...(filesystemPolicy === undefined ? {} : { filesystemPolicy }),
274
- ...(networkPolicy === undefined ? {} : { networkPolicy }),
275
- ...(sandboxBackend === "bwrap" ? {} : { sandboxBackend }),
276
- });
277
- }
278
- catch (err) {
279
- this.#serviceStartResults.push({
280
- serviceName: name,
281
- stage: "spawn",
282
- succeeded: false,
283
- readiness: null,
284
- error: err instanceof Error ? err.message : String(err),
285
- });
286
- this.#markRemainingNotAttempted(validation.order, i + 1);
287
- this.#tryTransition("FAILED_START");
288
- await this.#cleanup();
289
- this.#finish();
290
- throw err;
291
- }
292
- }
293
- this.#processes.set(name, managed);
294
- resolvedPorts.set(name, port);
295
- this.#recordProcesses();
296
- options.onProcessLifecycleEvent?.({ kind: "process-started", serviceName: name, handle: managed.handle() });
297
- // Read by the exit watcher below -- true only once readiness succeeded, which
298
- // lets `phase` distinguish "died before confirmed up" from "died after running".
299
- let reachedReady = false;
300
- // Fire-and-forget: exit can happen long after run() returns (a later crash, or
301
- // #cleanup()'s reap) -- must not be awaited inline, which would block every
302
- // later service in validation.order on this one's exit.
303
- void managed.waitForExit().then(() => {
304
- options.onProcessLifecycleEvent?.({
305
- kind: "process-exited",
306
- serviceName: name,
307
- handle: managed.handle(),
308
- phase: reachedReady ? "running" : "starting",
309
- });
310
- });
311
- const outputReader = createProcessOutputReader(() => managed.readOutput());
312
- const declaredChecks = readinessSpec.checks({ port, outputReader });
313
- const identityBoundChecks = bindChecksToProcessIdentity(declaredChecks, managed.handle().pid, sandboxBackend);
314
- const readinessResult = await awaitReadiness(identityBoundChecks, {
315
- timeoutMs: readinessSpec.timeoutMs,
316
- });
317
- if (readinessResult.ready)
318
- reachedReady = true;
319
- this.#serviceStartResults.push({
320
- serviceName: name,
321
- stage: "readiness",
322
- succeeded: readinessResult.ready,
323
- readiness: readinessResult,
324
- error: null,
325
- });
326
- options.onProcessLifecycleEvent?.({
327
- kind: readinessResult.ready ? "process-ready" : "process-ready-failed",
328
- serviceName: name,
329
- handle: managed.handle(),
330
- readiness: readinessResult,
331
- });
332
- if (isTerminalExecutionState(this.#execution.state)) {
333
- return this.#execution;
334
- }
335
- if (!readinessResult.ready) {
336
- this.#markRemainingNotAttempted(validation.order, i + 1);
337
- if (this.#tryTransition("FAILED_START")) {
338
- await this.#cleanup();
339
- }
340
- return this.#finish();
341
- }
342
- }
343
- if (this.#tryTransition("READY")) {
344
- this.#tryTransition("RUNNING");
345
- }
346
- return this.#execution;
347
- }
348
- #refuseToStart(reason, allServiceNames) {
349
- this.#validationError = reason;
350
- this.#serviceStartResults = allServiceNames.map((serviceName) => ({
351
- serviceName,
352
- stage: "not-attempted",
353
- succeeded: false,
354
- readiness: null,
355
- error: null,
356
- }));
357
- this.#tryTransition("FAILED_START");
358
- return this.#finish();
359
- }
360
- #markRemainingNotAttempted(order, fromIndex) {
361
- for (let i = fromIndex; i < order.length; i++) {
362
- const serviceName = order[i];
363
- if (serviceName === undefined)
364
- continue;
365
- this.#serviceStartResults.push({
366
- serviceName,
367
- stage: "not-attempted",
368
- succeeded: false,
369
- readiness: null,
370
- error: null,
371
- });
372
- }
373
- }
374
- async stop() {
375
- if (isTerminalExecutionState(this.#execution.state) || this.#execution.state === "STOPPING") {
376
- return this.#execution;
377
- }
378
- if (this.#tryTransition("STOPPING")) {
379
- await this.#cleanup();
380
- this.#tryTransition("COMPLETED");
381
- }
382
- return this.#finish();
383
- }
384
- /**
385
- * Stop everything and record `TIMED_OUT` -- same transition `#onTimeout` makes,
386
- * for a caller that knows the budget expired before the internal timer noticed.
387
- *
388
- * **Why not `stop()`:** the orchestrator clamps its observation window to
389
- * whatever's left of `timeoutMs`, making `TIMED_OUT` a race between `#onTimeout`
390
- * and `stop()` at the deadline -- measured: the same case reported `TIMED_OUT` at
391
- * 1534ms and `COMPLETED` at 1515ms. `execution.state` is what `observe_runtime`
392
- * reads to choose `ok` vs `timed_out`, so losing that race silently hides a real
393
- * cutoff. A caller that already decided it truncated the run shouldn't have to
394
- * win a race to report it.
395
- *
396
- * Idempotent and terminal-safe like `cancel()`: if the timer fired first, returns
397
- * the execution it already finished.
398
- */
399
- async timeout() {
400
- if (isTerminalExecutionState(this.#execution.state) || this.#execution.state === "STOPPING") {
401
- return this.#execution;
402
- }
403
- await this.#cleanup();
404
- this.#tryTransition("TIMED_OUT");
405
- return this.#finish();
406
- }
407
- async cancel() {
408
- if (isTerminalExecutionState(this.#execution.state) || this.#execution.state === "STOPPING") {
409
- return this.#execution;
410
- }
411
- await this.#cleanup();
412
- this.#tryTransition("CANCELLED");
413
- return this.#finish();
414
- }
415
- #armTimeout() {
416
- this.#timeoutHandle = setTimeout(() => {
417
- void this.#onTimeout();
418
- }, this.#execution.configuration.timeoutMs);
419
- }
420
- async #onTimeout() {
421
- if (isTerminalExecutionState(this.#execution.state)) {
422
- return;
423
- }
424
- await this.#cleanup();
425
- this.#tryTransition("TIMED_OUT");
426
- this.#finish();
427
- }
428
- /** Kills every spawned service in reverse start order — last up, first down. */
429
- async #cleanup() {
430
- if (this.#timeoutHandle !== null) {
431
- clearTimeout(this.#timeoutHandle);
432
- this.#timeoutHandle = null;
433
- }
434
- const managed = [...this.#processes.values()].reverse();
435
- for (const proc of managed) {
436
- await proc.kill();
437
- }
438
- if (managed.length > 0) {
439
- this.#recordProcesses();
440
- }
441
- }
442
- #finish() {
443
- if (this.#execution.endedAt === null) {
444
- this.#execution = { ...this.#execution, endedAt: new Date().toISOString() };
445
- }
446
- return this.#execution;
447
- }
448
- }
449
- //# sourceMappingURL=controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"controller.js","sourceRoot":"","sources":["../src/controller.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,GAI3B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,qBAAqB,E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CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACpD,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QACtB,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC;IAED,gFAAgF;IAChF,KAAK,CAAC,QAAQ;QACZ,IAAI,IAAI,CAAC,cAAc,KAAK,IAAI,EAAE,CAAC;YACjC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;QAC7B,CAAC;QACD,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;QACxD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAC3B,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO;QACL,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,UAAU,GAAG,EAAE,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC;QAC9E,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;CACF"}
@@ -1,36 +0,0 @@
1
- /**
2
- * `DEC-NEXT-fault-layer-empirical-confirmation.md`'s `dependency` mechanism: declared
3
- * (lockfile) vs resolved (installed) version — a structural fact, recorded not inferred.
4
- *
5
- * - Node-only, checked not assumed: no existing lockfile reader for any language to
6
- * match. A Python/Ruby target is a real, disclosed gap — an additive second reader,
7
- * not a rewrite.
8
- * - Only `lockfileVersion` 2/3's flat `packages` map (keyed by `node_modules/<name>`,
9
- * confirmed against `fixture-apps/broken-invoices-backend`). v1's `dependencies`
10
- * shape is not read — `applicable: false`, disclosed gap.
11
- * - "Resolved" is a direct read from the lockfile key's path, not Node module
12
- * resolution — the key already encodes install location, including nested
13
- * transitives (`node_modules/a/node_modules/b`).
14
- * - Direct dependencies only (`dependencies`/`devDependencies`), not every transitive
15
- * lockfile entry — matches the ruling's "cheap, always available" bar.
16
- */
17
- export interface DependencyVersionMismatch {
18
- readonly name: string;
19
- /** The version `package-lock.json` pins this package to. */
20
- readonly declaredVersion: string;
21
- /** The version actually found in `node_modules/<name>/package.json` on disk. */
22
- readonly resolvedVersion: string;
23
- }
24
- export interface DependencyVersionCheckResult {
25
- /** `false` when not identifiable as a checkable Node target (no package.json/lockfile, unsupported shape, malformed JSON) — "not applicable", not a guessed clean result. `mismatches` is `[]` when `false`. */
26
- readonly applicable: boolean;
27
- readonly mismatches: readonly DependencyVersionMismatch[];
28
- }
29
- /**
30
- * Compares lockfile-declared vs installed version for every direct dependency of the
31
- * Node project rooted at `cwd`. A dependency missing from the lockfile (workspace/
32
- * local-link) or from `node_modules` (never installed) is skipped, not reported —
33
- * different facts from a mismatch, not guessed as one.
34
- */
35
- export declare function checkDependencyVersions(cwd: string): DependencyVersionCheckResult;
36
- //# sourceMappingURL=dependency-version-check.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependency-version-check.d.ts","sourceRoot":"","sources":["../src/dependency-version-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,gFAAgF;IAChF,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC3C,gNAAgN;IAChN,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,SAAS,yBAAyB,EAAE,CAAC;CAC3D;AAuBD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,4BAA4B,CA4CjF"}
@@ -1,72 +0,0 @@
1
- /**
2
- * `DEC-NEXT-fault-layer-empirical-confirmation.md`'s `dependency` mechanism: declared
3
- * (lockfile) vs resolved (installed) version — a structural fact, recorded not inferred.
4
- *
5
- * - Node-only, checked not assumed: no existing lockfile reader for any language to
6
- * match. A Python/Ruby target is a real, disclosed gap — an additive second reader,
7
- * not a rewrite.
8
- * - Only `lockfileVersion` 2/3's flat `packages` map (keyed by `node_modules/<name>`,
9
- * confirmed against `fixture-apps/broken-invoices-backend`). v1's `dependencies`
10
- * shape is not read — `applicable: false`, disclosed gap.
11
- * - "Resolved" is a direct read from the lockfile key's path, not Node module
12
- * resolution — the key already encodes install location, including nested
13
- * transitives (`node_modules/a/node_modules/b`).
14
- * - Direct dependencies only (`dependencies`/`devDependencies`), not every transitive
15
- * lockfile entry — matches the ruling's "cheap, always available" bar.
16
- */
17
- import { existsSync, readFileSync } from "node:fs";
18
- import { join } from "node:path";
19
- function readJsonFile(path) {
20
- try {
21
- return JSON.parse(readFileSync(path, "utf8"));
22
- }
23
- catch {
24
- return null;
25
- }
26
- }
27
- /**
28
- * Compares lockfile-declared vs installed version for every direct dependency of the
29
- * Node project rooted at `cwd`. A dependency missing from the lockfile (workspace/
30
- * local-link) or from `node_modules` (never installed) is skipped, not reported —
31
- * different facts from a mismatch, not guessed as one.
32
- */
33
- export function checkDependencyVersions(cwd) {
34
- const packageJsonPath = join(cwd, "package.json");
35
- const lockfilePath = join(cwd, "package-lock.json");
36
- if (!existsSync(packageJsonPath) || !existsSync(lockfilePath)) {
37
- return { applicable: false, mismatches: [] };
38
- }
39
- const packageJson = readJsonFile(packageJsonPath);
40
- const lockfile = readJsonFile(lockfilePath);
41
- if (packageJson === null || lockfile === null) {
42
- return { applicable: false, mismatches: [] };
43
- }
44
- const packages = lockfile.packages;
45
- if (packages === undefined || typeof packages !== "object") {
46
- // lockfileVersion 1, or an unrecognized shape -- see header.
47
- return { applicable: false, mismatches: [] };
48
- }
49
- const declaredNames = new Set([
50
- ...Object.keys(packageJson.dependencies ?? {}),
51
- ...Object.keys(packageJson.devDependencies ?? {}),
52
- ]);
53
- const mismatches = [];
54
- for (const name of declaredNames) {
55
- const lockEntry = packages[`node_modules/${name}`];
56
- const declaredVersion = lockEntry?.version;
57
- if (typeof declaredVersion !== "string")
58
- continue;
59
- const installedPackageJsonPath = join(cwd, "node_modules", name, "package.json");
60
- if (!existsSync(installedPackageJsonPath))
61
- continue;
62
- const installedPackageJson = readJsonFile(installedPackageJsonPath);
63
- const resolvedVersion = installedPackageJson?.version;
64
- if (typeof resolvedVersion !== "string")
65
- continue;
66
- if (resolvedVersion !== declaredVersion) {
67
- mismatches.push({ name, declaredVersion, resolvedVersion });
68
- }
69
- }
70
- return { applicable: true, mismatches };
71
- }
72
- //# sourceMappingURL=dependency-version-check.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependency-version-check.js","sourceRoot":"","sources":["../src/dependency-version-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AA6BjC,SAAS,YAAY,CAAI,IAAY;IACnC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAM,CAAC;IACrD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAW;IACjD,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CA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AG,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;QACjF,IAAI,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAAE,SAAS;QAEpD,MAAM,oBAAoB,GAAG,YAAY,CAAgC,wBAAwB,CAAC,CAAC;QACnG,MAAM,eAAe,GAAG,oBAAoB,EAAE,OAAO,CAAC;QACtD,IAAI,OAAO,eAAe,KAAK,QAAQ;YAAE,SAAS;QAElD,IAAI,eAAe,KAAK,eAAe,EAAE,CAAC;YACxC,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;AAC1C,CAAC"}
package/dist/env.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Default environment applied to every spawned process, on top of the caller's own.
3
- *
4
- * RUST_BACKTRACE=1 (§17): without it a Rust panic prints only a message, hiding the
5
- * trace — a collector-absence-masquerading-as-success case, not a caller-remembers-it case.
6
- *
7
- * Never overrides a key the caller already set.
8
- */
9
- export declare function withDefaultProcessEnv(env: Readonly<Record<string, string | undefined>>): Record<string, string | undefined>;
10
- //# sourceMappingURL=env.d.ts.map
package/dist/env.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAEpC"}
package/dist/env.js DELETED
@@ -1,12 +0,0 @@
1
- /**
2
- * Default environment applied to every spawned process, on top of the caller's own.
3
- *
4
- * RUST_BACKTRACE=1 (§17): without it a Rust panic prints only a message, hiding the
5
- * trace — a collector-absence-masquerading-as-success case, not a caller-remembers-it case.
6
- *
7
- * Never overrides a key the caller already set.
8
- */
9
- export function withDefaultProcessEnv(env) {
10
- return { RUST_BACKTRACE: "1", ...env };
11
- }
12
- //# sourceMappingURL=env.js.map
package/dist/env.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../src/env.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CACnC,GAAiD;IAEjD,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;AACzC,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * §2/RT-193: `Execution.commit` alone can't reproduce a run — same commit, different
3
- * Node/OS/toolchain can behave differently. Fills the gap from the real host: OS
4
- * platform, this process's own `process.version`, and the version of every distinct
5
- * executable `configuration.services` invokes.
6
- *
7
- * Toolchain probe mirrors `scripts/preflight.mjs`'s `interpreters()` (version flag,
8
- * read stdout+stderr combined since some tools like `java -version` write to stderr
9
- * only, keep first line) but isn't the same function: that one checks a fixed tool
10
- * list against expected versions (a gate); this reports whatever `services[*].command`
11
- * names, no expected version to compare against.
12
- */
13
- import type { EnvironmentMetadata, ServiceConfiguration } from "@descryy/runtime-contracts";
14
- export declare function captureEnvironmentMetadata(services: Readonly<Record<string, ServiceConfiguration>>): Promise<EnvironmentMetadata>;
15
- //# sourceMappingURL=environment-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"environment-metadata.d.ts","sourceRoot":"","sources":["../src/environment-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAM5F,wBAAsB,0BAA0B,CAC9C,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAAC,GACvD,OAAO,CAAC,mBAAmB,CAAC,CAmB9B"}