eutaxy 0.5.1 → 0.6.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 (32) hide show
  1. package/README.md +96 -12
  2. package/dist/aws.mjs +5 -5
  3. package/dist/bin.mjs +2 -2
  4. package/dist/{checksum-DhS6ofSm.mjs → checksum-DHr5qb3Y.mjs} +2 -2
  5. package/dist/{checksum-DhS6ofSm.mjs.map → checksum-DHr5qb3Y.mjs.map} +1 -1
  6. package/dist/cli-CsiVEsS-.mjs +2 -0
  7. package/dist/cli.d.mts.map +1 -1
  8. package/dist/cli.mjs +2 -2
  9. package/dist/cloudflare.d.mts +2 -4
  10. package/dist/cloudflare.d.mts.map +1 -1
  11. package/dist/cloudflare.mjs +2 -2
  12. package/dist/{delivery-invariants-Cuxdna28.mjs → delivery-invariants-hmhwh_qD.mjs} +2 -2
  13. package/dist/{delivery-invariants-Cuxdna28.mjs.map → delivery-invariants-hmhwh_qD.mjs.map} +1 -1
  14. package/dist/{event-streams-BANyO9xt.mjs → event-streams-i8OGzuFN.mjs} +2 -2
  15. package/dist/{event-streams-BANyO9xt.mjs.map → event-streams-i8OGzuFN.mjs.map} +1 -1
  16. package/dist/{checked-CGpA2-F0.d.mts → explore-CDpJA9zX.d.mts} +118 -61
  17. package/dist/explore-CDpJA9zX.d.mts.map +1 -0
  18. package/dist/index.d.mts +76 -20
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +19 -20
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/{src-Bqc9Eyb1.mjs → src-BO7I3f-1.mjs} +2 -2
  23. package/dist/{src-Bqc9Eyb1.mjs.map → src-BO7I3f-1.mjs.map} +1 -1
  24. package/dist/{src-DKb-fkdb.mjs → src-C43iUZgr.mjs} +1650 -10
  25. package/dist/src-C43iUZgr.mjs.map +1 -0
  26. package/dist/{src-Dxl9ZlKn.mjs → src-Cs4Mg55e.mjs} +957 -37
  27. package/dist/src-Cs4Mg55e.mjs.map +1 -0
  28. package/package.json +16 -1
  29. package/dist/checked-CGpA2-F0.d.mts.map +0 -1
  30. package/dist/cli-IJrKkeYS.mjs +0 -2
  31. package/dist/src-DKb-fkdb.mjs.map +0 -1
  32. package/dist/src-Dxl9ZlKn.mjs.map +0 -1
package/README.md CHANGED
@@ -1,17 +1,101 @@
1
- # eutaxy
1
+ # Eutaxy
2
2
 
3
- **Purpose.** The published facade: `eutaxy` and `eutaxy/cloudflare`. Internal packages are bundled into it at build time.
3
+ Deterministic simulation and formal proof for TypeScript on Cloudflare
4
+ Workers.
4
5
 
5
- **Public surface.** `.`: scenario, invariant (`Refines` included) and verdict types, for scenarios and specs (`SpecVerdict`); `checkInvariants`, `explore`, `replay`, `restrictSpec`; `observeCore` (record a core module's calls as decisions); Lemma specs (`parseProperty`, `printProperty`, `extractSpecs`, the `SpecIR` types) and the `CHECKED` rung (`checkedRung`; `checkSpecModule`, `lemmaBool`, `lemmaUnresolved` and `ModulePredicates` are deprecated, internal to `eutaxy check`, and go in 0.6.0); `renderText`, `renderJson`, `renderSpecs`, `emitRegressionTest`. `./cloudflare`: everything from the cloudflare package (`refines` and `d1Read` among it) plus `cloudflareRegressionTest` and `checkInWorkerd` (what the test `eutaxy check` generates calls). `./aws`: everything from the aws package.
6
+ Eutaxy runs unmodified Worker code with its bindings wrapped (D1, and
7
+ Durable Objects with their alarms; outbound `fetch` is answered from the
8
+ externals a scenario declares), injects faults at every effect boundary,
9
+ interleaves concurrent invocations at their I/O, and checks invariants over
10
+ the effect log. It explores runs from a seed, or every schedule within the
11
+ bounds. The same engine checks AWS Lambda functions consuming SQS with
12
+ DynamoDB, through the AWS SDK as the effect boundary. A failure in a Worker
13
+ comes back as a shrunk, replayable trace plus a Vitest regression test that
14
+ runs in workerd.
6
15
 
7
- **Build.** `pnpm build` at the repository root bundles every internal
8
- package into `dist/` (tsdown, ESM, bundled declarations); `publishConfig`
9
- swaps the workspace entry points for `dist/` on publish, and the internal
10
- packages are dev dependencies so the published manifest has none at runtime.
16
+ Specs on a Worker's pure core functions are checked on the inputs the
17
+ simulator actually passed them, then on generated inputs, and proved in
18
+ Lean 4 when `--prover lean` is given; `refines` checks that the Worker
19
+ carries out the core's decisions on state that was still current.
11
20
 
12
- **May import.** `@eutaxy/spec`, `@eutaxy/core`, `@eutaxy/engine`, `@eutaxy/cloudflare`, `@eutaxy/prover`, `@eutaxy/prover-lean`, `@eutaxy/prover-thales`, `@eutaxy/prover-lemmascript`, `@eutaxy/report`, `@eutaxy/cli`, `@eutaxy/aws`. Only these are declared in `package.json`, and
13
- pnpm links only declared workspace dependencies, so an import of any other
14
- package does not resolve. The project references in `tsconfig.json` mirror the
15
- list; a test keeps the two in sync with the design.
21
+ **Status: 0.6, early.** The design is in
22
+ [docs/design.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.6.0/docs/design.md); the phases and their gates are in
23
+ [docs/roadmap.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.6.0/docs/roadmap.md).
16
24
 
17
- **Phase.** v0.4 onward. See `docs/design.md` and `docs/roadmap.md`.
25
+ ## Verdicts
26
+
27
+ A scenario gets `VIOLATED`, `BOUNDED` or `UNSUPPORTED`. A spec gets
28
+ `CHECKED` (held on every input the simulator passed), `TESTED` (held on
29
+ those and on inputs generated from the property's domains), `REFUTED`
30
+ (with the input that breaks it, shrunk), `PROVEN` (for every input, by a
31
+ named engine; `eutaxy check --prover lean` runs Eutaxy's own
32
+ TypeScript-to-Lean 4 engine, which proves properties of a pure subset over
33
+ integers, booleans, strings and records today), `CONFLICT` (engines disagree) or
34
+ `UNKNOWN`. Every verdict carries what it rests on:
35
+ seed and bounds, or the inputs it was checked on, and the assumptions.
36
+ Nothing is ever reported as verified when it was only explored or sampled:
37
+ `BOUNDED`, `CHECKED` and `TESTED` are not proofs.
38
+
39
+ ## Repository
40
+
41
+ ```
42
+ packages/ spec, core, engine, cloudflare, aws, prover, prover-lean,
43
+ prover-thales, prover-lemmascript, report, cli, eutaxy
44
+ docs/ design and roadmap
45
+ ```
46
+
47
+ Dependencies point down into a pure, dependency-free core. Each package's
48
+ `README.md` states its purpose, public surface and what it may import; each
49
+ declares exactly that, and pnpm links nothing else.
50
+
51
+ ## Installing
52
+
53
+ ```sh
54
+ pnpm add -D eutaxy vitest @cloudflare/vitest-plugin
55
+ ```
56
+
57
+ Requires Node 24. Published as `eutaxy` on npm.
58
+
59
+ ## Checking a Worker
60
+
61
+ Write a scenario beside your Worker and run the check:
62
+
63
+ ```sh
64
+ eutaxy check ./payments.sim.ts
65
+ ```
66
+
67
+ [examples/payments-queue](https://github.com/Kaisenwerk/eutaxy/blob/v0.6.0/examples/payments-queue) is a complete, runnable
68
+ version of this: a queue consumer with a bug the check finds, and the fixed
69
+ Worker it reports `BOUNDED` for.
70
+
71
+ A scenario drives the Worker through its `queue()` handler or, with
72
+ `http(...)`, through its `fetch()` handler, where the caller's retry policy
73
+ (a webhook provider resending until it gets a 2xx) decides redelivery. With
74
+ `maxConcurrentInvocations` above 1, invocations run concurrently and
75
+ interleave at their I/O, including a Durable Object's outbound I/O during
76
+ a call (its storage operations hold other events, as the runtime's input
77
+ gate does); alarms fire in virtual time. A scenario's `specs` names the
78
+ modules of its pure core, whose Lemma specs are then checked on the inputs
79
+ seen.
80
+
81
+ It runs the scenario inside workerd through your Vitest and the Cloudflare
82
+ Vitest plugin, prints the verdict with its trace and assumptions (or
83
+ `--json`; `--exhaustive` runs every schedule within the bounds), and on a
84
+ violation writes `payments.regression.test.ts`, which fails while the bug
85
+ exists and passes once it is fixed. It exits 0 for `BOUNDED`, 1 for
86
+ `VIOLATED` or a `REFUTED` spec, 2 for `UNSUPPORTED`, and 3 on an error.
87
+
88
+ ## Developing
89
+
90
+ Requires Node 24 and pnpm.
91
+
92
+ ```sh
93
+ pnpm install
94
+ pnpm check # lint, typecheck, test
95
+ ```
96
+
97
+ See [CONTRIBUTING.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.6.0/CONTRIBUTING.md).
98
+
99
+ ## License
100
+
101
+ [Apache-2.0](https://github.com/Kaisenwerk/eutaxy/blob/v0.6.0/LICENSE).
package/dist/aws.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-C1I3wEg2.mjs";
2
- import { S as canonicalJson, _ as defaultBounds, c as CrashSignal, f as patchGlobals, g as toJson$1, h as patchProperty, i as proxiedSide, m as settleOn, n as DifferentialStuck, p as realTick, r as compareSides, u as installScriptedFetch, v as validateScenario } from "./src-Bqc9Eyb1.mjs";
3
- import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-Cuxdna28.mjs";
4
- import { $ as booleanSelector, $t as ServiceException, A as BinaryDecisionDiagram, An as isValidHostLabel, B as NODE_REGION_CONFIG_FILE_OPTIONS, C as isIpAddress, Ct as dateToUtcString, Dt as parseRfc7231DateTime, E as EndpointError, En as normalizeProvider$1, Et as parseRfc3339DateTimeWithOffset, F as init_config$1, Fn as hasOwn, G as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, H as REGION_ENV_NAME, Ht as NoOpLogger, It as fromBase64, Jt as resolveDefaultRuntimeConfig, Kt as getDefaultExtensionConfiguration, L as resolveDefaultsModeConfig, Ln as getSmithyContext, N as resolveParams, Nn as HttpRequest, Nt as toBase64, O as EndpointCache, On as isValidHostname, Ot as expectUnion, P as config_exports, Pt as fromUtf8, Qt as loadConfigsForDefaultMode, Rt as client_exports$1, Sn as parseUrl, Tt as parseEpochTimestamp, U as REGION_INI_NAME, V as NODE_REGION_CONFIG_OPTIONS, Vt as makeBuilder, Wt as getValueFromTextNode, X as loadConfig, Yt as emitWarningIfUnsupportedVersion$1, Z as SelectorType, _ as resolveEndpointConfig, _t as _parseRfc7231DateTime, b as decideEndpoint, bn as init_transport, bt as quoteHeader, c as generateIdempotencyToken, cn as TypeRegistry, ct as NumericValue, d as v4, en as decorateServiceException, ft as splitHeader, g as init_endpoints, gn as deref, gt as _parseRfc3339DateTimeWithOffset, h as getEndpointPlugin, ht as _parseEpochTimestamp, in as Command, jn as HttpResponse, jt as toUtf8, l as init_serde, m as endpoints_exports, mn as getSchemaSerdePlugin, mt as splitEvery, n as init_checksum, nn as createAggregatedClient, on as init_schema, p as sdkStreamMixin, pn as translateTraits, q as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, r as Sha256Node, rt as calculateBodyLength, s as Uint8ArrayBlobAdapter, sn as schema_exports, t as checksum_exports, tt as ProviderError, u as serde_exports, un as NormalizedSchema, ut as nv, vn as Client$1, w as customEndpointFunctions, wn as parseQueryString, xt as LazyJsonString, y as resolveEndpoint, z as resolveRegionConfig, zn as require_dist_cjs$20, zt as init_client$1 } from "./checksum-DhS6ofSm.mjs";
5
- import { Readable } from "node:stream";
2
+ import { E as canonicalJson, _ as defaultBounds, c as CrashSignal, f as patchGlobals, g as toJson$1, h as patchProperty, i as proxiedSide, m as settleOn, n as DifferentialStuck, p as realTick, r as compareSides, u as installScriptedFetch, v as validateScenario } from "./src-BO7I3f-1.mjs";
3
+ import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-hmhwh_qD.mjs";
4
+ import { $ as booleanSelector, $t as ServiceException, A as BinaryDecisionDiagram, An as isValidHostLabel, B as NODE_REGION_CONFIG_FILE_OPTIONS, C as isIpAddress, Ct as dateToUtcString, Dt as parseRfc7231DateTime, E as EndpointError, En as normalizeProvider$1, Et as parseRfc3339DateTimeWithOffset, F as init_config$1, Fn as hasOwn, G as NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS, H as REGION_ENV_NAME, Ht as NoOpLogger, It as fromBase64, Jt as resolveDefaultRuntimeConfig, Kt as getDefaultExtensionConfiguration, L as resolveDefaultsModeConfig, Ln as getSmithyContext, N as resolveParams, Nn as HttpRequest, Nt as toBase64, O as EndpointCache, On as isValidHostname, Ot as expectUnion, P as config_exports, Pt as fromUtf8, Qt as loadConfigsForDefaultMode, Rt as client_exports$1, Sn as parseUrl, Tt as parseEpochTimestamp, U as REGION_INI_NAME, V as NODE_REGION_CONFIG_OPTIONS, Vt as makeBuilder, Wt as getValueFromTextNode, X as loadConfig, Yt as emitWarningIfUnsupportedVersion$1, Z as SelectorType, _ as resolveEndpointConfig, _t as _parseRfc7231DateTime, b as decideEndpoint, bn as init_transport, bt as quoteHeader, c as generateIdempotencyToken, cn as TypeRegistry, ct as NumericValue, d as v4, en as decorateServiceException, ft as splitHeader, g as init_endpoints, gn as deref, gt as _parseRfc3339DateTimeWithOffset, h as getEndpointPlugin, ht as _parseEpochTimestamp, in as Command, jn as HttpResponse, jt as toUtf8, l as init_serde, m as endpoints_exports, mn as getSchemaSerdePlugin, mt as splitEvery, n as init_checksum, nn as createAggregatedClient, on as init_schema, p as sdkStreamMixin, pn as translateTraits, q as NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS, r as Sha256Node, rt as calculateBodyLength, s as Uint8ArrayBlobAdapter, sn as schema_exports, t as checksum_exports, tt as ProviderError, u as serde_exports, un as NormalizedSchema, ut as nv, vn as Client$1, w as customEndpointFunctions, wn as parseQueryString, xt as LazyJsonString, y as resolveEndpoint, z as resolveRegionConfig, zn as require_dist_cjs$20, zt as init_client$1 } from "./checksum-DHr5qb3Y.mjs";
6
5
  import { platform, release } from "node:os";
6
+ import { Readable } from "node:stream";
7
7
  import { env, versions } from "node:process";
8
8
  // node_modules/.pnpm/@aws-sdk+core@3.978.5/node_modules/@aws-sdk/core/dist-es/submodules/account-id-endpoint/AccountIdEndpointModeConstants.js
9
9
  function validateAccountIdEndpointMode(value) {
@@ -301,7 +301,7 @@ var init_HttpProtocol = __esmMin((() => {
301
301
  });
302
302
  }
303
303
  async loadEventStreamCapability() {
304
- const { EventStreamSerde, eventStreamSerdeProvider } = await import("./event-streams-BANyO9xt.mjs");
304
+ const { EventStreamSerde, eventStreamSerdeProvider } = await import("./event-streams-i8OGzuFN.mjs");
305
305
  return new EventStreamSerde({
306
306
  marshaller: this.resolveEventStreamMarshaller(eventStreamSerdeProvider),
307
307
  serializer: this.serializer,
package/dist/bin.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { N as main } from "./src-DKb-fkdb.mjs";
3
- import "./cli-IJrKkeYS.mjs";
2
+ import { N as main } from "./src-C43iUZgr.mjs";
3
+ import "./cli-CsiVEsS-.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);
@@ -1,9 +1,9 @@
1
1
  import { n as __esmMin, r as __exportAll, t as __commonJSMin } from "./rolldown-runtime-C1I3wEg2.mjs";
2
2
  import { ReadStream, createReadStream, fstatSync, lstatSync } from "node:fs";
3
3
  import { join, sep } from "node:path";
4
+ import { homedir } from "node:os";
4
5
  import { PassThrough, Readable, Writable } from "node:stream";
5
6
  import { createHash, createHmac, getRandomValues } from "node:crypto";
6
- import { homedir } from "node:os";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import * as zlib from "node:zlib";
9
9
  // node_modules/.pnpm/@smithy+core@3.36.2/node_modules/@smithy/core/dist-es/submodules/client/middleware-stack/MiddlewareStack.js
@@ -6046,4 +6046,4 @@ var init_checksum = __esmMin((() => {
6046
6046
  }));
6047
6047
  export { booleanSelector as $, ServiceException as $t, BinaryDecisionDiagram as A, isValidHostLabel as An, init_toUtf8 as At, NODE_REGION_CONFIG_FILE_OPTIONS as B, init_client_command_builder as Bt, isIpAddress as C, init_parseQueryString as Cn, dateToUtcString as Ct, init_EndpointError as D, init_isValidHostname as Dn, parseRfc7231DateTime as Dt, EndpointError as E, normalizeProvider as En, parseRfc3339DateTimeWithOffset as Et, init_config as F, hasOwn as Fn, init_fromUtf8 as Ft, NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS as G, init_get_value_from_text_node as Gt, REGION_ENV_NAME as H, NoOpLogger as Ht, init_resolveDefaultsModeConfig as I, init_hasOwn as In, fromBase64 as It, init_NodeUseDualstackEndpointConfigOptions as J, resolveDefaultRuntimeConfig as Jt, init_NodeUseFipsEndpointConfigOptions as K, getDefaultExtensionConfiguration as Kt, resolveDefaultsModeConfig as L, getSmithyContext as Ln, init_fromBase64 as Lt, init_getEndpointFromInstructions as M, init_httpResponse as Mn, init_toBase64 as Mt, resolveParams as N, HttpRequest as Nn, toBase64$1 as Nt, EndpointCache as O, isValidHostname as On, expectUnion as Ot, config_exports as P, init_httpRequest as Pn, fromUtf8$1 as Pt, init_types$1 as Q, loadConfigsForDefaultMode as Qt, init_resolveRegionConfig as R, init_getSmithyContext as Rn, client_exports as Rt, init_isIpAddress as S, parseUrl as Sn, init_lazy_json as St, init_customEndpointFunctions as T, init_normalizeProvider as Tn, parseEpochTimestamp as Tt, REGION_INI_NAME as U, init_NoOpLogger as Ut, NODE_REGION_CONFIG_OPTIONS as V, makeBuilder as Vt, init_config$1 as W, getValueFromTextNode as Wt, loadConfig as X, init_emitWarningIfUnsupportedVersion as Xt, init_configLoader as Y, emitWarningIfUnsupportedVersion as Yt, SelectorType as Z, init_defaults_mode as Zt, resolveEndpointConfig as _, init_deref as _n, _parseRfc7231DateTime as _t, Crc32Node as a, init_command as an, fromHex as at, decideEndpoint as b, init_transport as bn, quoteHeader as bt, generateIdempotencyToken as c, TypeRegistry as cn, NumericValue as ct, v4 as d, init_NormalizedSchema as dn, init_split_header as dt, decorateServiceException as en, init_booleanSelector as et, init_sdk_stream_mixin as f, init_translateTraits as fn, splitHeader as ft, init_endpoints as g, deref as gn, _parseRfc3339DateTimeWithOffset as gt, getEndpointPlugin as h, init_getSchemaSerdePlugin as hn, _parseEpochTimestamp as ht, init_Sha256Node as i, Command as in, init_calculateBodyLength as it, init_BinaryDecisionDiagram as j, HttpResponse as jn, toUtf8$1 as jt, init_EndpointCache as k, init_isValidHostLabel as kn, init_parse_utils as kt, init_serde as l, init_TypeRegistry as ln, init_NumericValue as lt, endpoints_exports as m, getSchemaSerdePlugin as mn, splitEvery as mt, init_checksum as n, createAggregatedClient as nn, init_ProviderError as nt, init_Crc32Node as o, init_schema as on, init_hex_encoding as ot, sdkStreamMixin as p, translateTraits as pn, init_split_every as pt, NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS as q, init_defaultExtensionConfiguration as qt, Sha256Node as r, init_create_aggregated_client as rn, calculateBodyLength as rt, Uint8ArrayBlobAdapter as s, schema_exports as sn, toHex as st, checksum_exports as t, init_exceptions as tn, ProviderError as tt, serde_exports as u, NormalizedSchema as un, nv as ut, init_resolveEndpoint as v, Client as vn, init_schema_date_utils as vt, customEndpointFunctions as w, parseQueryString as wn, init_date_utils as wt, init_decideEndpoint as x, init_parseUrl as xn, LazyJsonString as xt, resolveEndpoint as y, init_client$1 as yn, init_quote_header as yt, resolveRegionConfig as z, require_dist_cjs as zn, init_client as zt };
6048
6048
 
6049
- //# sourceMappingURL=checksum-DhS6ofSm.mjs.map
6049
+ //# sourceMappingURL=checksum-DHr5qb3Y.mjs.map