eutaxy 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/aws.d.mts +1 -1
- package/dist/aws.mjs +2 -2
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +2 -2
- package/dist/cli-NqY61bpo.mjs +2 -0
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cloudflare.d.mts +84 -7
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +980 -248
- package/dist/cloudflare.mjs.map +1 -1
- package/dist/{explore-YVHTRjjS.d.mts → explore-BHYvAZKN.d.mts} +23 -2
- package/dist/explore-BHYvAZKN.d.mts.map +1 -0
- package/dist/index.d.mts +233 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +259 -3
- package/dist/index.mjs.map +1 -0
- package/dist/{platform-TwATAkL3.d.mts → platform-eVgCMbX0.d.mts} +121 -5
- package/dist/platform-eVgCMbX0.d.mts.map +1 -0
- package/dist/{src-BGdIBGkN.mjs → src-BD3jkjgG.mjs} +182 -16
- package/dist/src-BD3jkjgG.mjs.map +1 -0
- package/dist/{src-Brt0dfNL.mjs → src-C19_yfMM.mjs} +1029 -78
- package/dist/src-C19_yfMM.mjs.map +1 -0
- package/dist/src-CgfGiH25.mjs +1546 -0
- package/dist/src-CgfGiH25.mjs.map +1 -0
- package/dist/verdict-evEM5Gxx.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/cli-Dr-Ziogu.mjs +0 -2
- package/dist/explore-YVHTRjjS.d.mts.map +0 -1
- package/dist/platform-TwATAkL3.d.mts.map +0 -1
- package/dist/src-BBXd0WEp.mjs +0 -117
- package/dist/src-BBXd0WEp.mjs.map +0 -1
- package/dist/src-BGdIBGkN.mjs.map +0 -1
- package/dist/src-Brt0dfNL.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-CgfGiH25.mjs","names":["endsOperand","isPunct"],"sources":["../../spec/src/ir.ts","../../spec/src/tokens.ts","../../spec/src/parse.ts","../../spec/src/extract.ts","../../spec/src/predicate.ts","../../report/src/regression.ts","../../report/src/render.ts"],"sourcesContent":["/**\n * SpecIR: function specs as plain data. The surface syntax is Lemma\n * (https://github.com/jessealama/lemma-lang, grammar.ebnf and\n * semantics.md); the IR is Eutaxy's own, so engines and the simulator read\n * one shape whatever the annotation looked like. Leaves are opaque\n * TypeScript expressions, kept as written.\n */\n\n/** Lemma's binder domains. */\nexport type Domain = \"int\" | \"nat\" | \"number\" | \"boolean\" | \"string\" | \"bigint\";\n\nexport const domains: readonly Domain[] = [\"int\", \"nat\", \"number\", \"boolean\", \"string\", \"bigint\"];\n\n/**\n * One end of an interval: a numeric literal as written (sign included), or\n * `∞` / `-∞` for either infinity. `[` and `]` include the endpoint.\n */\nexport interface Endpoint {\n readonly value: string;\n readonly inclusive: boolean;\n}\n\n/** A binder's constraint: an interval for numeric domains, a whole-string regex for `string`. */\nexport type Guard =\n | { readonly kind: \"interval\"; readonly lower: Endpoint; readonly upper: Endpoint }\n | { readonly kind: \"regex\"; readonly pattern: string; readonly flags: string };\n\nexport interface Binder {\n readonly name: string;\n readonly domain: Domain;\n readonly guard?: Guard;\n}\n\n/**\n * A formula over boolean atoms. Atoms and equation sides are TypeScript\n * expressions, verbatim. `and` and `or` are n-ary (both are associative);\n * `implies` keeps Lemma's chain: every segment but the last is an\n * antecedent. An implication at a property's root is not a formula node but\n * the property's preconditions (`Property.requires`).\n */\nexport type Formula =\n | { readonly kind: \"atom\"; readonly text: string }\n | {\n readonly kind: \"equation\";\n readonly left: string;\n readonly right: string;\n /** `≢` rather than `≡`. */\n readonly negated: boolean;\n }\n | { readonly kind: \"not\"; readonly operand: Formula }\n | { readonly kind: \"and\" | \"or\"; readonly operands: readonly Formula[] }\n | {\n readonly kind: \"implies\";\n readonly antecedents: readonly Formula[];\n readonly consequent: Formula;\n }\n | { readonly kind: \"iff\"; readonly left: Formula; readonly right: Formula };\n\n/**\n * A universally quantified claim: for every assignment of the binders from\n * their (guarded) domains where every precondition holds, `claim` holds.\n * Assignments failing a precondition are outside the claim.\n */\nexport interface Property {\n readonly binders: readonly Binder[];\n readonly requires: readonly Formula[];\n readonly claim: Formula;\n}\n\n/** An `@ensures{name}` annotation. */\nexport interface NamedProperty {\n readonly name: string;\n readonly property: Property;\n /** The annotation's property text, as written. */\n readonly text: string;\n}\n\n/** The specs on one exported function. */\nexport interface FunctionSpec {\n readonly name: string;\n /** Parameter names in order; null for a destructured or rest parameter. */\n readonly params: readonly (string | null)[];\n readonly ensures: readonly NamedProperty[];\n /** `@total`: the function terminates on every input. */\n readonly total: boolean;\n /** `@throws`: the function throws (Lemma has not fixed its semantics yet). */\n readonly throws: boolean;\n /** 1-based line of the declaration. */\n readonly line: number;\n}\n\n/** A problem with an annotation, located in the module. */\nexport interface SpecError {\n readonly line: number;\n readonly message: string;\n}\n\n/** Every spec in one module, the names it exports, and the annotations that did not parse. */\nexport interface ModuleSpecs {\n readonly functions: readonly FunctionSpec[];\n readonly exports: readonly string[];\n readonly errors: readonly SpecError[];\n}\n","/**\n * A tokenizer shaped like TypeScript's scanner, which is how Lemma\n * tokenizes an annotation: glyphs inside string, template and regex\n * literals are text, never operators, and a template substitution nests.\n * It knows Lemma's operators besides JavaScript's punctuators; which ones\n * count where is the parser's business.\n */\n\nexport type TokenKind =\n | \"ident\"\n | \"number\"\n | \"string\"\n | \"template\"\n | \"regex\"\n | \"punct\"\n | \"op\"\n | \"comment\";\n\n/** Lemma operators, by canonical name. */\nexport type LemmaOp =\n | \"and\"\n | \"or\"\n | \"not\"\n | \"implies\"\n | \"iff\"\n | \"equiv\"\n | \"nequiv\"\n | \"neq\"\n | \"forall\"\n | \"exists\"\n | \"member\"\n | \"infinity\";\n\nexport interface Token {\n readonly kind: TokenKind;\n readonly text: string;\n /** Offsets into the scanned text: [start, end). */\n readonly start: number;\n readonly end: number;\n /** For kind \"op\". */\n readonly op?: LemmaOp;\n}\n\nconst glyphs: { readonly [glyph: string]: LemmaOp } = {\n \"∧\": \"and\",\n \"∨\": \"or\",\n \"¬\": \"not\",\n \"→\": \"implies\",\n \"↔\": \"iff\",\n \"≡\": \"equiv\",\n \"≢\": \"nequiv\",\n \"≠\": \"neq\",\n \"∀\": \"forall\",\n \"∃\": \"exists\",\n \"∈\": \"member\",\n \"∞\": \"infinity\",\n};\n\n/** ASCII spellings of Lemma connectives, longest first. */\nconst asciiOps: readonly (readonly [string, LemmaOp])[] = [\n [\"<->\", \"iff\"],\n [\"==>\", \"implies\"],\n [\"->\", \"implies\"],\n [\"\\\\/\", \"or\"],\n];\n\nconst punctuators = [\n \">>>=\",\n \"...\",\n \"===\",\n \"!==\",\n \"**=\",\n \"<<=\",\n \">>=\",\n \">>>\",\n \"&&=\",\n \"||=\",\n \"??=\",\n \"=>\",\n \"==\",\n \"!=\",\n \"<=\",\n \">=\",\n \"&&\",\n \"||\",\n \"??\",\n \"?.\",\n \"++\",\n \"--\",\n \"+=\",\n \"-=\",\n \"*=\",\n \"/=\",\n \"%=\",\n \"&=\",\n \"|=\",\n \"^=\",\n \"**\",\n \"<<\",\n \">>\",\n];\n\n/** Keywords after which a `/` starts a regular expression rather than a division. */\nconst regexAfter = new Set([\n \"in\",\n \"of\",\n \"typeof\",\n \"instanceof\",\n \"return\",\n \"new\",\n \"delete\",\n \"void\",\n \"case\",\n \"do\",\n \"else\",\n \"yield\",\n \"await\",\n]);\n\nconst identStart = /[\\p{ID_Start}$_]/u;\nconst identPart = /[\\p{ID_Continue}$]/u;\nconst numberAt =\n /^(?:0[xXoObB][0-9a-fA-F_]+n?|(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d[\\d_]*)?n?)/;\n\nexport class TokenizeError extends Error {}\n\n/** Keywords whose parenthesized condition is followed by a statement, not an operator. */\nconst controlKeywords = new Set([\"if\", \"while\", \"for\", \"with\"]);\n\n/**\n * Whether the code tokens up to `k` end an operand, so a `/` after them\n * divides. `conditions` holds the `)` that close a control statement's\n * condition (`if (x) /re/.test(s)`), after which a statement starts.\n */\nfunction endsOperand(\n tokens: readonly Token[],\n k: number,\n conditions: ReadonlySet<number>,\n blocks: ReadonlySet<number>,\n): boolean {\n while (k >= 0 && tokens[k]?.kind === \"comment\") k--;\n const t = tokens[k];\n if (!t) return false;\n switch (t.kind) {\n case \"ident\": {\n // After `.`, a word is a member name, whatever its spelling (`obj.in`).\n const before = tokens.slice(0, k).findLast((u) => u.kind !== \"comment\");\n if (before?.kind === \"punct\" && (before.text === \".\" || before.text === \"?.\")) return true;\n return !regexAfter.has(t.text);\n }\n case \"punct\":\n // After an operand, `!` (TypeScript's non-null assertion), `++` and `--` are postfix and end one too.\n if (t.text === \"!\" || t.text === \"++\" || t.text === \"--\")\n return endsOperand(tokens, k - 1, conditions, blocks);\n if (t.text === \")\") return !conditions.has(k);\n // A `}` closing a statement block ends no expression; one closing an object literal does.\n if (t.text === \"}\") return !blocks.has(k);\n return t.text === \"]\";\n case \"op\":\n return false;\n default:\n return true;\n }\n}\n\n/** The end of a quoted string starting at `i`. */\nfunction endOfString(text: string, i: number): number {\n const quote = text[i];\n for (let j = i + 1; j < text.length; j++) {\n const c = text[j];\n if (c === \"\\\\\") j++;\n else if (c === quote) return j + 1;\n else if (c === \"\\n\") break;\n }\n throw new TokenizeError(`unterminated string at offset ${i}`);\n}\n\n/** The end of the template literal starting at `i`, substitutions included. */\nfunction endOfTemplate(text: string, i: number): number {\n for (let j = i + 1; j < text.length; j++) {\n const c = text[j];\n if (c === \"\\\\\") j++;\n else if (c === \"`\") return j + 1;\n else if (c === \"$\" && text[j + 1] === \"{\") j = endOfSubstitution(text, j + 2) - 1;\n }\n throw new TokenizeError(`unterminated template literal at offset ${i}`);\n}\n\n/** The offset just past the `}` that closes a substitution whose body starts at `i`, scanned as code. */\nfunction endOfSubstitution(text: string, i: number): number {\n return scan(text, i, { untilBrace: true }).end;\n}\n\n/** The source of each `${…}` substitution in a template literal's text, outermost only. */\nexport function templateSubstitutions(template: string): string[] {\n const out: string[] = [];\n for (let j = 1; j < template.length; j++) {\n const c = template[j];\n if (c === \"\\\\\") j++;\n else if (c === \"$\" && template[j + 1] === \"{\") {\n const end = endOfSubstitution(template, j + 2);\n out.push(template.slice(j + 2, end - 1));\n j = end - 1;\n }\n }\n return out;\n}\n\n/** The end of the regex literal starting at `i`, flags included. */\nfunction endOfRegex(text: string, i: number): number {\n let inClass = false;\n for (let j = i + 1; j < text.length; j++) {\n const c = text[j];\n if (c === \"\\\\\") j++;\n else if (c === \"\\n\") break;\n else if (inClass) {\n if (c === \"]\") inClass = false;\n } else if (c === \"[\") inClass = true;\n else if (c === \"/\") {\n let k = j + 1;\n while (k < text.length && identPart.test(text[k] as string)) k++;\n return k;\n }\n }\n throw new TokenizeError(`unterminated regular expression at offset ${i}`);\n}\n\n/** Tokens of `text`; comments are dropped unless `comments` is set (then they are \"comment\" tokens). */\nexport function tokenize(text: string, options: { readonly comments?: boolean } = {}): Token[] {\n return scan(text, 0, options).tokens;\n}\n\n/**\n * Scan from `start`. With `untilBrace`, stop after the `}` that closes an\n * enclosing substitution (one not opened in the scanned code) and return\n * the offset after it.\n */\nfunction scan(\n text: string,\n start: number,\n options: { readonly comments?: boolean; readonly untilBrace?: boolean },\n): { tokens: Token[]; end: number } {\n const tokens: Token[] = [];\n const push = (kind: TokenKind, start: number, end: number, op?: LemmaOp): void => {\n tokens.push({ kind, text: text.slice(start, end), start, end, ...(op ? { op } : {}) });\n };\n // Comments are always tracked here, so regex detection can skip them; they are dropped at the end if unwanted.\n let braces = 0;\n // Open parentheses (true for a control statement's condition), and the `)` that closed a condition.\n const parens: boolean[] = [];\n const conditions = new Set<number>();\n // Open braces (true for a statement block), and the `}` that closed a block.\n const curlies: boolean[] = [];\n const blocks = new Set<number>();\n let i = start;\n while (i < text.length) {\n const c = text[i] as string;\n if (/\\s/u.test(c)) {\n i++;\n continue;\n }\n if (c === \"/\" && text[i + 1] === \"/\") {\n const from = i;\n while (i < text.length && text[i] !== \"\\n\") i++;\n push(\"comment\", from, i);\n continue;\n }\n if (c === \"/\" && text[i + 1] === \"*\") {\n const close = text.indexOf(\"*/\", i + 2);\n if (close < 0) throw new TokenizeError(`unterminated comment at offset ${i}`);\n push(\"comment\", i, close + 2);\n i = close + 2;\n continue;\n }\n const glyph = glyphs[c];\n if (glyph) {\n push(\"op\", i, i + 1, glyph);\n i++;\n continue;\n }\n const ascii = asciiOps.find(([s]) => text.startsWith(s, i));\n if (ascii) {\n push(\"op\", i, i + ascii[0].length, ascii[1]);\n i += ascii[0].length;\n continue;\n }\n if (c === \"/\") {\n if (!endsOperand(tokens, tokens.length - 1, conditions, blocks)) {\n const end = endOfRegex(text, i);\n push(\"regex\", i, end);\n i = end;\n continue;\n }\n if (text[i + 1] === \"\\\\\") {\n push(\"op\", i, i + 2, \"and\");\n i += 2;\n continue;\n }\n }\n if (c === '\"' || c === \"'\") {\n const end = endOfString(text, i);\n push(\"string\", i, end);\n i = end;\n continue;\n }\n if (c === \"`\") {\n const end = endOfTemplate(text, i);\n push(\"template\", i, end);\n i = end;\n continue;\n }\n const num = numberAt.exec(text.slice(i));\n if (num && (/\\d/.test(c) || (c === \".\" && /\\d/.test(text[i + 1] ?? \"\")))) {\n push(\"number\", i, i + num[0].length);\n i += num[0].length;\n continue;\n }\n if (identStart.test(c)) {\n let j = i + 1;\n while (j < text.length && identPart.test(text[j] as string)) j++;\n // Words (`forall`, `in`, `iff`, ...) stay identifiers: whether they are Lemma's depends on where.\n push(\"ident\", i, j);\n i = j;\n continue;\n }\n const p = punctuators.find((s) => text.startsWith(s, i)) ?? c;\n if (p === \"(\") {\n const before = tokens.findLast((t) => t.kind !== \"comment\");\n parens.push(before?.kind === \"ident\" && controlKeywords.has(before.text));\n } else if (p === \")\" && parens.pop()) conditions.add(tokens.length);\n if (p === \"{\") {\n const before = tokens.findLast((t) => t.kind !== \"comment\");\n curlies.push(\n before === undefined ||\n (before.kind === \"punct\" && [\")\", \"{\", \"}\", \";\", \"=>\"].includes(before.text)) ||\n (before.kind === \"ident\" && [\"else\", \"do\", \"try\", \"finally\"].includes(before.text)),\n );\n } else if (p === \"}\" && curlies.pop()) blocks.add(tokens.length);\n if (p === \"{\") braces++;\n if (p === \"}\" && braces-- === 0 && options.untilBrace) {\n return { tokens: keep(tokens, options), end: i + 1 };\n }\n push(\"punct\", i, i + p.length);\n i += p.length;\n }\n if (options.untilBrace)\n throw new TokenizeError(`unterminated template substitution at offset ${start}`);\n return { tokens: keep(tokens, options), end: i };\n}\n\nfunction keep(tokens: Token[], options: { readonly comments?: boolean }): Token[] {\n return options.comments ? tokens : tokens.filter((t) => t.kind !== \"comment\");\n}\n","/**\n * The Lemma `@ensures` property parser: grammar.ebnf of lemma-lang, with\n * the side conditions it states on atoms. A property is a quantifier\n * prefix and a braced formula body; the body's structure (connectives,\n * equations, grouping) is Lemma, and its leaves are TypeScript expressions\n * kept verbatim. Validation that needs the enclosing module (free\n * identifiers exported) is left to whoever evaluates the leaves.\n */\n\nimport {\n type Binder,\n type Domain,\n domains,\n type Endpoint,\n type Formula,\n type Guard,\n type Property,\n} from \"./ir.ts\";\nimport {\n type LemmaOp,\n type Token,\n TokenizeError,\n templateSubstitutions,\n tokenize,\n} from \"./tokens.ts\";\n\n/** A property that is not Lemma. `stage` says which part rejected it. */\nexport class LemmaSyntaxError extends Error {\n readonly stage: \"prefix\" | \"formula\";\n constructor(stage: \"prefix\" | \"formula\", message: string) {\n super(message);\n this.stage = stage;\n }\n}\n\nconst numeric = new Set<Domain>([\"int\", \"nat\", \"number\", \"bigint\"]);\n\nconst literalSyntax: { readonly [d in Domain]?: RegExp } = {\n int: /^[+-]?\\d[\\d_]*$/,\n nat: /^[+-]?\\d[\\d_]*$/,\n bigint: /^[+-]?\\d[\\d_]*n?$/,\n number: /^[+-]?(?:\\d[\\d_]*(?:\\.[\\d_]*)?|\\.\\d[\\d_]*)(?:[eE][+-]?\\d+)?$/,\n};\n\nconst assignments = new Set([\n \"=\",\n \"+=\",\n \"-=\",\n \"*=\",\n \"/=\",\n \"%=\",\n \"**=\",\n \"<<=\",\n \">>=\",\n \">>>=\",\n \"&=\",\n \"|=\",\n \"^=\",\n \"&&=\",\n \"||=\",\n \"??=\",\n]);\n\n/** Parse the text after `@ensures{name}`. Throws LemmaSyntaxError. */\nexport function parseProperty(text: string): Property {\n let tokens: Token[];\n try {\n tokens = tokenize(text);\n } catch (err) {\n if (err instanceof TokenizeError) throw new LemmaSyntaxError(\"formula\", err.message);\n throw err;\n }\n const prefix = new Prefix(tokens);\n const binders = prefix.parse();\n const body = new Body(text, tokens, prefix.at);\n return { binders, ...body.parse() };\n}\n\nconst isOp = (t: Token | undefined, op: LemmaOp): boolean => t?.kind === \"op\" && t.op === op;\nconst isPunct = (t: Token | undefined, p: string): boolean => t?.kind === \"punct\" && t.text === p;\n\nclass Prefix {\n readonly tokens: readonly Token[];\n at = 0;\n constructor(tokens: readonly Token[]) {\n this.tokens = tokens;\n }\n\n private fail(message: string): never {\n throw new LemmaSyntaxError(\"prefix\", message);\n }\n\n private peek(): Token | undefined {\n return this.tokens[this.at];\n }\n\n private next(what: string): Token {\n const t = this.tokens[this.at++];\n if (!t) this.fail(`expected ${what}, found the end of the annotation`);\n return t;\n }\n\n parse(): Binder[] {\n const first = this.next(\"forall\");\n if (isOp(first, \"exists\") || (first.kind === \"ident\" && first.text === \"exists\")) {\n this.fail(\n \"existential quantifiers are not Lemma: sampling cannot confirm that something exists, so state the property with forall\",\n );\n }\n if (!(isOp(first, \"forall\") || (first.kind === \"ident\" && first.text === \"forall\")))\n this.fail(`a property starts with forall, not ${JSON.stringify(first.text)}`);\n const binders: Binder[] = [];\n while (isPunct(this.peek(), \"(\")) binders.push(...this.group());\n if (binders.length === 0) this.fail(\"forall needs at least one binder group, as in (x: int)\");\n const seen = new Set<string>();\n for (const b of binders) {\n if (seen.has(b.name)) this.fail(`${b.name} is bound twice`);\n seen.add(b.name);\n }\n if (!isPunct(this.peek(), \"{\"))\n this.fail(\"expected { to open the property body after the binders\");\n return binders;\n }\n\n private group(): Binder[] {\n this.next(\"(\");\n const names: string[] = [];\n while (this.peek()?.kind === \"ident\") names.push(this.next(\"a name\").text);\n const colon = this.next(\":\");\n if (!isPunct(colon, \":\")) {\n this.fail(\n names.length === 0\n ? \"a binder group needs at least one name before the colon, as in (x: int)\"\n : `expected : before the domain, found ${JSON.stringify(colon.text)}`,\n );\n }\n if (names.length === 0)\n this.fail(\"a binder group needs at least one name before the colon, as in (x: int)\");\n for (const n of names)\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(n))\n this.fail(`${JSON.stringify(n)} is not a binder name`);\n const d = this.next(\"a domain\");\n if (d.kind !== \"ident\" || !(domains as readonly string[]).includes(d.text))\n this.fail(`${JSON.stringify(d.text)} is not a Lemma domain (one of ${domains.join(\", \")})`);\n const domain = d.text as Domain;\n let guard: Guard | undefined;\n const member = this.peek();\n if (isOp(member, \"member\") || (member?.kind === \"ident\" && member.text === \"in\")) {\n this.at++;\n guard = this.guard(domain);\n }\n const close = this.next(\")\");\n if (!isPunct(close, \")\"))\n this.fail(`expected ) to close the binder group, found ${JSON.stringify(close.text)}`);\n return names.map((name) => ({ name, domain, ...(guard ? { guard } : {}) }));\n }\n\n private guard(domain: Domain): Guard {\n const t = this.peek();\n if (t?.kind === \"regex\") {\n this.at++;\n if (domain !== \"string\") this.fail(`a regex guard applies to string, not ${domain}`);\n const slash = t.text.lastIndexOf(\"/\");\n const pattern = t.text.slice(1, slash);\n const flags = t.text.slice(slash + 1);\n if (!/^[su]*$/.test(flags) || new Set(flags).size !== flags.length)\n this.fail(`a regex guard takes only the s and u flags, not ${JSON.stringify(flags)}`);\n try {\n new RegExp(`^(?:${pattern})$`, flags);\n } catch (err) {\n this.fail(`the regex guard does not compile: ${String(err)}`);\n }\n return { kind: \"regex\", pattern, flags };\n }\n if (!numeric.has(domain))\n this.fail(`an interval guard applies to numeric domains only, not ${domain}`);\n const open = this.next(\"[ or (\");\n if (!(isPunct(open, \"[\") || isPunct(open, \"(\")))\n this.fail(`expected an interval or a regex after ∈, found ${JSON.stringify(open.text)}`);\n const lower = this.endpoint(domain, isPunct(open, \"[\"));\n const comma = this.next(\",\");\n if (!isPunct(comma, \",\"))\n this.fail(`expected , between the interval's endpoints, found ${JSON.stringify(comma.text)}`);\n const upperValue = this.endpointValue(domain);\n const close = this.next(\"] or )\");\n if (isPunct(close, \",\")) this.fail(\"an interval has exactly two endpoints\");\n if (!(isPunct(close, \"]\") || isPunct(close, \")\")))\n this.fail(`expected ] or ) to close the interval, found ${JSON.stringify(close.text)}`);\n const upper: Endpoint = { value: upperValue, inclusive: isPunct(close, \"]\") };\n this.checkInterval(domain, lower, upper);\n return { kind: \"interval\", lower, upper };\n }\n\n private endpoint(domain: Domain, inclusive: boolean): Endpoint {\n return { value: this.endpointValue(domain), inclusive };\n }\n\n private endpointValue(domain: Domain): string {\n let sign = \"\";\n const s = this.peek();\n if (isPunct(s, \"-\") || isPunct(s, \"+\")) {\n this.at++;\n sign = s?.text === \"-\" ? \"-\" : \"\";\n }\n const t = this.next(\"an endpoint\");\n if (isOp(t, \"infinity\") || (t.kind === \"ident\" && t.text === \"Infinity\")) return `${sign}∞`;\n if (t.kind !== \"number\") this.fail(`${JSON.stringify(t.text)} is not an interval endpoint`);\n const value = `${sign}${t.text}`;\n const syntax = literalSyntax[domain];\n if (syntax && !syntax.test(value)) this.fail(`${value} is not a ${domain} literal`);\n return value;\n }\n\n private checkInterval(domain: Domain, lower: Endpoint, upper: Endpoint): void {\n const integral = domain !== \"number\";\n for (const e of [lower, upper])\n if (e.value.endsWith(\"∞\") && e.inclusive && integral)\n this.fail(`an ∞ endpoint must be exclusive for ${domain}`);\n if (lower.value === \"∞\") this.fail(\"the lower endpoint cannot be +∞\");\n if (upper.value === \"-∞\") this.fail(\"the upper endpoint cannot be -∞\");\n // Integer literals compare exactly (a double would merge neighbours beyond 2^53).\n const exact = (v: string): number | bigint =>\n integral && !v.endsWith(\"∞\")\n ? BigInt(v.replace(/_/g, \"\").replace(/n$/, \"\"))\n : endpointNumber(v);\n const lo = exact(lower.value);\n const hi = exact(upper.value);\n if (lo > hi || (lo === hi && !(lower.inclusive && upper.inclusive)))\n this.fail(`the interval from ${lower.value} to ${upper.value} is empty`);\n }\n}\n\n/** An endpoint's value for ordering: exact for integer literals, as a double otherwise. */\nexport function endpointNumber(value: string): number {\n if (value === \"∞\") return Number.POSITIVE_INFINITY;\n if (value === \"-∞\") return Number.NEGATIVE_INFINITY;\n return Number(value.replace(/_/g, \"\").replace(/n$/, \"\"));\n}\n\nconst connectives = new Set<LemmaOp>([\"and\", \"or\", \"not\", \"implies\", \"iff\"]);\n\nclass Body {\n private readonly text: string;\n private readonly tokens: readonly Token[];\n private readonly open: number;\n /** Per token of the body: how many brackets enclose it inside the body braces. */\n private readonly depth = new Map<number, number>();\n /** Bracket matches, both ways. */\n private readonly match = new Map<number, number>();\n /** Per token: the innermost enclosing opening bracket, or -1. */\n private readonly enclosing = new Map<number, number>();\n\n constructor(text: string, tokens: readonly Token[], open: number) {\n this.text = text;\n this.tokens = tokens;\n this.open = open;\n }\n\n private fail(message: string): never {\n throw new LemmaSyntaxError(\"formula\", message);\n }\n\n parse(): { requires: Formula[]; claim: Formula } {\n const pairs: { [close: string]: string } = { \")\": \"(\", \"]\": \"[\", \"}\": \"{\" };\n const stack: number[] = [];\n let close = -1;\n for (let i = this.open; i < this.tokens.length; i++) {\n const t = this.tokens[i] as Token;\n this.depth.set(i, stack.length - 1);\n this.enclosing.set(i, stack[stack.length - 1] ?? -1);\n if (t.kind !== \"punct\") continue;\n if (t.text === \"(\" || t.text === \"[\" || t.text === \"{\") stack.push(i);\n else if (pairs[t.text]) {\n const o = stack.pop();\n if (o === undefined || this.tokens[o]?.text !== pairs[t.text])\n this.fail(`unbalanced ${t.text} in the property body`);\n this.match.set(o, i);\n this.match.set(i, o);\n if (stack.length === 0) {\n close = i;\n break;\n }\n }\n }\n if (close < 0) this.fail(\"the property body is not closed with }\");\n if (close !== this.tokens.length - 1)\n this.fail(\"the } closing the property body must be the annotation's last token\");\n const s = this.open + 1;\n const e = close;\n if (s >= e) this.fail(\"the property body is empty\");\n const grouped = isPunct(this.tokens[s], \"(\") && this.match.get(s) === e - 1;\n const f = this.formula(s, e, 0);\n if (!grouped && f.kind === \"implies\")\n return { requires: [...f.antecedents], claim: f.consequent };\n return { requires: [], claim: f };\n }\n\n private at(i: number, base: number): boolean {\n return this.depth.get(i) === base;\n }\n\n /** Base-level positions of tokens satisfying `pred` in [s, e). */\n private split(\n s: number,\n e: number,\n base: number,\n pred: (t: Token, i: number) => boolean,\n ): number[] {\n const out: number[] = [];\n for (let i = s; i < e; i++)\n if (this.at(i, base) && pred(this.tokens[i] as Token, i)) out.push(i);\n return out;\n }\n\n private segments(s: number, e: number, cuts: readonly number[]): [number, number][] {\n const out: [number, number][] = [];\n let from = s;\n for (const c of cuts) {\n out.push([from, c]);\n from = c + 1;\n }\n out.push([from, e]);\n return out;\n }\n\n private formula(s: number, e: number, base: number): Formula {\n if (s >= e) this.fail(\"a connective is missing an operand\");\n // The word iff is the connective, except as a member name (`api.iff`).\n const iff = this.split(s, e, base, (t, i) => {\n if (t.op === \"iff\") return true;\n const prev = this.tokens[i - 1];\n return t.kind === \"ident\" && t.text === \"iff\" && !isPunct(prev, \".\") && !isPunct(prev, \"?.\");\n });\n if (iff.length > 1) this.fail(\"↔ is non-associative: parenthesize a ↔ b ↔ c\");\n if (iff.length === 1) {\n const k = iff[0] as number;\n return { kind: \"iff\", left: this.formula(s, k, base), right: this.formula(k + 1, e, base) };\n }\n const implies = this.split(s, e, base, (t) => t.op === \"implies\");\n if (implies.length > 0) {\n const parts = this.segments(s, e, implies).map(([a, b]) => this.formula(a, b, base));\n return {\n kind: \"implies\",\n antecedents: parts.slice(0, -1),\n consequent: parts[parts.length - 1] as Formula,\n };\n }\n for (const kind of [\"or\", \"and\"] as const) {\n const cuts = this.split(s, e, base, (t) => t.op === kind);\n if (cuts.length > 0)\n return {\n kind,\n operands: this.segments(s, e, cuts).map(([a, b]) => this.formula(a, b, base)),\n };\n }\n if (isOp(this.tokens[s], \"not\")) return { kind: \"not\", operand: this.formula(s + 1, e, base) };\n if (isPunct(this.tokens[s], \"(\") && this.match.get(s) === e - 1)\n return this.formula(s + 1, e - 1, base + 1);\n return this.atom(s, e, base);\n }\n\n private slice(s: number, e: number): string {\n return this.text\n .slice((this.tokens[s] as Token).start, (this.tokens[e - 1] as Token).end)\n .trim();\n }\n\n private atom(s: number, e: number, base: number): Formula {\n const equations: number[] = [];\n for (let i = s; i < e; i++) {\n const t = this.tokens[i] as Token;\n const prev = i > s ? this.tokens[i - 1] : undefined;\n if (t.kind === \"op\") {\n if (t.op === \"equiv\" || t.op === \"nequiv\") {\n if (!this.at(i, base))\n this.fail(\n `${t.text} only joins an atom's two sides; in nested positions call Object.is`,\n );\n equations.push(i);\n } else if (t.op === \"neq\") this.fail(\"≠ is not Lemma: write ≢ (not the same value) or !==\");\n else if (t.op === \"forall\" || t.op === \"exists\")\n this.fail(\"quantifiers nest only in the prefix\");\n else if (connectives.has(t.op as LemmaOp))\n this.fail(\n `${t.text} inside a JavaScript expression: use && || ! there, or parenthesize the whole formula`,\n );\n else this.fail(`${t.text} belongs in a binder group, not the property body`);\n }\n if (\n t.kind === \"ident\" &&\n (t.text === \"forall\" || t.text === \"exists\") &&\n !isPunct(prev, \".\") &&\n !isPunct(prev, \"?.\")\n )\n this.fail(\"quantifiers nest only in the prefix\");\n // A template's substitutions are nested expressions under the same rules.\n if (t.kind === \"template\") for (const sub of templateSubstitutions(t.text)) this.nested(sub);\n if (t.kind !== \"punct\") continue;\n if (t.text === \"==\" || t.text === \"!=\")\n this.fail(`loose ${t.text} is not allowed: use ≡ / ≢ or === / !==`);\n if (assignments.has(t.text) && !this.inParameterList(i))\n this.fail(`assignments are not allowed in a property (${t.text})`);\n if (!this.at(i, base)) continue;\n if (t.text === \"&&\" || t.text === \"||\")\n this.fail(`${t.text} at an atom's top level: use ${t.text === \"&&\" ? \"∧\" : \"∨\"}`);\n if (t.text === \"!\" && !endsOperand(prev)) this.fail(\"prefix ! at an atom's top level: use ¬\");\n }\n if (equations.length > 1) this.fail(\"≡ is non-associative: write a ≡ b ∧ b ≡ c\");\n if (equations.length === 0) return { kind: \"atom\", text: this.slice(s, e) };\n const k = equations[0] as number;\n for (let i = s; i < e; i++) {\n const t = this.tokens[i] as Token;\n if (\n this.at(i, base) &&\n t.kind === \"punct\" &&\n [\"??\", \"?\", \"===\", \"!==\", \",\", \"=>\"].includes(t.text)\n )\n this.fail(`${t.text} beside an equation is ambiguous: parenthesize the side it belongs to`);\n }\n if (k === s || k === e - 1)\n this.fail(`${this.tokens[k]?.text} needs an expression on both sides`);\n return {\n kind: \"equation\",\n left: this.slice(s, k),\n right: this.slice(k + 1, e),\n negated: this.tokens[k]?.op === \"nequiv\",\n };\n }\n\n /** Check an expression nested in an atom (a template substitution): what no position allows. */\n private nested(text: string): void {\n let tokens: Token[];\n try {\n tokens = tokenize(text);\n } catch (err) {\n if (err instanceof TokenizeError) this.fail(err.message);\n throw err;\n }\n const stack: number[] = [];\n const enclosing: number[] = [];\n const match = new Map<number, number>();\n tokens.forEach((t, i) => {\n enclosing.push(stack[stack.length - 1] ?? -1);\n if (t.kind !== \"punct\") return;\n if (t.text === \"(\" || t.text === \"[\" || t.text === \"{\") stack.push(i);\n else if (t.text === \")\" || t.text === \"]\" || t.text === \"}\") {\n const o = stack.pop();\n if (o !== undefined) match.set(o, i);\n }\n });\n tokens.forEach((t, i) => {\n const prev = tokens[i - 1];\n if (t.kind === \"op\") {\n if (t.op === \"equiv\" || t.op === \"nequiv\")\n this.fail(`${t.text} only joins an atom's two sides; in nested positions call Object.is`);\n if (t.op === \"neq\") this.fail(\"≠ is not Lemma: write ≢ (not the same value) or !==\");\n if (t.op === \"forall\" || t.op === \"exists\")\n this.fail(\"quantifiers nest only in the prefix\");\n this.fail(\n `${t.text} inside a JavaScript expression: use && || ! there, or parenthesize the whole formula`,\n );\n }\n if (\n t.kind === \"ident\" &&\n (t.text === \"forall\" || t.text === \"exists\") &&\n !isPunct(prev, \".\") &&\n !isPunct(prev, \"?.\")\n )\n this.fail(\"quantifiers nest only in the prefix\");\n if (t.kind === \"template\") for (const sub of templateSubstitutions(t.text)) this.nested(sub);\n if (t.kind !== \"punct\") return;\n if (t.text === \"==\" || t.text === \"!=\")\n this.fail(`loose ${t.text} is not allowed: use ≡ / ≢ or === / !==`);\n if (assignments.has(t.text)) {\n const open = enclosing[i] ?? -1;\n const close = open >= 0 ? match.get(open) : undefined;\n const defaultValue =\n t.text === \"=\" &&\n isPunct(tokens[open], \"(\") &&\n close !== undefined &&\n isPunct(tokens[close + 1], \"=>\");\n if (!defaultValue) this.fail(`assignments are not allowed in a property (${t.text})`);\n }\n });\n }\n\n /** A default initializer: `=` directly inside the parentheses of an arrow function's parameters. */\n private inParameterList(i: number): boolean {\n if (this.tokens[i]?.text !== \"=\") return false;\n const open = this.enclosing.get(i) ?? -1;\n if (open < 0 || !isPunct(this.tokens[open], \"(\")) return false;\n const close = this.match.get(open);\n return close !== undefined && isPunct(this.tokens[close + 1], \"=>\");\n }\n}\n\n/** Whether a token ends an operand, so a `!` after it is postfix (non-null assertion). */\nfunction endsOperand(t: Token | undefined): boolean {\n if (!t) return false;\n if (t.kind === \"punct\") return t.text === \")\" || t.text === \"]\" || t.text === \"}\";\n return t.kind !== \"op\";\n}\n","/**\n * Find the Lemma annotations in a TypeScript module: JSDoc blocks with\n * `@ensures{name}`, `@total` or `@throws` on exported function\n * declarations, where Lemma says they attach. A tag counts at the start of\n * a JSDoc line; an `@ensures` property runs to the next tag or the end of\n * the comment. Also lists the module's exported value names, which are the\n * free identifiers a property may use.\n */\n\nimport type { FunctionSpec, ModuleSpecs, NamedProperty, SpecError } from \"./ir.ts\";\nimport { LemmaSyntaxError, parseProperty } from \"./parse.ts\";\nimport { type Token, TokenizeError, tokenize } from \"./tokens.ts\";\n\nconst tagLine = /^@(\\w+)(?:\\{([^}]*)\\})?/;\n\ninterface Tag {\n readonly name: string;\n readonly label: string | undefined;\n readonly text: string;\n readonly line: number;\n}\n\n/** The JSDoc's tags, each with its text up to the next tag. */\nfunction tags(comment: Token, lineOf: (offset: number) => number): Tag[] {\n const body = comment.text.slice(3, -2);\n const first = lineOf(comment.start);\n const out: { name: string; label: string | undefined; lines: string[]; line: number }[] = [];\n body.split(\"\\n\").forEach((raw, i) => {\n const line = raw.replace(/^\\s*\\*?\\s?/, \"\");\n const m = tagLine.exec(line.trimStart());\n if (m) {\n out.push({\n name: m[1] as string,\n label: m[2],\n lines: [line.trimStart().slice(m[0].length)],\n line: first + i,\n });\n } else out[out.length - 1]?.lines.push(line);\n });\n return out.map((t) => ({\n name: t.name,\n label: t.label,\n text: t.lines.join(\"\\n\").trim(),\n line: t.line,\n }));\n}\n\nconst isWord = (t: Token | undefined, w: string): boolean => t?.kind === \"ident\" && t.text === w;\nconst isPunct = (t: Token | undefined, p: string): boolean => t?.kind === \"punct\" && t.text === p;\n\n/** `export [async] function [*] name(` at `i`: the name and the index of `(`. */\nfunction functionAt(tokens: readonly Token[], i: number): { name: string; open: number } | null {\n if (!isWord(tokens[i], \"export\")) return null;\n let j = i + 1;\n if (isWord(tokens[j], \"async\")) j++;\n if (!isWord(tokens[j], \"function\")) return null;\n j++;\n if (isPunct(tokens[j], \"*\")) j++;\n const name = tokens[j];\n if (name?.kind !== \"ident\") return null;\n j++;\n if (isPunct(tokens[j], \"<\")) j = skipAngles(tokens, j);\n return isPunct(tokens[j], \"(\") ? { name: name.text, open: j } : null;\n}\n\n/** The index after the `>` closing the type parameters opened at `i`. */\nfunction skipAngles(tokens: readonly Token[], i: number): number {\n let depth = 0;\n for (let j = i; j < tokens.length; j++) {\n const t = tokens[j] as Token;\n if (t.kind !== \"punct\") continue;\n if (t.text === \"<\") depth++;\n else if (t.text === \">\" || t.text === \">>\" || t.text === \">>>\") {\n depth -= t.text.length;\n if (depth <= 0) return j + 1;\n }\n }\n return tokens.length;\n}\n\n/**\n * Parameter names of the list opened at `open`; null for destructured and\n * rest parameters. `ambiguous` when a default value has a top-level `<` or\n * `>`: a comparison or a generic call's type arguments (`pair<A, B>()`),\n * which a token scan cannot tell apart, and guessing wrong would bind a\n * binder to another parameter's argument.\n */\nfunction params(\n tokens: readonly Token[],\n open: number,\n): { names: (string | null)[]; ambiguous: boolean } {\n const firsts: Token[] = [];\n let depth = 0;\n let start = true;\n // Angle brackets are type arguments only in a parameter's type annotation, not its default value.\n let inType = false;\n let inDefault = false;\n let ambiguous = false;\n for (let j = open + 1; j < tokens.length; j++) {\n const t = tokens[j] as Token;\n if (depth === 0 && isPunct(t, \")\")) break;\n if (start) firsts.push(t);\n start = false;\n if (t.kind !== \"punct\") continue;\n if (inDefault && depth === 0 && /^(<|>)/.test(t.text) && t.text !== \">=\" && t.text !== \"<=\")\n ambiguous = true;\n if ([\"(\", \"[\", \"{\"].includes(t.text) || (inType && t.text === \"<\")) depth++;\n else if ([\")\", \"]\", \"}\"].includes(t.text)) depth--;\n // Closing type arguments: `>`, or `>>` closing two.\n else if (inType && /^>+$/.test(t.text)) depth -= t.text.length;\n else if (depth === 0 && t.text === \":\") inType = true;\n else if (depth === 0 && t.text === \"=\") {\n inType = false;\n inDefault = true;\n } else if (t.text === \",\" && depth === 0) {\n start = true;\n inType = false;\n inDefault = false;\n }\n }\n // A `this` parameter is a type annotation only, not an argument.\n const names = firsts\n .filter((t) => !isWord(t, \"this\"))\n .map((t) => (t.kind === \"ident\" ? t.text : null));\n return { names, ambiguous };\n}\n\n/** Names the module exports as values (not types). */\nfunction exportedNames(tokens: readonly Token[]): string[] {\n const names = new Set<string>();\n for (let i = 0; i < tokens.length; i++) {\n if (!isWord(tokens[i], \"export\")) continue;\n let j = i + 1;\n if (isWord(tokens[j], \"declare\")) j++;\n if (isWord(tokens[j], \"default\")) continue;\n if (isWord(tokens[j], \"async\")) j++;\n if (isWord(tokens[j], \"abstract\")) j++;\n const kw = tokens[j];\n if ([\"function\", \"class\", \"enum\"].some((w) => isWord(kw, w))) {\n let k = j + 1;\n if (isPunct(tokens[k], \"*\")) k++;\n if (tokens[k]?.kind === \"ident\") names.add((tokens[k] as Token).text);\n } else if ([\"const\", \"let\", \"var\"].some((w) => isWord(kw, w))) {\n // Every name declared at this declaration's top level: `export const a = 1, b = 2`.\n let depth = 0;\n let expectName = true;\n for (let k = j + 1; k < tokens.length; k++) {\n const t = tokens[k] as Token;\n if (expectName && depth === 0 && t.kind === \"ident\") names.add(t.text);\n expectName = false;\n if (t.kind !== \"punct\") continue;\n if ([\"(\", \"[\", \"{\"].includes(t.text)) depth++;\n else if ([\")\", \"]\", \"}\"].includes(t.text)) depth--;\n else if (t.text === \",\" && depth === 0) expectName = true;\n else if (t.text === \";\" && depth === 0) break;\n if (depth < 0) break;\n }\n } else if (isPunct(kw, \"{\")) {\n const close = tokens.findIndex((t, k) => k > j && isPunct(t, \"}\"));\n if (close < 0 || isWord(tokens[close + 1], \"from\")) continue;\n for (let k = j + 1; k < close; k++) {\n const t = tokens[k] as Token;\n if (t.kind !== \"ident\" || isWord(tokens[k - 1], \"type\")) continue;\n if (isWord(tokens[k + 1], \"as\")) continue;\n if (isWord(t, \"as\") || isWord(t, \"type\")) continue;\n names.add(t.text);\n }\n }\n }\n return [...names];\n}\n\nexport function extractSpecs(source: string): ModuleSpecs {\n const starts = [0];\n for (let i = 0; i < source.length; i++) if (source[i] === \"\\n\") starts.push(i + 1);\n const lineOf = (offset: number): number => {\n let lo = 0;\n let hi = starts.length - 1;\n while (lo < hi) {\n const mid = (lo + hi + 1) >> 1;\n if ((starts[mid] as number) <= offset) lo = mid;\n else hi = mid - 1;\n }\n return lo + 1;\n };\n let all: Token[];\n try {\n all = tokenize(source, { comments: true });\n } catch (err) {\n if (err instanceof TokenizeError)\n return { functions: [], exports: [], errors: [{ line: 1, message: err.message }] };\n throw err;\n }\n const code = all.filter((t) => t.kind !== \"comment\");\n const indexOf = new Map(code.map((t, i) => [t, i]));\n const errors: SpecError[] = [];\n const functions: FunctionSpec[] = [];\n all.forEach((comment, i) => {\n if (comment.kind !== \"comment\" || !comment.text.startsWith(\"/**\")) return;\n const found = tags(comment, lineOf).filter((t) =>\n [\"ensures\", \"total\", \"throws\"].includes(t.name),\n );\n if (found.length === 0) return;\n const next = all.slice(i + 1).find((t) => t.kind !== \"comment\");\n const decl = next ? functionAt(code, indexOf.get(next) ?? -1) : null;\n if (!decl) {\n errors.push({\n line: found[0]?.line ?? lineOf(comment.start),\n message: \"Lemma annotations attach to an exported function declaration\",\n });\n return;\n }\n const ensures: NamedProperty[] = [];\n for (const t of found) {\n if (t.name !== \"ensures\") continue;\n const name = t.label?.trim();\n if (!name) {\n errors.push({\n line: t.line,\n message: \"@ensures needs a name, as in @ensures{non-negative}\",\n });\n continue;\n }\n if (ensures.some((e) => e.name === name)) {\n errors.push({ line: t.line, message: `${decl.name} has two properties named ${name}` });\n continue;\n }\n try {\n ensures.push({ name, property: parseProperty(t.text), text: t.text });\n } catch (err) {\n if (!(err instanceof LemmaSyntaxError)) throw err;\n errors.push({ line: t.line, message: `@ensures{${name}} on ${decl.name}: ${err.message}` });\n }\n }\n if (functions.some((f) => f.name === decl.name)) {\n // Overloads: each declaration's binders could differ, and a property is checked against one signature.\n errors.push({\n line: lineOf((code[decl.open] as Token).start),\n message: `${decl.name} is annotated on more than one declaration (overloads): put its annotations on one`,\n });\n return;\n }\n const signature = params(code, decl.open);\n if (signature.ambiguous)\n errors.push({\n line: lineOf((code[decl.open] as Token).start),\n message: `cannot tell the parameters of ${decl.name} apart: a default value has a top-level < or >; parenthesize it`,\n });\n functions.push({\n name: decl.name,\n params: signature.names,\n ensures,\n total: found.some((t) => t.name === \"total\"),\n throws: found.some((t) => t.name === \"throws\"),\n line: lineOf((code[decl.open] as Token).start),\n });\n });\n return { functions, exports: exportedNames(code), errors };\n}\n","/**\n * A property as TypeScript source: an arrow function from the binders to\n * \"held\", \"discarded\" (a precondition failed, so the assignment is outside\n * the claim) or \"refuted\". Atoms are the islands as written, each checked to\n * be a genuine boolean by a helper the surrounding module defines; `≡` is\n * `Object.is`. The source is code to compile, not to `eval`: runtimes such\n * as workerd refuse dynamic code.\n */\n\nimport type { Domain, Formula, Property } from \"./ir.ts\";\nimport { type Token, templateSubstitutions, tokenize } from \"./tokens.ts\";\n\n/** The outcome a predicate returns for one assignment. */\nexport type PredicateOutcome = \"held\" | \"discarded\" | \"refuted\";\n\nconst tsType: { readonly [d in Domain]: string } = {\n int: \"number\",\n nat: \"number\",\n number: \"number\",\n boolean: \"boolean\",\n string: \"string\",\n bigint: \"bigint\",\n};\n\n/** Names in the surrounding generated module that the predicate's source refers to. */\nexport interface PredicateHelpers {\n /** Returns its argument when it is a boolean, throws a TypeError otherwise. */\n readonly bool: string;\n /** `Object.is`. */\n readonly same: string;\n /** The annotated module's namespace: where a property's free identifiers come from. */\n readonly scope: string;\n /** Throws for the free names that neither the namespace nor the globals define. */\n readonly unresolved: string;\n}\n\n/** Words that cannot name a binding. */\nconst reserved = new Set(\n \"await break case catch class const continue debugger default delete do else enum export extends false finally for function if implements import in instanceof interface let new null package private protected public return static super switch this throw true try typeof var void while with yield arguments eval\".split(\n \" \",\n ),\n);\n\nfunction islands(f: Formula): string[] {\n switch (f.kind) {\n case \"atom\":\n return [f.text];\n case \"equation\":\n return [f.left, f.right];\n case \"not\":\n return islands(f.operand);\n case \"and\":\n case \"or\":\n return f.operands.flatMap(islands);\n case \"implies\":\n return [...f.antecedents, f.consequent].flatMap(islands);\n case \"iff\":\n return [...islands(f.left), ...islands(f.right)];\n }\n}\n\n/** Names an arrow function binds, over the tokens of its parameters and body. */\ninterface ArrowScope {\n readonly names: ReadonlySet<string>;\n readonly from: number;\n readonly to: number;\n}\n\n/**\n * Indices of the tokens that are TypeScript type positions or binding\n * names, not references, and the scopes arrow functions bind names in.\n */\nfunction notReferences(tokens: readonly Token[]): { skip: Set<number>; scopes: ArrowScope[] } {\n const skip = new Set<number>();\n const scopes: ArrowScope[] = [];\n const match = new Map<number, number>();\n const stack: number[] = [];\n /** Per token, the innermost open bracket around it, or -1. */\n const enclosing: number[] = [];\n tokens.forEach((t, i) => {\n enclosing.push(stack[stack.length - 1] ?? -1);\n if (t.kind !== \"punct\") return;\n if (t.text === \"(\" || t.text === \"[\" || t.text === \"{\") stack.push(i);\n else if (t.text === \")\" || t.text === \"]\" || t.text === \"}\") {\n const o = stack.pop();\n if (o !== undefined) match.set(o, i);\n }\n });\n const is = (k: number, text: string) => tokens[k]?.kind === \"punct\" && tokens[k]?.text === text;\n /** The last token of an arrow body starting at `k`: a block, or an expression up to a top-level `,` or close. */\n const bodyEnd = (k: number): number => {\n if (is(k, \"{\")) return match.get(k) ?? tokens.length - 1;\n let depth = 0;\n for (let m = k; m < tokens.length; m++) {\n const u = tokens[m] as Token;\n if (u.kind !== \"punct\") continue;\n if (u.text === \"(\" || u.text === \"[\" || u.text === \"{\") depth++;\n else if (u.text === \")\" || u.text === \"]\" || u.text === \"}\") {\n if (depth === 0) return m - 1;\n depth--;\n } else if (u.text === \",\" && depth === 0) return m - 1;\n }\n return tokens.length - 1;\n };\n /**\n * The index just after a type starting at `k`: names, dots, brackets,\n * unions and intersections, and type arguments, but a `<` only when its\n * `>` closes before anything that cannot be in a type (else it compares).\n */\n const typeEnd = (k: number): number => {\n const typeish = (u: Token | undefined, angles: number) =>\n u !== undefined &&\n (u.kind === \"ident\" ||\n u.kind === \"string\" ||\n u.kind === \"number\" ||\n (u.kind === \"punct\" && [\".\", \"[\", \"]\", \"|\", \"&\"].includes(u.text)) ||\n (angles > 0 &&\n u.kind === \"punct\" &&\n [\",\", \"(\", \")\", \"=>\", \":\", \"{\", \"}\", \";\"].includes(u.text)));\n let m = k;\n while (m < tokens.length) {\n const u = tokens[m] as Token;\n if (u.kind === \"punct\" && u.text === \"<\") {\n let angles = 0;\n let n = m;\n for (; n < tokens.length; n++) {\n const w = tokens[n] as Token;\n if (w.kind === \"punct\" && w.text === \"<\") angles++;\n else if (w.kind === \"punct\" && /^>+$/.test(w.text)) {\n angles -= w.text.length;\n if (angles <= 0) break;\n } else if (!typeish(w, angles)) break;\n }\n if (angles > 0 || n >= tokens.length || !/^>+$/.test((tokens[n] as Token).text)) return m;\n m = n + 1;\n continue;\n }\n if (!typeish(u, 0)) return m;\n m++;\n }\n return m;\n };\n /** After the `)` of a parameter list at `close`: an optional `: ReturnType`, then the index of what follows. */\n const afterReturnType = (close: number): number => {\n if (!is(close + 1, \":\")) return close + 1;\n const end = typeEnd(close + 2);\n for (let m = close + 2; m < end; m++) skip.add(m);\n return end;\n };\n /**\n * The names a parameter list from `open` to `close` binds, skipping them and\n * their type annotations. A `:` directly in the list starts a type; inside a\n * destructuring pattern it renames (`{ a: b }` binds b).\n */\n const parameters = (open: number, close: number): Set<string> => {\n const names = new Set<string>();\n const nesting: string[] = [];\n let inType = false;\n // Inside a default value (`v = limit`, `{ a = f(b) }`): references, not names, until it ends.\n let inDefault = false;\n let defaultDepth = 0;\n for (let k = open + 1; k < close; k++) {\n const u = tokens[k] as Token;\n if (inDefault) {\n if (u.kind !== \"punct\") continue;\n if (u.text === \"(\" || u.text === \"[\" || u.text === \"{\") {\n defaultDepth++;\n continue;\n }\n if ((u.text === \")\" || u.text === \"]\" || u.text === \"}\") && defaultDepth > 0) {\n defaultDepth--;\n continue;\n }\n if (\n defaultDepth > 0 ||\n !(u.text === \",\" || u.text === \")\" || u.text === \"]\" || u.text === \"}\")\n )\n continue;\n inDefault = false; // The default ends at a `,` or the pattern's close, handled below.\n }\n if (u.kind === \"punct\") {\n if (!inType && u.text === \"=\") {\n inDefault = true;\n defaultDepth = 0;\n continue;\n }\n if (inType) {\n if (u.text === \"(\" || u.text === \"[\" || u.text === \"{\" || u.text === \"<\")\n nesting.push(u.text);\n else if (nesting.length > 0 && [\")\", \"]\", \"}\"].includes(u.text)) nesting.pop();\n else if (nesting.length > 0 && /^>+$/.test(u.text)) nesting.splice(-u.text.length);\n else if (nesting.length === 0 && u.text === \",\") inType = false;\n else if (nesting.length === 0 && u.text === \"=\") {\n inType = false;\n inDefault = true;\n defaultDepth = 0;\n }\n continue;\n }\n if (u.text === \"{\" || u.text === \"[\") nesting.push(u.text);\n else if (u.text === \"}\" || u.text === \"]\") nesting.pop();\n else if (u.text === \":\" && nesting.length === 0) inType = true;\n continue;\n }\n if (inType) {\n skip.add(k);\n continue;\n }\n if (u.kind !== \"ident\") continue;\n const prev = tokens[k - 1];\n const next = tokens[k + 1];\n // In a pattern, a key followed by `:` is renamed; the name after the `:` is bound.\n if (nesting.length > 0 && next?.kind === \"punct\" && next.text === \":\") {\n skip.add(k);\n continue;\n }\n if (prev?.kind === \"punct\" && [\"(\", \",\", \"...\", \"{\", \"[\", \":\"].includes(prev.text)) {\n names.add(u.text);\n skip.add(k);\n }\n }\n return names;\n };\n tokens.forEach((t, i) => {\n if (t.kind === \"ident\" && is(i + 1, \"=>\")) {\n skip.add(i); // x => …\n scopes.push({ names: new Set([t.text]), from: i, to: bodyEnd(i + 2) });\n }\n const close = is(i, \"(\") ? match.get(i) : undefined;\n const arrow = close === undefined ? -1 : afterReturnType(close);\n if (close !== undefined && is(arrow, \"=>\")) {\n scopes.push({ names: parameters(i, close), from: i, to: bodyEnd(arrow + 1) });\n }\n if (t.kind === \"ident\" && is(i + 1, \"(\") && (is(i - 1, \"{\") || is(i - 1, \",\"))) {\n // { name(a) { … } }: an object method, named like a key, binding its parameters in its body.\n const end = match.get(i + 1);\n const body = end === undefined ? -1 : afterReturnType(end);\n if (end !== undefined && is(body, \"{\")) {\n skip.add(i);\n scopes.push({\n names: parameters(i + 1, end),\n from: i + 1,\n to: match.get(body) ?? tokens.length - 1,\n });\n }\n }\n if (t.kind === \"ident\" && t.text === \"for\" && is(i + 1, \"(\")) {\n // for (const y of xs) …, for (const k in o) …: the head's names are the loop's.\n const end = match.get(i + 1);\n const decl = tokens[i + 2];\n if (\n end !== undefined &&\n decl?.kind === \"ident\" &&\n [\"const\", \"let\", \"var\"].includes(decl.text)\n ) {\n const names = new Set<string>();\n for (let k = i + 3; k < end; k++) {\n const u = tokens[k] as Token;\n if (u.kind === \"ident\" && (u.text === \"of\" || u.text === \"in\")) {\n skip.add(k);\n break;\n }\n if (u.kind === \"ident\" && !is(k + 1, \":\")) {\n names.add(u.text);\n skip.add(k);\n }\n }\n const body = end + 1;\n const to = is(body, \"{\") ? (match.get(body) ?? tokens.length - 1) : bodyEnd(body);\n scopes.push({ names, from: i, to });\n }\n }\n if (t.kind === \"ident\" && t.text === \"catch\" && is(i + 1, \"(\")) {\n // catch (err) { … }: the binding is the following block's.\n const end = match.get(i + 1);\n if (end !== undefined && is(end + 1, \"{\"))\n scopes.push({\n names: parameters(i + 1, end),\n from: i + 1,\n to: match.get(end + 1) ?? tokens.length - 1,\n });\n }\n if (t.kind === \"ident\" && t.text === \"function\") {\n // function [name](a, b) { … }: its parameters are bound in it. A declaration (in statement\n // position) binds its name in the enclosing block; an expression's name only in itself.\n const named = tokens[i + 1]?.kind === \"ident\";\n const statement = i === 0 || [\"{\", \"}\", \";\"].some((p) => is(i - 1, p));\n if (named && statement) {\n const open = enclosing[i] ?? -1;\n skip.add(i + 1);\n scopes.push({\n names: new Set([(tokens[i + 1] as Token).text]),\n from: open,\n to: open >= 0 ? (match.get(open) ?? tokens.length - 1) : tokens.length - 1,\n });\n }\n const open = named ? i + 2 : i + 1;\n const end = is(open, \"(\") ? match.get(open) : undefined;\n const body = end === undefined ? -1 : afterReturnType(end);\n if (end !== undefined && is(body, \"{\")) {\n const names = parameters(open, end);\n if (named) {\n names.add((tokens[i + 1] as Token).text);\n skip.add(i + 1);\n }\n scopes.push({ names, from: i, to: match.get(body) ?? tokens.length - 1 });\n }\n }\n if (t.kind === \"ident\" && is(i + 1, \":\") && (is(i - 1, \"{\") || is(i - 1, \",\"))) skip.add(i); // { key: … }\n if (t.kind === \"ident\" && (t.text === \"as\" || t.text === \"satisfies\")) {\n // The operator and the type after it.\n skip.add(i);\n for (let k = i + 1; k < typeEnd(i + 1); k++) skip.add(k);\n }\n if (t.kind === \"ident\" && is(i + 1, \"<\")) {\n // f<A, B>(…): a generic call's type arguments, only when they read as a type and a call follows.\n const end = typeEnd(i + 1);\n if (end > i + 1 && is(end, \"(\")) for (let m = i + 2; m < end; m++) skip.add(m);\n }\n });\n return { skip, scopes };\n}\n\n/**\n * Identifiers the islands refer to from outside: not after a `.`, not a\n * binder, not an object key, an arrow function's parameter or a type. What\n * is left may still over-approximate (a `function` expression's parameter),\n * which only costs a binding the inner name shadows.\n */\nexport function freeNames(p: Property): string[] {\n const bound = new Set(p.binders.map((b) => b.name));\n const names = new Set<string>();\n // `outer`: names bound where the text sits, for a template substitution inside an arrow.\n const scan = (text: string, outer: ReadonlySet<string>): void => {\n const tokens = tokenize(text);\n const { skip, scopes } = notReferences(tokens);\n // A name an arrow function binds is its own inside that function.\n const local = (n: string, i: number) =>\n scopes.some((sc) => sc.names.has(n) && sc.from <= i && i <= sc.to);\n tokens.forEach((t, i) => {\n // A template's substitutions are expressions too.\n if (t.kind === \"template\") {\n const inScope = new Set(outer);\n for (const sc of scopes)\n if (sc.from <= i && i <= sc.to) for (const n of sc.names) inScope.add(n);\n for (const sub of templateSubstitutions(t.text)) scan(sub, inScope);\n }\n const prev = tokens[i - 1];\n if (\n t.kind !== \"ident\" ||\n skip.has(i) ||\n bound.has(t.text) ||\n reserved.has(t.text) ||\n outer.has(t.text) ||\n local(t.text, i)\n )\n return;\n if (prev?.kind === \"punct\" && (prev.text === \".\" || prev.text === \"?.\")) return;\n names.add(t.text);\n });\n };\n for (const text of [...p.requires, p.claim].flatMap(islands)) scan(text, new Set());\n return [...names];\n}\n\nfunction expression(f: Formula, h: { bool: string; same: string }): string {\n switch (f.kind) {\n case \"atom\":\n return `${h.bool}((${f.text}))`;\n case \"equation\":\n return `${f.negated ? \"!\" : \"\"}${h.same}((${f.left}), (${f.right}))`;\n case \"not\":\n return `!${expression(f.operand, h)}`;\n case \"and\":\n case \"or\":\n return `(${f.operands.map((o) => expression(o, h)).join(f.kind === \"and\" ? \" && \" : \" || \")})`;\n case \"implies\":\n return `(!(${f.antecedents.map((a) => expression(a, h)).join(\" && \")}) || ${expression(f.consequent, h)})`;\n case \"iff\":\n return `(${expression(f.left, h)} === ${expression(f.right, h)})`;\n }\n}\n\n/**\n * The predicate's source: an expression evaluating to the arrow function.\n * It takes the helpers as parameters under names fresh for this property,\n * so no binder or identifier in it can shadow them, and binds each free\n * name from the module's namespace when it has it, else from the globals,\n * which is the scope Lemma gives a property (re-exports included).\n */\nexport function predicateSource(p: Property, helpers: PredicateHelpers): string {\n // The globals that name fixed values, and `globalThis` itself, are never rebound.\n const free = freeNames(p).filter(\n (n) => ![\"globalThis\", \"undefined\", \"NaN\", \"Infinity\"].includes(n),\n );\n const taken = new Set([...p.binders.map((b) => b.name), ...free, \"globalThis\"]);\n const fresh = (base: string): string => {\n let name = base;\n while (taken.has(name)) name = `${name}$`;\n taken.add(name);\n return name;\n };\n const local = {\n bool: fresh(\"__bool\"),\n same: fresh(\"__same\"),\n scope: fresh(\"__scope\"),\n unresolved: fresh(\"__unresolved\"),\n missing: fresh(\"__missing\"),\n };\n const params = p.binders.map((b) => `${b.name}: ${tsType[b.domain]}`).join(\", \");\n const lines = [\n `((${local.bool}: (v: unknown) => boolean, ${local.same}: (a: unknown, b: unknown) => boolean, ${local.scope}: any, ${local.unresolved}: (names: string[]) => never) => {`,\n ` const ${local.missing}: string[] = [];`,\n // A name the module does not have comes from the globals (`globalThis` itself is never rebound);\n // one neither defines is noted, and evaluating the property then throws rather than reading undefined.\n ...free.map((n) => {\n const k = JSON.stringify(n);\n return ` const ${n} = ${k} in ${local.scope} ? ${local.scope}[${k}] : ${k} in globalThis ? (globalThis as any)[${k}] : (${local.missing}.push(${k}), undefined);`;\n }),\n ` return (${params}): \"held\" | \"discarded\" | \"refuted\" => {`,\n ` if (${local.missing}.length > 0) ${local.unresolved}(${local.missing});`,\n ...p.requires.map((r) => ` if (!${expression(r, local)}) return \"discarded\";`),\n ` return ${expression(p.claim, local)} ? \"held\" : \"refuted\";`,\n \" };\",\n `})(${helpers.bool}, ${helpers.same}, ${helpers.scope}, ${helpers.unresolved})`,\n ];\n return lines.join(\"\\n\");\n}\n","/**\n * The Vitest regression emitter. Given a violation, produce a test file that\n * replays its shrunk schedule on the restricted scenario. By default the\n * test expects the invariants to hold, so it fails while the bug exists and\n * passes once it is fixed. With `expect: \"violates\"` it asserts the recorded\n * violation instead, which is how Eutaxy's own corpus exercises the emitter.\n *\n * The emitter knows nothing about any platform: the caller supplies the\n * import lines and the expression that builds the platform.\n */\n\nimport { canonicalJson, type JsonValue, type Violated } from \"@eutaxy/core\";\n\nexport interface RegressionTestOptions {\n /** Import lines for the scenario, the platform's dependencies, and anything the platform expression needs. */\n readonly imports: readonly string[];\n /** An expression evaluating to the `Platform` (may reference the imports). */\n readonly platform: string;\n /** An expression evaluating to the `ScenarioSpec`. */\n readonly scenario: string;\n /** Module that exports `replay`, `restrictSpec` and `checkInvariants`; the public facade by default. */\n readonly engineModule?: string;\n readonly expect?: \"holds\" | \"violates\";\n /**\n * Core functions to observe during the replay, as `refines` needs their\n * decisions in the log: an expression for each module's namespace (from\n * the imports) and the functions to observe on it.\n */\n readonly observe?: readonly {\n readonly namespace: string;\n readonly functions: readonly string[];\n }[];\n}\n\nexport function emitRegressionTest(verdict: Violated, options: RegressionTestOptions): string {\n const engineModule = options.engineModule ?? \"eutaxy\";\n const mode = options.expect ?? \"holds\";\n const schedule = canonicalJson(verdict.schedule as unknown as JsonValue);\n const kept = canonicalJson([...verdict.keptEvents]);\n const keys = canonicalJson([...verdict.violation.keys]);\n const title =\n mode === \"holds\"\n ? `${verdict.scenario}: ${verdict.violation.invariant} holds on the recorded schedule`\n : `${verdict.scenario}: ${verdict.violation.invariant} is still violated on the recorded schedule`;\n const assertion =\n mode === \"holds\"\n ? ` expect(violations.map((v) => \\`\\${v.invariant}: \\${v.message}\\`)).toEqual([]);`\n : ` expect(violations.map((v) => [v.invariant, v.keys])).toContainEqual([${JSON.stringify(verdict.violation.invariant)}, ${keys}]);`;\n const observe = options.observe ?? [];\n const replayLines =\n observe.length === 0\n ? [\" const log = await replay(spec, platform, schedule);\"]\n : [\n ` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(\", \")}];`,\n \" const log = await replay(spec, platform, schedule).finally(() => {\",\n \" for (const o of observers) o.restore();\",\n \" });\",\n ];\n const lines = [\n \"// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.\",\n `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,\n `import { checkInvariants, ${observe.length > 0 ? \"observeCore, \" : \"\"}replay, restrictSpec } from ${JSON.stringify(engineModule)};`,\n ...options.imports,\n 'import { expect, test } from \"vitest\";',\n \"\",\n `const schedule = ${schedule} as const;`,\n `const keptEvents = ${kept} as const;`,\n \"\",\n `test(${JSON.stringify(title)}, async () => {`,\n ` const platform = ${options.platform};`,\n ` const spec = restrictSpec(platform, ${options.scenario}, keptEvents);`,\n ...replayLines,\n \" const violations = checkInvariants(log, spec.invariants);\",\n assertion,\n \"});\",\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n","/**\n * Rendering verdicts: a text form for people and a versioned JSON form for\n * CI and coding agents. Both are pure functions over the verdict data.\n */\n\nimport {\n canonicalJson,\n type EffectLog,\n type JsonValue,\n type ScenarioVerdict,\n type SpecVerdict,\n} from \"@eutaxy/core\";\n\nexport const reportSchemaVersion = 1;\n\n/**\n * The JSON report: one object, canonical, with a schema version at the top.\n * Spec verdicts, when there are any, sit beside the scenario's, never in it.\n */\nexport function renderJson(verdict: ScenarioVerdict, specs: readonly SpecVerdict[] = []): string {\n return canonicalJson({\n schemaVersion: reportSchemaVersion,\n generator: \"eutaxy\",\n verdict: verdict as unknown as JsonValue,\n ...(specs.length > 0 ? { specs: specs as unknown as JsonValue } : {}),\n });\n}\n\n/** Spec verdicts as text: one line each, a counterexample under a refutation. */\nexport function renderSpecs(specs: readonly SpecVerdict[]): string {\n if (specs.length === 0) return \"\";\n const out = [\"Specs (CHECKED means held on the inputs the simulator passed; it is not a proof)\"];\n for (const v of specs) {\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n out.push(\n ` CHECKED ${what}: held on ${v.inputs} input(s)${v.discarded > 0 ? `, ${v.discarded} outside the claim` : \"\"}`,\n );\n break;\n case \"REFUTED\": {\n const c = v.counterexample;\n out.push(\n ` REFUTED ${what}: false at ${c.call}${c.error ? `, which threw ${c.error}` : \"\"}`,\n );\n out.push(` ${c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \")}`);\n out.push(` ${v.text.replace(/\\s+/g, \" \")}`);\n break;\n }\n case \"UNKNOWN\":\n out.push(` UNKNOWN ${what}: ${v.cause}: ${v.reason}`);\n break;\n }\n }\n return out.join(\"\\n\");\n}\n\nfunction clip(s: string, max: number): string {\n return s.length <= max ? s : `${s.slice(0, max - 1)}…`;\n}\n\nfunction pad(s: string, width: number): string {\n return s.length >= width ? s : s + \" \".repeat(width - s.length);\n}\n\n/** The trace as a fixed-width table; evidence rows are marked with `*`. */\nexport function renderTrace(log: EffectLog, evidence: readonly number[] = []): string {\n const rows = log.entries.map((e) => [\n evidence.includes(e.seq) ? \"*\" : \" \",\n String(e.seq),\n e.invocation,\n e.kind,\n e.target,\n e.op,\n clip(canonicalJson(e.payload), 72),\n ]);\n const header = [\" \", \"seq\", \"invocation\", \"kind\", \"target\", \"op\", \"payload\"];\n const widths = header.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => (r[i] as string).length)),\n );\n const line = (cells: readonly string[]) =>\n cells\n .map((c, i) => (i === cells.length - 1 ? c : pad(c, widths[i] as number)))\n .join(\" \")\n .trimEnd();\n return [line(header), ...rows.map(line)].join(\"\\n\");\n}\n\n/** A readable report: verdict, what it rests on, and for a violation the schedule and trace. */\nexport function renderText(verdict: ScenarioVerdict): string {\n const out: string[] = [];\n const r = verdict.reached;\n out.push(`${verdict.kind} ${verdict.scenario} (seed ${String(verdict.seed)})`);\n switch (verdict.kind) {\n case \"VIOLATED\": {\n out.push(\"\");\n out.push(\n `Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`,\n );\n out.push(`Keys: ${verdict.violation.keys.join(\", \")}`);\n out.push(\"\");\n out.push(\n `Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(\", \")}`,\n );\n if (verdict.schedule.faults.length === 0) out.push(\" no injected faults\");\n for (const f of verdict.schedule.faults) {\n out.push(` ${f.fault} at ${f.invocation} effect #${f.ordinal} (${f.target} ${f.op})`);\n }\n out.push(\n `Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`,\n );\n out.push(\"\");\n out.push(\"Trace:\");\n out.push(renderTrace(verdict.trace, verdict.violation.evidence));\n break;\n }\n case \"BOUNDED\": {\n const b = verdict.bounds;\n out.push(\"\");\n out.push(\"No violation found within the stated bounds. This is not a proof.\");\n out.push(\n `Bounds: faults per run ≤ ${b.maxFaultsPerRun}, redeliveries ≤ ${b.maxRedeliveries}, concurrent invocations ≤ ${b.maxConcurrentInvocations}, budget ${b.budgetMs} ms`,\n );\n const e = r.exhaustive;\n if (e) {\n out.push(\n `Exhaustive: ${e.complete ? \"every schedule within the bounds ran\" : \"stopped at the budget before every schedule ran\"} (${e.schedules} schedules${e.reduction ? \", partial-order reduction\" : \"\"})`,\n );\n }\n break;\n }\n case \"UNSUPPORTED\": {\n out.push(\"\");\n out.push(`Eutaxy could not decide this scenario (${verdict.cause}): ${verdict.reason}`);\n break;\n }\n }\n out.push(\"\");\n out.push(\n `Explored: ${r.runs} run(s), ${r.effectPoints} effect point(s), ${r.faultsInjected} fault(s) injected, ${r.elapsedMs} ms`,\n );\n out.push(\"Assumptions:\");\n for (const a of verdict.assumptions) out.push(` - ${a}`);\n return out.join(\"\\n\");\n}\n"],"mappings":";;AAWA,MAAa,UAA6B;CAAC;CAAO;CAAO;CAAU;CAAW;CAAU;AAAQ;;ACgChG,MAAM,SAAgD;CACpD,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;CACL,KAAK;AACP;;AAGA,MAAM,WAAoD;CACxD,CAAC,OAAO,KAAK;CACb,CAAC,OAAO,SAAS;CACjB,CAAC,MAAM,SAAS;CAChB,CAAC,OAAO,IAAI;AACd;AAEA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;AAGA,MAAM,6BAAa,IAAI,IAAI;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,aAAa;AACnB,MAAM,YAAY;AAClB,MAAM,WACJ;AAEF,IAAa,gBAAb,cAAmC,MAAM,CAAC;;AAG1C,MAAM,kCAAkB,IAAI,IAAI;CAAC;CAAM;CAAS;CAAO;AAAM,CAAC;;;;;;AAO9D,SAASA,cACP,QACA,GACA,YACA,QACS;CACT,OAAO,KAAK,KAAK,OAAO,EAAE,EAAE,SAAS,WAAW;CAChD,MAAM,IAAI,OAAO;CACjB,IAAI,CAAC,GAAG,OAAO;CACf,QAAQ,EAAE,MAAV;EACE,KAAK,SAAS;GAEZ,MAAM,SAAS,OAAO,MAAM,GAAG,CAAC,CAAC,CAAC,UAAU,MAAM,EAAE,SAAS,SAAS;GACtE,IAAI,QAAQ,SAAS,YAAY,OAAO,SAAS,OAAO,OAAO,SAAS,OAAO,OAAO;GACtF,OAAO,CAAC,WAAW,IAAI,EAAE,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,QAAQ;CAG1F;CACA,IAAI,KAAK,EAAE;CACX,IAAI,KACF,aAAa,EAAE,KAAK,WAAW,EAAE,aAAa,oBAAoB,EAAE,eAAe,sBAAsB,EAAE,UAAU,IACvH;CACA,IAAI,KAAK,cAAc;CACvB,KAAK,MAAM,KAAK,QAAQ,aAAa,IAAI,KAAK,OAAO,GAAG;CACxD,OAAO,IAAI,KAAK,IAAI;AACtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verdict-evEM5Gxx.mjs","names":[],"sources":["../../core/src/verdict.ts"],"sourcesContent":["/** Simulation verdicts, with what each one rests on. */\n\nimport type { EffectLog } from \"./effect-log.ts\";\nimport type { Schedule } from \"./faults.ts\";\nimport type { Violation } from \"./invariants.ts\";\nimport type { Bounds } from \"./scenario.ts\";\n\nexport interface BoundsReached {\n readonly runs: number;\n readonly effectPoints: number;\n readonly faultsInjected: number;\n readonly elapsedMs: number;\n}\n\ninterface VerdictBase {\n readonly scenario: string;\n readonly seed: number | string;\n readonly reached: BoundsReached;\n readonly assumptions: readonly string[];\n}\n\nexport interface Shrunk {\n readonly faultsRemoved: number;\n readonly eventsRemoved: number;\n readonly runs: number;\n}\n\nexport interface Violated extends VerdictBase {\n readonly kind: \"VIOLATED\";\n readonly violation: Violation;\n /** The replayed, shrunk trace that breaks the invariant. */\n readonly trace: EffectLog;\n readonly schedule: Schedule;\n /** Ids of the drive's events that remain after shrinking. */\n readonly keptEvents: readonly string[];\n readonly shrunk: Shrunk;\n}\n\nexport interface Bounded extends VerdictBase {\n readonly kind: \"BOUNDED\";\n readonly bounds: Bounds;\n}\n\nexport type UnsupportedCause =\n | \"unsupported_api\"\n | \"not_replayable\"\n | \"module_state_leak\"\n | \"unsupported_bounds\";\n\nexport interface Unsupported extends VerdictBase {\n readonly kind: \"UNSUPPORTED\";\n readonly cause: UnsupportedCause;\n readonly reason: string;\n}\n\nexport type ScenarioVerdict = Violated | Bounded | Unsupported;\n\n/** One line per verdict, for error messages; full rendering lives in `report`. */\nexport function describeVerdict(v: ScenarioVerdict): string {\n switch (v.kind) {\n case \"VIOLATED\":\n return `VIOLATED ${v.scenario}: ${v.violation.message} (seed ${v.schedule.seed}, ${v.reached.runs} run(s))`;\n case \"BOUNDED\":\n return `BOUNDED ${v.scenario}: no violation in ${v.reached.runs} run(s), ${v.reached.effectPoints} effect point(s), ${v.reached.faultsInjected} fault(s)`;\n case \"UNSUPPORTED\":\n return `UNSUPPORTED ${v.scenario}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"verdict-evEM5Gxx.mjs","names":[],"sources":["../../core/src/verdict.ts"],"sourcesContent":["/** Simulation verdicts, with what each one rests on. */\n\nimport type { EffectLog } from \"./effect-log.ts\";\nimport type { Schedule } from \"./faults.ts\";\nimport type { Violation } from \"./invariants.ts\";\nimport type { Bounds } from \"./scenario.ts\";\n\nexport interface BoundsReached {\n readonly runs: number;\n readonly effectPoints: number;\n readonly faultsInjected: number;\n readonly elapsedMs: number;\n /**\n * Present when exploration was exhaustive: how many distinct schedules ran\n * (runs that only repeated an order the reduction had covered are not\n * counted), and whether every schedule within the bounds was reached\n * before the budget ran out.\n */\n readonly exhaustive?: {\n readonly complete: boolean;\n readonly schedules: number;\n readonly reduction: boolean;\n };\n}\n\ninterface VerdictBase {\n readonly scenario: string;\n readonly seed: number | string;\n readonly reached: BoundsReached;\n readonly assumptions: readonly string[];\n}\n\nexport interface Shrunk {\n readonly faultsRemoved: number;\n readonly eventsRemoved: number;\n readonly runs: number;\n}\n\nexport interface Violated extends VerdictBase {\n readonly kind: \"VIOLATED\";\n readonly violation: Violation;\n /** The replayed, shrunk trace that breaks the invariant. */\n readonly trace: EffectLog;\n readonly schedule: Schedule;\n /** Ids of the drive's events that remain after shrinking. */\n readonly keptEvents: readonly string[];\n readonly shrunk: Shrunk;\n}\n\nexport interface Bounded extends VerdictBase {\n readonly kind: \"BOUNDED\";\n readonly bounds: Bounds;\n}\n\nexport type UnsupportedCause =\n | \"unsupported_api\"\n | \"not_replayable\"\n | \"module_state_leak\"\n | \"unsupported_bounds\";\n\nexport interface Unsupported extends VerdictBase {\n readonly kind: \"UNSUPPORTED\";\n readonly cause: UnsupportedCause;\n readonly reason: string;\n}\n\nexport type ScenarioVerdict = Violated | Bounded | Unsupported;\n\n/** One line per verdict, for error messages; full rendering lives in `report`. */\nexport function describeVerdict(v: ScenarioVerdict): string {\n switch (v.kind) {\n case \"VIOLATED\":\n return `VIOLATED ${v.scenario}: ${v.violation.message} (seed ${v.schedule.seed}, ${v.reached.runs} run(s))`;\n case \"BOUNDED\":\n return `BOUNDED ${v.scenario}: no violation in ${v.reached.runs} run(s), ${v.reached.effectPoints} effect point(s), ${v.reached.faultsInjected} fault(s)`;\n case \"UNSUPPORTED\":\n return `UNSUPPORTED ${v.scenario}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;AAqEA,SAAgB,gBAAgB,GAA4B;CAC1D,QAAQ,EAAE,MAAV;EACE,KAAK,YACH,OAAO,YAAY,EAAE,SAAS,IAAI,EAAE,UAAU,QAAQ,SAAS,EAAE,SAAS,KAAK,IAAI,EAAE,QAAQ,KAAK;EACpG,KAAK,WACH,OAAO,WAAW,EAAE,SAAS,oBAAoB,EAAE,QAAQ,KAAK,WAAW,EAAE,QAAQ,aAAa,oBAAoB,EAAE,QAAQ,eAAe;EACjJ,KAAK,eACH,OAAO,eAAe,EAAE,SAAS,IAAI,EAAE,MAAM,IAAI,EAAE;CACvD;AACF"}
|
package/package.json
CHANGED
package/dist/cli-Dr-Ziogu.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"explore-YVHTRjjS.d.mts","names":[],"sources":["../../core/src/verdict.ts","../../engine/src/explore.ts"],"mappings":";UAOiB;WACN;WACA;WACA;WACA;;UAGD;WACC;WACA;WACA,SAAS;WACT;;UAGM;WACN;WACA;WACA;;UAGM,iBAAiB;WACvB;WACA,WAAW;;WAEX,OAAO;WACP,UAAU;;WAEV;WACA,QAAQ;;UAGF,gBAAgB;WACtB;WACA,QAAQ;;KAGP;UAMK,oBAAoB;WAC1B;WACA,OAAO;WACP;;KAGC,kBAAkB,WAAW,UAAU;;iBAGnC,gBAAgB,GAAG;UCnClB;WACN;;WAEA;;WAEA;;WAEA;;WAEA;;;;;;WAMA;;;iBAuDW,OACpB,MAAM,cACN,UAAU,UACV,UAAU,WACT,QAAQ;iBAIW,QACpB,MAAM,cACN,UAAU,UACV,SAAS,iBACR,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform-TwATAkL3.d.mts","names":[],"sources":["../../core/src/canonical-json.ts","../../core/src/effect-log.ts","../../core/src/faults.ts","../../core/src/invariants.ts","../../core/src/scenario.ts","../../core/src/platform.ts"],"mappings":";;;;;KAMY,wDAKC;YACG,cAAc;;;KCDlB;UAEK;;WAEN;WACA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,kBAAkB;;;;;;;KChBjB;UAUK;;WAEN;;WAEA;WACA,OAAO;;WAEP;WACA;;UAGM;;WAEN;WACA,iBAAiB;;;UC1BX;WACN;WACA;WACA,OAAO;;WAEP;cAAoB,eAAe;;;WAEnC;cAAsB;;;;UAIhB;WACN;WACA;WACA,QAAQ;;WAER;;;UAIM;WACN;WACA;WACA,QAAQ;WACR;WACA,mBAAmB;;WAEnB;aAAwB;;;;KAqBvB;WACG;WAAyB;WAA2B,OAAO;;WAC3D;WAAyB;WAA0C;;WACnE;WAAyB;WAAmB,gBAAgB;;WAC5D;WAAyB;;;UAGvB;;WAEN;WACA;WACA,iBAAiB;;;UAIX;WACN;WACA;WACA,OAAO;WACP,gBAAgB;;;;;;;UAQV;WACN;WACA;WACA,MAAM;;WAEN;WACA,OAAO;WACP;;KAGC,YAAY,mBAAmB,cAAc,WAAW;UA2DnD;WACN;WACA;;WAEA;;WAEA;;iBA4EK,eAAe,KAAK,WAAW,KAAK,YAAY;iBAiGhD,gBACd,KAAK,WACL,qBAAqB,uBACX;;UCrUK;WACN;YACC,cAAc;;;UAIT;WACN;WACA;;;UAIM;;WAEN;;WAEA;WACA;WACA;cAAsB;;;WAEtB,OAAO;;;;;;;UAQD;WACN;;WAEA;WACA;;;;;;aAME;;;WAGF,qBAAqB;;;UAIf;WACN;WACA;WACA;WACA;;UAGM;WACN;WACA;;WAEA;WACA,QAAQ;;WAER,OAAO;;WAEP,gBAAgB;WAChB,oBAAoB;WACpB,qBAAqB;WACrB,QAAQ;;;iBAeH,iBAAiB,MAAM;;UC9EtB;WACN;;WAEA;WACA,MAAM;;;UAIA;WACN;WACA;WACA;WACA,MAAM;;WAEN,kBAAkB;;;UAIZ;WACN;;WAEA,SAAS;EAClB;;;UAIe;EACf,gBAAgB,aAAa;;EAE7B,OAAO,GACL,OAAO,aACP,eAAe,QAAQ,IACvB,YAAY,OAAO,MAAM,YACxB,QAAQ;;EAEX,WAAW,GAAG,OAAO,aAAa,eAAe,GAAG,YAAY,OAAO,MAAM,YAAY;;EAEzF,YAAY;;EAEZ,SAAS,oBAAoB,gBAAgB,SAAS;;;;;;;EAOtD,OAAO,GAAG,SAAS,QAAQ,IAAI,qBAAqB,QAAQ;;UAG7C;WACN;;WAEA,oBAAoB;;UAGd;WACN;;WAEA;;EAET,MAAM,MAAM,eAAe;;EAE3B,cAAc,MAAM,wBAAwB;;EAE5C,QAAQ,OAAO,UAAU,OAAO,UAAU,MAAM,eAAe,QAAQ;;EAEvE,eAAe,MAAM,cAAc,6BAA6B;;EAEhE,QAAQ,MAAM,cAAc,OAAO,WAAW;;EAE9C,SAAS,MAAM,eAAe"}
|
package/dist/src-BBXd0WEp.mjs
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { i as canonicalJson } from "./src-s6uYyC0B.mjs";
|
|
2
|
-
// packages/report/src/regression.ts
|
|
3
|
-
/**
|
|
4
|
-
* The Vitest regression emitter. Given a violation, produce a test file that
|
|
5
|
-
* replays its shrunk schedule on the restricted scenario. By default the
|
|
6
|
-
* test expects the invariants to hold, so it fails while the bug exists and
|
|
7
|
-
* passes once it is fixed. With `expect: "violates"` it asserts the recorded
|
|
8
|
-
* violation instead, which is how Eutaxy's own corpus exercises the emitter.
|
|
9
|
-
*
|
|
10
|
-
* The emitter knows nothing about any platform: the caller supplies the
|
|
11
|
-
* import lines and the expression that builds the platform.
|
|
12
|
-
*/
|
|
13
|
-
function emitRegressionTest(verdict, options) {
|
|
14
|
-
const engineModule = options.engineModule ?? "eutaxy";
|
|
15
|
-
const mode = options.expect ?? "holds";
|
|
16
|
-
const schedule = canonicalJson(verdict.schedule);
|
|
17
|
-
const kept = canonicalJson([...verdict.keptEvents]);
|
|
18
|
-
const keys = canonicalJson([...verdict.violation.keys]);
|
|
19
|
-
const title = mode === "holds" ? `${verdict.scenario}: ${verdict.violation.invariant} holds on the recorded schedule` : `${verdict.scenario}: ${verdict.violation.invariant} is still violated on the recorded schedule`;
|
|
20
|
-
const assertion = mode === "holds" ? ` expect(violations.map((v) => \`\${v.invariant}: \${v.message}\`)).toEqual([]);` : ` expect(violations.map((v) => [v.invariant, v.keys])).toContainEqual([${JSON.stringify(verdict.violation.invariant)}, ${keys}]);`;
|
|
21
|
-
return [
|
|
22
|
-
"// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.",
|
|
23
|
-
`// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,
|
|
24
|
-
`import { checkInvariants, replay, restrictSpec } from ${JSON.stringify(engineModule)};`,
|
|
25
|
-
...options.imports,
|
|
26
|
-
"import { expect, test } from \"vitest\";",
|
|
27
|
-
"",
|
|
28
|
-
`const schedule = ${schedule} as const;`,
|
|
29
|
-
`const keptEvents = ${kept} as const;`,
|
|
30
|
-
"",
|
|
31
|
-
`test(${JSON.stringify(title)}, async () => {`,
|
|
32
|
-
` const platform = ${options.platform};`,
|
|
33
|
-
` const spec = restrictSpec(platform, ${options.scenario}, keptEvents);`,
|
|
34
|
-
" const log = await replay(spec, platform, schedule);",
|
|
35
|
-
" const violations = checkInvariants(log, spec.invariants);",
|
|
36
|
-
assertion,
|
|
37
|
-
"});",
|
|
38
|
-
""
|
|
39
|
-
].join("\n");
|
|
40
|
-
}
|
|
41
|
-
/** The JSON report: one object, canonical, with a schema version at the top. */
|
|
42
|
-
function renderJson(verdict) {
|
|
43
|
-
return canonicalJson({
|
|
44
|
-
schemaVersion: 1,
|
|
45
|
-
generator: "eutaxy",
|
|
46
|
-
verdict
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
function clip(s, max) {
|
|
50
|
-
return s.length <= max ? s : `${s.slice(0, max - 1)}…`;
|
|
51
|
-
}
|
|
52
|
-
function pad(s, width) {
|
|
53
|
-
return s.length >= width ? s : s + " ".repeat(width - s.length);
|
|
54
|
-
}
|
|
55
|
-
/** The trace as a fixed-width table; evidence rows are marked with `*`. */
|
|
56
|
-
function renderTrace(log, evidence = []) {
|
|
57
|
-
const rows = log.entries.map((e) => [
|
|
58
|
-
evidence.includes(e.seq) ? "*" : " ",
|
|
59
|
-
String(e.seq),
|
|
60
|
-
e.invocation,
|
|
61
|
-
e.kind,
|
|
62
|
-
e.target,
|
|
63
|
-
e.op,
|
|
64
|
-
clip(canonicalJson(e.payload), 72)
|
|
65
|
-
]);
|
|
66
|
-
const header = [
|
|
67
|
-
" ",
|
|
68
|
-
"seq",
|
|
69
|
-
"invocation",
|
|
70
|
-
"kind",
|
|
71
|
-
"target",
|
|
72
|
-
"op",
|
|
73
|
-
"payload"
|
|
74
|
-
];
|
|
75
|
-
const widths = header.map((h, i) => Math.max(h.length, ...rows.map((r) => r[i].length)));
|
|
76
|
-
const line = (cells) => cells.map((c, i) => i === cells.length - 1 ? c : pad(c, widths[i])).join(" ").trimEnd();
|
|
77
|
-
return [line(header), ...rows.map(line)].join("\n");
|
|
78
|
-
}
|
|
79
|
-
/** A readable report: verdict, what it rests on, and for a violation the schedule and trace. */
|
|
80
|
-
function renderText(verdict) {
|
|
81
|
-
const out = [];
|
|
82
|
-
const r = verdict.reached;
|
|
83
|
-
out.push(`${verdict.kind} ${verdict.scenario} (seed ${String(verdict.seed)})`);
|
|
84
|
-
switch (verdict.kind) {
|
|
85
|
-
case "VIOLATED":
|
|
86
|
-
out.push("");
|
|
87
|
-
out.push(`Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`);
|
|
88
|
-
out.push(`Keys: ${verdict.violation.keys.join(", ")}`);
|
|
89
|
-
out.push("");
|
|
90
|
-
out.push(`Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(", ")}`);
|
|
91
|
-
if (verdict.schedule.faults.length === 0) out.push(" no injected faults");
|
|
92
|
-
for (const f of verdict.schedule.faults) out.push(` ${f.fault} at ${f.invocation} effect #${f.ordinal} (${f.target} ${f.op})`);
|
|
93
|
-
out.push(`Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`);
|
|
94
|
-
out.push("");
|
|
95
|
-
out.push("Trace:");
|
|
96
|
-
out.push(renderTrace(verdict.trace, verdict.violation.evidence));
|
|
97
|
-
break;
|
|
98
|
-
case "BOUNDED": {
|
|
99
|
-
const b = verdict.bounds;
|
|
100
|
-
out.push("");
|
|
101
|
-
out.push("No violation found within the stated bounds. This is not a proof.");
|
|
102
|
-
out.push(`Bounds: faults per run ≤ ${b.maxFaultsPerRun}, redeliveries ≤ ${b.maxRedeliveries}, concurrent invocations ≤ ${b.maxConcurrentInvocations}, budget ${b.budgetMs} ms`);
|
|
103
|
-
break;
|
|
104
|
-
}
|
|
105
|
-
case "UNSUPPORTED":
|
|
106
|
-
out.push("");
|
|
107
|
-
out.push(`Eutaxy could not decide this scenario (${verdict.cause}): ${verdict.reason}`);
|
|
108
|
-
}
|
|
109
|
-
out.push("");
|
|
110
|
-
out.push(`Explored: ${r.runs} run(s), ${r.effectPoints} effect point(s), ${r.faultsInjected} fault(s) injected, ${r.elapsedMs} ms`);
|
|
111
|
-
out.push("Assumptions:");
|
|
112
|
-
for (const a of verdict.assumptions) out.push(` - ${a}`);
|
|
113
|
-
return out.join("\n");
|
|
114
|
-
}
|
|
115
|
-
export { emitRegressionTest as i, renderText as n, renderTrace as r, renderJson as t };
|
|
116
|
-
|
|
117
|
-
//# sourceMappingURL=src-BBXd0WEp.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-BBXd0WEp.mjs","names":[],"sources":["../../report/src/regression.ts","../../report/src/render.ts"],"sourcesContent":["/**\n * The Vitest regression emitter. Given a violation, produce a test file that\n * replays its shrunk schedule on the restricted scenario. By default the\n * test expects the invariants to hold, so it fails while the bug exists and\n * passes once it is fixed. With `expect: \"violates\"` it asserts the recorded\n * violation instead, which is how Eutaxy's own corpus exercises the emitter.\n *\n * The emitter knows nothing about any platform: the caller supplies the\n * import lines and the expression that builds the platform.\n */\n\nimport { canonicalJson, type JsonValue, type Violated } from \"@eutaxy/core\";\n\nexport interface RegressionTestOptions {\n /** Import lines for the scenario, the platform's dependencies, and anything the platform expression needs. */\n readonly imports: readonly string[];\n /** An expression evaluating to the `Platform` (may reference the imports). */\n readonly platform: string;\n /** An expression evaluating to the `ScenarioSpec`. */\n readonly scenario: string;\n /** Module that exports `replay`, `restrictSpec` and `checkInvariants`; the public facade by default. */\n readonly engineModule?: string;\n readonly expect?: \"holds\" | \"violates\";\n}\n\nexport function emitRegressionTest(verdict: Violated, options: RegressionTestOptions): string {\n const engineModule = options.engineModule ?? \"eutaxy\";\n const mode = options.expect ?? \"holds\";\n const schedule = canonicalJson(verdict.schedule as unknown as JsonValue);\n const kept = canonicalJson([...verdict.keptEvents]);\n const keys = canonicalJson([...verdict.violation.keys]);\n const title =\n mode === \"holds\"\n ? `${verdict.scenario}: ${verdict.violation.invariant} holds on the recorded schedule`\n : `${verdict.scenario}: ${verdict.violation.invariant} is still violated on the recorded schedule`;\n const assertion =\n mode === \"holds\"\n ? ` expect(violations.map((v) => \\`\\${v.invariant}: \\${v.message}\\`)).toEqual([]);`\n : ` expect(violations.map((v) => [v.invariant, v.keys])).toContainEqual([${JSON.stringify(verdict.violation.invariant)}, ${keys}]);`;\n const lines = [\n \"// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.\",\n `// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,\n `import { checkInvariants, replay, restrictSpec } from ${JSON.stringify(engineModule)};`,\n ...options.imports,\n 'import { expect, test } from \"vitest\";',\n \"\",\n `const schedule = ${schedule} as const;`,\n `const keptEvents = ${kept} as const;`,\n \"\",\n `test(${JSON.stringify(title)}, async () => {`,\n ` const platform = ${options.platform};`,\n ` const spec = restrictSpec(platform, ${options.scenario}, keptEvents);`,\n \" const log = await replay(spec, platform, schedule);\",\n \" const violations = checkInvariants(log, spec.invariants);\",\n assertion,\n \"});\",\n \"\",\n ];\n return lines.join(\"\\n\");\n}\n","/**\n * Rendering verdicts: a text form for people and a versioned JSON form for\n * CI and coding agents. Both are pure functions over the verdict data.\n */\n\nimport { canonicalJson, type EffectLog, type JsonValue, type ScenarioVerdict } from \"@eutaxy/core\";\n\nexport const reportSchemaVersion = 1;\n\n/** The JSON report: one object, canonical, with a schema version at the top. */\nexport function renderJson(verdict: ScenarioVerdict): string {\n return canonicalJson({\n schemaVersion: reportSchemaVersion,\n generator: \"eutaxy\",\n verdict: verdict as unknown as JsonValue,\n });\n}\n\nfunction clip(s: string, max: number): string {\n return s.length <= max ? s : `${s.slice(0, max - 1)}…`;\n}\n\nfunction pad(s: string, width: number): string {\n return s.length >= width ? s : s + \" \".repeat(width - s.length);\n}\n\n/** The trace as a fixed-width table; evidence rows are marked with `*`. */\nexport function renderTrace(log: EffectLog, evidence: readonly number[] = []): string {\n const rows = log.entries.map((e) => [\n evidence.includes(e.seq) ? \"*\" : \" \",\n String(e.seq),\n e.invocation,\n e.kind,\n e.target,\n e.op,\n clip(canonicalJson(e.payload), 72),\n ]);\n const header = [\" \", \"seq\", \"invocation\", \"kind\", \"target\", \"op\", \"payload\"];\n const widths = header.map((h, i) =>\n Math.max(h.length, ...rows.map((r) => (r[i] as string).length)),\n );\n const line = (cells: readonly string[]) =>\n cells\n .map((c, i) => (i === cells.length - 1 ? c : pad(c, widths[i] as number)))\n .join(\" \")\n .trimEnd();\n return [line(header), ...rows.map(line)].join(\"\\n\");\n}\n\n/** A readable report: verdict, what it rests on, and for a violation the schedule and trace. */\nexport function renderText(verdict: ScenarioVerdict): string {\n const out: string[] = [];\n const r = verdict.reached;\n out.push(`${verdict.kind} ${verdict.scenario} (seed ${String(verdict.seed)})`);\n switch (verdict.kind) {\n case \"VIOLATED\": {\n out.push(\"\");\n out.push(\n `Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`,\n );\n out.push(`Keys: ${verdict.violation.keys.join(\", \")}`);\n out.push(\"\");\n out.push(\n `Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(\", \")}`,\n );\n if (verdict.schedule.faults.length === 0) out.push(\" no injected faults\");\n for (const f of verdict.schedule.faults) {\n out.push(` ${f.fault} at ${f.invocation} effect #${f.ordinal} (${f.target} ${f.op})`);\n }\n out.push(\n `Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`,\n );\n out.push(\"\");\n out.push(\"Trace:\");\n out.push(renderTrace(verdict.trace, verdict.violation.evidence));\n break;\n }\n case \"BOUNDED\": {\n const b = verdict.bounds;\n out.push(\"\");\n out.push(\"No violation found within the stated bounds. This is not a proof.\");\n out.push(\n `Bounds: faults per run ≤ ${b.maxFaultsPerRun}, redeliveries ≤ ${b.maxRedeliveries}, concurrent invocations ≤ ${b.maxConcurrentInvocations}, budget ${b.budgetMs} ms`,\n );\n break;\n }\n case \"UNSUPPORTED\": {\n out.push(\"\");\n out.push(`Eutaxy could not decide this scenario (${verdict.cause}): ${verdict.reason}`);\n break;\n }\n }\n out.push(\"\");\n out.push(\n `Explored: ${r.runs} run(s), ${r.effectPoints} effect point(s), ${r.faultsInjected} fault(s) injected, ${r.elapsedMs} ms`,\n );\n out.push(\"Assumptions:\");\n for (const a of verdict.assumptions) out.push(` - ${a}`);\n return out.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgB,mBAAmB,SAAmB,SAAwC;CAC5F,MAAM,eAAe,QAAQ,gBAAgB;CAC7C,MAAM,OAAO,QAAQ,UAAU;CAC/B,MAAM,WAAW,cAAc,QAAQ,QAAgC;CACvE,MAAM,OAAO,cAAc,CAAC,GAAG,QAAQ,UAAU,CAAC;CAClD,MAAM,OAAO,cAAc,CAAC,GAAG,QAAQ,UAAU,IAAI,CAAC;CACtD,MAAM,QACJ,SAAS,UACL,GAAG,QAAQ,SAAS,IAAI,QAAQ,UAAU,UAAU,mCACpD,GAAG,QAAQ,SAAS,IAAI,QAAQ,UAAU,UAAU;CAC1D,MAAM,YACJ,SAAS,UACL,qFACA,0EAA0E,KAAK,UAAU,QAAQ,UAAU,SAAS,EAAE,IAAI,KAAK;CAoBrI,OAAO;EAlBL;EACA,eAAe,QAAQ,SAAS,SAAS,OAAO,QAAQ,IAAI,EAAE,IAAI,QAAQ,UAAU;EACpF,yDAAyD,KAAK,UAAU,YAAY,EAAE;EACtF,GAAG,QAAQ;EACX;EACA;EACA,oBAAoB,SAAS;EAC7B,sBAAsB,KAAK;EAC3B;EACA,QAAQ,KAAK,UAAU,KAAK,EAAE;EAC9B,sBAAsB,QAAQ,SAAS;EACvC,yCAAyC,QAAQ,SAAS;EAC1D;EACA;EACA;EACA;EACA;CAES,CAAC,CAAC,KAAK,IAAI;AACxB;;ACjDA,SAAgB,WAAW,SAAkC;CAC3D,OAAO,cAAc;EACnB,eAAA;EACA,WAAW;EACF;CACX,CAAC;AACH;AAEA,SAAS,KAAK,GAAW,KAAqB;CAC5C,OAAO,EAAE,UAAU,MAAM,IAAI,GAAG,EAAE,MAA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X,IAAI,KACF,sBAAsB,QAAQ,SAAS,KAAK,kBAAkB,QAAQ,WAAW,KAAK,IAAI,GAC5F;GACA,IAAI,QAAQ,SAAS,OAAO,WAAW,GAAG,IAAI,KAAK,sBAAsB;GACzE,KAAK,MAAM,KAAK,QAAQ,SAAS,QAC/B,IAAI,KAAK,KAAK,EAAE,MAAM,MAAM,EAAE,WAAW,WAAW,EAAE,QAAQ,IAAI,EAAE,OAAO,GAAG,EAAE,GAAG,EAAE;GAEvF,IAAI,KACF,WAAW,QAAQ,OAAO,cAAc,gBAAgB,QAAQ,OAAO,cAAc,uBAAuB,QAAQ,OAAO,KAAK,QAClI;GACA,IAAI,KAAK,EAAE;GACX,IAAI,KAAK,QAAQ;GACjB,IAAI,KAAK,YAAY,QAAQ,OAAO,QAAQ,UAAU,QAAQ,CAAC;GAC/D;EAEF,KAAK,WAAW;GACd,MAAM,IAAI,QAAQ;GAClB,IAAI,KAAK,EAAE;GACX,IAAI,KAAK,mEAAmE;GAC5E,IAAI,KACF,4BAA4B,EAAE,gBAAgB,mBAAmB,EAAE,gBAAgB,6BAA6B,EAAE,yBAAyB,WAAW,EAAE,SAAS,IACnK;GACA;EACF;EACA,KAAK;GACH,IAAI,KAAK,EAAE;GACX,IAAI,KAAK,0CAA0C,QAAQ,MAAM,KAAK,QAAQ,QAAQ;CAG1F;CACA,IAAI,KAAK,EAAE;CACX,IAAI,KACF,aAAa,EAAE,KAAK,WAAW,EAAE,aAAa,oBAAoB,EAAE,eAAe,sBAAsB,EAAE,UAAU,IACvH;CACA,IAAI,KAAK,cAAc;CACvB,KAAK,MAAM,KAAK,QAAQ,aAAa,IAAI,KAAK,OAAO,GAAG;CACxD,OAAO,IAAI,KAAK,IAAI;AACtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-BGdIBGkN.mjs","names":[],"sources":["../../cli/src/args.ts","../../cli/src/generate.ts","../../cli/src/regression.ts","../../cli/src/check.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","/**\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.\n */\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 /** Import specifier of the scenario from the generated test (e.g. \"../scenario.sim.ts\"). */\n readonly scenarioImport: string;\n}\n\n/** What the generated test stores in its task meta. */\nexport interface CheckTransport {\n readonly report: unknown;\n readonly worker: { readonly entry: string; readonly config: string };\n readonly setup: readonly { readonly kind: string; readonly [key: string]: unknown }[];\n}\n\nexport function checkTestSource(g: GeneratedCheck): string {\n const maxRuns = g.maxRuns === undefined ? \"\" : `, maxRuns: ${g.maxRuns}`;\n return `// Generated by eutaxy check; deleted after the run.\nimport { renderJson } from \"eutaxy\";\nimport { check, createCloudflarePlatform, type QueueHandler } from \"eutaxy/cloudflare\";\nimport { env } from \"cloudflare:workers\";\nimport { test } from \"vitest\";\nimport scenario from ${JSON.stringify(g.scenarioImport)};\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/**\"]) as Record<string, () => Promise<{ default: QueueHandler }>>;\n\nfunction key(path: string): string {\n return \\`../\\${path.replace(/^\\\\.\\\\//, \"\")}\\`;\n}\n\ntest(\"eutaxy check\", async ({ task }) => {\n const schemas: Record<string, string> = {};\n for (const step of scenario.setup) {\n if (step.kind !== \"d1\") continue;\n const sql = sqlFiles[key(String(step.schemaFile))];\n if (sql === undefined) throw new Error(\\`schema file \\${String(step.schemaFile)} not found next to the scenario\\`);\n schemas[String(step.binding)] = sql;\n }\n const load = modules[key(scenario.worker.entry)];\n if (!load) throw new Error(\\`worker entry \\${scenario.worker.entry} not found next to the scenario\\`);\n const handler = (await load()).default;\n const platform = createCloudflarePlatform({ env, handler, schemas });\n const verdict = await check(scenario, platform, { seed: ${JSON.stringify(g.seed)}${maxRuns} });\n task.meta[${JSON.stringify(metaKey)}] = { report: JSON.parse(renderJson(verdict)), worker: scenario.worker, setup: scenario.setup };\n});\n`;\n}\n\nexport function vitestConfigSource(\n wranglerConfigPath: string,\n testPath: string,\n outputFile: string,\n): string {\n return `// Generated by eutaxy check; deleted after the run.\nimport { cloudflareTest } from \"@cloudflare/vitest-plugin\";\nimport { defineConfig } from \"vitest/config\";\n\nexport default defineConfig({\n plugins: [cloudflareTest({ wrangler: { configPath: ${JSON.stringify(wranglerConfigPath)} } })],\n test: {\n include: [${JSON.stringify(testPath)}],\n testTimeout: 600_000,\n reporters: [\"json\"],\n outputFile: ${JSON.stringify(outputFile)},\n },\n});\n`;\n}\n","import type { Violated } from \"@eutaxy/core\";\nimport { emitRegressionTest } from \"@eutaxy/report\";\n\nexport interface CloudflareRegressionOptions {\n /** Import path of the scenario module, relative to the emitted file. */\n readonly scenarioPath: string;\n /** Import path of the Worker module. */\n readonly workerPath: string;\n /** D1 binding name to schema file path, imported with `?raw`. */\n readonly schemaPaths: Readonly<Record<string, string>>;\n /** The platform's retry limit, when the scenario was checked with a non-default one. */\n readonly maxRetries?: number;\n readonly expect?: \"holds\" | \"violates\";\n readonly engineModule?: string;\n}\n\n/** A Vitest regression test for a Cloudflare scenario, to run under the Cloudflare Vitest plugin. */\nexport function cloudflareRegressionTest(\n verdict: Violated,\n options: CloudflareRegressionOptions,\n): string {\n const bindings = Object.keys(options.schemaPaths).sort();\n const imports = [\n 'import { createCloudflarePlatform } from \"eutaxy/cloudflare\";',\n 'import { env } from \"cloudflare:workers\";',\n `import scenario from ${JSON.stringify(options.scenarioPath)};`,\n ...bindings.map(\n (b) => `import schema_${b} from ${JSON.stringify(`${options.schemaPaths[b]}?raw`)};`,\n ),\n `import handler from ${JSON.stringify(options.workerPath)};`,\n ];\n const schemas = `{ ${bindings.map((b) => `${b}: schema_${b}`).join(\", \")} }`;\n const retries = options.maxRetries === undefined ? \"\" : `, maxRetries: ${options.maxRetries}`;\n return emitRegressionTest(verdict, {\n imports,\n platform: `createCloudflarePlatform({ env, handler, schemas: ${schemas}${retries} })`,\n scenario: \"scenario\",\n ...(options.expect ? { expect: options.expect } : {}),\n ...(options.engineModule ? { engineModule: options.engineModule } : {}),\n });\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 { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { basename, dirname, join, relative, resolve } from \"node:path\";\nimport { canonicalJson, type JsonValue, type ScenarioVerdict, type Violated } from \"@eutaxy/core\";\nimport { renderText } from \"@eutaxy/report\";\nimport { type CheckTransport, checkTestSource, metaKey, vitestConfigSource } from \"./generate.ts\";\nimport { cloudflareRegressionTest } from \"./regression.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 readonly json: boolean;\n /** Where to write the regression test on a violation; default `<name>.regression.test.ts` beside the scenario. */\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 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\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/** 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\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 const dir = dirname(scenarioPath);\n const name = basename(scenarioPath)\n .replace(/\\.sim\\.ts$/, \"\")\n .replace(/\\.ts$/, \"\");\n const wrangler = findWrangler(dir, o.wrangler, o.cwd);\n if (!wrangler || !existsSync(wrangler)) {\n o.stderr(`no wrangler config found next to the scenario; pass --wrangler <path>\\n`);\n return exitCodes.error;\n }\n const workDir = join(dir, \".eutaxy\");\n const testPath = join(workDir, `${name}.check.test.ts`);\n const configPath = join(workDir, \"vitest.config.mts\");\n mkdirSync(workDir, { recursive: true });\n try {\n writeFileSync(\n testPath,\n checkTestSource({\n seed: o.seed ?? name,\n ...(o.maxRuns === undefined ? {} : { maxRuns: o.maxRuns }),\n scenarioImport: `../${basename(scenarioPath)}`,\n }),\n );\n const reportPath = join(workDir, \"vitest-report.json\");\n rmSync(reportPath, { force: true }); // never read a report left by an earlier --keep run\n writeFileSync(configPath, vitestConfigSource(wrangler, testPath, reportPath));\n const { code, output } = await runVitest(vitestBin(dir), configPath, dir);\n const transport = code === 0 ? readTransport(reportPath) : null;\n if (!transport) {\n o.stderr(`eutaxy check could not read a verdict from Vitest (exit ${code}):\\n${output}\\n`);\n return exitCodes.error;\n }\n const report = transport.report as { verdict: ScenarioVerdict };\n const verdict = report.verdict;\n if (o.json) o.stdout(`${canonicalJson(transport.report as JsonValue)}\\n`);\n else o.stdout(`${renderText(verdict)}\\n`);\n\n if (verdict.kind === \"VIOLATED\" && !o.noRegression) {\n const outPath = o.out ? resolve(o.cwd, o.out) : join(dir, `${name}.regression.test.ts`);\n const outDir = dirname(outPath);\n const schemaPaths: Record<string, string> = {};\n for (const step of transport.setup) {\n if (step.kind === \"d1\") {\n schemaPaths[String(step[\"binding\"])] = toPosix(\n relative(outDir, resolve(dir, String(step[\"schemaFile\"]))),\n );\n }\n }\n const source = cloudflareRegressionTest(verdict as Violated, {\n scenarioPath: toPosix(relative(outDir, scenarioPath)),\n workerPath: toPosix(relative(outDir, resolve(dir, transport.worker.entry))),\n schemaPaths,\n ...(o.expectViolation ? { expect: \"violates\" as const } : {}),\n });\n mkdirSync(outDir, { recursive: true });\n writeFileSync(outPath, source);\n if (!o.json)\n o.stdout(`\\nRegression test written to ${relative(o.cwd, outPath) || outPath}\\n`);\n }\n return exitCodes[verdict.kind];\n } finally {\n if (!o.keep) rmSync(workDir, { recursive: true, force: true });\n }\n}\n","import { parseArgs } from \"./args.ts\";\nimport { exitCodes, runCheck } from \"./check.ts\";\n\nconst usage = `eutaxy — deterministic simulation checks for Cloudflare Workers\n\nUsage:\n eutaxy check <scenario.sim.ts> [options]\n\nOptions:\n --wrangler <path> wrangler config (default: 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 --json print the versioned JSON report instead of text\n --out <path> where to write the regression test on a violation\n --no-regression do not write a regression test\n --expect-violation write a regression test that asserts the violation (for corpora)\n --keep keep the generated .eutaxy/ files\n\nExit codes: 0 BOUNDED, 1 VIOLATED, 2 UNSUPPORTED, 3 error.\n`;\n\nexport interface Io {\n readonly cwd: string;\n readonly stdout: (text: string) => void;\n readonly stderr: (text: string) => void;\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 \"help\",\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 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 const str = (k: string): string | undefined =>\n typeof flags[k] === \"string\" ? (flags[k] as string) : undefined;\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 return runCheck({\n scenario,\n cwd: io.cwd,\n ...(str(\"wrangler\") ? { wrangler: str(\"wrangler\") as string } : {}),\n ...(str(\"seed\") ? { seed: str(\"seed\") as string } : {}),\n ...(maxRuns === undefined ? {} : { maxRuns }),\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 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,I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