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,269 @@
1
+ import { o as canonicalJson } from "./src-BtLZPRyG.mjs";
2
+ // packages/report/src/regression.ts
3
+ /**
4
+ * The Vitest regression emitter. Given a violation, produce a test file that
5
+ * replays its shrunk schedule on the restricted scenario. By default the
6
+ * test expects the invariants to hold, so it fails while the bug exists and
7
+ * passes once it is fixed. With `expect: "violates"` it asserts the recorded
8
+ * violation instead, which is how Eutaxy's own corpus exercises the emitter.
9
+ *
10
+ * The emitter knows nothing about any platform: the caller supplies the
11
+ * import lines and the expression that builds the platform.
12
+ */
13
+ /**
14
+ * A Vitest test file that replays a violation's shrunk schedule: by default it fails while the bug is
15
+ * there and passes once it is fixed.
16
+ */
17
+ function emitRegressionTest(verdict, options) {
18
+ const engineModule = options.engineModule ?? "eutaxy";
19
+ const mode = options.expect ?? "holds";
20
+ const schedule = canonicalJson(verdict.schedule);
21
+ const kept = canonicalJson([...verdict.keptEvents]);
22
+ const keys = canonicalJson([...verdict.violation.keys]);
23
+ const title = mode === "holds" ? `${verdict.scenario}: ${verdict.violation.invariant} holds on the recorded schedule` : `${verdict.scenario}: ${verdict.violation.invariant} is still violated on the recorded schedule`;
24
+ const assertion = mode === "holds" ? ` expect(violations.map((v) => \`\${v.invariant}: \${v.message}\`)).toEqual([]);` : ` expect(violations.map((v) => [v.invariant, v.keys])).toContainEqual([${JSON.stringify(verdict.violation.invariant)}, ${keys}]);`;
25
+ const observe = options.observe ?? [];
26
+ const replayLines = observe.length === 0 ? [" const log = await replay(spec, platform, schedule);"] : [
27
+ ` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(", ")}];`,
28
+ " const log = await replay(spec, platform, schedule).finally(() => {",
29
+ " for (const o of observers) o.restore();",
30
+ " });"
31
+ ];
32
+ return [
33
+ "// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.",
34
+ `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,
35
+ ...verdict.pinned === void 0 ? [] : [`// The run of the scenario's pinned schedule ${JSON.stringify(verdict.pinned)} under seed ${verdict.schedule.seed}, as it ran.`],
36
+ `import { checkInvariants, ${observe.length > 0 ? "observeCore, " : ""}replay, restrictSpec } from ${JSON.stringify(engineModule)};`,
37
+ ...options.imports,
38
+ "import { expect, test } from \"vitest\";",
39
+ "",
40
+ `const schedule = ${schedule} as const;`,
41
+ `const keptEvents = ${kept} as const;`,
42
+ "",
43
+ `test(${JSON.stringify(title)}, async () => {`,
44
+ ` const platform = ${options.platform};`,
45
+ ` const spec = restrictSpec(platform, ${options.scenario}, keptEvents);`,
46
+ ...replayLines,
47
+ " const violations = checkInvariants(log, spec.invariants);",
48
+ assertion,
49
+ "});",
50
+ ""
51
+ ].join("\n");
52
+ }
53
+ /**
54
+ * A Vitest test file that replays the run that made a check `UNSUPPORTED`, as its verdict's `replay`
55
+ * names it (each fault at the call it hit, by target, op, arguments and call number), and expects
56
+ * the run to place every fault and reach the same reason: a reproduction to look into, which fails
57
+ * once the run no longer gets there. Only for `unsupported_api`, which one run reaches again (other
58
+ * causes throw). `engineModule` as for `emitRegressionTest`; it exports `runPinned`.
59
+ */
60
+ function emitUnsupportedTest(verdict, options) {
61
+ if (verdict.cause !== "unsupported_api") throw new Error(`a ${verdict.cause} verdict is not reached again by replaying one run; only unsupported_api is`);
62
+ if (verdict.replay === void 0) throw new Error("the verdict has no run to replay: it was reached before any run");
63
+ const engineModule = options.engineModule ?? "eutaxy";
64
+ const pinned = canonicalJson(verdict.replay);
65
+ const observe = options.observe ?? [];
66
+ const runLines = observe.length === 0 ? [` const run = await runPinned(${options.scenario}, platform, pinned);`] : [
67
+ ` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(", ")}];`,
68
+ ` const run = await runPinned(${options.scenario}, platform, pinned).finally(() => {`,
69
+ " for (const o of observers) o.restore();",
70
+ " });"
71
+ ];
72
+ return [
73
+ "// Generated by Eutaxy. Replays the run that made a check UNSUPPORTED; regenerate rather than edit.",
74
+ `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.cause}: ${verdict.reason.replace(/\s+/g, " ")}`,
75
+ `import { ${observe.length > 0 ? "observeCore, " : ""}runPinned } from ${JSON.stringify(engineModule)};`,
76
+ ...options.imports,
77
+ "import { expect, test } from \"vitest\";",
78
+ "",
79
+ pinned.includes("\"__proto__\"") ? `const pinned = JSON.parse(${JSON.stringify(pinned)});` : `const pinned = ${pinned} as const;`,
80
+ "",
81
+ `test(${JSON.stringify(`${verdict.scenario}: the recorded run still reaches what made the check UNSUPPORTED`)}, async () => {`,
82
+ ` const platform = ${options.platform};`,
83
+ ...runLines,
84
+ " expect(run.unplaced).toEqual([]);",
85
+ ` expect(run.unsupportedReasons.join("; ")).toBe(${JSON.stringify(verdict.reason)});`,
86
+ "});",
87
+ ""
88
+ ].join("\n");
89
+ }
90
+ /**
91
+ * The JSON report: one object, canonical, with a schema version at the top.
92
+ * Spec verdicts, when there are any, sit beside the scenario's, never in it.
93
+ */
94
+ function renderJson(verdict, specs = []) {
95
+ return canonicalJson({
96
+ schemaVersion: 1,
97
+ generator: "eutaxy",
98
+ verdict,
99
+ ...specs.length > 0 ? { specs } : {}
100
+ });
101
+ }
102
+ const specsHeader = "Specs (CHECKED means held on the inputs the simulator passed, TESTED on generated ones too; neither is a proof. PROVEN is one, by the named engine)";
103
+ /** Spec verdicts as text: one line each, a counterexample under a refutation. */
104
+ function renderSpecs(specs) {
105
+ if (specs.length === 0) return "";
106
+ return [specsHeader, ...specs.flatMap(specLines)].join("\n");
107
+ }
108
+ /** The order a report counts verdicts in: strongest evidence first, then what needs attention. */
109
+ const verdictOrder = [
110
+ "PROVEN",
111
+ "TESTED",
112
+ "CHECKED",
113
+ "REFUTED",
114
+ "CONFLICT",
115
+ "UNKNOWN"
116
+ ];
117
+ /**
118
+ * `eutaxy report` as text: the spec verdicts grouped by module, in the
119
+ * order given, and one closing line counting them by verdict.
120
+ */
121
+ function renderSpecReport(specs) {
122
+ if (specs.length === 0) return "No specs found.";
123
+ const modules = [...new Set(specs.map((v) => v.module))];
124
+ const out = ["Specs (TESTED means held on inputs generated from the parameter types, which is not a proof; PROVEN is one, by the named engine)"];
125
+ for (const m of modules) {
126
+ out.push("", m);
127
+ for (const v of specs) if (v.module === m) out.push(...specLines(v));
128
+ }
129
+ const counts = verdictOrder.map((k) => [k, specs.filter((v) => v.kind === k).length]).filter(([, n]) => n > 0).map(([k, n]) => `${n} ${k}`);
130
+ out.push("", `${specs.length} propert${specs.length === 1 ? "y" : "ies"} in ${modules.length} module${modules.length === 1 ? "" : "s"}: ${counts.join(", ")}`);
131
+ return out.join("\n");
132
+ }
133
+ /** `eutaxy report --json`: canonical, with the schema version, the spec verdicts and nothing else. */
134
+ function renderSpecReportJson(specs) {
135
+ return canonicalJson({
136
+ schemaVersion: 1,
137
+ generator: "eutaxy",
138
+ specs
139
+ });
140
+ }
141
+ function specLines(v) {
142
+ const out = [];
143
+ const what = `${v.function} ${v.property}`;
144
+ switch (v.kind) {
145
+ case "CHECKED":
146
+ out.push(` CHECKED ${what}: held on ${v.inputs} input(s)${v.discarded > 0 ? `, ${v.discarded} outside the claim` : ""}`);
147
+ break;
148
+ case "TESTED":
149
+ out.push(` TESTED ${what}: held on ${v.inputs} generated input(s)${v.checked === void 0 ? "" : ` and ${v.checked} the simulator passed`}${v.discarded > 0 ? `, ${v.discarded} outside the claim` : ""}`);
150
+ break;
151
+ case "PROVEN": {
152
+ const beside = [...v.tested === void 0 ? [] : [`${v.tested} generated input(s)`], ...v.checked === void 0 ? [] : [`${v.checked} the simulator passed`]];
153
+ out.push(` PROVEN ${what}: by ${v.engine.name} ${v.engine.version}${beside.length > 0 ? `; also held on ${beside.join(" and ")}` : ""}`);
154
+ break;
155
+ }
156
+ case "CONFLICT":
157
+ out.push(` CONFLICT ${what}: ${v.proven.name} ${v.proven.version} proves it, ${v.refuted.name} ${v.refuted.version} refutes it; not resolved automatically`);
158
+ if (v.refuted.counterexample) out.push(` ${v.refuted.counterexample.binders.map((b) => `${b.name} = ${b.value}`).join(", ")}`);
159
+ break;
160
+ case "REFUTED": {
161
+ const c = v.counterexample;
162
+ const where = v.rung === "PROVEN" ? `by ${v.engine?.name ?? "an engine"}` : c.call === void 0 ? "on a generated input" : `at ${c.call}`;
163
+ out.push(` REFUTED ${what}: false ${where}${c.error ? `, which threw ${c.error}` : ""}`);
164
+ if (c.binders.length > 0) out.push(` ${c.binders.map((b) => `${b.name} = ${b.value}`).join(", ")}`);
165
+ out.push(` ${v.text.replace(/\s+/g, " ")}`);
166
+ break;
167
+ }
168
+ case "UNKNOWN": out.push(` UNKNOWN ${what}: ${v.cause}: ${v.reason}`);
169
+ }
170
+ for (const a of v.assumptions) if (v.kind === "PROVEN" || a.startsWith("not PROVEN by ")) out.push(` ${a}`);
171
+ return out;
172
+ }
173
+ function clip(s, max) {
174
+ return s.length <= max ? s : `${s.slice(0, max - 1)}…`;
175
+ }
176
+ function pad(s, width) {
177
+ return s.length >= width ? s : s + " ".repeat(width - s.length);
178
+ }
179
+ /** The trace as a fixed-width table; evidence rows are marked with `*`. */
180
+ function renderTrace(log, evidence = []) {
181
+ const rows = log.entries.map((e) => [
182
+ evidence.includes(e.seq) ? "*" : " ",
183
+ String(e.seq),
184
+ e.invocation,
185
+ e.kind,
186
+ e.target,
187
+ e.op,
188
+ clip(canonicalJson(e.payload), 72)
189
+ ]);
190
+ const header = [
191
+ " ",
192
+ "seq",
193
+ "invocation",
194
+ "kind",
195
+ "target",
196
+ "op",
197
+ "payload"
198
+ ];
199
+ const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i].length)));
200
+ const line = (cells) => cells.map((c, i) => i === cells.length - 1 ? c : pad(c, widths[i])).join(" ").trimEnd();
201
+ return [line(header), ...rows.map(line)].join("\n");
202
+ }
203
+ /** A schedule's faults, one a line, as a report lists them. */
204
+ function faultLines(schedule) {
205
+ if (schedule.faults.length === 0) return [" no injected faults"];
206
+ return schedule.faults.map((f) => ` ${f.fault} at ${f.invocation} effect #${f.ordinal} (${f.target} ${f.op})`);
207
+ }
208
+ /**
209
+ * A readable report: verdict, what it rests on, for a violation the schedule and trace, and for a
210
+ * scenario that could not be decided the schedule of the run that reached that.
211
+ */
212
+ function renderText(verdict) {
213
+ const out = [];
214
+ const r = verdict.reached;
215
+ out.push(`${verdict.kind} ${verdict.scenario} (seed ${String(verdict.seed)})`);
216
+ switch (verdict.kind) {
217
+ case "VIOLATED":
218
+ out.push("");
219
+ out.push(`Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`);
220
+ out.push(`Keys: ${verdict.violation.keys.join(", ")}`);
221
+ out.push("");
222
+ if (verdict.pinned === void 0) {
223
+ out.push(`Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(", ")}`);
224
+ out.push(...faultLines(verdict.schedule));
225
+ out.push(`Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`);
226
+ } else {
227
+ out.push(`Pinned schedule ${JSON.stringify(verdict.pinned)} (run seed ${verdict.schedule.seed}), as it ran, not shrunk; events: ${verdict.keptEvents.join(", ")}`);
228
+ out.push(...faultLines(verdict.schedule));
229
+ for (const u of verdict.unplaced ?? []) out.push(` not placed: ${u}`);
230
+ }
231
+ out.push("");
232
+ out.push("Trace:");
233
+ out.push(renderTrace(verdict.trace, verdict.violation.evidence));
234
+ break;
235
+ case "BOUNDED": {
236
+ const b = verdict.bounds;
237
+ out.push("");
238
+ out.push("No violation found within the stated bounds. This is not a proof.");
239
+ out.push(`Bounds: faults per run ≤ ${b.maxFaultsPerRun}, redeliveries ≤ ${b.maxRedeliveries}, concurrent invocations ≤ ${b.maxConcurrentInvocations}, budget ${b.budgetMs} ms`);
240
+ break;
241
+ }
242
+ case "UNSUPPORTED":
243
+ out.push("");
244
+ out.push(`Eutaxy could not decide this scenario (${verdict.cause}): ${verdict.reason}`);
245
+ if (verdict.schedule) {
246
+ out.push("");
247
+ out.push(`Schedule of the run that reached it (run seed ${verdict.schedule.seed}), as it ran, not shrunk:`);
248
+ out.push(...faultLines(verdict.schedule));
249
+ if (verdict.schedule.turns) out.push(` ${verdict.schedule.turns.length} turn(s) picked; the JSON report has them, to replay the run`);
250
+ }
251
+ }
252
+ out.push("");
253
+ out.push(`Explored: ${r.runs} run(s), ${r.effectPoints} effect point(s), ${r.faultsInjected} fault(s) injected, ${r.elapsedMs} ms`);
254
+ const e = r.exhaustive;
255
+ if (e) {
256
+ const stopped = {
257
+ VIOLATED: "stopped at the first violation",
258
+ BOUNDED: "stopped at the budget before every schedule ran",
259
+ UNSUPPORTED: "stopped where the scenario could not be decided"
260
+ }[verdict.kind];
261
+ out.push(`Exhaustive: ${e.complete ? "every schedule within the bounds ran" : stopped} (${e.schedules} schedules${e.reduction ? ", partial-order reduction" : ""})`);
262
+ }
263
+ out.push("Assumptions:");
264
+ for (const a of verdict.assumptions) out.push(` - ${a}`);
265
+ return out.join("\n");
266
+ }
267
+ export { renderText as a, emitUnsupportedTest as c, renderSpecs as i, renderSpecReport as n, renderTrace as o, renderSpecReportJson as r, emitRegressionTest as s, renderJson as t };
268
+
269
+ //# sourceMappingURL=src-COuquJvI.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"src-COuquJvI.mjs","names":[],"sources":["../../report/src/regression.ts","../../report/src/render.ts"],"sourcesContent":["/**\n * The Vitest regression emitter. Given a violation, produce a test file that\n * replays its shrunk schedule on the restricted scenario. By default the\n * test expects the invariants to hold, so it fails while the bug exists and\n * passes once it is fixed. With `expect: \"violates\"` it asserts the recorded\n * violation instead, which is how Eutaxy's own corpus exercises the emitter.\n *\n * The emitter knows nothing about any platform: the caller supplies the\n * import lines and the expression that builds the platform.\n */\n\nimport { canonicalJson, type JsonValue, type Unsupported, type Violated } from \"@eutaxy/core\";\n\n/** What the emitted test imports, the expressions for its platform and scenario, and what it expects. */\nexport interface RegressionTestOptions {\n /** Import lines for the scenario, the platform's dependencies, and anything the platform expression needs. */\n readonly imports: readonly string[];\n /** An expression evaluating to the `Platform` (may reference the imports). */\n readonly platform: string;\n /** An expression evaluating to the `ScenarioSpec`. */\n readonly scenario: string;\n /** Module that exports `replay`, `restrictSpec` and `checkInvariants`; the public facade by default. */\n readonly engineModule?: string;\n readonly expect?: \"holds\" | \"violates\";\n /**\n * Core functions to observe during the replay, as `refines` needs their\n * decisions in the log: an expression for each module's namespace (from\n * the imports) and the functions to observe on it.\n */\n readonly observe?: readonly {\n readonly namespace: string;\n readonly functions: readonly string[];\n }[];\n}\n\n/**\n * A Vitest test file that replays a violation's shrunk schedule: by default it fails while the bug is\n * there and passes once it is fixed.\n */\nexport function emitRegressionTest(verdict: Violated, options: RegressionTestOptions): string {\n const engineModule = options.engineModule ?? \"eutaxy\";\n const mode = options.expect ?? \"holds\";\n const schedule = canonicalJson(verdict.schedule as unknown as JsonValue);\n const kept = canonicalJson([...verdict.keptEvents]);\n const keys = canonicalJson([...verdict.violation.keys]);\n const title =\n mode === \"holds\"\n ? `${verdict.scenario}: ${verdict.violation.invariant} holds on the recorded schedule`\n : `${verdict.scenario}: ${verdict.violation.invariant} is still violated on the recorded schedule`;\n const assertion =\n mode === \"holds\"\n ? ` expect(violations.map((v) => \\`\\${v.invariant}: \\${v.message}\\`)).toEqual([]);`\n : ` expect(violations.map((v) => [v.invariant, v.keys])).toContainEqual([${JSON.stringify(verdict.violation.invariant)}, ${keys}]);`;\n const observe = options.observe ?? [];\n const replayLines =\n observe.length === 0\n ? [\" const log = await replay(spec, platform, schedule);\"]\n : [\n ` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(\", \")}];`,\n \" const log = await replay(spec, platform, schedule).finally(() => {\",\n \" for (const o of observers) o.restore();\",\n \" });\",\n ];\n const lines = [\n \"// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.\",\n `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,\n ...(verdict.pinned === undefined\n ? []\n : [\n `// The run of the scenario's pinned schedule ${JSON.stringify(verdict.pinned)} under seed ${verdict.schedule.seed}, as it ran.`,\n ]),\n `import { checkInvariants, ${observe.length > 0 ? \"observeCore, \" : \"\"}replay, restrictSpec } from ${JSON.stringify(engineModule)};`,\n ...options.imports,\n 'import { expect, test } from \"vitest\";',\n \"\",\n `const schedule = ${schedule} as const;`,\n `const keptEvents = ${kept} as const;`,\n \"\",\n `test(${JSON.stringify(title)}, async () => {`,\n ` const platform = ${options.platform};`,\n ` const spec = restrictSpec(platform, ${options.scenario}, keptEvents);`,\n ...replayLines,\n \" const violations = checkInvariants(log, spec.invariants);\",\n assertion,\n \"});\",\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n\n/**\n * A Vitest test file that replays the run that made a check `UNSUPPORTED`, as its verdict's `replay`\n * names it (each fault at the call it hit, by target, op, arguments and call number), and expects\n * the run to place every fault and reach the same reason: a reproduction to look into, which fails\n * once the run no longer gets there. Only for `unsupported_api`, which one run reaches again (other\n * causes throw). `engineModule` as for `emitRegressionTest`; it exports `runPinned`.\n */\nexport function emitUnsupportedTest(\n verdict: Unsupported,\n options: Omit<RegressionTestOptions, \"expect\">,\n): string {\n // A leak shows only after other runs, a run that did not replay has nothing to pin, and a pin\n // not placed is the scenario's own: only a run that met something outside the model reaches it again.\n if (verdict.cause !== \"unsupported_api\")\n throw new Error(\n `a ${verdict.cause} verdict is not reached again by replaying one run; only unsupported_api is`,\n );\n if (verdict.replay === undefined)\n throw new Error(\"the verdict has no run to replay: it was reached before any run\");\n const engineModule = options.engineModule ?? \"eutaxy\";\n const pinned = canonicalJson(verdict.replay as unknown as JsonValue);\n const observe = options.observe ?? [];\n const runLines =\n observe.length === 0\n ? [` const run = await runPinned(${options.scenario}, platform, pinned);`]\n : [\n ` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(\", \")}];`,\n ` const run = await runPinned(${options.scenario}, platform, pinned).finally(() => {`,\n \" for (const o of observers) o.restore();\",\n \" });\",\n ];\n const lines = [\n \"// Generated by Eutaxy. Replays the run that made a check UNSUPPORTED; regenerate rather than edit.\",\n `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.cause}: ${verdict.reason.replace(/\\s+/g, \" \")}`,\n `import { ${observe.length > 0 ? \"observeCore, \" : \"\"}runPinned } from ${JSON.stringify(engineModule)};`,\n ...options.imports,\n 'import { expect, test } from \"vitest\";',\n \"\",\n // In an object literal a \"__proto__\" key sets the prototype, so arguments that have one are\n // read back with JSON.parse, which keeps it as an own key the address must match.\n pinned.includes('\"__proto__\"')\n ? `const pinned = JSON.parse(${JSON.stringify(pinned)});`\n : `const pinned = ${pinned} as const;`,\n \"\",\n `test(${JSON.stringify(`${verdict.scenario}: the recorded run still reaches what made the check UNSUPPORTED`)}, async () => {`,\n ` const platform = ${options.platform};`,\n ...runLines,\n \" expect(run.unplaced).toEqual([]);\",\n ` expect(run.unsupportedReasons.join(\"; \")).toBe(${JSON.stringify(verdict.reason)});`,\n \"});\",\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n","/**\n * Rendering verdicts: a text form for people and a versioned JSON form for\n * CI and coding agents. Both are pure functions over the verdict data.\n */\n\nimport {\n canonicalJson,\n type EffectLog,\n type JsonValue,\n type ScenarioVerdict,\n type Schedule,\n type SpecVerdict,\n} from \"@eutaxy/core\";\n\nexport const reportSchemaVersion = 1;\n\n/**\n * The JSON report: one object, canonical, with a schema version at the top.\n * Spec verdicts, when there are any, sit beside the scenario's, never in it.\n */\nexport function renderJson(verdict: ScenarioVerdict, specs: readonly SpecVerdict[] = []): string {\n return canonicalJson({\n schemaVersion: reportSchemaVersion,\n generator: \"eutaxy\",\n verdict: verdict as unknown as JsonValue,\n ...(specs.length > 0 ? { specs: specs as unknown as JsonValue } : {}),\n });\n}\n\nconst specsHeader =\n \"Specs (CHECKED means held on the inputs the simulator passed, TESTED on generated ones too; neither is a proof. PROVEN is one, by the named engine)\";\n\n/** Spec verdicts as text: one line each, a counterexample under a refutation. */\nexport function renderSpecs(specs: readonly SpecVerdict[]): string {\n if (specs.length === 0) return \"\";\n return [specsHeader, ...specs.flatMap(specLines)].join(\"\\n\");\n}\n\n/** The order a report counts verdicts in: strongest evidence first, then what needs attention. */\nconst verdictOrder = [\"PROVEN\", \"TESTED\", \"CHECKED\", \"REFUTED\", \"CONFLICT\", \"UNKNOWN\"] as const;\n\n/**\n * `eutaxy report` as text: the spec verdicts grouped by module, in the\n * order given, and one closing line counting them by verdict.\n */\nexport function renderSpecReport(specs: readonly SpecVerdict[]): string {\n if (specs.length === 0) return \"No specs found.\";\n const modules = [...new Set(specs.map((v) => v.module))];\n const out = [\n \"Specs (TESTED means held on inputs generated from the parameter types, which is not a proof; PROVEN is one, by the named engine)\",\n ];\n for (const m of modules) {\n out.push(\"\", m);\n for (const v of specs) if (v.module === m) out.push(...specLines(v));\n }\n const counts = verdictOrder\n .map((k) => [k, specs.filter((v) => v.kind === k).length] as const)\n .filter(([, n]) => n > 0)\n .map(([k, n]) => `${n} ${k}`);\n out.push(\n \"\",\n `${specs.length} propert${specs.length === 1 ? \"y\" : \"ies\"} in ${modules.length} module${modules.length === 1 ? \"\" : \"s\"}: ${counts.join(\", \")}`,\n );\n return out.join(\"\\n\");\n}\n\n/** `eutaxy report --json`: canonical, with the schema version, the spec verdicts and nothing else. */\nexport function renderSpecReportJson(specs: readonly SpecVerdict[]): string {\n return canonicalJson({\n schemaVersion: reportSchemaVersion,\n generator: \"eutaxy\",\n specs: specs as unknown as JsonValue,\n });\n}\n\nfunction specLines(v: SpecVerdict): string[] {\n const out: string[] = [];\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n out.push(\n ` CHECKED ${what}: held on ${v.inputs} input(s)${v.discarded > 0 ? `, ${v.discarded} outside the claim` : \"\"}`,\n );\n break;\n case \"TESTED\":\n out.push(\n ` TESTED ${what}: held on ${v.inputs} generated input(s)${v.checked === undefined ? \"\" : ` and ${v.checked} the simulator passed`}${v.discarded > 0 ? `, ${v.discarded} outside the claim` : \"\"}`,\n );\n break;\n case \"PROVEN\": {\n const beside = [\n ...(v.tested === undefined ? [] : [`${v.tested} generated input(s)`]),\n ...(v.checked === undefined ? [] : [`${v.checked} the simulator passed`]),\n ];\n out.push(\n ` PROVEN ${what}: by ${v.engine.name} ${v.engine.version}${beside.length > 0 ? `; also held on ${beside.join(\" and \")}` : \"\"}`,\n );\n break;\n }\n case \"CONFLICT\":\n out.push(\n ` CONFLICT ${what}: ${v.proven.name} ${v.proven.version} proves it, ${v.refuted.name} ${v.refuted.version} refutes it; not resolved automatically`,\n );\n if (v.refuted.counterexample)\n out.push(\n ` ${v.refuted.counterexample.binders.map((b) => `${b.name} = ${b.value}`).join(\", \")}`,\n );\n break;\n case \"REFUTED\": {\n const c = v.counterexample;\n const where =\n v.rung === \"PROVEN\"\n ? `by ${v.engine?.name ?? \"an engine\"}`\n : c.call === undefined\n ? \"on a generated input\"\n : `at ${c.call}`;\n out.push(` REFUTED ${what}: false ${where}${c.error ? `, which threw ${c.error}` : \"\"}`);\n if (c.binders.length > 0)\n out.push(` ${c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \")}`);\n out.push(` ${v.text.replace(/\\s+/g, \" \")}`);\n break;\n }\n case \"UNKNOWN\":\n out.push(` UNKNOWN ${what}: ${v.cause}: ${v.reason}`);\n break;\n }\n // A proof rests on its engine's model of the language: every assumption is shown. Elsewhere, an\n // engine that was asked and fell short says so under the verdict that stands.\n for (const a of v.assumptions)\n if (v.kind === \"PROVEN\" || a.startsWith(\"not PROVEN by \")) out.push(` ${a}`);\n return out;\n}\n\nfunction clip(s: string, max: number): string {\n return s.length <= max ? s : `${s.slice(0, max - 1)}…`;\n}\n\nfunction pad(s: string, width: number): string {\n return s.length >= width ? s : s + \" \".repeat(width - s.length);\n}\n\n/** The trace as a fixed-width table; evidence rows are marked with `*`. */\nexport function renderTrace(log: EffectLog, evidence: readonly number[] = []): string {\n const rows = log.entries.map((e) => [\n evidence.includes(e.seq) ? \"*\" : \" \",\n String(e.seq),\n e.invocation,\n e.kind,\n e.target,\n e.op,\n clip(canonicalJson(e.payload), 72),\n ]);\n const header = [\" \", \"seq\", \"invocation\", \"kind\", \"target\", \"op\", \"payload\"];\n const widths = header.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => (r[i] as string).length)),\n );\n const line = (cells: readonly string[]) =>\n cells\n .map((c, i) => (i === cells.length - 1 ? c : pad(c, widths[i] as number)))\n .join(\" \")\n .trimEnd();\n return [line(header), ...rows.map(line)].join(\"\\n\");\n}\n\n/** A schedule's faults, one a line, as a report lists them. */\nfunction faultLines(schedule: Schedule): string[] {\n if (schedule.faults.length === 0) return [\" no injected faults\"];\n return schedule.faults.map(\n (f) => ` ${f.fault} at ${f.invocation} effect #${f.ordinal} (${f.target} ${f.op})`,\n );\n}\n\n/**\n * A readable report: verdict, what it rests on, for a violation the schedule and trace, and for a\n * scenario that could not be decided the schedule of the run that reached that.\n */\nexport function renderText(verdict: ScenarioVerdict): string {\n const out: string[] = [];\n const r = verdict.reached;\n out.push(`${verdict.kind} ${verdict.scenario} (seed ${String(verdict.seed)})`);\n switch (verdict.kind) {\n case \"VIOLATED\": {\n out.push(\"\");\n out.push(\n `Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`,\n );\n out.push(`Keys: ${verdict.violation.keys.join(\", \")}`);\n out.push(\"\");\n if (verdict.pinned === undefined) {\n out.push(\n `Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(\", \")}`,\n );\n out.push(...faultLines(verdict.schedule));\n out.push(\n `Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`,\n );\n } else {\n out.push(\n `Pinned schedule ${JSON.stringify(verdict.pinned)} (run seed ${verdict.schedule.seed}), as it ran, not shrunk; events: ${verdict.keptEvents.join(\", \")}`,\n );\n out.push(...faultLines(verdict.schedule));\n for (const u of verdict.unplaced ?? []) out.push(` not placed: ${u}`);\n }\n out.push(\"\");\n out.push(\"Trace:\");\n out.push(renderTrace(verdict.trace, verdict.violation.evidence));\n break;\n }\n case \"BOUNDED\": {\n const b = verdict.bounds;\n out.push(\"\");\n out.push(\"No violation found within the stated bounds. This is not a proof.\");\n out.push(\n `Bounds: faults per run ≤ ${b.maxFaultsPerRun}, redeliveries ≤ ${b.maxRedeliveries}, concurrent invocations ≤ ${b.maxConcurrentInvocations}, budget ${b.budgetMs} ms`,\n );\n break;\n }\n case \"UNSUPPORTED\": {\n out.push(\"\");\n out.push(`Eutaxy could not decide this scenario (${verdict.cause}): ${verdict.reason}`);\n if (verdict.schedule) {\n out.push(\"\");\n out.push(\n `Schedule of the run that reached it (run seed ${verdict.schedule.seed}), as it ran, not shrunk:`,\n );\n out.push(...faultLines(verdict.schedule));\n // The turns an exhaustive run picked are part of the schedule; too many to print.\n if (verdict.schedule.turns)\n out.push(\n ` ${verdict.schedule.turns.length} turn(s) picked; the JSON report has them, to replay the run`,\n );\n }\n break;\n }\n }\n out.push(\"\");\n out.push(\n `Explored: ${r.runs} run(s), ${r.effectPoints} effect point(s), ${r.faultsInjected} fault(s) injected, ${r.elapsedMs} ms`,\n );\n const e = r.exhaustive;\n if (e) {\n const stopped = {\n VIOLATED: \"stopped at the first violation\",\n BOUNDED: \"stopped at the budget before every schedule ran\",\n UNSUPPORTED: \"stopped where the scenario could not be decided\",\n }[verdict.kind];\n out.push(\n `Exhaustive: ${e.complete ? \"every schedule within the bounds ran\" : stopped} (${e.schedules} schedules${e.reduction ? \", partial-order reduction\" : \"\"})`,\n );\n }\n out.push(\"Assumptions:\");\n for (const a of verdict.assumptions) out.push(` - ${a}`);\n return out.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuCA,SAAgB,mBAAmB,SAAmB,SAAwC;CAC5F,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,MAAM,WAAW,cAAc,QAAQ,QAAgC;CACvE,MAAM,OAAO,cAAc,CAAC,GAAG,QAAQ,UAAU,CAAC;CAClD,MAAM,OAAO,cAAc,CAAC,GAAG,QAAQ,UAAU,IAAI,CAAC;CACtD,MAAM,QACJ,SAAS,UACL,GAAG,QAAQ,SAAS,IAAI,QAAQ,UAAU,UAAU,mCACpD,GAAG,QAAQ,SAAS,IAAI,QAAQ,UAAU,UAAU;CAC1D,MAAM,YACJ,SAAS,UACL,qFACA,0EAA0E,KAAK,UAAU,QAAQ,UAAU,SAAS,EAAE,IAAI,KAAK;CACrI,MAAM,UAAU,QAAQ,WAAW,CAAC;CACpC,MAAM,cACJ,QAAQ,WAAW,IACf,CAAC,uDAAuD,IACxD;EACE,wBAAwB,QAAQ,KAAK,MAAM,eAAe,EAAE,UAAU,IAAI,KAAK,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE;EACrH;EACA;EACA;CACF;CAyBN,OAAO;EAvBL;EACA,eAAe,QAAQ,SAAS,SAAS,OAAO,QAAQ,IAAI,EAAE,IAAI,QAAQ,UAAU;EACpF,GAAI,QAAQ,WAAW,KAAA,IACnB,CAAC,IACD,CACE,gDAAgD,KAAK,UAAU,QAAQ,MAAM,EAAE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