eutaxy 0.18.0 → 0.19.1

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 (75) hide show
  1. package/README.md +15 -12
  2. package/dist/aws.d.mts +3 -3
  3. package/dist/aws.d.mts.map +1 -1
  4. package/dist/aws.mjs +13 -4
  5. package/dist/aws.mjs.map +1 -1
  6. package/dist/bin.mjs +1 -1
  7. package/dist/check-zkHLdWyf.mjs +1281 -0
  8. package/dist/check-zkHLdWyf.mjs.map +1 -0
  9. package/dist/cli-Bxjvq4p9.mjs +297 -0
  10. package/dist/cli-Bxjvq4p9.mjs.map +1 -0
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +1 -1
  13. package/dist/cloudflare.d.mts +38 -6
  14. package/dist/cloudflare.d.mts.map +1 -1
  15. package/dist/cloudflare.mjs +6466 -3
  16. package/dist/cloudflare.mjs.map +1 -0
  17. package/dist/{delivery-invariants-D-_GPOqE.d.mts → delivery-invariants-C3GXJIbg.d.mts} +2 -2
  18. package/dist/{delivery-invariants-D-_GPOqE.d.mts.map → delivery-invariants-C3GXJIbg.d.mts.map} +1 -1
  19. package/dist/{delivery-invariants-BRwfZJrs.mjs → delivery-invariants-DsBHpT1n.mjs} +2 -2
  20. package/dist/{delivery-invariants-BRwfZJrs.mjs.map → delivery-invariants-DsBHpT1n.mjs.map} +1 -1
  21. package/dist/draft-DEUDffHa.mjs +467 -0
  22. package/dist/draft-DEUDffHa.mjs.map +1 -0
  23. package/dist/{src-H1Q8ytEx.mjs → generate-TBJM3-2P.mjs} +3 -618
  24. package/dist/generate-TBJM3-2P.mjs.map +1 -0
  25. package/dist/index.d.mts +36 -36
  26. package/dist/index.d.mts.map +1 -1
  27. package/dist/index.mjs +6 -3
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/install-DkzpGA5D.mjs +611 -0
  30. package/dist/install-DkzpGA5D.mjs.map +1 -0
  31. package/dist/{explore-D33RP9hF.d.mts → ir-KpC2epGn.d.mts} +70 -70
  32. package/dist/ir-KpC2epGn.d.mts.map +1 -0
  33. package/dist/keys-xtanNmuR.mjs +111 -0
  34. package/dist/keys-xtanNmuR.mjs.map +1 -0
  35. package/dist/mcp-DEn3HnLz.mjs +539 -0
  36. package/dist/mcp-DEn3HnLz.mjs.map +1 -0
  37. package/dist/{platform-CawKCUru.d.mts → platform-Cs9V9t2k.d.mts} +25 -11
  38. package/dist/platform-Cs9V9t2k.d.mts.map +1 -0
  39. package/dist/pool-CXN4CwGY.mjs +61 -0
  40. package/dist/pool-CXN4CwGY.mjs.map +1 -0
  41. package/dist/{provers-DS44OeEm.mjs → provers-D8VaY_OM.mjs} +18 -2
  42. package/dist/provers-D8VaY_OM.mjs.map +1 -0
  43. package/dist/reader-B9FSoEYW.mjs +1 -0
  44. package/dist/reader-Cz6_bLf6.mjs +3774 -0
  45. package/dist/reader-Cz6_bLf6.mjs.map +1 -0
  46. package/dist/report-_Vzavqg0.mjs +310 -0
  47. package/dist/report-_Vzavqg0.mjs.map +1 -0
  48. package/dist/src-B2DpVbMN.mjs +2 -0
  49. package/dist/src-BFGTvuA_.mjs +1235 -0
  50. package/dist/src-BFGTvuA_.mjs.map +1 -0
  51. package/dist/src-BtLZPRyG.mjs +120 -0
  52. package/dist/src-BtLZPRyG.mjs.map +1 -0
  53. package/dist/src-CB8DcvsK.mjs +1 -0
  54. package/dist/src-COuquJvI.mjs +269 -0
  55. package/dist/src-COuquJvI.mjs.map +1 -0
  56. package/dist/src-Chn-m_r1.mjs +1082 -0
  57. package/dist/src-Chn-m_r1.mjs.map +1 -0
  58. package/dist/{src-Whn0RMSh.mjs → src-D-MeEFn3.mjs} +589 -517
  59. package/dist/src-D-MeEFn3.mjs.map +1 -0
  60. package/dist/src-DwYD3QQJ.mjs +346 -0
  61. package/dist/src-DwYD3QQJ.mjs.map +1 -0
  62. package/dist/toolchain-DWfymxAJ.mjs +80 -0
  63. package/dist/toolchain-DWfymxAJ.mjs.map +1 -0
  64. package/dist/verdict-evEM5Gxx.mjs +12 -0
  65. package/dist/verdict-evEM5Gxx.mjs.map +1 -0
  66. package/package.json +4 -1
  67. package/dist/cli-DyA7uTBg.mjs +0 -9447
  68. package/dist/cli-DyA7uTBg.mjs.map +0 -1
  69. package/dist/explore-D33RP9hF.d.mts.map +0 -1
  70. package/dist/platform-CawKCUru.d.mts.map +0 -1
  71. package/dist/provers-DS44OeEm.mjs.map +0 -1
  72. package/dist/src-H1Q8ytEx.mjs.map +0 -1
  73. package/dist/src-Whn0RMSh.mjs.map +0 -1
  74. package/dist/workerd-tI8INa6v.mjs +0 -6334
  75. package/dist/workerd-tI8INa6v.mjs.map +0 -1
@@ -0,0 +1,346 @@
1
+ import { i as seedPrng } from "./src-BtLZPRyG.mjs";
2
+ import { n as isSpec } from "./combinators-CLfsPfhT.mjs";
3
+ import { a as edgeLists, c as generateAssignment, d as render, i as edgeAssignmentCount, l as shrinkCandidates, n as conforms, r as edgeAssignment, t as CannotGenerate, u as copy } from "./generate-TBJM3-2P.mjs";
4
+ // packages/prover/src/checked.ts
5
+ /**
6
+ * One assignment through a spec. The precondition decides whether the
7
+ * assignment is inside the claim; a precondition that throws or does not
8
+ * answer a boolean is a malformed property, since it cannot tell. The
9
+ * claim then holds, or is false, or throws: a throw from the claim, the
10
+ * function's own included, means the claim is not true there. A claim
11
+ * that returns something other than a boolean is malformed.
12
+ */
13
+ function evaluate(spec, values, copied = false) {
14
+ const fresh = () => copied ? copy(values) : values;
15
+ if (spec.when) {
16
+ let inside;
17
+ try {
18
+ inside = spec.when(...fresh());
19
+ } catch (err) {
20
+ return { malformed: `the precondition threw ${String(err)}` };
21
+ }
22
+ if (typeof inside !== "boolean") return { malformed: `the precondition returned ${render(inside)}, not a boolean` };
23
+ if (!inside) return { outcome: "discarded" };
24
+ }
25
+ let claim;
26
+ try {
27
+ claim = spec.ensures(...fresh());
28
+ } catch (err) {
29
+ return {
30
+ outcome: "refuted",
31
+ error: String(err)
32
+ };
33
+ }
34
+ if (typeof claim !== "boolean") return { malformed: `the claim returned ${render(claim)}, not a boolean` };
35
+ return { outcome: claim ? "held" : "refuted" };
36
+ }
37
+ /** How every rung words an `UNKNOWN` for a property that cannot be evaluated; the ladder recognizes it. */
38
+ const malformedReason = (detail) => `the property could not be evaluated: ${detail}`;
39
+ /** The `CHECKED` rung: evaluate the property on every distinct input the simulator passed the function. */
40
+ function checkedRung(input) {
41
+ const { module, fn, property } = input;
42
+ const base = {
43
+ module,
44
+ function: fn.name,
45
+ property: property.name,
46
+ text: property.text
47
+ };
48
+ const unknown = (cause, reason) => ({
49
+ ...base,
50
+ kind: "UNKNOWN",
51
+ cause,
52
+ reason,
53
+ assumptions: []
54
+ });
55
+ if (property.kind === "total") return unknown("unsupported", "termination is not observable on the inputs the simulator passed; total needs a prover");
56
+ if (input.unobservable) return unknown("unavailable", `calls to ${fn.name} could not be observed: ${input.unobservable}`);
57
+ const spec = input.spec;
58
+ if (!spec) return unknown("unavailable", `the spec file's export ${property.name} was not loaded`);
59
+ const binders = property.binders;
60
+ const seen = /* @__PURE__ */ new Set();
61
+ let held = 0;
62
+ let discarded = 0;
63
+ for (const call of input.calls) {
64
+ const values = binders.map((_, i) => call.args[i]);
65
+ const key = values.map(render).join(", ");
66
+ if (seen.has(key)) continue;
67
+ seen.add(key);
68
+ if (!binders.every((b, i) => conforms(b.type, values[i]))) {
69
+ discarded++;
70
+ continue;
71
+ }
72
+ const counterexample = (error) => ({
73
+ binders: binders.map((b, i) => ({
74
+ name: b.name,
75
+ value: render(values[i])
76
+ })),
77
+ call: `${fn.name}(${call.args.map(render).join(", ")})`,
78
+ ...error === void 0 ? {} : { error }
79
+ });
80
+ const result = evaluate(spec, values);
81
+ if ("malformed" in result) return unknown("unsupported", malformedReason(result.malformed));
82
+ if (result.outcome === "refuted") return {
83
+ ...base,
84
+ kind: "REFUTED",
85
+ rung: "CHECKED",
86
+ counterexample: counterexample(result.error),
87
+ assumptions: []
88
+ };
89
+ if (result.outcome === "discarded") discarded++;
90
+ else held++;
91
+ }
92
+ if (held === 0) return unknown("gave_up", input.calls.length === 0 ? `the simulator never called ${fn.name}` : `none of the ${seen.size} distinct input(s) the simulator passed is inside the claim (the precondition)`);
93
+ return {
94
+ ...base,
95
+ kind: "CHECKED",
96
+ inputs: held,
97
+ discarded,
98
+ assumptions: [`held on the ${held} distinct input(s) the simulator passed to ${fn.name}; inputs it never passed are not covered`]
99
+ };
100
+ }
101
+ // packages/prover/src/shrink.ts
102
+ /** How many evaluations shrinking may spend on one counterexample. */
103
+ const shrinkBudget = 500;
104
+ function shrinkRefutation(spec, binders, start, startEvaluation) {
105
+ let values = [...start];
106
+ let error = refutes(startEvaluation) ?? {};
107
+ let spent = 0;
108
+ let progress = true;
109
+ while (progress && spent < shrinkBudget) {
110
+ progress = false;
111
+ for (let i = 0; i < binders.length && spent < shrinkBudget; i++) {
112
+ const b = binders[i];
113
+ let moved = true;
114
+ while (moved && spent < shrinkBudget) {
115
+ moved = false;
116
+ for (const candidate of shrinkCandidates(b, values[i])) {
117
+ if (spent >= shrinkBudget) break;
118
+ spent++;
119
+ const trial = values.with(i, candidate);
120
+ if (spec.sample && !inSample(spec, trial)) continue;
121
+ const still = refutes(evaluate(spec, trial, true));
122
+ if (still === void 0) continue;
123
+ values = trial;
124
+ error = still;
125
+ moved = true;
126
+ progress = true;
127
+ break;
128
+ }
129
+ }
130
+ }
131
+ }
132
+ return error.error === void 0 ? { values } : {
133
+ values,
134
+ error: error.error
135
+ };
136
+ }
137
+ /** Whether an evaluation still refutes: an object (holding the error text, if any), or undefined. */
138
+ function refutes(e) {
139
+ if ("malformed" in e || e.outcome !== "refuted") return void 0;
140
+ return "error" in e && e.error !== void 0 ? { error: e.error } : {};
141
+ }
142
+ /** Whether the spec's sample holds of the values (a sample that throws or answers other than true does not). */
143
+ function inSample(spec, values) {
144
+ try {
145
+ return spec.sample?.(...copy(values)) === true;
146
+ } catch {
147
+ return false;
148
+ }
149
+ }
150
+ // packages/prover/src/tested.ts
151
+ /**
152
+ * The `TESTED` rung: a property evaluated on assignments drawn from its
153
+ * binders' types, steered by the precondition's hints, with a seed, so the
154
+ * same seed draws the same assignments everywhere. An assignment where the
155
+ * claim is false is shrunk toward smaller values that still break it and
156
+ * reported as a counterexample. Holding on every drawn assignment is
157
+ * `TESTED`: evidence from sampling, which says nothing about the inputs
158
+ * never drawn.
159
+ */
160
+ /** The `TESTED` rung: evaluate the property on inputs generated from its binders' domains, drawn from the seed. */
161
+ function testedRung(input) {
162
+ const { module, fn, property } = input;
163
+ const base = {
164
+ module,
165
+ function: fn.name,
166
+ property: property.name,
167
+ text: property.text
168
+ };
169
+ const unknown = (cause, reason) => ({
170
+ ...base,
171
+ kind: "UNKNOWN",
172
+ cause,
173
+ reason,
174
+ assumptions: []
175
+ });
176
+ if (property.kind === "total") return unknown("unsupported", "termination is not observable on generated inputs; total needs a prover");
177
+ const spec = input.spec;
178
+ if (!spec) return unknown("unavailable", `the spec file's export ${property.name} was not loaded`);
179
+ const binders = property.binders;
180
+ const wanted = input.inputs ?? 100;
181
+ if (!Number.isInteger(wanted) || wanted < 1) throw new RangeError(`inputs must be a positive integer, got ${String(input.inputs)}`);
182
+ const seed = `${input.seed}:${module}:${fn.name}:${property.name}`;
183
+ let state = seedPrng(seed);
184
+ let held = 0;
185
+ let discarded = 0;
186
+ let sampledOut = 0;
187
+ const seen = /* @__PURE__ */ new Set();
188
+ const counterexample = (values, error) => ({
189
+ binders: binders.map((b, i) => ({
190
+ name: b.name,
191
+ value: render(values[i])
192
+ })),
193
+ ...error === void 0 ? {} : { error }
194
+ });
195
+ const edges = edgeLists(binders);
196
+ const edgeTotal = edgeAssignmentCount(edges);
197
+ const randomWanted = Math.ceil(wanted / 2);
198
+ let randomHeld = 0;
199
+ for (let draws = 0; draws < edgeTotal || (held < wanted || randomHeld < randomWanted) && draws < edgeTotal + wanted * 20; draws++) {
200
+ let values;
201
+ try {
202
+ [values, state] = (draws < edgeTotal ? edgeAssignment(binders, edges, draws, state) : void 0) ?? generateAssignment(binders, state);
203
+ } catch (err) {
204
+ if (err instanceof CannotGenerate) return unknown(err.why, err.message);
205
+ throw err;
206
+ }
207
+ const key = values.map(render).join(", ");
208
+ if (seen.has(key)) continue;
209
+ seen.add(key);
210
+ if (spec.sample) {
211
+ let inSample;
212
+ try {
213
+ inSample = spec.sample(...copy(values));
214
+ } catch (err) {
215
+ return unknown("unsupported", malformedReason(`the sample threw ${String(err)}`));
216
+ }
217
+ if (typeof inSample !== "boolean") return unknown("unsupported", malformedReason(`the sample returned ${render(inSample)}, not a boolean`));
218
+ if (!inSample) {
219
+ sampledOut++;
220
+ continue;
221
+ }
222
+ }
223
+ const result = evaluate(spec, values, true);
224
+ if ("malformed" in result) return unknown("unsupported", malformedReason(result.malformed));
225
+ if (result.outcome === "discarded") {
226
+ discarded++;
227
+ continue;
228
+ }
229
+ if (result.outcome === "refuted") {
230
+ const smallest = shrinkRefutation(spec, binders, values, result);
231
+ return {
232
+ ...base,
233
+ kind: "REFUTED",
234
+ rung: "TESTED",
235
+ counterexample: counterexample(smallest.values, smallest.error),
236
+ assumptions: [`found on an input generated with seed ${input.seed}, then shrunk`]
237
+ };
238
+ }
239
+ held++;
240
+ if (draws >= edgeTotal) randomHeld++;
241
+ }
242
+ if (held === 0) return unknown("gave_up", sampledOut > 0 && discarded === 0 ? `all ${sampledOut} distinct generated inputs were outside the sample: it admits too few of the parameter types to draw` : `all ${discarded + sampledOut} distinct generated inputs were outside the claim or the sample: its precondition admits too few of the parameter types to sample`);
243
+ return {
244
+ ...base,
245
+ kind: "TESTED",
246
+ inputs: held,
247
+ discarded,
248
+ seed: input.seed,
249
+ assumptions: [
250
+ `held on ${held} distinct input(s) generated from the parameter types with seed ${input.seed}; inputs never drawn are not covered`,
251
+ `${fn.name} was called on generated inputs outside the simulator, so it is assumed pure`,
252
+ ...spec.sample ? [`drawn only where the sample holds${property.sample ? ` (${property.sample.body.replace(/\s+/g, " ").trim()})` : ""}; the claim itself is not limited to it`] : []
253
+ ]
254
+ };
255
+ }
256
+ // packages/prover/src/ladder.ts
257
+ /** One property through the ladder's rungs. */
258
+ function specLadder(input, options = {}) {
259
+ if (options.checked === false) {
260
+ if (!options.tested) throw new RangeError("a ladder without CHECKED needs the TESTED rung");
261
+ return testedRung({
262
+ module: input.module,
263
+ fn: input.fn,
264
+ property: input.property,
265
+ spec: input.spec,
266
+ ...options.tested
267
+ });
268
+ }
269
+ const checked = checkedRung(input);
270
+ if (checked.kind === "REFUTED" || options.tested === false || options.tested === void 0) return checked;
271
+ if (input.property.kind === "total") return checked;
272
+ if (checked.kind === "UNKNOWN" && checked.reason.startsWith(malformedReason(""))) return checked;
273
+ const tested = testedRung({
274
+ module: input.module,
275
+ fn: input.fn,
276
+ property: input.property,
277
+ spec: input.spec,
278
+ ...options.tested
279
+ });
280
+ if (tested.kind === "REFUTED") return tested;
281
+ if (tested.kind === "UNKNOWN" && tested.reason.startsWith(malformedReason(""))) return tested;
282
+ if (tested.kind === "TESTED") {
283
+ if (checked.kind !== "CHECKED") return {
284
+ ...tested,
285
+ assumptions: [...tested.assumptions, reason(checked)]
286
+ };
287
+ return {
288
+ ...tested,
289
+ checked: checked.inputs,
290
+ assumptions: [...tested.assumptions, ...checked.assumptions]
291
+ };
292
+ }
293
+ if (checked.kind !== "UNKNOWN") return {
294
+ ...checked,
295
+ assumptions: [...checked.assumptions, `not TESTED: ${reason(tested)}`]
296
+ };
297
+ if (reason(tested) === checked.reason) return checked;
298
+ return {
299
+ ...checked,
300
+ reason: `${checked.reason}; generated inputs: ${reason(tested)}`
301
+ };
302
+ }
303
+ function reason(v) {
304
+ return v.kind === "UNKNOWN" ? v.reason : v.kind;
305
+ }
306
+ /**
307
+ * Every spec verdict for one module: each property through the ladder.
308
+ * `props` is the spec file's namespace, `namespace` the module's (after
309
+ * observation ended, so it holds the functions themselves); a spec whose
310
+ * function is not the module's export of that name is not evaluated.
311
+ */
312
+ function checkSpecModule(module, specs, props, namespace, observed, options = {}) {
313
+ return specs.functions.flatMap((fn) => {
314
+ const calls = observed.calls.filter((c) => c.function === fn.name);
315
+ const unobservable = Object.hasOwn(observed.unobservable, fn.name) ? observed.unobservable[fn.name] : void 0;
316
+ return fn.properties.map((property) => {
317
+ const exported = Object.hasOwn(props, property.name) ? props[property.name] : void 0;
318
+ let spec;
319
+ let mismatch;
320
+ if (!isSpec(exported)) mismatch = `the spec file exports no spec named ${property.name}`;
321
+ else if (exported.fn !== namespace[fn.name]) mismatch = `${property.name} names a function that is not the module's export ${fn.name}`;
322
+ else if (exported.kind === "forall") spec = exported;
323
+ if (mismatch !== void 0) return {
324
+ module,
325
+ function: fn.name,
326
+ property: property.name,
327
+ text: property.text,
328
+ kind: "UNKNOWN",
329
+ cause: "unavailable",
330
+ reason: mismatch,
331
+ assumptions: []
332
+ };
333
+ return specLadder({
334
+ module,
335
+ fn,
336
+ property,
337
+ calls,
338
+ spec,
339
+ ...unobservable === void 0 ? {} : { unobservable }
340
+ }, options);
341
+ });
342
+ });
343
+ }
344
+ export { checkedRung as a, shrinkRefutation as i, specLadder as n, evaluate as o, testedRung as r, checkSpecModule as t };
345
+
346
+ //# sourceMappingURL=src-DwYD3QQJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-DwYD3QQJ.mjs","names":[],"sources":["../../prover/src/checked.ts","../../prover/src/shrink.ts","../../prover/src/tested.ts","../../prover/src/ladder.ts"],"sourcesContent":["/**\n * The `CHECKED` rung: a property evaluated on every input the simulator\n * actually passed to its function. Binders are the function's parameters,\n * so each recorded call is one assignment; one failing the precondition is\n * outside the claim and discarded. One assignment where the claim is false\n * refutes the property. Holding on all of them is `CHECKED`, which says\n * nothing about inputs the simulator never passed.\n */\n\nimport type { Counterexample, SpecVerdict } from \"@eutaxy/core\";\nimport type { Fn, Forall, FunctionSpec, Property } from \"@eutaxy/spec\";\nimport { conforms } from \"./generate.ts\";\nimport { copy, render } from \"./render.ts\";\n\nexport { render } from \"./render.ts\";\n\n/** What evaluating a spec on one assignment came to. */\nexport type PredicateOutcome = \"held\" | \"discarded\" | \"refuted\";\n\nexport type Evaluation =\n | { readonly outcome: \"held\" | \"discarded\" }\n | { readonly outcome: \"refuted\"; readonly error?: string }\n /** The property, not the function, is at fault: it cannot be evaluated at any rung. */\n | { readonly malformed: string };\n\n/**\n * One assignment through a spec. The precondition decides whether the\n * assignment is inside the claim; a precondition that throws or does not\n * answer a boolean is a malformed property, since it cannot tell. The\n * claim then holds, or is false, or throws: a throw from the claim, the\n * function's own included, means the claim is not true there. A claim\n * that returns something other than a boolean is malformed.\n */\nexport function evaluate(\n spec: Forall<Fn>,\n values: readonly unknown[],\n /** For generated inputs: each arrow gets its own copy of their plain data (`copy`). */\n copied = false,\n): Evaluation {\n const fresh = (): never[] => (copied ? copy(values) : values) as never[];\n if (spec.when) {\n let inside: unknown;\n try {\n inside = spec.when(...fresh());\n } catch (err) {\n return { malformed: `the precondition threw ${String(err)}` };\n }\n if (typeof inside !== \"boolean\")\n return { malformed: `the precondition returned ${render(inside)}, not a boolean` };\n if (!inside) return { outcome: \"discarded\" };\n }\n let claim: unknown;\n try {\n claim = spec.ensures(...fresh());\n } catch (err) {\n return { outcome: \"refuted\", error: String(err) };\n }\n if (typeof claim !== \"boolean\")\n return { malformed: `the claim returned ${render(claim)}, not a boolean` };\n return { outcome: claim ? \"held\" : \"refuted\" };\n}\n\n/** How every rung words an `UNKNOWN` for a property that cannot be evaluated; the ladder recognizes it. */\nexport const malformedReason = (detail: string): string =>\n `the property could not be evaluated: ${detail}`;\n\nexport interface CheckedInput {\n readonly module: string;\n readonly fn: FunctionSpec;\n readonly property: Property;\n /** The calls the simulator made, with their arguments. */\n readonly calls: readonly { readonly args: readonly unknown[] }[];\n /** The spec file's export, or undefined when it could not be loaded. */\n readonly spec: Forall<Fn> | undefined;\n /** Why the function's calls could not be observed, when they could not. */\n readonly unobservable?: string;\n}\n\n/** The `CHECKED` rung: evaluate the property on every distinct input the simulator passed the function. */\nexport function checkedRung(input: CheckedInput): SpecVerdict {\n const { module, fn, property } = input;\n const base = { module, function: fn.name, property: property.name, text: property.text };\n const unknown = (\n cause: \"gave_up\" | \"unsupported\" | \"unavailable\",\n reason: string,\n ): SpecVerdict => ({ ...base, kind: \"UNKNOWN\", cause, reason, assumptions: [] });\n if (property.kind === \"total\")\n return unknown(\n \"unsupported\",\n \"termination is not observable on the inputs the simulator passed; total needs a prover\",\n );\n if (input.unobservable)\n return unknown(\n \"unavailable\",\n `calls to ${fn.name} could not be observed: ${input.unobservable}`,\n );\n const spec = input.spec;\n if (!spec)\n return unknown(\"unavailable\", `the spec file's export ${property.name} was not loaded`);\n const binders = property.binders;\n const seen = new Set<string>();\n let held = 0;\n let discarded = 0;\n for (const call of input.calls) {\n const values = binders.map((_, i) => call.args[i]);\n const key = values.map(render).join(\", \");\n if (seen.has(key)) continue;\n seen.add(key);\n // The claim quantifies over the parameter types; a call with an argument of another type\n // (a shell passing a string where a number is declared) is outside it, not a counterexample.\n if (!binders.every((b, i) => conforms(b.type, values[i]))) {\n discarded++;\n continue;\n }\n const counterexample = (error?: string): Counterexample => ({\n binders: binders.map((b, i) => ({ name: b.name, value: render(values[i]) })),\n call: `${fn.name}(${call.args.map(render).join(\", \")})`,\n ...(error === undefined ? {} : { error }),\n });\n const result = evaluate(spec, values);\n if (\"malformed\" in result) return unknown(\"unsupported\", malformedReason(result.malformed));\n if (result.outcome === \"refuted\")\n return {\n ...base,\n kind: \"REFUTED\",\n rung: \"CHECKED\",\n counterexample: counterexample(result.error),\n assumptions: [],\n };\n if (result.outcome === \"discarded\") discarded++;\n else held++;\n }\n if (held === 0)\n return unknown(\n \"gave_up\",\n input.calls.length === 0\n ? `the simulator never called ${fn.name}`\n : `none of the ${seen.size} distinct input(s) the simulator passed is inside the claim (the precondition)`,\n );\n return {\n ...base,\n kind: \"CHECKED\",\n inputs: held,\n discarded,\n assumptions: [\n `held on the ${held} distinct input(s) the simulator passed to ${fn.name}; inputs it never passed are not covered`,\n ],\n };\n}\n","/**\n * A refuting assignment made as small as the candidates allow, one binder\n * at a time, while the property still fails: what the TESTED rung reports,\n * and what an engine reports after replaying a solver's model.\n */\n\nimport type { Binder, Fn, Forall } from \"@eutaxy/spec\";\nimport { type Evaluation, evaluate } from \"./checked.ts\";\nimport { shrinkCandidates } from \"./generate.ts\";\nimport { copy } from \"./render.ts\";\n\n/** How many evaluations shrinking may spend on one counterexample. */\nconst shrinkBudget = 500;\n\nexport function shrinkRefutation(\n spec: Forall<Fn>,\n binders: readonly Binder[],\n start: readonly unknown[],\n startEvaluation: Evaluation,\n): { readonly values: readonly unknown[]; readonly error?: string } {\n let values = [...start];\n let error: { readonly error?: string } = refutes(startEvaluation) ?? {};\n let spent = 0;\n let progress = true;\n while (progress && spent < shrinkBudget) {\n progress = false;\n for (let i = 0; i < binders.length && spent < shrinkBudget; i++) {\n const b = binders[i] as Binder;\n let moved = true;\n while (moved && spent < shrinkBudget) {\n moved = false;\n for (const candidate of shrinkCandidates(b, values[i])) {\n if (spent >= shrinkBudget) break;\n spent++;\n const trial = values.with(i, candidate);\n // Inside the sample only: it bounds what an evaluation may cost, shrinking included.\n if (spec.sample && !inSample(spec, trial)) continue;\n const still = refutes(evaluate(spec, trial, true));\n if (still === undefined) continue;\n values = trial;\n error = still;\n moved = true;\n progress = true;\n break;\n }\n }\n }\n }\n return error.error === undefined ? { values } : { values, error: error.error };\n}\n\n/** Whether an evaluation still refutes: an object (holding the error text, if any), or undefined. */\nexport function refutes(e: Evaluation): { readonly error?: string } | undefined {\n if (\"malformed\" in e || e.outcome !== \"refuted\") return undefined;\n return \"error\" in e && e.error !== undefined ? { error: e.error } : {};\n}\n\n/** Whether the spec's sample holds of the values (a sample that throws or answers other than true does not). */\nfunction inSample(spec: Forall<Fn>, values: readonly unknown[]): boolean {\n try {\n return spec.sample?.(...(copy(values) as never[])) === true;\n } catch {\n return false;\n }\n}\n","/**\n * The `TESTED` rung: a property evaluated on assignments drawn from its\n * binders' types, steered by the precondition's hints, with a seed, so the\n * same seed draws the same assignments everywhere. An assignment where the\n * claim is false is shrunk toward smaller values that still break it and\n * reported as a counterexample. Holding on every drawn assignment is\n * `TESTED`: evidence from sampling, which says nothing about the inputs\n * never drawn.\n */\n\nimport { type Counterexample, type PrngState, type SpecVerdict, seedPrng } from \"@eutaxy/core\";\nimport type { Fn, Forall, FunctionSpec, Property } from \"@eutaxy/spec\";\nimport { evaluate, malformedReason, render } from \"./checked.ts\";\nimport {\n CannotGenerate,\n edgeAssignment,\n edgeAssignmentCount,\n edgeLists,\n generateAssignment,\n} from \"./generate.ts\";\nimport { copy } from \"./render.ts\";\nimport { shrinkRefutation } from \"./shrink.ts\";\n\n/** The `TESTED` rung's seed, and how many distinct generated inputs a property must hold on (default 100). */\nexport interface TestedOptions {\n /** The check's seed; each property derives its own stream from it and its name. */\n readonly seed: string;\n /** Distinct assignments the property must hold on; default 100. Drawing stops after 20 times as many draws, whatever they were. */\n readonly inputs?: number;\n}\n\nexport interface TestedInput extends TestedOptions {\n readonly module: string;\n readonly fn: FunctionSpec;\n readonly property: Property;\n /** The spec file's export, or undefined when it could not be loaded. */\n readonly spec: Forall<Fn> | undefined;\n}\n\n/** The `TESTED` rung: evaluate the property on inputs generated from its binders' domains, drawn from the seed. */\nexport function testedRung(input: TestedInput): SpecVerdict {\n const { module, fn, property } = input;\n const base = { module, function: fn.name, property: property.name, text: property.text };\n const unknown = (\n cause: \"gave_up\" | \"unsupported\" | \"unavailable\",\n reason: string,\n ): SpecVerdict => ({ ...base, kind: \"UNKNOWN\", cause, reason, assumptions: [] });\n if (property.kind === \"total\")\n return unknown(\n \"unsupported\",\n \"termination is not observable on generated inputs; total needs a prover\",\n );\n const spec = input.spec;\n if (!spec)\n return unknown(\"unavailable\", `the spec file's export ${property.name} was not loaded`);\n const binders = property.binders;\n const wanted = input.inputs ?? 100;\n if (!Number.isInteger(wanted) || wanted < 1)\n throw new RangeError(`inputs must be a positive integer, got ${String(input.inputs)}`);\n const seed = `${input.seed}:${module}:${fn.name}:${property.name}`;\n let state: PrngState = seedPrng(seed);\n let held = 0;\n let discarded = 0;\n let sampledOut = 0;\n // Distinct assignments only, as the CHECKED rung counts them: two booleans are two inputs, not a hundred.\n const seen = new Set<string>();\n const counterexample = (values: readonly unknown[], error?: string): Counterexample => ({\n binders: binders.map((b, i) => ({ name: b.name, value: render(values[i]) })),\n ...(error === undefined ? {} : { error }),\n });\n // Every edge assignment is tried, however many there are (a union of a hundred literals has a\n // hundred); then random draws until the budget is met, and at least half of it random, so many\n // edges never crowd out the values between them.\n const edges = edgeLists(binders);\n const edgeTotal = edgeAssignmentCount(edges);\n const randomWanted = Math.ceil(wanted / 2);\n let randomHeld = 0;\n for (\n let draws = 0;\n draws < edgeTotal ||\n ((held < wanted || randomHeld < randomWanted) && draws < edgeTotal + wanted * 20);\n draws++\n ) {\n let values: unknown[];\n try {\n // The edges first, every one of them, then random draws.\n [values, state] =\n (draws < edgeTotal ? edgeAssignment(binders, edges, draws, state) : undefined) ??\n generateAssignment(binders, state);\n } catch (err) {\n if (err instanceof CannotGenerate) return unknown(err.why, err.message);\n throw err;\n }\n const key = values.map(render).join(\", \");\n if (seen.has(key)) continue;\n seen.add(key);\n // Outside the sample is not drawn at all: neither inside nor outside the claim, just not tried.\n if (spec.sample) {\n let inSample: unknown;\n try {\n inSample = spec.sample(...(copy(values) as never[]));\n } catch (err) {\n return unknown(\"unsupported\", malformedReason(`the sample threw ${String(err)}`));\n }\n if (typeof inSample !== \"boolean\")\n return unknown(\n \"unsupported\",\n malformedReason(`the sample returned ${render(inSample)}, not a boolean`),\n );\n if (!inSample) {\n sampledOut++;\n continue;\n }\n }\n const result = evaluate(spec, values, true);\n if (\"malformed\" in result) return unknown(\"unsupported\", malformedReason(result.malformed));\n if (result.outcome === \"discarded\") {\n discarded++;\n continue;\n }\n if (result.outcome === \"refuted\") {\n const smallest = shrinkRefutation(spec, binders, values, result);\n return {\n ...base,\n kind: \"REFUTED\",\n rung: \"TESTED\",\n counterexample: counterexample(smallest.values, smallest.error),\n assumptions: [`found on an input generated with seed ${input.seed}, then shrunk`],\n };\n }\n held++;\n if (draws >= edgeTotal) randomHeld++;\n }\n if (held === 0)\n return unknown(\n \"gave_up\",\n sampledOut > 0 && discarded === 0\n ? `all ${sampledOut} distinct generated inputs were outside the sample: it admits too few of the parameter types to draw`\n : `all ${discarded + sampledOut} distinct generated inputs were outside the claim or the sample: its precondition admits too few of the parameter types to sample`,\n );\n return {\n ...base,\n kind: \"TESTED\",\n inputs: held,\n discarded,\n seed: input.seed,\n assumptions: [\n `held on ${held} distinct input(s) generated from the parameter types with seed ${input.seed}; inputs never drawn are not covered`,\n `${fn.name} was called on generated inputs outside the simulator, so it is assumed pure`,\n ...(spec.sample\n ? [\n `drawn only where the sample holds${property.sample ? ` (${property.sample.body.replace(/\\s+/g, \" \").trim()})` : \"\"}; the claim itself is not limited to it`,\n ]\n : []),\n ],\n };\n}\n","/**\n * The spec ladder, as far as it goes without an engine: `CHECKED` on the\n * inputs the simulator passed, then `TESTED` on generated ones. A\n * counterexample at either rung is `REFUTED`; otherwise the verdict is the\n * highest rung that decided, with the lower one's evidence kept beside it.\n */\n\nimport type { SpecVerdict } from \"@eutaxy/core\";\nimport { type Fn, type Forall, isSpec, type ModuleSpecs } from \"@eutaxy/spec\";\nimport { type CheckedInput, checkedRung, malformedReason } from \"./checked.ts\";\nimport { type TestedOptions, testedRung } from \"./tested.ts\";\n\n/** How far `specLadder` climbs: the `TESTED` rung's options (or none), and whether a scenario ran for `CHECKED`. */\nexport interface LadderOptions {\n /** Run the `TESTED` rung with these options; `false` stops the ladder at `CHECKED`. */\n readonly tested?: TestedOptions | false;\n /** `false` when no scenario ran (`eutaxy report`): the ladder starts at `TESTED`, which it then needs. */\n readonly checked?: false;\n}\n\n/** One property through the ladder's rungs. */\nexport function specLadder(input: CheckedInput, options: LadderOptions = {}): SpecVerdict {\n if (options.checked === false) {\n if (!options.tested) throw new RangeError(\"a ladder without CHECKED needs the TESTED rung\");\n return testedRung({\n module: input.module,\n fn: input.fn,\n property: input.property,\n spec: input.spec,\n ...options.tested,\n });\n }\n const checked = checkedRung(input);\n if (checked.kind === \"REFUTED\" || options.tested === false || options.tested === undefined)\n return checked;\n if (input.property.kind === \"total\") return checked;\n // A property that could not be evaluated on an input the simulator passed is malformed: sampling\n // that happens to miss the input must not make it look sound.\n if (checked.kind === \"UNKNOWN\" && checked.reason.startsWith(malformedReason(\"\"))) return checked;\n const tested = testedRung({\n module: input.module,\n fn: input.fn,\n property: input.property,\n spec: input.spec,\n ...options.tested,\n });\n if (tested.kind === \"REFUTED\") return tested;\n // The same holds the other way round: a generated input that shows the property malformed outranks CHECKED.\n if (tested.kind === \"UNKNOWN\" && tested.reason.startsWith(malformedReason(\"\"))) return tested;\n if (tested.kind === \"TESTED\") {\n if (checked.kind !== \"CHECKED\")\n // Why there is no `checked` count stays visible: the simulator never called the function, say.\n return { ...tested, assumptions: [...tested.assumptions, reason(checked)] };\n return {\n ...tested,\n checked: checked.inputs,\n assumptions: [...tested.assumptions, ...checked.assumptions],\n };\n }\n if (checked.kind !== \"UNKNOWN\")\n return { ...checked, assumptions: [...checked.assumptions, `not TESTED: ${reason(tested)}`] };\n // Neither rung decided: say why for both, once when it is the same reason.\n if (reason(tested) === checked.reason) return checked;\n return { ...checked, reason: `${checked.reason}; generated inputs: ${reason(tested)}` };\n}\n\nfunction reason(v: SpecVerdict): string {\n return v.kind === \"UNKNOWN\" ? v.reason : v.kind;\n}\n\n/**\n * Every spec verdict for one module: each property through the ladder.\n * `props` is the spec file's namespace, `namespace` the module's (after\n * observation ended, so it holds the functions themselves); a spec whose\n * function is not the module's export of that name is not evaluated.\n */\nexport function checkSpecModule(\n module: string,\n specs: ModuleSpecs,\n props: Readonly<Record<string, unknown>>,\n namespace: Readonly<Record<string, unknown>>,\n observed: {\n readonly calls: readonly { readonly function: string; readonly args: readonly unknown[] }[];\n readonly unobservable: { readonly [fn: string]: string };\n },\n options: LadderOptions = {},\n): SpecVerdict[] {\n return specs.functions.flatMap((fn) => {\n const calls = observed.calls.filter((c) => c.function === fn.name);\n // Own properties only: a function named toString must not find Object.prototype's.\n const unobservable = Object.hasOwn(observed.unobservable, fn.name)\n ? observed.unobservable[fn.name]\n : undefined;\n return fn.properties.map((property) => {\n const exported = Object.hasOwn(props, property.name) ? props[property.name] : undefined;\n let spec: Forall<Fn> | undefined;\n let mismatch: string | undefined;\n if (!isSpec(exported)) mismatch = `the spec file exports no spec named ${property.name}`;\n else if (exported.fn !== namespace[fn.name])\n mismatch = `${property.name} names a function that is not the module's export ${fn.name}`;\n else if (exported.kind === \"forall\") spec = exported;\n if (mismatch !== undefined)\n return {\n module,\n function: fn.name,\n property: property.name,\n text: property.text,\n kind: \"UNKNOWN\",\n cause: \"unavailable\",\n reason: mismatch,\n assumptions: [],\n };\n return specLadder(\n {\n module,\n fn,\n property,\n calls,\n spec,\n ...(unobservable === undefined ? {} : { unobservable }),\n },\n options,\n );\n });\n });\n}\n"],"mappings":";;;;;;;;;;;;AAiCA,SAAgB,SACd,MACA,QAEA,SAAS,OACG;CACZ,MAAM,cAAwB,SAAS,KAAK,MAAM,IAAI;CACtD,IAAI,KAAK,MAAM;EACb,IAAI;EACJ,IAAI;GACF,SAAS,KAAK,KAAK,GAAG,MAAM,CAAC;EAC/B,SAAS,KAAK;GACZ,OAAO,EAAE,WAAW,0BAA0B,OAAO,GAAG,IAAI;EAC9D;EACA,IAAI,OAAO,WAAW,WACpB,OAAO,EAAE,WAAW,6BAA6B,OAAO,MAAM,EAAE,iBAAiB;EACnF,IAAI,CAAC,QAAQ,OAAO,EAAE,SAAS,YAAY;CAC7C;CACA,IAAI;CACJ,IAAI;EACF,QAAQ,KAAK,QAAQ,GAAG,MAAM,CAAC;CACjC,SAAS,KAAK;EACZ,OAAO;GAAE,SAAS;GAAW,OAAO,OAAO,GAAG;EAAE;CAClD;CACA,IAAI,OAAO,UAAU,WACnB,OAAO,EAAE,WAAW,sBAAsB,OAAO,KAAK,EA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AG,OACpC,WAAW,GAAG,SAAS,KAAK,oDAAoD,GAAG;QAChF,IAAI,SAAS,SAAS,UAAU,OAAO;GAC5C,IAAI,aAAa,KAAA,GACf,OAAO;IACL;IACA,UAAU,GAAG;IACb,UAAU,SAAS;IACnB,MAAM,SAAS;IACf,MAAM;IACN,OAAO;IACP,QAAQ;IACR,aAAa,CAAC;GAChB;GACF,OAAO,WACL;IACE;IACA;IACA;IACA;IACA;IACA,GAAI,iBAAiB,KAAA,IAAY,CAAC,IAAI,EAAE,aAAa;GACvD,GACA,OACF;EACF,CAAC;CACH,CAAC;AACH"}
@@ -0,0 +1,80 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import { homedir } from "node:os";
3
+ import { join, resolve } from "node:path";
4
+ // packages/prover/src/toolchain.ts
5
+ /**
6
+ * Where a pinned prover toolchain lives on this machine once `eutaxy prover
7
+ * install` has put it there, and what that command downloads: one upstream
8
+ * release file per platform, with the checksum the download must match.
9
+ * Node-side only (`@eutaxy/prover/toolchain`, a subpath so workerd never
10
+ * loads it): it reads the file system, so this file alone references Node's
11
+ * types, as the reader alone uses the compiler's. Nothing here downloads or
12
+ * runs anything; the engines ask `installed` and the command does the rest.
13
+ */
14
+ const platforms = [
15
+ "linux-x64",
16
+ "linux-arm64",
17
+ "darwin-x64",
18
+ "darwin-arm64",
19
+ "win32-x64"
20
+ ];
21
+ function host() {
22
+ return {
23
+ platform: process.platform,
24
+ arch: process.arch,
25
+ env: process.env,
26
+ home: homedir()
27
+ };
28
+ }
29
+ function platformOf(h) {
30
+ const key = `${h.platform}-${h.arch}`;
31
+ return platforms.includes(key) ? key : void 0;
32
+ }
33
+ /**
34
+ * Eutaxy's cache directory: `EUTAXY_CACHE_DIR`, else the platform's user
35
+ * cache (`$XDG_CACHE_HOME/eutaxy` or `~/.cache/eutaxy` on Linux,
36
+ * `~/Library/Caches/eutaxy` on macOS, `%LOCALAPPDATA%\eutaxy\Cache` on
37
+ * Windows). Always absolute: the engines spawn the executable from a
38
+ * scratch directory, where a relative path would not resolve.
39
+ */
40
+ function cacheDir(h = host()) {
41
+ const set = h.env["EUTAXY_CACHE_DIR"];
42
+ if (set) return resolve(set);
43
+ if (h.platform === "darwin") return join(h.home, "Library", "Caches", "eutaxy");
44
+ if (h.platform === "win32") return join(h.env["LOCALAPPDATA"] || join(h.home, "AppData", "Local"), "eutaxy", "Cache");
45
+ return resolve(h.env["XDG_CACHE_HOME"] || join(h.home, ".cache"), "eutaxy");
46
+ }
47
+ /** Where one toolchain's unpacked release lives: `<cache>/toolchains/<name>/<version>`. */
48
+ function toolchainDir(cache, toolchain) {
49
+ return join(cache, "toolchains", toolchain.name, toolchain.version);
50
+ }
51
+ /** The file the command writes last, so its presence means the install completed. */
52
+ const markerFile = "eutaxy-toolchain.json";
53
+ function executableName(toolchain, h) {
54
+ return h.platform === "win32" ? `${toolchain.executable}.exe` : toolchain.executable;
55
+ }
56
+ /**
57
+ * The toolchain the command put in the cache, if its marker and its
58
+ * executable are both there and the marker names this toolchain for this
59
+ * platform (a cache carried to another machine holds the wrong binary).
60
+ */
61
+ function installed(toolchain, h = host()) {
62
+ const dir = toolchainDir(cacheDir(h), toolchain);
63
+ const executable = join(dir, executableName(toolchain, h));
64
+ const markerPath = join(dir, markerFile);
65
+ if (!existsSync(markerPath) || !existsSync(executable)) return void 0;
66
+ try {
67
+ const marker = JSON.parse(readFileSync(markerPath, "utf8"));
68
+ if (marker.name !== toolchain.name || marker.version !== toolchain.version || marker.platform !== platformOf(h) || typeof marker.file !== "string" || typeof marker.sha256 !== "string" || typeof marker.source !== "string") return void 0;
69
+ return {
70
+ dir,
71
+ executable,
72
+ marker
73
+ };
74
+ } catch {
75
+ return;
76
+ }
77
+ }
78
+ export { markerFile as a, toolchainDir as c, installed as i, executableName as n, platformOf as o, host as r, platforms as s, cacheDir as t };
79
+
80
+ //# sourceMappingURL=toolchain-DWfymxAJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolchain-DWfymxAJ.mjs","names":[],"sources":["../../prover/src/toolchain.ts"],"sourcesContent":["/**\n * Where a pinned prover toolchain lives on this machine once `eutaxy prover\n * install` has put it there, and what that command downloads: one upstream\n * release file per platform, with the checksum the download must match.\n * Node-side only (`@eutaxy/prover/toolchain`, a subpath so workerd never\n * loads it): it reads the file system, so this file alone references Node's\n * types, as the reader alone uses the compiler's. Nothing here downloads or\n * runs anything; the engines ask `installed` and the command does the rest.\n */\n/// <reference types=\"node\" />\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join, resolve } from \"node:path\";\n\n/** The platforms Eutaxy runs a prover on: Node's `process.platform-process.arch`. */\nexport type Platform = \"linux-x64\" | \"linux-arm64\" | \"darwin-x64\" | \"darwin-arm64\" | \"win32-x64\";\nexport const platforms: readonly Platform[] = [\n \"linux-x64\",\n \"linux-arm64\",\n \"darwin-x64\",\n \"darwin-arm64\",\n \"win32-x64\",\n];\n\n/** One file of an upstream release: where it is, what it must hash to, how big it is. */\nexport interface ReleaseFile {\n /** The file's name in the release, which a mirror or offline copy keeps. */\n readonly file: string;\n readonly url: string;\n /** Lower-case hex SHA-256 of the file. */\n readonly sha256: string;\n readonly bytes: number;\n /**\n * For a zip, the files taken from it, each path in the archive mapped to\n * its path under the toolchain directory; nothing else in the zip is\n * unpacked. A zip must list them. A `tar.zst` is unpacked whole.\n */\n readonly entries?: Readonly<Record<string, string>>;\n}\n\n/** A prover toolchain as `eutaxy prover install` knows it. */\nexport interface Toolchain {\n /** The name the command takes: the engine's. */\n readonly name: string;\n readonly version: string;\n /** The executable inside the unpacked release, relative to its root; `.exe` is added on Windows. */\n readonly executable: string;\n readonly files: Readonly<Partial<Record<Platform, ReleaseFile>>>;\n}\n\n/** What of the machine the lookup depends on, so tests can hand in another. */\nexport interface Host {\n readonly platform: string;\n readonly arch: string;\n readonly env: Readonly<Record<string, string | undefined>>;\n readonly home: string;\n}\n\nexport function host(): Host {\n return { platform: process.platform, arch: process.arch, env: process.env, home: homedir() };\n}\n\nexport function platformOf(h: Host): Platform | undefined {\n const key = `${h.platform}-${h.arch}`;\n return (platforms as readonly string[]).includes(key) ? (key as Platform) : undefined;\n}\n\n/**\n * Eutaxy's cache directory: `EUTAXY_CACHE_DIR`, else the platform's user\n * cache (`$XDG_CACHE_HOME/eutaxy` or `~/.cache/eutaxy` on Linux,\n * `~/Library/Caches/eutaxy` on macOS, `%LOCALAPPDATA%\\eutaxy\\Cache` on\n * Windows). Always absolute: the engines spawn the executable from a\n * scratch directory, where a relative path would not resolve.\n */\nexport function cacheDir(h: Host = host()): string {\n const set = h.env[\"EUTAXY_CACHE_DIR\"];\n if (set) return resolve(set);\n if (h.platform === \"darwin\") return join(h.home, \"Library\", \"Caches\", \"eutaxy\");\n if (h.platform === \"win32\")\n return join(h.env[\"LOCALAPPDATA\"] || join(h.home, \"AppData\", \"Local\"), \"eutaxy\", \"Cache\");\n return resolve(h.env[\"XDG_CACHE_HOME\"] || join(h.home, \".cache\"), \"eutaxy\");\n}\n\n/** Where one toolchain's unpacked release lives: `<cache>/toolchains/<name>/<version>`. */\nexport function toolchainDir(\n cache: string,\n toolchain: Pick<Toolchain, \"name\" | \"version\">,\n): string {\n return join(cache, \"toolchains\", toolchain.name, toolchain.version);\n}\n\n/** The file the command writes last, so its presence means the install completed. */\nexport const markerFile = \"eutaxy-toolchain.json\";\n\nexport interface InstallMarker {\n readonly name: string;\n readonly version: string;\n readonly platform: Platform;\n readonly file: string;\n readonly sha256: string;\n /** Where the file came from: the upstream URL, or the mirror or directory given. */\n readonly source: string;\n}\n\nexport function executableName(toolchain: Pick<Toolchain, \"executable\">, h: Host): string {\n return h.platform === \"win32\" ? `${toolchain.executable}.exe` : toolchain.executable;\n}\n\nexport interface Installed {\n readonly dir: string;\n readonly executable: string;\n readonly marker: InstallMarker;\n}\n\n/**\n * The toolchain the command put in the cache, if its marker and its\n * executable are both there and the marker names this toolchain for this\n * platform (a cache carried to another machine holds the wrong binary).\n */\nexport function installed(toolchain: Toolchain, h: Host = host()): Installed | undefined {\n const dir = toolchainDir(cacheDir(h), toolchain);\n const executable = join(dir, executableName(toolchain, h));\n const markerPath = join(dir, markerFile);\n if (!existsSync(markerPath) || !existsSync(executable)) return undefined;\n try {\n const marker = JSON.parse(readFileSync(markerPath, \"utf8\")) as Partial<InstallMarker>;\n if (\n marker.name !== toolchain.name ||\n marker.version !== toolchain.version ||\n marker.platform !== platformOf(h) ||\n typeof marker.file !== \"string\" ||\n typeof marker.sha256 !== \"string\" ||\n typeof marker.source !== \"string\"\n )\n return undefined;\n return { dir, executable, marker: marker as InstallMarker };\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,MAAa,YAAiC;CAC5C;CACA;CACA;CACA;CACA;AACF;AAoCA,SAAgB,OAAa;CAC3B,OAAO;EAAE,UAAU,QAAQ;EAAU,MAAM,QAAQ;EAAM,KAAK,QAAQ;EAAK,MAAM,QAAQ;CAAE;AAC7F;AAEA,SAAgB,WAAW,GAA+B;CACxD,MAAM,MAAM,GAAG,EAAE,SAAS,GAAG,EAAE;CAC/B,OAAQ,UAAgC,SAAS,GAAG,IAAK,MAAmB,KAAA;AAC9E;;;;;;;;AASA,SAAgB,SAAS,IAAU,KAAK,GAAW;CACjD,MAAM,MAAM,EAAE,IAAI;CAClB,IAAI,KAAK,OAAO,QAAQ,GAAG;CAC3B,IAAI,EAAE,aAAa,UAAU,OAAO,KAAK,EAAE,MAAM,WAAW,UAAU,QAAQ;CAC9E,IAAI,EAAE,aAAa,SACjB,OAAO,KAAK,EAAE,IAAI,mBAAmB,KAAK,EAAE,MAAM,WAAW,OAAO,GAAG,UAAU,OAAO;CAC1F,OAAO,QAAQ,EAAE,IAAI,qBAAqB,KAAK,EAAE,MAAM,QAAQ,GAAG,QAAQ;AAC5E;;AAGA,SAAgB,aACd,OACA,WACQ;CACR,OAAO,KAAK,OAAO,cAAc,UAAU,MAAM,UAAU,OAAO;AACpE;;AAGA,MAAa,aAAa;AAY1B,SAAgB,eAAe,WAA0C,GAAiB;CACxF,OAAO,EAAE,aAAa,UAAU,GAAG,UAAU,WAAW,QAAQ,UAAU;AAC5E;;;;;;AAaA,SAAgB,UAAU,WAAsB,IAAU,KAAK,GAA0B;CACvF,MAAM,MAAM,aAAa,SAAS,CAAC,GAAG,SAAS;CAC/C,MAAM,aAAa,KAAK,KAAK,eAAe,WAAW,CAAC,CAAC;CACzD,MAAM,aAAa,KAAK,KAAK,UAAU;CACvC,IAAI,CAAC,WAAW,UAAU,KAAK,CAAC,WAAW,UAAU,GAAG,OAAO,KAAA;CAC/D,IAAI;EACF,MAAM,SAAS,KAAK,MAAM,aAAa,YAAY,MAAM,CAAC;EAC1D,IACE,OAAO,SAAS,UAAU,QAC1B,OAAO,YAAY,UAAU,WAC7B,OAAO,aAAa,WAAW,CAAC,KAChC,OAAO,OAAO,SAAS,YACvB,OAAO,OAAO,WAAW,YACzB,OAAO,OAAO,WAAW,UAEzB,OAAO,KAAA;EACT,OAAO;GAAE;GAAK;GAAoB;EAAwB;CAC5D,QAAQ;EACN;CACF;AACF"}
@@ -0,0 +1,12 @@
1
+ // packages/core/src/verdict.ts
2
+ /** One line per verdict, for error messages; full rendering lives in `report`. */
3
+ function describeVerdict(v) {
4
+ switch (v.kind) {
5
+ case "VIOLATED": return `VIOLATED ${v.scenario}: ${v.violation.message} (seed ${v.schedule.seed}, ${v.reached.runs} run(s))`;
6
+ case "BOUNDED": return `BOUNDED ${v.scenario}: no violation in ${v.reached.runs} run(s), ${v.reached.effectPoints} effect point(s), ${v.reached.faultsInjected} fault(s)`;
7
+ case "UNSUPPORTED": return `UNSUPPORTED ${v.scenario}: ${v.cause}: ${v.reason}`;
8
+ }
9
+ }
10
+ export { describeVerdict as t };
11
+
12
+ //# sourceMappingURL=verdict-evEM5Gxx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verdict-evEM5Gxx.mjs","names":[],"sources":["../../core/src/verdict.ts"],"sourcesContent":["/** Simulation verdicts, with what each one rests on. */\n\nimport type { EffectLog } from \"./effect-log.ts\";\nimport type { Schedule } from \"./faults.ts\";\nimport type { PinnedSchedule } from \"./pinned-schedules.ts\";\nimport type { Bounds } from \"./scenario.ts\";\nimport type { Violation } from \"./violation.ts\";\n\n/** How far exploration got: runs, effect points, faults injected and time taken, and coverage when exhaustive. */\nexport interface BoundsReached {\n readonly runs: number;\n readonly effectPoints: number;\n readonly faultsInjected: number;\n readonly elapsedMs: number;\n /**\n * Present when exploration was exhaustive: how many distinct schedules ran\n * (runs that only repeated an order the reduction had covered are not\n * counted), and whether every schedule within the bounds was reached\n * before the budget ran out.\n */\n readonly exhaustive?: {\n readonly complete: boolean;\n readonly schedules: number;\n readonly reduction: boolean;\n };\n}\n\ninterface VerdictBase {\n readonly scenario: string;\n readonly seed: number | string;\n readonly reached: BoundsReached;\n readonly assumptions: readonly string[];\n}\n\nexport interface Shrunk {\n readonly faultsRemoved: number;\n readonly eventsRemoved: number;\n readonly runs: number;\n}\n\n/** An invariant broke: the violation, the shrunk schedule that reproduces it and its trace. */\nexport interface Violated extends VerdictBase {\n readonly kind: \"VIOLATED\";\n readonly violation: Violation;\n /** The replayed, shrunk trace that breaks the invariant. */\n readonly trace: EffectLog;\n readonly schedule: Schedule;\n /** Ids of the drive's events that remain after shrinking. */\n readonly keptEvents: readonly string[];\n readonly shrunk: Shrunk;\n /**\n * The name of the scenario's pinned schedule whose run broke the\n * invariant; its schedule is that run's, as it ran (not shrunk). Absent\n * when exploration found it.\n */\n readonly pinned?: string;\n /** The pinned schedule's faults its run did not place, each with why; absent when it placed them all. */\n readonly unplaced?: readonly string[];\n}\n\n/** No violation within the stated bounds; not a proof. */\nexport interface Bounded extends VerdictBase {\n readonly kind: \"BOUNDED\";\n readonly bounds: Bounds;\n}\n\nexport type UnsupportedCause =\n | \"unsupported_api\"\n | \"not_replayable\"\n | \"module_state_leak\"\n | \"unsupported_bounds\"\n | \"pin_not_placed\";\n\n/** The run did something the simulation cannot control or replay, so no claim is made: the cause and the reason. */\nexport interface Unsupported extends VerdictBase {\n readonly kind: \"UNSUPPORTED\";\n readonly cause: UnsupportedCause;\n readonly reason: string;\n /**\n * The schedule of the run that reached it, to replay; absent where no run\n * was made (`unsupported_bounds`). It is the run's own, not shrunk. A run\n * that ended on real time (an effect that outlasted the budget, code\n * waiting on something outside the simulation) may not end at the same\n * place when replayed.\n */\n readonly schedule?: Schedule;\n /**\n * For `unsupported_api`, the same run as a pinned schedule, present once\n * that run replayed alone reached the same reason again: each fault\n * at the call it hit, by its target, op and arguments and that call's\n * number among the run's matching calls, under the run's seed (and its\n * turns when it recorded them), so a replay still finds the call when\n * the faults or effects before it move invocations and positions.\n */\n readonly replay?: PinnedSchedule;\n}\n\n/** A scenario's verdict: `VIOLATED`, `BOUNDED` or `UNSUPPORTED`. */\nexport type ScenarioVerdict = Violated | Bounded | Unsupported;\n\n/** One line per verdict, for error messages; full rendering lives in `report`. */\nexport function describeVerdict(v: ScenarioVerdict): string {\n switch (v.kind) {\n case \"VIOLATED\":\n return `VIOLATED ${v.scenario}: ${v.violation.message} (seed ${v.schedule.seed}, ${v.reached.runs} run(s))`;\n case \"BOUNDED\":\n return `BOUNDED ${v.scenario}: no violation in ${v.reached.runs} run(s), ${v.reached.effectPoints} effect point(s), ${v.reached.faultsInjected} fault(s)`;\n case \"UNSUPPORTED\":\n return `UNSUPPORTED ${v.scenario}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;AAqGA,SAAgB,gBAAgB,GAA4B;CAC1D,QAAQ,EAAE,MAAV;EACE,KAAK,YACH,OAAO,YAAY,EAAE,SAAS,IAAI,EAAE,UAAU,QAAQ,SAAS,EAAE,SAAS,KAAK,IAAI,EAAE,QAAQ,KAAK;EACpG,KAAK,WACH,OAAO,WAAW,EAAE,SAAS,oBAAoB,EAAE,QAAQ,KAAK,WAAW,EAAE,QAAQ,aAAa,oBAAoB,EAAE,QAAQ,eAAe;EACjJ,KAAK,eACH,OAAO,eAAe,EAAE,SAAS,IAAI,EAAE,MAAM,IAAI,EAAE;CACvD;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eutaxy",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Deterministic simulation and formal proof for TypeScript on Cloudflare Workers",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -66,6 +66,9 @@
66
66
  "typescript": ">=7.1.0-beta"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
+ "typescript": {
70
+ "optional": true
71
+ },
69
72
  "@cloudflare/workers-types": {
70
73
  "optional": true
71
74
  },