eutaxy 0.13.0 → 0.15.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.
Files changed (50) hide show
  1. package/README.md +10 -6
  2. package/dist/aws.d.mts +28 -2
  3. package/dist/aws.d.mts.map +1 -1
  4. package/dist/aws.mjs +13 -2
  5. package/dist/aws.mjs.map +1 -1
  6. package/dist/bin.mjs +1 -1
  7. package/dist/{cli-D3SPblWw.mjs → cli-CzGCMudc.mjs} +1269 -117
  8. package/dist/cli-CzGCMudc.mjs.map +1 -0
  9. package/dist/cli.d.mts.map +1 -1
  10. package/dist/cli.mjs +1 -1
  11. package/dist/cloudflare.d.mts +180 -15
  12. package/dist/cloudflare.d.mts.map +1 -1
  13. package/dist/cloudflare.mjs +3 -3
  14. package/dist/{combinators-Bsd9HKtw.d.mts → combinators-BecOKcmi.d.mts} +7 -1
  15. package/dist/combinators-BecOKcmi.d.mts.map +1 -0
  16. package/dist/{combinators-CVjxodAJ.mjs → combinators-CLfsPfhT.mjs} +6 -1
  17. package/dist/combinators-CLfsPfhT.mjs.map +1 -0
  18. package/dist/{delivery-invariants-Br29H7Rg.mjs → delivery-invariants-BCtvzAfW.mjs} +7 -2
  19. package/dist/delivery-invariants-BCtvzAfW.mjs.map +1 -0
  20. package/dist/delivery-invariants-DzMy3iPs.d.mts +10 -0
  21. package/dist/delivery-invariants-DzMy3iPs.d.mts.map +1 -0
  22. package/dist/{explore-B7aR_5Hy.d.mts → explore-B52m-wmk.d.mts} +13 -2
  23. package/dist/explore-B52m-wmk.d.mts.map +1 -0
  24. package/dist/index.d.mts +25 -3
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +2 -2
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/{platform-CCz48WF9.d.mts → platform-Ba1Kvdza.d.mts} +18 -1
  29. package/dist/platform-Ba1Kvdza.d.mts.map +1 -0
  30. package/dist/provers-DS44OeEm.mjs.map +1 -1
  31. package/dist/spec.d.mts +1 -1
  32. package/dist/spec.mjs +1 -1
  33. package/dist/{src-5pKRvj02.mjs → src-nwQA9Xwr.mjs} +9 -3
  34. package/dist/src-nwQA9Xwr.mjs.map +1 -0
  35. package/dist/{src-DGh7w877.mjs → src-ud5wEfnx.mjs} +111 -16
  36. package/dist/src-ud5wEfnx.mjs.map +1 -0
  37. package/dist/{workerd-BMJ-GKx8.mjs → workerd-Be43_PZo.mjs} +2050 -1503
  38. package/dist/workerd-Be43_PZo.mjs.map +1 -0
  39. package/package.json +1 -1
  40. package/dist/cli-D3SPblWw.mjs.map +0 -1
  41. package/dist/combinators-Bsd9HKtw.d.mts.map +0 -1
  42. package/dist/combinators-CVjxodAJ.mjs.map +0 -1
  43. package/dist/delivery-invariants-Br29H7Rg.mjs.map +0 -1
  44. package/dist/delivery-invariants-DZOBkCMR.d.mts +0 -5
  45. package/dist/delivery-invariants-DZOBkCMR.d.mts.map +0 -1
  46. package/dist/explore-B7aR_5Hy.d.mts.map +0 -1
  47. package/dist/platform-CCz48WF9.d.mts.map +0 -1
  48. package/dist/src-5pKRvj02.mjs.map +0 -1
  49. package/dist/src-DGh7w877.mjs.map +0 -1
  50. package/dist/workerd-BMJ-GKx8.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,UAkDiB;WACN;WACA,SAAS;WACT,SAAS;;wBAGE,KAAK,yBAAyB,IAAI,KAAK"}
1
+ {"version":3,"file":"cli.d.mts","names":[],"sources":["../../cli/src/main.ts"],"mappings":"A,UA8DiB;WACN;WACA,SAAS;WACT,SAAS;;wBAGE,KAAK,yBAAyB,IAAI,KAAK"}
package/dist/cli.mjs CHANGED
@@ -1 +1 @@
1
- export { t as main } from "./cli-D3SPblWw.mjs";
1
+ export { t as main } from "./cli-CzGCMudc.mjs";
@@ -1,13 +1,17 @@
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";
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-Ba1Kvdza.mjs";
2
+ import { n as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-DzMy3iPs.mjs";
3
+ import { c as ModuleSpecs, g as Violated, m as ScenarioVerdict, t as ExploreOptions } from "./explore-B52m-wmk.mjs";
4
+ /**
5
+ * What `cloudflareRegressionTest` needs to write the test: import paths of the scenario, the Worker and its
6
+ * schema files, relative to the emitted file, and what the platform was given when the check ran.
7
+ */
4
8
  interface CloudflareRegressionOptions {
5
9
  /** Import path of the scenario module, relative to the emitted file. */
6
10
  readonly scenarioPath: string;
7
11
  /** Import path of the Worker module. */
8
12
  readonly workerPath: string;
9
- /** D1 binding name to schema file path, imported with `?raw`. */
10
- readonly schemaPaths: Readonly<Record<string, string>>;
13
+ /** D1 binding name to its schema file path, or its files in setup order (joined), imported with `?raw`. */
14
+ readonly schemaPaths: Readonly<Record<string, string | readonly string[]>>;
11
15
  /**
12
16
  * The time budget the check ran with, when it replaced the scenario's: the
13
17
  * replay gets the same, so I/O that finished within it does not time out.
@@ -24,6 +28,24 @@ interface CloudflareRegressionOptions {
24
28
  readonly exports?: boolean;
25
29
  /** @deprecated Use `exports`. */
26
30
  readonly workflows?: boolean;
31
+ /**
32
+ * The Workers behind service bindings the scenario names with `callee`, by
33
+ * binding: each one's name from its wrangler config and the import path of
34
+ * its module.
35
+ */
36
+ readonly callees?: Readonly<Record<string, {
37
+ readonly name: string;
38
+ readonly path: string;
39
+ readonly entrypoint?: string;
40
+ readonly props?: Readonly<Record<string, unknown>>;
41
+ }>>;
42
+ /**
43
+ * The qualified names the callees' bindings had in the check's isolate: the
44
+ * replay needs them in its own, so the test says so at its top.
45
+ */
46
+ readonly calleeBindings?: readonly string[];
47
+ /** Qualified binding names that are aliases of the caller's bindings, passed to the platform. */
48
+ readonly aliases?: Readonly<Record<string, string>>;
27
49
  readonly expect?: "holds" | "violates";
28
50
  readonly engineModule?: string;
29
51
  /** Core modules to observe during the replay (import path, functions), for `refines`. */
@@ -34,10 +56,6 @@ interface CloudflareRegressionOptions {
34
56
  }
35
57
  /** A Vitest regression test for a Cloudflare scenario, to run under the Cloudflare Vitest plugin. */
36
58
  export declare function cloudflareRegressionTest(verdict: Violated, options: CloudflareRegressionOptions): string;
37
- /** Explore a scenario on a platform and return its verdict. */
38
- export declare function check(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<ScenarioVerdict>;
39
- /** For use from a test: passes only when the scenario is BOUNDED. */
40
- export declare function expectHolds(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<void>;
41
59
  /** Every user table's rows, sorted canonically, read through the real binding (not an effect). */
42
60
  export declare function snapshotD1(real: D1Database): Promise<{
43
61
  readonly [table: string]: readonly JsonValue[];
@@ -102,12 +120,21 @@ interface HttpDrive extends PlatformData {
102
120
  readonly delaysMs?: readonly number[];
103
121
  readonly deadlineMs?: number;
104
122
  }
123
+ /**
124
+ * How the HTTP drive's caller resends a request it got no acceptable answer for: up to `retries` times
125
+ * (default 3), on a status `retryOn` rejects (default any non-2xx), after `delaysMs` of virtual time, and
126
+ * not waiting past `deadlineMs`.
127
+ */
105
128
  interface HttpCallerOptions {
106
129
  readonly retries?: number;
107
130
  readonly retryOn?: "non-2xx" | "5xx";
108
131
  readonly delaysMs?: readonly number[];
109
132
  readonly deadlineMs?: number;
110
133
  }
134
+ /**
135
+ * Drive the Worker's `fetch()` handler with these requests, each resent as `options` say. A request's
136
+ * method defaults to POST with a body and GET without; its id to `req-<n>`, by position.
137
+ */
111
138
  export declare function http(requests: readonly HttpRequestInput[], options?: HttpCallerOptions): HttpDrive;
112
139
  /** One message the scenario sends on a connection: text, or a JSON value sent as its text (plain data, as drives are). */
113
140
  type WebSocketMessageSpec = {
@@ -132,10 +159,12 @@ interface WebSocketDrive extends PlatformData {
132
159
  readonly kind: "websocket";
133
160
  readonly connections: readonly WebSocketConnectionSpec[];
134
161
  }
162
+ /** One message to send on a connection: its data (a JSON value is sent as its text) and an optional id. */
135
163
  interface WebSocketMessageInput {
136
164
  readonly id?: string;
137
165
  readonly data: JsonValue;
138
166
  }
167
+ /** One connection to open: the path of its upgrade request, its headers and the messages to send on it. */
139
168
  interface WebSocketConnectionInput {
140
169
  /** Defaults to its position: `conn-1`, `conn-2`, … */
141
170
  readonly id?: string;
@@ -144,6 +173,10 @@ interface WebSocketConnectionInput {
144
173
  /** Message ids default to `<connection>:1`, `<connection>:2`, … */
145
174
  readonly messages?: readonly WebSocketMessageInput[];
146
175
  }
176
+ /**
177
+ * Drive the Worker over these WebSocket connections: each opened through its `fetch()` and handed to a
178
+ * Durable Object, its messages delivered in order to the object's `webSocketMessage` handler.
179
+ */
147
180
  export declare function websocket(connections: readonly WebSocketConnectionInput[]): WebSocketDrive;
148
181
  /** One RPC call; `id` defaults to its position, `args` to none. */
149
182
  interface RpcCallInput {
@@ -175,12 +208,17 @@ interface RpcDrive extends PlatformData {
175
208
  readonly delaysMs?: readonly number[];
176
209
  readonly deadlineMs?: number;
177
210
  }
211
+ /**
212
+ * The RPC drive's entrypoint (a named export; default the default export) and how its caller resends a call
213
+ * that threw or got no answer: `retries` (default 0), `delaysMs` and `deadlineMs`, as for `http`.
214
+ */
178
215
  interface RpcCallerOptions {
179
216
  readonly entrypoint?: string;
180
217
  readonly retries?: number;
181
218
  readonly delaysMs?: readonly number[];
182
219
  readonly deadlineMs?: number;
183
220
  }
221
+ /** Drive a `WorkerEntrypoint` of the Worker with these method calls; a call's id defaults to `call-<n>`. */
184
222
  export declare function rpc(calls: readonly RpcCallInput[], options?: RpcCallerOptions): RpcDrive;
185
223
  /** One tick of a Cron Trigger: its id and the virtual time it fires, which the handler sees as `scheduledTime`. */
186
224
  type CronTickSpec = {
@@ -201,11 +239,16 @@ interface CronDrive extends PlatformData {
201
239
  readonly ticks: readonly CronTickSpec[];
202
240
  readonly retries: number;
203
241
  }
242
+ /** How many ticks of the expression to drive, and how many times a tick whose handler failed is re-run. */
204
243
  interface CronOptions {
205
244
  /** How many ticks to drive, from the first match on (default 1). */
206
245
  readonly ticks?: number;
207
246
  readonly retries?: number;
208
247
  }
248
+ /**
249
+ * Drive the Worker's `scheduled()` handler with the ticks of a Cron Trigger expression, in Cloudflare's
250
+ * dialect: one tick by default, re-run 0 times by default.
251
+ */
209
252
  export declare function cron(expression: string, options?: CronOptions): CronDrive;
210
253
  /** The drives a Cloudflare scenario can have. */
211
254
  type Drive = QueueDrive | HttpDrive | RpcDrive | CronDrive | WebSocketDrive;
@@ -250,6 +293,11 @@ type DurableObjectSqlSeed = {
250
293
  type SqlRow = {
251
294
  readonly [column: string]: JsonValue;
252
295
  };
296
+ /**
297
+ * A Durable Object namespace the scenario uses: cleared before each run, the named objects seeded with
298
+ * key-value entries (and with `sql`, a SQLite-backed object's tables and rows), and its storage snapshotted
299
+ * after the run. `alarmsPerObject` caps an object's alarm firings per run (default 3).
300
+ */
253
301
  export declare function durableObject(binding: string, objects?: {
254
302
  readonly [name: string]: {
255
303
  readonly [key: string]: JsonValue;
@@ -266,6 +314,7 @@ interface R2Setup extends PlatformData {
266
314
  readonly binding: string;
267
315
  readonly objects: Readonly<Record<string, R2Seed>>;
268
316
  }
317
+ /** An R2 bucket the scenario uses: emptied before each run, then seeded with these objects by key. */
269
318
  export declare function r2Bucket(binding: string, objects?: Readonly<Record<string, R2Seed>>): R2Setup;
270
319
  /**
271
320
  * Selects an R2 bucket's operations that completed, a `put` by default; a
@@ -288,6 +337,10 @@ interface WorkflowSetup extends PlatformData {
288
337
  /** The Workflow's `name` in the wrangler config, which instances see as `event.workflowName`. */
289
338
  readonly name?: string;
290
339
  }
340
+ /**
341
+ * A Workflow binding and the class its instances run, an export of the Worker module; `name` is the
342
+ * Workflow's name in the wrangler config, which instances read as `event.workflowName`.
343
+ */
291
344
  export declare function workflow(binding: string, className: string, options?: {
292
345
  readonly name?: string;
293
346
  }): WorkflowSetup;
@@ -324,13 +377,46 @@ interface ServiceSetup extends PlatformData {
324
377
  };
325
378
  readonly fetch?: readonly ServiceResponse[];
326
379
  }
380
+ /**
381
+ * Script the Worker behind a service binding: its RPC methods answer from `methods` and its `fetch()` from
382
+ * `fetch`, and the real binding is never called. See `ServiceSetup`.
383
+ */
327
384
  export declare function service(binding: string, options?: {
328
385
  readonly methods?: {
329
386
  readonly [method: string]: ScriptedReply;
330
387
  };
331
388
  readonly fetch?: readonly ServiceResponse[];
332
389
  }): ServiceSetup;
333
- /** Selects the calls through a service binding that completed, one method's or all. */
390
+ /**
391
+ * The Worker behind a service binding, run for real: its module and wrangler
392
+ * config, relative to the scenario, in place of a script. The `name` in that
393
+ * config qualifies the callee's bindings (`orders/DB`) in effect targets,
394
+ * setup steps, state queries and snapshots. Each call is one effect,
395
+ * `Service:<binding>`, hosting the callee's invocation
396
+ * (`<caller invocation>/<binding>.<method>`), with the faults of a call in
397
+ * the network: `crash_before`, `ambiguous` and `crash_after`; what the
398
+ * callee throws is real.
399
+ */
400
+ interface CalleeSetup extends PlatformData {
401
+ readonly kind: "callee";
402
+ readonly binding: string;
403
+ /** The callee's module, relative to the scenario. */
404
+ readonly entry: string;
405
+ /** Its wrangler config, relative to the scenario; its `name` qualifies the callee's bindings. */
406
+ readonly config: string;
407
+ /** The named export the binding reaches; the default export otherwise. */
408
+ readonly entrypoint?: string;
409
+ }
410
+ /**
411
+ * Run the Worker behind a service binding for real, named by its module and its wrangler config, relative
412
+ * to the scenario; `entrypoint` names the export the binding reaches. See `CalleeSetup`.
413
+ */
414
+ export declare function callee(binding: string, worker: {
415
+ readonly entry: string;
416
+ readonly config: string;
417
+ readonly entrypoint?: string;
418
+ }): CalleeSetup;
419
+ /** Selects the calls through a service binding that completed (scripted or a callee's), one method's or all. */
334
420
  export declare function serviceCall(binding: string, method?: string): EffectSelector;
335
421
  /** Selects a Workflow's step attempts, optionally of one step; a failed attempt's result carries its error. */
336
422
  export declare function workflowStep(binding: string, step?: string): EffectSelector;
@@ -347,6 +433,10 @@ export declare function durableObjectRows(binding: string, object: string, where
347
433
  * invariants. The snapshot names it `<object>/<table>`.
348
434
  */
349
435
  export declare function durableObjectTable(binding: string, object: string, table: string, where?: readonly RowCondition[]): StateQuery;
436
+ /**
437
+ * The input to `defineScenario`: the Worker, the drive, the setup steps, the externals it fetches, the
438
+ * invariants, the bounds (merged with the defaults) and the core modules whose specs run.
439
+ */
350
440
  interface CloudflareScenarioInput {
351
441
  readonly name: string;
352
442
  readonly worker: WorkerRef;
@@ -355,14 +445,19 @@ interface CloudflareScenarioInput {
355
445
  readonly queue: string;
356
446
  readonly messages: readonly QueueMessage[];
357
447
  };
358
- readonly setup?: readonly (D1Setup | DurableObjectSetup | R2Setup | WorkflowSetup | ServiceSetup)[];
448
+ readonly setup?: readonly (CalleeSetup | D1Setup | DurableObjectSetup | R2Setup | WorkflowSetup | ServiceSetup)[];
359
449
  readonly externals?: readonly ExternalDecl[];
360
450
  readonly invariants: readonly Invariant[];
361
451
  readonly bounds?: Partial<Bounds>;
362
452
  /** Modules of pure core functions with spec files beside them, relative to the scenario (see ScenarioSpec.specs). */
363
453
  readonly specs?: readonly string[];
364
454
  }
455
+ /** Drive the Worker's `queue()` handler with these messages from the named queue; an id defaults to `msg-<n>`. */
365
456
  export declare function queue(name: string, messages: readonly QueueMessage[]): QueueDrive;
457
+ /**
458
+ * A D1 binding the scenario uses: its tables dropped before each run and the schema file applied, relative
459
+ * to the scenario. Several steps on one binding apply their files in order, a migration per file.
460
+ */
366
461
  export declare function d1Schema(binding: string, schemaFile: string): D1Setup;
367
462
  /**
368
463
  * Effect conventions for D1 (what the proxies record):
@@ -441,6 +536,33 @@ export declare function external(name: string, host: string, options?: {
441
536
  export declare function fetchCall(externalName: string, method?: string): EffectSelector;
442
537
  /** Build and validate a scenario spec; throws with every problem listed. */
443
538
  export declare function defineScenario(input: CloudflareScenarioInput): ScenarioSpec;
539
+ /**
540
+ * The callee's module as the test gives it: the Worker's name from its
541
+ * wrangler config, which qualifies its bindings, its exports, and what the
542
+ * caller's service binding carries in its own config: the `entrypoint` the
543
+ * binding reaches (the scenario's `callee()` may name one too, and wins)
544
+ * and the `props` the callee reads from `ctx.props`.
545
+ */
546
+ interface CalleeModule {
547
+ readonly name: string;
548
+ readonly exports: Readonly<Record<string, unknown>>;
549
+ readonly entrypoint?: string;
550
+ readonly props?: Readonly<Record<string, JsonValue>>;
551
+ }
552
+ /**
553
+ * The callee's `env`: the scenario's env seen under the callee's own names,
554
+ * each mapped onto `<name>/<key>`. Over the platform's proxied env the
555
+ * entries are the proxies, so the callee's effects are recorded under their
556
+ * qualified targets, and an alias (`<name>/STOCK` for the caller's `STOCK`)
557
+ * is already resolved; over workerd's raw env (a callee's Durable Object,
558
+ * which the runtime constructs with the main Worker's env) the aliases are
559
+ * given here, so the shared binding is there under the callee's name too.
560
+ */
561
+ export declare function calleeEnv(name: string, env: object, aliases?: Readonly<Record<string, string>>): object;
562
+ /** Explore a scenario on a platform and return its verdict. */
563
+ export declare function check(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<ScenarioVerdict>;
564
+ /** For use from a test: passes only when the scenario is BOUNDED. */
565
+ export declare function expectHolds(spec: ScenarioSpec, platform: Platform, options?: ExploreOptions): Promise<void>;
444
566
  /**
445
567
  * The Cloudflare Vitest plugin's test helpers, as exported by
446
568
  * `cloudflare:test` (pass the module namespace). Typed loosely on purpose:
@@ -459,13 +581,18 @@ interface WorkerHandler {
459
581
  }
460
582
  /** A `WorkerEntrypoint` subclass: the Worker's default export when it exposes RPC methods. Its env is its own. */
461
583
  type WorkerEntrypointClass = abstract new (ctx: ExecutionContext, env: never) => object;
584
+ /**
585
+ * What `createCloudflarePlatform` needs: the env and the Worker's default export, the schema per D1
586
+ * binding, and for the bindings that need them the test helpers, the module's exports, the callees and
587
+ * the aliases.
588
+ */
462
589
  interface CloudflarePlatformOptions {
463
590
  /** The bindings from `cloudflare:workers`. */
464
591
  readonly env: object;
465
592
  /**
466
- * The Worker's default export: the handler object, or the
467
- * `WorkerEntrypoint` class the `rpc` drive calls (its own `fetch()`
468
- * method is not driven by `http()` yet).
593
+ * The Worker's default export: the handler object, or a
594
+ * `WorkerEntrypoint` class, whose `fetch()`, `queue()` and `scheduled()`
595
+ * are its handlers and whose other methods the `rpc` drive calls.
469
596
  */
470
597
  readonly handler: WorkerHandler | WorkerEntrypointClass;
471
598
  /** Schema SQL per D1 binding named in the scenario's setup. */
@@ -483,7 +610,26 @@ interface CloudflarePlatformOptions {
483
610
  * where the classes `workflow` setup steps name are found.
484
611
  */
485
612
  readonly exports?: Readonly<Record<string, unknown>>;
613
+ /**
614
+ * The Workers behind service bindings that `callee` setup steps name, by
615
+ * binding: each one's name from its wrangler config, which qualifies its
616
+ * bindings in `env` (`orders/DB`), and its module's exports.
617
+ */
618
+ readonly callees?: Readonly<Record<string, CalleeModule>>;
619
+ /**
620
+ * Bindings that name a resource another binding already names (the same
621
+ * database, the same Durable Object namespace), by their qualified name
622
+ * (`inventory/DB`) to the name the resource is set up and snapshotted
623
+ * under (`DB`): one resource, one snapshot, the alias a second name for it
624
+ * in `env`. A setup step on an alias is refused.
625
+ */
626
+ readonly aliases?: Readonly<Record<string, string>>;
486
627
  }
628
+ /**
629
+ * The Cloudflare platform for `check`, run inside workerd under the Cloudflare Vitest plugin: the scenario's
630
+ * drive delivered to the Worker's handlers, its bindings proxied so every call is an effect that faults can
631
+ * hit, and the setup's resources reset before each run and snapshotted after it.
632
+ */
487
633
  export declare function createCloudflarePlatform(options: CloudflarePlatformOptions): Platform;
488
634
  /** A type, not an interface, so it is JSON data the comparison takes as it is. */
489
635
  type AttemptRecord = {
@@ -505,6 +651,7 @@ interface Side {
505
651
  };
506
652
  };
507
653
  }
654
+ /** What `runDifferential` found: each side's attempts and end state, and where they differ. */
508
655
  interface DifferentialResult {
509
656
  /** True only when both sides agree and the proxied run touched nothing unmodelled. */
510
657
  readonly equal: boolean;
@@ -535,6 +682,14 @@ interface CheckTransport {
535
682
  readonly [key: string]: unknown;
536
683
  };
537
684
  /** The core modules observed (as the scenario's specs name them) and the functions on each. */
685
+ /** The callees the platform ran, by binding: each one's Worker name, and what the binding carried, for the regression test. */
686
+ readonly callees?: Readonly<Record<string, {
687
+ readonly name: string;
688
+ readonly entrypoint?: string;
689
+ readonly props?: Readonly<Record<string, unknown>>;
690
+ }>>;
691
+ /** The aliases the platform ran with, for the regression test. */
692
+ readonly aliases?: Readonly<Record<string, string>>;
538
693
  readonly observed?: readonly {
539
694
  readonly module: string;
540
695
  readonly functions: readonly string[];
@@ -552,6 +707,10 @@ interface SpecEntry {
552
707
  }
553
708
  /** Vite globs, keyed as `import.meta.glob` keys them from `.eutaxy/` (see `globKey`). */
554
709
  type ModuleGlob = Readonly<Record<string, () => Promise<unknown>>>;
710
+ /**
711
+ * What the generated check test passes to `checkInWorkerd`: the scenario, the bindings and test helpers,
712
+ * the modules and SQL files beside the scenario, the callees, and the exploration options.
713
+ */
555
714
  interface WorkerdCheckInput {
556
715
  /** The scenario module's default export. */
557
716
  readonly scenario: ScenarioSpec;
@@ -565,6 +724,12 @@ interface WorkerdCheckInput {
565
724
  readonly modules: ModuleGlob;
566
725
  /** The generated `specs.ts` entries, by module key. */
567
726
  readonly specEntries: Readonly<Record<string, SpecEntry>>;
727
+ /** The callees the scenario names, by binding: each one's Worker name and module exports, imported by the generated test. */
728
+ readonly callees?: Readonly<Record<string, CalleeModule>>;
729
+ /** SQL files outside the scenario's directory, by the key `schemasFor` looks up. */
730
+ readonly extraSql?: Readonly<Record<string, string>>;
731
+ /** Qualified binding names that are aliases of the caller's bindings (shared resources). */
732
+ readonly aliases?: Readonly<Record<string, string>>;
568
733
  readonly seed: string;
569
734
  readonly maxRuns?: number;
570
735
  readonly budgetMs?: number;
@@ -572,5 +737,5 @@ interface WorkerdCheckInput {
572
737
  }
573
738
  /** Run the scenario's check, with its specs observed, and return what the CLI reads back. */
574
739
  export declare function checkInWorkerd(input: WorkerdCheckInput): Promise<CheckTransport>;
575
- export { type CheckTransport, type CloudflarePlatformOptions, type CloudflareRegressionOptions, type CloudflareScenarioInput, type CronDrive, type CronOptions, type CronTickSpec, type D1Setup, type DifferentialResult, type DurableObjectSetup, type DurableObjectSqlSeed, 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 SqlRow, type WebSocketConnectionInput, type WebSocketDrive, type WebSocketMessageInput, type WorkerEntrypointClass, type WorkerHandler, type WorkerdCheckInput, type WorkflowSetup, atLeastOnce, atMostOncePerKey };
740
+ export { type CalleeModule, type CalleeSetup, type CheckTransport, type CloudflarePlatformOptions, type CloudflareRegressionOptions, type CloudflareScenarioInput, type CronDrive, type CronOptions, type CronTickSpec, type D1Setup, type DifferentialResult, type DurableObjectSetup, type DurableObjectSqlSeed, 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 SqlRow, type WebSocketConnectionInput, type WebSocketDrive, type WebSocketMessageInput, type WorkerEntrypointClass, type WorkerHandler, type WorkerdCheckInput, type WorkflowSetup, atLeastOnce, atMostOncePerKey };
576
741
  //# 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/r2.ts","../../cloudflare/src/scenario.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.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;;wBCkPmB,WACpB,MAAM,aACL;YAAoB,yBAAyB;;;KCxBpC;WAGG;WACA,iBAAiB,SAAS;WAC1B,eAAe,SAAS;;;UCpNtB;WACN;WACA,MAAM;;;UAIA,mBAAmB;WACzB;WACA;WACA;aAA8B;aAAqB,MAAM;;;;UAInD;WACN;WACA;WACA;WACA;cAAsB;;;WAEtB,OAAO;;;KAIN;WACD;WACA;WACA;WACA;cAAqB;;;WAErB,OAAO;;;;;;;;;;;;UAaD,kBAAkB;WACxB;WACA,mBAAmB;WACnB;WACA;WACA;WACA;;UAGM;WACN;WACA;WACA;WACA;;wBAGK,KACd,mBAAmB,oBACnB,UAAS,oBACR;;KAkBS;WACD;WACA,MAAM;;;KAIL;WACD;WACA;WACA,SAAS,SAAS;WAClB,mBAAmB;;;;;;;;;UAUb,uBAAuB;WAC7B;WACA,sBAAsB;;UAGhB;WACN;WACA,MAAM;;UAGA;;WAEN;WACA;WACA,UAAU,SAAS;;WAEnB,oBAAoB;;wBAGf,UAAU,sBAAsB,6BAA6B;;UAmB5D;WACN;WACA;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;;;;WAMA,SAAS,gBAAgB;;WAEzB,SAAS,SAAS;;WAElB;;;;;;WAMA,iBAAiB;;;;;WAKjB,UAAU,SAAS;;wBA+Bd,yBAAyB,SAAS,4BAA4B;;KCjElE;WACD;WACA;WACA;;WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,mBAAmB;WACnB;cACG;gBAA8B,yBAAyB;;;;UAIpD;;WAEN;WACA,QAAQ;WACR,KAAK;WACL;;WAEA;;;wBAwYW,gBACpB,MAAM,cACN,SAAS,4BACR,QAAQ;;UCxbM;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"}
1
+ {"version":3,"file":"cloudflare.d.mts","names":[],"sources":["../../cli/src/regression.ts","../../cloudflare/src/d1.ts","../../cloudflare/src/r2.ts","../../cloudflare/src/scenario.ts","../../cloudflare/src/callees.ts","../../cloudflare/src/check.ts","../../cloudflare/src/durable-objects.ts","../../cloudflare/src/platform.ts","../../cloudflare/src/differential.ts","../../cli/src/workerd.ts"],"mappings":";;;;;;;UAOiB;;WAEN;;WAEA;;WAEA,aAAa,SAAS;;;;;WAKtB;;WAEA;;WAEA;;;;;WAKA;;WAEA;;;;;;WAMA,UAAU,SACjB;aAGa;aACA;aACA;aACA,QAAQ,SAAS;;;;;;WAQvB;;WAEA,UAAU,SAAS;WACnB;WACA;;WAEA;aACE;aACA;;;;wBA0BG,yBACd,SAAS,UACT,SAAS;;wBC0NW,WACpB,MAAM,aACL;YAAoB,yBAAyB;;;KChEp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WAEA;;WAEA;;WAEA,SAAS;;UAGH;WACN,mBAAmB;WACnB;cACG;gBAA8B,yBAAyB;;;;;UAKpD;;WAEN;WACA,QAAQ;WACR,KAAK;WACL;;WAEA;;;wBAwYW,gBACpB,MAAM,cACN,SAAS,4BACR,QAAQ;;UCxbM;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"}
@@ -1,3 +1,3 @@
1
- import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-Br29H7Rg.mjs";
2
- import { A as rpcResponse, B as check, C as queueAck, D as references, E as r2Rows, F as websocket, H as cloudflareRegressionTest, I as workflow, L as workflowRows, M as serviceCall, N as unique, O as refines, P as webSocketReceived, R as workflowStep, S as queue, T as r2Op, V as expectHolds, _ as external, a as atLeastOncePerMessage, b as httpResponse, c as d1Read, d as d1Write, f as defineScenario, g as everyRow, h as durableObjectTable, i as createCloudflarePlatform, j as service, k as rpc, l as d1Rows, m as durableObjectRows, o as cron, p as durableObject, r as runDifferential, s as d1Param, t as checkInWorkerd, u as d1Schema, v as fetchCall, w as r2Bucket, x as implies, y as http, z as snapshotD1 } from "./workerd-BMJ-GKx8.mjs";
3
- export { atLeastOnce, atLeastOncePerMessage, atMostOncePerKey, 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 };
1
+ import { r as atMostOncePerKey, t as atLeastOnce } from "./delivery-invariants-BCtvzAfW.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-Be43_PZo.mjs";
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 };
@@ -29,14 +29,20 @@ interface Total<F extends Fn> {
29
29
  readonly kind: "total";
30
30
  readonly fn: F;
31
31
  }
32
+ /** A spec file's export: a `forall` claim or a `total` claim. */
32
33
  type Spec = Forall<Fn> | Total<Fn>;
34
+ /**
35
+ * Claim that `ensures` holds for every input of `fn` where `when` holds; `sample` narrows only the inputs
36
+ * the `TESTED` rung draws. See `Forall`.
37
+ */
33
38
  declare function forall<F extends Fn>(fn: F, property: {
34
39
  readonly sample?: (...args: Parameters<F>) => boolean;
35
40
  readonly when?: (...args: Parameters<F>) => boolean;
36
41
  readonly ensures: (...args: Parameters<F>) => boolean;
37
42
  }): Forall<F>;
43
+ /** Claim that `fn` terminates on every input of its parameter types; only an engine can establish it. */
38
44
  declare function total<F extends Fn>(fn: F): Total<F>;
39
45
  /** Whether a spec file's export is one of the two spec shapes. */
40
46
  declare function isSpec(value: unknown): value is Spec;
41
47
  export { forall as a, Total as i, Forall as n, isSpec as o, Spec as r, total as s, Fn as t };
42
- //# sourceMappingURL=combinators-Bsd9HKtw.d.mts.map
48
+ //# sourceMappingURL=combinators-BecOKcmi.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combinators-BecOKcmi.d.mts","names":[],"sources":["../../spec/src/combinators.ts"],"mappings":";;;;;;;;;KAUY,SAAS;;;;;;;;;;UAWJ,OAAO,UAAU;WACvB;WACA,IAAI;WACJ,aAAa,MAAM,WAAW;WAC9B,WAAW,MAAM,WAAW;WAC5B,aAAa,MAAM,WAAW;;;UAIxB,MAAM,UAAU;WACtB;WACA,IAAI;;;KAIH,OAAO,OAAO,MAAM,MAAM;;;;;iBAMtB,OAAO,UAAU,IAC/B,IAAI,GACJ;WACW,aAAa,MAAM,WAAW;WAC9B,WAAW,MAAM,WAAW;WAC5B,aAAa,MAAM,WAAW;IAExC,OAAO;;iBAWM,MAAM,UAAU,IAAI,IAAI,IAAI,MAAM;;iBAKlC,OAAO,iBAAiB,SAAS"}
@@ -1,4 +1,8 @@
1
1
  // packages/spec/src/combinators.ts
2
+ /**
3
+ * Claim that `ensures` holds for every input of `fn` where `when` holds; `sample` narrows only the inputs
4
+ * the `TESTED` rung draws. See `Forall`.
5
+ */
2
6
  function forall(fn, property) {
3
7
  return {
4
8
  kind: "forall",
@@ -8,6 +12,7 @@ function forall(fn, property) {
8
12
  ensures: property.ensures
9
13
  };
10
14
  }
15
+ /** Claim that `fn` terminates on every input of its parameter types; only an engine can establish it. */
11
16
  function total(fn) {
12
17
  return {
13
18
  kind: "total",
@@ -24,4 +29,4 @@ function isSpec(value) {
24
29
  }
25
30
  export { isSpec as n, total as r, forall as t };
26
31
 
27
- //# sourceMappingURL=combinators-CVjxodAJ.mjs.map
32
+ //# sourceMappingURL=combinators-CLfsPfhT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combinators-CLfsPfhT.mjs","names":[],"sources":["../../spec/src/combinators.ts"],"sourcesContent":["/**\n * What a spec file writes: `forall(f, { sample, when, ensures })` and `total(f)`.\n * Both return plain data holding the function itself, so the user's\n * compiler types the arrows' parameters as `f`'s and a spec that does not\n * match its function does not compile. Nothing here runs a check: the\n * simulator's rungs evaluate the arrows on inputs, and the engines read\n * the spec file's text.\n */\n\n/** Any function; `never[]` so that every parameter list is accepted. */\nexport type Fn = (...args: never[]) => unknown;\n\n/**\n * A universally quantified claim: for every input of `fn`'s parameter\n * types where `when` holds, `ensures` holds. `ensures` is evaluated only\n * where `when` does, so a guard such as `c !== null` protects what follows.\n * `sample` is not part of the claim: it limits the inputs the `TESTED`\n * rung draws (to keep each evaluation small, say), and the verdict says\n * so; inputs the simulator passed are checked whatever it says, and an\n * engine proves the claim for every input.\n */\nexport interface Forall<F extends Fn> {\n readonly kind: \"forall\";\n readonly fn: F;\n readonly sample?: (...args: Parameters<F>) => boolean;\n readonly when?: (...args: Parameters<F>) => boolean;\n readonly ensures: (...args: Parameters<F>) => boolean;\n}\n\n/** The claim that `fn` terminates on every input of its parameter types. */\nexport interface Total<F extends Fn> {\n readonly kind: \"total\";\n readonly fn: F;\n}\n\n/** A spec file's export: a `forall` claim or a `total` claim. */\nexport type Spec = Forall<Fn> | Total<Fn>;\n\n/**\n * Claim that `ensures` holds for every input of `fn` where `when` holds; `sample` narrows only the inputs\n * the `TESTED` rung draws. See `Forall`.\n */\nexport function forall<F extends Fn>(\n fn: F,\n property: {\n readonly sample?: (...args: Parameters<F>) => boolean;\n readonly when?: (...args: Parameters<F>) => boolean;\n readonly ensures: (...args: Parameters<F>) => boolean;\n },\n): Forall<F> {\n return {\n kind: \"forall\",\n fn,\n ...(property.sample === undefined ? {} : { sample: property.sample }),\n ...(property.when === undefined ? {} : { when: property.when }),\n ensures: property.ensures,\n };\n}\n\n/** Claim that `fn` terminates on every input of its parameter types; only an engine can establish it. */\nexport function total<F extends Fn>(fn: F): Total<F> {\n return { kind: \"total\", fn };\n}\n\n/** Whether a spec file's export is one of the two spec shapes. */\nexport function isSpec(value: unknown): value is Spec {\n if (typeof value !== \"object\" || value === null) return false;\n const v = value as {\n kind?: unknown;\n fn?: unknown;\n ensures?: unknown;\n when?: unknown;\n sample?: unknown;\n };\n if (typeof v.fn !== \"function\") return false;\n if (v.kind === \"total\") return true;\n return (\n v.kind === \"forall\" &&\n typeof v.ensures === \"function\" &&\n (v.when === undefined || typeof v.when === \"function\") &&\n (v.sample === undefined || typeof v.sample === \"function\")\n );\n}\n"],"mappings":";;;;;AA0CA,SAAgB,OACd,IACA,UAKW;CACX,OAAO;EACL,MAAM;EACN;EACA,GAAI,SAAS,WAAW,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ,SAAS,OAAO;EACnE,GAAI,SAAS,SAAS,KAAA,IAAY,CAAC,IAAI,EAAE,MAAM,SAAS,KAAK;EAC7D,SAAS,SAAS;CACpB;AACF;;AAGA,SAAgB,MAAoB,IAAiB;CACnD,OAAO;EAAE,MAAM;EAAS;CAAG;AAC7B;;AAGA,SAAgB,OAAO,OAA+B;CACpD,IAAI,OAAO,UAAU,YAAY,UAAU,MAAM,OAAO;CACxD,MAAM,IAAI;CAOV,IAAI,OAAO,EAAE,OAAO,YAAY,OAAO;CACvC,IAAI,EAAE,SAAS,SAAS,OAAO;CAC/B,OACE,EAAE,SAAS,YACX,OAAO,EAAE,YAAY,eACpB,EAAE,SAAS,KAAA,KAAa,OAAO,EAAE,SAAS,gBAC1C,EAAE,WAAW,KAAA,KAAa,OAAO,EAAE,WAAW;AAEnD"}
@@ -1,4 +1,4 @@
1
- import { F as getPath } from "./src-DGh7w877.mjs";
1
+ import { I as getPath } from "./src-ud5wEfnx.mjs";
2
2
  // packages/core/src/delivery.ts
3
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
4
  function invocationOf(event) {
@@ -23,6 +23,10 @@ function redelivery(event, limit, bounds) {
23
23
  };
24
24
  }
25
25
  // packages/core/src/delivery-invariants.ts
26
+ /**
27
+ * No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
28
+ * happened twice for one key, a payment recorded twice, a message sent twice.
29
+ */
26
30
  function atMostOncePerKey(name, effect, key) {
27
31
  return {
28
32
  kind: "atMostOncePerKey",
@@ -31,6 +35,7 @@ function atMostOncePerKey(name, effect, key) {
31
35
  key
32
36
  };
33
37
  }
38
+ /** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */
34
39
  function atLeastOnce(name, effect, key, expected) {
35
40
  return {
36
41
  kind: "atLeastOnce",
@@ -59,4 +64,4 @@ function atLeastOncePerMessage(name, events, effect, key, bodyKey) {
59
64
  }
60
65
  export { redelivery as a, invocationOf as i, atLeastOncePerMessage as n, atMostOncePerKey as r, atLeastOnce as t };
61
66
 
62
- //# sourceMappingURL=delivery-invariants-Br29H7Rg.mjs.map
67
+ //# sourceMappingURL=delivery-invariants-BCtvzAfW.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-invariants-BCtvzAfW.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\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":";;;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;;;;;;ACnBA,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"}
@@ -0,0 +1,10 @@
1
+ import { C as EffectSelector, d as AtMostOncePerKey, k as JsonValue, u as AtLeastOnce } from "./platform-Ba1Kvdza.mjs";
2
+ /**
3
+ * No two selected effects share the value at `key` (a dot path into the effect's payload): nothing
4
+ * happened twice for one key, a payment recorded twice, a message sent twice.
5
+ */
6
+ declare function atMostOncePerKey(name: string, effect: EffectSelector, key: string): AtMostOncePerKey;
7
+ /** Every value in `expected` appears at least once as `key` in a selected effect: nothing was lost. */
8
+ declare function atLeastOnce(name: string, effect: EffectSelector, key: string, expected: readonly JsonValue[]): AtLeastOnce;
9
+ export { atMostOncePerKey as n, atLeastOnce as t };
10
+ //# sourceMappingURL=delivery-invariants-DzMy3iPs.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-invariants-DzMy3iPs.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,5 @@
1
- import { O as Schedule, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, w as EffectLog } from "./platform-CCz48WF9.mjs";
1
+ import { O as Schedule, n as Platform, o as ScenarioSpec, p as Violation, r as Bounds, w as EffectLog } from "./platform-Ba1Kvdza.mjs";
2
+ /** How far exploration got: runs, effect points, faults injected and time taken, and coverage when exhaustive. */
2
3
  interface BoundsReached {
3
4
  readonly runs: number;
4
5
  readonly effectPoints: number;
@@ -27,6 +28,7 @@ interface Shrunk {
27
28
  readonly eventsRemoved: number;
28
29
  readonly runs: number;
29
30
  }
31
+ /** An invariant broke: the violation, the shrunk schedule that reproduces it and its trace. */
30
32
  interface Violated extends VerdictBase {
31
33
  readonly kind: "VIOLATED";
32
34
  readonly violation: Violation;
@@ -37,16 +39,19 @@ interface Violated extends VerdictBase {
37
39
  readonly keptEvents: readonly string[];
38
40
  readonly shrunk: Shrunk;
39
41
  }
42
+ /** No violation within the stated bounds; not a proof. */
40
43
  interface Bounded extends VerdictBase {
41
44
  readonly kind: "BOUNDED";
42
45
  readonly bounds: Bounds;
43
46
  }
44
47
  type UnsupportedCause = "unsupported_api" | "not_replayable" | "module_state_leak" | "unsupported_bounds";
48
+ /** The run did something the simulation cannot control or replay, so no claim is made: the cause and the reason. */
45
49
  interface Unsupported extends VerdictBase {
46
50
  readonly kind: "UNSUPPORTED";
47
51
  readonly cause: UnsupportedCause;
48
52
  readonly reason: string;
49
53
  }
54
+ /** A scenario's verdict: `VIOLATED`, `BOUNDED` or `UNSUPPORTED`. */
50
55
  type ScenarioVerdict = Violated | Bounded | Unsupported;
51
56
  /** One line per verdict, for error messages; full rendering lives in `report`. */
52
57
  declare function describeVerdict(v: ScenarioVerdict): string;
@@ -186,6 +191,7 @@ interface ModuleSpecs {
186
191
  readonly functions: readonly FunctionSpec[];
187
192
  readonly errors: readonly SpecError[];
188
193
  }
194
+ /** How `explore` searches: the seed, a cap on runs, the time budget, the share of runs with faults, and exhaustive mode. */
189
195
  interface ExploreOptions {
190
196
  readonly seed: number | string;
191
197
  /** Hard cap on runs, in addition to the scenario's time budget. */
@@ -228,6 +234,11 @@ interface ExploreOptions {
228
234
  }
229
235
  /** Re-run a recorded schedule exactly. */
230
236
  declare function replay(spec: ScenarioSpec, platform: Platform, schedule: Schedule): Promise<EffectLog>;
237
+ /**
238
+ * Explore a scenario on a platform: run it under schedules drawn from the seed (or every schedule within
239
+ * the bounds, when exhaustive), shrink the first violation found, and return the verdict. At most 100 runs
240
+ * unless `maxRuns` says otherwise.
241
+ */
231
242
  declare function explore(scenario: ScenarioSpec, platform: Platform, options: ExploreOptions): Promise<ScenarioVerdict>;
232
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 };
233
- //# sourceMappingURL=explore-B7aR_5Hy.d.mts.map
244
+ //# sourceMappingURL=explore-B52m-wmk.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"explore-B52m-wmk.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;;;UChGX;WACN;;WAEA;;;;;;;;WAQA;;;;;;;WAOA;;WAEA;;WAEA;;;;;;WAMA;;;;;;;;WAQA;aAAkC;;;;iBAsKvB,OACpB,MAAM,cACN,UAAU,UACV,UAAU,WACT,QAAQ;;;;;;iBASW,QACpB,UAAU,cACV,UAAU,UACV,SAAS,iBACR,QAAQ"}