eutaxy 0.9.0 → 0.10.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 +12 -9
- package/dist/aws.d.mts +2 -2
- package/dist/aws.d.mts.map +1 -1
- package/dist/aws.mjs +20 -36
- package/dist/aws.mjs.map +1 -1
- package/dist/bin.mjs +2 -2
- package/dist/cli-Di86EM3f.mjs +2 -0
- package/dist/cli.mjs +2 -2
- package/dist/cloudflare.d.mts +149 -14
- package/dist/cloudflare.d.mts.map +1 -1
- package/dist/cloudflare.mjs +3 -3
- package/dist/delivery-invariants-Br29H7Rg.mjs +62 -0
- package/dist/delivery-invariants-Br29H7Rg.mjs.map +1 -0
- package/dist/{delivery-invariants-DfPkJL0Q.d.mts → delivery-invariants-DZOBkCMR.d.mts} +2 -2
- package/dist/{delivery-invariants-DfPkJL0Q.d.mts.map → delivery-invariants-DZOBkCMR.d.mts.map} +1 -1
- package/dist/{explore-Rwe1PPqX.d.mts → explore-B7aR_5Hy.d.mts} +2 -2
- package/dist/{explore-Rwe1PPqX.d.mts.map → explore-B7aR_5Hy.d.mts.map} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/{platform-Bpnav0kn.d.mts → platform-CCz48WF9.d.mts} +30 -30
- package/dist/platform-CCz48WF9.d.mts.map +1 -0
- package/dist/{src-BZtuuu_j.mjs → src-CWVQEhTr.mjs} +2 -2
- package/dist/{src-BZtuuu_j.mjs.map → src-CWVQEhTr.mjs.map} +1 -1
- package/dist/{src-BO7I3f-1.mjs → src-DGh7w877.mjs} +470 -265
- package/dist/src-DGh7w877.mjs.map +1 -0
- package/dist/{src-BzZU6eGF.mjs → src-MX90l1IH.mjs} +5301 -3469
- package/dist/src-MX90l1IH.mjs.map +1 -0
- package/package.json +1 -1
- package/dist/cli-DpeAhtU5.mjs +0 -2
- package/dist/delivery-invariants-hmhwh_qD.mjs +0 -39
- package/dist/delivery-invariants-hmhwh_qD.mjs.map +0 -1
- package/dist/platform-Bpnav0kn.d.mts.map +0 -1
- package/dist/src-BO7I3f-1.mjs.map +0 -1
- package/dist/src-BzZU6eGF.mjs.map +0 -1
package/dist/bin.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import "./cli-
|
|
2
|
+
import { R as main } from "./src-MX90l1IH.mjs";
|
|
3
|
+
import "./cli-Di86EM3f.mjs";
|
|
4
4
|
// packages/eutaxy/src/bin.ts
|
|
5
5
|
process.stdout.on("error", (err) => {
|
|
6
6
|
if (err.code === "EPIPE") process.exit(process.exitCode ?? 0);
|
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import "./cli-
|
|
1
|
+
export { R as main } from "./src-MX90l1IH.mjs";
|
|
2
|
+
import "./cli-Di86EM3f.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 { 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-CCz48WF9.mjs";
|
|
2
|
+
import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-DZOBkCMR.mjs";
|
|
3
|
+
import { c as ModuleSpecs, g as Violated, m as ScenarioVerdict, t as ExploreOptions } from "./explore-B7aR_5Hy.mjs";
|
|
4
4
|
interface CloudflareRegressionOptions {
|
|
5
5
|
/** Import path of the scenario module, relative to the emitted file. */
|
|
6
6
|
readonly scenarioPath: string;
|
|
@@ -17,7 +17,12 @@ interface CloudflareRegressionOptions {
|
|
|
17
17
|
readonly maxRetries?: number;
|
|
18
18
|
/** The scenario sets up Durable Objects: pass the Cloudflare test helpers to the platform. */
|
|
19
19
|
readonly durableObjects?: boolean;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Pass the Worker module's exports to the platform: the scenario sets up
|
|
22
|
+
* Workflows (their classes are among them) or drives a named entrypoint.
|
|
23
|
+
*/
|
|
24
|
+
readonly exports?: boolean;
|
|
25
|
+
/** @deprecated Use `exports`. */
|
|
21
26
|
readonly workflows?: boolean;
|
|
22
27
|
readonly expect?: "holds" | "violates";
|
|
23
28
|
readonly engineModule?: string;
|
|
@@ -51,12 +56,19 @@ interface DurableObjectTestHelpers {
|
|
|
51
56
|
interface WorkerHandler {
|
|
52
57
|
queue?(batch: MessageBatch<unknown>, env: unknown, ctx: ExecutionContext): void | Promise<void>;
|
|
53
58
|
fetch?(request: Request, env: unknown, ctx: ExecutionContext): Response | Promise<Response>;
|
|
59
|
+
scheduled?(controller: ScheduledController, env: unknown, ctx: ExecutionContext): void | Promise<void>;
|
|
54
60
|
}
|
|
61
|
+
/** A `WorkerEntrypoint` subclass: the Worker's default export when it exposes RPC methods. Its env is its own. */
|
|
62
|
+
type WorkerEntrypointClass = abstract new (ctx: ExecutionContext, env: never) => object;
|
|
55
63
|
interface CloudflarePlatformOptions {
|
|
56
64
|
/** The bindings from `cloudflare:workers`. */
|
|
57
65
|
readonly env: object;
|
|
58
|
-
/**
|
|
59
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The Worker's default export: the handler object, or the
|
|
68
|
+
* `WorkerEntrypoint` class the `rpc` drive calls (its own `fetch()`
|
|
69
|
+
* method is not driven by `http()` yet).
|
|
70
|
+
*/
|
|
71
|
+
readonly handler: WorkerHandler | WorkerEntrypointClass;
|
|
60
72
|
/** Schema SQL per D1 binding named in the scenario's setup. */
|
|
61
73
|
readonly schemas: Readonly<Record<string, string>>;
|
|
62
74
|
/** Cloudflare's default when the consumer does not set max_retries. */
|
|
@@ -79,10 +91,12 @@ type AttemptRecord = {
|
|
|
79
91
|
readonly event: string;
|
|
80
92
|
readonly attempt: number;
|
|
81
93
|
readonly status: "completed" | "errored";
|
|
82
|
-
/** Queue drive: the acknowledgement that took effect. */
|
|
83
|
-
readonly decision: "ack" | "retry" | null;
|
|
94
|
+
/** Queue drive: the acknowledgement that took effect. Cron drive: `no_retry` when the handler asked for none. */
|
|
95
|
+
readonly decision: "ack" | "retry" | "no_retry" | null;
|
|
84
96
|
/** HTTP drive: the response status the caller saw (500 for an uncaught exception). */
|
|
85
97
|
readonly response?: number;
|
|
98
|
+
/** RPC drive: the answer the caller saw, `{ ok: true, value }` or `{ ok: false, error }`. */
|
|
99
|
+
readonly result?: JsonValue;
|
|
86
100
|
};
|
|
87
101
|
interface Side {
|
|
88
102
|
readonly attempts: readonly AttemptRecord[];
|
|
@@ -170,6 +184,70 @@ interface HttpCallerOptions {
|
|
|
170
184
|
readonly deadlineMs?: number;
|
|
171
185
|
}
|
|
172
186
|
export declare function http(requests: readonly HttpRequestInput[], options?: HttpCallerOptions): HttpDrive;
|
|
187
|
+
/** One RPC call; `id` defaults to its position, `args` to none. */
|
|
188
|
+
interface RpcCallInput {
|
|
189
|
+
readonly id?: string;
|
|
190
|
+
readonly method: string;
|
|
191
|
+
readonly args?: readonly JsonValue[];
|
|
192
|
+
}
|
|
193
|
+
/** A type alias, not an interface, so it is assignable to the JSON shape of `PlatformData`. */
|
|
194
|
+
type RpcCallSpec = {
|
|
195
|
+
readonly id: string;
|
|
196
|
+
readonly method: string;
|
|
197
|
+
readonly args: readonly JsonValue[];
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Drive a `WorkerEntrypoint` of the Worker with these method calls, one
|
|
201
|
+
* invocation per attempt, the entrypoint constructed anew for each. The
|
|
202
|
+
* entrypoint is the Worker's default export, or the named export
|
|
203
|
+
* `entrypoint`. Cloudflare does not retry an RPC call; the caller resends
|
|
204
|
+
* a call that threw or got no answer up to `retries` times (default 0: a
|
|
205
|
+
* calling Worker resends only when written to), after `delaysMs` of
|
|
206
|
+
* virtual time, and gives up waiting at `deadlineMs`, as the HTTP drive's
|
|
207
|
+
* caller does.
|
|
208
|
+
*/
|
|
209
|
+
interface RpcDrive extends PlatformData {
|
|
210
|
+
readonly kind: "rpc";
|
|
211
|
+
readonly entrypoint?: string;
|
|
212
|
+
readonly calls: readonly RpcCallSpec[];
|
|
213
|
+
readonly retries: number;
|
|
214
|
+
readonly delaysMs?: readonly number[];
|
|
215
|
+
readonly deadlineMs?: number;
|
|
216
|
+
}
|
|
217
|
+
interface RpcCallerOptions {
|
|
218
|
+
readonly entrypoint?: string;
|
|
219
|
+
readonly retries?: number;
|
|
220
|
+
readonly delaysMs?: readonly number[];
|
|
221
|
+
readonly deadlineMs?: number;
|
|
222
|
+
}
|
|
223
|
+
export declare function rpc(calls: readonly RpcCallInput[], options?: RpcCallerOptions): RpcDrive;
|
|
224
|
+
/** One tick of a Cron Trigger: its id and the virtual time it fires, which the handler sees as `scheduledTime`. */
|
|
225
|
+
type CronTickSpec = {
|
|
226
|
+
readonly id: string;
|
|
227
|
+
readonly at: number;
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Drive the Worker's `scheduled()` handler with the ticks of a Cron Trigger:
|
|
231
|
+
* the expression's first `ticks` matches from the virtual epoch on, in UTC,
|
|
232
|
+
* each an event delivered at its virtual time. Cloudflare documents
|
|
233
|
+
* `noRetry()` but no retry count, so the drive declares how many times a
|
|
234
|
+
* tick whose handler failed is re-run (`retries`, default 0); a handler that
|
|
235
|
+
* called `noRetry()` is not re-run.
|
|
236
|
+
*/
|
|
237
|
+
interface CronDrive extends PlatformData {
|
|
238
|
+
readonly kind: "cron";
|
|
239
|
+
readonly cron: string;
|
|
240
|
+
readonly ticks: readonly CronTickSpec[];
|
|
241
|
+
readonly retries: number;
|
|
242
|
+
}
|
|
243
|
+
interface CronOptions {
|
|
244
|
+
/** How many ticks to drive, from the first match on (default 1). */
|
|
245
|
+
readonly ticks?: number;
|
|
246
|
+
readonly retries?: number;
|
|
247
|
+
}
|
|
248
|
+
export declare function cron(expression: string, options?: CronOptions): CronDrive;
|
|
249
|
+
/** The drives a Cloudflare scenario can have. */
|
|
250
|
+
type Drive = QueueDrive | HttpDrive | RpcDrive | CronDrive;
|
|
173
251
|
/** Apply a SQL file to a D1 binding before each run. */
|
|
174
252
|
interface D1Setup extends PlatformData {
|
|
175
253
|
readonly kind: "d1";
|
|
@@ -233,6 +311,47 @@ interface WorkflowSetup extends PlatformData {
|
|
|
233
311
|
export declare function workflow(binding: string, className: string, options?: {
|
|
234
312
|
readonly name?: string;
|
|
235
313
|
}): WorkflowSetup;
|
|
314
|
+
/** A scripted method's reply: a value returned to the caller, or an error (`"<Name>: <message>"`) thrown to it. */
|
|
315
|
+
type ScriptedReply = {
|
|
316
|
+
readonly returns: JsonValue;
|
|
317
|
+
} | {
|
|
318
|
+
readonly throws: string;
|
|
319
|
+
};
|
|
320
|
+
/** A reply to `fetch()` through a service binding; a type alias of core's `ScriptedResponse`, for the JSON shape. */
|
|
321
|
+
type ServiceResponse = {
|
|
322
|
+
readonly method?: string;
|
|
323
|
+
readonly path?: string;
|
|
324
|
+
readonly status: number;
|
|
325
|
+
readonly headers?: {
|
|
326
|
+
readonly [name: string]: string;
|
|
327
|
+
};
|
|
328
|
+
readonly body?: JsonValue;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Script the Worker another Worker reaches through a service binding: its
|
|
332
|
+
* RPC methods answer from `methods` (every method returns `null` when
|
|
333
|
+
* omitted; a method missing from a present `methods` makes the run
|
|
334
|
+
* UNSUPPORTED) and its `fetch()` from `fetch`, matched by method and path
|
|
335
|
+
* as an external's responses are (200 with an empty body when omitted).
|
|
336
|
+
* The real binding is never called. Each call is one effect,
|
|
337
|
+
* `Service:<binding>`, with the faults of a Durable Object stub call.
|
|
338
|
+
*/
|
|
339
|
+
interface ServiceSetup extends PlatformData {
|
|
340
|
+
readonly kind: "service";
|
|
341
|
+
readonly binding: string;
|
|
342
|
+
readonly methods?: {
|
|
343
|
+
readonly [method: string]: ScriptedReply;
|
|
344
|
+
};
|
|
345
|
+
readonly fetch?: readonly ServiceResponse[];
|
|
346
|
+
}
|
|
347
|
+
export declare function service(binding: string, options?: {
|
|
348
|
+
readonly methods?: {
|
|
349
|
+
readonly [method: string]: ScriptedReply;
|
|
350
|
+
};
|
|
351
|
+
readonly fetch?: readonly ServiceResponse[];
|
|
352
|
+
}): ServiceSetup;
|
|
353
|
+
/** Selects the calls through a service binding that completed, one method's or all. */
|
|
354
|
+
export declare function serviceCall(binding: string, method?: string): EffectSelector;
|
|
236
355
|
/** Selects a Workflow's step attempts, optionally of one step; a failed attempt's result carries its error. */
|
|
237
356
|
export declare function workflowStep(binding: string, step?: string): EffectSelector;
|
|
238
357
|
/** A Workflow's instances at the end of the run as rows `{ id, status, params, output?, error? }`. */
|
|
@@ -245,12 +364,12 @@ export declare function durableObjectRows(binding: string, object: string, where
|
|
|
245
364
|
interface CloudflareScenarioInput {
|
|
246
365
|
readonly name: string;
|
|
247
366
|
readonly worker: WorkerRef;
|
|
248
|
-
readonly drive: QueueDrive | HttpDrive | {
|
|
367
|
+
readonly drive: QueueDrive | HttpDrive | RpcDrive | CronDrive | {
|
|
249
368
|
readonly kind: "queue";
|
|
250
369
|
readonly queue: string;
|
|
251
370
|
readonly messages: readonly QueueMessage[];
|
|
252
371
|
};
|
|
253
|
-
readonly setup?: readonly (D1Setup | DurableObjectSetup | R2Setup | WorkflowSetup)[];
|
|
372
|
+
readonly setup?: readonly (D1Setup | DurableObjectSetup | R2Setup | WorkflowSetup | ServiceSetup)[];
|
|
254
373
|
readonly externals?: readonly ExternalDecl[];
|
|
255
374
|
readonly invariants: readonly Invariant[];
|
|
256
375
|
readonly bounds?: Partial<Bounds>;
|
|
@@ -280,10 +399,12 @@ export declare function d1Param(index: number): string;
|
|
|
280
399
|
*/
|
|
281
400
|
export declare function refines(name: string, decision: string, effect: EffectSelector, options?: Pick<Refines, "follows" | "state">): Refines;
|
|
282
401
|
/**
|
|
283
|
-
* Every message's (or request's) `bodyKey` value must appear at
|
|
284
|
-
* as `key` in a selected effect: nothing the drive delivered may
|
|
402
|
+
* Every message's (or request's, or call's) `bodyKey` value must appear at
|
|
403
|
+
* least once as `key` in a selected effect: nothing the drive delivered may
|
|
404
|
+
* be lost. For an RPC drive `bodyKey` is a path into the call's arguments
|
|
405
|
+
* (`"0.orderId"`).
|
|
285
406
|
*/
|
|
286
|
-
export declare function atLeastOncePerMessage(name: string, drive:
|
|
407
|
+
export declare function atLeastOncePerMessage(name: string, drive: Drive, effect: EffectSelector, key: string, bodyKey: string): AtLeastOnce;
|
|
287
408
|
/**
|
|
288
409
|
* Selects the responses the Worker returned for a path (`ok` narrows to 2xx
|
|
289
410
|
* or to everything else). One `result` per attempt: a crash before the
|
|
@@ -292,6 +413,15 @@ export declare function atLeastOncePerMessage(name: string, drive: QueueDrive |
|
|
|
292
413
|
export declare function httpResponse(path: string, options?: {
|
|
293
414
|
readonly ok?: boolean;
|
|
294
415
|
}): EffectSelector;
|
|
416
|
+
/**
|
|
417
|
+
* Selects the answers an RPC method gave (`ok` narrows to values returned
|
|
418
|
+
* or to errors thrown). One `result` per attempt: a crash before the
|
|
419
|
+
* response leaves none.
|
|
420
|
+
*/
|
|
421
|
+
export declare function rpcResponse(method: string, options?: {
|
|
422
|
+
readonly ok?: boolean;
|
|
423
|
+
readonly entrypoint?: string;
|
|
424
|
+
}): EffectSelector;
|
|
295
425
|
/** Rows of a D1 table in the end-of-run snapshot, optionally filtered. */
|
|
296
426
|
export declare function d1Rows(binding: string, table: string, where?: readonly RowCondition[]): StateQuery;
|
|
297
427
|
/** Every row the query selects satisfies all conditions. */
|
|
@@ -332,6 +462,11 @@ interface CheckTransport {
|
|
|
332
462
|
readonly kind: string;
|
|
333
463
|
readonly [key: string]: unknown;
|
|
334
464
|
}[];
|
|
465
|
+
/** The scenario's drive, for what the regression test must pass the platform (a named entrypoint). */
|
|
466
|
+
readonly drive?: {
|
|
467
|
+
readonly kind: string;
|
|
468
|
+
readonly [key: string]: unknown;
|
|
469
|
+
};
|
|
335
470
|
/** The core modules observed (as the scenario's specs name them) and the functions on each. */
|
|
336
471
|
readonly observed?: readonly {
|
|
337
472
|
readonly module: string;
|
|
@@ -370,5 +505,5 @@ interface WorkerdCheckInput {
|
|
|
370
505
|
}
|
|
371
506
|
/** Run the scenario's check, with its specs observed, and return what the CLI reads back. */
|
|
372
507
|
export declare function checkInWorkerd(input: WorkerdCheckInput): Promise<CheckTransport>;
|
|
373
|
-
export { type CheckTransport, type CloudflarePlatformOptions, type CloudflareRegressionOptions, type CloudflareScenarioInput, type D1Setup, type DifferentialResult, type DurableObjectSetup, type DurableObjectTestHelpers, type HttpCallerOptions, type HttpDrive, type HttpRequestInput, type HttpRequestSpec, type QueueDrive, type QueueMessage, type R2Setup, type SpecEntry, type WorkerHandler, type WorkerdCheckInput, type WorkflowSetup, atLeastOnce, atMostOncePerKey };
|
|
508
|
+
export { type CheckTransport, type CloudflarePlatformOptions, type CloudflareRegressionOptions, type CloudflareScenarioInput, type CronDrive, type CronOptions, type CronTickSpec, type D1Setup, type DifferentialResult, type DurableObjectSetup, type DurableObjectTestHelpers, type HttpCallerOptions, type HttpDrive, type HttpRequestInput, type HttpRequestSpec, type QueueDrive, type QueueMessage, type R2Setup, type RpcCallInput, type RpcCallSpec, type RpcCallerOptions, type RpcDrive, type ScriptedReply, type ServiceResponse, type ServiceSetup, type SpecEntry, type WorkerEntrypointClass, type WorkerHandler, type WorkerdCheckInput, type WorkflowSetup, atLeastOnce, atMostOncePerKey };
|
|
374
509
|
//# sourceMappingURL=cloudflare.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/check.ts","../../cloudflare/src/d1.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.ts","../../cloudflare/src/r2.ts","../../cloudflare/src/scenario.ts","../../cli/src/workerd.ts"],"mappings":";;;UAGiB;;WAEN;;WAEA;;WAEA,aAAa,SAAS;;;;;WAKtB;;WAEA;;WAEA;;WAEA;WACA;WACA;;WAEA;aACE;aACA;;;;wBAKG,yBACd,SAAS,UACT,SAAS;;
|
|
1
|
+
{"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/check.ts","../../cloudflare/src/d1.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.ts","../../cloudflare/src/r2.ts","../../cloudflare/src/scenario.ts","../../cli/src/workerd.ts"],"mappings":";;;UAGiB;;WAEN;;WAEA;;WAEA,aAAa,SAAS;;;;;WAKtB;;WAEA;;WAEA;;;;;WAKA;;WAEA;WACA;WACA;;WAEA;aACE;aACA;;;;wBAKG,yBACd,SAAS,UACT,SAAS;;wBC7BK,MACd,MAAM,cACN,UAAU,UACV,UAAS,iBACR,QAAQ;;wBAKW,YACpB,MAAM,cACN,UAAU,UACV,UAAU,iBACT;;wBC0OmB,WACpB,MAAM,aACL;YAAoB,yBAAyB;;;;;;;UCzO/B;WACN;WACA;WACA;;;UCQM;EACf,OAAO,OAAO,uBAAuB,cAAc,KAAK,0BAA0B;EAClF,OAAO,SAAS,SAAS,cAAc,KAAK,mBAAmB,WAAW,QAAQ;EAClF,WACE,YAAY,qBACZ,cACA,KAAK,0BACG;;;KAIA,sCAAsC,KAAK,kBAAkB;UAExD;;WAEN;;;;;;WAMA,SAAS,gBAAgB;;WAEzB,SAAS,SAAS;;WAElB;;;;;;WAMA,iBAAiB;;;;;WAKjB,UAAU,SAAS;;wBA+Bd,yBAAyB,SAAS,4BAA4B;;KC/DlE;WACD;WACA;WACA;;WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,mBAAmB;WACnB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AA4B,qBAAqB;IACpE;;;;;wBAaa,UAAU,sBAAsB,kBAAkB;;wBA0FlD,eAAe,OAAO,0BAA0B;;UC3sB/C;WACN;;WAEA,sBAAsB;WACtB;aAAmB;aAAwB;;WAC3C;aAA2B;cAAwB;;;WAEnD;aAAmB;cAAwB;;;WAE3C;aAA+B;aAAyB;;;UAGlD;WACN;WACA;WACA;;;UAIM;WACN,OAAO;WACP,YAAY;;;KAIX,aAAa,SAAS,qBAAqB;UAqFtC;;WAEN,UAAU;;WAEV;;WAEA,gBAAgB;;WAEhB,UAAU,SAAS;;WAEnB,SAAS;;WAET,aAAa,SAAS,eAAe;WACrC;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
|
|
3
|
-
export { atLeastOnce, atLeastOncePerMessage, atMostOncePerKey, check, checkInWorkerd, cloudflareRegressionTest, createCloudflarePlatform, d1Param, d1Read, d1Rows, d1Schema, d1Write, defineScenario, durableObject, durableObjectRows, everyRow, expectHolds, external, fetchCall, http, httpResponse, implies, queue, queueAck, r2Bucket, r2Op, r2Rows, references, refines, runDifferential, snapshotD1, unique, workflow, workflowRows, workflowStep };
|
|
1
|
+
import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-Br29H7Rg.mjs";
|
|
2
|
+
import { A as serviceCall, C as r2Op, D as rpc, E as refines, F as snapshotD1, I as check, L as expectHolds, M as workflow, N as workflowRows, O as rpcResponse, P as workflowStep, S as r2Bucket, T as references, _ as http, a as cron, b as queue, c as d1Rows, d as defineScenario, f as durableObject, g as fetchCall, h as external, i as atLeastOncePerMessage, j as unique, k as service, l as d1Schema, m as everyRow, n as runDifferential, o as d1Param, p as durableObjectRows, r as createCloudflarePlatform, s as d1Read, t as checkInWorkerd, u as d1Write, v as httpResponse, w as r2Rows, x as queueAck, y as implies, z as cloudflareRegressionTest } from "./src-MX90l1IH.mjs";
|
|
3
|
+
export { atLeastOnce, atLeastOncePerMessage, atMostOncePerKey, check, checkInWorkerd, cloudflareRegressionTest, createCloudflarePlatform, cron, d1Param, d1Read, d1Rows, d1Schema, d1Write, defineScenario, durableObject, durableObjectRows, everyRow, expectHolds, external, fetchCall, http, httpResponse, implies, queue, queueAck, r2Bucket, r2Op, r2Rows, references, refines, rpc, rpcResponse, runDifferential, service, serviceCall, snapshotD1, unique, workflow, workflowRows, workflowStep };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { F as getPath } from "./src-DGh7w877.mjs";
|
|
2
|
+
// packages/core/src/delivery.ts
|
|
3
|
+
/** The invocation one attempt of an event runs as: `<event>#<attempt>`, so a schedule's faults stay keyed when other events are removed. */
|
|
4
|
+
function invocationOf(event) {
|
|
5
|
+
return `${event.id}#${event.attempt}`;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The next attempt of an event that was not handled (a message not
|
|
9
|
+
* acknowledged or deleted, a request its caller resends, an alarm that
|
|
10
|
+
* failed), or null when it is dropped (dead-lettered, given up on). It is
|
|
11
|
+
* delivered again while both the platform's own limit on redeliveries
|
|
12
|
+
* (Queues' `max_retries`, the caller's `retries`, SQS's `maxReceiveCount`
|
|
13
|
+
* less the first delivery, an alarm's six retries) and the scenario's
|
|
14
|
+
* `maxRedeliveries` leave room; the redeliveries so far are `attempt - 1`.
|
|
15
|
+
* Pure.
|
|
16
|
+
*/
|
|
17
|
+
function redelivery(event, limit, bounds) {
|
|
18
|
+
const redeliveries = event.attempt - 1;
|
|
19
|
+
if (redeliveries >= limit || redeliveries >= bounds.maxRedeliveries) return null;
|
|
20
|
+
return {
|
|
21
|
+
...event,
|
|
22
|
+
attempt: event.attempt + 1
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// packages/core/src/delivery-invariants.ts
|
|
26
|
+
function atMostOncePerKey(name, effect, key) {
|
|
27
|
+
return {
|
|
28
|
+
kind: "atMostOncePerKey",
|
|
29
|
+
name,
|
|
30
|
+
effect,
|
|
31
|
+
key
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function atLeastOnce(name, effect, key, expected) {
|
|
35
|
+
return {
|
|
36
|
+
kind: "atLeastOnce",
|
|
37
|
+
name,
|
|
38
|
+
effect,
|
|
39
|
+
key,
|
|
40
|
+
expected
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Every event's `bodyKey` value must appear at least once as `key` in a
|
|
45
|
+
* selected effect. The expected keys are re-derived from the bodies that
|
|
46
|
+
* remain when shrinking removes events.
|
|
47
|
+
*/
|
|
48
|
+
function atLeastOncePerMessage(name, events, effect, key, bodyKey) {
|
|
49
|
+
const expected = [];
|
|
50
|
+
for (const e of events) {
|
|
51
|
+
const v = getPath(e.body, bodyKey);
|
|
52
|
+
if (v === void 0) throw new Error(`event ${e.id} has no ${JSON.stringify(bodyKey)} in its body`);
|
|
53
|
+
expected.push(v);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...atLeastOnce(name, effect, key, expected),
|
|
57
|
+
perMessage: { bodyKey }
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export { redelivery as a, invocationOf as i, atLeastOncePerMessage as n, atMostOncePerKey as r, atLeastOnce as t };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=delivery-invariants-Br29H7Rg.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delivery-invariants-Br29H7Rg.mjs","names":[],"sources":["../../core/src/delivery.ts","../../core/src/delivery-invariants.ts"],"sourcesContent":["/**\n * The delivery conventions every platform shares, and the differential\n * runner's raw sides with them: how an attempt names its invocation, and\n * the redelivery rule, which applies the same reading of a platform's limit\n * without any of its proxy code.\n */\n\nimport type { EventRef } from \"./platform.ts\";\nimport type { Bounds } from \"./scenario.ts\";\n\n/** The invocation one attempt of an event runs as: `<event>#<attempt>`, so a schedule's faults stay keyed when other events are removed. */\nexport function invocationOf(event: EventRef): string {\n return `${event.id}#${event.attempt}`;\n}\n\n/**\n * The next attempt of an event that was not handled (a message not\n * acknowledged or deleted, a request its caller resends, an alarm that\n * failed), or null when it is dropped (dead-lettered, given up on). It is\n * delivered again while both the platform's own limit on redeliveries\n * (Queues' `max_retries`, the caller's `retries`, SQS's `maxReceiveCount`\n * less the first delivery, an alarm's six retries) and the scenario's\n * `maxRedeliveries` leave room; the redeliveries so far are `attempt - 1`.\n * Pure.\n */\nexport function redelivery(\n event: EventRef,\n limit: number,\n bounds: Pick<Bounds, \"maxRedeliveries\">,\n): EventRef | null {\n const redeliveries = event.attempt - 1;\n if (redeliveries >= limit || redeliveries >= bounds.maxRedeliveries) return null;\n return { ...event, attempt: event.attempt + 1 };\n}\n","/**\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\nexport function atMostOncePerKey(\n name: string,\n effect: EffectSelector,\n key: string,\n): AtMostOncePerKey {\n return { kind: \"atMostOncePerKey\", name, effect, key };\n}\n\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":";;;AAWA,SAAgB,aAAa,OAAyB;CACpD,OAAO,GAAG,MAAM,GAAG,GAAG,MAAM;AAC9B;;;;;;;;;;;AAYA,SAAgB,WACd,OACA,OACA,QACiB;CACjB,MAAM,eAAe,MAAM,UAAU;CACrC,IAAI,gBAAgB,SAAS,gBAAgB,OAAO,iBAAiB,OAAO;CAC5E,OAAO;EAAE,GAAG;EAAO,SAAS,MAAM,UAAU;CAAE;AAChD;;ACvBA,SAAgB,iBACd,MACA,QACA,KACkB;CAClB,OAAO;EAAE,MAAM;EAAoB;EAAM;EAAQ;CAAI;AACvD;AAEA,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,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as EffectSelector, d as AtMostOncePerKey, k as JsonValue, u as AtLeastOnce } from "./platform-CCz48WF9.mjs";
|
|
2
2
|
declare function atMostOncePerKey(name: string, effect: EffectSelector, key: string): AtMostOncePerKey;
|
|
3
3
|
declare function atLeastOnce(name: string, effect: EffectSelector, key: string, expected: readonly JsonValue[]): AtLeastOnce;
|
|
4
4
|
export { atMostOncePerKey as n, atLeastOnce as t };
|
|
5
|
-
//# sourceMappingURL=delivery-invariants-
|
|
5
|
+
//# sourceMappingURL=delivery-invariants-DZOBkCMR.d.mts.map
|
package/dist/{delivery-invariants-DfPkJL0Q.d.mts.map → delivery-invariants-DZOBkCMR.d.mts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-invariants-
|
|
1
|
+
{"version":3,"file":"delivery-invariants-DZOBkCMR.d.mts","names":[],"sources":["../../core/src/delivery-invariants.ts"],"mappings":";iBAUgB,iBACd,cACA,QAAQ,gBACR,cACC;iBAIa,YACd,cACA,QAAQ,gBACR,aACA,mBAAmB,cAClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { O as Schedule, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, w as EffectLog } from "./platform-CCz48WF9.mjs";
|
|
2
2
|
interface BoundsReached {
|
|
3
3
|
readonly runs: number;
|
|
4
4
|
readonly effectPoints: number;
|
|
@@ -230,4 +230,4 @@ interface ExploreOptions {
|
|
|
230
230
|
declare function replay(spec: ScenarioSpec, platform: Platform, schedule: Schedule): Promise<EffectLog>;
|
|
231
231
|
declare function explore(scenario: ScenarioSpec, platform: Platform, options: ExploreOptions): Promise<ScenarioVerdict>;
|
|
232
232
|
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 };
|
|
233
|
-
//# sourceMappingURL=explore-
|
|
233
|
+
//# sourceMappingURL=explore-B7aR_5Hy.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explore-
|
|
1
|
+
{"version":3,"file":"explore-B7aR_5Hy.d.mts","names":[],"sources":["../../core/src/verdict.ts","../../spec/src/ir.ts","../../engine/src/explore.ts"],"mappings":";UAOiB;WACN;WACA;WACA;WACA;;;;;;;WAOA;aACE;aACA;aACA;;;UAIH;WACC;WACA;WACA,SAAS;WACT;;UAGM;WACN;WACA;WACA;;UAGM,iBAAiB;WACvB;WACA,WAAW;;WAEX,OAAO;WACP,UAAU;;WAEV;WACA,QAAQ;;UAGF,gBAAgB;WACtB;WACA,QAAQ;;KAGP;UAMK,oBAAoB;WAC1B;WACA,OAAO;WACP;;KAGC,kBAAkB,WAAW,UAAU;;iBAGnC,gBAAgB,GAAG;;;;;;;;;;;KC1DvB;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;;UCjGX;WACN;;WAEA;;;;;;;;WAQA;;;;;;;WAOA;;WAEA;;WAEA;;;;;;WAMA;;;;;;;;WAQA;aAAkC;;;;iBAsKvB,OACpB,MAAM,cACN,UAAU,UACV,UAAU,WACT,QAAQ;iBAIW,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 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-CCz48WF9.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-B7aR_5Hy.mjs";
|
|
3
3
|
import { n as Forall, t as Fn } from "./combinators-Bsd9HKtw.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 {
|
|
2
|
-
import { a as renderText, b as describeVerdict, c as aggregate, d as testedRung, i as renderSpecs, o as renderTrace, p as checkedRung, s as emitRegressionTest, t as renderJson, u as specLadder } 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-DGh7w877.mjs";
|
|
2
|
+
import { a as renderText, b as describeVerdict, c as aggregate, d as testedRung, i as renderSpecs, o as renderTrace, p as checkedRung, s as emitRegressionTest, t as renderJson, u as specLadder } from "./src-CWVQEhTr.mjs";
|
|
3
3
|
// packages/core/src/spec-verdict.ts
|
|
4
4
|
/** One line per spec verdict, for error messages; full rendering lives in `report`. */
|
|
5
5
|
function describeSpecVerdict(v) {
|
|
@@ -6,6 +6,34 @@
|
|
|
6
6
|
type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
7
7
|
readonly [key: string]: JsonValue;
|
|
8
8
|
};
|
|
9
|
+
/**
|
|
10
|
+
* `cut_off` is a crash that happens after a response or acknowledgement was
|
|
11
|
+
* already sent, so only background work (ctx.waitUntil) is lost; platforms
|
|
12
|
+
* offer it at the point where that work would start.
|
|
13
|
+
*/
|
|
14
|
+
type FaultKind = "crash_before" | "crash_after" | "ambiguous" | "error" | "cut_off";
|
|
15
|
+
interface FaultDecision {
|
|
16
|
+
/** The invocation the effect belongs to, e.g. "msg-1#2". */
|
|
17
|
+
readonly invocation: string;
|
|
18
|
+
/** Position of the effect within that invocation, from 0. Stable when other invocations are removed. */
|
|
19
|
+
readonly ordinal: number;
|
|
20
|
+
readonly fault: FaultKind;
|
|
21
|
+
/** What the effect was, for people reading the schedule. */
|
|
22
|
+
readonly target: string;
|
|
23
|
+
readonly op: string;
|
|
24
|
+
}
|
|
25
|
+
interface Schedule {
|
|
26
|
+
/** The per-run seed the decisions were drawn from. */
|
|
27
|
+
readonly seed: number;
|
|
28
|
+
readonly faults: readonly FaultDecision[];
|
|
29
|
+
/**
|
|
30
|
+
* The turn picked at each scheduling decision with more than one option,
|
|
31
|
+
* in order, as an index into the options (parked invocations by start
|
|
32
|
+
* order, then starting the next event). Absent: turns follow the seed.
|
|
33
|
+
* Exhaustive exploration records them, since it picks rather than draws.
|
|
34
|
+
*/
|
|
35
|
+
readonly turns?: readonly number[];
|
|
36
|
+
}
|
|
9
37
|
/** `snapshot` records platform state (e.g. D1 tables) captured at the end of a run; it is not an effect point. */
|
|
10
38
|
type EffectKind = "call" | "result" | "fault" | "snapshot";
|
|
11
39
|
interface EffectRecord {
|
|
@@ -168,34 +196,6 @@ interface Violation {
|
|
|
168
196
|
}
|
|
169
197
|
declare function checkInvariant(log: EffectLog, inv: Invariant): Violation | null;
|
|
170
198
|
declare function checkInvariants(log: EffectLog, invariants: readonly Invariant[]): readonly Violation[];
|
|
171
|
-
/**
|
|
172
|
-
* `cut_off` is a crash that happens after a response or acknowledgement was
|
|
173
|
-
* already sent, so only background work (ctx.waitUntil) is lost; platforms
|
|
174
|
-
* offer it at the point where that work would start.
|
|
175
|
-
*/
|
|
176
|
-
type FaultKind = "crash_before" | "crash_after" | "ambiguous" | "error" | "cut_off";
|
|
177
|
-
interface FaultDecision {
|
|
178
|
-
/** The invocation the effect belongs to, e.g. "msg-1#2". */
|
|
179
|
-
readonly invocation: string;
|
|
180
|
-
/** Position of the effect within that invocation, from 0. Stable when other invocations are removed. */
|
|
181
|
-
readonly ordinal: number;
|
|
182
|
-
readonly fault: FaultKind;
|
|
183
|
-
/** What the effect was, for people reading the schedule. */
|
|
184
|
-
readonly target: string;
|
|
185
|
-
readonly op: string;
|
|
186
|
-
}
|
|
187
|
-
interface Schedule {
|
|
188
|
-
/** The per-run seed the decisions were drawn from. */
|
|
189
|
-
readonly seed: number;
|
|
190
|
-
readonly faults: readonly FaultDecision[];
|
|
191
|
-
/**
|
|
192
|
-
* The turn picked at each scheduling decision with more than one option,
|
|
193
|
-
* in order, as an index into the options (parked invocations by start
|
|
194
|
-
* order, then starting the next event). Absent: turns follow the seed.
|
|
195
|
-
* Exhaustive exploration records them, since it picks rather than draws.
|
|
196
|
-
*/
|
|
197
|
-
readonly turns?: readonly number[];
|
|
198
|
-
}
|
|
199
199
|
/** Opaque, JSON-shaped data owned by a platform package. `kind` names its shape. */
|
|
200
200
|
interface PlatformData {
|
|
201
201
|
readonly kind: string;
|
|
@@ -404,5 +404,5 @@ interface Platform {
|
|
|
404
404
|
/** Called when a run ends for any reason, after `finish` or after a failure: undo any per-run patching. */
|
|
405
405
|
cleanup?(spec: ScenarioSpec): Promise<void>;
|
|
406
406
|
}
|
|
407
|
-
export {
|
|
408
|
-
//# sourceMappingURL=platform-
|
|
407
|
+
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-CCz48WF9.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-CCz48WF9.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;UAmBK;;WAEN;;WAEA;WACA,OAAO;;WAEP;WACA;;UAGM;;WAEN;WACA,iBAAiB;;;;;;;WAOjB;;;KCzCC;UAEK;;WAEN;WACA,MAAM;;WAEN;;WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,kBAAkB;;;UCtBZ;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;;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AQ,OAAO,UAAU,OAAO,UAAU,MAAM,eAAe,QAAQ;;EAEvE,eAAe,MAAM,cAAc,6BAA6B;;EAEhE,QAAQ,MAAM,cAAc,OAAO,WAAW;;EAE9C,SAAS,MAAM,eAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I as canonicalJson, M as nextInt, N as nextU32, P as seedPrng, j as nextFloat } from "./src-DGh7w877.mjs";
|
|
2
2
|
import { n as isSpec } from "./combinators-CVjxodAJ.mjs";
|
|
3
3
|
// packages/core/src/verdict.ts
|
|
4
4
|
/** One line per verdict, for error messages; full rendering lives in `report`. */
|
|
@@ -1703,4 +1703,4 @@ function renderText(verdict) {
|
|
|
1703
1703
|
}
|
|
1704
1704
|
export { endpointNumber as _, renderText as a, describeVerdict as b, aggregate 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 };
|
|
1705
1705
|
|
|
1706
|
-
//# sourceMappingURL=src-
|
|
1706
|
+
//# sourceMappingURL=src-CWVQEhTr.mjs.map
|