@decaf-ts/as-graph 0.2.1 → 0.4.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.
- package/README.md +158 -2
- package/dist/as-graph.cjs +1 -1
- package/dist/as-graph.cjs.map +1 -1
- package/dist/as-graph.js +1 -1
- package/dist/as-graph.js.map +1 -1
- package/lib/cjs/dagster/DagsterGraphEventBridge.cjs +344 -0
- package/lib/cjs/dagster/DagsterGraphEventBridge.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs +789 -0
- package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
- package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
- package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
- package/lib/cjs/dagster/capabilities.cjs +102 -0
- package/lib/cjs/dagster/capabilities.cjs.map +1 -0
- package/lib/cjs/dagster/constants.cjs +92 -0
- package/lib/cjs/dagster/constants.cjs.map +1 -0
- package/lib/cjs/dagster/index.cjs +32 -0
- package/lib/cjs/dagster/index.cjs.map +1 -0
- package/lib/cjs/engine/constants.cjs +6 -1
- package/lib/cjs/engine/constants.cjs.map +1 -1
- package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
- package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
- package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
- package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/engine/execution/index.cjs +4 -0
- package/lib/cjs/engine/execution/index.cjs.map +1 -1
- package/lib/cjs/engine/index.cjs +4 -0
- package/lib/cjs/engine/index.cjs.map +1 -1
- package/lib/cjs/engine/runs/GraphRunService.cjs +61 -0
- package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphWorkflowService.cjs +33 -14
- package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
- package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
- package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
- package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
- package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
- package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
- package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
- package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
- package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
- package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
- package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
- package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
- package/lib/cjs/mastra/index.cjs +35 -0
- package/lib/cjs/mastra/index.cjs.map +1 -0
- package/lib/cjs/mastra/types.cjs +34 -0
- package/lib/cjs/mastra/types.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
- package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs +30 -2
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
- package/lib/cjs/nest/graph/index.cjs +3 -0
- package/lib/cjs/nest/graph/index.cjs.map +1 -1
- package/lib/cjs/nest/graph/main.cjs +54 -0
- package/lib/cjs/nest/graph/main.cjs.map +1 -0
- package/lib/cjs/nest/graph/servingErrors.cjs +3 -0
- package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -1
- package/lib/cjs/node/utility/code/node.cjs +11 -3
- package/lib/cjs/node/utility/code/node.cjs.map +1 -1
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
- package/lib/cjs/shared/graph/constants.cjs +8 -0
- package/lib/cjs/shared/graph/constants.cjs.map +1 -1
- package/lib/cjs/shared/graph/index.cjs +2 -1
- package/lib/cjs/shared/graph/index.cjs.map +1 -1
- package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
- package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
- package/lib/cjs/shared/graph/layout/index.cjs +23 -0
- package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
- package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
- package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
- package/lib/cjs/shared/ui/index.cjs +8 -10
- package/lib/cjs/shared/ui/index.cjs.map +1 -1
- package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
- package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
- package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
- package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
- package/lib/esm/dagster/DagsterResultMapper.js +51 -0
- package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
- package/lib/esm/dagster/DagsterTypes.js +2 -0
- package/lib/esm/dagster/DagsterTypes.js.map +1 -0
- package/lib/esm/dagster/capabilities.js +97 -0
- package/lib/esm/dagster/capabilities.js.map +1 -0
- package/lib/esm/dagster/constants.js +88 -0
- package/lib/esm/dagster/constants.js.map +1 -0
- package/lib/esm/dagster/index.js +15 -0
- package/lib/esm/dagster/index.js.map +1 -0
- package/lib/esm/engine/constants.js +5 -0
- package/lib/esm/engine/constants.js.map +1 -1
- package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
- package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
- package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
- package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
- package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
- package/lib/esm/engine/execution/index.js +4 -0
- package/lib/esm/engine/execution/index.js.map +1 -1
- package/lib/esm/engine/index.js +4 -0
- package/lib/esm/engine/index.js.map +1 -1
- package/lib/esm/engine/runs/GraphRunService.js +62 -1
- package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
- package/lib/esm/engine/services/GraphWorkflowService.js +33 -14
- package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
- package/lib/esm/mastra/MastraCapabilities.js +164 -0
- package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
- package/lib/esm/mastra/MastraConditionBridge.js +34 -0
- package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
- package/lib/esm/mastra/MastraEventBridge.js +481 -0
- package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
- package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
- package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
- package/lib/esm/mastra/MastraResumeGuard.js +123 -0
- package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
- package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
- package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
- package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
- package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
- package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
- package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
- package/lib/esm/mastra/index.js +18 -0
- package/lib/esm/mastra/index.js.map +1 -0
- package/lib/esm/mastra/types.js +30 -0
- package/lib/esm/mastra/types.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineController.js +218 -0
- package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
- package/lib/esm/nest/graph/GraphExecutionModule.js +30 -2
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/index.js +3 -0
- package/lib/esm/nest/graph/index.js.map +1 -1
- package/lib/esm/nest/graph/main.js +51 -0
- package/lib/esm/nest/graph/main.js.map +1 -0
- package/lib/esm/nest/graph/servingErrors.js +3 -0
- package/lib/esm/nest/graph/servingErrors.js.map +1 -1
- package/lib/esm/node/utility/code/node.js +11 -3
- package/lib/esm/node/utility/code/node.js.map +1 -1
- package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
- package/lib/esm/shared/graph/constants.js +8 -0
- package/lib/esm/shared/graph/constants.js.map +1 -1
- package/lib/esm/shared/graph/index.js +2 -1
- package/lib/esm/shared/graph/index.js.map +1 -1
- package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
- package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
- package/lib/esm/shared/graph/layout/index.js +6 -0
- package/lib/esm/shared/graph/layout/index.js.map +1 -0
- package/lib/esm/shared/graph/layout/layout-options.js +96 -0
- package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
- package/lib/esm/shared/ui/index.js +8 -10
- package/lib/esm/shared/ui/index.js.map +1 -1
- package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
- package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
- package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
- package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
- package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
- package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
- package/lib/types/dagster/DagsterTypes.d.cts +355 -0
- package/lib/types/dagster/DagsterTypes.d.mts +355 -0
- package/lib/types/dagster/capabilities.d.cts +34 -0
- package/lib/types/dagster/capabilities.d.mts +34 -0
- package/lib/types/dagster/constants.d.cts +87 -0
- package/lib/types/dagster/constants.d.mts +87 -0
- package/lib/types/dagster/index.d.cts +14 -0
- package/lib/types/dagster/index.d.mts +14 -0
- package/lib/types/engine/constants.d.cts +5 -0
- package/lib/types/engine/constants.d.mts +5 -0
- package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
- package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
- package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
- package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
- package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
- package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
- package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
- package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
- package/lib/types/engine/execution/index.d.cts +4 -0
- package/lib/types/engine/execution/index.d.mts +4 -0
- package/lib/types/engine/index.d.cts +4 -0
- package/lib/types/engine/index.d.mts +4 -0
- package/lib/types/engine/runs/GraphRunService.d.cts +19 -0
- package/lib/types/engine/runs/GraphRunService.d.mts +19 -0
- package/lib/types/engine/services/GraphWorkflowService.d.cts +22 -0
- package/lib/types/engine/services/GraphWorkflowService.d.mts +22 -0
- package/lib/types/mastra/MastraCapabilities.d.cts +91 -0
- package/lib/types/mastra/MastraCapabilities.d.mts +91 -0
- package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
- package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
- package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
- package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
- package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
- package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
- package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
- package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
- package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
- package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
- package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
- package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
- package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
- package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
- package/lib/types/mastra/index.d.cts +17 -0
- package/lib/types/mastra/index.d.mts +17 -0
- package/lib/types/mastra/types.d.cts +222 -0
- package/lib/types/mastra/types.d.mts +222 -0
- package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
- package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
- package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
- package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
- package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
- package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +8 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +8 -0
- package/lib/types/nest/graph/index.d.cts +3 -0
- package/lib/types/nest/graph/index.d.mts +3 -0
- package/lib/types/nest/graph/main.d.cts +1 -0
- package/lib/types/nest/graph/main.d.mts +1 -0
- package/lib/types/nest/graph/servingErrors.d.cts +3 -1
- package/lib/types/nest/graph/servingErrors.d.mts +3 -1
- package/lib/types/node/utility/code/node.d.cts +1 -1
- package/lib/types/node/utility/code/node.d.mts +1 -1
- package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
- package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
- package/lib/types/shared/graph/constants.d.cts +8 -0
- package/lib/types/shared/graph/constants.d.mts +8 -0
- package/lib/types/shared/graph/index.d.cts +2 -1
- package/lib/types/shared/graph/index.d.mts +2 -1
- package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
- package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
- package/lib/types/shared/graph/layout/index.d.cts +5 -0
- package/lib/types/shared/graph/layout/index.d.mts +5 -0
- package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
- package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
- package/lib/types/shared/graph/types.d.cts +4 -3
- package/lib/types/shared/graph/types.d.mts +4 -3
- package/lib/types/shared/ui/index.d.cts +8 -10
- package/lib/types/shared/ui/index.d.mts +8 -10
- package/package.json +49 -6
- package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
- package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
- package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
- package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
- package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
- package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
- package/lib/cjs/shared/ui/types.cjs +0 -4
- package/lib/cjs/shared/ui/types.cjs.map +0 -1
- package/lib/esm/shared/ui/GraphNodeView.js +0 -107
- package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
- package/lib/esm/shared/ui/GraphRunView.js +0 -90
- package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
- package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
- package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
- package/lib/esm/shared/ui/types.js +0 -2
- package/lib/esm/shared/ui/types.js.map +0 -1
- package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
- package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
- package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
- package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
- package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
- package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
- package/lib/types/shared/ui/types.d.cts +0 -200
- package/lib/types/shared/ui/types.d.mts +0 -200
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterGraphEventBridge
|
|
3
|
+
* @summary Maps raw Dagster events onto the engine-agnostic event sink (SAA-195 §4.3).
|
|
4
|
+
* @description Subscribes to a Dagster run's raw event stream and translates every
|
|
5
|
+
* step/run event into the shared {@link GraphExecutionEventType} vocabulary before
|
|
6
|
+
* forwarding it through the facade-owned {@link GraphExecutionEventSink}. Only the
|
|
7
|
+
* documented mapping table is accepted: a step-level event type with no mapping
|
|
8
|
+
* fails loudly (`GRAPH_DAGSTER_EVENT_UNSUPPORTED`), while unknown run/engine-level
|
|
9
|
+
* events are ignored so Dagster's internal telemetry cannot break the run.
|
|
10
|
+
*/
|
|
11
|
+
import type { GraphExecutionEvent } from "../shared/graph/index.d.mts";
|
|
12
|
+
import type { GraphNodeExecutionResult } from "../engine/types.d.mts";
|
|
13
|
+
import type { GraphExecutionEventSink } from "../engine/execution/GraphExecutionBackend.d.mts";
|
|
14
|
+
import type { DagsterClient, DagsterRunRecord } from "./DagsterTypes.d.mts";
|
|
15
|
+
/** Options for constructing a {@link DagsterGraphEventBridge}. */
|
|
16
|
+
export interface DagsterGraphEventBridgeOptions {
|
|
17
|
+
/** The Dagster run id to subscribe to. */
|
|
18
|
+
dagsterRunId: string;
|
|
19
|
+
/** The canonical as-graph run id carried on emitted events. */
|
|
20
|
+
graphRunId: string;
|
|
21
|
+
/** Canonical workflow id. */
|
|
22
|
+
workflowId: string;
|
|
23
|
+
/**
|
|
24
|
+
* The inspected job's op-name → canonical node-id map. Built from the
|
|
25
|
+
* deployment structure the read-only driver looked up; the bridge never
|
|
26
|
+
* translates a document.
|
|
27
|
+
*/
|
|
28
|
+
nodeIdsByOpName: Record<string, string>;
|
|
29
|
+
/** The facade-owned event sink. */
|
|
30
|
+
sink: GraphExecutionEventSink;
|
|
31
|
+
/** The host-injected client port. */
|
|
32
|
+
client: DagsterClient;
|
|
33
|
+
/** Cancels the observation and any in-flight transport work. */
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
/** Hard cap on processed events; defaults to {@link DEFAULT_MAX_EVENTS}. */
|
|
36
|
+
maxEvents?: number;
|
|
37
|
+
/** Hard cap on transport pagination pages; defaults to {@link DEFAULT_MAX_PAGES}. */
|
|
38
|
+
maxPages?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum time to await the terminal record; defaults to
|
|
41
|
+
* {@link DEFAULT_TERMINAL_TIMEOUT_MS}.
|
|
42
|
+
*/
|
|
43
|
+
terminalTimeoutMs?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Bridges a Dagster run's raw event stream onto the engine-agnostic event sink.
|
|
47
|
+
*/
|
|
48
|
+
export declare class DagsterGraphEventBridge {
|
|
49
|
+
private readonly options;
|
|
50
|
+
private readonly nodeResults;
|
|
51
|
+
private readonly workflowOutputs;
|
|
52
|
+
private subscription?;
|
|
53
|
+
private terminal?;
|
|
54
|
+
private failure?;
|
|
55
|
+
private eventCount;
|
|
56
|
+
private resolveTerminal?;
|
|
57
|
+
private rejectTerminal?;
|
|
58
|
+
private readonly processing;
|
|
59
|
+
private readonly terminalPromise;
|
|
60
|
+
/**
|
|
61
|
+
* @param options - The run identity, op-name map, sink, client port, and bounds.
|
|
62
|
+
*/
|
|
63
|
+
constructor(options: DagsterGraphEventBridgeOptions);
|
|
64
|
+
/** Subscribes to the run's event stream. */
|
|
65
|
+
start(): Promise<void>;
|
|
66
|
+
/** Stops the subscription and waits for in-flight event processing. */
|
|
67
|
+
stop(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Waits for the run's terminal record, bounded by the observation's
|
|
70
|
+
* `terminalTimeoutMs` and `signal`. Exceeding the timeout, or an abort, fails
|
|
71
|
+
* the wait closed instead of hanging on a stalled or hostile gateway.
|
|
72
|
+
*
|
|
73
|
+
* @returns The terminal Dagster run record.
|
|
74
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_OBSERVE_TIMEOUT` when the run
|
|
75
|
+
* does not terminate in time, or `GRAPH_DAGSTER_OBSERVE_ABORTED` on abort.
|
|
76
|
+
*/
|
|
77
|
+
waitForTerminal(): Promise<DagsterRunRecord>;
|
|
78
|
+
/** The node results collected from step events. */
|
|
79
|
+
collectedNodeResults(): Record<string, GraphNodeExecutionResult>;
|
|
80
|
+
/** The workflow output values collected from the terminal record. */
|
|
81
|
+
collectedWorkflowOutputs(): Record<string, unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* Resolves a Dagster step key to a canonical node id through the inspected
|
|
84
|
+
* job's op-name map.
|
|
85
|
+
*
|
|
86
|
+
* @param stepKey - The Dagster step key.
|
|
87
|
+
* @returns The canonical node id, or `undefined` for non-graph steps.
|
|
88
|
+
*/
|
|
89
|
+
private resolveNodeId;
|
|
90
|
+
/**
|
|
91
|
+
* Handles a single raw Dagster event.
|
|
92
|
+
*
|
|
93
|
+
* @param event - The raw event.
|
|
94
|
+
*/
|
|
95
|
+
private handleEvent;
|
|
96
|
+
/**
|
|
97
|
+
* Maps a Dagster event type to an engine-agnostic execution status.
|
|
98
|
+
*
|
|
99
|
+
* @param eventType - The Dagster event type.
|
|
100
|
+
* @returns The engine-agnostic status.
|
|
101
|
+
*/
|
|
102
|
+
private nodeStatus;
|
|
103
|
+
/**
|
|
104
|
+
* Maps a terminal Dagster run record to an engine-agnostic status.
|
|
105
|
+
*
|
|
106
|
+
* @param record - The terminal run record.
|
|
107
|
+
* @returns The engine-agnostic status.
|
|
108
|
+
*/
|
|
109
|
+
private terminalStatus;
|
|
110
|
+
/**
|
|
111
|
+
* Extracts output values from a Dagster step event payload.
|
|
112
|
+
*
|
|
113
|
+
* @param event - The raw event.
|
|
114
|
+
* @returns The extracted outputs, or `undefined`.
|
|
115
|
+
*/
|
|
116
|
+
private extractOutputs;
|
|
117
|
+
/**
|
|
118
|
+
* Fails the observation closed exactly once: records the failure, rejects the
|
|
119
|
+
* terminal wait, and cancels the underlying subscription so a stalled transport
|
|
120
|
+
* stops working.
|
|
121
|
+
*
|
|
122
|
+
* @param error - The graph error the observation failed with.
|
|
123
|
+
* @returns The same error, for convenient `throw`/`return` use.
|
|
124
|
+
*/
|
|
125
|
+
private failClosed;
|
|
126
|
+
/** The error raised when the caller aborts the observation. */
|
|
127
|
+
private abortError;
|
|
128
|
+
/** The error raised when the run misses the terminal-wait timeout. */
|
|
129
|
+
private timeoutError;
|
|
130
|
+
/** The error raised when the run exceeds the event cap. */
|
|
131
|
+
private limitError;
|
|
132
|
+
/**
|
|
133
|
+
* Builds a frontend-safe error payload. Raw Dagster details are never
|
|
134
|
+
* forwarded to clients (standing hardening rule).
|
|
135
|
+
*
|
|
136
|
+
* @param error - The raw error.
|
|
137
|
+
* @returns The frontend-safe error payload.
|
|
138
|
+
*/
|
|
139
|
+
private toErrorPayload;
|
|
140
|
+
}
|
|
141
|
+
/** Re-exported for typing clarity. */
|
|
142
|
+
export type { GraphExecutionEvent };
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterGraphExecutionBackend
|
|
3
|
+
* @summary Dagster graph backend: read-only surface plus gated execute/replay of
|
|
4
|
+
* EXISTING workflows (DECAF-50 §4.9).
|
|
5
|
+
* @description A non-local {@link GraphExecutionBackend} that lists, looks up,
|
|
6
|
+
* and inspects ALREADY-EXISTING Dagster workflows through a host-injected
|
|
7
|
+
* {@link DagsterClient} port, and — only when the explicit
|
|
8
|
+
* {@link DagsterGraphExecutionBackendConfig.executionEnabled} gate is on — launches
|
|
9
|
+
* a run of an already-deployed job and re-executes an existing run. By owner
|
|
10
|
+
* mandate the driver never authors a workflow and never generates, embeds, or emits
|
|
11
|
+
* Python source:
|
|
12
|
+
*
|
|
13
|
+
* - `listWorkflows`/`getWorkflow` map the real deployment structure (job name,
|
|
14
|
+
* graph/op structure, asset keys, schedules/sensors) into the canonical summary
|
|
15
|
+
* and document shapes;
|
|
16
|
+
* - `observeRun` surfaces the events of an EXISTING run and maps its terminal
|
|
17
|
+
* record onto a canonical result;
|
|
18
|
+
* - `execute` fails closed with `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` when the gate
|
|
19
|
+
* is off (before any network call); when on, it launches a run of the job the
|
|
20
|
+
* supplied document describes through `client.launchRun` and observes it through
|
|
21
|
+
* the existing event bridge. It never translates a document into Python;
|
|
22
|
+
* - `replayRun` fails closed with `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` when the
|
|
23
|
+
* gate is off; when on, it delegates re-execution of an existing run to the
|
|
24
|
+
* host transport's `client.replayRun`;
|
|
25
|
+
* - it declares `local = false` and `codeMode = "unsupported"`, so the facade fails
|
|
26
|
+
* closed on any code-mode surface before delegating;
|
|
27
|
+
* - it never reads, sets, or reconfigures a code sandbox evaluator.
|
|
28
|
+
*/
|
|
29
|
+
import type { GraphWorkflowDocument } from "../shared/graph/index.d.cts";
|
|
30
|
+
import type { GraphBackendCapabilities, GraphBackendExecutionRequest, GraphBackendWorkflowSummary, GraphExecutionBackend } from "../engine/execution/GraphExecutionBackend.d.cts";
|
|
31
|
+
import type { GraphExecutionResult, GraphRunId } from "../engine/types.d.cts";
|
|
32
|
+
import type { DagsterGraphExecutionBackendConfig, DagsterJobRecord, DagsterObserveRunRequest, DagsterReplayExistingRunRequest, DagsterRunRecord } from "./DagsterTypes.d.cts";
|
|
33
|
+
/**
|
|
34
|
+
* Builds the inspected job's op-name → canonical node-id map. The event bridge
|
|
35
|
+
* uses it to resolve Dagster step keys onto canonical node ids for an existing run.
|
|
36
|
+
*
|
|
37
|
+
* @param job - The inspected Dagster job record.
|
|
38
|
+
* @returns The op-name → node-id map.
|
|
39
|
+
*/
|
|
40
|
+
export declare function dagsterNodeIdsByOpName(job: DagsterJobRecord): Record<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Builds the op-name → canonical node-id map from an already-mapped canonical
|
|
43
|
+
* document. The event bridge uses it to resolve Dagster step keys onto canonical
|
|
44
|
+
* node ids for a run the driver launched from that document, without re-reading
|
|
45
|
+
* the job.
|
|
46
|
+
*
|
|
47
|
+
* @param document - The canonical document of the launched job.
|
|
48
|
+
* @returns The op-name → node-id map.
|
|
49
|
+
*/
|
|
50
|
+
export declare function dagsterNodeIdsByOpNameFromDocument(document: {
|
|
51
|
+
nodes?: ReadonlyArray<{
|
|
52
|
+
id: string;
|
|
53
|
+
metadata?: Record<string, unknown>;
|
|
54
|
+
}>;
|
|
55
|
+
}): Record<string, string>;
|
|
56
|
+
/**
|
|
57
|
+
* Maps an inspected Dagster job record onto the canonical workflow document
|
|
58
|
+
* shape. The deployment structure (job name, ops, dependencies, asset keys,
|
|
59
|
+
* schedules/sensors) is carried as document metadata for read-only inspection;
|
|
60
|
+
* nothing is authored.
|
|
61
|
+
*
|
|
62
|
+
* @param job - The inspected Dagster job record.
|
|
63
|
+
* @returns The canonical workflow document.
|
|
64
|
+
*/
|
|
65
|
+
export declare function dagsterJobDocument(job: DagsterJobRecord): GraphWorkflowDocument;
|
|
66
|
+
/**
|
|
67
|
+
* Non-local Dagster backend. Read-only by default; launches/replays EXISTING
|
|
68
|
+
* workflows only behind the explicit `executionEnabled` gate. Registers itself
|
|
69
|
+
* under {@link DAGSTER_BACKEND_FLAVOUR} on construction.
|
|
70
|
+
*/
|
|
71
|
+
export declare class DagsterGraphExecutionBackend implements GraphExecutionBackend<DagsterGraphExecutionBackendConfig> {
|
|
72
|
+
/** This backend reads a remote Dagster deployment, not an in-process engine. */
|
|
73
|
+
readonly local = false;
|
|
74
|
+
/**
|
|
75
|
+
* Dagster never authors code-mode surfaces; the facade rejects them before
|
|
76
|
+
* delegating.
|
|
77
|
+
*/
|
|
78
|
+
readonly codeMode: "unsupported";
|
|
79
|
+
private client?;
|
|
80
|
+
private readonly mapper;
|
|
81
|
+
private readonly bridges;
|
|
82
|
+
private defaultTags;
|
|
83
|
+
private _config?;
|
|
84
|
+
private executionEnabled;
|
|
85
|
+
constructor();
|
|
86
|
+
/**
|
|
87
|
+
* Resolves the host-injected client port and the explicit execution gate. The
|
|
88
|
+
* backend never reads a code sandbox evaluator.
|
|
89
|
+
*
|
|
90
|
+
* @param config - The backend configuration.
|
|
91
|
+
*/
|
|
92
|
+
initialize(config: DagsterGraphExecutionBackendConfig): Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* The backend configuration most recently resolved by {@link initialize}. The
|
|
95
|
+
* facade reads this during `GraphExecutionEngine.initialize` and merges its own
|
|
96
|
+
* facade-owned keys over it, so a host that configured the backend directly
|
|
97
|
+
* (including `executionEnabled`) before booting the engine does not lose that
|
|
98
|
+
* wiring.
|
|
99
|
+
*/
|
|
100
|
+
get config(): DagsterGraphExecutionBackendConfig | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Effective capability metadata: code-mode is `unsupported`; workflow
|
|
103
|
+
* listing/lookup is supported exactly when the client port exposes it.
|
|
104
|
+
*/
|
|
105
|
+
get capabilities(): GraphBackendCapabilities;
|
|
106
|
+
/**
|
|
107
|
+
* Lists the deployment's Dagster jobs through the client port.
|
|
108
|
+
*
|
|
109
|
+
* @returns Real workflow summaries.
|
|
110
|
+
* @throws {GraphExecutionError} when the client port exposes no job listing.
|
|
111
|
+
*/
|
|
112
|
+
listWorkflows(): Promise<GraphBackendWorkflowSummary[]>;
|
|
113
|
+
/**
|
|
114
|
+
* Reads a single already-deployed Dagster job through the client port and maps
|
|
115
|
+
* its ACTUAL deployment structure (graph/op structure, asset keys,
|
|
116
|
+
* schedules/sensors) into the canonical document shape.
|
|
117
|
+
*
|
|
118
|
+
* @param workflowId - The canonical workflow id (the Dagster job name).
|
|
119
|
+
* @returns A canonical document describing the existing job.
|
|
120
|
+
* @throws {GraphExecutionError} when the client port exposes no job lookup.
|
|
121
|
+
*/
|
|
122
|
+
getWorkflow(workflowId: string): Promise<GraphWorkflowDocument>;
|
|
123
|
+
/**
|
|
124
|
+
* Reads an EXISTING Dagster run's terminal record through the client port.
|
|
125
|
+
*
|
|
126
|
+
* @param runId - The Dagster run id.
|
|
127
|
+
* @returns The terminal run record.
|
|
128
|
+
*/
|
|
129
|
+
getRun(runId: string): Promise<DagsterRunRecord>;
|
|
130
|
+
/**
|
|
131
|
+
* Observes an EXISTING Dagster run: subscribes to its event stream, maps every
|
|
132
|
+
* event onto the canonical sink, and returns the canonical result of the terminal
|
|
133
|
+
* record. The driver never launches the run; the caller supplies the id of a run
|
|
134
|
+
* that already exists in the deployment.
|
|
135
|
+
*
|
|
136
|
+
* The request's bounds (`signal`, `maxEvents`, `maxPages`, `terminalTimeoutMs`)
|
|
137
|
+
* are forwarded to the event bridge so the observation always terminates: the
|
|
138
|
+
* event cap fails closed with `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED`, the terminal
|
|
139
|
+
* wait with `GRAPH_DAGSTER_OBSERVE_TIMEOUT`, and an abort with
|
|
140
|
+
* `GRAPH_DAGSTER_OBSERVE_ABORTED`.
|
|
141
|
+
*
|
|
142
|
+
* @param request - The observe request (existing run id, workflow id, sink, and
|
|
143
|
+
* optional observation bounds).
|
|
144
|
+
* @returns The canonical execution result of the observed run.
|
|
145
|
+
* @throws {GraphExecutionError} when the run cannot be read or subscribed to,
|
|
146
|
+
* or when an observation bound is hit (see above).
|
|
147
|
+
*/
|
|
148
|
+
observeRun(request: DagsterObserveRunRequest): Promise<GraphExecutionResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Executes an ALREADY-DEPLOYED Dagster job: launches a run of the job the
|
|
151
|
+
* supplied document describes through the client port's `launchRun`, then
|
|
152
|
+
* observes it through the existing event bridge to a canonical result.
|
|
153
|
+
*
|
|
154
|
+
* The operation is gated: when `executionEnabled` is off it fails closed with
|
|
155
|
+
* `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` BEFORE any network call, and when the
|
|
156
|
+
* client port exposes no `launchRun` it fails closed with
|
|
157
|
+
* `GRAPH_DAGSTER_EXECUTION_NOT_SUPPORTED`. The driver never translates a
|
|
158
|
+
* document into Python; it launches a job the deployment already defines.
|
|
159
|
+
*
|
|
160
|
+
* The job is bound from the document's canonical workflow id and confirmed
|
|
161
|
+
* through the read-only `getJob` surface, never from the document's untrusted
|
|
162
|
+
* `metadata.dagsterJobName` (C2): a document whose metadata names a different
|
|
163
|
+
* job is rejected before any launch.
|
|
164
|
+
*
|
|
165
|
+
* @param request - The execution request (document, plan, inputs, options, sink).
|
|
166
|
+
* @returns The canonical execution result of the launched run.
|
|
167
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` when the
|
|
168
|
+
* gate is off, `GRAPH_DAGSTER_EXECUTION_NOT_SUPPORTED` when the port exposes no
|
|
169
|
+
* launch, `GRAPH_DAGSTER_RUN_WORKFLOW_MISMATCH` when the document metadata
|
|
170
|
+
* names a different job, or `GRAPH_DAGSTER_RUN_LAUNCH_FAILED` when the launch
|
|
171
|
+
* fails.
|
|
172
|
+
*/
|
|
173
|
+
execute(request: GraphBackendExecutionRequest): Promise<GraphExecutionResult>;
|
|
174
|
+
/**
|
|
175
|
+
* Replays (re-executes) an EXISTING Dagster run through the client port's
|
|
176
|
+
* `replayRun`, then observes the new run through the existing event bridge to a
|
|
177
|
+
* canonical result.
|
|
178
|
+
*
|
|
179
|
+
* The operation is gated: when `executionEnabled` is off it fails closed with
|
|
180
|
+
* `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` BEFORE any network call, and when the
|
|
181
|
+
* client port exposes no `replayRun` it fails closed with
|
|
182
|
+
* `GRAPH_DAGSTER_REPLAY_NOT_SUPPORTED`. The re-execution mechanism (GraphQL
|
|
183
|
+
* re-execution from the run id, or a re-launch of the run's job with its original
|
|
184
|
+
* configuration) is owned by the host transport; the driver only observes the
|
|
185
|
+
* resulting run.
|
|
186
|
+
*
|
|
187
|
+
* The caller-supplied run id is bound to the requested workflow before any
|
|
188
|
+
* re-execution (C1): the run's owning job is resolved through the read-only
|
|
189
|
+
* `getRun` surface and a cross-job replay, or a run whose owning job cannot be
|
|
190
|
+
* determined, is rejected before the re-execution is issued.
|
|
191
|
+
*
|
|
192
|
+
* @param request - The replay request (existing run id, workflow id, sink, bounds).
|
|
193
|
+
* @returns The canonical execution result of the re-executed run.
|
|
194
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` when the
|
|
195
|
+
* gate is off, `GRAPH_DAGSTER_REPLAY_NOT_SUPPORTED` when the port exposes no
|
|
196
|
+
* replay, `GRAPH_DAGSTER_RUN_WORKFLOW_MISMATCH` when the run does not belong
|
|
197
|
+
* to the requested workflow, or `GRAPH_DAGSTER_RUN_LAUNCH_FAILED` when the
|
|
198
|
+
* re-execution fails.
|
|
199
|
+
*/
|
|
200
|
+
replayRun(request: DagsterReplayExistingRunRequest): Promise<GraphExecutionResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Terminates an EXISTING run through the client port.
|
|
203
|
+
*
|
|
204
|
+
* @param runId - The Dagster run id.
|
|
205
|
+
* @param reason - Optional cancellation reason.
|
|
206
|
+
* @returns `true` when a run was terminated.
|
|
207
|
+
*/
|
|
208
|
+
cancel(runId: GraphRunId, reason?: string): Promise<boolean>;
|
|
209
|
+
/**
|
|
210
|
+
* Releases the bridge resources associated with a run.
|
|
211
|
+
*
|
|
212
|
+
* @param runId - The canonical run id.
|
|
213
|
+
*/
|
|
214
|
+
release(runId: GraphRunId): Promise<void>;
|
|
215
|
+
/** Disposes the backend and the host-injected client port. */
|
|
216
|
+
dispose(): Promise<void>;
|
|
217
|
+
/**
|
|
218
|
+
* Subscribes to an EXISTING (or just-launched) run's event stream, maps every
|
|
219
|
+
* event onto the canonical sink, and returns the canonical result of the
|
|
220
|
+
* terminal record. Shared by `observeRun`, `execute`, and `replayRun`.
|
|
221
|
+
*
|
|
222
|
+
* @param input - The run identity, document, op map, sink, and observation bounds.
|
|
223
|
+
* @returns The canonical execution result.
|
|
224
|
+
* @throws {GraphExecutionError} when the run cannot be read or subscribed to, or
|
|
225
|
+
* when an observation bound is hit.
|
|
226
|
+
*/
|
|
227
|
+
private observeRunEvents;
|
|
228
|
+
/**
|
|
229
|
+
* Launches a run through the port, mapping any transport failure onto the
|
|
230
|
+
* driver's machine-readable launch error.
|
|
231
|
+
*
|
|
232
|
+
* @param client - The wired client port.
|
|
233
|
+
* @param input - The job name, canonical run id, workflow id, and run config.
|
|
234
|
+
* @returns The launched run handle.
|
|
235
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_RUN_LAUNCH_FAILED`.
|
|
236
|
+
*/
|
|
237
|
+
private launchThroughPort;
|
|
238
|
+
/**
|
|
239
|
+
* Re-executes an existing run through the port, mapping any transport failure
|
|
240
|
+
* onto the driver's machine-readable launch error.
|
|
241
|
+
*
|
|
242
|
+
* @param client - The wired client port.
|
|
243
|
+
* @param input - The existing run id, job name, canonical run id, workflow id.
|
|
244
|
+
* @returns The re-executed run handle.
|
|
245
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_RUN_LAUNCH_FAILED`.
|
|
246
|
+
*/
|
|
247
|
+
private replayThroughPort;
|
|
248
|
+
/**
|
|
249
|
+
* Resolves the canonical deployed job a requested workflow binds to and rejects
|
|
250
|
+
* any document whose untrusted `metadata.dagsterJobName` claims a different job
|
|
251
|
+
* BEFORE any launch (C2). The canonical id comes from the document's own
|
|
252
|
+
* identity and is confirmed through the read-only `getJob` surface, mirroring
|
|
253
|
+
* `replayRun`; an unknown workflow fails closed as a launch failure.
|
|
254
|
+
*
|
|
255
|
+
* @param client - The wired client port.
|
|
256
|
+
* @param workflowId - The canonical workflow id (the document's own identity).
|
|
257
|
+
* @param document - The canonical document whose metadata must agree.
|
|
258
|
+
* @returns The canonical deployed job name to launch.
|
|
259
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_RUN_WORKFLOW_MISMATCH` when the
|
|
260
|
+
* metadata names a different job, or `GRAPH_DAGSTER_RUN_LAUNCH_FAILED` when the
|
|
261
|
+
* canonical job cannot be resolved.
|
|
262
|
+
*/
|
|
263
|
+
private resolveCanonicalJobName;
|
|
264
|
+
/**
|
|
265
|
+
* Asserts that a caller-supplied Dagster run id belongs to the requested
|
|
266
|
+
* workflow before it is re-executed (C1 BOLA guard). The run's owning job is
|
|
267
|
+
* resolved from the read-only `getRun` surface; a cross-job run, or a run whose
|
|
268
|
+
* owning job cannot be determined, is rejected before any re-execution.
|
|
269
|
+
*
|
|
270
|
+
* @param client - The wired client port.
|
|
271
|
+
* @param dagsterRunId - The caller-supplied run id to bind.
|
|
272
|
+
* @param workflowId - The workflow the run must belong to.
|
|
273
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_RUN_WORKFLOW_MISMATCH` when the
|
|
274
|
+
* run is foreign or its owning job cannot be determined.
|
|
275
|
+
*/
|
|
276
|
+
private assertRunOwnedByWorkflow;
|
|
277
|
+
/**
|
|
278
|
+
* Awaits a launched/re-executed run's terminal state through the read-only
|
|
279
|
+
* `getRun` surface, bounded by the signal and timeout. The run is then observed
|
|
280
|
+
* through the event bridge; this keeps the transport's replay-based subscription
|
|
281
|
+
* (which does not stream) sufficient without a live transport.
|
|
282
|
+
*
|
|
283
|
+
* @param client - The wired client port.
|
|
284
|
+
* @param runId - The launched/re-executed Dagster run id.
|
|
285
|
+
* @param options - Optional signal, timeout, and poll interval.
|
|
286
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_OBSERVE_ABORTED` on abort, or
|
|
287
|
+
* `GRAPH_DAGSTER_OBSERVE_TIMEOUT` when the run does not terminate in time.
|
|
288
|
+
*/
|
|
289
|
+
private awaitRunTerminal;
|
|
290
|
+
/**
|
|
291
|
+
* Fails closed when the explicit execution gate is off, BEFORE any client or
|
|
292
|
+
* network call.
|
|
293
|
+
*
|
|
294
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED`.
|
|
295
|
+
*/
|
|
296
|
+
private assertExecutionEnabled;
|
|
297
|
+
/**
|
|
298
|
+
* Builds the run tags the driver attaches to a launched/re-executed run: the
|
|
299
|
+
* host defaults plus the canonical run/workflow identity under the
|
|
300
|
+
* {@link DAGSTER_TAG_NAMESPACE} namespace. No document content or Python source
|
|
301
|
+
* is carried.
|
|
302
|
+
*
|
|
303
|
+
* @param graphRunId - The canonical run id.
|
|
304
|
+
* @param workflowId - The canonical workflow id.
|
|
305
|
+
* @returns The run tags.
|
|
306
|
+
*/
|
|
307
|
+
private executionTags;
|
|
308
|
+
/**
|
|
309
|
+
* Reads the optional raw Dagster run configuration from execution metadata. The
|
|
310
|
+
* driver forwards it verbatim; it never synthesizes run config.
|
|
311
|
+
*
|
|
312
|
+
* @param metadata - The execution options metadata.
|
|
313
|
+
* @returns The raw run config, when present.
|
|
314
|
+
*/
|
|
315
|
+
private dagsterRunConfigOf;
|
|
316
|
+
/**
|
|
317
|
+
* Returns the wired client port or fails loudly.
|
|
318
|
+
*
|
|
319
|
+
* @returns The client port.
|
|
320
|
+
* @throws {GraphExecutionError} when no client is configured.
|
|
321
|
+
*/
|
|
322
|
+
private requireClient;
|
|
323
|
+
}
|