eutaxy 0.17.1 → 0.18.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 +6 -6
- package/dist/aws.d.mts +2 -2
- package/dist/aws.mjs +2 -2
- package/dist/bin.mjs +1 -1
- package/dist/{cli-CxbXc1j2.mjs → cli-DyA7uTBg.mjs} +801 -449
- package/dist/cli-DyA7uTBg.mjs.map +1 -0
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cloudflare.d.mts +22 -3
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +3 -3
- package/dist/{delivery-invariants-DO3j1mmD.mjs → delivery-invariants-BRwfZJrs.mjs} +2 -2
- package/dist/{delivery-invariants-DO3j1mmD.mjs.map → delivery-invariants-BRwfZJrs.mjs.map} +1 -1
- package/dist/{delivery-invariants-D7DI7i8x.d.mts → delivery-invariants-D-_GPOqE.d.mts} +2 -2
- package/dist/{delivery-invariants-D7DI7i8x.d.mts.map → delivery-invariants-D-_GPOqE.d.mts.map} +1 -1
- package/dist/{explore-CkKiOuz6.d.mts → explore-D33RP9hF.d.mts} +43 -8
- package/dist/explore-D33RP9hF.d.mts.map +1 -0
- package/dist/index.d.mts +11 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/{platform-D4hlJjm3.d.mts → platform-CawKCUru.d.mts} +69 -2
- package/dist/platform-CawKCUru.d.mts.map +1 -0
- package/dist/{src-fxWc6oGc.mjs → src-H1Q8ytEx.mjs} +50 -6
- package/dist/src-H1Q8ytEx.mjs.map +1 -0
- package/dist/{src-D_hHC_-3.mjs → src-Whn0RMSh.mjs} +406 -51
- package/dist/src-Whn0RMSh.mjs.map +1 -0
- package/dist/{workerd-DhrzU6AZ.mjs → workerd-tI8INa6v.mjs} +43 -9
- package/dist/workerd-tI8INa6v.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cli-CxbXc1j2.mjs.map +0 -1
- package/dist/explore-CkKiOuz6.d.mts.map +0 -1
- package/dist/platform-D4hlJjm3.d.mts.map +0 -1
- package/dist/src-D_hHC_-3.mjs.map +0 -1
- package/dist/src-fxWc6oGc.mjs.map +0 -1
- package/dist/workerd-DhrzU6AZ.mjs.map +0 -1
package/dist/cli.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,
|
|
1
|
+
{"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,UAkEiB;WACN;WACA,SAAS;WACT,SAAS;;wBAGE,KAAK,yBAAyB,IAAI,KAAK"}
|
package/dist/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as main } from "./cli-
|
|
1
|
+
export { t as main } from "./cli-DyA7uTBg.mjs";
|
package/dist/cloudflare.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-
|
|
3
|
-
import {
|
|
1
|
+
import { A as FaultKind, C as Unique, M as JsonValue, O as FaultSite, S as StateQuery, T as EffectSelector, a as PlatformData, b as References, c as WorkerRef, d as PinnedSchedule, f as AtLeastOnce, i as ExternalDecl, m as Invariant, n as Platform, o as ScenarioSpec, r as Bounds, s as ScriptedResponse, v as EveryRow, w as Refines, x as RowCondition, y as Implies } from "./platform-CawKCUru.mjs";
|
|
2
|
+
import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-D-_GPOqE.mjs";
|
|
3
|
+
import { _ as Unsupported, g as ScenarioVerdict, t as ExploreOptions, u as ModuleSpecs, v as Violated } from "./explore-D33RP9hF.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* What `cloudflareRegressionTest` needs to write the test: import paths of the scenario, the Worker and its
|
|
6
6
|
* schema files, relative to the emitted file, and what the platform was given when the check ran.
|
|
@@ -58,6 +58,11 @@ interface CloudflareRegressionOptions {
|
|
|
58
58
|
}
|
|
59
59
|
/** A Vitest regression test for a Cloudflare scenario, to run under the Cloudflare Vitest plugin. */
|
|
60
60
|
export declare function cloudflareRegressionTest(verdict: Violated, options: CloudflareRegressionOptions): string;
|
|
61
|
+
/**
|
|
62
|
+
* A Vitest test for a Cloudflare scenario that replays the run that made the check `UNSUPPORTED`
|
|
63
|
+
* (see `emitUnsupportedTest`), to run under the Cloudflare Vitest plugin; `expect` is not used.
|
|
64
|
+
*/
|
|
65
|
+
export declare function cloudflareUnsupportedTest(verdict: Unsupported, options: CloudflareRegressionOptions): string;
|
|
61
66
|
/** An object a setup seeds: its text, or its text with metadata. */
|
|
62
67
|
type R2Seed = string | {
|
|
63
68
|
readonly value: string;
|
|
@@ -450,6 +455,18 @@ export declare function callee(binding: string, worker: {
|
|
|
450
455
|
export declare function serviceCall(binding: string, method?: string): EffectSelector;
|
|
451
456
|
/** Selects a Workflow's step attempts, optionally of one step; a failed attempt's result carries its error. */
|
|
452
457
|
export declare function workflowStep(binding: string, step?: string): EffectSelector;
|
|
458
|
+
/**
|
|
459
|
+
* A fault site (for `bounds.faultsAt`) on a Workflow step's attempts: the
|
|
460
|
+
* point where an attempt starts (`crash_before`, `ambiguous`) and the one
|
|
461
|
+
* where its result is persisted (`crash_after`, `ambiguous`), of every
|
|
462
|
+
* attempt or only `attempt` (from 1), of the kinds `faults` lists or every
|
|
463
|
+
* kind those points allow. It matches every step of that name in every
|
|
464
|
+
* instance of the binding's Workflow.
|
|
465
|
+
*/
|
|
466
|
+
export declare function stepFaults(binding: string, step: string, options?: {
|
|
467
|
+
readonly attempt?: number;
|
|
468
|
+
readonly faults?: readonly FaultKind[];
|
|
469
|
+
}): FaultSite;
|
|
453
470
|
/** A Workflow's instances at the end of the run as rows `{ id, status, params, output?, error? }`. */
|
|
454
471
|
export declare function workflowRows(binding: string, where?: readonly RowCondition[]): StateQuery;
|
|
455
472
|
/**
|
|
@@ -481,6 +498,8 @@ interface CloudflareScenarioInput {
|
|
|
481
498
|
readonly bounds?: Partial<Bounds>;
|
|
482
499
|
/** Modules of pure core functions with spec files beside them, relative to the scenario (see ScenarioSpec.specs). */
|
|
483
500
|
readonly specs?: readonly string[];
|
|
501
|
+
/** Schedules the check runs before it explores, each fault at the call it names (see ScenarioSpec.pinned). */
|
|
502
|
+
readonly pinned?: readonly PinnedSchedule[];
|
|
484
503
|
}
|
|
485
504
|
/** Drive the Worker's `queue()` handler with these messages from the named queue; an id defaults to `msg-<n>`. */
|
|
486
505
|
export declare function queue(name: string, messages: readonly QueueMessage[]): QueueDrive;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/r2.ts","../../cloudflare/src/scenario.ts","../../cloudflare/src/callees.ts","../../cloudflare/src/check.ts","../../cloudflare/src/d1.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.ts","../../cli/src/workerd.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/r2.ts","../../cloudflare/src/scenario.ts","../../cloudflare/src/callees.ts","../../cloudflare/src/check.ts","../../cloudflare/src/d1.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.ts","../../cli/src/workerd.ts"],"mappings":";;;;;;;UAWiB;;WAEN;;WAEA;;WAEA,aAAa,SAAS;;;;;WAKtB;;WAEA;;WAEA;;;;;WAKA;;WAEA;;;;;;WAMA,UAAU,SACjB;aAGa;aACA;aACA;aACA,QAAQ,SAAS;;aAEjB;;;;;;WAQN;;WAEA,UAAU,SAAS;WACnB;WACA;;WAEA;aACE;aACA;;;;wBA0BG,yBACd,SAAS,UACT,SAAS;;;;;wBAYK,0BACd,SAAS,aACT,SAAS;;KCkIC;WAGG;WACA,iBAAiB,S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WACE,YAAY,qBACZ,cACA,KAAK,0BACG;;;KAIA,sCAAsC,KAAK,kBAAkB;;;;;;UAOxD;;WAEN;;;;;;WAMA,SAAS,gBAAgB;;WAEzB,SAAS,SAAS;;WAElB;;;;;;WAMA,iBAAiB;;;;;WAKjB,UAAU,SAAS;;;;;;WAMnB,UAAU,SAAS,eAAe;;;;;;;;WAQlC,UAAU,SAAS;;;;;;;wBA8Cd,yBAAyB,SAAS,4BAA4B;;KC7FlE;WACD;WACA;WACA;;WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,mBAAmB;WACnB;cACG;gBAA8B,yBAAyB;;;;;UAKpD;;WAEN;WACA,QAAQ;WACR,KAAK;WACL;;WAEA;;;wBAkcW,gBACpB,MAAM,cACN,SAAS,4BACR,QAAQ;;UCvgBM;WACN;;WAEA,sBAAsB;WACtB;aAAmB;aAAwB;;WAC3C;aAA2B;cAAwB;;;WAEnD;aAAmB;cAAwB;;;;WAG3C,UAAU,SACjB;aAGa;aACA;aACA,QAAQ,SAAS;aACjB;;;WAKN,UAAU,SAAS;WACnB;aAA+B;aAAyB;;;UAGlD;WACN;WACA;WACA;;;UAIM;WACN,OAAO;WACP,YAAY;;;KAIX,aAAa,SAAS,qBAAqB;;;;;UA8FtC;;WAEN,UAAU;;WAEV;;WAEA,gBAAgB;;WAEhB,UAAU,SAAS;;WAEnB,SAAS;;WAET,aAAa,SAAS,eAAe;;WAErC,SAAS,SAAS;;WAElB,UAAU,SAAS,eAAe;;WAElC,WAAW,SAAS;;WAEpB,UAAU,SAAS;WACnB;WACA;WACA;WACA;;;wBAIW,eAAe,OAAO,oBAAoB,QAAQ"}
|
package/dist/cloudflare.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-
|
|
2
|
-
import { A as r2Bucket, B as
|
|
3
|
-
export { atLeastOnce, atLeastOncePerMessage, atMostOncePerKey, callee, calleeEnv, check, checkInWorkerd, cloudflareRegressionTest, createCloudflarePlatform, cron, d1Param, d1Read, d1Rows, d1Schema, d1Write, defineScenario, durableObject, durableObjectRows, durableObjectTable, everyRow, expectHolds, external, fetchCall, http, httpResponse, implies, objectCall, queue, queueAck, r2Bucket, r2Op, r2Rows, references, refines, rpc, rpcResponse, runDifferential, scriptedObject, service, serviceCall, snapshotD1, unique, webSocketReceived, websocket, workflow, workflowRows, workflowStep };
|
|
1
|
+
import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-BRwfZJrs.mjs";
|
|
2
|
+
import { A as r2Bucket, B as stepFaults, C as fetchCall, D as objectCall, E as implies, F as rpc, G as workflowRows, H as webSocketReceived, I as rpcResponse, J as cloudflareRegressionTest, K as workflowStep, L as scriptedObject, M as r2Rows, N as references, O as queue, P as refines, R as service, S as external, T as httpResponse, U as websocket, V as unique, W as workflow, Y as cloudflareUnsupportedTest, _ as defineScenario, a as createCloudflarePlatform, b as durableObjectTable, c as calleeEnv, d as cron, f as d1Param, g as d1Write, h as d1Schema, i as runDifferential, j as r2Op, k as queueAck, l as atLeastOncePerMessage, m as d1Rows, o as check, p as d1Read, q as snapshotD1, s as expectHolds, t as checkInWorkerd, u as callee, v as durableObject, w as http, x as everyRow, y as durableObjectRows, z as serviceCall } from "./workerd-tI8INa6v.mjs";
|
|
3
|
+
export { atLeastOnce, atLeastOncePerMessage, atMostOncePerKey, callee, calleeEnv, check, checkInWorkerd, cloudflareRegressionTest, cloudflareUnsupportedTest, createCloudflarePlatform, cron, d1Param, d1Read, d1Rows, d1Schema, d1Write, defineScenario, durableObject, durableObjectRows, durableObjectTable, everyRow, expectHolds, external, fetchCall, http, httpResponse, implies, objectCall, queue, queueAck, r2Bucket, r2Op, r2Rows, references, refines, rpc, rpcResponse, runDifferential, scriptedObject, service, serviceCall, snapshotD1, stepFaults, unique, webSocketReceived, websocket, workflow, workflowRows, workflowStep };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as getPath } from "./src-Whn0RMSh.mjs";
|
|
2
2
|
// packages/core/src/delivery-invariants.ts
|
|
3
3
|
/**
|
|
4
4
|
* No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
|
|
@@ -41,4 +41,4 @@ function atLeastOncePerMessage(name, events, effect, key, bodyKey) {
|
|
|
41
41
|
}
|
|
42
42
|
export { atLeastOncePerMessage as n, atMostOncePerKey as r, atLeastOnce as t };
|
|
43
43
|
|
|
44
|
-
//# sourceMappingURL=delivery-invariants-
|
|
44
|
+
//# sourceMappingURL=delivery-invariants-BRwfZJrs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-invariants-
|
|
1
|
+
{"version":3,"file":"delivery-invariants-BRwfZJrs.mjs","names":[],"sources":["../../core/src/delivery-invariants.ts"],"sourcesContent":["/**\n * Constructors for the delivery invariants every platform's scenarios use:\n * nothing delivered twice, nothing lost. Platforms wrap them to take their\n * own drive shapes.\n */\n\nimport type { JsonValue } from \"./canonical-json.ts\";\nimport type { AtLeastOnce, AtMostOncePerKey } from \"./invariants.ts\";\nimport { type EffectSelector, getPath } from \"./selectors.ts\";\n\n/**\n * No two selected effects share the value at `key` (a dot path into the effect's payload): nothing\n * happened twice for one key, a payment recorded twice, a message sent twice.\n */\nexport function atMostOncePerKey(\n name: string,\n effect: EffectSelector,\n key: string,\n): AtMostOncePerKey {\n return { kind: \"atMostOncePerKey\", name, effect, key };\n}\n\n/** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */\nexport function atLeastOnce(\n name: string,\n effect: EffectSelector,\n key: string,\n expected: readonly JsonValue[],\n): AtLeastOnce {\n return { kind: \"atLeastOnce\", name, effect, key, expected };\n}\n\n/**\n * Every event's `bodyKey` value must appear at least once as `key` in a\n * selected effect. The expected keys are re-derived from the bodies that\n * remain when shrinking removes events.\n */\nexport function atLeastOncePerMessage(\n name: string,\n events: readonly { readonly id: string; readonly body: JsonValue }[],\n effect: EffectSelector,\n key: string,\n bodyKey: string,\n): AtLeastOnce {\n const expected: JsonValue[] = [];\n for (const e of events) {\n const v = getPath(e.body, bodyKey);\n if (v === undefined)\n throw new Error(`event ${e.id} has no ${JSON.stringify(bodyKey)} in its body`);\n expected.push(v);\n }\n return { ...atLeastOnce(name, effect, key, expected), perMessage: { bodyKey } };\n}\n"],"mappings":";;;;;;AAcA,SAAgB,iBACd,MACA,QACA,KACkB;CAClB,OAAO;EAAE,MAAM;EAAoB;EAAM;EAAQ;CAAI;AACvD;;AAGA,SAAgB,YACd,MACA,QACA,KACA,UACa;CACb,OAAO;EAAE,MAAM;EAAe;EAAM;EAAQ;EAAK;CAAS;AAC5D;;;;;;AAOA,SAAgB,sBACd,MACA,QACA,QACA,KACA,SACa;CACb,MAAM,WAAwB,CAAC;CAC/B,KAAK,MAAM,KAAK,QAAQ;EACtB,MAAM,IAAI,QAAQ,EAAE,MAAM,OAAO;EACjC,IAAI,MAAM,KAAA,GACR,MAAM,IAAI,MAAM,SAAS,EAAE,GAAG,UAAU,KAAK,UAAU,OAAO,EAAE,aAAa;EAC/E,SAAS,KAAK,CAAC;CACjB;CACA,OAAO;EAAE,GAAG,YAAY,MAAM,QAAQ,KAAK,QAAQ;EAAG,YAAY,EAAE,QAAQ;CAAE;AAChF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as JsonValue, T as EffectSelector, f as AtLeastOnce, p as AtMostOncePerKey } from "./platform-CawKCUru.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
|
|
4
4
|
* happened twice for one key, a payment recorded twice, a message sent twice.
|
|
@@ -7,4 +7,4 @@ declare function atMostOncePerKey(name: string, effect: EffectSelector, key: str
|
|
|
7
7
|
/** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */
|
|
8
8
|
declare function atLeastOnce(name: string, effect: EffectSelector, key: string, expected: readonly JsonValue[]): AtLeastOnce;
|
|
9
9
|
export { atMostOncePerKey as n, atLeastOnce as t };
|
|
10
|
-
//# sourceMappingURL=delivery-invariants-
|
|
10
|
+
//# sourceMappingURL=delivery-invariants-D-_GPOqE.d.mts.map
|
package/dist/{delivery-invariants-D7DI7i8x.d.mts.map → delivery-invariants-D-_GPOqE.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-invariants-
|
|
1
|
+
{"version":3,"file":"delivery-invariants-D-_GPOqE.d.mts","names":[],"sources":["../../core/src/delivery-invariants.ts"],"mappings":";;;;;iBAcgB,iBACd,cACA,QAAQ,gBACR,cACC;;iBAKa,YACd,cACA,QAAQ,gBACR,aACA,mBAAmB,cAClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as EffectLog, d as PinnedSchedule, h as Violation, j as Schedule, n as Platform, o as ScenarioSpec, r as Bounds } from "./platform-CawKCUru.mjs";
|
|
2
2
|
/** How far exploration got: runs, effect points, faults injected and time taken, and coverage when exhaustive. */
|
|
3
3
|
interface BoundsReached {
|
|
4
4
|
readonly runs: number;
|
|
@@ -38,13 +38,21 @@ interface Violated extends VerdictBase {
|
|
|
38
38
|
/** Ids of the drive's events that remain after shrinking. */
|
|
39
39
|
readonly keptEvents: readonly string[];
|
|
40
40
|
readonly shrunk: Shrunk;
|
|
41
|
+
/**
|
|
42
|
+
* The name of the scenario's pinned schedule whose run broke the
|
|
43
|
+
* invariant; its schedule is that run's, as it ran (not shrunk). Absent
|
|
44
|
+
* when exploration found it.
|
|
45
|
+
*/
|
|
46
|
+
readonly pinned?: string;
|
|
47
|
+
/** The pinned schedule's faults its run did not place, each with why; absent when it placed them all. */
|
|
48
|
+
readonly unplaced?: readonly string[];
|
|
41
49
|
}
|
|
42
50
|
/** No violation within the stated bounds; not a proof. */
|
|
43
51
|
interface Bounded extends VerdictBase {
|
|
44
52
|
readonly kind: "BOUNDED";
|
|
45
53
|
readonly bounds: Bounds;
|
|
46
54
|
}
|
|
47
|
-
type UnsupportedCause = "unsupported_api" | "not_replayable" | "module_state_leak" | "unsupported_bounds";
|
|
55
|
+
type UnsupportedCause = "unsupported_api" | "not_replayable" | "module_state_leak" | "unsupported_bounds" | "pin_not_placed";
|
|
48
56
|
/** The run did something the simulation cannot control or replay, so no claim is made: the cause and the reason. */
|
|
49
57
|
interface Unsupported extends VerdictBase {
|
|
50
58
|
readonly kind: "UNSUPPORTED";
|
|
@@ -58,6 +66,15 @@ interface Unsupported extends VerdictBase {
|
|
|
58
66
|
* place when replayed.
|
|
59
67
|
*/
|
|
60
68
|
readonly schedule?: Schedule;
|
|
69
|
+
/**
|
|
70
|
+
* For `unsupported_api`, the same run as a pinned schedule, present once
|
|
71
|
+
* that run replayed alone reached the same reason again: each fault
|
|
72
|
+
* at the call it hit, by its target, op and arguments and that call's
|
|
73
|
+
* number among the run's matching calls, under the run's seed (and its
|
|
74
|
+
* turns when it recorded them), so a replay still finds the call when
|
|
75
|
+
* the faults or effects before it move invocations and positions.
|
|
76
|
+
*/
|
|
77
|
+
readonly replay?: PinnedSchedule;
|
|
61
78
|
}
|
|
62
79
|
/** A scenario's verdict: `VIOLATED`, `BOUNDED` or `UNSUPPORTED`. */
|
|
63
80
|
type ScenarioVerdict = Violated | Bounded | Unsupported;
|
|
@@ -202,7 +219,10 @@ interface ModuleSpecs {
|
|
|
202
219
|
/** How `explore` searches: the seed, a cap on runs, the time budget, the share of runs with faults, and exhaustive mode. */
|
|
203
220
|
interface ExploreOptions {
|
|
204
221
|
readonly seed: number | string;
|
|
205
|
-
/**
|
|
222
|
+
/**
|
|
223
|
+
* Hard cap on exploration's runs, in addition to the scenario's time budget. The scenario's pinned
|
|
224
|
+
* schedules run first, each under each of its seeds, uncounted and whatever the budget.
|
|
225
|
+
*/
|
|
206
226
|
readonly maxRuns?: number;
|
|
207
227
|
/**
|
|
208
228
|
* Replaces the scenario's `budgetMs` for this exploration: the real time
|
|
@@ -240,13 +260,28 @@ interface ExploreOptions {
|
|
|
240
260
|
readonly reduction?: boolean;
|
|
241
261
|
};
|
|
242
262
|
}
|
|
263
|
+
/** What one run of a pinned schedule did. */
|
|
264
|
+
interface PinnedRun {
|
|
265
|
+
readonly log: EffectLog;
|
|
266
|
+
/** The run's schedule as recorded, by invocation and position. */
|
|
267
|
+
readonly schedule: Schedule;
|
|
268
|
+
/** What the run met that the simulation cannot control or replay; empty when nothing. */
|
|
269
|
+
readonly unsupportedReasons: readonly string[];
|
|
270
|
+
/** Each fault of the schedule the run did not place, and why; empty when it placed them all. */
|
|
271
|
+
readonly unplaced: readonly string[];
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Run a pinned schedule once, under `seed` (default its first), each fault at the call it names:
|
|
275
|
+
* the replay of an `UNSUPPORTED` verdict's `replay`, or of one of a scenario's pinned schedules.
|
|
276
|
+
*/
|
|
277
|
+
declare function runPinned(spec: ScenarioSpec, platform: Platform, pinned: PinnedSchedule, seed?: number): Promise<PinnedRun>;
|
|
243
278
|
/** Re-run a recorded schedule exactly. */
|
|
244
279
|
declare function replay(spec: ScenarioSpec, platform: Platform, schedule: Schedule): Promise<EffectLog>;
|
|
245
280
|
/**
|
|
246
|
-
* Explore a scenario on a platform: run it under schedules drawn from the
|
|
247
|
-
* the bounds, when exhaustive), shrink the first violation
|
|
248
|
-
* unless `maxRuns` says otherwise.
|
|
281
|
+
* Explore a scenario on a platform: run its pinned schedules, then run it under schedules drawn from the
|
|
282
|
+
* seed (or every schedule within the bounds, when exhaustive), shrink the first violation exploration
|
|
283
|
+
* found, and return the verdict. At most 100 runs of exploration unless `maxRuns` says otherwise.
|
|
249
284
|
*/
|
|
250
285
|
declare function explore(scenario: ScenarioSpec, platform: Platform, options: ExploreOptions): Promise<ScenarioVerdict>;
|
|
251
|
-
export {
|
|
252
|
-
//# sourceMappingURL=explore-
|
|
286
|
+
export { Unsupported as _, runPinned as a, FunctionSpec as c, Property as d, SpecError as f, ScenarioVerdict as g, BoundsReached as h, replay as i, Hint as l, Bounded as m, PinnedRun as n, Arrow as o, SpecType as p, explore as r, Binder as s, ExploreOptions as t, ModuleSpecs as u, Violated as v, describeVerdict as y };
|
|
287
|
+
//# sourceMappingURL=explore-D33RP9hF.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explore-D33RP9hF.d.mts","names":[],"sources":["../../core/src/verdict.ts","../../spec/src/ir.ts","../../engine/src/explore.ts"],"mappings":";;UASiB;WACN;WACA;WACA;WACA;;;;;;;WAOA;aACE;aACA;aACA;;;UAIH;WACC;WACA;WACA,SAAS;WACT;;UAGM;WACN;WACA;WACA;;;UAIM,iBAAiB;WACvB;WACA,WAAW;;WAEX,OAAO;WACP,UAAU;;WAEV;WACA,QAAQ;;;;;;WAMR;;WAEA;;;UAIM,gBAAgB;WACtB;WACA,QAAQ;;KAGP;;UAQK,oBAAoB;WAC1B;WACA,OAAO;WACP;;;;;;;;WAQA,WAAW;;;;;;;;;WASX,SAAS;;;KAIR,kBAAkB,WAAW,UAAU;;iBAGnC,gBAAgB,GAAG;;;;;;;;;;;KC1FvB;WACG;;WACA;;WACA;;WACA;;WACA;WAA0B;;WAC1B;;WACA;;WAEA;;WAEA;WACA,iBAAiB;;WAEjB;WAAwB,kBAAkB;;;;WAE1C;WAAwB,SAAS;;WACjC;WAA0B;;UAExB;WACN;WACA,MAAM;;;UAIA;WACN;WACA;;;;;;;UAQM;WACN;WACA,QAAQ;WACR,QAAQ;WACR;aAAmB;aAA0B;;;;UAIvC;;WAEN;WACA,MAAM;;;UAIA;WACN;WACA,MAAM;WACN,OAAO;;;UAID;;WAEN;;WAEA;WACA;;WAEA;;;;;;;UAQM;;WAEN;WACA;;WAEA,kBAAkB;;WAElB,SAAS;WACT,OAAO;WACP,UAAU;;;;;WAKV;aAA6B;aAAwB;;;WAErD;;WAEA;;;UAIM;WACN;WACA,iBAAiB;WACjB,qBAAqB;;WAErB;;WAEA;;;UAIM;WACN;WACA;WACA;;;UAIM;WACN,oBAAoB;WACpB,iBAAiB;;;UCnFX;WACN;;;;;WAKA;;;;;;;;WAQA;;;;;;;WAOA;;WAEA;;WAEA;;;;;;WAMA;;;;;;;;WAQA;aAAkC;;;;UAoR5B;WACN,KAAK;;WAEL,UAAU;;WAEV;;WAEA;;;;;;iBAoBW,UACpB,MAAM,cACN,UAAU,UACV,QAAQ,gBACR,gBACC,QAAQ;;iBAaW,OACpB,MAAM,cACN,UAAU,UACV,UAAU,WACT,QAAQ;;;;;;iBASW,QACpB,UAAU,cACV,UAAU,UACV,SAAS,iBACR,QAAQ"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { A as FaultKind, C as Unique, D as EffectRecord, E as EffectLog, O as FaultSite, S as StateQuery, T as EffectSelector, _ as checkInvariants, d as PinnedSchedule, f as AtLeastOnce, g as checkInvariant, h as Violation, j as Schedule, k as FaultDecision, l as validateScenario, m as Invariant, n as Platform, o as ScenarioSpec, p as AtMostOncePerKey, r as Bounds, t as EventRef, u as PinnedFault, v as EveryRow, w as Refines, x as RowCondition, y as Implies } from "./platform-CawKCUru.mjs";
|
|
2
|
+
import { _ as Unsupported, a as runPinned, c as FunctionSpec, d as Property, f as SpecError, g as ScenarioVerdict, h as BoundsReached, i as replay, l as Hint, m as Bounded, n as PinnedRun, o as Arrow, p as SpecType, r as explore, s as Binder, t as ExploreOptions, u as ModuleSpecs, v as Violated, y as describeVerdict } from "./explore-D33RP9hF.mjs";
|
|
3
3
|
import { n as Forall, t as Fn } from "./combinators-BecOKcmi.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* Spec verdicts: what is known about one property of one pure function.
|
|
@@ -285,6 +285,14 @@ interface RegressionTestOptions {
|
|
|
285
285
|
* there and passes once it is fixed.
|
|
286
286
|
*/
|
|
287
287
|
export declare function emitRegressionTest(verdict: Violated, options: RegressionTestOptions): string;
|
|
288
|
+
/**
|
|
289
|
+
* A Vitest test file that replays the run that made a check `UNSUPPORTED`, as its verdict's `replay`
|
|
290
|
+
* names it (each fault at the call it hit, by target, op, arguments and call number), and expects
|
|
291
|
+
* the run to place every fault and reach the same reason: a reproduction to look into, which fails
|
|
292
|
+
* once the run no longer gets there. Only for `unsupported_api`, which one run reaches again (other
|
|
293
|
+
* causes throw). `engineModule` as for `emitRegressionTest`; it exports `runPinned`.
|
|
294
|
+
*/
|
|
295
|
+
export declare function emitUnsupportedTest(verdict: Unsupported, options: Omit<RegressionTestOptions, "expect">): string;
|
|
288
296
|
/**
|
|
289
297
|
* The JSON report: one object, canonical, with a schema version at the top.
|
|
290
298
|
* Spec verdicts, when there are any, sit beside the scenario's, never in it.
|
|
@@ -299,5 +307,5 @@ export declare function renderTrace(log: EffectLog, evidence?: readonly number[]
|
|
|
299
307
|
* scenario that could not be decided the schedule of the run that reached that.
|
|
300
308
|
*/
|
|
301
309
|
export declare function renderText(verdict: ScenarioVerdict): string;
|
|
302
|
-
export { type Arrow, type AtLeastOnce, type AtMostOncePerKey, type Binder, type Bounded, type Bounds, type BoundsReached, type Checked, type Conflict, type CoreObserver, type Counterexample, type EffectLog, type EffectRecord, type EffectSelector, type EngineId, type EngineReport, type EventRef, type EveryRow, type ExploreOptions, type FaultDecision, type FaultKind, type FunctionSpec, type Hint, type Implies, type Invariant, type LadderOptions, type ModuleProofs, type ModuleSpecs, type ObservedCall, type Platform, type ProofOutcome, type Property, type PropertyProof, type ProveInput, type Proven, type Prover, type Refines, type Refuted, type RegressionTestOptions, type RowCondition, type ScenarioSpec, type ScenarioVerdict, type Schedule, type SpecType, type SpecUnknown, type SpecVerdict, type StateQuery, type Tested, type TestedOptions, type Unique, type Unsupported, type Violated, type Violation, checkInvariant, checkInvariants, describeVerdict, explore, replay, validateScenario };
|
|
310
|
+
export { type Arrow, type AtLeastOnce, type AtMostOncePerKey, type Binder, type Bounded, type Bounds, type BoundsReached, type Checked, type Conflict, type CoreObserver, type Counterexample, type EffectLog, type EffectRecord, type EffectSelector, type EngineId, type EngineReport, type EventRef, type EveryRow, type ExploreOptions, type FaultDecision, type FaultKind, type FaultSite, type FunctionSpec, type Hint, type Implies, type Invariant, type LadderOptions, type ModuleProofs, type ModuleSpecs, type ObservedCall, type PinnedFault, type PinnedRun, type PinnedSchedule, type Platform, type ProofOutcome, type Property, type PropertyProof, type ProveInput, type Proven, type Prover, type Refines, type Refuted, type RegressionTestOptions, type RowCondition, type ScenarioSpec, type ScenarioVerdict, type Schedule, type SpecType, type SpecUnknown, type SpecVerdict, type StateQuery, type Tested, type TestedOptions, type Unique, type Unsupported, type Violated, type Violation, checkInvariant, checkInvariants, describeVerdict, explore, replay, runPinned, validateScenario };
|
|
303
311
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/spec-verdict.ts","../../prover/src/checked.ts","../../prover/src/tested.ts","../../prover/src/ladder.ts","../../prover/src/provers.ts","../../engine/src/observe.ts","../../engine/src/shrink.ts","../../report/src/regression.ts","../../report/src/render.ts"],"mappings":";;;;;;;;;;UAQU;;WAEC;WACA;;WAEA;;WAEA;WACA;;;UAIM,gBAAgB;WACtB;;WAEA;;WAEA;;;UAIM,eAAe;WACrB;;WAEA;;WAEA;;WAEA;;WAEA;;;UAIM;;WAEN;aAA6B;aAAuB;;;WAEpD;;WAEA;;;UAIM,gBAAgB;WACtB;;WAEA;;WAEA;aAAoB;aAAuB;;WAC3C,gBAAgB;;;UAIV,eAAe;WACrB;WACA;aAAmB;aAAuB;;;WAE1C;;WAEA;;;UAIM,iBAAiB;WACvB;WACA;aAAmB;aAAuB;;WAC1C;aACE;aACA;aACA,iBAAiB;;;KAIlB;;UAGK,oBAAoB;WAC1B;WACA,OAAO;WACP;;;KAIC,cAAc,UAAU,SAAS,SAAS,UAAU,WAAW;;wBAG3D,oBAAoB,GAAG;UC7BtB;WACN;WACA,IAAI;WACJ,UAAU;;WAEV;aAA2B;;;WAE3B,MAAM,OAAO;;WAEb;;;wBAIK,YAAY,OAAO,eAAe;;UCvDjC;;WAEN;;WAEA;;UAGM,oBAAoB;WAC1B;WACA,IAAI;WACJ,UAAU;;WAEV,MAAM,OAAO;;;wBAIR,WAAW,OAAO,cAAc;;UC3B/B;;WAEN,SAAS;;WAET;;;wBAIK,WAAW,OAAO,cAAc,UAAS,gBAAqB;;UCL7D;WACN;WACA;;;KAIC;WACG;WAAyB,QAAQ;WAAmB;;WAEpD;WACA,QAAQ;WACR,iBAAiB;WACjB;;WAGA;WACA;WACA;;;UAIE;WACN;;WAEA;WACA,SAAS;;;UAIH;WACN;WACA;;WAEA;;WAEA;;;UAIM;WACN,kBAAkB;;WAElB,qBAAqB;;;;;WAKrB,iBAAiB;;;UAIX;;WAEN;;WAEA,OAAO;;WAEP;;WAEA;;WAEA;WACA;;;UAIM;WACN;;EAET,aAAa;aAAmB;;aAA+B;;EAC/D,MAAM,OAAO,aAAa,QAAQ;;;UAInB;WACN;WACA,QAAQ;;;;;;;;;;;wBAYH,UACd,gBACA,mBAAmB,eACnB,kBAAkB,iBACjB;;;;;;;;;;;;;;;UCzFc;WACN;;WAEA;WACA;;;UAIM;WACN,gBAAgB;;WAEhB;cAA0B;;;EAEnC;;;wBAIc,YAAY,mBAAmB,+BAA+B;;wBCE9D,aACd,UAAU,UACV,MAAM,cACN,6BACC;;UC5Bc;;WAEN;;WAEA;;WAEA;;WAEA;WACA;;;;;;WAMA;aACE;aACA;;;;;;;wBAQG,mBAAmB,SAAS,UAAU,SAAS
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../core/src/spec-verdict.ts","../../prover/src/checked.ts","../../prover/src/tested.ts","../../prover/src/ladder.ts","../../prover/src/provers.ts","../../engine/src/observe.ts","../../engine/src/shrink.ts","../../report/src/regression.ts","../../report/src/render.ts"],"mappings":";;;;;;;;;;UAQU;;WAEC;WACA;;WAEA;;WAEA;WACA;;;UAIM,gBAAgB;WACtB;;WAEA;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AA0B;;;EAEnC;;;wBAIc,YAAY,mBAAmB,+BAA+B;;wBCE9D,aACd,UAAU,UACV,MAAM,cACN,6BACC;;UC5Bc;;WAEN;;WAEA;;WAEA;;WAEA;WACA;;;;;;WAMA;aACE;aACA;;;;;;;wBAQG,mBAAmB,SAAS,UAAU,SAAS;;;;;;;;wBA0D/C,oBACd,SAAS,aACT,SAAS,KAAK;;;;;wBC/EA,WAAW,SAAS,iBAAiB,iBAAgB;;wBAarD,YAAY,gBAAgB;;wBA6G5B,YAAY,KAAK,WAAW;;;;;wBAkC5B,WAAW,SAAS"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { a as renderText,
|
|
1
|
+
import { D as checkInvariant, E as validateScenario, O as checkInvariants, a as explore, c as restrictSpec, o as replay, s as runPinned, t as observeCore } from "./src-Whn0RMSh.mjs";
|
|
2
|
+
import { a as renderText, b as describeVerdict, c as emitUnsupportedTest, d as testedRung, i as renderSpecs, o as renderTrace, p as checkedRung, s as emitRegressionTest, t as renderJson, u as specLadder } from "./src-H1Q8ytEx.mjs";
|
|
3
3
|
import { t as aggregate } from "./provers-DS44OeEm.mjs";
|
|
4
4
|
// packages/core/src/spec-verdict.ts
|
|
5
5
|
/** One line per spec verdict, for error messages; full rendering lives in `report`. */
|
|
@@ -17,6 +17,6 @@ function describeSpecVerdict(v) {
|
|
|
17
17
|
case "UNKNOWN": return `UNKNOWN ${what}: ${v.cause}: ${v.reason}`;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export { aggregate, checkInvariant, checkInvariants, checkedRung, describeSpecVerdict, describeVerdict, emitRegressionTest, explore, observeCore, renderJson, renderSpecs, renderText, renderTrace, replay, restrictSpec, specLadder, testedRung, validateScenario };
|
|
20
|
+
export { aggregate, checkInvariant, checkInvariants, checkedRung, describeSpecVerdict, describeVerdict, emitRegressionTest, emitUnsupportedTest, explore, observeCore, renderJson, renderSpecs, renderText, renderTrace, replay, restrictSpec, runPinned, specLadder, testedRung, validateScenario };
|
|
21
21
|
|
|
22
22
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -36,6 +36,26 @@ interface Schedule {
|
|
|
36
36
|
*/
|
|
37
37
|
readonly turns?: readonly number[];
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Effect points a fault may hit, matched on the effect's call as an
|
|
41
|
+
* `EffectSelector` matches a record: `target` exactly, `op` when given,
|
|
42
|
+
* `where` and `atLeast` on dot paths into `{ args }`. `faults` narrows the
|
|
43
|
+
* kinds to those listed (each point still allows only its own); absent,
|
|
44
|
+
* every kind the point allows. An invariant's selector serves as a site
|
|
45
|
+
* when its paths are into `args`: its record `kind` is ignored, since a
|
|
46
|
+
* site always matches the call.
|
|
47
|
+
*/
|
|
48
|
+
interface FaultSite {
|
|
49
|
+
readonly target: string;
|
|
50
|
+
readonly op?: string;
|
|
51
|
+
readonly where?: {
|
|
52
|
+
readonly [path: string]: JsonValue;
|
|
53
|
+
};
|
|
54
|
+
readonly atLeast?: {
|
|
55
|
+
readonly [path: string]: number;
|
|
56
|
+
};
|
|
57
|
+
readonly faults?: readonly FaultKind[];
|
|
58
|
+
}
|
|
39
59
|
/** `snapshot` records platform state (e.g. D1 tables) captured at the end of a run; it is not an effect point. */
|
|
40
60
|
type EffectKind = "call" | "result" | "fault" | "snapshot";
|
|
41
61
|
/** One entry of the effect log: an effect's call, its result, an injected fault, or an end-of-run snapshot. */
|
|
@@ -204,6 +224,40 @@ interface Violation {
|
|
|
204
224
|
declare function checkInvariant(log: EffectLog, inv: Invariant): Violation | null;
|
|
205
225
|
/** Check every invariant against a run's effect log and return the violations, in the invariants' order. */
|
|
206
226
|
declare function checkInvariants(log: EffectLog, invariants: readonly Invariant[]): readonly Violation[];
|
|
227
|
+
/** One fault of a pinned schedule: the kind, at the `call`-th call of the run that `at` matches. */
|
|
228
|
+
interface PinnedFault {
|
|
229
|
+
/**
|
|
230
|
+
* The calls it may hit, matched as a fault site matches a point (target,
|
|
231
|
+
* op, `where` and `atLeast` on `args`); its `faults` stays unset, since
|
|
232
|
+
* `fault` names the one kind.
|
|
233
|
+
*/
|
|
234
|
+
readonly at: FaultSite;
|
|
235
|
+
/**
|
|
236
|
+
* Which of the calls `at` matches, from 1, in the order the run makes
|
|
237
|
+
* them, counting the points that may take a fault (under the bounds'
|
|
238
|
+
* fault sites, those they leave). Default 1.
|
|
239
|
+
*/
|
|
240
|
+
readonly call?: number;
|
|
241
|
+
readonly fault: FaultKind;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* A schedule a scenario carries: its faults, placed in every run of each
|
|
245
|
+
* seed in `seeds` (the run's seed, from which its virtual globals and, with
|
|
246
|
+
* several invocations in flight, its turns are drawn; default `[0]`).
|
|
247
|
+
*/
|
|
248
|
+
interface PinnedSchedule {
|
|
249
|
+
/** Names the schedule in the report and the regression test. */
|
|
250
|
+
readonly name: string;
|
|
251
|
+
readonly faults: readonly PinnedFault[];
|
|
252
|
+
readonly seeds?: readonly number[];
|
|
253
|
+
/**
|
|
254
|
+
* The turn picked at each scheduling decision with more than one option,
|
|
255
|
+
* as a recorded schedule has them (see `Schedule.turns`); absent, turns
|
|
256
|
+
* follow the seed. A run that exhaustive exploration picked records them,
|
|
257
|
+
* and the schedule written from it keeps them.
|
|
258
|
+
*/
|
|
259
|
+
readonly turns?: readonly number[];
|
|
260
|
+
}
|
|
207
261
|
/** Opaque, JSON-shaped data owned by a platform package. `kind` names its shape. */
|
|
208
262
|
interface PlatformData {
|
|
209
263
|
readonly kind: string;
|
|
@@ -253,6 +307,11 @@ interface Bounds {
|
|
|
253
307
|
readonly maxRedeliveries: number;
|
|
254
308
|
readonly maxConcurrentInvocations: number;
|
|
255
309
|
readonly budgetMs: number;
|
|
310
|
+
/**
|
|
311
|
+
* Where faults may go: a run spends its faults only at effect points one
|
|
312
|
+
* of these sites matches, of the kinds they list. Absent: anywhere.
|
|
313
|
+
*/
|
|
314
|
+
readonly faultsAt?: readonly FaultSite[];
|
|
256
315
|
}
|
|
257
316
|
/**
|
|
258
317
|
* A scenario as plain data: the Worker, the drive, the setup, the externals, the invariants and the
|
|
@@ -279,6 +338,14 @@ interface ScenarioSpec {
|
|
|
279
338
|
* inputs seen.
|
|
280
339
|
*/
|
|
281
340
|
readonly specs?: readonly string[];
|
|
341
|
+
/**
|
|
342
|
+
* Schedules the check runs before it explores, each placing its faults
|
|
343
|
+
* at the calls it names, under each of its seeds; a violation in one is
|
|
344
|
+
* reported as any violation is. Their faults go where they say among the
|
|
345
|
+
* points `bounds.faultsAt` leaves, however many `bounds.maxFaultsPerRun`
|
|
346
|
+
* allows exploration's runs.
|
|
347
|
+
*/
|
|
348
|
+
readonly pinned?: readonly PinnedSchedule[];
|
|
282
349
|
}
|
|
283
350
|
/** Every reason a spec is not usable; empty when it is. */
|
|
284
351
|
declare function validateScenario(spec: ScenarioSpec): readonly string[];
|
|
@@ -498,5 +565,5 @@ interface Platform {
|
|
|
498
565
|
/** Called when a run ends for any reason, after `finish` or after a failure: undo any per-run patching. */
|
|
499
566
|
cleanup?(spec: ScenarioSpec): Promise<void>;
|
|
500
567
|
}
|
|
501
|
-
export {
|
|
502
|
-
//# sourceMappingURL=platform-
|
|
568
|
+
export { FaultKind as A, Unique as C, EffectRecord as D, EffectLog as E, JsonValue as M, FaultSite as O, StateQuery as S, EffectSelector as T, checkInvariants as _, PlatformData as a, References as b, WorkerRef as c, PinnedSchedule as d, AtLeastOnce as f, checkInvariant as g, Violation as h, ExternalDecl as i, Schedule as j, FaultDecision as k, validateScenario as l, Invariant as m, Platform as n, ScenarioSpec as o, AtMostOncePerKey as p, Bounds as r, ScriptedResponse as s, EventRef as t, PinnedFault as u, EveryRow as v, Refines as w, RowCondition as x, Implies as y };
|
|
569
|
+
//# sourceMappingURL=platform-CawKCUru.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-CawKCUru.d.mts","names":[],"sources":["../../core/src/canonical-json.ts","../../core/src/faults.ts","../../core/src/fault-sites.ts","../../core/src/effect-log.ts","../../core/src/selectors.ts","../../core/src/refines.ts","../../core/src/state.ts","../../core/src/invariants.ts","../../core/src/pinned-schedules.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;;;;;;;;;;;UCjCM;WACN;WACA;WACA;cAAoB,eAAe;;WACnC;cAAsB;;WACtB,kBAAkB;;;KCfjB;;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;;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;;;;;;;;UASM;WACN;WACA;WACA,OAAO;WACP;;;;;;;;UASM;WACN;WACA;WACA,OAAO;WACP;WACA,IAAI;WACJ;;;UChDM;WACN;WACA;WACA,QAAQ;;WAER;;;UAIM;WACN;WACA;WACA,QAAQ;WACR;WACA,mBAAmB;;WAEnB;aAAwB;;;;KAqBvB,YACR,mBACA,cACA,WACA,UACA,SACA,aACA;;UAGa;WACN;WACA;;WAEA;;WAEA;;;iBAaK,eAAe,KAAK,WAAW,KAAK,YAAY;;iBAkDhD,gBACd,KAAK,WACL,qBAA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5D,QAAQ,GAAG,oBAAoB,YAAY,GAAG,qBAAqB,QAAQ;;;UAI5D,QAAQ;;WAEd,OAAO;;WAEP,MAAM;;UAGA;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;;;;;;;;;EAShE,eAAe,MAAM,wBAAwB;;EAE7C,QAAQ,MAAM,cAAc,OAAO,WAAW;;EAE9C,SAAS,MAAM,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as seedPrng, M as nextFloat, N as nextInt, P as nextU32, z as canonicalJson } from "./src-Whn0RMSh.mjs";
|
|
2
2
|
import { n as isSpec } from "./combinators-CLfsPfhT.mjs";
|
|
3
3
|
// packages/core/src/verdict.ts
|
|
4
4
|
/** One line per verdict, for error messages; full rendering lives in `report`. */
|
|
@@ -1452,6 +1452,7 @@ function emitRegressionTest(verdict, options) {
|
|
|
1452
1452
|
return [
|
|
1453
1453
|
"// Generated by Eutaxy. Replays a recorded violation; regenerate rather than edit.",
|
|
1454
1454
|
`// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.violation.message}`,
|
|
1455
|
+
...verdict.pinned === void 0 ? [] : [`// The run of the scenario's pinned schedule ${JSON.stringify(verdict.pinned)} under seed ${verdict.schedule.seed}, as it ran.`],
|
|
1455
1456
|
`import { checkInvariants, ${observe.length > 0 ? "observeCore, " : ""}replay, restrictSpec } from ${JSON.stringify(engineModule)};`,
|
|
1456
1457
|
...options.imports,
|
|
1457
1458
|
"import { expect, test } from \"vitest\";",
|
|
@@ -1470,6 +1471,43 @@ function emitRegressionTest(verdict, options) {
|
|
|
1470
1471
|
].join("\n");
|
|
1471
1472
|
}
|
|
1472
1473
|
/**
|
|
1474
|
+
* A Vitest test file that replays the run that made a check `UNSUPPORTED`, as its verdict's `replay`
|
|
1475
|
+
* names it (each fault at the call it hit, by target, op, arguments and call number), and expects
|
|
1476
|
+
* the run to place every fault and reach the same reason: a reproduction to look into, which fails
|
|
1477
|
+
* once the run no longer gets there. Only for `unsupported_api`, which one run reaches again (other
|
|
1478
|
+
* causes throw). `engineModule` as for `emitRegressionTest`; it exports `runPinned`.
|
|
1479
|
+
*/
|
|
1480
|
+
function emitUnsupportedTest(verdict, options) {
|
|
1481
|
+
if (verdict.cause !== "unsupported_api") throw new Error(`a ${verdict.cause} verdict is not reached again by replaying one run; only unsupported_api is`);
|
|
1482
|
+
if (verdict.replay === void 0) throw new Error("the verdict has no run to replay: it was reached before any run");
|
|
1483
|
+
const engineModule = options.engineModule ?? "eutaxy";
|
|
1484
|
+
const pinned = canonicalJson(verdict.replay);
|
|
1485
|
+
const observe = options.observe ?? [];
|
|
1486
|
+
const runLines = observe.length === 0 ? [` const run = await runPinned(${options.scenario}, platform, pinned);`] : [
|
|
1487
|
+
` const observers = [${observe.map((o) => `observeCore(${o.namespace}, ${JSON.stringify(o.functions)})`).join(", ")}];`,
|
|
1488
|
+
` const run = await runPinned(${options.scenario}, platform, pinned).finally(() => {`,
|
|
1489
|
+
" for (const o of observers) o.restore();",
|
|
1490
|
+
" });"
|
|
1491
|
+
];
|
|
1492
|
+
return [
|
|
1493
|
+
"// Generated by Eutaxy. Replays the run that made a check UNSUPPORTED; regenerate rather than edit.",
|
|
1494
|
+
`// Scenario ${verdict.scenario}, seed ${String(verdict.seed)}: ${verdict.cause}: ${verdict.reason.replace(/\s+/g, " ")}`,
|
|
1495
|
+
`import { ${observe.length > 0 ? "observeCore, " : ""}runPinned } from ${JSON.stringify(engineModule)};`,
|
|
1496
|
+
...options.imports,
|
|
1497
|
+
"import { expect, test } from \"vitest\";",
|
|
1498
|
+
"",
|
|
1499
|
+
pinned.includes("\"__proto__\"") ? `const pinned = JSON.parse(${JSON.stringify(pinned)});` : `const pinned = ${pinned} as const;`,
|
|
1500
|
+
"",
|
|
1501
|
+
`test(${JSON.stringify(`${verdict.scenario}: the recorded run still reaches what made the check UNSUPPORTED`)}, async () => {`,
|
|
1502
|
+
` const platform = ${options.platform};`,
|
|
1503
|
+
...runLines,
|
|
1504
|
+
" expect(run.unplaced).toEqual([]);",
|
|
1505
|
+
` expect(run.unsupportedReasons.join("; ")).toBe(${JSON.stringify(verdict.reason)});`,
|
|
1506
|
+
"});",
|
|
1507
|
+
""
|
|
1508
|
+
].join("\n");
|
|
1509
|
+
}
|
|
1510
|
+
/**
|
|
1473
1511
|
* The JSON report: one object, canonical, with a schema version at the top.
|
|
1474
1512
|
* Spec verdicts, when there are any, sit beside the scenario's, never in it.
|
|
1475
1513
|
*/
|
|
@@ -1601,9 +1639,15 @@ function renderText(verdict) {
|
|
|
1601
1639
|
out.push(`Invariant ${verdict.violation.invariant} is violated: ${verdict.violation.message}`);
|
|
1602
1640
|
out.push(`Keys: ${verdict.violation.keys.join(", ")}`);
|
|
1603
1641
|
out.push("");
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1642
|
+
if (verdict.pinned === void 0) {
|
|
1643
|
+
out.push(`Schedule (run seed ${verdict.schedule.seed}), events kept: ${verdict.keptEvents.join(", ")}`);
|
|
1644
|
+
out.push(...faultLines(verdict.schedule));
|
|
1645
|
+
out.push(`Shrunk: ${verdict.shrunk.eventsRemoved} event(s) and ${verdict.shrunk.faultsRemoved} fault(s) removed in ${verdict.shrunk.runs} run(s)`);
|
|
1646
|
+
} else {
|
|
1647
|
+
out.push(`Pinned schedule ${JSON.stringify(verdict.pinned)} (run seed ${verdict.schedule.seed}), as it ran, not shrunk; events: ${verdict.keptEvents.join(", ")}`);
|
|
1648
|
+
out.push(...faultLines(verdict.schedule));
|
|
1649
|
+
for (const u of verdict.unplaced ?? []) out.push(` not placed: ${u}`);
|
|
1650
|
+
}
|
|
1607
1651
|
out.push("");
|
|
1608
1652
|
out.push("Trace:");
|
|
1609
1653
|
out.push(renderTrace(verdict.trace, verdict.violation.evidence));
|
|
@@ -1640,6 +1684,6 @@ function renderText(verdict) {
|
|
|
1640
1684
|
for (const a of verdict.assumptions) out.push(` - ${a}`);
|
|
1641
1685
|
return out.join("\n");
|
|
1642
1686
|
}
|
|
1643
|
-
export {
|
|
1687
|
+
export { endpointNumber as _, renderText as a, describeVerdict as b, emitUnsupportedTest as c, testedRung as d, shrinkRefutation as f, endpointBigInt as g, conforms as h, renderSpecs as i, checkSpecModule as l, evaluate as m, renderSpecReport as n, renderTrace as o, checkedRung as p, renderSpecReportJson as r, emitRegressionTest as s, renderJson as t, specLadder as u, render as v, describeType as y };
|
|
1644
1688
|
|
|
1645
|
-
//# sourceMappingURL=src-
|
|
1689
|
+
//# sourceMappingURL=src-H1Q8ytEx.mjs.map
|