eutaxy 0.15.0 → 0.16.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.d.mts.map +1 -1
- package/dist/aws.mjs +53 -79
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/{cli-CzGCMudc.mjs → cli-DbLlYHTY.mjs} +406 -196
- package/dist/cli-DbLlYHTY.mjs.map +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/cloudflare.d.mts +7 -7
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +2 -2
- package/dist/delivery-invariants-90c5xBcd.mjs +44 -0
- package/dist/delivery-invariants-90c5xBcd.mjs.map +1 -0
- package/dist/{delivery-invariants-DzMy3iPs.d.mts → delivery-invariants-B8ZZnCZg.d.mts} +2 -2
- package/dist/{delivery-invariants-DzMy3iPs.d.mts.map → delivery-invariants-B8ZZnCZg.d.mts.map} +1 -1
- package/dist/{explore-B52m-wmk.d.mts → explore-DlwIUowm.d.mts} +2 -2
- package/dist/{explore-B52m-wmk.d.mts.map → explore-DlwIUowm.d.mts.map} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{platform-Ba1Kvdza.d.mts → platform-DPJTjpSr.d.mts} +56 -4
- package/dist/{platform-Ba1Kvdza.d.mts.map → platform-DPJTjpSr.d.mts.map} +1 -1
- package/dist/{src-ud5wEfnx.mjs → src-CmHdPsZy.mjs} +1297 -388
- package/dist/src-CmHdPsZy.mjs.map +1 -0
- package/dist/{src-nwQA9Xwr.mjs → src-Dz9Wn2vL.mjs} +2 -2
- package/dist/{src-nwQA9Xwr.mjs.map → src-Dz9Wn2vL.mjs.map} +1 -1
- package/dist/{workerd-Be43_PZo.mjs → workerd-D9cUGjYv.mjs} +571 -483
- package/dist/workerd-D9cUGjYv.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/cli-CzGCMudc.mjs.map +0 -1
- package/dist/delivery-invariants-BCtvzAfW.mjs +0 -67
- package/dist/delivery-invariants-BCtvzAfW.mjs.map +0 -1
- package/dist/src-ud5wEfnx.mjs.map +0 -1
- package/dist/workerd-Be43_PZo.mjs.map +0 -1
package/dist/cli.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as main } from "./cli-
|
|
1
|
+
export { t as main } from "./cli-DbLlYHTY.mjs";
|
package/dist/cloudflare.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { C as EffectSelector, S as Refines, _ as Implies, a as PlatformData, b as StateQuery, c as WorkerRef, f as Invariant, g as EveryRow, i as ExternalDecl, k as JsonValue, n as Platform, o as ScenarioSpec, r as Bounds, s as ScriptedResponse, u as AtLeastOnce, v as References, x as Unique, y as RowCondition } from "./platform-
|
|
2
|
-
import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-
|
|
3
|
-
import { c as ModuleSpecs, g as Violated, m as ScenarioVerdict, t as ExploreOptions } from "./explore-
|
|
1
|
+
import { C as EffectSelector, S as Refines, _ as Implies, a as PlatformData, b as StateQuery, c as WorkerRef, f as Invariant, g as EveryRow, i as ExternalDecl, k as JsonValue, n as Platform, o as ScenarioSpec, r as Bounds, s as ScriptedResponse, u as AtLeastOnce, v as References, x as Unique, y as RowCondition } from "./platform-DPJTjpSr.mjs";
|
|
2
|
+
import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-B8ZZnCZg.mjs";
|
|
3
|
+
import { c as ModuleSpecs, g as Violated, m as ScenarioVerdict, t as ExploreOptions } from "./explore-DlwIUowm.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.
|
|
@@ -56,10 +56,6 @@ interface CloudflareRegressionOptions {
|
|
|
56
56
|
}
|
|
57
57
|
/** A Vitest regression test for a Cloudflare scenario, to run under the Cloudflare Vitest plugin. */
|
|
58
58
|
export declare function cloudflareRegressionTest(verdict: Violated, options: CloudflareRegressionOptions): string;
|
|
59
|
-
/** Every user table's rows, sorted canonically, read through the real binding (not an effect). */
|
|
60
|
-
export declare function snapshotD1(real: D1Database): Promise<{
|
|
61
|
-
readonly [table: string]: readonly JsonValue[];
|
|
62
|
-
}>;
|
|
63
59
|
/** An object a setup seeds: its text, or its text with metadata. */
|
|
64
60
|
type R2Seed = string | {
|
|
65
61
|
readonly value: string;
|
|
@@ -563,6 +559,10 @@ export declare function calleeEnv(name: string, env: object, aliases?: Readonly<
|
|
|
563
559
|
export declare function check(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<ScenarioVerdict>;
|
|
564
560
|
/** For use from a test: passes only when the scenario is BOUNDED. */
|
|
565
561
|
export declare function expectHolds(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<void>;
|
|
562
|
+
/** Every user table's rows, sorted canonically, read through the real binding (not an effect). */
|
|
563
|
+
export declare function snapshotD1(real: D1Database): Promise<{
|
|
564
|
+
readonly [table: string]: readonly JsonValue[];
|
|
565
|
+
}>;
|
|
566
566
|
/**
|
|
567
567
|
* The Cloudflare Vitest plugin's test helpers, as exported by
|
|
568
568
|
* `cloudflare:test` (pass the module namespace). Typed loosely on purpose:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/
|
|
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":";;;;;;;UAOiB;;WAEN;;WAEA;;WAEA,aAAa,SAA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,kBAAkB;;;;;;UAOxD;;WAEN;;;;;;WAMA,SAAS,gBAAgB;;WAEzB,SAAS,SAAS;;WAElB;;;;;;WAMA,iBAAiB;;;;;WAKjB,UAAU,SAAS;;;;;;WAMnB,UAAU,SAAS,eAAe;;;;;;;;WAQlC,UAAU,SAAS;;;;;;;wBAsCd,yBAAyB,SAAS,4BAA4B;;KC1ElE;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;;UCtgBM;WACN;;WAEA,sBAAsB;WACtB;aAAmB;aAAwB;;WAC3C;aAA2B;cAAwB;;;WAEnD;aAAmB;cAAwB;;;;WAG3C,UAAU,SACjB;aAGa;aACA;aACA,QAAQ,SAAS;;;WAKvB,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,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 webSocketReceived, C as external, D as implies, E as httpResponse, F as rpc, G as cloudflareRegressionTest, H as workflow, I as rpcResponse, L as service, M as r2Rows, N as references, O as queue, P as refines, R as serviceCall, S as everyRow, T as http, U as workflowRows, V as websocket, W as workflowStep, _ as d1Write, a as createCloudflarePlatform, b as durableObjectRows, c as expectHolds, d as callee, f as cron, g as d1Schema, h as d1Rows, i as runDifferential, j as r2Op, k as queueAck, l as calleeEnv, m as d1Read, o as snapshotD1, p as d1Param, s as check, t as checkInWorkerd, u as atLeastOncePerMessage, v as defineScenario, w as fetchCall, x as durableObjectTable, y as durableObject, z as unique } from "./workerd-
|
|
1
|
+
import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-90c5xBcd.mjs";
|
|
2
|
+
import { A as r2Bucket, B as webSocketReceived, C as external, D as implies, E as httpResponse, F as rpc, G as cloudflareRegressionTest, H as workflow, I as rpcResponse, L as service, M as r2Rows, N as references, O as queue, P as refines, R as serviceCall, S as everyRow, T as http, U as workflowRows, V as websocket, W as workflowStep, _ as d1Write, a as createCloudflarePlatform, b as durableObjectRows, c as expectHolds, d as callee, f as cron, g as d1Schema, h as d1Rows, i as runDifferential, j as r2Op, k as queueAck, l as calleeEnv, m as d1Read, o as snapshotD1, p as d1Param, s as check, t as checkInWorkerd, u as atLeastOncePerMessage, v as defineScenario, w as fetchCall, x as durableObjectTable, y as durableObject, z as unique } from "./workerd-D9cUGjYv.mjs";
|
|
3
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, queue, queueAck, r2Bucket, r2Op, r2Rows, references, refines, rpc, rpcResponse, runDifferential, service, serviceCall, snapshotD1, unique, webSocketReceived, websocket, workflow, workflowRows, workflowStep };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { F as getPath } from "./src-CmHdPsZy.mjs";
|
|
2
|
+
// packages/core/src/delivery-invariants.ts
|
|
3
|
+
/**
|
|
4
|
+
* No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
|
|
5
|
+
* happened twice for one key, a payment recorded twice, a message sent twice.
|
|
6
|
+
*/
|
|
7
|
+
function atMostOncePerKey(name, effect, key) {
|
|
8
|
+
return {
|
|
9
|
+
kind: "atMostOncePerKey",
|
|
10
|
+
name,
|
|
11
|
+
effect,
|
|
12
|
+
key
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */
|
|
16
|
+
function atLeastOnce(name, effect, key, expected) {
|
|
17
|
+
return {
|
|
18
|
+
kind: "atLeastOnce",
|
|
19
|
+
name,
|
|
20
|
+
effect,
|
|
21
|
+
key,
|
|
22
|
+
expected
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Every event's `bodyKey` value must appear at least once as `key` in a
|
|
27
|
+
* selected effect. The expected keys are re-derived from the bodies that
|
|
28
|
+
* remain when shrinking removes events.
|
|
29
|
+
*/
|
|
30
|
+
function atLeastOncePerMessage(name, events, effect, key, bodyKey) {
|
|
31
|
+
const expected = [];
|
|
32
|
+
for (const e of events) {
|
|
33
|
+
const v = getPath(e.body, bodyKey);
|
|
34
|
+
if (v === void 0) throw new Error(`event ${e.id} has no ${JSON.stringify(bodyKey)} in its body`);
|
|
35
|
+
expected.push(v);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
...atLeastOnce(name, effect, key, expected),
|
|
39
|
+
perMessage: { bodyKey }
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export { atLeastOncePerMessage as n, atMostOncePerKey as r, atLeastOnce as t };
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=delivery-invariants-90c5xBcd.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-invariants-90c5xBcd.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 { C as EffectSelector, d as AtMostOncePerKey, k as JsonValue, u as AtLeastOnce } from "./platform-
|
|
1
|
+
import { C as EffectSelector, d as AtMostOncePerKey, k as JsonValue, u as AtLeastOnce } from "./platform-DPJTjpSr.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-B8ZZnCZg.d.mts.map
|
package/dist/{delivery-invariants-DzMy3iPs.d.mts.map → delivery-invariants-B8ZZnCZg.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-invariants-
|
|
1
|
+
{"version":3,"file":"delivery-invariants-B8ZZnCZg.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 { O as Schedule, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, w as EffectLog } from "./platform-
|
|
1
|
+
import { O as Schedule, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, w as EffectLog } from "./platform-DPJTjpSr.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;
|
|
@@ -241,4 +241,4 @@ declare function replay(spec: ScenarioSpec, platform: Platform, schedule: Schedu
|
|
|
241
241
|
*/
|
|
242
242
|
declare function explore(scenario: ScenarioSpec, platform: Platform, options: ExploreOptions): Promise<ScenarioVerdict>;
|
|
243
243
|
export { describeVerdict as _, Binder as a, ModuleSpecs as c, SpecType as d, Bounded as f, Violated as g, Unsupported as h, Arrow as i, Property as l, ScenarioVerdict as m, explore as n, FunctionSpec as o, BoundsReached as p, replay as r, Hint as s, ExploreOptions as t, SpecError as u };
|
|
244
|
-
//# sourceMappingURL=explore-
|
|
244
|
+
//# sourceMappingURL=explore-DlwIUowm.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore-
|
|
1
|
+
{"version":3,"file":"explore-DlwIUowm.d.mts","names":[],"sources":["../../core/src/verdict.ts","../../spec/src/ir.ts","../../engine/src/explore.ts"],"mappings":";;UAQiB;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;;;UAIF,gBAAgB;WACtB;WACA,QAAQ;;KAGP;;UAOK,oBAAoB;WAC1B;WACA,OAAO;WACP;;;KAIC,kBAAkB,WAAW,UAAU;;iBAGnC,gBAAgB,GAAG;;;;;;;;;;;KC/DvB;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;;;UC5FX;WACN;;WAEA;;;;;;;;WAQA;;;;;;;WAOA;;WAEA;;WAEA;;;;;;WAMA;;;;;;;;WAQA;aAAkC;;;;iBAmMvB,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 EffectSelector, D as FaultKind, E as FaultDecision, O as Schedule, S as Refines, T as EffectRecord, _ as Implies, b as StateQuery, d as AtMostOncePerKey, f as Invariant, g as EveryRow, h as checkInvariants, l as validateScenario, m as checkInvariant, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, t as EventRef, u as AtLeastOnce, w as EffectLog, x as Unique, y as RowCondition } from "./platform-
|
|
2
|
-
import { _ as describeVerdict, a as Binder, c as ModuleSpecs, d as SpecType, f as Bounded, g as Violated, h as Unsupported, i as Arrow, l as Property, m as ScenarioVerdict, n as explore, o as FunctionSpec, p as BoundsReached, r as replay, s as Hint, t as ExploreOptions, u as SpecError } from "./explore-
|
|
1
|
+
import { C as EffectSelector, D as FaultKind, E as FaultDecision, O as Schedule, S as Refines, T as EffectRecord, _ as Implies, b as StateQuery, d as AtMostOncePerKey, f as Invariant, g as EveryRow, h as checkInvariants, l as validateScenario, m as checkInvariant, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, t as EventRef, u as AtLeastOnce, w as EffectLog, x as Unique, y as RowCondition } from "./platform-DPJTjpSr.mjs";
|
|
2
|
+
import { _ as describeVerdict, a as Binder, c as ModuleSpecs, d as SpecType, f as Bounded, g as Violated, h as Unsupported, i as Arrow, l as Property, m as ScenarioVerdict, n as explore, o as FunctionSpec, p as BoundsReached, r as replay, s as Hint, t as ExploreOptions, u as SpecError } from "./explore-DlwIUowm.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.
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import { a as renderText, f as checkedRung, i as renderSpecs, l as specLadder, o as renderTrace, s as emitRegressionTest, t as renderJson, u as testedRung, y as describeVerdict } from "./src-
|
|
1
|
+
import { D as checkInvariants, E as checkInvariant, T as validateScenario, a as explore, o as replay, s as restrictSpec, t as observeCore } from "./src-CmHdPsZy.mjs";
|
|
2
|
+
import { a as renderText, f as checkedRung, i as renderSpecs, l as specLadder, o as renderTrace, s as emitRegressionTest, t as renderJson, u as testedRung, y as describeVerdict } from "./src-Dz9Wn2vL.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`. */
|
|
@@ -325,6 +325,20 @@ interface EffectOptions {
|
|
|
325
325
|
* async context of the code the perform runs.
|
|
326
326
|
*/
|
|
327
327
|
readonly onAbandon?: () => void;
|
|
328
|
+
/**
|
|
329
|
+
* The hosted code is `host`'s: an object's that stays alive after this
|
|
330
|
+
* effect ends (a Durable Object, named `<target>/<object>`). The platform
|
|
331
|
+
* enters that code through `RunHooks.hostedCode`, so an effect it makes is
|
|
332
|
+
* this effect's while one of `host`'s effects is being performed and, once
|
|
333
|
+
* none is, is work of `host`'s own after its answer (a promise it did not
|
|
334
|
+
* await, a timer it set): an invocation `<host>/after`, whose effects are
|
|
335
|
+
* turns of their own and take faults by their position in it, alive until
|
|
336
|
+
* nothing of it can move and revived by work woken later; a crash in it
|
|
337
|
+
* resets the object (`onAbandon`). Timers `host`'s code sets are its too.
|
|
338
|
+
* Without `host`, what hosted code leaves running is the hosting
|
|
339
|
+
* invocation's and ends with it.
|
|
340
|
+
*/
|
|
341
|
+
readonly host?: string;
|
|
328
342
|
/**
|
|
329
343
|
* Whether an effect the hosted code makes may wait for its turn now. False
|
|
330
344
|
* while the hosted code holds every other event out (a Durable Object
|
|
@@ -370,6 +384,18 @@ interface RunHooks {
|
|
|
370
384
|
* invocations only one runs at a time, so this is always the caller.
|
|
371
385
|
*/
|
|
372
386
|
running(): string;
|
|
387
|
+
/**
|
|
388
|
+
* Run `code` as `host`'s own (see `EffectOptions.host`), where the runtime
|
|
389
|
+
* does not carry async context into it: an object's method about to be
|
|
390
|
+
* called, its alarm or WebSocket handler. `op` names the call the code is
|
|
391
|
+
* (a stub call's method or property), so the code is matched to the
|
|
392
|
+
* effect of the host's with that `op` whose call has not started. Timers
|
|
393
|
+
* inside are virtual, as for handler code. Code already running as the
|
|
394
|
+
* host's that enters again (a method calling another) stays what it was.
|
|
395
|
+
*/
|
|
396
|
+
hostedCode<T>(host: string, code: () => T, op?: string): T;
|
|
397
|
+
/** The platform dropped `host`'s instance (an eviction after a crash): work of its after an answer is gone with it. */
|
|
398
|
+
hostReset(host: string): void;
|
|
373
399
|
/**
|
|
374
400
|
* Queue an event now, before the current delivery finishes, e.g. a resend
|
|
375
401
|
* the caller makes as soon as it gives up while the handler's background
|
|
@@ -381,11 +407,37 @@ interface RunHooks {
|
|
|
381
407
|
snapshot(invocation: string, target: string, payload: JsonValue): void;
|
|
382
408
|
/**
|
|
383
409
|
* Wait for user code under the engine's virtual clock: real I/O completes,
|
|
384
|
-
* timers fire while the invocation is idle, and
|
|
385
|
-
*
|
|
386
|
-
*
|
|
410
|
+
* timers fire while the invocation is idle, and once the invocation has
|
|
411
|
+
* crashed the wait rejects with the engine's crash signal, seen on the
|
|
412
|
+
* run's own tick (whatever the crash itself settled may never wake its
|
|
413
|
+
* waiters: a Durable Object's reset tears down the task it happened in).
|
|
414
|
+
* Platforms await handler and background promises through this, never
|
|
415
|
+
* directly, and treat the crash signal as the invocation's end.
|
|
387
416
|
*/
|
|
388
417
|
settle<T>(promise: Promise<T>, invocation: string): Promise<T>;
|
|
418
|
+
/**
|
|
419
|
+
* Run `code` as an attempt of `invocation`'s that the platform gives up on
|
|
420
|
+
* once it has outlived `deadlineMs` of virtual time with its result still
|
|
421
|
+
* pending (a Workflow step attempt past its `timeout`), or at once when
|
|
422
|
+
* `deadlineMs` is 0 or less (a fault that says the attempt timed out). The
|
|
423
|
+
* code is not stopped, as the runtime cannot stop it either: from then on
|
|
424
|
+
* the effects it goes on to make are late turns. In a concurrent run a late
|
|
425
|
+
* turn is offered at every decision but holds nothing: while only late
|
|
426
|
+
* turns are parked, time may pass to the next timer or delayed event
|
|
427
|
+
* instead, so what the late code still does lands before, between or after
|
|
428
|
+
* what the invocation did since it gave up; once nothing else can move, the
|
|
429
|
+
* late turns run. In a sequential run the late code runs on as it would,
|
|
430
|
+
* before timers not yet due. The deadline is the engine's, not a timer of
|
|
431
|
+
* the code's: it leaves no trace and does not count as reading the clock.
|
|
432
|
+
*/
|
|
433
|
+
attempt<T>(invocation: string, code: () => T, deadlineMs: number): Attempt<T>;
|
|
434
|
+
}
|
|
435
|
+
/** An attempt started with `RunHooks.attempt`. */
|
|
436
|
+
interface Attempt<T> {
|
|
437
|
+
/** What the code returned. */
|
|
438
|
+
readonly value: T;
|
|
439
|
+
/** Resolves once the attempt is late (the deadline passed with its result pending); never, when it finished in time. */
|
|
440
|
+
readonly late: Promise<void>;
|
|
389
441
|
}
|
|
390
442
|
interface DeliveryResult {
|
|
391
443
|
readonly status: "completed" | "errored" | "crashed";
|
|
@@ -422,4 +474,4 @@ interface Platform {
|
|
|
422
474
|
cleanup?(spec: ScenarioSpec): Promise<void>;
|
|
423
475
|
}
|
|
424
476
|
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 };
|
|
425
|
-
//# sourceMappingURL=platform-
|
|
477
|
+
//# sourceMappingURL=platform-DPJTjpSr.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-
|
|
1
|
+
{"version":3,"file":"platform-DPJTjpSr.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;WAA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