@stigmer/runner 3.29.0 → 3.30.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 (61) hide show
  1. package/dist/.build-fingerprint +1 -1
  2. package/dist/activities/call-eval.d.ts +16 -0
  3. package/dist/activities/call-eval.js +54 -1
  4. package/dist/activities/call-eval.js.map +1 -1
  5. package/dist/activities/hydrate-workflow-execution.d.ts +1 -1
  6. package/dist/activities/workflow-event-activities.d.ts +2 -2
  7. package/dist/activities/workflow-event-activities.js +2 -2
  8. package/dist/harness/transcript/builder.d.ts +3 -2
  9. package/dist/harness/transcript/builder.js +28 -8
  10. package/dist/harness/transcript/builder.js.map +1 -1
  11. package/dist/shared/approval-policy.d.ts +5 -0
  12. package/dist/shared/approval-policy.js +8 -0
  13. package/dist/shared/approval-policy.js.map +1 -1
  14. package/dist/shared/args-preview.d.ts +12 -5
  15. package/dist/shared/args-preview.js +12 -5
  16. package/dist/shared/args-preview.js.map +1 -1
  17. package/dist/worker.d.ts +2 -4
  18. package/dist/worker.js +2 -4
  19. package/dist/worker.js.map +1 -1
  20. package/dist/workflow-engine/tasks/run.d.ts +13 -1
  21. package/dist/workflow-engine/tasks/run.js +16 -1
  22. package/dist/workflow-engine/tasks/run.js.map +1 -1
  23. package/dist/workflows/call-agent-orchestrator.d.ts +1 -1
  24. package/dist/workflows/call-agent-orchestrator.js +1 -1
  25. package/dist/workflows/engine-core.d.ts +28 -8
  26. package/dist/workflows/engine-core.js +9 -7
  27. package/dist/workflows/engine-core.js.map +1 -1
  28. package/dist/workflows/index.d.ts +22 -7
  29. package/dist/workflows/index.js +22 -7
  30. package/dist/workflows/index.js.map +1 -1
  31. package/dist/workflows/workflow-signals.d.ts +3 -3
  32. package/dist/workflows/workflow-signals.js +3 -3
  33. package/package.json +5 -5
  34. package/src/__test-utils__/workflows/index.ts +14 -0
  35. package/src/__test-utils__/workflows/inline-model.ts +32 -0
  36. package/src/__tests__/dispatch-surface-e2e.test.ts +212 -0
  37. package/src/__tests__/golden-e2e.test.ts +4 -3
  38. package/src/__tests__/history-encryption-e2e.test.ts +1 -1
  39. package/src/activities/__tests__/call-eval.test.ts +115 -0
  40. package/src/activities/call-eval.ts +59 -1
  41. package/src/activities/hydrate-workflow-execution.ts +1 -1
  42. package/src/activities/workflow-event-activities.ts +2 -2
  43. package/src/harness/transcript/__tests__/builder.test.ts +56 -1
  44. package/src/harness/transcript/builder.ts +29 -8
  45. package/src/shared/__tests__/approval-policy.test.ts +10 -0
  46. package/src/shared/__tests__/args-preview.test.ts +50 -1
  47. package/src/shared/approval-policy.ts +7 -0
  48. package/src/shared/args-preview.ts +12 -5
  49. package/src/worker.ts +2 -4
  50. package/src/workflow-engine/__tests__/tasks/run.test.ts +25 -0
  51. package/src/workflow-engine/tasks/run.ts +19 -1
  52. package/src/workflows/__tests__/barrel.test.ts +41 -0
  53. package/src/workflows/__tests__/{execute-serverless-workflow.test.ts → engine-inline-model.test.ts} +16 -4
  54. package/src/workflows/call-agent-orchestrator.ts +1 -1
  55. package/src/workflows/engine-core.ts +34 -9
  56. package/src/workflows/index.ts +22 -10
  57. package/src/workflows/workflow-signals.ts +3 -3
  58. package/dist/workflows/execute-serverless-workflow.d.ts +0 -32
  59. package/dist/workflows/execute-serverless-workflow.js +0 -36
  60. package/dist/workflows/execute-serverless-workflow.js.map +0 -1
  61. package/src/workflows/execute-serverless-workflow.ts +0 -60
@@ -7,7 +7,9 @@
7
7
  * - `run.workflow`: Child Temporal workflow (await or fire-and-forget)
8
8
  *
9
9
  * The kernel validates configuration and delegates to `ctx.runCommand`
10
- * (for script/shell) or `ctx.runWorkflow` (for child workflows).
10
+ * (for script/shell) or `ctx.runWorkflow` (for child workflows). A child
11
+ * workflow's name may not be a platform workflow type
12
+ * ({@link PLATFORM_WORKFLOW_TYPE_PREFIX} says why).
11
13
  *
12
14
  * YAML shapes:
13
15
  * - runScript:
@@ -30,6 +32,16 @@
30
32
  * version: '1.0.0'
31
33
  */
32
34
  const SUPPORTED_LANGUAGES = ["js", "python"];
35
+ /**
36
+ * The namespace of the platform's own Temporal workflow types: every type a
37
+ * runner registers (`workflows/index.ts`) and every type the server starts.
38
+ * A child started by `run.workflow` runs on the parent's task queue, so a
39
+ * name in this namespace would reach the runner's own types directly: work
40
+ * the server never dispatched, outside the run it belongs to. A workflow
41
+ * therefore cannot name one. `workflows/__tests__/barrel.test.ts` pins that
42
+ * every registered type carries this prefix, so the refusal covers each.
43
+ */
44
+ export const PLATFORM_WORKFLOW_TYPE_PREFIX = "stigmer/";
33
45
  export class RunTaskBuilder {
34
46
  taskName;
35
47
  taskDef;
@@ -109,6 +121,9 @@ function validateRunConfig(config, taskName) {
109
121
  if (!config.workflow.name) {
110
122
  throw new Error(`Run task '${taskName}': workflow.name is required`);
111
123
  }
124
+ if (config.workflow.name.startsWith(PLATFORM_WORKFLOW_TYPE_PREFIX)) {
125
+ throw new Error(`Run task '${taskName}': '${config.workflow.name}' is a platform workflow type, and a workflow cannot start one`);
126
+ }
112
127
  }
113
128
  }
114
129
  //# sourceMappingURL=run.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run.js","sourceRoot":"","sources":["../../../src/workflow-engine/tasks/run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAYH,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAE7C,MAAM,OAAO,cAAc;IAChB,QAAQ,CAAS;IACjB,OAAO,CAAU;IAE1B,YAAY,QAAgB,EAAE,OAAmB;QAC/C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IAED,KAAK;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,OAAqB,CAAC;QAC1C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC;QAC1B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,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AK,CAAC,aAAa,QAAQ,8BAA8B,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC,EAAE,CAAC;YACnE,MAAM,IAAI,KAAK,CACb,aAAa,QAAQ,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,gEAAgE,CACjH,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * The workflow engine's CallAgentTaskBuilder (workflow-engine/tasks/
12
12
  * call-agent.ts) calls `ctx.callAgent()`, which is wired to
13
- * `orchestrateAgentCall()` in execute-serverless-workflow.ts.
13
+ * `orchestrateAgentCall()` in engine-core.ts.
14
14
  *
15
15
  * SANDBOX RULES: Only @temporalio/workflow imports, type-only imports,
16
16
  * and pure logic. No Node.js built-ins.
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * The workflow engine's CallAgentTaskBuilder (workflow-engine/tasks/
12
12
  * call-agent.ts) calls `ctx.callAgent()`, which is wired to
13
- * `orchestrateAgentCall()` in execute-serverless-workflow.ts.
13
+ * `orchestrateAgentCall()` in engine-core.ts.
14
14
  *
15
15
  * SANDBOX RULES: Only @temporalio/workflow imports, type-only imports,
16
16
  * and pure logic. No Node.js built-ins.
@@ -2,17 +2,38 @@
2
2
  * Shared workflow engine core — runs CNCF Serverless Workflow DSL
3
3
  * tasks inside the Temporal deterministic sandbox.
4
4
  *
5
- * Extracted from execute-serverless-workflow.ts so that both the
6
- * direct workflow ("stigmer/workflow/execute") and the hydration
7
- * wrapper ("stigmer/workflow/execute-from-execution") can share the
8
- * engine without code duplication.
5
+ * The engine runs a fully materialized {@link ExecuteServerlessWorkflowInput}
6
+ * and owns that type. Production reaches it only through the hydration
7
+ * workflow ("stigmer/workflow/execute-from-execution"), which reads the
8
+ * model, env and input back from the server by id; no registered workflow
9
+ * accepts a materialized model from its caller (see `index.ts`). The test
10
+ * harness runs goldens through an inline entry of its own
11
+ * (`src/__test-utils__/workflows/`).
9
12
  *
10
13
  * SANDBOX RULES: This file runs inside the Temporal deterministic V8
11
14
  * isolate. No Node.js built-ins (crypto, fs, net), no non-deterministic
12
15
  * operations, no side-effecting imports. Only @temporalio/workflow APIs,
13
16
  * type-only imports, and pure JS/TS logic.
14
17
  */
15
- import type { ExecuteServerlessWorkflowInput } from "./execute-serverless-workflow.js";
18
+ import type { WorkflowModel } from "../workflow-engine/types.js";
19
+ /**
20
+ * What the engine runs: a parsed model, the merged env and the workflow
21
+ * input. Built by the hydration activity from what the server holds
22
+ * (`activities/hydrate-workflow-execution.ts`), never taken from a caller.
23
+ */
24
+ export interface ExecuteServerlessWorkflowInput {
25
+ model: WorkflowModel;
26
+ workflow_input: unknown;
27
+ env: Record<string, unknown>;
28
+ metadata?: ExecutionMetadata;
29
+ }
30
+ export interface ExecutionMetadata {
31
+ execution_id?: string;
32
+ workflow_id?: string;
33
+ workflow_instance_id?: string;
34
+ org_id?: string;
35
+ execution_target?: number;
36
+ }
16
37
  export interface RunWorkflowEngineOptions {
17
38
  readonly checkPause?: () => Promise<void>;
18
39
  readonly recoveryMode?: boolean;
@@ -25,9 +46,8 @@ export interface RunWorkflowEngineOptions {
25
46
  * executes all tasks via {@link executeDoTasks}, and returns the final
26
47
  * output.
27
48
  *
28
- * Called by both:
29
- * - `executeServerlessWorkflow` (direct invocation with pre-materialized input)
30
- * - `executeFromExecution` (wrapper that hydrates from slim IDs first)
49
+ * Called by `executeFromExecution` once it has hydrated the input from
50
+ * slim ids, and by the test harness's inline entry.
31
51
  *
32
52
  * @param options.checkPause Optional pause yield point callback. When
33
53
  * provided, the engine calls this between tasks and allows the
@@ -2,10 +2,13 @@
2
2
  * Shared workflow engine core — runs CNCF Serverless Workflow DSL
3
3
  * tasks inside the Temporal deterministic sandbox.
4
4
  *
5
- * Extracted from execute-serverless-workflow.ts so that both the
6
- * direct workflow ("stigmer/workflow/execute") and the hydration
7
- * wrapper ("stigmer/workflow/execute-from-execution") can share the
8
- * engine without code duplication.
5
+ * The engine runs a fully materialized {@link ExecuteServerlessWorkflowInput}
6
+ * and owns that type. Production reaches it only through the hydration
7
+ * workflow ("stigmer/workflow/execute-from-execution"), which reads the
8
+ * model, env and input back from the server by id; no registered workflow
9
+ * accepts a materialized model from its caller (see `index.ts`). The test
10
+ * harness runs goldens through an inline entry of its own
11
+ * (`src/__test-utils__/workflows/`).
9
12
  *
10
13
  * SANDBOX RULES: This file runs inside the Temporal deterministic V8
11
14
  * isolate. No Node.js built-ins (crypto, fs, net), no non-deterministic
@@ -94,9 +97,8 @@ const promoteProxy = proxyLocalActivities({
94
97
  * executes all tasks via {@link executeDoTasks}, and returns the final
95
98
  * output.
96
99
  *
97
- * Called by both:
98
- * - `executeServerlessWorkflow` (direct invocation with pre-materialized input)
99
- * - `executeFromExecution` (wrapper that hydrates from slim IDs first)
100
+ * Called by `executeFromExecution` once it has hydrated the input from
101
+ * slim ids, and by the test harness's inline entry.
100
102
  *
101
103
  * @param options.checkPause Optional pause yield point callback. When
102
104
  * provided, the engine calls this between tasks and allows the
@@ -1 +1 @@
1
- {"version":3,"file":"engine-core.js","sourceRoot":"","sources":["../../src/workflows/engine-core.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AASzF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,q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CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,mBAAmB,CACvC,EAAE,UAAU,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAC/B,KAAK,CAAC,MAAM,EACZ,SAAS,CACV,CAAC;YACF,OAAO,OAAO,CAAC,UAAU,CAAC;QAC5B,CAAC;QACD,OAAO,KAAK,CAAC,MAAM,CAAC;IACtB,CAAC;IAED,OAAO,KAAK,CAAC,MAAM,CAAC;AACtB,CAAC"}
@@ -1,13 +1,29 @@
1
1
  /**
2
- * Workflow barrel file — the entry point for Temporal's workflow bundler.
2
+ * Workflow barrel file — the entry point for Temporal's workflow bundler,
3
+ * and the complete list of workflow types a runner registers.
3
4
  *
4
5
  * Re-exports workflow functions with the exact Temporal workflow type
5
- * names that the Java/Go backend uses to start them. The Temporal TS
6
- * SDK derives the workflow type from the export name of the module
7
- * passed to `workflowsPath`.
6
+ * names that the server uses to start them. The Temporal TS SDK derives
7
+ * the workflow type from the export name of the module passed to
8
+ * `workflowsPath`, so every export here is a registered type on every
9
+ * worker root: the static worker, the manager and pool workers, and the
10
+ * pre-built bundle (`scripts/bundle-slim.mjs`).
8
11
  *
9
- * The Java backend starts workflows via:
10
- * workflowClient.newUntypedWorkflowStub("stigmer/mcp-server/connect", ...)
12
+ * THE RULE: every export is a type the server starts, and each takes ids
13
+ * that the runner reads back from the server, never a model to run.
14
+ * Anyone who can reach Temporal can start any type registered here on a
15
+ * runner's queue, so a new export is a new door and is reviewed as a
16
+ * wire change. `__tests__/barrel.test.ts` pins the exact set. Tests that
17
+ * hand the engine a model directly use the test barrel
18
+ * (`src/__test-utils__/workflows/index.ts`).
19
+ *
20
+ * The types and their starters:
21
+ * - "stigmer/mcp-server/connect" and "stigmer/mcp-server/discover": the
22
+ * server's MCP connect lane (`temporal/mcpserver/names.ts` in the
23
+ * server), by MCP server id.
24
+ * - "stigmer/workflow/execute-from-execution": the server's workflow
25
+ * execution orchestrator (`temporal/workflowexecution/names.ts`), by
26
+ * execution id; it hydrates the model from the server.
11
27
  *
12
28
  * ES2022 arbitrary module export names (`export { fn as "..." }`) let
13
29
  * us map TypeScript function names to the slash-delimited Temporal
@@ -21,5 +37,4 @@
21
37
  * src/workflow-source.ts).
22
38
  */
23
39
  export { connectMcpServer as "stigmer/mcp-server/connect", discoverMcpServerLegacy as "stigmer/mcp-server/discover", } from "./connect-mcp-server.js";
24
- export { executeServerlessWorkflow as "stigmer/workflow/execute", } from "./execute-serverless-workflow.js";
25
40
  export { executeFromExecution as "stigmer/workflow/execute-from-execution", } from "./execute-from-execution.js";
@@ -1,13 +1,29 @@
1
1
  /**
2
- * Workflow barrel file — the entry point for Temporal's workflow bundler.
2
+ * Workflow barrel file — the entry point for Temporal's workflow bundler,
3
+ * and the complete list of workflow types a runner registers.
3
4
  *
4
5
  * Re-exports workflow functions with the exact Temporal workflow type
5
- * names that the Java/Go backend uses to start them. The Temporal TS
6
- * SDK derives the workflow type from the export name of the module
7
- * passed to `workflowsPath`.
6
+ * names that the server uses to start them. The Temporal TS SDK derives
7
+ * the workflow type from the export name of the module passed to
8
+ * `workflowsPath`, so every export here is a registered type on every
9
+ * worker root: the static worker, the manager and pool workers, and the
10
+ * pre-built bundle (`scripts/bundle-slim.mjs`).
8
11
  *
9
- * The Java backend starts workflows via:
10
- * workflowClient.newUntypedWorkflowStub("stigmer/mcp-server/connect", ...)
12
+ * THE RULE: every export is a type the server starts, and each takes ids
13
+ * that the runner reads back from the server, never a model to run.
14
+ * Anyone who can reach Temporal can start any type registered here on a
15
+ * runner's queue, so a new export is a new door and is reviewed as a
16
+ * wire change. `__tests__/barrel.test.ts` pins the exact set. Tests that
17
+ * hand the engine a model directly use the test barrel
18
+ * (`src/__test-utils__/workflows/index.ts`).
19
+ *
20
+ * The types and their starters:
21
+ * - "stigmer/mcp-server/connect" and "stigmer/mcp-server/discover": the
22
+ * server's MCP connect lane (`temporal/mcpserver/names.ts` in the
23
+ * server), by MCP server id.
24
+ * - "stigmer/workflow/execute-from-execution": the server's workflow
25
+ * execution orchestrator (`temporal/workflowexecution/names.ts`), by
26
+ * execution id; it hydrates the model from the server.
11
27
  *
12
28
  * ES2022 arbitrary module export names (`export { fn as "..." }`) let
13
29
  * us map TypeScript function names to the slash-delimited Temporal
@@ -21,6 +37,5 @@
21
37
  * src/workflow-source.ts).
22
38
  */
23
39
  export { connectMcpServer as "stigmer/mcp-server/connect", discoverMcpServerLegacy as "stigmer/mcp-server/discover", } from "./connect-mcp-server.js";
24
- export { executeServerlessWorkflow as "stigmer/workflow/execute", } from "./execute-serverless-workflow.js";
25
40
  export { executeFromExecution as "stigmer/workflow/execute-from-execution", } from "./execute-from-execution.js";
26
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,gBAAgB,IAAI,4BAA4B,EAChD,uBAAuB,IAAI,6BAA6B,GACzD,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,yBAAyB,IAAI,0BAA0B,GACxD,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,oBAAoB,IAAI,yCAAyC,GAClE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/workflows/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,gBAAgB,IAAI,4BAA4B,EAChD,uBAAuB,IAAI,6BAA6B,GACzD,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,oBAAoB,IAAI,yCAAyC,GAClE,MAAM,6BAA6B,CAAC"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Shared pause/resume signal definitions and handler setup for
3
- * workflow execution. Used by both the hydration wrapper
4
- * ("stigmer/workflow/execute-from-execution") and the direct
5
- * invocation path ("stigmer/workflow/execute").
3
+ * workflow execution. Used by the hydration wrapper
4
+ * ("stigmer/workflow/execute-from-execution") and by the test harness's
5
+ * inline entry (`src/__test-utils__/workflows/inline-model.ts`).
6
6
  *
7
7
  * The Java/Go orchestrators forward pause and resume signals to
8
8
  * the child workflow. The engine checks a `checkPause` callback
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Shared pause/resume signal definitions and handler setup for
3
- * workflow execution. Used by both the hydration wrapper
4
- * ("stigmer/workflow/execute-from-execution") and the direct
5
- * invocation path ("stigmer/workflow/execute").
3
+ * workflow execution. Used by the hydration wrapper
4
+ * ("stigmer/workflow/execute-from-execution") and by the test harness's
5
+ * inline entry (`src/__test-utils__/workflows/inline-model.ts`).
6
6
  *
7
7
  * The Java/Go orchestrators forward pause and resume signals to
8
8
  * the child workflow. The engine checks a `checkPause` callback
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stigmer/runner",
3
- "version": "3.29.0",
3
+ "version": "3.30.0",
4
4
  "description": "Embeddable Temporal worker for the Stigmer AI agent platform — handles agent execution, workflow orchestration, and MCP server management",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -104,10 +104,10 @@
104
104
  "@opentelemetry/sdk-metrics": "^2.0.0",
105
105
  "@opentelemetry/sdk-trace-base": "^2.0.0",
106
106
  "@opentelemetry/sdk-trace-node": "^2.0.0",
107
- "@stigmer/outbound": "3.29.0",
108
- "@stigmer/protos": "3.29.0",
109
- "@stigmer/temporal-codecs": "3.29.0",
110
- "@stigmer/zip-structure": "3.29.0",
107
+ "@stigmer/outbound": "3.30.0",
108
+ "@stigmer/protos": "3.30.0",
109
+ "@stigmer/temporal-codecs": "3.30.0",
110
+ "@stigmer/zip-structure": "3.30.0",
111
111
  "@temporalio/activity": "1.16.2",
112
112
  "@temporalio/common": "1.16.2",
113
113
  "@temporalio/interceptors-opentelemetry": "1.16.2",
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Test-only workflow barrel: every production type, plus the inline-model
3
+ * entry the goldens drive the engine through (`inline-model.ts` says why it
4
+ * is test-only). Point a test worker's `workflowsPath` here instead of at
5
+ * `src/workflows/index.ts` when a test hands the engine a model directly.
6
+ *
7
+ * WORKFLOW-BUNDLE IMPORT DISCIPLINE applies (sandbox module).
8
+ */
9
+
10
+ export * from "../../workflows/index.js";
11
+
12
+ // Must equal INLINE_MODEL_WORKFLOW_TYPE in inline-model.ts: an ES2022
13
+ // export alias must be a literal, so this line cannot import it.
14
+ export { executeInlineModel as "test/workflow/execute-inline" } from "./inline-model.js";
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Test-only workflow: runs the engine on a model the caller hands it.
3
+ *
4
+ * The goldens and the encryption e2e drive the engine with a materialized
5
+ * {@link ExecuteServerlessWorkflowInput} and no server to hydrate from.
6
+ * Production registers no such type. A worker that ran whatever model
7
+ * arrived on its queue would let anyone who can reach Temporal run work
8
+ * that no signed-in person asked for, so the production barrel
9
+ * (`src/workflows/index.ts`) exports only the types the server starts.
10
+ * This entry lives here, outside the published build (`tsconfig.build.json`
11
+ * excludes `src/__test-utils__`), and is registered only by the test
12
+ * barrel beside it, under a name outside the platform's `stigmer/`
13
+ * namespace.
14
+ *
15
+ * SANDBOX RULES: This file runs inside the Temporal deterministic V8
16
+ * isolate. No Node.js built-ins, no non-deterministic operations, no
17
+ * side-effecting imports.
18
+ */
19
+
20
+ import { runWorkflowEngine } from "../../workflows/engine-core.js";
21
+ import type { ExecuteServerlessWorkflowInput } from "../../workflows/engine-core.js";
22
+ import { setupPauseResumeHandlers } from "../../workflows/workflow-signals.js";
23
+
24
+ /** The test barrel's name for this workflow; never a production type. */
25
+ export const INLINE_MODEL_WORKFLOW_TYPE = "test/workflow/execute-inline";
26
+
27
+ export async function executeInlineModel(
28
+ input: ExecuteServerlessWorkflowInput,
29
+ ): Promise<unknown> {
30
+ const { checkPause } = setupPauseResumeHandlers();
31
+ return runWorkflowEngine(input, { checkPause });
32
+ }
@@ -0,0 +1,212 @@
1
+ /**
2
+ * What a runner does with a workflow it was never meant to run, through a
3
+ * real Temporal (`TestWorkflowEnvironment`, the golden E2E's harness).
4
+ *
5
+ * A client that can reach Temporal can start any workflow type on a
6
+ * runner's queue, with any input. The runner's answer is its registered
7
+ * set: the production barrel (`src/workflows/index.ts`), which every
8
+ * worker root bundles, registers only types the server starts by id. This
9
+ * file pins the consequence end to end, on a worker that loads that barrel
10
+ * and the run-credential interceptors the way the roots do:
11
+ * - a start of `stigmer/workflow/execute` carrying a complete model never
12
+ * runs. Its workflow task fails because the type is unregistered, and no
13
+ * activity is ever scheduled, so the model's shell task never executes;
14
+ * - the same worker still runs `execute-from-execution`, the type the
15
+ * server does start, so the refusal is the barrel's and not a dead worker.
16
+ *
17
+ * The inline type's name is written out here on purpose: it is the removed
18
+ * type, and this test is what keeps it removed at the wire. Skipped, like
19
+ * the golden E2E, when a local Temporal cannot boot.
20
+ */
21
+
22
+ import { describe, it, expect, beforeAll, afterAll } from "vitest";
23
+ import { readFileSync } from "node:fs";
24
+ import { join, dirname } from "node:path";
25
+ import { fileURLToPath } from "node:url";
26
+
27
+ import { loadWorkflowFromYaml } from "../workflow-engine/loader.js";
28
+ import { evaluateExpressionBatch } from "../workflow-engine/expression.js";
29
+ import type { ExecuteServerlessWorkflowInput } from "../workflows/engine-core.js";
30
+ import type { ExecuteFromExecutionInput } from "../workflows/execute-from-execution.js";
31
+ import { EXECUTE_FROM_EXECUTION_WORKFLOW_TYPE } from "../workflows/execute-from-execution.js";
32
+ import { runCredentialActivityInterceptor } from "../interceptors/run-credential-activity.js";
33
+
34
+ const __dirname = dirname(fileURLToPath(import.meta.url));
35
+ const WORKFLOWS_PATH = join(__dirname, "../workflows/index.ts");
36
+ const RUN_CREDENTIAL_WORKFLOW_INTERCEPTOR = join(
37
+ __dirname,
38
+ "../workflows/interceptors/run-credential.ts",
39
+ );
40
+ const GOLDEN_MODEL = readFileSync(
41
+ join(__dirname, "../../test/golden/01-operation-basic.yaml"),
42
+ "utf-8",
43
+ );
44
+ const TASK_QUEUE = "dispatch-surface-e2e-test";
45
+ const REMOVED_INLINE_TYPE = "stigmer/workflow/execute";
46
+
47
+ const SHELL_MODEL = `
48
+ document:
49
+ dsl: '1.0.0'
50
+ namespace: dispatch-surface
51
+ name: handed-model
52
+ version: '1.0.0'
53
+ do:
54
+ - runShell:
55
+ run:
56
+ shell:
57
+ command: echo
58
+ arguments:
59
+ msg: "this must never run"
60
+ `;
61
+
62
+ type TestWorkflowEnvironment =
63
+ import("@temporalio/testing").TestWorkflowEnvironment;
64
+ type Worker = import("@temporalio/worker").Worker;
65
+
66
+ let env: TestWorkflowEnvironment | null = null;
67
+ let worker: Worker | null = null;
68
+ let workerRunPromise: Promise<void> | null = null;
69
+ let envReady = false;
70
+
71
+ /** Every activity the worker ran, in order. */
72
+ const ran: string[] = [];
73
+
74
+ function recording<T extends (...args: never[]) => unknown>(
75
+ activity: string,
76
+ body: T,
77
+ ): T {
78
+ return ((...args: never[]) => {
79
+ ran.push(activity);
80
+ return body(...args);
81
+ }) as T;
82
+ }
83
+
84
+ function createRecordingActivities() {
85
+ return {
86
+ HydrateWorkflowExecution: recording(
87
+ "HydrateWorkflowExecution",
88
+ async (input: ExecuteFromExecutionInput) => ({
89
+ model: loadWorkflowFromYaml(GOLDEN_MODEL),
90
+ workflow_input: null,
91
+ env: {},
92
+ metadata: { execution_id: input.execution_id },
93
+ }),
94
+ ),
95
+ ResetEventSequence: recording("ResetEventSequence", async (): Promise<number> => 0),
96
+ LoadRecoveryContext: recording("LoadRecoveryContext", async (): Promise<unknown[]> => []),
97
+ EmitWorkflowEvents: recording("EmitWorkflowEvents", async (): Promise<void> => {}),
98
+ PromoteTaskOutput: recording("PromoteTaskOutput", async (): Promise<void> => {}),
99
+ EvaluateExpressions: recording(
100
+ "EvaluateExpressions",
101
+ async (
102
+ expressions: Record<string, string>,
103
+ input: unknown,
104
+ stateVars: Record<string, unknown>,
105
+ ) => evaluateExpressionBatch(expressions, input, stateVars),
106
+ ),
107
+ RunShell: recording("RunShell", async (): Promise<unknown> => ({ stdout: "" })),
108
+ RunScript: recording("RunScript", async (): Promise<unknown> => ({ stdout: "" })),
109
+ };
110
+ }
111
+
112
+ function uniqueId(prefix: string): string {
113
+ return `${prefix}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
114
+ }
115
+
116
+ describe("dispatch surface E2E — Temporal TestWorkflowEnvironment", () => {
117
+ beforeAll(async () => {
118
+ try {
119
+ const { TestWorkflowEnvironment: TWE } = await import("@temporalio/testing");
120
+ const { Worker: W } = await import("@temporalio/worker");
121
+
122
+ env = await TWE.createLocal();
123
+ worker = await W.create({
124
+ connection: env.nativeConnection,
125
+ taskQueue: TASK_QUEUE,
126
+ workflowsPath: WORKFLOWS_PATH,
127
+ activities: createRecordingActivities(),
128
+ interceptors: {
129
+ activity: [runCredentialActivityInterceptor],
130
+ workflowModules: [RUN_CREDENTIAL_WORKFLOW_INTERCEPTOR],
131
+ },
132
+ });
133
+ workerRunPromise = worker.run();
134
+ envReady = true;
135
+ } catch (err: unknown) {
136
+ const msg = err instanceof Error ? err.message : String(err);
137
+ console.warn(`Temporal E2E smoke test failed (tests will be skipped): ${msg}`);
138
+ envReady = false;
139
+ }
140
+ }, 90_000);
141
+
142
+ afterAll(async () => {
143
+ if (worker) {
144
+ worker.shutdown();
145
+ await workerRunPromise;
146
+ }
147
+ await env?.teardown();
148
+ });
149
+
150
+ it("never runs a complete model started on its queue as the removed inline type", async (testCtx) => {
151
+ if (!envReady || !env) return testCtx.skip();
152
+ ran.length = 0;
153
+
154
+ const input: ExecuteServerlessWorkflowInput = {
155
+ model: loadWorkflowFromYaml(SHELL_MODEL),
156
+ workflow_input: null,
157
+ env: {},
158
+ };
159
+ const handle = await env.client.workflow.start(REMOVED_INLINE_TYPE, {
160
+ taskQueue: TASK_QUEUE,
161
+ workflowId: uniqueId("dispatch-surface-inline"),
162
+ args: [input],
163
+ workflowExecutionTimeout: "60s",
164
+ });
165
+
166
+ // The worker answers the first workflow task with a failure and the
167
+ // workflow stays open. Poll the history until that failure appears, or
168
+ // until the workflow closes (which only a worker that ran it can cause).
169
+ const deadline = Date.now() + 30_000;
170
+ let taskFailure: string | undefined;
171
+ let scheduledActivities = 0;
172
+ let running = true;
173
+ while (Date.now() < deadline && taskFailure === undefined && running) {
174
+ const history = await handle.fetchHistory();
175
+ const events = history.events ?? [];
176
+ scheduledActivities = events.filter((e) => e.activityTaskScheduledEventAttributes).length;
177
+ const failed = events.find((e) => e.workflowTaskFailedEventAttributes);
178
+ taskFailure = failed?.workflowTaskFailedEventAttributes?.failure?.message ?? undefined;
179
+ running = (await handle.describe()).status.name === "RUNNING";
180
+ if (taskFailure === undefined && running) await new Promise((r) => setTimeout(r, 200));
181
+ }
182
+ if (running) {
183
+ await handle.terminate("dispatch-surface e2e: the removed type is never executed");
184
+ }
185
+
186
+ expect(ran, "no activity of the handed model may run").toEqual([]);
187
+ expect(scheduledActivities).toBe(0);
188
+ expect(running, "the workflow must stay open: nothing ran it").toBe(true);
189
+ expect(taskFailure, "the workflow task must fail for the unregistered type").toBeDefined();
190
+ expect(taskFailure).toContain(REMOVED_INLINE_TYPE);
191
+ }, 60_000);
192
+
193
+ it("still runs the type the server starts, on the same worker", async (testCtx) => {
194
+ if (!envReady || !env) return testCtx.skip();
195
+ ran.length = 0;
196
+
197
+ const input: ExecuteFromExecutionInput = {
198
+ execution_id: `wex_dispatch_${Math.random().toString(36).slice(2)}`,
199
+ workflow_instance_id: "wfi_1",
200
+ workflow_id: "wf_1",
201
+ org_id: "org_1",
202
+ };
203
+ await env.client.workflow.execute(EXECUTE_FROM_EXECUTION_WORKFLOW_TYPE, {
204
+ taskQueue: TASK_QUEUE,
205
+ workflowId: uniqueId("dispatch-surface-dispatched"),
206
+ args: [input],
207
+ workflowExecutionTimeout: "30s",
208
+ });
209
+
210
+ expect(ran).toContain("HydrateWorkflowExecution");
211
+ }, 60_000);
212
+ });
@@ -25,12 +25,13 @@ import { join, dirname } from "node:path";
25
25
  import { fileURLToPath } from "node:url";
26
26
  import { loadWorkflowFromYaml } from "../workflow-engine/loader.js";
27
27
  import { evaluateExpressionBatch } from "../workflow-engine/expression.js";
28
- import type { ExecuteServerlessWorkflowInput } from "../workflows/execute-serverless-workflow.js";
28
+ import type { ExecuteServerlessWorkflowInput } from "../workflows/engine-core.js";
29
29
  import type { WorkflowModel } from "../workflow-engine/types.js";
30
+ import { INLINE_MODEL_WORKFLOW_TYPE } from "../__test-utils__/workflows/inline-model.js";
30
31
 
31
32
  const __dirname = dirname(fileURLToPath(import.meta.url));
32
33
  const GOLDEN_DIR = join(__dirname, "../../test/golden");
33
- const WORKFLOWS_PATH = join(__dirname, "../workflows/index.ts");
34
+ const WORKFLOWS_PATH = join(__dirname, "../__test-utils__/workflows/index.ts");
34
35
  const TASK_QUEUE = "golden-e2e-test";
35
36
 
36
37
  function loadGolden(filename: string): string {
@@ -91,7 +92,7 @@ async function runGoldenWorkflow(model: WorkflowModel, workflowInput: unknown =
91
92
  env: {},
92
93
  metadata: { execution_id: "e2e-test" },
93
94
  };
94
- return env.client.workflow.execute("stigmer/workflow/execute", {
95
+ return env.client.workflow.execute(INLINE_MODEL_WORKFLOW_TYPE, {
95
96
  taskQueue: TASK_QUEUE,
96
97
  workflowId: `golden-e2e-${Date.now()}-${Math.random().toString(36).slice(2)}`,
97
98
  args: [input],