eutaxy 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +15 -12
  2. package/dist/aws.d.mts +2 -2
  3. package/dist/aws.mjs +3 -2
  4. package/dist/aws.mjs.map +1 -1
  5. package/dist/bin.mjs +1 -1
  6. package/dist/check-zkHLdWyf.mjs +1281 -0
  7. package/dist/check-zkHLdWyf.mjs.map +1 -0
  8. package/dist/cli-CNAKqV9R.mjs +297 -0
  9. package/dist/cli-CNAKqV9R.mjs.map +1 -0
  10. package/dist/cli.d.mts.map +1 -1
  11. package/dist/cli.mjs +1 -1
  12. package/dist/cloudflare.d.mts +37 -5
  13. package/dist/cloudflare.d.mts.map +1 -1
  14. package/dist/cloudflare.mjs +6417 -3
  15. package/dist/cloudflare.mjs.map +1 -0
  16. package/dist/{delivery-invariants-BRwfZJrs.mjs → delivery-invariants-BJDck0K8.mjs} +2 -2
  17. package/dist/{delivery-invariants-BRwfZJrs.mjs.map → delivery-invariants-BJDck0K8.mjs.map} +1 -1
  18. package/dist/{delivery-invariants-D-_GPOqE.d.mts → delivery-invariants-C3GXJIbg.d.mts} +2 -2
  19. package/dist/{delivery-invariants-D-_GPOqE.d.mts.map → delivery-invariants-C3GXJIbg.d.mts.map} +1 -1
  20. package/dist/draft-DEUDffHa.mjs +467 -0
  21. package/dist/draft-DEUDffHa.mjs.map +1 -0
  22. package/dist/{src-H1Q8ytEx.mjs → generate-TBJM3-2P.mjs} +3 -618
  23. package/dist/generate-TBJM3-2P.mjs.map +1 -0
  24. package/dist/index.d.mts +36 -36
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +6 -3
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/install-DkzpGA5D.mjs +611 -0
  29. package/dist/install-DkzpGA5D.mjs.map +1 -0
  30. package/dist/{explore-D33RP9hF.d.mts → ir-KpC2epGn.d.mts} +70 -70
  31. package/dist/ir-KpC2epGn.d.mts.map +1 -0
  32. package/dist/keys-xtanNmuR.mjs +111 -0
  33. package/dist/keys-xtanNmuR.mjs.map +1 -0
  34. package/dist/mcp-B64Ko6y7.mjs +539 -0
  35. package/dist/mcp-B64Ko6y7.mjs.map +1 -0
  36. package/dist/{platform-CawKCUru.d.mts → platform-Cs9V9t2k.d.mts} +25 -11
  37. package/dist/platform-Cs9V9t2k.d.mts.map +1 -0
  38. package/dist/pool-CXN4CwGY.mjs +61 -0
  39. package/dist/pool-CXN4CwGY.mjs.map +1 -0
  40. package/dist/{provers-DS44OeEm.mjs → provers-D8VaY_OM.mjs} +18 -2
  41. package/dist/provers-D8VaY_OM.mjs.map +1 -0
  42. package/dist/reader-B9FSoEYW.mjs +1 -0
  43. package/dist/reader-Cz6_bLf6.mjs +3774 -0
  44. package/dist/reader-Cz6_bLf6.mjs.map +1 -0
  45. package/dist/report-_Vzavqg0.mjs +310 -0
  46. package/dist/report-_Vzavqg0.mjs.map +1 -0
  47. package/dist/src-B2DpVbMN.mjs +2 -0
  48. package/dist/src-BFGTvuA_.mjs +1235 -0
  49. package/dist/src-BFGTvuA_.mjs.map +1 -0
  50. package/dist/src-BtLZPRyG.mjs +120 -0
  51. package/dist/src-BtLZPRyG.mjs.map +1 -0
  52. package/dist/src-CB8DcvsK.mjs +1 -0
  53. package/dist/src-COuquJvI.mjs +269 -0
  54. package/dist/src-COuquJvI.mjs.map +1 -0
  55. package/dist/src-Chn-m_r1.mjs +1082 -0
  56. package/dist/src-Chn-m_r1.mjs.map +1 -0
  57. package/dist/src-DwYD3QQJ.mjs +346 -0
  58. package/dist/src-DwYD3QQJ.mjs.map +1 -0
  59. package/dist/{src-Whn0RMSh.mjs → src-Dx4QvrQb.mjs} +559 -517
  60. package/dist/src-Dx4QvrQb.mjs.map +1 -0
  61. package/dist/toolchain-DWfymxAJ.mjs +80 -0
  62. package/dist/toolchain-DWfymxAJ.mjs.map +1 -0
  63. package/dist/verdict-evEM5Gxx.mjs +12 -0
  64. package/dist/verdict-evEM5Gxx.mjs.map +1 -0
  65. package/package.json +4 -1
  66. package/dist/cli-DyA7uTBg.mjs +0 -9447
  67. package/dist/cli-DyA7uTBg.mjs.map +0 -1
  68. package/dist/explore-D33RP9hF.d.mts.map +0 -1
  69. package/dist/platform-CawKCUru.d.mts.map +0 -1
  70. package/dist/provers-DS44OeEm.mjs.map +0 -1
  71. package/dist/src-H1Q8ytEx.mjs.map +0 -1
  72. package/dist/src-Whn0RMSh.mjs.map +0 -1
  73. package/dist/workerd-tI8INa6v.mjs +0 -6334
  74. package/dist/workerd-tI8INa6v.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-zkHLdWyf.mjs","names":["toPosix"],"sources":["../../cli/src/resolve.ts","../../cli/src/wrangler.ts","../../cli/src/callees.ts","../../cli/src/vitest-failure.ts","../../cli/src/generate.ts","../../cli/src/specs.ts","../../cli/src/check.ts"],"sourcesContent":["/**\n * Relative imports from a `.ts` file that Node cannot resolve are tried as\n * TypeScript resolves them, so `./domain.js` and `./domain` find `domain.ts`\n * (or `domain/index.ts`), as `tsc` and Vite would. Used where the command\n * imports a user's module in Node: `eutaxy report` for spec modules, `eutaxy\n * check` for a scenario that names callees.\n */\n\nimport { registerHooks } from \"node:module\";\n\nlet registered = false;\n\n/** Register the hook once per process. */\nexport function resolveAsTypeScript(): void {\n if (registered) return;\n registered = true;\n registerHooks({\n resolve(specifier, context, nextResolve) {\n try {\n return nextResolve(specifier, context);\n } catch (err) {\n const relative = specifier.startsWith(\"./\") || specifier.startsWith(\"../\");\n if (!relative || !context.parentURL?.endsWith(\".ts\")) throw err;\n const stem = specifier.endsWith(\".js\") ? specifier.slice(0, -3) : specifier;\n for (const candidate of [`${stem}.ts`, `${stem}/index.ts`]) {\n try {\n return nextResolve(candidate, context);\n } catch {}\n }\n throw err;\n }\n },\n });\n}\n","/**\n * Wrangler config reading, one copy for `check` and `draft`: JSON and JSONC\n * parsing, the bindings a config declares, and the rules that name their\n * resources (a D1 database's id, an R2 bucket's name, a KV namespace's id,\n * which Durable Object classes are SQLite-backed). Only JSON and JSONC are\n * read; a TOML config is refused.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { basename, extname } from \"node:path\";\nimport type { JsonValue } from \"@eutaxy/core\";\n\n/**\n * JSON with comments and trailing commas, as wrangler.jsonc allows: comments\n * are removed outside strings, a comma before `}` or `]` dropped, and the\n * rest is JSON.\n */\nexport function parseJsonc(text: string): unknown {\n let out = \"\";\n let i = 0;\n /** The index of the next character that is neither whitespace nor inside a comment, from `from`. */\n const nextToken = (from: number): number => {\n let k = from;\n for (;;) {\n while (k < text.length && /\\s/.test(text[k] as string)) k++;\n if (text[k] === \"/\" && text[k + 1] === \"/\") {\n while (k < text.length && text[k] !== \"\\n\") k++;\n } else if (text[k] === \"/\" && text[k + 1] === \"*\") {\n const end = text.indexOf(\"*/\", k + 2);\n k = end < 0 ? text.length : end + 2;\n } else return k;\n }\n };\n while (i < text.length) {\n const c = text[i] as string;\n if (c === '\"') {\n let j = i + 1;\n while (j < text.length && text[j] !== '\"') j += text[j] === \"\\\\\" ? 2 : 1;\n out += text.slice(i, j + 1);\n i = j + 1;\n } else if (c === \"/\" && text[i + 1] === \"/\") {\n while (i < text.length && text[i] !== \"\\n\") i++;\n } else if (c === \"/\" && text[i + 1] === \"*\") {\n const end = text.indexOf(\"*/\", i + 2);\n i = end < 0 ? text.length : end + 2;\n } else if (c === \",\") {\n // A trailing comma, outside strings only: dropped.\n const next = text[nextToken(i + 1)];\n if (next !== \"}\" && next !== \"]\") out += c;\n i++;\n } else {\n out += c;\n i++;\n }\n }\n return JSON.parse(out);\n}\n\n/** Read a wrangler config as an object; only JSON and JSONC are read. */\nexport function readWranglerConfig(path: string): Record<string, unknown> {\n const ext = extname(path);\n if (ext !== \".json\" && ext !== \".jsonc\")\n throw new Error(\n `${basename(path)}: eutaxy reads a wrangler config as JSON or JSONC; a TOML config is not read`,\n );\n const parsed = parseJsonc(readFileSync(path, \"utf8\"));\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed))\n throw new Error(`${basename(path)}: not a wrangler config object`);\n return parsed as Record<string, unknown>;\n}\n\n/** The `name` of a wrangler config, when the config can be read and names one. */\nexport function workerName(path: string): string | undefined {\n try {\n const name = readWranglerConfig(path)[\"name\"];\n return typeof name === \"string\" && name ? name : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** The object entries of a config list; anything else is no entry. */\nexport const list = (v: unknown): Record<string, unknown>[] =>\n Array.isArray(v) ? v.filter((x): x is Record<string, unknown> => typeof x === \"object\" && x) : [];\nconst str = (v: unknown, fallback = \"\"): string => (typeof v === \"string\" ? v : fallback);\nconst strings = (v: unknown): string[] =>\n Array.isArray(v) ? v.filter((x): x is string => typeof x === \"string\") : [];\n\n/** A D1 binding's database: its id, else its name, else the binding (the same database in two configs is one). */\nexport const d1Id = (db: Record<string, unknown>): string =>\n str(db[\"database_id\"], str(db[\"database_name\"], str(db[\"binding\"])));\n/** An R2 binding's bucket: its name, else the binding. */\nexport const r2Bucket = (b: Record<string, unknown>): string =>\n str(b[\"bucket_name\"], str(b[\"binding\"]));\n/** A KV binding's namespace: its id, else the binding. */\nexport const kvId = (k: Record<string, unknown>): string => str(k[\"id\"], str(k[\"binding\"]));\n\n/**\n * The SQLite-backed Durable Object classes of a config, with its migrations applied in order as\n * wrangler applies them: a class is SQLite-backed from the migration that created it so, through\n * renames, until one deletes it.\n */\nexport function sqliteClasses(config: Record<string, unknown>): Set<string> {\n const sqlite = new Set<string>();\n for (const m of list(config[\"migrations\"])) {\n for (const c of strings(m[\"new_sqlite_classes\"])) sqlite.add(c);\n for (const r of list(m[\"renamed_classes\"])) {\n const from = str(r[\"from\"]);\n if (sqlite.delete(from)) sqlite.add(str(r[\"to\"]));\n }\n for (const c of strings(m[\"deleted_classes\"])) sqlite.delete(c);\n }\n return sqlite;\n}\n\n/** The bindings a wrangler config declares, each resource named by the rules above. */\nexport interface WranglerBindings {\n readonly name: string | undefined;\n readonly main: string | undefined;\n readonly d1: readonly { readonly binding: string; readonly id: string }[];\n readonly r2: readonly { readonly binding: string; readonly bucket: string }[];\n readonly kv: readonly { readonly binding: string; readonly id: string }[];\n readonly durableObjects: readonly {\n readonly binding: string;\n readonly className: string;\n readonly sqlite: boolean;\n /** Another Worker's script, when the class is its. */\n readonly scriptName?: string;\n }[];\n readonly workflows: readonly {\n readonly binding: string;\n readonly className: string;\n readonly name: string;\n }[];\n /** The service bindings: the Worker each names, the entrypoint it reaches and the props it carries, when set. */\n readonly services: readonly {\n readonly binding: string;\n readonly service: string;\n readonly entrypoint?: string;\n readonly props?: Readonly<Record<string, JsonValue>>;\n }[];\n readonly queues: readonly { readonly binding: string; readonly queue: string }[];\n readonly vars: Readonly<Record<string, JsonValue>>;\n readonly sqliteClasses: readonly string[];\n /** Every top-level key of the config. */\n readonly keys: readonly string[];\n}\n\n/** Read a config's bindings. */\nexport function readBindings(config: Record<string, unknown>): WranglerBindings {\n const sqlite = sqliteClasses(config);\n const dos = config[\"durable_objects\"] as { bindings?: unknown } | undefined;\n const queues = config[\"queues\"] as { producers?: unknown } | undefined;\n const vars: Record<string, JsonValue> = {};\n const rawVars = config[\"vars\"];\n if (typeof rawVars === \"object\" && rawVars !== null)\n for (const [k, v] of Object.entries(rawVars as Record<string, JsonValue>)) vars[k] = v;\n return {\n name: str(config[\"name\"]) || undefined,\n main: str(config[\"main\"]) || undefined,\n d1: list(config[\"d1_databases\"]).map((d) => ({ binding: str(d[\"binding\"]), id: d1Id(d) })),\n r2: list(config[\"r2_buckets\"]).map((b) => ({\n binding: str(b[\"binding\"]),\n bucket: r2Bucket(b),\n })),\n kv: list(config[\"kv_namespaces\"]).map((k) => ({ binding: str(k[\"binding\"]), id: kvId(k) })),\n durableObjects: list(dos?.bindings).map((b) => {\n const className = str(b[\"class_name\"]);\n return {\n binding: str(b[\"name\"]),\n className,\n sqlite: sqlite.has(className),\n ...(b[\"script_name\"] === undefined ? {} : { scriptName: str(b[\"script_name\"]) }),\n };\n }),\n workflows: list(config[\"workflows\"]).map((w) => ({\n binding: str(w[\"binding\"]),\n className: str(w[\"class_name\"]),\n name: str(w[\"name\"], str(w[\"binding\"])),\n })),\n services: list(config[\"services\"]).map((s) => ({\n binding: str(s[\"binding\"]),\n service: str(s[\"service\"]),\n ...(typeof s[\"entrypoint\"] === \"string\" ? { entrypoint: s[\"entrypoint\"] } : {}),\n ...(typeof s[\"props\"] === \"object\" && s[\"props\"] !== null\n ? { props: s[\"props\"] as Record<string, JsonValue> }\n : {}),\n })),\n queues: list(queues?.producers).map((p) => ({\n binding: str(p[\"binding\"]),\n queue: str(p[\"queue\"]),\n })),\n vars,\n sqliteClasses: [...sqlite],\n keys: Object.keys(config),\n };\n}\n","/**\n * The callees a scenario names (`callee()` steps), read on the Node side for\n * `eutaxy check`. Each callee's wrangler config gives its Worker's name and\n * its bindings; the command adds them to the test's isolate under qualified\n * names (`<name>/<binding>`): the main module it generates re-exports the\n * caller's exports as they are and the callees' Durable Object and Workflow\n * classes under qualified aliases, and the Vitest config's miniflare options\n * add the callees' resources. Probed inside workerd (2026-11): the plugin\n * takes a `main` beside the caller's `wrangler.configPath`, miniflare options\n * add to and override the wrangler config's bindings, and wrangler, miniflare\n * and workerd accept a slash in a binding name.\n */\n\nimport { fork } from \"node:child_process\";\nimport { basename, relative, resolve } from \"node:path\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport type { JsonValue, ScenarioSpec } from \"@eutaxy/core\";\nimport { resolveAsTypeScript } from \"./resolve.ts\";\nimport { readBindings, readWranglerConfig } from \"./wrangler.ts\";\n\n/** A `callee` setup step as the scenario holds it. */\nexport interface CalleeStep {\n readonly binding: string;\n readonly entry: string;\n readonly config: string;\n readonly entrypoint?: string;\n}\n\n/** What a callee's wrangler config says that the test's isolate must hold. */\nexport interface CalleeConfig {\n readonly binding: string;\n /** The Worker's name, which qualifies its bindings. */\n readonly name: string;\n /** The callee's module, absolute. */\n readonly entry: string;\n readonly d1: readonly { readonly binding: string; readonly id: string }[];\n readonly r2: readonly { readonly binding: string; readonly bucket: string }[];\n readonly kv: readonly { readonly binding: string; readonly id: string }[];\n readonly durableObjects: readonly {\n readonly binding: string;\n readonly className: string;\n readonly sqlite: boolean;\n /** The Worker whose script holds the class, when it is another's. */\n readonly scriptName?: string;\n }[];\n readonly workflows: readonly {\n readonly binding: string;\n readonly className: string;\n readonly name: string;\n }[];\n readonly services: readonly string[];\n /** What each of its service bindings carries in its config (the entrypoint reached, the props), for a callee of its own. */\n readonly carries: readonly {\n readonly binding: string;\n readonly entrypoint?: string;\n readonly props?: Readonly<Record<string, JsonValue>>;\n }[];\n readonly queues: readonly { readonly binding: string; readonly queue: string }[];\n readonly vars: Readonly<Record<string, JsonValue>>;\n /** The classes the migrations make SQLite-backed, bound by this Worker or not. */\n readonly sqliteClasses: readonly string[];\n /** Config the command does not carry into the isolate, named so the user knows. */\n readonly notAdded: readonly string[];\n}\n\n/** The `callee` steps of a setup, as the scenario wrote them. */\n/**\n * The vars and secrets the scenario's setup gives a value (`envVar()`, `secret()`), by binding name,\n * a callee's under its qualified one: what the isolate's env holds for them.\n */\nexport function envSteps(setup: ScenarioSpec[\"setup\"]): Record<string, JsonValue> {\n const out: Record<string, JsonValue> = {};\n for (const s of setup) if (s.kind === \"env\") out[String(s[\"binding\"])] = s[\"value\"] as JsonValue;\n return out;\n}\n\nexport function calleeSteps(setup: ScenarioSpec[\"setup\"]): CalleeStep[] {\n return setup\n .filter((s) => s.kind === \"callee\")\n .map((s) => ({\n binding: String(s[\"binding\"]),\n entry: String(s[\"entry\"]),\n config: String(s[\"config\"]),\n ...(s[\"entrypoint\"] === undefined ? {} : { entrypoint: String(s[\"entrypoint\"]) }),\n }));\n}\n\n/**\n * Whether the scenario's source names a callee at all: the command imports\n * the scenario module in Node only then, since reading its steps needs it.\n */\nexport function mentionsCallee(scenarioSource: string): boolean {\n return /\\bcallee\\s*\\(/.test(scenarioSource);\n}\n\n/** What the command reads from the scenario module: its setup and its Worker. */\nexport type LoadedScenario = Pick<ScenarioSpec, \"setup\" | \"worker\">;\n\n/** The argument that makes a process started on this module load one scenario and report it. */\nconst scenarioFlag = \"--eutaxy-load-scenario\";\n\ntype ScenarioOutput =\n | { readonly kind: \"eutaxy-scenario\"; readonly scenario: LoadedScenario }\n | { readonly kind: \"eutaxy-scenario-error\"; readonly message: string };\n\n/** Inside the child: import the scenario and keep what the command reads. */\nasync function loadHere(scenarioPath: string): Promise<LoadedScenario> {\n resolveAsTypeScript();\n const mod = (await import(pathToFileURL(scenarioPath).href)) as { default?: ScenarioSpec };\n const spec = mod.default;\n if (!spec || !Array.isArray(spec.setup) || typeof spec.worker?.entry !== \"string\")\n throw new Error(\"the scenario module's default export is not a scenario\");\n return { setup: spec.setup, worker: spec.worker };\n}\n\nconst send = process.send?.bind(process);\nif (process.argv[2] === scenarioFlag && send) {\n process.once(\"disconnect\", () => process.exit(0));\n process.once(\"message\", async (scenarioPath: string) => {\n let output: ScenarioOutput;\n try {\n output = { kind: \"eutaxy-scenario\", scenario: await loadHere(scenarioPath) };\n } catch (err) {\n output = { kind: \"eutaxy-scenario-error\", message: String(err) };\n }\n send(output, () => process.exit(0));\n });\n}\n\n/** How long a scenario module may take to load before the command gives up on it. */\nconst loadBudgetMs = 60_000;\n\n/**\n * Import the scenario module in Node and return its setup and Worker, in a\n * child process started on this module (as `eutaxy report` loads modules):\n * a long-lived process (the MCP server) would otherwise get Node's cached\n * module after the scenario or what it imports changed. Relative imports\n * are resolved as TypeScript resolves them (`./setup.js` and `./setup` find\n * `setup.ts`). Rejects with what the import threw.\n */\nexport function loadScenario(scenarioPath: string): Promise<LoadedScenario> {\n return new Promise((resolveLoad, reject) => {\n const child = fork(fileURLToPath(import.meta.url), [scenarioFlag], {\n stdio: [\"ignore\", \"ignore\", \"pipe\", \"ipc\"],\n serialization: \"advanced\",\n });\n let errors = \"\";\n child.stderr?.on(\"data\", (d: Buffer) => {\n errors += d.toString();\n });\n let settled = false;\n const settle = (outcome: () => void) => {\n if (settled) return;\n settled = true;\n clearTimeout(timer);\n outcome();\n };\n const timer = setTimeout(() => {\n child.kill(\"SIGKILL\");\n settle(() => reject(new Error(`the scenario module did not load within ${loadBudgetMs} ms`)));\n }, loadBudgetMs);\n child.on(\"message\", (output: ScenarioOutput) => {\n settle(() => {\n if (output.kind === \"eutaxy-scenario\") resolveLoad(output.scenario);\n else reject(new Error(output.message));\n });\n });\n child.once(\"error\", (err) => settle(() => reject(err)));\n child.once(\"close\", (code, signal) =>\n settle(() =>\n reject(\n new Error(\n `the scenario module's process ended (${signal ?? `exit ${code}`}) before reporting${errors ? `:\\n${errors}` : \"\"}`,\n ),\n ),\n ),\n );\n child.send(scenarioPath);\n });\n}\n\n/** The qualified names the callees' bindings get in the isolate, for a regression test's note. */\nexport function isolateBindings(callees: readonly CalleeConfig[]): string[] {\n const names: string[] = [];\n for (const c of callees) {\n for (const d of c.d1) names.push(qualified(c.name, d.binding));\n for (const b of c.r2) names.push(qualified(c.name, b.binding));\n for (const k of c.kv) names.push(qualified(c.name, k.binding));\n for (const o of c.durableObjects)\n if (o.scriptName === undefined) names.push(qualified(c.name, o.binding));\n for (const w of c.workflows) names.push(qualified(c.name, w.binding));\n for (const s of c.services) names.push(qualified(c.name, s));\n for (const q of c.queues) names.push(qualified(c.name, q.binding));\n for (const v of Object.keys(c.vars)) names.push(qualified(c.name, v));\n }\n return names;\n}\n\n/** The keys of a wrangler config whose bindings the command carries into the isolate. */\nconst carried = new Set([\n \"name\",\n \"main\",\n \"compatibility_date\",\n \"compatibility_flags\",\n \"d1_databases\",\n \"r2_buckets\",\n \"kv_namespaces\",\n \"durable_objects\",\n \"migrations\",\n \"workflows\",\n \"services\",\n \"queues\",\n \"vars\",\n \"$schema\",\n \"observability\",\n \"triggers\",\n \"routes\",\n \"route\",\n \"workers_dev\",\n \"account_id\",\n \"placement\",\n \"limits\",\n \"upload_source_maps\",\n \"minify\",\n \"keep_vars\",\n \"preview_urls\",\n]);\n\n/** Read a callee's wrangler config into what the isolate needs; `scenarioDir` resolves the step's paths. */\nexport function readCalleeConfig(step: CalleeStep, scenarioDir: string): CalleeConfig {\n const path = resolve(scenarioDir, step.config);\n const bindings = readBindings(readWranglerConfig(path));\n if (bindings.name === undefined)\n throw new Error(\n `${basename(path)}: the callee's wrangler config has no name, which qualifies its bindings`,\n );\n return {\n binding: step.binding,\n name: bindings.name,\n entry: resolve(scenarioDir, step.entry),\n d1: bindings.d1,\n r2: bindings.r2,\n kv: bindings.kv,\n durableObjects: bindings.durableObjects,\n workflows: bindings.workflows,\n services: bindings.services.map((s) => s.binding),\n carries: bindings.services.map(({ binding, entrypoint, props }) => ({\n binding,\n ...(entrypoint === undefined ? {} : { entrypoint }),\n ...(props === undefined ? {} : { props }),\n })),\n queues: bindings.queues,\n vars: bindings.vars,\n sqliteClasses: bindings.sqliteClasses,\n notAdded: bindings.keys.filter((key) => !carried.has(key)),\n };\n}\n\n/** A Worker's name as an identifier prefix (`my-worker` → `my_worker`, `1st` → `_1st`). */\nconst ident = (s: string): string => {\n const safe = s.replace(/[^A-Za-z0-9_$]/g, \"_\");\n return /^[A-Za-z_$]/.test(safe) ? safe : `_${safe}`;\n};\n\n/** The export name a callee's class gets in the generated main module. */\nexport function classAlias(worker: string, className: string): string {\n return `${ident(worker)}__${className}`;\n}\n\n/** The qualified name of a callee's binding. */\nexport function qualified(worker: string, binding: string): string {\n return `${worker}/${binding}`;\n}\n\nfunction toPosix(p: string): string {\n const s = p.split(\"\\\\\").join(\"/\");\n return s.startsWith(\".\") ? s : `./${s}`;\n}\n\n/**\n * The main module the plugin runs: the caller's exports as they are, and\n * each callee's Durable Object and Workflow classes under qualified aliases,\n * so the miniflare options can bind them. workerd constructs those classes\n * with the main Worker's env, so each alias is a subclass handing its parent\n * the callee's view of it (`calleeEnv`), under which `this.env.DB` is the\n * callee's `<name>/DB`.\n */\nexport function mainModuleSource(\n workDir: string,\n callerEntry: string,\n callees: readonly CalleeConfig[],\n isolate: ReturnType<typeof isolateOf> = noIsolate,\n): string {\n const caller = toPosix(relative(workDir, callerEntry));\n const lines = [\n \"// Generated by eutaxy check; deleted after the run.\",\n `export * from ${JSON.stringify(caller)};`,\n `export { default } from ${JSON.stringify(caller)};`,\n ];\n const adapters: string[] = [];\n // Two bindings may reach one Worker (two entrypoints of it): one adapter per Worker and class.\n const emitted = new Set<string>();\n callees.forEach((c, i) => {\n const classes = [\n ...c.durableObjects.filter((d) => d.scriptName === undefined).map((d) => d.className),\n ...c.workflows.map((w) => w.className),\n // Classes of this script the caller binds, which the callee binds nowhere itself.\n ...(isolate.extraClasses[c.name] ?? []),\n ];\n const unique = [...new Set(classes)].filter((n) => n && !emitted.has(classAlias(c.name, n)));\n if (unique.length === 0) return;\n lines.push(\n `import { ${unique.map((n) => `${n} as callee${i}_${n}`).join(\", \")} } from ${JSON.stringify(toPosix(relative(workDir, c.entry)))};`,\n );\n // The aliases of this callee's bindings: workerd constructs the class with the raw env, where an alias\n // has no key of its own, so the view resolves them.\n const own = Object.fromEntries(\n Object.entries(isolate.aliases).filter(([k]) => k.startsWith(`${c.name}/`)),\n );\n const view = `calleeEnv(${JSON.stringify(c.name)}, env${Object.keys(own).length === 0 ? \"\" : `, ${JSON.stringify(own)}`})`;\n for (const n of unique) {\n emitted.add(classAlias(c.name, n));\n adapters.push(\n `export class ${classAlias(c.name, n)} extends callee${i}_${n} {`,\n ` constructor(ctx: unknown, env: object) {`,\n ` super(ctx as never, ${view} as never);`,\n ` }`,\n `}`,\n );\n }\n });\n if (adapters.length > 0) lines.splice(1, 0, 'import { calleeEnv } from \"eutaxy/cloudflare\";');\n return `${[...lines, ...adapters].join(\"\\n\")}\\n`;\n}\n\n/** The name the generated config gives the function answering a service binding nobody calls. */\nexport const neverCalled = \"neverCalled\";\n\n/**\n * The miniflare options adding the callees' resources under qualified names,\n * as source (an object literal) for the generated Vitest config. Service\n * bindings, the caller's to its callees and the callees' own, are answered\n * by a function of the config's (`neverCalled`): the Worker the caller's\n * config names is not in the isolate, a worker name given through these\n * options must be one the plugin knows, and the binding is never called\n * anyway (the scenario names a callee for it or scripts it); its value is a\n * Fetcher all the same, which is what the platform recognises.\n */\nexport function miniflareOptionsSource(\n callees: readonly CalleeConfig[],\n isolate: ReturnType<typeof isolateOf> = noIsolate,\n /**\n * The caller's own service bindings: each is answered by the platform (scripted with service(), or a\n * callee hosted inside the call), never by the Worker its config names, which the isolate may not hold.\n */\n callerServices: readonly string[] = [],\n /** The vars and secrets the scenario gives a value (`envSteps`), over what the configs give. */\n env: Readonly<Record<string, JsonValue>> = {},\n): string {\n const d1: Record<string, string> = {};\n const r2: Record<string, string> = {};\n const kv: Record<string, string> = {};\n const dos: Record<string, { className: string; useSQLite?: boolean }> = {};\n const workflows: Record<string, { name: string; className: string }> = {};\n const services: Record<string, string> = {};\n const queues: Record<string, string> = {};\n const vars: Record<string, JsonValue> = {};\n // An alias is a second name of the caller's binding in env, which the platform gives it: nothing to add.\n const aliased = (name: string): boolean => name in isolate.aliases;\n Object.assign(dos, isolate.redirected);\n for (const b of callerServices) services[b] = neverCalled;\n for (const c of callees) {\n for (const d of c.d1)\n if (!aliased(qualified(c.name, d.binding))) d1[qualified(c.name, d.binding)] = d.id;\n for (const b of c.r2)\n if (!aliased(qualified(c.name, b.binding))) r2[qualified(c.name, b.binding)] = b.bucket;\n for (const k of c.kv)\n if (!aliased(qualified(c.name, k.binding))) kv[qualified(c.name, k.binding)] = k.id;\n for (const o of c.durableObjects) {\n // A class of another Worker's script is that Worker's: an alias when it is the caller's (see\n // `isolateOf`), not added otherwise.\n if (o.scriptName !== undefined || aliased(qualified(c.name, o.binding))) continue;\n dos[qualified(c.name, o.binding)] = {\n className: classAlias(c.name, o.className),\n ...(o.sqlite ? { useSQLite: true } : {}),\n };\n }\n for (const w of c.workflows)\n workflows[qualified(c.name, w.binding)] = {\n name: w.name,\n className: classAlias(c.name, w.className),\n };\n services[c.binding] = neverCalled;\n for (const s of c.services) services[qualified(c.name, s)] = neverCalled;\n for (const q of c.queues) queues[qualified(c.name, q.binding)] = q.queue;\n for (const [k, v] of Object.entries(c.vars)) vars[qualified(c.name, k)] = v;\n }\n Object.assign(vars, env);\n const options: Record<string, object> = {};\n const add = (key: string, value: object) => {\n if (Object.keys(value).length > 0) options[key] = value;\n };\n add(\"d1Databases\", d1);\n add(\"r2Buckets\", r2);\n add(\"kvNamespaces\", kv);\n add(\"durableObjects\", dos);\n add(\"workflows\", workflows);\n add(\"queueProducers\", queues);\n add(\"bindings\", vars);\n // JSON for the data, which is also an object literal; the service bindings name the config's function.\n const data = JSON.stringify(options);\n const bindings = Object.keys(services);\n if (bindings.length === 0) return data;\n const literal = `\"serviceBindings\":{${bindings.map((b) => `${JSON.stringify(b)}:${neverCalled}`).join(\",\")}}`;\n return data === \"{}\" ? `{${literal}}` : `${data.slice(0, -1)},${literal}}`;\n}\n\n/** What the caller's config says that the isolate must reconcile with the callees'. */\nexport interface CallerResources {\n readonly name: string | undefined;\n readonly d1: readonly { readonly binding: string; readonly id: string }[];\n readonly r2: readonly { readonly binding: string; readonly bucket: string }[];\n readonly kv: readonly { readonly binding: string; readonly id: string }[];\n readonly durableObjects: readonly {\n readonly binding: string;\n readonly className: string;\n readonly scriptName?: string;\n }[];\n /** The caller's service bindings: the Worker each names, the entrypoint it reaches and the props it carries, when set. */\n readonly services: readonly {\n readonly binding: string;\n readonly service: string;\n readonly entrypoint?: string;\n readonly props?: Readonly<Record<string, JsonValue>>;\n }[];\n}\n\n/** The caller's resources from its wrangler config, when the config can be read (JSON or JSONC); none otherwise. */\nexport function readCallerResources(wranglerPath: string): CallerResources | undefined {\n try {\n const bindings = readBindings(readWranglerConfig(wranglerPath));\n return {\n name: bindings.name,\n d1: bindings.d1,\n r2: bindings.r2,\n kv: bindings.kv,\n durableObjects: bindings.durableObjects,\n services: bindings.services,\n };\n } catch {\n return undefined;\n }\n}\n\n/**\n * What the binding to a callee carries (its entrypoint and props), for the\n * test to pass with the module: from the caller's config, or for a callee's\n * own callee (`<callee>/<binding>`) from that callee's config, where the\n * binding is declared.\n */\nexport function bindingCarries(\n caller: CallerResources | undefined,\n binding: string,\n callees: readonly CalleeConfig[] = [],\n): { readonly entrypoint?: string; readonly props?: Readonly<Record<string, JsonValue>> } {\n const owner = callees.find((c) => binding.startsWith(`${c.name}/`));\n const s =\n caller?.services.find((x) => x.binding === binding) ??\n owner?.carries.find((x) => qualified(owner.name, x.binding) === binding);\n return {\n ...(s?.entrypoint === undefined ? {} : { entrypoint: s.entrypoint }),\n ...(s?.props === undefined ? {} : { props: s.props }),\n };\n}\n\n/**\n * The isolate's shared resources, from the two configs: a callee binding\n * that names a resource the caller binds too (the same `database_id`,\n * `bucket_name` or KV `id`; a Durable Object class of the caller's script,\n * or a caller binding to a class of the callee's script) is an alias of the\n * caller's binding, set up and snapshotted under the caller's name; a\n * caller's binding to a callee's class is redirected to the generated alias\n * class. What a callee binds in a third Worker's script is named as not\n * added.\n */\nexport function isolateOf(\n callees: readonly CalleeConfig[],\n caller: CallerResources | undefined,\n): {\n /** Qualified name → the caller's binding it is an alias of. */\n readonly aliases: Readonly<Record<string, string>>;\n /** The caller's own bindings redirected to a callee's class, as miniflare `durableObjects` entries. */\n readonly redirected: Readonly<Record<string, { className: string; useSQLite?: boolean }>>;\n /** Per callee name, classes of its script the caller binds that the callee binds nowhere itself: the main module exports them too. */\n readonly extraClasses: Readonly<Record<string, readonly string[]>>;\n readonly notAdded: readonly string[];\n} {\n const aliases: Record<string, string> = {};\n const redirected: Record<string, { className: string; useSQLite?: boolean }> = {};\n const extraClasses: Record<string, string[]> = {};\n const notAdded: string[] = [];\n // A caller config that already declares the callee's binding under its qualified name (for a test\n // of its own) names nothing else: no alias.\n const alias = (name: string, own: string) => {\n if (own !== name) aliases[name] = own;\n };\n for (const c of callees) {\n if (caller) {\n for (const d of c.d1) {\n const own = caller.d1.find((x) => x.id === d.id);\n if (own) alias(qualified(c.name, d.binding), own.binding);\n }\n for (const b of c.r2) {\n const own = caller.r2.find((x) => x.bucket === b.bucket);\n if (own) alias(qualified(c.name, b.binding), own.binding);\n }\n for (const k of c.kv) {\n const own = caller.kv.find((x) => x.id === k.id);\n if (own) alias(qualified(c.name, k.binding), own.binding);\n }\n // The caller binds a class of this callee's script: its binding is the class's alias; the\n // callee's own binding of that class is an alias of the caller's.\n for (const o of caller.durableObjects) {\n if (o.scriptName !== c.name) continue;\n const theirs = c.durableObjects.find(\n (x) => x.className === o.className && x.scriptName === undefined,\n );\n redirected[o.binding] = {\n className: classAlias(c.name, o.className),\n ...(c.sqliteClasses.includes(o.className) ? { useSQLite: true } : {}),\n };\n if (theirs) alias(qualified(c.name, theirs.binding), o.binding);\n else {\n const extra = extraClasses[c.name] ?? [];\n extra.push(o.className);\n extraClasses[c.name] = extra;\n }\n }\n }\n for (const o of c.durableObjects) {\n if (o.scriptName === undefined) continue;\n // A class of the caller's script: the callee's binding is an alias of the caller's binding to it.\n const own =\n caller && o.scriptName === caller.name\n ? caller.durableObjects.find(\n (x) => x.className === o.className && x.scriptName === undefined,\n )\n : undefined;\n if (own) alias(qualified(c.name, o.binding), own.binding);\n else\n notAdded.push(\n `${c.binding}: durable_objects binding ${o.binding} (script_name ${o.scriptName}: a class of another Worker)`,\n );\n }\n }\n return { aliases, redirected, extraClasses, notAdded };\n}\n\n/** An isolate with nothing shared. */\nexport const noIsolate: ReturnType<typeof isolateOf> = {\n aliases: {},\n redirected: {},\n extraClasses: {},\n notAdded: [],\n};\n\n/** Where a callee's config path and entry sit, for messages. */\nexport function describeCallee(c: CalleeConfig, scenarioDir: string): string {\n return `${c.binding} (${c.name}, ${toPosix(relative(scenarioDir, c.entry))})`;\n}\n","/**\n * Why Vitest failed the run a check started, from what that run left: its\n * JSON report (a test file that could not run, a failed test) and the\n * errors nothing handled, which fail a run without being in that report,\n * so the generated config's own reporter writes them beside it\n * (`unhandledErrorsFile`). Without this the command could only say that\n * Vitest exited non-zero: the run's only reporter is the JSON one, and its\n * files are deleted after the run.\n */\n\n/** Where the run's errors nothing handled are written: beside its report, under its stamp. */\nexport function unhandledErrorsFile(reportFile: string): string {\n return reportFile.replace(/\\.json$/, \".unhandled.json\");\n}\n\n/** Lines of an error kept in the explanation; a stack's first frames say where. */\nconst keptLines = 8;\n\n/** What the JSON report holds, as far as it is read; fields are checked, not trusted. */\ninterface Report {\n readonly testResults?: readonly {\n readonly status?: unknown;\n readonly message?: unknown;\n readonly assertionResults?: readonly {\n readonly status?: unknown;\n readonly failureMessages?: readonly unknown[];\n }[];\n }[];\n}\n\n/** An error nothing handled as the reporter wrote it: whatever was thrown, so any field may be data. */\ninterface Unhandled {\n readonly type?: unknown;\n readonly message?: unknown;\n readonly stack?: unknown;\n}\n\nfunction parsed<T>(text: string | undefined): T | undefined {\n if (text === undefined) return undefined;\n try {\n return JSON.parse(text) as T;\n } catch {\n return undefined;\n }\n}\n\n/** A field as text: a string as it is, anything else as JSON (a thrown value need not be an error). */\nfunction asText(value: unknown): string {\n if (typeof value === \"string\") return value;\n try {\n return JSON.stringify(value) ?? String(value);\n } catch {\n return String(value);\n }\n}\n\n/** What an error says: its stack or message when either is text, else whatever was thrown, as data. */\nfunction said(e: Unhandled): string {\n for (const v of [e.stack, e.message]) if (typeof v === \"string\" && v !== \"\") return v;\n const thrown = e.message ?? e.stack;\n return thrown === undefined || thrown === null ? \"(no message)\" : asText(thrown);\n}\n\n/** An error's first lines, each without its indent; a line at the end says how many were cut. */\nfunction firstLines(text: string): string[] {\n const lines = text\n .trimEnd()\n .split(\"\\n\")\n .map((l) => l.trimStart());\n const kept = lines.slice(0, keptLines);\n if (lines.length > keptLines) kept.push(`… ${lines.length - keptLines} more lines`);\n return kept;\n}\n\n/** An error's text, cut to its first lines and indented under its heading. */\nfunction cut(text: string): string {\n return firstLines(text).join(\"\\n \");\n}\n\n/** An error nothing handled, told once however often it came: its type, its first lines, how often. */\nexport interface StrayError {\n readonly type: string;\n readonly message: string;\n readonly times: number;\n}\n\n/** The errors nothing handled, the same type and text told once with how often it came, in first-seen order. */\nfunction distinct(unhandled: readonly Unhandled[]): StrayError[] {\n const seen = new Map<string, { type: string; message: string; times: number }>();\n for (const e of unhandled) {\n const type = typeof e.type === \"string\" && e.type !== \"\" ? e.type : \"Error\";\n const whole = said(e);\n // Told apart by the whole text: two errors may differ only past the lines that are shown.\n const key = `${type}\\n${whole}`;\n const found = seen.get(key);\n if (found) found.times++;\n else seen.set(key, { type, message: firstLines(whole).join(\"\\n\"), times: 1 });\n }\n return [...seen.values()];\n}\n\n/** The distinct errors, one a line under the count, each error's own lines indented under it. */\nfunction told(errors: readonly StrayError[]): string {\n return errors\n .map(\n ({ type, message, times }) =>\n `\\n ${type}${times > 1 ? ` (${times} times)` : \"\"}: ${message.split(\"\\n\").join(\"\\n \")}`,\n )\n .join(\"\");\n}\n\n/** How many errors came, and how many distinct when more than one. */\nfunction counted(errors: readonly StrayError[]): string {\n const all = errors.reduce((n, e) => n + e.times, 0);\n return all === 1\n ? \"1 error nothing handled\"\n : `${all} errors nothing handled, ${errors.length} distinct`;\n}\n\n/** Why each test file failed and each failed test's first error, and how many tests passed. */\nfunction reportCauses(report: Report | undefined): { causes: string[]; passed: number } {\n const causes: string[] = [];\n let passed = 0;\n for (const file of report?.testResults ?? []) {\n const tests = file.assertionResults ?? [];\n // The reporter gives a file the first error outside its tests: its import, a hook, a teardown.\n if (file.status === \"failed\" && file.message !== undefined && file.message !== \"\")\n causes.push(\n `the check's test file ${tests.length === 0 ? \"could not run\" : \"failed outside its test\"}: ${cut(asText(file.message))}`,\n );\n for (const t of tests) {\n if (t.status === \"passed\") passed++;\n else if (t.status === \"failed\") {\n const [first] = t.failureMessages ?? [];\n causes.push(\n `the check's test failed${first === undefined ? \"\" : `: ${cut(asText(first))}`}`,\n );\n }\n }\n }\n return { causes, passed };\n}\n\n/**\n * The kinds of error nothing handled that Vitest's error catcher in the\n * test's own runtime records (`listenForErrors`): what code that ran\n * inside the test left behind, the Worker's or the simulation's. The\n * runner, its pool and the reporters record their own failures through the\n * same channel (`Teardown Error`, `Unhandled Error`, `Unhandled Reporter\n * Error`, `Restart Error`, …); those mean the run broke.\n */\nconst fromTheTest = new Set([\"Unhandled Rejection\", \"Uncaught Exception\"]);\n\n/**\n * The errors nothing handled, when they are the run's only fault: every\n * test in the report passed, at least one did, no file failed outside its\n * tests, and there was at least one such error, every one recorded by the\n * test's own runtime (`fromTheTest`). Cloudflare's runtime only\n * logs an error nothing handled (a promise a Worker leaves rejected, say),\n * while Vitest fails the whole run on one, so then the verdict the test\n * left stands and these are told beside it. Otherwise undefined: the run\n * failed, and `vitestFailure` says why.\n */\nexport function strayErrors(left: {\n readonly report?: string | undefined;\n readonly unhandled?: string | undefined;\n}): readonly StrayError[] | undefined {\n const report = parsed<Report>(left.report);\n const unhandled = parsed<Unhandled[]>(left.unhandled);\n if (report === undefined || !Array.isArray(unhandled) || unhandled.length === 0) return undefined;\n if (!unhandled.every((e) => typeof e?.type === \"string\" && fromTheTest.has(e.type)))\n return undefined;\n const { causes, passed } = reportCauses(report);\n const allPassed = (report.testResults ?? []).every(\n (f) => f.status === \"passed\" && (f.assertionResults ?? []).every((t) => t.status === \"passed\"),\n );\n return passed > 0 && causes.length === 0 && allPassed ? distinct(unhandled) : undefined;\n}\n\n/** The note printed beside a verdict that stands despite errors nothing handled. */\nexport function strayNote(errors: readonly StrayError[]): string {\n return `note: the check's test passed, and its verdict stands, but there ${errors.reduce((n, e) => n + e.times, 0) === 1 ? \"was\" : \"were\"} ${counted(errors)} (Cloudflare's runtime only logs them; Vitest fails the run on them):${told(errors)}\\n`;\n}\n\n/**\n * The explanation, one cause a line (each error's own lines indented under\n * it), from the report's text and the unhandled errors' text, either of\n * which may be missing.\n */\nexport function vitestFailure(left: {\n readonly report?: string | undefined;\n readonly unhandled?: string | undefined;\n}): string {\n const report = parsed<Report>(left.report);\n const unhandled = parsed<Unhandled[]>(left.unhandled) ?? [];\n const { causes, passed } = reportCauses(report);\n if (unhandled.length > 0) {\n const errors = distinct(unhandled);\n const passedAlone = passed > 0 && causes.length === 0;\n // Errors the test's own runtime caught leave a passed test's verdict standing (`strayErrors`),\n // so with only those the run failed because the test left no verdict.\n const onlyFromTheTest = unhandled.every(\n (e) => typeof e?.type === \"string\" && fromTheTest.has(e.type),\n );\n const intro = !passedAlone\n ? \"\"\n : onlyFromTheTest\n ? \"its test passed but left no verdict in Vitest's report; there \"\n : \"its test passed, but Vitest fails a run on any error nothing handled, and there \";\n const also = passedAlone && onlyFromTheTest ? \"also \" : \"\";\n const verb = intro === \"\" ? \"\" : `${unhandled.length === 1 ? \"was\" : \"were\"} ${also}`;\n causes.push(`${intro}${verb}${counted(errors)}:${told(errors)}`);\n }\n if (causes.length === 0)\n causes.push(\n report === undefined\n ? \"Vitest left no report it could be told from\"\n : passed > 0\n ? \"its test passed but left no verdict in Vitest's report\"\n : \"Vitest reported no failed test and no error nothing handled\",\n );\n return causes.map((c) => ` ${c}\\n`).join(\"\");\n}\n","/**\n * The files `eutaxy check` writes into `<scenario dir>/.eutaxy/` before\n * running Vitest: a test that performs the check inside workerd and prints\n * the verdict on one marked line, and a Vitest config with the Cloudflare\n * plugin pointed at the scenario's wrangler config. For a scenario with\n * callees the test imports their modules, the config names a generated main\n * module and adds their resources through miniflare options (`callees.ts`).\n */\n\nimport { dirname, join } from \"node:path\";\nimport { neverCalled } from \"./callees.ts\";\nimport { unhandledErrorsFile } from \"./vitest-failure.ts\";\n\n/** Key under which the generated test stores its result in the Vitest task meta, read back from the JSON reporter. */\nexport const metaKey = \"eutaxy\";\n\nexport interface GeneratedCheck {\n readonly seed: string;\n readonly maxRuns?: number;\n /** Replaces the scenario's time budget. */\n readonly budgetMs?: number;\n /** Exhaustive exploration instead of seeded. */\n readonly exhaustive?: boolean;\n /** Import specifier of the scenario from the generated test (e.g. \"../scenario.sim.ts\"). */\n readonly scenarioImport: string;\n /** Import specifier of the Worker's entry when it lies outside the scenario's directory, where the test's glob does not reach. */\n readonly workerImport?: string;\n /** The callees the scenario names: each one's binding, Worker name and the import specifier of its module. */\n readonly callees?: readonly {\n readonly binding: string;\n readonly name: string;\n readonly importPath: string;\n /** From the caller's config: the entrypoint the binding reaches, the props it carries. */\n readonly entrypoint?: string;\n readonly props?: Readonly<Record<string, unknown>>;\n /** The callee is the scenario's own Worker, called back by a Worker it called. */\n readonly self?: boolean;\n }[];\n /** SQL files outside the scenario's directory (a callee's schema), by the key `schemasFor` looks up, with their import specifiers. */\n readonly sqlImports?: readonly { readonly key: string; readonly importPath: string }[];\n /** Qualified binding names that are aliases of the caller's bindings (shared resources). */\n readonly aliases?: Readonly<Record<string, string>>;\n}\n\n/**\n * The generated test: the module globs (Vite resolves them at build time,\n * so they must be written in the test) and one call to `checkInWorkerd`,\n * which does the rest.\n */\nexport function checkTestSource(g: GeneratedCheck): string {\n const options =\n `seed: ${JSON.stringify(g.seed)}` +\n (g.maxRuns === undefined ? \"\" : `, maxRuns: ${g.maxRuns}`) +\n (g.budgetMs === undefined ? \"\" : `, budgetMs: ${g.budgetMs}`) +\n (g.exhaustive ? \", exhaustive: true\" : \"\");\n const callees = g.callees ?? [];\n const sqlImports = g.sqlImports ?? [];\n const calleeImports = callees.map(\n (c, i) => `import * as callee_${i} from ${JSON.stringify(c.importPath)};\\n`,\n );\n const sqlImportLines = sqlImports.map(\n (f, i) => `import sql_${i} from ${JSON.stringify(`${f.importPath}?raw`)};\\n`,\n );\n const workerImportLine =\n g.workerImport === undefined\n ? \"\"\n : `import * as workerModule from ${JSON.stringify(g.workerImport)};\\n`;\n const workerOption = g.workerImport === undefined ? \"\" : \", worker: workerModule\";\n const calleesOption =\n callees.length === 0\n ? \"\"\n : `, callees: { ${callees\n .map(\n (c, i) =>\n `${JSON.stringify(c.binding)}: { name: ${JSON.stringify(c.name)}, exports: callee_${i}${c.entrypoint === undefined ? \"\" : `, entrypoint: ${JSON.stringify(c.entrypoint)}`}${c.props === undefined ? \"\" : `, props: ${JSON.stringify(c.props)}`}${c.self ? \", self: true\" : \"\"} }`,\n )\n .join(\", \")} }`;\n const extraSql =\n sqlImports.length === 0\n ? \"\"\n : `, extraSql: { ${sqlImports.map((f, i) => `${JSON.stringify(f.key)}: sql_${i}`).join(\", \")} }`;\n const aliases =\n g.aliases === undefined || Object.keys(g.aliases).length === 0\n ? \"\"\n : `, aliases: ${JSON.stringify(g.aliases)}`;\n return `// Generated by eutaxy check; deleted after the run.\nimport { checkInWorkerd } from \"eutaxy/cloudflare\";\nimport { env } from \"cloudflare:workers\";\nimport * as durableObjects from \"cloudflare:test\";\nimport { test } from \"vitest\";\nimport scenario from ${JSON.stringify(g.scenarioImport)};\n${workerImportLine}${calleeImports.join(\"\")}${sqlImportLines.join(\"\")}import { specEntries } from \"./specs.ts\";\n\nconst sqlFiles = import.meta.glob(\"../**/*.sql\", { query: \"?raw\", import: \"default\", eager: true }) as Record<string, string>;\nconst modules = import.meta.glob([\"../**/*.ts\", \"!../**/*.test.ts\", \"!../**/*.sim.ts\", \"!../**/node_modules/**\", \"!../**/.eutaxy/**\"]);\n\ntest(\"eutaxy check\", async ({ task }) => {\n task.meta[${JSON.stringify(metaKey)}] = await checkInWorkerd({ scenario, env, durableObjects, sqlFiles, modules, specEntries${workerOption}${calleesOption}${extraSql}${aliases}, ${options} });\n});\n`;\n}\n\n/**\n * The plugin's main module, absolute: the scenario's Worker entry, or for a scenario with callees the\n * generated module re-exporting the caller's and the callees' classes, with the callees' resources.\n */\nexport interface CalleeIsolate {\n readonly main: string;\n /** The miniflare options as source (an object literal); only a scenario with callees has them. */\n readonly miniflare?: string;\n}\n\n/** Where the generated config writes what the Workers wrote to the console, one JSON line per write, when asked to. */\nexport const consoleFile = (outputFile: string): string =>\n outputFile.replace(/\\.json$/, \".console.jsonl\");\n\n/** One write to the console as Vitest reports it: the stream it went to and its text. */\nexport interface ConsoleWrite {\n readonly type: \"stdout\" | \"stderr\";\n readonly content: string;\n}\n\nexport function vitestConfigSource(\n wranglerConfigPath: string,\n testPath: string,\n outputFile: string,\n isolate?: CalleeIsolate,\n /** Keep what the Workers write to the console (`consoleFile`); by default it is dropped. */\n keepConsole = false,\n): string {\n const plugin =\n isolate === undefined\n ? `cloudflareTest({ wrangler: { configPath: ${JSON.stringify(wranglerConfigPath)} } })`\n : `cloudflareTest({ main: ${JSON.stringify(isolate.main)}, wrangler: { configPath: ${JSON.stringify(wranglerConfigPath)} }${isolate.miniflare === undefined ? \"\" : `, miniflare: ${isolate.miniflare}`} })`;\n // A service binding the scenario scripts or runs as a callee is never called; the value must exist.\n const helpers =\n isolate?.miniflare === undefined\n ? \"\"\n : `const ${neverCalled} = () => new Response(\"eutaxy: a service binding the scenario scripts or runs as a callee is never called\", { status: 500 });\\n\\n`;\n return `// Generated by eutaxy check; deleted after the run.\nimport { ${keepConsole ? \"appendFileSync, \" : \"\"}writeFileSync } from \"node:fs\";\nimport { cloudflareTest } from \"@cloudflare/vitest-plugin\";\nimport { defineConfig } from \"vitest/config\";\n\n${helpers}export default defineConfig({\n // Vite's cache, kept with the generated files so it goes when they do (its default is the\n // project's node_modules/.vite, which a check would leave behind in the scenario's directory).\n cacheDir: ${JSON.stringify(join(dirname(testPath), \".vite\"))},\n plugins: [${plugin}],\n test: {\n include: [${JSON.stringify(testPath)}],\n testTimeout: 600_000,\n // An error nothing handled fails the run but is not in the JSON report; kept for the command to tell.\n reporters: [\"json\", { onTestRunEnd(_modules, errors) {\n if (errors.length > 0)\n writeFileSync(${JSON.stringify(unhandledErrorsFile(outputFile))}, JSON.stringify(errors.map((e) => ({ type: e.type, message: e.message, stack: e.stack }))));\n }${\n keepConsole\n ? `, onUserConsoleLog(log) {\n appendFileSync(${JSON.stringify(consoleFile(outputFile))}, JSON.stringify({ type: log.type, content: log.content }) + \"\\\\n\");\n }`\n : \"\"\n } }],\n outputFile: ${JSON.stringify(outputFile)},\n },\n});\n`;\n}\n","/**\n * Spec files for `eutaxy check`: every `<module>.props.ts` next to the\n * scenario, read with its module into `SpecIR` on the Node side, and the\n * generated `specs.ts` that hands workerd each module's specs together\n * with a loader for its spec file. Which of them a run checks is the\n * scenario's `specs`, read where the scenario is loaded, inside the\n * generated test; a spec file loads only when its module is named.\n */\n\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { basename, dirname, join, relative } from \"node:path\";\nimport type { ModuleSpecs } from \"@eutaxy/spec\";\nimport { specKey } from \"./keys.ts\";\n\nexport { specKey } from \"./keys.ts\";\n\n/** The suffix a spec file carries beside its module: `domain.ts` has `domain.props.ts`. */\nexport const specSuffix = \".props.ts\";\n\nexport interface SpecModule {\n /** The module's path relative to the scenario's directory, as a scenario names it: \"./domain.ts\". */\n readonly key: string;\n /** The module's absolute path. */\n readonly path: string;\n /** The spec file's absolute path. */\n readonly specPath: string;\n readonly specs: ModuleSpecs;\n}\n\nconst skipDirs = new Set([\"node_modules\", \".eutaxy\", \"dist\", \".git\"]);\n\n/** What the spec reader needs that a project without specs need not have. */\nexport const typescriptNeeded =\n \"the TypeScript compiler, version 7.1 or later (typescript), which this project does not have: add it to the project's dev dependencies, or update the one there\";\n\n/** A spec file was to be read, or an engine run, where the TypeScript compiler is not installed. */\nexport class TypescriptNeeded extends Error {}\n\n/**\n * Whether an import failed because the project has no TypeScript compiler the reader can use: none\n * installed (Node finds no package `typescript`), or an older one, which lacks the modules the\n * reader imports (no such export in its package, or no such file in it).\n */\nexport function typescriptMissing(err: unknown): boolean {\n const e = err as { code?: string; message?: string } | null;\n if (e?.code !== \"ERR_MODULE_NOT_FOUND\" && e?.code !== \"ERR_PACKAGE_PATH_NOT_EXPORTED\")\n return false;\n // The package by name, or a path inside it; not a package whose name only starts the same.\n return /(^|[\\\\/'\"\\s])typescript([\\\\/'\"\\s]|$)/.test(e.message ?? \"\");\n}\n\n/**\n * The spec reader, loaded when a spec file is first read: it runs the\n * TypeScript compiler, which a project that writes no specs need not have\n * installed, so the command does not load it before then.\n */\nasync function reader(): Promise<typeof import(\"@eutaxy/prover/reader\")> {\n try {\n return await import(\"@eutaxy/prover/reader\");\n } catch (err) {\n if (typescriptMissing(err))\n throw new TypescriptNeeded(`reading a spec file needs ${typescriptNeeded}`);\n throw err;\n }\n}\n\n/** Read one module and its spec file; their imports resolve from where they are. */\nexport async function readSpecModule(modulePath: string, specPath: string): Promise<ModuleSpecs> {\n const { readSpecs } = await reader();\n return readSpecs({\n module: readFileSync(modulePath, \"utf8\"),\n spec: readFileSync(specPath, \"utf8\"),\n modulePath,\n specPath,\n });\n}\n\n/**\n * Spec files under `dir`, each with its module; a spec file without a module beside it is an error\n * entry. A directory with no spec file is walked without the spec reader being loaded.\n */\nexport async function findSpecModules(dir: string): Promise<SpecModule[]> {\n const out: SpecModule[] = [];\n const walk = async (at: string): Promise<void> => {\n for (const entry of readdirSync(at, { withFileTypes: true })) {\n const path = join(at, entry.name);\n if (entry.isDirectory()) {\n if (!skipDirs.has(entry.name)) await walk(path);\n continue;\n }\n if (!entry.name.endsWith(specSuffix)) continue;\n const modulePath = join(at, `${entry.name.slice(0, -specSuffix.length)}.ts`);\n const key = specKey(relative(dir, modulePath));\n if (!existsSync(modulePath)) {\n out.push({\n key,\n path: modulePath,\n specPath: path,\n specs: {\n functions: [],\n errors: [\n {\n line: 1,\n message: `${entry.name} has no module ${basename(modulePath)} beside it`,\n },\n ],\n },\n });\n continue;\n }\n out.push({\n key,\n path: modulePath,\n specPath: path,\n specs: await readSpecModule(modulePath, path),\n });\n }\n };\n await walk(dir);\n return out.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));\n}\n\n/** A file `eutaxy check` writes into `.eutaxy/`, by its path there. */\nexport interface GeneratedFile {\n readonly name: string;\n readonly source: string;\n}\n\n/** A path as an import specifier from `.eutaxy/`: forward slashes, relative, `.ts` kept (Vite resolves it). */\nfunction importFrom(workDir: string, target: string): string {\n const rel = relative(workDir, target).split(\"\\\\\").join(\"/\");\n return rel.startsWith(\".\") ? rel : `./${rel}`;\n}\n\n/**\n * The generated `specs.ts`: each module's key mapped to its specs (plain\n * data read on the Node side) and a loader of its spec file. The loader is\n * lazy, so a spec file elsewhere that does not compile cannot stop a check\n * of a scenario that does not name its module.\n */\nexport function specFiles(modules: readonly SpecModule[], workDir: string): GeneratedFile[] {\n const header = \"// Generated by eutaxy check; deleted after the run.\";\n const lines = [\n header,\n \"// The `any`: this file runs in the user's Vitest, which does not type-check it; `SpecEntry` in workerd.ts is the shape.\",\n \"export const specEntries: Record<string, { specs: any; load: () => Promise<any> }> = {\",\n ...modules.map(\n (m) =>\n ` ${JSON.stringify(m.key)}: { specs: ${JSON.stringify(m.specs)}, load: () => import(${JSON.stringify(importFrom(workDir, m.specPath))}) },`,\n ),\n \"};\",\n ];\n return [{ name: \"specs.ts\", source: `${lines.join(\"\\n\")}\\n` }];\n}\n\n/** The directory a generated file's import is resolved from. */\nexport function specWorkDir(dir: string): string {\n return dirname(join(dir, \".eutaxy\", \"specs.ts\"));\n}\n","/**\n * `eutaxy check <scenario.sim.ts>`: run a scenario inside workerd through\n * the user's Vitest and the Cloudflare plugin, print the verdict as text or\n * JSON, and on a violation write a regression test next to the scenario.\n */\n\nimport { spawn } from \"node:child_process\";\nimport { randomBytes } from \"node:crypto\";\nimport { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { basename, dirname, join, relative, resolve } from \"node:path\";\nimport {\n canonicalJson,\n type JsonValue,\n type ScenarioVerdict,\n type SpecVerdict,\n type Violated,\n} from \"@eutaxy/core\";\nimport { aggregate, type EngineReport, type Prover } from \"@eutaxy/prover\";\nimport { renderSpecs, renderText } from \"@eutaxy/report\";\nimport {\n bindingCarries,\n type CalleeConfig,\n calleeSteps,\n describeCallee,\n envSteps,\n isolateBindings,\n isolateOf,\n type LoadedScenario,\n loadScenario,\n mainModuleSource,\n mentionsCallee,\n miniflareOptionsSource,\n readCalleeConfig,\n readCallerResources,\n} from \"./callees.ts\";\nimport {\n type ConsoleWrite,\n checkTestSource,\n consoleFile,\n metaKey,\n vitestConfigSource,\n} from \"./generate.ts\";\nimport { globKey } from \"./keys.ts\";\nimport {\n type CloudflareRegressionOptions,\n cloudflareRegressionTest,\n cloudflareUnsupportedTest,\n} from \"./regression.ts\";\nimport {\n findSpecModules,\n type SpecModule,\n specFiles,\n specKey,\n TypescriptNeeded,\n typescriptMissing,\n typescriptNeeded,\n} from \"./specs.ts\";\nimport { strayErrors, strayNote, unhandledErrorsFile, vitestFailure } from \"./vitest-failure.ts\";\nimport type { CheckTransport } from \"./workerd.ts\";\n\nexport interface CheckOptions {\n readonly scenario: string;\n readonly cwd: string;\n readonly wrangler?: string;\n readonly seed?: string;\n readonly maxRuns?: number;\n /** Replaces the scenario's time budget. */\n readonly budgetMs?: number;\n /** Run every schedule within the bounds once instead of drawing them from the seed. */\n readonly exhaustive?: boolean;\n /** Engines to run the PROVEN rung with, by name, on the scenario's spec modules. */\n readonly provers?: readonly string[];\n readonly json: boolean;\n /**\n * Where to write the regression test on a violation, or the test replaying the run that met\n * something outside the model on an UNSUPPORTED verdict; default `<name>.regression.test.ts`\n * beside the scenario.\n */\n readonly out?: string;\n readonly noRegression: boolean;\n /** Emit a regression test that asserts the violation (for corpora) rather than one that expects it fixed. */\n readonly expectViolation: boolean;\n /** Keep the generated `.eutaxy/` files for inspection. */\n readonly keep: boolean;\n /** Show what was written to the console in the isolate during the check (the Workers', a callee's included), on stderr. */\n readonly console?: boolean;\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n}\n\nexport const exitCodes = { BOUNDED: 0, VIOLATED: 1, UNSUPPORTED: 2, error: 3 } as const;\n\n/** The engines `--prover` can name. */\nexport const proverNames = [\"lean\", \"smt\"] as const;\n\n/**\n * An engine, loaded when it is first named: the engines read through the TypeScript compiler,\n * which a project that proves nothing need not have installed.\n */\nexport async function loadProver(name: (typeof proverNames)[number]): Promise<Prover> {\n try {\n return name === \"lean\"\n ? (await import(\"@eutaxy/prover-lean\")).leanProver\n : (await import(\"@eutaxy/prover-smt\")).smtProver;\n } catch (err) {\n if (typescriptMissing(err)) throw new Error(`the ${name} engine needs ${typescriptNeeded}`);\n throw err;\n }\n}\n\n/** The engines named, or the error naming the first unknown one, or why one could not be loaded. */\nexport async function enginesNamed(\n names: readonly string[],\n): Promise<{ readonly engines: Prover[] } | { readonly error: string }> {\n const known = (name: string): name is (typeof proverNames)[number] =>\n (proverNames as readonly string[]).includes(name);\n // Every name is checked before any engine is loaded.\n for (const name of names)\n if (!known(name)) return { error: `unknown prover ${name}; known: ${proverNames.join(\", \")}` };\n const engines: Prover[] = [];\n try {\n for (const name of names) if (known(name)) engines.push(await loadProver(name));\n } catch (err) {\n return { error: err instanceof Error ? err.message : String(err) };\n }\n return { engines };\n}\n\n/**\n * The PROVEN rung, on the Node side: each engine on each observed spec\n * module's source, the outcomes folded into the simulator's verdicts.\n * An engine that is not installed proves nothing and says so.\n */\nexport async function proveSpecs(\n dir: string,\n observed: readonly { readonly module: string; readonly functions: readonly string[] }[],\n specs: readonly SpecVerdict[],\n engines: readonly Prover[],\n /** The spec modules under `dir`, when the caller has read them already. */\n given?: readonly SpecModule[],\n /** Told each engine's report on each module, for what the verdicts do not carry: the open goals. */\n onReport?: (module: SpecModule, report: EngineReport) => void,\n): Promise<readonly SpecVerdict[]> {\n const modules = given ?? (await findSpecModules(dir));\n let out = specs;\n for (const m of observed) {\n // Verdicts carry the module as a normalized key (\"./domain.ts\"); the observed path is as the scenario wrote it.\n const key = specKey(m.module);\n const found = modules.find((s) => s.key === key);\n const withSpecs = m.functions.filter((f) =>\n specs.some((v) => v.module === key && v.function === f),\n );\n if (!found || withSpecs.length === 0) continue;\n const source = readFileSync(found.path, \"utf8\");\n const reports: EngineReport[] = [];\n for (const engine of engines) {\n const report: EngineReport = {\n engine: engine.name,\n proofs: await engine.prove({\n source,\n specs: found.specs,\n functions: withSpecs,\n modulePath: found.path,\n specPath: found.specPath,\n }),\n };\n reports.push(report);\n onReport?.(found, report);\n }\n out = aggregate(key, out, reports);\n }\n return out;\n}\n\nfunction findWrangler(dir: string, explicit: string | undefined, cwd: string): string | null {\n if (explicit) return resolve(cwd, explicit);\n for (const name of [\"wrangler.jsonc\", \"wrangler.json\", \"wrangler.toml\"]) {\n const p = join(dir, name);\n if (existsSync(p)) return p;\n }\n return null;\n}\n\nfunction vitestBin(from: string): string {\n const req = createRequire(join(from, \"package.json\"));\n return join(dirname(req.resolve(\"vitest/package.json\")), \"vitest.mjs\");\n}\n\nfunction runVitest(\n bin: string,\n configPath: string,\n cwd: string,\n): Promise<{ code: number; output: string }> {\n return new Promise((resolveRun) => {\n const child = spawn(process.execPath, [bin, \"run\", \"--config\", configPath], {\n cwd,\n env: { ...process.env, CI: \"1\", FORCE_COLOR: \"0\" },\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n let output = \"\";\n child.stdout.on(\"data\", (d: Buffer) => {\n output += d.toString();\n });\n child.stderr.on(\"data\", (d: Buffer) => {\n output += d.toString();\n });\n child.on(\"close\", (code) => resolveRun({ code: code ?? 1, output }));\n });\n}\n\n/** A colour or style escape, which a console in the isolate adds to an object it prints whatever the terminal. */\nconst styleEscape = new RegExp(`${String.fromCharCode(27)}\\\\[[0-9;]*m`, \"g\");\n\n/**\n * What was written to the console in the isolate during the check, for `--console`: the Workers'\n * writes, a callee's included, and the scenario file's own, every run of the check (it runs the\n * scenario many times, so a line a handler writes once appears once per run), without colour\n * escapes. As Vitest reported it: the writes to one stream are in the order written, but it hands\n * over what went to stdout before what went to stderr within one stretch of synchronous code, so a\n * `console.error` can follow a `console.log` that was written after it.\n */\nexport function consoleOutput(file: string): string {\n const writes = existsSync(file)\n ? readFileSync(file, \"utf8\")\n .split(\"\\n\")\n .filter((line) => line !== \"\")\n .map((line) => JSON.parse(line) as ConsoleWrite)\n : [];\n if (writes.length === 0) return \"Nothing was written to the console during the check.\\n\";\n const text = writes\n .map((w) => w.content)\n .join(\"\")\n .replace(styleEscape, \"\");\n return `Console output during the check, every run, as Vitest reported it:\\n${text}${text.endsWith(\"\\n\") ? \"\" : \"\\n\"}`;\n}\n\n/** The transport the generated test left in its task meta, via Vitest's JSON reporter. */\nfunction readTransport(reportPath: string): CheckTransport | null {\n if (!existsSync(reportPath)) return null;\n const report = JSON.parse(readFileSync(reportPath, \"utf8\")) as {\n testResults?: { assertionResults?: { meta?: Record<string, unknown> }[] }[];\n };\n for (const file of report.testResults ?? []) {\n for (const t of file.assertionResults ?? []) {\n const m = t.meta?.[metaKey];\n if (m) return m as CheckTransport;\n }\n }\n return null;\n}\n\n/**\n * Whether a regression test for a scenario with these setup steps is given the Cloudflare test\n * helpers: real objects are reset and snapshotted through them, and a scripted namespace is watched\n * through them for an object that ran after all.\n */\nexport function needsObjectHelpers(setup: readonly { readonly kind: string }[]): boolean {\n return setup.some((s) => s.kind === \"durable_object\" || s.kind === \"scripted_object\");\n}\n\nfunction toPosix(p: string): string {\n const s = p.split(\"\\\\\").join(\"/\");\n return s.startsWith(\".\") ? s : `./${s}`;\n}\n\nexport async function runCheck(o: CheckOptions): Promise<number> {\n const scenarioPath = resolve(o.cwd, o.scenario);\n if (!existsSync(scenarioPath)) {\n o.stderr(`scenario not found: ${scenarioPath}\\n`);\n return exitCodes.error;\n }\n // The engines named, before anything runs: a name that is none, or an engine that cannot be loaded\n // (it reads through the TypeScript compiler), is told now and not after the whole check.\n let engines: Prover[] = [];\n if (o.provers && o.provers.length > 0) {\n const named = await enginesNamed(o.provers);\n if (\"error\" in named) {\n o.stderr(`${named.error}\\n`);\n return exitCodes.error;\n }\n engines = named.engines;\n }\n const dir = dirname(scenarioPath);\n const name = basename(scenarioPath)\n .replace(/\\.sim\\.ts$/, \"\")\n .replace(/\\.ts$/, \"\");\n // One run's files carry a stamp of their own, so two checks of one scenario running at once (a CLI run\n // beside the MCP server's, say) never share a test, a config or Vitest's report file; specs.ts is the\n // same for every run of the directory and is shared.\n const stamp = `${process.pid}-${randomBytes(3).toString(\"hex\")}`;\n const workDir = join(dir, \".eutaxy\");\n const testPath = join(workDir, `${name}.${stamp}.check.test.ts`);\n const configPath = join(workDir, `vitest.config.${stamp}.mts`);\n const mainPath = join(workDir, `main.${stamp}.ts`);\n // The scenario module is imported in Node, in a process of its own, for the Worker it names (its entry\n // is the isolate's main module, so the Durable Object and Workflow classes that run are the entry's, not\n // those of the wrangler config's `main`) and for its callees, whose configs are read here, before Vitest\n // starts, since the isolate must hold their resources.\n let callees: CalleeConfig[] = [];\n let loaded: LoadedScenario | undefined;\n try {\n loaded = await loadScenario(scenarioPath);\n } catch (err) {\n if (mentionsCallee(readFileSync(scenarioPath, \"utf8\"))) {\n o.stderr(`could not read the scenario's callees: ${String(err)}\\n`);\n return exitCodes.error;\n }\n o.stderr(\n `could not read the scenario in Node, so the isolate's main module is the wrangler config's: ${String(err).split(\"\\n\")[0]}\\n`,\n );\n }\n // The wrangler config: --wrangler, else the one the scenario names, else one beside the scenario.\n const named = o.wrangler === undefined ? loaded?.worker.config : undefined;\n const wrangler = named !== undefined ? resolve(dir, named) : findWrangler(dir, o.wrangler, o.cwd);\n if (!wrangler || !existsSync(wrangler)) {\n o.stderr(\n named !== undefined\n ? `the scenario's wrangler config was not found: ${wrangler}; pass --wrangler <path>\\n`\n : `no wrangler config found next to the scenario; pass --wrangler <path>\\n`,\n );\n return exitCodes.error;\n }\n try {\n callees = calleeSteps(loaded?.setup ?? []).map((step) => readCalleeConfig(step, dir));\n } catch (err) {\n o.stderr(`could not read the scenario's callees: ${String(err)}\\n`);\n return exitCodes.error;\n }\n // Shared resources, from the caller's config (readable as JSON or JSONC) and the callees'.\n const callerResources = readCallerResources(wrangler);\n // A callee step that names the scenario's own Worker (the Worker it called calls it in turn): its\n // module is the caller's and its resources are in the isolate already, under their own names.\n const isSelf = (c: CalleeConfig): boolean =>\n callerResources?.name !== undefined && c.name === callerResources.name;\n const allCallees = callees;\n callees = allCallees.filter((c) => !isSelf(c));\n for (const c of callees)\n if (c.notAdded.length > 0)\n o.stderr(\n `callee ${describeCallee(c, dir)}: not added to the test's isolate: ${c.notAdded.join(\", \")}\\n`,\n );\n const isolate = isolateOf(callees, callees.length > 0 ? callerResources : undefined);\n // The caller's service bindings, replaced in the isolate: the platform answers each one.\n const callerServices = (callerResources?.services ?? []).map((s) => s.binding).filter((b) => b);\n // The vars and secrets the scenario gives a value: in the isolate's env, the Worker's and the callees'.\n const env = envSteps(loaded?.setup ?? []);\n for (const reason of isolate.notAdded) o.stderr(`not added to the test's isolate: ${reason}\\n`);\n mkdirSync(workDir, { recursive: true });\n try {\n const sqlImports: { key: string; importPath: string }[] = [];\n /** Whether a path the scenario names lies outside its directory, where the test's globs do not reach. */\n const outside = (file: string): boolean => relative(dir, resolve(dir, file)).startsWith(\"..\");\n if (loaded) {\n // A schema outside the scenario's directory (a callee's, or a shared one) is imported by name.\n for (const step of loaded.setup) {\n if (step.kind !== \"d1\") continue;\n const file = String(step[\"schemaFile\"]);\n if (!outside(file)) continue;\n sqlImports.push({\n key: globKey(file),\n importPath: toPosix(relative(workDir, resolve(dir, file))),\n });\n }\n }\n writeFileSync(\n testPath,\n checkTestSource({\n seed: o.seed ?? name,\n ...(o.maxRuns === undefined ? {} : { maxRuns: o.maxRuns }),\n ...(o.budgetMs === undefined ? {} : { budgetMs: o.budgetMs }),\n ...(o.exhaustive ? { exhaustive: true } : {}),\n scenarioImport: `../${basename(scenarioPath)}`,\n // So is a Worker entry outside it, as a scenario kept apart from the Workers it checks has.\n ...(loaded && outside(loaded.worker.entry)\n ? { workerImport: toPosix(relative(workDir, resolve(dir, loaded.worker.entry))) }\n : {}),\n ...(allCallees.length === 0\n ? {}\n : {\n callees: allCallees.map((c) => ({\n binding: c.binding,\n name: c.name,\n importPath: toPosix(relative(workDir, c.entry)),\n ...bindingCarries(callerResources, c.binding, callees),\n ...(isSelf(c) ? { self: true } : {}),\n })),\n }),\n ...(sqlImports.length === 0 ? {} : { sqlImports }),\n ...(Object.keys(isolate.aliases).length === 0 ? {} : { aliases: isolate.aliases }),\n }),\n );\n // Read through the TypeScript compiler, which is loaded only once a spec file is found: a\n // directory with none is checked without it.\n let specModules: SpecModule[];\n try {\n specModules = await findSpecModules(dir);\n } catch (err) {\n if (!(err instanceof TypescriptNeeded)) throw err;\n o.stderr(`the scenario's directory holds spec files (*.props.ts): ${err.message}\\n`);\n return exitCodes.error;\n }\n for (const f of specFiles(specModules, workDir)) {\n mkdirSync(dirname(join(workDir, f.name)), { recursive: true });\n writeFileSync(join(workDir, f.name), f.source);\n }\n const reportPath = join(workDir, `vitest-report.${stamp}.json`);\n rmSync(reportPath, { force: true }); // never read a report left by an earlier --keep run\n if (callees.length > 0 && loaded) {\n // The caller's module as the scenario names it, whatever the wrangler config's format.\n const callerEntry = resolve(dir, loaded.worker.entry);\n writeFileSync(mainPath, mainModuleSource(workDir, callerEntry, callees, isolate));\n writeFileSync(\n configPath,\n vitestConfigSource(\n wrangler,\n testPath,\n reportPath,\n {\n main: mainPath,\n miniflare: miniflareOptionsSource(callees, isolate, callerServices, env),\n },\n o.console === true,\n ),\n );\n } else\n writeFileSync(\n configPath,\n vitestConfigSource(\n wrangler,\n testPath,\n reportPath,\n loaded\n ? {\n main: resolve(dir, loaded.worker.entry),\n ...(callerServices.length > 0 || Object.keys(env).length > 0\n ? { miniflare: miniflareOptionsSource([], undefined, callerServices, env) }\n : {}),\n }\n : undefined,\n o.console === true,\n ),\n );\n rmSync(consoleFile(reportPath), { force: true }); // never show what an earlier --keep run wrote\n const { code, output } = await runVitest(vitestBin(dir), configPath, dir);\n // Before anything the check goes on to say, an error of its own included: what the Workers wrote\n // is often why.\n if (o.console === true) o.stderr(consoleOutput(consoleFile(reportPath)));\n const left = (path: string) => (existsSync(path) ? readFileSync(path, \"utf8\") : undefined);\n const ran = { report: left(reportPath), unhandled: left(unhandledErrorsFile(reportPath)) };\n // Vitest fails a run on an error nothing handled; Cloudflare's runtime only logs one, so when\n // those are the run's only fault the verdict its passed test left stands, told beside them.\n const stray = code === 0 ? undefined : strayErrors(ran);\n const transport = code === 0 || stray !== undefined ? readTransport(reportPath) : null;\n if (!transport) {\n const why = vitestFailure(ran);\n o.stderr(\n `eutaxy check could not read a verdict from Vitest (exit ${code}):\\n${why}Vitest's output:\\n${output}\\n`,\n );\n return exitCodes.error;\n }\n // Told first, so the errors are seen whatever the check goes on to say, an error of its own included.\n if (stray !== undefined) o.stderr(strayNote(stray));\n if (transport.specErrors && transport.specErrors.length > 0) {\n for (const e of transport.specErrors)\n o.stderr(`${e.module}${e.line > 0 ? `:${e.line}` : \"\"}: ${e.message}\\n`);\n return exitCodes.error;\n }\n const report = transport.report as { verdict: ScenarioVerdict; specs?: readonly SpecVerdict[] };\n const verdict = report.verdict;\n let specs = report.specs ?? [];\n if (engines.length > 0)\n specs = await proveSpecs(dir, transport.observed ?? [], specs, engines, specModules);\n // The regression test's path goes into the JSON report too (an optional field of schema 1), so a\n // caller that reads the report knows where the replay is without parsing the text.\n // A violation gets a test that replays it; so does a run that met something outside the model,\n // which replays by its faults' calls. Other UNSUPPORTED causes do not replay from one run.\n const replayable =\n verdict.kind === \"VIOLATED\" ||\n (verdict.kind === \"UNSUPPORTED\" &&\n verdict.cause === \"unsupported_api\" &&\n verdict.replay !== undefined);\n const regressionPath =\n replayable && !o.noRegression\n ? o.out\n ? resolve(o.cwd, o.out)\n : join(dir, `${name}.regression.test.ts`)\n : undefined;\n const printed = {\n ...(transport.report as object),\n ...(o.provers && o.provers.length > 0 ? { specs } : {}),\n ...(regressionPath === undefined\n ? {}\n : { regressionTest: toPosix(relative(o.cwd, regressionPath) || regressionPath) }),\n ...(stray === undefined ? {} : { unhandledErrors: stray }),\n };\n if (o.json) o.stdout(`${canonicalJson(printed as JsonValue)}\\n`);\n else o.stdout(`${renderText(verdict)}\\n${specs.length > 0 ? `\\n${renderSpecs(specs)}\\n` : \"\"}`);\n\n if (regressionPath !== undefined) {\n const outPath = regressionPath;\n const outDir = dirname(outPath);\n const schemaPaths: Record<string, string[]> = {};\n for (const step of transport.setup) {\n if (step.kind === \"d1\") {\n const binding = String(step[\"binding\"]);\n const path = toPosix(relative(outDir, resolve(dir, String(step[\"schemaFile\"]))));\n schemaPaths[binding] = [...(schemaPaths[binding] ?? []), path];\n }\n }\n const calleePaths: Record<\n string,\n {\n name: string;\n path: string;\n entrypoint?: string;\n props?: Readonly<Record<string, unknown>>;\n }\n > = {};\n for (const step of transport.setup) {\n if (step.kind !== \"callee\") continue;\n const binding = String(step[\"binding\"]);\n const carried = transport.callees?.[binding];\n if (carried === undefined) continue;\n calleePaths[binding] = {\n ...carried,\n path: toPosix(relative(outDir, resolve(dir, String(step[\"entry\"])))),\n };\n }\n const testOptions: CloudflareRegressionOptions = {\n scenarioPath: toPosix(relative(outDir, scenarioPath)),\n workerPath: toPosix(relative(outDir, resolve(dir, transport.worker.entry))),\n schemaPaths,\n ...(Object.keys(calleePaths).length === 0\n ? {}\n : {\n callees: calleePaths,\n calleeBindings: isolateBindings(callees).filter((b) => !(b in isolate.aliases)),\n ...(transport.aliases === undefined ? {} : { aliases: transport.aliases }),\n }),\n ...(Object.keys(env).length === 0 ? {} : { envBindings: Object.keys(env) }),\n ...(o.budgetMs === undefined ? {} : { budgetMs: o.budgetMs }),\n ...(needsObjectHelpers(transport.setup) ? { durableObjects: true } : {}),\n ...(transport.setup.some((s) => s.kind === \"workflow\") ||\n (transport.drive?.kind === \"rpc\" && transport.drive[\"entrypoint\"] !== undefined)\n ? { exports: true }\n : {}),\n ...(o.expectViolation ? { expect: \"violates\" as const } : {}),\n ...((transport.observed ?? []).length > 0\n ? {\n specModules: (transport.observed ?? []).map((m) => ({\n path: toPosix(relative(outDir, resolve(dir, m.module))),\n functions: m.functions,\n })),\n }\n : {}),\n };\n const source =\n verdict.kind === \"UNSUPPORTED\"\n ? cloudflareUnsupportedTest(verdict, testOptions)\n : cloudflareRegressionTest(verdict as Violated, testOptions);\n mkdirSync(outDir, { recursive: true });\n writeFileSync(outPath, source);\n if (!o.json)\n o.stdout(\n `\\n${verdict.kind === \"UNSUPPORTED\" ? \"Test replaying the run\" : \"Regression test\"} written to ${relative(o.cwd, outPath) || outPath}\\n`,\n );\n }\n // A refuted spec fails the check like a violation does; so does a conflict between engines.\n if (\n verdict.kind !== \"VIOLATED\" &&\n specs.some((v) => v.kind === \"REFUTED\" || v.kind === \"CONFLICT\")\n )\n return exitCodes.VIOLATED;\n return exitCodes[verdict.kind];\n } finally {\n if (!o.keep) cleanUp(workDir, stamp);\n }\n}\n\n/**\n * Remove this run's files; the shared ones and the directory go only when\n * no other run's files are left there (another check may still be using\n * them).\n */\nfunction cleanUp(workDir: string, stamp: string): void {\n if (!existsSync(workDir)) return;\n for (const f of readdirSync(workDir))\n if (f.includes(`.${stamp}.`)) rmSync(join(workDir, f), { force: true });\n const others = readdirSync(workDir).some((f) =>\n /\\.check\\.test\\.ts$|^vitest\\.config\\..*\\.mts$|^vitest-report\\./.test(f),\n );\n if (!others) rmSync(workDir, { recursive: true, force: true });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAUA,IAAI,aAAa;;AAGjB,SAAgB,sBAA4B;CAC1C,IAAI,YAAY;CAChB,aAAa;CACb,cAAc,EACZ,QAAQ,WAAW,SAAS,aAAa;EACvC,IAAI;GACF,OAAO,YAAY,WAAW,OAAO;EACvC,SAAS,KAAK;GAEZ,IAAI,EADa,UAAU,WAAW,IAAI,KAAK,UAAU,WAAW,KAAK,MACxD,CAAC,QAAQ,WAAW,SAAS,KAAK,GAAG,MAAM;GAC5D,MAAM,OAAO,UAAU,SAAS,KAAK,IAAI,UAAU,MAAM,GAAG,EAAE,IAAI;GAClE,KAAK,MAAM,aAAa,CAAC,GAAG,KAAK,MAAM,GAAG,KAAK,UAAU,GACvD,IAAI;IACF,OAAO,YAAY,WAAW,OAAO;GACvC,QAAQ,CAAC;GAEX,MAAM;EACR;CACF,EACF,CAAC;AACH;;;;;;;;;;;;;;AChBA,SAAgB,WAAW,MAAuB;CAChD,IAAI,MAAM;CACV,IAAI,IAAI;;CAER,MAAM,aAAa,SAAyB;EAC1C,IAAI,IAAI;EACR,SAAS;GACP,OAAO,IAAI,KAAK,UAAU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as proverNames, c as typescriptMissing, l as typescriptNeeded, n as exitCodes, o as runCheck } from "./check-zkHLdWyf.mjs";
2
+ import { t as runDraft } from "./draft-DEUDffHa.mjs";
3
+ // packages/cli/src/args.ts
4
+ function parseArgs(argv, booleans = []) {
5
+ const positionals = [];
6
+ const flags = {};
7
+ for (let i = 0; i < argv.length; i++) {
8
+ const a = argv[i];
9
+ if (!a.startsWith("--")) {
10
+ positionals.push(a);
11
+ continue;
12
+ }
13
+ const eq = a.indexOf("=");
14
+ if (eq !== -1) {
15
+ flags[a.slice(2, eq)] = a.slice(eq + 1);
16
+ continue;
17
+ }
18
+ const name = a.slice(2);
19
+ const next = argv[i + 1];
20
+ if (booleans.includes(name) || next === void 0 || next.startsWith("--")) flags[name] = true;
21
+ else {
22
+ flags[name] = next;
23
+ i++;
24
+ }
25
+ }
26
+ return {
27
+ positionals,
28
+ flags
29
+ };
30
+ }
31
+ // packages/cli/src/main.ts
32
+ const usage = `eutaxy — deterministic simulation checks and spec verdicts for Cloudflare Workers
33
+
34
+ Usage:
35
+ eutaxy check <scenario.sim.ts> [options]
36
+ eutaxy draft [wrangler config] [--worker <module>] [--out <file>] [--json]
37
+ eutaxy report [dir] [--prover <names>] [--seed <seed>] [--json]
38
+ eutaxy prover install <lean|smt> [--from <url or directory>] [--json]
39
+ eutaxy mcp
40
+
41
+ check options:
42
+ --wrangler <path> wrangler config (default: the one the scenario names, else
43
+ wrangler.jsonc/json/toml beside the scenario)
44
+ --seed <seed> exploration seed (default: the scenario file name)
45
+ --max-runs <n> cap on exploration runs in addition to the scenario's time budget
46
+ --budget-ms <n> replace the scenario's time budget (with --max-runs, the run cap decides)
47
+ --exhaustive run every schedule within the bounds once (with partial-order reduction)
48
+ --prover <names> also run the PROVEN rung with these engines on the scenario's specs
49
+ (comma-separated; known: lean, smt)
50
+ --json print the versioned JSON report instead of text
51
+ --out <path> where to write the regression test on a violation, or the
52
+ test replaying the run that met something outside the model
53
+ --no-regression do not write either test
54
+ --expect-violation write a regression test that asserts the violation (for corpora)
55
+ --keep keep the generated .eutaxy/ files
56
+ --console show what the Workers wrote to the console during the check,
57
+ on stderr
58
+
59
+ draft writes a scenario skeleton from a wrangler config (JSON or JSONC; default:
60
+ wrangler.jsonc or wrangler.json in the current directory) and the Worker module it names
61
+ (--worker to name another): the bindings become setup steps (a service binding whose
62
+ Worker's config is found under the directory becomes a callee), the handlers the drive,
63
+ the hosts the code fetches the externals; the invariants and the events are left as holes
64
+ marked TODO. It prints the scenario, or writes it to --out (never over an existing file);
65
+ nothing is imported or run.
66
+
67
+ report runs every spec file (*.props.ts) under dir (default: the current directory)
68
+ through the TESTED rung, on inputs drawn from the parameter types with the seed
69
+ (default: report), and the PROVEN rung with --prover. No scenario runs, so nothing
70
+ is CHECKED.
71
+
72
+ prover install smt puts the pinned Z3 for this platform in Eutaxy's cache
73
+ (EUTAXY_CACHE_DIR, else the platform's user cache), where --prover finds it first:
74
+ downloaded from the upstream GitHub release, or from a mirror or offline directory
75
+ holding the same file (--from), and checked against its SHA-256 before the solver is
76
+ taken from it. prover install lean installs the pinned Lean through elan: the machine's
77
+ elan, else elan put in Eutaxy's cache from its pinned installer (the PATH and the
78
+ shell's profile untouched); the toolchain's files are checked against the pinned
79
+ digest. Nothing is downloaded at any other time.
80
+
81
+ report options: --goals writes each module's open Lean goals beside its spec file as
82
+ <spec>.goals.lean (a proof file with every proof open) and lists them; needs --prover lean.
83
+
84
+ mcp serves the Model Context Protocol over stdio (one JSON-RPC message per line, logs on
85
+ stderr) for a coding agent: tools check, report, goals, prove and prover_status, each
86
+ returning the JSON report, and draft, returning the drafted scenario. Point the agent's
87
+ MCP configuration at "eutaxy mcp".
88
+
89
+ Exit codes: 0 BOUNDED, 1 VIOLATED or a REFUTED or CONFLICT spec, 2 UNSUPPORTED, 3 error.
90
+ report: 0, or 1 for a REFUTED or CONFLICT spec, 3 error. prover install: 0, or 3.
91
+ `;
92
+ /**
93
+ * A part of the command that reads specs or runs an engine, loaded when its command is given: it
94
+ * loads the TypeScript compiler, which a project that only checks scenarios need not have
95
+ * installed. Undefined, with why on stderr, when the compiler is not there.
96
+ */
97
+ async function needingTypescript(what, load, io) {
98
+ try {
99
+ return await load();
100
+ } catch (err) {
101
+ if (!typescriptMissing(err)) throw err;
102
+ io.stderr(`${what} needs ${typescriptNeeded}\n`);
103
+ return;
104
+ }
105
+ }
106
+ async function main(argv, io) {
107
+ const { positionals, flags } = parseArgs(argv, [
108
+ "json",
109
+ "no-regression",
110
+ "expect-violation",
111
+ "keep",
112
+ "console",
113
+ "help",
114
+ "exhaustive",
115
+ "goals"
116
+ ]);
117
+ const command = positionals[0];
118
+ if (!command || command === "help" || flags["help"] === true) {
119
+ io.stdout(usage);
120
+ return command ? exitCodes.BOUNDED : exitCodes.error;
121
+ }
122
+ for (const k of [
123
+ "wrangler",
124
+ "seed",
125
+ "max-runs",
126
+ "budget-ms",
127
+ "prover",
128
+ "out",
129
+ "from",
130
+ "worker"
131
+ ]) if (flags[k] === true) {
132
+ io.stderr(`--${k} needs a value\n`);
133
+ return exitCodes.error;
134
+ }
135
+ const str = (k) => typeof flags[k] === "string" ? flags[k] : void 0;
136
+ const provers = (str("prover") ?? "").split(",").map((n) => n.trim()).filter((n) => n.length > 0);
137
+ if (command === "mcp") {
138
+ if (positionals.length !== 1 || Object.keys(flags).length > 0) {
139
+ io.stderr(`mcp takes no arguments\n\n${usage}`);
140
+ return exitCodes.error;
141
+ }
142
+ const { serveStdio } = await import("./mcp-B64Ko6y7.mjs");
143
+ return serveStdio({
144
+ cwd: io.cwd,
145
+ log: io.stderr
146
+ });
147
+ }
148
+ if (command === "prover") {
149
+ const engines = proverNames;
150
+ const names = engines.join("|");
151
+ if (positionals[1] !== "install" || positionals.length !== 3) {
152
+ io.stderr(`prover takes: install <${names}>\n\n${usage}`);
153
+ return exitCodes.error;
154
+ }
155
+ const other = Object.keys(flags).find((k) => !["from", "json"].includes(k));
156
+ if (other !== void 0) {
157
+ io.stderr(`prover install does not take --${other}\n`);
158
+ return exitCodes.error;
159
+ }
160
+ const engine = positionals[2];
161
+ if (!engines.includes(engine)) {
162
+ io.stderr(`unknown engine ${positionals[2]}; the engines are ${names.replaceAll("|", ", ")}\n`);
163
+ return exitCodes.error;
164
+ }
165
+ const installer = await needingTypescript("eutaxy prover install", () => import("./install-DkzpGA5D.mjs"), io);
166
+ if (installer === void 0) return exitCodes.error;
167
+ return installer.runInstall({
168
+ engine,
169
+ from: str("from"),
170
+ json: flags["json"] === true,
171
+ stdout: io.stdout,
172
+ stderr: io.stderr
173
+ });
174
+ }
175
+ if (command === "report") {
176
+ if (positionals.length > 2) {
177
+ io.stderr(`report takes one directory\n\n${usage}`);
178
+ return exitCodes.error;
179
+ }
180
+ const other = Object.keys(flags).find((k) => ![
181
+ "prover",
182
+ "seed",
183
+ "json",
184
+ "goals"
185
+ ].includes(k));
186
+ if (other !== void 0) {
187
+ io.stderr(`report does not take --${other}\n`);
188
+ return exitCodes.error;
189
+ }
190
+ const dir = positionals[1];
191
+ const report = await needingTypescript("eutaxy report", () => import("./report-_Vzavqg0.mjs"), io);
192
+ if (report === void 0) return exitCodes.error;
193
+ const { runReport } = report;
194
+ return runReport({
195
+ cwd: io.cwd,
196
+ ...dir === void 0 ? {} : { dir },
197
+ ...provers.length > 0 ? { provers } : {},
198
+ ...str("seed") ? { seed: str("seed") } : {},
199
+ ...flags["goals"] === true ? { goals: true } : {},
200
+ json: flags["json"] === true,
201
+ stdout: io.stdout,
202
+ stderr: io.stderr
203
+ });
204
+ }
205
+ if (command === "draft") {
206
+ if (positionals.length > 2) {
207
+ io.stderr(`draft takes one wrangler config\n\n${usage}`);
208
+ return exitCodes.error;
209
+ }
210
+ const other = Object.keys(flags).find((k) => ![
211
+ "worker",
212
+ "out",
213
+ "json"
214
+ ].includes(k));
215
+ if (other !== void 0) {
216
+ io.stderr(`draft does not take --${other}\n`);
217
+ return exitCodes.error;
218
+ }
219
+ const config = positionals[1];
220
+ const worker = str("worker");
221
+ const out = str("out");
222
+ return runDraft({
223
+ cwd: io.cwd,
224
+ ...config === void 0 ? {} : { config },
225
+ ...worker === void 0 ? {} : { worker },
226
+ ...out === void 0 ? {} : { out },
227
+ json: flags["json"] === true,
228
+ stdout: io.stdout,
229
+ stderr: io.stderr
230
+ });
231
+ }
232
+ if (command !== "check") {
233
+ io.stderr(`unknown command ${command}\n\n${usage}`);
234
+ return exitCodes.error;
235
+ }
236
+ const scenario = positionals[1];
237
+ if (!scenario) {
238
+ io.stderr(`check needs a scenario file\n\n${usage}`);
239
+ return exitCodes.error;
240
+ }
241
+ if (positionals.length > 2) {
242
+ io.stderr(`check takes one scenario file\n\n${usage}`);
243
+ return exitCodes.error;
244
+ }
245
+ const checkFlags = [
246
+ "wrangler",
247
+ "seed",
248
+ "max-runs",
249
+ "budget-ms",
250
+ "exhaustive",
251
+ "prover",
252
+ "json",
253
+ "out",
254
+ "no-regression",
255
+ "expect-violation",
256
+ "keep",
257
+ "console"
258
+ ];
259
+ const unknownFlag = Object.keys(flags).find((k) => !checkFlags.includes(k));
260
+ if (unknownFlag !== void 0) {
261
+ io.stderr(`check does not take --${unknownFlag}\n`);
262
+ return exitCodes.error;
263
+ }
264
+ const maxRunsText = str("max-runs");
265
+ const maxRuns = maxRunsText === void 0 ? void 0 : Number(maxRunsText);
266
+ if (maxRuns !== void 0 && !(Number.isInteger(maxRuns) && maxRuns > 0)) {
267
+ io.stderr(`--max-runs must be a positive integer, got ${JSON.stringify(maxRunsText)}\n`);
268
+ return exitCodes.error;
269
+ }
270
+ const budgetText = str("budget-ms");
271
+ const budgetMs = budgetText === void 0 ? void 0 : Number(budgetText);
272
+ if (budgetMs !== void 0 && !(Number.isInteger(budgetMs) && budgetMs > 0)) {
273
+ io.stderr(`--budget-ms must be a positive integer, got ${JSON.stringify(budgetText)}\n`);
274
+ return exitCodes.error;
275
+ }
276
+ return runCheck({
277
+ scenario,
278
+ cwd: io.cwd,
279
+ ...provers.length > 0 ? { provers } : {},
280
+ ...str("wrangler") ? { wrangler: str("wrangler") } : {},
281
+ ...str("seed") ? { seed: str("seed") } : {},
282
+ ...maxRuns === void 0 ? {} : { maxRuns },
283
+ ...budgetMs === void 0 ? {} : { budgetMs },
284
+ exhaustive: flags["exhaustive"] === true,
285
+ json: flags["json"] === true,
286
+ ...str("out") ? { out: str("out") } : {},
287
+ noRegression: flags["no-regression"] === true,
288
+ expectViolation: flags["expect-violation"] === true,
289
+ keep: flags["keep"] === true,
290
+ console: flags["console"] === true,
291
+ stdout: io.stdout,
292
+ stderr: io.stderr
293
+ });
294
+ }
295
+ export { main as t };
296
+
297
+ //# sourceMappingURL=cli-CNAKqV9R.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-CNAKqV9R.mjs","names":[],"sources":["../../cli/src/args.ts","../../cli/src/main.ts"],"sourcesContent":["/** A small argument parser: positionals, `--flag value`, `--flag=value` and boolean `--flag`. */\n\nexport interface ParsedArgs {\n readonly positionals: readonly string[];\n readonly flags: Readonly<Record<string, string | true>>;\n}\n\nexport function parseArgs(argv: readonly string[], booleans: readonly string[] = []): ParsedArgs {\n const positionals: string[] = [];\n const flags: Record<string, string | true> = {};\n for (let i = 0; i < argv.length; i++) {\n const a = argv[i] as string;\n if (!a.startsWith(\"--\")) {\n positionals.push(a);\n continue;\n }\n const eq = a.indexOf(\"=\");\n if (eq !== -1) {\n flags[a.slice(2, eq)] = a.slice(eq + 1);\n continue;\n }\n const name = a.slice(2);\n const next = argv[i + 1];\n if (booleans.includes(name) || next === undefined || next.startsWith(\"--\")) {\n flags[name] = true;\n } else {\n flags[name] = next;\n i++;\n }\n }\n return { positionals, flags };\n}\n","import { parseArgs } from \"./args.ts\";\nimport { exitCodes, proverNames, runCheck } from \"./check.ts\";\nimport { runDraft } from \"./draft.ts\";\nimport type { Engine } from \"./install.ts\";\nimport { typescriptMissing, typescriptNeeded } from \"./specs.ts\";\n\nconst usage = `eutaxy — deterministic simulation checks and spec verdicts for Cloudflare Workers\n\nUsage:\n eutaxy check <scenario.sim.ts> [options]\n eutaxy draft [wrangler config] [--worker <module>] [--out <file>] [--json]\n eutaxy report [dir] [--prover <names>] [--seed <seed>] [--json]\n eutaxy prover install <lean|smt> [--from <url or directory>] [--json]\n eutaxy mcp\n\ncheck options:\n --wrangler <path> wrangler config (default: the one the scenario names, else\n wrangler.jsonc/json/toml beside the scenario)\n --seed <seed> exploration seed (default: the scenario file name)\n --max-runs <n> cap on exploration runs in addition to the scenario's time budget\n --budget-ms <n> replace the scenario's time budget (with --max-runs, the run cap decides)\n --exhaustive run every schedule within the bounds once (with partial-order reduction)\n --prover <names> also run the PROVEN rung with these engines on the scenario's specs\n (comma-separated; known: lean, smt)\n --json print the versioned JSON report instead of text\n --out <path> where to write the regression test on a violation, or the\n test replaying the run that met something outside the model\n --no-regression do not write either test\n --expect-violation write a regression test that asserts the violation (for corpora)\n --keep keep the generated .eutaxy/ files\n --console show what the Workers wrote to the console during the check,\n on stderr\n\ndraft writes a scenario skeleton from a wrangler config (JSON or JSONC; default:\nwrangler.jsonc or wrangler.json in the current directory) and the Worker module it names\n(--worker to name another): the bindings become setup steps (a service binding whose\nWorker's config is found under the directory becomes a callee), the handlers the drive,\nthe hosts the code fetches the externals; the invariants and the events are left as holes\nmarked TODO. It prints the scenario, or writes it to --out (never over an existing file);\nnothing is imported or run.\n\nreport runs every spec file (*.props.ts) under dir (default: the current directory)\nthrough the TESTED rung, on inputs drawn from the parameter types with the seed\n(default: report), and the PROVEN rung with --prover. No scenario runs, so nothing\nis CHECKED.\n\nprover install smt puts the pinned Z3 for this platform in Eutaxy's cache\n(EUTAXY_CACHE_DIR, else the platform's user cache), where --prover finds it first:\ndownloaded from the upstream GitHub release, or from a mirror or offline directory\nholding the same file (--from), and checked against its SHA-256 before the solver is\ntaken from it. prover install lean installs the pinned Lean through elan: the machine's\nelan, else elan put in Eutaxy's cache from its pinned installer (the PATH and the\nshell's profile untouched); the toolchain's files are checked against the pinned\ndigest. Nothing is downloaded at any other time.\n\nreport options: --goals writes each module's open Lean goals beside its spec file as\n<spec>.goals.lean (a proof file with every proof open) and lists them; needs --prover lean.\n\nmcp serves the Model Context Protocol over stdio (one JSON-RPC message per line, logs on\nstderr) for a coding agent: tools check, report, goals, prove and prover_status, each\nreturning the JSON report, and draft, returning the drafted scenario. Point the agent's\nMCP configuration at \"eutaxy mcp\".\n\nExit codes: 0 BOUNDED, 1 VIOLATED or a REFUTED or CONFLICT spec, 2 UNSUPPORTED, 3 error.\nreport: 0, or 1 for a REFUTED or CONFLICT spec, 3 error. prover install: 0, or 3.\n`;\n\nexport interface Io {\n readonly cwd: string;\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\n}\n\n/**\n * A part of the command that reads specs or runs an engine, loaded when its command is given: it\n * loads the TypeScript compiler, which a project that only checks scenarios need not have\n * installed. Undefined, with why on stderr, when the compiler is not there.\n */\nasync function needingTypescript<T>(\n what: string,\n load: () => Promise<T>,\n io: Io,\n): Promise<T | undefined> {\n try {\n return await load();\n } catch (err) {\n if (!typescriptMissing(err)) throw err;\n io.stderr(`${what} needs ${typescriptNeeded}\\n`);\n return undefined;\n }\n}\n\nexport async function main(argv: readonly string[], io: Io): Promise<number> {\n const { positionals, flags } = parseArgs(argv, [\n \"json\",\n \"no-regression\",\n \"expect-violation\",\n \"keep\",\n \"console\",\n \"help\",\n \"exhaustive\",\n \"goals\",\n ]);\n const command = positionals[0];\n if (!command || command === \"help\" || flags[\"help\"] === true) {\n io.stdout(usage);\n return command ? exitCodes.BOUNDED : exitCodes.error;\n }\n // A value flag given without one would otherwise read as absent: `--prover` alone must not quietly\n // skip the PROVEN rung.\n for (const k of [\"wrangler\", \"seed\", \"max-runs\", \"budget-ms\", \"prover\", \"out\", \"from\", \"worker\"])\n if (flags[k] === true) {\n io.stderr(`--${k} needs a value\\n`);\n return exitCodes.error;\n }\n const str = (k: string): string | undefined =>\n typeof flags[k] === \"string\" ? (flags[k] as string) : undefined;\n const provers = (str(\"prover\") ?? \"\")\n .split(\",\")\n .map((n) => n.trim())\n .filter((n) => n.length > 0);\n if (command === \"mcp\") {\n if (positionals.length !== 1 || Object.keys(flags).length > 0) {\n io.stderr(`mcp takes no arguments\\n\\n${usage}`);\n return exitCodes.error;\n }\n // The server, the installer and the report are loaded where a command needs them: the last two\n // load the engines and the spec reader, and with them the TypeScript compiler, which a project\n // that only checks scenarios need not have installed.\n const { serveStdio } = await import(\"./mcp.ts\");\n return serveStdio({ cwd: io.cwd, log: io.stderr });\n }\n if (command === \"prover\") {\n // The usage is checked first, from the engines' names alone; the installer is loaded once there\n // is something to install.\n const engines: readonly string[] = proverNames;\n const names = engines.join(\"|\");\n if (positionals[1] !== \"install\" || positionals.length !== 3) {\n io.stderr(`prover takes: install <${names}>\\n\\n${usage}`);\n return exitCodes.error;\n }\n const other = Object.keys(flags).find((k) => ![\"from\", \"json\"].includes(k));\n if (other !== undefined) {\n io.stderr(`prover install does not take --${other}\\n`);\n return exitCodes.error;\n }\n const engine = positionals[2] as Engine;\n if (!engines.includes(engine)) {\n io.stderr(\n `unknown engine ${positionals[2]}; the engines are ${names.replaceAll(\"|\", \", \")}\\n`,\n );\n return exitCodes.error;\n }\n const installer = await needingTypescript(\n \"eutaxy prover install\",\n () => import(\"./install.ts\"),\n io,\n );\n if (installer === undefined) return exitCodes.error;\n return installer.runInstall({\n engine,\n from: str(\"from\"),\n json: flags[\"json\"] === true,\n stdout: io.stdout,\n stderr: io.stderr,\n });\n }\n if (command === \"report\") {\n if (positionals.length > 2) {\n io.stderr(`report takes one directory\\n\\n${usage}`);\n return exitCodes.error;\n }\n const other = Object.keys(flags).find((k) => ![\"prover\", \"seed\", \"json\", \"goals\"].includes(k));\n if (other !== undefined) {\n io.stderr(`report does not take --${other}\\n`);\n return exitCodes.error;\n }\n const dir = positionals[1];\n const report = await needingTypescript(\"eutaxy report\", () => import(\"./report.ts\"), io);\n if (report === undefined) return exitCodes.error;\n const { runReport } = report;\n return runReport({\n cwd: io.cwd,\n ...(dir === undefined ? {} : { dir }),\n ...(provers.length > 0 ? { provers } : {}),\n ...(str(\"seed\") ? { seed: str(\"seed\") as string } : {}),\n ...(flags[\"goals\"] === true ? { goals: true } : {}),\n json: flags[\"json\"] === true,\n stdout: io.stdout,\n stderr: io.stderr,\n });\n }\n if (command === \"draft\") {\n if (positionals.length > 2) {\n io.stderr(`draft takes one wrangler config\\n\\n${usage}`);\n return exitCodes.error;\n }\n const other = Object.keys(flags).find((k) => ![\"worker\", \"out\", \"json\"].includes(k));\n if (other !== undefined) {\n io.stderr(`draft does not take --${other}\\n`);\n return exitCodes.error;\n }\n const config = positionals[1];\n const worker = str(\"worker\");\n const out = str(\"out\");\n return runDraft({\n cwd: io.cwd,\n ...(config === undefined ? {} : { config }),\n ...(worker === undefined ? {} : { worker }),\n ...(out === undefined ? {} : { out }),\n json: flags[\"json\"] === true,\n stdout: io.stdout,\n stderr: io.stderr,\n });\n }\n if (command !== \"check\") {\n io.stderr(`unknown command ${command}\\n\\n${usage}`);\n return exitCodes.error;\n }\n const scenario = positionals[1];\n if (!scenario) {\n io.stderr(`check needs a scenario file\\n\\n${usage}`);\n return exitCodes.error;\n }\n if (positionals.length > 2) {\n io.stderr(`check takes one scenario file\\n\\n${usage}`);\n return exitCodes.error;\n }\n const checkFlags = [\n \"wrangler\",\n \"seed\",\n \"max-runs\",\n \"budget-ms\",\n \"exhaustive\",\n \"prover\",\n \"json\",\n \"out\",\n \"no-regression\",\n \"expect-violation\",\n \"keep\",\n \"console\",\n ];\n const unknownFlag = Object.keys(flags).find((k) => !checkFlags.includes(k));\n if (unknownFlag !== undefined) {\n io.stderr(`check does not take --${unknownFlag}\\n`);\n return exitCodes.error;\n }\n const maxRunsText = str(\"max-runs\");\n const maxRuns = maxRunsText === undefined ? undefined : Number(maxRunsText);\n if (maxRuns !== undefined && !(Number.isInteger(maxRuns) && maxRuns > 0)) {\n io.stderr(`--max-runs must be a positive integer, got ${JSON.stringify(maxRunsText)}\\n`);\n return exitCodes.error;\n }\n const budgetText = str(\"budget-ms\");\n const budgetMs = budgetText === undefined ? undefined : Number(budgetText);\n if (budgetMs !== undefined && !(Number.isInteger(budgetMs) && budgetMs > 0)) {\n io.stderr(`--budget-ms must be a positive integer, got ${JSON.stringify(budgetText)}\\n`);\n return exitCodes.error;\n }\n return runCheck({\n scenario,\n cwd: io.cwd,\n ...(provers.length > 0 ? { provers } : {}),\n ...(str(\"wrangler\") ? { wrangler: str(\"wrangler\") as string } : {}),\n ...(str(\"seed\") ? { seed: str(\"seed\") as string } : {}),\n ...(maxRuns === undefined ? {} : { maxRuns }),\n ...(budgetMs === undefined ? {} : { budgetMs }),\n exhaustive: flags[\"exhaustive\"] === true,\n json: flags[\"json\"] === true,\n ...(str(\"out\") ? { out: str(\"out\") as string } : {}),\n noRegression: flags[\"no-regression\"] === true,\n expectViolation: flags[\"expect-violation\"] === true,\n keep: flags[\"keep\"] === true,\n console: flags[\"console\"] === true,\n stdout: io.stdout,\n stderr: io.stderr,\n });\n}\n"],"mappings":";;;AAOA,SAAgB,UAAU,MAAyB,WAA8B,CAAC,GAAe;CAC/F,MAAM,cAAwB,CAAC;CAC/B,MAAM,QAAuC,CAAC;CAC9C,KAAK,IAAI,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;EACpC,MAAM,IAAI,KAAK;EACf,IAAI,CAAC,EAAE,WAAW,IAAI,GAAG;GACvB,YAAY,KAAK,CAAC;GAClB;EACF;EACA,MAAM,KAAK,EAAE,QAAQ,GAAG;EACxB,IAAI,OAAO,IAAI;GACb,MAAM,EAAE,MAAM,GAAG,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;GACtC;EACF;EACA,MAAM,OAAO,EAAE,MAAM,CAAC;EACtB,MAAM,OAAO,KAAK,IAAI;EACtB,IAAI,SAAS,SAAS,IAAI,KAAK,SAAS,KAAA,KAAa,KAAK,WAAW,IAAI,GACvE,MAAM,QAAQ;OACT;GACL,MAAM,QAAQ;GACd;EACF;CACF;CACA,OAAO;EAAE;EAAa;CAAM;AAC9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AAC,IAAI,EAAE,SAAS;EAC7C,YAAY,MAAM,kBAAkB;EACpC,MAAM,MAAM,YAAY;EACxB,GAAI,IAAI,KAAK,IAAI,EAAE,KAAK,IAAI,KAAK,EAAY,IAAI,CAAC;EAClD,cAAc,MAAM,qBAAqB;EACzC,iBAAiB,MAAM,wBAAwB;EAC/C,MAAM,MAAM,YAAY;EACxB,SAAS,MAAM,eAAe;EAC9B,QAAQ,GAAG;EACX,QAAQ,GAAG;CACb,CAAC;AACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,UAkEiB;WACN;WACA,SAAS;WACT,SAAS;;wBAGE,KAAK,yBAAyB,IAAI,KAAK"}
1
+ {"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,UAmEiB;WACN;WACA,SAAS;WACT,SAAS;;wBAsBE,KAAK,yBAAyB,IAAI,KAAK"}
package/dist/cli.mjs CHANGED
@@ -1 +1 @@
1
- export { t as main } from "./cli-DyA7uTBg.mjs";
1
+ export { t as main } from "./cli-CNAKqV9R.mjs";