eutaxy 0.16.0 → 0.17.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 (29) hide show
  1. package/README.md +6 -6
  2. package/dist/aws.d.mts +2 -2
  3. package/dist/aws.mjs +2 -2
  4. package/dist/bin.mjs +1 -1
  5. package/dist/{cli-DbLlYHTY.mjs → cli-dK6w25AU.mjs} +39 -16
  6. package/dist/{cli-DbLlYHTY.mjs.map → cli-dK6w25AU.mjs.map} +1 -1
  7. package/dist/cli.mjs +1 -1
  8. package/dist/cloudflare.d.mts +16 -3
  9. package/dist/cloudflare.d.mts.map +1 -1
  10. package/dist/cloudflare.mjs +2 -2
  11. package/dist/{delivery-invariants-90c5xBcd.mjs → delivery-invariants-BXCuv43L.mjs} +2 -2
  12. package/dist/{delivery-invariants-90c5xBcd.mjs.map → delivery-invariants-BXCuv43L.mjs.map} +1 -1
  13. package/dist/{delivery-invariants-B8ZZnCZg.d.mts → delivery-invariants-D7DI7i8x.d.mts} +2 -2
  14. package/dist/{delivery-invariants-B8ZZnCZg.d.mts.map → delivery-invariants-D7DI7i8x.d.mts.map} +1 -1
  15. package/dist/{explore-DlwIUowm.d.mts → explore-Ci-xVeKU.d.mts} +2 -2
  16. package/dist/{explore-DlwIUowm.d.mts.map → explore-Ci-xVeKU.d.mts.map} +1 -1
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +2 -2
  19. package/dist/{platform-DPJTjpSr.d.mts → platform-D4hlJjm3.d.mts} +26 -1
  20. package/dist/{platform-DPJTjpSr.d.mts.map → platform-D4hlJjm3.d.mts.map} +1 -1
  21. package/dist/{src-CmHdPsZy.mjs → src-BiX530QY.mjs} +235 -24
  22. package/dist/src-BiX530QY.mjs.map +1 -0
  23. package/dist/{src-Dz9Wn2vL.mjs → src-DVqL5Rk_.mjs} +2 -2
  24. package/dist/{src-Dz9Wn2vL.mjs.map → src-DVqL5Rk_.mjs.map} +1 -1
  25. package/dist/{workerd-D9cUGjYv.mjs → workerd-b1sqOnVc.mjs} +3786 -3218
  26. package/dist/workerd-b1sqOnVc.mjs.map +1 -0
  27. package/package.json +1 -1
  28. package/dist/src-CmHdPsZy.mjs.map +0 -1
  29. package/dist/workerd-D9cUGjYv.mjs.map +0 -1
package/README.md CHANGED
@@ -21,8 +21,8 @@ on state that was still current.
21
21
 
22
22
  **Status: early.** The documentation is at
23
23
  [eutaxy.dev](https://eutaxy.dev). The design is in
24
- [docs/design.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/docs/design.md); the phases and their gates are in
25
- [docs/roadmap.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/docs/roadmap.md).
24
+ [docs/design.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/docs/design.md); the phases and their gates are in
25
+ [docs/roadmap.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/docs/roadmap.md).
26
26
 
27
27
  ## Verdicts
28
28
 
@@ -76,9 +76,9 @@ Write a scenario beside your Worker and run the check:
76
76
  eutaxy check ./payments.sim.ts
77
77
  ```
78
78
 
79
- [examples/payments-queue](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/examples/payments-queue) is a complete, runnable
79
+ [examples/payments-queue](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/examples/payments-queue) is a complete, runnable
80
80
  version of this: a queue consumer with a bug the check finds, and the fixed
81
- Worker it reports `BOUNDED` for. [examples/](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/examples) holds the others,
81
+ Worker it reports `BOUNDED` for. [examples/](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/examples) holds the others,
82
82
  each a Worker, its scenario, the bug and the fix: a webhook with an
83
83
  idempotency key, a lease pool object with an alarm, an Agent with a
84
84
  schedule and WebSocket connections, two Workers over a service binding,
@@ -153,8 +153,8 @@ pnpm install
153
153
  pnpm check # lint, typecheck, test
154
154
  ```
155
155
 
156
- See [CONTRIBUTING.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/CONTRIBUTING.md).
156
+ See [CONTRIBUTING.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/CONTRIBUTING.md).
157
157
 
158
158
  ## License
159
159
 
160
- [Apache-2.0](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.0/LICENSE).
160
+ [Apache-2.0](https://github.com/Kaisenwerk/eutaxy/blob/v0.17.0/LICENSE).
package/dist/aws.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { C as EffectSelector, a as PlatformData, b as StateQuery, c as WorkerRef, f as Invariant, i as ExternalDecl, k as JsonValue, n as Platform, o as ScenarioSpec, r as Bounds, u as AtLeastOnce, y as RowCondition } from "./platform-DPJTjpSr.mjs";
2
- import { n as atMostOncePerKey } from "./delivery-invariants-B8ZZnCZg.mjs";
1
+ import { C as EffectSelector, a as PlatformData, b as StateQuery, c as WorkerRef, f as Invariant, i as ExternalDecl, k as JsonValue, n as Platform, o as ScenarioSpec, r as Bounds, u as AtLeastOnce, y as RowCondition } from "./platform-D4hlJjm3.mjs";
2
+ import { n as atMostOncePerKey } from "./delivery-invariants-D7DI7i8x.mjs";
3
3
  import { Readable } from "node:stream";
4
4
  import { Agent, AgentOptions } from "node:http";
5
5
  import { Agent as Agent$1, AgentOptions as AgentOptions$1 } from "node:https";
package/dist/aws.mjs CHANGED
@@ -1,6 +1,6 @@
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 { A as writeFaults, C as toJson$1, I as invocationOf, L as redelivery, O as decisionFaults, R as canonicalJson, S as patchProperty, T as validateScenario, b as realTick, c as decide, d as runInvocation, i as rawRun, k as readFaults, n as compareSides, r as proxiedSide, u as note, w as defaultBounds } from "./src-CmHdPsZy.mjs";
3
- import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-90c5xBcd.mjs";
2
+ import { A as writeFaults, C as toJson$1, I as invocationOf, L as redelivery, O as decisionFaults, R as canonicalJson, S as patchProperty, T as validateScenario, b as realTick, c as decide, d as runInvocation, i as rawRun, k as readFaults, n as compareSides, r as proxiedSide, u as note, w as defaultBounds } from "./src-BiX530QY.mjs";
3
+ import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-BXCuv43L.mjs";
4
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-75EliDEr.mjs";
5
5
  import { Readable } from "node:stream";
6
6
  import { platform, release } from "node:os";
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as main } from "./cli-DbLlYHTY.mjs";
2
+ import { t as main } from "./cli-dK6w25AU.mjs";
3
3
  // packages/eutaxy/src/bin.ts
4
4
  process.stdout.on("error", (err) => {
5
5
  if (err.code === "EPIPE") process.exit(process.exitCode ?? 0);
@@ -1,8 +1,8 @@
1
- import { R as canonicalJson } from "./src-CmHdPsZy.mjs";
2
- import { _ as render, a as renderText, c as checkSpecModule, d as shrinkRefutation, g as endpointNumber, h as endpointBigInt, i as renderSpecs, m as conforms, n as renderSpecReport, p as evaluate, r as renderSpecReportJson, v as describeType } from "./src-Dz9Wn2vL.mjs";
1
+ import { R as canonicalJson } from "./src-BiX530QY.mjs";
2
+ import { _ as render, a as renderText, c as checkSpecModule, d as shrinkRefutation, g as endpointNumber, h as endpointBigInt, i as renderSpecs, m as conforms, n as renderSpecReport, p as evaluate, r as renderSpecReportJson, v as describeType } from "./src-DVqL5Rk_.mjs";
3
3
  import { n as isSpec } from "./combinators-CLfsPfhT.mjs";
4
4
  import { t as aggregate } from "./provers-DS44OeEm.mjs";
5
- import { G as cloudflareRegressionTest, n as globKey, r as specKey } from "./workerd-D9cUGjYv.mjs";
5
+ import { G as cloudflareRegressionTest, n as globKey, r as specKey } from "./workerd-b1sqOnVc.mjs";
6
6
  import { createRequire, registerHooks } from "node:module";
7
7
  import { Readable } from "node:stream";
8
8
  import { createHash, randomBytes } from "node:crypto";
@@ -6389,6 +6389,11 @@ function readCalleeConfig(step, scenarioDir) {
6389
6389
  durableObjects: bindings.durableObjects,
6390
6390
  workflows: bindings.workflows,
6391
6391
  services: bindings.services.map((s) => s.binding),
6392
+ carries: bindings.services.map(({ binding, entrypoint, props }) => ({
6393
+ binding,
6394
+ ...entrypoint === void 0 ? {} : { entrypoint },
6395
+ ...props === void 0 ? {} : { props }
6396
+ })),
6392
6397
  queues: bindings.queues,
6393
6398
  vars: bindings.vars,
6394
6399
  sqliteClasses: bindings.sqliteClasses,
@@ -6525,9 +6530,15 @@ function readCallerResources(wranglerPath) {
6525
6530
  return;
6526
6531
  }
6527
6532
  }
6528
- /** What the caller's binding to a callee carries (its entrypoint and props), for the test to pass with the module. */
6529
- function bindingCarries(caller, binding) {
6530
- const s = caller?.services.find((x) => x.binding === binding);
6533
+ /**
6534
+ * What the binding to a callee carries (its entrypoint and props), for the
6535
+ * test to pass with the module: from the caller's config, or for a callee's
6536
+ * own callee (`<callee>/<binding>`) from that callee's config, where the
6537
+ * binding is declared.
6538
+ */
6539
+ function bindingCarries(caller, binding, callees = []) {
6540
+ const owner = callees.find((c) => binding.startsWith(`${c.name}/`));
6541
+ const s = caller?.services.find((x) => x.binding === binding) ?? owner?.carries.find((x) => qualified(owner.name, x.binding) === binding);
6531
6542
  return {
6532
6543
  ...s?.entrypoint === void 0 ? {} : { entrypoint: s.entrypoint },
6533
6544
  ...s?.props === void 0 ? {} : { props: s.props }
@@ -6627,7 +6638,9 @@ function checkTestSource(g) {
6627
6638
  const sqlImports = g.sqlImports ?? [];
6628
6639
  const calleeImports = callees.map((c, i) => `import * as callee_${i} from ${JSON.stringify(c.importPath)};\n`);
6629
6640
  const sqlImportLines = sqlImports.map((f, i) => `import sql_${i} from ${JSON.stringify(`${f.importPath}?raw`)};\n`);
6630
- const calleesOption = callees.length === 0 ? "" : `, callees: { ${callees.map((c, i) => `${JSON.stringify(c.binding)}: { name: ${JSON.stringify(c.name)}, exports: callee_${i}${c.entrypoint === void 0 ? "" : `, entrypoint: ${JSON.stringify(c.entrypoint)}`}${c.props === void 0 ? "" : `, props: ${JSON.stringify(c.props)}`} }`).join(", ")} }`;
6641
+ const workerImportLine = g.workerImport === void 0 ? "" : `import * as workerModule from ${JSON.stringify(g.workerImport)};\n`;
6642
+ const workerOption = g.workerImport === void 0 ? "" : ", worker: workerModule";
6643
+ const calleesOption = callees.length === 0 ? "" : `, callees: { ${callees.map((c, i) => `${JSON.stringify(c.binding)}: { name: ${JSON.stringify(c.name)}, exports: callee_${i}${c.entrypoint === void 0 ? "" : `, entrypoint: ${JSON.stringify(c.entrypoint)}`}${c.props === void 0 ? "" : `, props: ${JSON.stringify(c.props)}`}${c.self ? ", self: true" : ""} }`).join(", ")} }`;
6631
6644
  const extraSql = sqlImports.length === 0 ? "" : `, extraSql: { ${sqlImports.map((f, i) => `${JSON.stringify(f.key)}: sql_${i}`).join(", ")} }`;
6632
6645
  const aliases = g.aliases === void 0 || Object.keys(g.aliases).length === 0 ? "" : `, aliases: ${JSON.stringify(g.aliases)}`;
6633
6646
  return `// Generated by eutaxy check; deleted after the run.
@@ -6636,13 +6649,13 @@ import { env } from "cloudflare:workers";
6636
6649
  import * as durableObjects from "cloudflare:test";
6637
6650
  import { test } from "vitest";
6638
6651
  import scenario from ${JSON.stringify(g.scenarioImport)};
6639
- ${calleeImports.join("")}${sqlImportLines.join("")}import { specEntries } from "./specs.ts";
6652
+ ${workerImportLine}${calleeImports.join("")}${sqlImportLines.join("")}import { specEntries } from "./specs.ts";
6640
6653
 
6641
6654
  const sqlFiles = import.meta.glob("../**/*.sql", { query: "?raw", import: "default", eager: true }) as Record<string, string>;
6642
6655
  const modules = import.meta.glob(["../**/*.ts", "!../**/*.test.ts", "!../**/*.sim.ts", "!../**/node_modules/**", "!../**/.eutaxy/**"]);
6643
6656
 
6644
6657
  test("eutaxy check", async ({ task }) => {
6645
- task.meta[${JSON.stringify(metaKey)}] = await checkInWorkerd({ scenario, env, durableObjects, sqlFiles, modules, specEntries${calleesOption}${extraSql}${aliases}, ${options} });
6658
+ task.meta[${JSON.stringify(metaKey)}] = await checkInWorkerd({ scenario, env, durableObjects, sqlFiles, modules, specEntries${workerOption}${calleesOption}${extraSql}${aliases}, ${options} });
6646
6659
  });
6647
6660
  `;
6648
6661
  }
@@ -6653,6 +6666,9 @@ import { cloudflareTest } from "@cloudflare/vitest-plugin";
6653
6666
  import { defineConfig } from "vitest/config";
6654
6667
 
6655
6668
  ${isolate?.miniflare === void 0 ? "" : `const ${neverCalled} = () => new Response("eutaxy: a service binding the scenario scripts or runs as a callee is never called", { status: 500 });\n\n`}export default defineConfig({
6669
+ // Vite's cache, kept with the generated files so it goes when they do (its default is the
6670
+ // project's node_modules/.vite, which a check would leave behind in the scenario's directory).
6671
+ cacheDir: ${JSON.stringify(join(dirname(testPath), ".vite"))},
6656
6672
  plugins: [${plugin}],
6657
6673
  test: {
6658
6674
  include: [${JSON.stringify(testPath)}],
@@ -6898,18 +6914,23 @@ async function runCheck(o) {
6898
6914
  o.stderr(`could not read the scenario's callees: ${String(err)}\n`);
6899
6915
  return exitCodes.error;
6900
6916
  }
6901
- for (const c of callees) if (c.notAdded.length > 0) o.stderr(`callee ${describeCallee(c, dir)}: not added to the test's isolate: ${c.notAdded.join(", ")}\n`);
6902
6917
  const callerResources = readCallerResources(wrangler);
6918
+ const isSelf = (c) => callerResources?.name !== void 0 && c.name === callerResources.name;
6919
+ const allCallees = callees;
6920
+ callees = allCallees.filter((c) => !isSelf(c));
6921
+ for (const c of callees) if (c.notAdded.length > 0) o.stderr(`callee ${describeCallee(c, dir)}: not added to the test's isolate: ${c.notAdded.join(", ")}\n`);
6903
6922
  const isolate = isolateOf(callees, callees.length > 0 ? callerResources : void 0);
6904
6923
  const callerServices = (callerResources?.services ?? []).map((s) => s.binding).filter((b) => b);
6905
6924
  for (const reason of isolate.notAdded) o.stderr(`not added to the test's isolate: ${reason}\n`);
6906
6925
  mkdirSync(workDir, { recursive: true });
6907
6926
  try {
6908
6927
  const sqlImports = [];
6909
- if (callees.length > 0 && loaded) for (const step of loaded.setup) {
6928
+ /** Whether a path the scenario names lies outside its directory, where the test's globs do not reach. */
6929
+ const outside = (file) => relative(dir, resolve(dir, file)).startsWith("..");
6930
+ if (loaded) for (const step of loaded.setup) {
6910
6931
  if (step.kind !== "d1") continue;
6911
6932
  const file = String(step["schemaFile"]);
6912
- if (!relative(dir, resolve(dir, file)).startsWith("..")) continue;
6933
+ if (!outside(file)) continue;
6913
6934
  sqlImports.push({
6914
6935
  key: globKey(file),
6915
6936
  importPath: toPosix(relative(workDir, resolve(dir, file)))
@@ -6921,11 +6942,13 @@ async function runCheck(o) {
6921
6942
  ...o.budgetMs === void 0 ? {} : { budgetMs: o.budgetMs },
6922
6943
  ...o.exhaustive ? { exhaustive: true } : {},
6923
6944
  scenarioImport: `../${basename(scenarioPath)}`,
6924
- ...callees.length === 0 ? {} : { callees: callees.map((c) => ({
6945
+ ...loaded && outside(loaded.worker.entry) ? { workerImport: toPosix(relative(workDir, resolve(dir, loaded.worker.entry))) } : {},
6946
+ ...allCallees.length === 0 ? {} : { callees: allCallees.map((c) => ({
6925
6947
  binding: c.binding,
6926
6948
  name: c.name,
6927
6949
  importPath: toPosix(relative(workDir, c.entry)),
6928
- ...bindingCarries(callerResources, c.binding)
6950
+ ...bindingCarries(callerResources, c.binding, callees),
6951
+ ...isSelf(c) ? { self: true } : {}
6929
6952
  })) },
6930
6953
  ...sqlImports.length === 0 ? {} : { sqlImports },
6931
6954
  ...Object.keys(isolate.aliases).length === 0 ? {} : { aliases: isolate.aliases }
@@ -8303,7 +8326,7 @@ async function runReport(o) {
8303
8326
  }
8304
8327
  // packages/cli/src/version.ts
8305
8328
  /** The published package's version, as the MCP server reports it; the release tooling keeps it in step. */
8306
- const eutaxyVersion = "0.16.0";
8329
+ const eutaxyVersion = "0.17.0";
8307
8330
  // packages/cli/src/mcp.ts
8308
8331
  /**
8309
8332
  * `eutaxy mcp`: a Model Context Protocol server over stdio, so a coding
@@ -9061,4 +9084,4 @@ async function main(argv, io) {
9061
9084
  }
9062
9085
  export { main as t };
9063
9086
 
9064
- //# sourceMappingURL=cli-DbLlYHTY.mjs.map
9087
+ //# sourceMappingURL=cli-dK6w25AU.mjs.map