eutaxy 0.16.0 → 0.16.1

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 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.16.1/docs/design.md); the phases and their gates are in
25
+ [docs/roadmap.md](https://github.com/Kaisenwerk/eutaxy/blob/v0.16.1/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.16.1/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.16.1/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.16.1/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.16.1/LICENSE).
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-dkn6Illb.mjs";
3
+ import { n as atLeastOncePerMessage$1, r as atMostOncePerKey } from "./delivery-invariants-BfRnb9yR.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-KACykdzJ.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-dkn6Illb.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-DWRaG5aV.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-9Tt0BV-3.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,6 +6638,8 @@ 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`);
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";
6630
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)}`} }`).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)}`;
@@ -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)}],
@@ -6906,10 +6922,12 @@ async function runCheck(o) {
6906
6922
  mkdirSync(workDir, { recursive: true });
6907
6923
  try {
6908
6924
  const sqlImports = [];
6909
- if (callees.length > 0 && loaded) for (const step of loaded.setup) {
6925
+ /** Whether a path the scenario names lies outside its directory, where the test's globs do not reach. */
6926
+ const outside = (file) => relative(dir, resolve(dir, file)).startsWith("..");
6927
+ if (loaded) for (const step of loaded.setup) {
6910
6928
  if (step.kind !== "d1") continue;
6911
6929
  const file = String(step["schemaFile"]);
6912
- if (!relative(dir, resolve(dir, file)).startsWith("..")) continue;
6930
+ if (!outside(file)) continue;
6913
6931
  sqlImports.push({
6914
6932
  key: globKey(file),
6915
6933
  importPath: toPosix(relative(workDir, resolve(dir, file)))
@@ -6921,11 +6939,12 @@ async function runCheck(o) {
6921
6939
  ...o.budgetMs === void 0 ? {} : { budgetMs: o.budgetMs },
6922
6940
  ...o.exhaustive ? { exhaustive: true } : {},
6923
6941
  scenarioImport: `../${basename(scenarioPath)}`,
6942
+ ...loaded && outside(loaded.worker.entry) ? { workerImport: toPosix(relative(workDir, resolve(dir, loaded.worker.entry))) } : {},
6924
6943
  ...callees.length === 0 ? {} : { callees: callees.map((c) => ({
6925
6944
  binding: c.binding,
6926
6945
  name: c.name,
6927
6946
  importPath: toPosix(relative(workDir, c.entry)),
6928
- ...bindingCarries(callerResources, c.binding)
6947
+ ...bindingCarries(callerResources, c.binding, callees)
6929
6948
  })) },
6930
6949
  ...sqlImports.length === 0 ? {} : { sqlImports },
6931
6950
  ...Object.keys(isolate.aliases).length === 0 ? {} : { aliases: isolate.aliases }
@@ -8303,7 +8322,7 @@ async function runReport(o) {
8303
8322
  }
8304
8323
  // packages/cli/src/version.ts
8305
8324
  /** The published package's version, as the MCP server reports it; the release tooling keeps it in step. */
8306
- const eutaxyVersion = "0.16.0";
8325
+ const eutaxyVersion = "0.16.1";
8307
8326
  // packages/cli/src/mcp.ts
8308
8327
  /**
8309
8328
  * `eutaxy mcp`: a Model Context Protocol server over stdio, so a coding
@@ -9061,4 +9080,4 @@ async function main(argv, io) {
9061
9080
  }
9062
9081
  export { main as t };
9063
9082
 
9064
- //# sourceMappingURL=cli-DbLlYHTY.mjs.map
9083
+ //# sourceMappingURL=cli-KACykdzJ.mjs.map