eutaxy 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -6
- package/dist/aws.d.mts +28 -2
- package/dist/aws.d.mts.map +1 -1
- package/dist/aws.mjs +13 -2
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{cli-BppjMaqL.mjs → cli-DT4lxaPK.mjs} +863 -89
- package/dist/cli-DT4lxaPK.mjs.map +1 -0
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cloudflare.d.mts +79 -8
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +2 -2
- package/dist/{combinators-Bsd9HKtw.d.mts → combinators-BecOKcmi.d.mts} +7 -1
- package/dist/combinators-BecOKcmi.d.mts.map +1 -0
- package/dist/{combinators-CVjxodAJ.mjs → combinators-CLfsPfhT.mjs} +6 -1
- package/dist/combinators-CLfsPfhT.mjs.map +1 -0
- package/dist/{delivery-invariants-_T9ZMwOJ.mjs → delivery-invariants-Dr658H1W.mjs} +7 -2
- package/dist/delivery-invariants-Dr658H1W.mjs.map +1 -0
- package/dist/delivery-invariants-DzMy3iPs.d.mts +10 -0
- package/dist/delivery-invariants-DzMy3iPs.d.mts.map +1 -0
- package/dist/{explore-B7aR_5Hy.d.mts → explore-B52m-wmk.d.mts} +13 -2
- package/dist/explore-B52m-wmk.d.mts.map +1 -0
- package/dist/index.d.mts +25 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{platform-CCz48WF9.d.mts → platform-Ba1Kvdza.d.mts} +18 -1
- package/dist/platform-Ba1Kvdza.d.mts.map +1 -0
- package/dist/provers-DS44OeEm.mjs.map +1 -1
- package/dist/spec.d.mts +1 -1
- package/dist/spec.mjs +1 -1
- package/dist/{src-DPCF2XGv.mjs → src-CPuihHZh.mjs} +225 -238
- package/dist/src-CPuihHZh.mjs.map +1 -0
- package/dist/{src-ClXnIi6O.mjs → src-wa0JZa-T.mjs} +9 -3
- package/dist/src-wa0JZa-T.mjs.map +1 -0
- package/dist/{workerd-DVJ8eCLI.mjs → workerd-DvhVDnQW.mjs} +170 -42
- package/dist/workerd-DvhVDnQW.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/cli-BppjMaqL.mjs.map +0 -1
- package/dist/combinators-Bsd9HKtw.d.mts.map +0 -1
- package/dist/combinators-CVjxodAJ.mjs.map +0 -1
- package/dist/delivery-invariants-DZOBkCMR.d.mts +0 -5
- package/dist/delivery-invariants-DZOBkCMR.d.mts.map +0 -1
- package/dist/delivery-invariants-_T9ZMwOJ.mjs.map +0 -1
- package/dist/explore-B7aR_5Hy.d.mts.map +0 -1
- package/dist/platform-CCz48WF9.d.mts.map +0 -1
- package/dist/src-ClXnIi6O.mjs.map +0 -1
- package/dist/src-DPCF2XGv.mjs.map +0 -1
- package/dist/workerd-DVJ8eCLI.mjs.map +0 -1
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/spec-verdict.ts"],"sourcesContent":["/**\n * Spec verdicts: what is known about one property of one pure function.\n * Kept apart from scenario verdicts in every report. The ladder runs\n * `CHECKED` (held on every input the simulator passed), then `TESTED` (held\n * on inputs generated from the binders' domains), then `PROVEN` (an engine\n * proved it for every input); `CONFLICT` when engines disagree.\n */\n\ninterface SpecVerdictBase {\n /** The module, as the scenario names it. */\n readonly module: string;\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n /** The property as written. */\n readonly text: string;\n readonly assumptions: readonly string[];\n}\n\nexport interface Checked extends SpecVerdictBase {\n readonly kind: \"CHECKED\";\n /** Distinct inputs the property was evaluated on. */\n readonly inputs: number;\n /** Distinct inputs outside the claim: a precondition failed, or a value fell outside its binder's domain. */\n readonly discarded: number;\n}\n\n/** The property held on inputs generated from its binders' domains, and on the simulator's where it passed any. */\nexport interface Tested extends SpecVerdictBase {\n readonly kind: \"TESTED\";\n /** Generated assignments the property held on. */\n readonly inputs: number;\n /** Generated assignments outside the claim: a precondition failed. */\n readonly discarded: number;\n /** The seed the assignments were drawn from; the same seed draws the same assignments. */\n readonly seed: string;\n /** Distinct inputs the simulator passed that the property also held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** One assignment that breaks the property, as JavaScript literals, and where it came from. */\nexport interface Counterexample {\n /** In the property's binder order. */\n readonly binders: readonly { readonly name: string; readonly value: string }[];\n /** The simulator's call the assignment was taken from; absent when it was generated. */\n readonly call?: string;\n /** Set when evaluating the property threw instead of returning false. */\n readonly error?: string;\n}\n\nexport interface Refuted extends SpecVerdictBase {\n readonly kind: \"REFUTED\";\n /** The rung that found the counterexample: a rung of the simulator, or an engine by name. */\n readonly rung: \"CHECKED\" | \"TESTED\" | \"PROVEN\";\n /** The engine, when the rung is PROVEN. */\n readonly engine?: { readonly name: string; readonly version: string };\n readonly counterexample: Counterexample;\n}\n\n/** Proved for every input by a named engine; the lower rungs' evidence is kept beside it. */\nexport interface Proven extends SpecVerdictBase {\n readonly kind: \"PROVEN\";\n readonly engine: { readonly name: string; readonly version: string };\n /** Generated inputs the TESTED rung held on, when it ran. */\n readonly tested?: number;\n /** Distinct inputs the simulator passed that the CHECKED rung held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** Two engines disagree: one proves, one refutes. Never resolved automatically. */\nexport interface Conflict extends SpecVerdictBase {\n readonly kind: \"CONFLICT\";\n readonly proven: { readonly name: string; readonly version: string };\n readonly refuted: {\n readonly name: string;\n readonly version: string;\n readonly counterexample?: Counterexample;\n };\n}\n\nexport type SpecUnknownCause = \"gave_up\" | \"unsupported\" | \"unavailable\";\n\nexport interface SpecUnknown extends SpecVerdictBase {\n readonly kind: \"UNKNOWN\";\n readonly cause: SpecUnknownCause;\n readonly reason: string;\n}\n\nexport type SpecVerdict = Checked | Tested | Proven | Refuted | Conflict | SpecUnknown;\n\n/** One line per spec verdict, for error messages; full rendering lives in `report`. */\nexport function describeSpecVerdict(v: SpecVerdict): string {\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n return `CHECKED ${what}: held on ${v.inputs} input(s) the simulator passed`;\n case \"TESTED\":\n return `TESTED ${what}: held on ${v.inputs} generated input(s)`;\n case \"PROVEN\":\n return `PROVEN ${what}: by ${v.engine.name} ${v.engine.version}`;\n case \"CONFLICT\":\n return `CONFLICT ${what}: ${v.proven.name} proves it, ${v.refuted.name} refutes it`;\n case \"REFUTED\": {\n const c = v.counterexample;\n const where = c.call ?? c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \");\n return `REFUTED ${what}: ${where}${c.error ? ` threw ${c.error}` : \"\"}`;\n }\n case \"UNKNOWN\":\n return `UNKNOWN ${what}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../core/src/spec-verdict.ts"],"sourcesContent":["/**\n * Spec verdicts: what is known about one property of one pure function.\n * Kept apart from scenario verdicts in every report. The ladder runs\n * `CHECKED` (held on every input the simulator passed), then `TESTED` (held\n * on inputs generated from the binders' domains), then `PROVEN` (an engine\n * proved it for every input); `CONFLICT` when engines disagree.\n */\n\ninterface SpecVerdictBase {\n /** The module, as the scenario names it. */\n readonly module: string;\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n /** The property as written. */\n readonly text: string;\n readonly assumptions: readonly string[];\n}\n\n/** The property held on every distinct input the simulator passed the function during the scenario's runs. */\nexport interface Checked extends SpecVerdictBase {\n readonly kind: \"CHECKED\";\n /** Distinct inputs the property was evaluated on. */\n readonly inputs: number;\n /** Distinct inputs outside the claim: a precondition failed, or a value fell outside its binder's domain. */\n readonly discarded: number;\n}\n\n/** The property held on inputs generated from its binders' domains, and on the simulator's where it passed any. */\nexport interface Tested extends SpecVerdictBase {\n readonly kind: \"TESTED\";\n /** Generated assignments the property held on. */\n readonly inputs: number;\n /** Generated assignments outside the claim: a precondition failed. */\n readonly discarded: number;\n /** The seed the assignments were drawn from; the same seed draws the same assignments. */\n readonly seed: string;\n /** Distinct inputs the simulator passed that the property also held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** One assignment that breaks the property, as JavaScript literals, and where it came from. */\nexport interface Counterexample {\n /** In the property's binder order. */\n readonly binders: readonly { readonly name: string; readonly value: string }[];\n /** The simulator's call the assignment was taken from; absent when it was generated. */\n readonly call?: string;\n /** Set when evaluating the property threw instead of returning false. */\n readonly error?: string;\n}\n\n/** A counterexample breaks the property, found by the simulator's inputs, generated ones, or an engine. */\nexport interface Refuted extends SpecVerdictBase {\n readonly kind: \"REFUTED\";\n /** The rung that found the counterexample: a rung of the simulator, or an engine by name. */\n readonly rung: \"CHECKED\" | \"TESTED\" | \"PROVEN\";\n /** The engine, when the rung is PROVEN. */\n readonly engine?: { readonly name: string; readonly version: string };\n readonly counterexample: Counterexample;\n}\n\n/** Proved for every input by a named engine; the lower rungs' evidence is kept beside it. */\nexport interface Proven extends SpecVerdictBase {\n readonly kind: \"PROVEN\";\n readonly engine: { readonly name: string; readonly version: string };\n /** Generated inputs the TESTED rung held on, when it ran. */\n readonly tested?: number;\n /** Distinct inputs the simulator passed that the CHECKED rung held on, when it passed any. */\n readonly checked?: number;\n}\n\n/** Two engines disagree: one proves, one refutes. Never resolved automatically. */\nexport interface Conflict extends SpecVerdictBase {\n readonly kind: \"CONFLICT\";\n readonly proven: { readonly name: string; readonly version: string };\n readonly refuted: {\n readonly name: string;\n readonly version: string;\n readonly counterexample?: Counterexample;\n };\n}\n\nexport type SpecUnknownCause = \"gave_up\" | \"unsupported\" | \"unavailable\";\n\n/** Nothing is known about the property: the engine gave up, the construct is not supported, or no engine was available. */\nexport interface SpecUnknown extends SpecVerdictBase {\n readonly kind: \"UNKNOWN\";\n readonly cause: SpecUnknownCause;\n readonly reason: string;\n}\n\n/** What is known about one property of one pure function, from the highest rung that reached it. */\nexport type SpecVerdict = Checked | Tested | Proven | Refuted | Conflict | SpecUnknown;\n\n/** One line per spec verdict, for error messages; full rendering lives in `report`. */\nexport function describeSpecVerdict(v: SpecVerdict): string {\n const what = `${v.function} ${v.property}`;\n switch (v.kind) {\n case \"CHECKED\":\n return `CHECKED ${what}: held on ${v.inputs} input(s) the simulator passed`;\n case \"TESTED\":\n return `TESTED ${what}: held on ${v.inputs} generated input(s)`;\n case \"PROVEN\":\n return `PROVEN ${what}: by ${v.engine.name} ${v.engine.version}`;\n case \"CONFLICT\":\n return `CONFLICT ${what}: ${v.proven.name} proves it, ${v.refuted.name} refutes it`;\n case \"REFUTED\": {\n const c = v.counterexample;\n const where = c.call ?? c.binders.map((b) => `${b.name} = ${b.value}`).join(\", \");\n return `REFUTED ${what}: ${where}${c.error ? ` threw ${c.error}` : \"\"}`;\n }\n case \"UNKNOWN\":\n return `UNKNOWN ${what}: ${v.cause}: ${v.reason}`;\n }\n}\n"],"mappings":";;;;;AA+FA,SAAgB,oBAAoB,GAAwB;CAC1D,MAAM,OAAO,GAAG,EAAE,SAAS,GAAG,EAAE;CAChC,QAAQ,EAAE,MAAV;EACE,KAAK,WACH,OAAO,WAAW,KAAK,YAAY,EAAE,OAAO;EAC9C,KAAK,UACH,OAAO,UAAU,KAAK,YAAY,EAAE,OAAO;EAC7C,KAAK,UACH,OAAO,UAAU,KAAK,OAAO,EAAE,OAAO,KAAK,GAAG,EAAE,OAAO;EACzD,KAAK,YACH,OAAO,YAAY,KAAK,IAAI,EAAE,OAAO,KAAK,cAAc,EAAE,QAAQ,KAAK;EACzE,KAAK,WAAW;GACd,MAAM,IAAI,EAAE;GAEZ,OAAO,WAAW,KAAK,IADT,EAAE,QAAQ,EAAE,QAAQ,KAAK,MAAM,GAAG,EAAE,KAAK,KAAK,EAAE,OAAO,CAAC,CAAC,KAAK,IAAI,IAC7C,EAAE,QAAQ,UAAU,EAAE,UAAU;EACrE;EACA,KAAK,WACH,OAAO,WAAW,KAAK,IAAI,EAAE,MAAM,IAAI,EAAE;CAC7C;AACF"}
|
|
@@ -12,6 +12,7 @@ type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
|
12
12
|
* offer it at the point where that work would start.
|
|
13
13
|
*/
|
|
14
14
|
type FaultKind = "crash_before" | "crash_after" | "ambiguous" | "error" | "cut_off";
|
|
15
|
+
/** One injected fault: which effect of which invocation it hit, and what kind of fault it was. */
|
|
15
16
|
interface FaultDecision {
|
|
16
17
|
/** The invocation the effect belongs to, e.g. "msg-1#2". */
|
|
17
18
|
readonly invocation: string;
|
|
@@ -22,6 +23,7 @@ interface FaultDecision {
|
|
|
22
23
|
readonly target: string;
|
|
23
24
|
readonly op: string;
|
|
24
25
|
}
|
|
26
|
+
/** What decided one run: the seed it drew from, the faults injected, and the turns picked when they were picked. */
|
|
25
27
|
interface Schedule {
|
|
26
28
|
/** The per-run seed the decisions were drawn from. */
|
|
27
29
|
readonly seed: number;
|
|
@@ -36,6 +38,7 @@ interface Schedule {
|
|
|
36
38
|
}
|
|
37
39
|
/** `snapshot` records platform state (e.g. D1 tables) captured at the end of a run; it is not an effect point. */
|
|
38
40
|
type EffectKind = "call" | "result" | "fault" | "snapshot";
|
|
41
|
+
/** One entry of the effect log: an effect's call, its result, an injected fault, or an end-of-run snapshot. */
|
|
39
42
|
interface EffectRecord {
|
|
40
43
|
/** Position in the log, dense from 0. */
|
|
41
44
|
readonly seq: number;
|
|
@@ -49,6 +52,7 @@ interface EffectRecord {
|
|
|
49
52
|
/** Operation-specific data: arguments, results, or the injected fault. */
|
|
50
53
|
readonly payload: JsonValue;
|
|
51
54
|
}
|
|
55
|
+
/** The ordered record of what a run did at its effect boundaries, which invariants are checked against. */
|
|
52
56
|
interface EffectLog {
|
|
53
57
|
readonly entries: readonly EffectRecord[];
|
|
54
58
|
}
|
|
@@ -185,7 +189,9 @@ interface AtLeastOnce {
|
|
|
185
189
|
readonly bodyKey: string;
|
|
186
190
|
};
|
|
187
191
|
}
|
|
192
|
+
/** Anything a scenario says must hold after every run, over the effect log or the end-of-run state. */
|
|
188
193
|
type Invariant = AtMostOncePerKey | AtLeastOnce | EveryRow | Implies | Unique | References | Refines;
|
|
194
|
+
/** An invariant that did not hold: its name, what went wrong, the keys involved and the effects that show it. */
|
|
189
195
|
interface Violation {
|
|
190
196
|
readonly invariant: string;
|
|
191
197
|
readonly message: string;
|
|
@@ -194,7 +200,9 @@ interface Violation {
|
|
|
194
200
|
/** Sequence numbers of the effects that witness the violation. */
|
|
195
201
|
readonly evidence: readonly number[];
|
|
196
202
|
}
|
|
203
|
+
/** Check one invariant against a run's effect log; null when it holds. */
|
|
197
204
|
declare function checkInvariant(log: EffectLog, inv: Invariant): Violation | null;
|
|
205
|
+
/** Check every invariant against a run's effect log and return the violations, in the invariants' order. */
|
|
198
206
|
declare function checkInvariants(log: EffectLog, invariants: readonly Invariant[]): readonly Violation[];
|
|
199
207
|
/** Opaque, JSON-shaped data owned by a platform package. `kind` names its shape. */
|
|
200
208
|
interface PlatformData {
|
|
@@ -246,6 +254,10 @@ interface Bounds {
|
|
|
246
254
|
readonly maxConcurrentInvocations: number;
|
|
247
255
|
readonly budgetMs: number;
|
|
248
256
|
}
|
|
257
|
+
/**
|
|
258
|
+
* A scenario as plain data: the Worker, the drive, the setup, the externals, the invariants and the
|
|
259
|
+
* bounds, which `defineScenario` (or a platform's equivalent) builds and validates.
|
|
260
|
+
*/
|
|
249
261
|
interface ScenarioSpec {
|
|
250
262
|
readonly version: 1;
|
|
251
263
|
readonly name: string;
|
|
@@ -380,6 +392,11 @@ interface DeliveryResult {
|
|
|
380
392
|
/** Events the platform's semantics require next, e.g. redeliveries. */
|
|
381
393
|
readonly followUps: readonly EventRef[];
|
|
382
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* What a platform package gives the engine to run a scenario: its events, how each is delivered to the
|
|
397
|
+
* Worker or function, how state is reset before a run and snapshotted after it, and the assumptions a
|
|
398
|
+
* verdict rests on.
|
|
399
|
+
*/
|
|
383
400
|
interface Platform {
|
|
384
401
|
readonly name: string;
|
|
385
402
|
/** What a verdict rests on that this platform decides, one line each. */
|
|
@@ -405,4 +422,4 @@ interface Platform {
|
|
|
405
422
|
cleanup?(spec: ScenarioSpec): Promise<void>;
|
|
406
423
|
}
|
|
407
424
|
export { EffectSelector as C, FaultKind as D, FaultDecision as E, Schedule as O, Refines as S, EffectRecord as T, Implies as _, PlatformData as a, StateQuery as b, WorkerRef as c, AtMostOncePerKey as d, Invariant as f, EveryRow as g, checkInvariants as h, ExternalDecl as i, JsonValue as k, validateScenario as l, checkInvariant as m, Platform as n, ScenarioSpec as o, Violation as p, Bounds as r, ScriptedResponse as s, EventRef as t, AtLeastOnce as u, References as v, EffectLog as w, Unique as x, RowCondition as y };
|
|
408
|
-
//# sourceMappingURL=platform-
|
|
425
|
+
//# sourceMappingURL=platform-Ba1Kvdza.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-Ba1Kvdza.d.mts","names":[],"sources":["../../core/src/canonical-json.ts","../../core/src/faults.ts","../../core/src/effect-log.ts","../../core/src/selectors.ts","../../core/src/refines.ts","../../core/src/state.ts","../../core/src/invariants.ts","../../core/src/scenario.ts","../../core/src/platform.ts"],"mappings":";;;;;KAMY,wDAKC;YACG,cAAc;;;;;;;KCAlB;;UAoBK;;WAEN;;WAEA;WACA,OAAO;;WAEP;WACA;;;UAIM;;WAEN;WACA,iBAAiB;;;;;;;WAOjB;;;KC3CC;;UAGK;;WAEN;WACA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;;UAIH;WACN,kBAAkB;;;UCxBZ;WACN;WACA;WACA,OAAO;;WAEP;cAAoB,eAAe;;;WAEnC;cAAsB;;;;;;;;;;;;;;UCYhB;WACN;WACA;;WAEA;WACA,QAAQ;WACR;aAA8B;aAAyB;;WACvD;aACE,MAAM;aACN,OAAO;;aAEP;;;;KC5BD;WACG;WAAyB;WAA2B,OAAO;;WAC3D;WAAyB;WAA0C;;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AAa,eAAe,GAAG,YAAY,OAAO,MAAM,YAAY;;EAEzF,YAAY;;;;;;EAMZ;;;;;;;EAOA,QAAQ,OAAO;;EAEf,SAAS,oBAAoB,gBAAgB,SAAS;;;;;;;EAOtD,OAAO,GAAG,SAAS,QAAQ,IAAI,qBAAqB,QAAQ;;UAG7C;WACN;;WAEA,oBAAoB;;;;;;;UAQd;WACN;;WAEA;;;;;;;WAOA;;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provers-DS44OeEm.mjs","names":[],"sources":["../../prover/src/provers.ts"],"sourcesContent":["/**\n * The `Prover` interface every engine implements, first-party or not, and\n * the aggregation of what engines say into the ladder's verdicts. An\n * engine takes a module's source with its specs and the functions to\n * prove and answers per property: `PROVEN` with its name, version and\n * assumptions, or `UNKNOWN` as `gave_up` (a proof did not close, or timed\n * out), `unsupported` (outside its subset) or `unavailable` (not\n * installed). An engine that refutes gives `REFUTED` with a counterexample\n * when it has one. Engines run over a process boundary; nothing here\n * spawns anything.\n */\n\nimport type { Counterexample, SpecVerdict } from \"@eutaxy/core\";\nimport type { ModuleSpecs, SpecError } from \"@eutaxy/spec\";\n\nexport interface EngineId {\n readonly name: string;\n readonly version: string;\n}\n\nexport type ProofOutcome =\n | { readonly kind: \"PROVEN\"; readonly engine: EngineId; readonly assumptions: readonly string[] }\n | {\n readonly kind: \"REFUTED\";\n readonly engine: EngineId;\n readonly counterexample?: Counterexample;\n readonly assumptions: readonly string[];\n }\n | {\n readonly kind: \"UNKNOWN\";\n readonly cause: \"gave_up\" | \"unsupported\" | \"unavailable\";\n readonly reason: string;\n };\n\nexport interface PropertyProof {\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n readonly outcome: ProofOutcome;\n}\n\n/** A property an engine gave up on, with the statement it tried to prove, for a proof to be supplied. */\nexport interface OpenGoal {\n readonly function: string;\n readonly property: string;\n /** The statement in the engine's language, as it emitted it. */\n readonly statement: string;\n /** Why the engine gave up: its own words, first line. */\n readonly reason: string;\n}\n\nexport interface ModuleProofs {\n readonly results: readonly PropertyProof[];\n /** Specs that did not read: properties asked for and never checked. */\n readonly specErrors: readonly SpecError[];\n /**\n * The properties given up on that a supplied proof could close, when the engine takes supplied proofs\n * and answered (empty when it closed every one; absent when it could not run or finish).\n */\n readonly goals?: readonly OpenGoal[];\n}\n\nexport interface ProveInput {\n /** The module's source text. */\n readonly source: string;\n /** The module's specs, read from its spec file. */\n readonly specs: ModuleSpecs;\n /** The functions to prove; every one with specs when omitted. */\n readonly functions?: readonly string[];\n /** The module's path, under which its imports resolve; without it the module stands alone. */\n readonly modulePath?: string;\n /** The spec file's path, for an engine that replays a counterexample through the spec itself. */\n readonly specPath?: string;\n readonly timeoutMs?: number;\n}\n\nexport interface Prover {\n readonly name: string;\n /** Whether the engine can run here, or why not. */\n available(): Promise<{ readonly version: string } | { readonly unavailable: string }>;\n prove(input: ProveInput): Promise<ModuleProofs>;\n}\n\n/** What an engine said about one module, by its name. */\nexport interface EngineReport {\n readonly engine: string;\n readonly proofs: ModuleProofs;\n}\n\n/**\n * The simulator's verdicts for a module (CHECKED, TESTED, REFUTED, UNKNOWN,\n * `total` included) combined with what the engines proved. A simulator\n * counterexample stands. One engine proving is `PROVEN`, the lower rungs'\n * counts kept beside it; an engine refuting where nothing else did is\n * `REFUTED` at the PROVEN rung; one proving and another refuting is\n * `CONFLICT`. An engine that gave up, could not run or does not take the\n * function leaves the verdict as it was, with why among the assumptions.\n */\nexport function aggregate(\n module: string,\n verdicts: readonly SpecVerdict[],\n reports: readonly EngineReport[],\n): SpecVerdict[] {\n return verdicts.map((v) => {\n if (v.module !== module) return v;\n const says = reports\n .map((r) => ({\n engine: r.engine,\n outcome: r.proofs.results.find(\n (p) => p.function === v.function && p.property === v.property,\n )?.outcome,\n }))\n .filter((x): x is { engine: string; outcome: ProofOutcome } => x.outcome !== undefined);\n if (says.length === 0) return v;\n const proven = says.find((x) => x.outcome.kind === \"PROVEN\");\n const refuted = says.find((x) => x.outcome.kind === \"REFUTED\");\n if (v.kind === \"REFUTED\" || v.kind === \"CONFLICT\") {\n // The simulator's counterexample is a fact; an engine proving against it is a conflict too.\n if (v.kind === \"REFUTED\" && proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: { name: \"simulator\", version: v.rung, counterexample: v.counterexample },\n assumptions: [...v.assumptions, ...proven.outcome.assumptions],\n };\n return v;\n }\n if (proven?.outcome.kind === \"PROVEN\" && refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: {\n name: refuted.outcome.engine.name,\n version: refuted.outcome.engine.version,\n ...(refuted.outcome.counterexample\n ? { counterexample: refuted.outcome.counterexample }\n : {}),\n },\n assumptions: [...proven.outcome.assumptions, ...refuted.outcome.assumptions],\n };\n if (refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"REFUTED\",\n rung: \"PROVEN\",\n engine: refuted.outcome.engine,\n counterexample: refuted.outcome.counterexample ?? { binders: [] },\n assumptions: refuted.outcome.assumptions,\n };\n if (proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"PROVEN\",\n engine: proven.outcome.engine,\n ...(v.kind === \"TESTED\" ? { tested: v.inputs } : {}),\n ...(v.kind === \"TESTED\" && v.checked !== undefined\n ? { checked: v.checked }\n : v.kind === \"CHECKED\"\n ? { checked: v.inputs }\n : {}),\n assumptions: [...proven.outcome.assumptions, ...v.assumptions],\n };\n // Every engine fell short: say so beside the verdict that stands.\n const notes = says.map((x) =>\n x.outcome.kind === \"UNKNOWN\"\n ? `not PROVEN by ${x.engine}: ${x.outcome.cause}: ${x.outcome.reason}`\n : `${x.engine}: ${x.outcome.kind}`,\n );\n return { ...v, assumptions: [...v.assumptions, ...notes] };\n });\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"provers-DS44OeEm.mjs","names":[],"sources":["../../prover/src/provers.ts"],"sourcesContent":["/**\n * The `Prover` interface every engine implements, first-party or not, and\n * the aggregation of what engines say into the ladder's verdicts. An\n * engine takes a module's source with its specs and the functions to\n * prove and answers per property: `PROVEN` with its name, version and\n * assumptions, or `UNKNOWN` as `gave_up` (a proof did not close, or timed\n * out), `unsupported` (outside its subset) or `unavailable` (not\n * installed). An engine that refutes gives `REFUTED` with a counterexample\n * when it has one. Engines run over a process boundary; nothing here\n * spawns anything.\n */\n\nimport type { Counterexample, SpecVerdict } from \"@eutaxy/core\";\nimport type { ModuleSpecs, SpecError } from \"@eutaxy/spec\";\n\n/** A proof engine's name and version, as verdicts record it. */\nexport interface EngineId {\n readonly name: string;\n readonly version: string;\n}\n\n/** What an engine said about one property: proven, refuted (with a counterexample when it has one), or unknown and why. */\nexport type ProofOutcome =\n | { readonly kind: \"PROVEN\"; readonly engine: EngineId; readonly assumptions: readonly string[] }\n | {\n readonly kind: \"REFUTED\";\n readonly engine: EngineId;\n readonly counterexample?: Counterexample;\n readonly assumptions: readonly string[];\n }\n | {\n readonly kind: \"UNKNOWN\";\n readonly cause: \"gave_up\" | \"unsupported\" | \"unavailable\";\n readonly reason: string;\n };\n\n/** An engine's outcome for one property of one function. */\nexport interface PropertyProof {\n readonly function: string;\n /** The property's export name in the spec file. */\n readonly property: string;\n readonly outcome: ProofOutcome;\n}\n\n/** A property an engine gave up on, with the statement it tried to prove, for a proof to be supplied. */\nexport interface OpenGoal {\n readonly function: string;\n readonly property: string;\n /** The statement in the engine's language, as it emitted it. */\n readonly statement: string;\n /** Why the engine gave up: its own words, first line. */\n readonly reason: string;\n}\n\n/** An engine's answer for one module: an outcome per property, the specs that did not read, and the open goals. */\nexport interface ModuleProofs {\n readonly results: readonly PropertyProof[];\n /** Specs that did not read: properties asked for and never checked. */\n readonly specErrors: readonly SpecError[];\n /**\n * The properties given up on that a supplied proof could close, when the engine takes supplied proofs\n * and answered (empty when it closed every one; absent when it could not run or finish).\n */\n readonly goals?: readonly OpenGoal[];\n}\n\n/** What an engine is given: the module's source and specs, the functions to prove, and where they live. */\nexport interface ProveInput {\n /** The module's source text. */\n readonly source: string;\n /** The module's specs, read from its spec file. */\n readonly specs: ModuleSpecs;\n /** The functions to prove; every one with specs when omitted. */\n readonly functions?: readonly string[];\n /** The module's path, under which its imports resolve; without it the module stands alone. */\n readonly modulePath?: string;\n /** The spec file's path, for an engine that replays a counterexample through the spec itself. */\n readonly specPath?: string;\n readonly timeoutMs?: number;\n}\n\n/** A proof engine: whether it can run here, and proving a module's properties. */\nexport interface Prover {\n readonly name: string;\n /** Whether the engine can run here, or why not. */\n available(): Promise<{ readonly version: string } | { readonly unavailable: string }>;\n prove(input: ProveInput): Promise<ModuleProofs>;\n}\n\n/** What an engine said about one module, by its name. */\nexport interface EngineReport {\n readonly engine: string;\n readonly proofs: ModuleProofs;\n}\n\n/**\n * The simulator's verdicts for a module (CHECKED, TESTED, REFUTED, UNKNOWN,\n * `total` included) combined with what the engines proved. A simulator\n * counterexample stands. One engine proving is `PROVEN`, the lower rungs'\n * counts kept beside it; an engine refuting where nothing else did is\n * `REFUTED` at the PROVEN rung; one proving and another refuting is\n * `CONFLICT`. An engine that gave up, could not run or does not take the\n * function leaves the verdict as it was, with why among the assumptions.\n */\nexport function aggregate(\n module: string,\n verdicts: readonly SpecVerdict[],\n reports: readonly EngineReport[],\n): SpecVerdict[] {\n return verdicts.map((v) => {\n if (v.module !== module) return v;\n const says = reports\n .map((r) => ({\n engine: r.engine,\n outcome: r.proofs.results.find(\n (p) => p.function === v.function && p.property === v.property,\n )?.outcome,\n }))\n .filter((x): x is { engine: string; outcome: ProofOutcome } => x.outcome !== undefined);\n if (says.length === 0) return v;\n const proven = says.find((x) => x.outcome.kind === \"PROVEN\");\n const refuted = says.find((x) => x.outcome.kind === \"REFUTED\");\n if (v.kind === \"REFUTED\" || v.kind === \"CONFLICT\") {\n // The simulator's counterexample is a fact; an engine proving against it is a conflict too.\n if (v.kind === \"REFUTED\" && proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: { name: \"simulator\", version: v.rung, counterexample: v.counterexample },\n assumptions: [...v.assumptions, ...proven.outcome.assumptions],\n };\n return v;\n }\n if (proven?.outcome.kind === \"PROVEN\" && refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"CONFLICT\",\n proven: proven.outcome.engine,\n refuted: {\n name: refuted.outcome.engine.name,\n version: refuted.outcome.engine.version,\n ...(refuted.outcome.counterexample\n ? { counterexample: refuted.outcome.counterexample }\n : {}),\n },\n assumptions: [...proven.outcome.assumptions, ...refuted.outcome.assumptions],\n };\n if (refuted?.outcome.kind === \"REFUTED\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"REFUTED\",\n rung: \"PROVEN\",\n engine: refuted.outcome.engine,\n counterexample: refuted.outcome.counterexample ?? { binders: [] },\n assumptions: refuted.outcome.assumptions,\n };\n if (proven?.outcome.kind === \"PROVEN\")\n return {\n module: v.module,\n function: v.function,\n property: v.property,\n text: v.text,\n kind: \"PROVEN\",\n engine: proven.outcome.engine,\n ...(v.kind === \"TESTED\" ? { tested: v.inputs } : {}),\n ...(v.kind === \"TESTED\" && v.checked !== undefined\n ? { checked: v.checked }\n : v.kind === \"CHECKED\"\n ? { checked: v.inputs }\n : {}),\n assumptions: [...proven.outcome.assumptions, ...v.assumptions],\n };\n // Every engine fell short: say so beside the verdict that stands.\n const notes = says.map((x) =>\n x.outcome.kind === \"UNKNOWN\"\n ? `not PROVEN by ${x.engine}: ${x.outcome.cause}: ${x.outcome.reason}`\n : `${x.engine}: ${x.outcome.kind}`,\n );\n return { ...v, assumptions: [...v.assumptions, ...notes] };\n });\n}\n"],"mappings":";;;;;;;;;;AAwGA,SAAgB,UACd,QACA,UACA,SACe;CACf,OAAO,SAAS,KAAK,MAAM;EACzB,IAAI,EAAE,WAAW,QAAQ,OAAO;EAChC,MAAM,OAAO,QACV,KAAK,OAAO;GACX,QAAQ,EAAE;GACV,SAAS,EAAE,OAAO,QAAQ,MACvB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,QACvD,CAAC,EAAE;EACL,EAAE,CAAC,CACF,QAAQ,MAAsD,EAAE,YAAY,KAAA,CAAS;EACxF,IAAI,KAAK,WAAW,GAAG,OAAO;EAC9B,MAAM,SAAS,KAAK,MAAM,MAAM,EAAE,QAAQ,SAAS,QAAQ;EAC3D,MAAM,UAAU,KAAK,MAAM,MAAM,EAAE,QAAQ,SAAS,SAAS;EAC7D,IAAI,EAAE,SAAS,aAAa,EAAE,SAAS,YAAY;GAEjD,IAAI,EAAE,SAAS,aAAa,QAAQ,QAAQ,SAAS,UACnD,OAAO;IACL,QAAQ,EAAE;IACV,UAAU,EAAE;IACZ,UAAU,EAAE;IACZ,MAAM,EAAE;IACR,MAAM;IACN,QAAQ,OAAO,QAAQ;IACvB,SAAS;KAAE,MAAM;KAAa,SAAS,EAAE;KAAM,gBAAgB,EAAE;IAAe;IAChF,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,QAAQ,WAAW;GAC/D;GACF,OAAO;EACT;EACA,IAAI,QAAQ,QAAQ,SAAS,YAAY,SAAS,QAAQ,SAAS,WACjE,OAAO;GACL,QAAQ,EAAE;GACV,UAAU,EAAE;GACZ,UAAU,E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;CAC3D,CAAC;AACH"}
|
package/dist/spec.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as forall, i as Total, n as Forall, o as isSpec, r as Spec, s as total, t as Fn } from "./combinators-
|
|
1
|
+
import { a as forall, i as Total, n as Forall, o as isSpec, r as Spec, s as total, t as Fn } from "./combinators-BecOKcmi.mjs";
|
|
2
2
|
export { type Fn, type Forall, type Spec, type Total, forall, isSpec, total };
|
package/dist/spec.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as forall, n as isSpec, r as total } from "./combinators-
|
|
1
|
+
export { t as forall, n as isSpec, r as total } from "./combinators-CLfsPfhT.mjs";
|