deepline 0.1.227 → 0.1.229
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/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +76 -1842
- package/dist/bundling-sources/apps/play-runner-workers/src/dedup-do.ts +0 -113
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +144 -1000
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/ledger-event-batches.ts +81 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/workflow-retry-state.ts +1 -50
- package/dist/bundling-sources/sdk/src/client.ts +24 -2
- package/dist/bundling-sources/sdk/src/play.ts +2 -2
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +382 -31
- package/dist/bundling-sources/shared_libs/play-runtime/child-execution-strategy.ts +84 -79
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +201 -705
- package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +3 -10
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-contract.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +12 -47
- package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +0 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +12 -200
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +2 -17
- package/dist/bundling-sources/shared_libs/play-runtime/live-state-contract.ts +3 -9
- package/dist/bundling-sources/shared_libs/play-runtime/play-call-execution.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-latency-trace.ts +28 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-execution-scope.ts +16 -64
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +26 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-lifecycle-policy.ts +5 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +0 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +81 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +0 -36
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +3 -21
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/transport-error-diagnostics.ts +63 -0
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +2 -0
- package/dist/cli/index.js +78 -11
- package/dist/cli/index.mjs +78 -11
- package/dist/{compiler-manifest-BhgZ23A4.d.ts → compiler-manifest-CYcwzSOJ.d.mts} +2 -0
- package/dist/{compiler-manifest-BhgZ23A4.d.mts → compiler-manifest-CYcwzSOJ.d.ts} +2 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +14 -5
- package/dist/index.mjs +14 -5
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/package.json +1 -1
- package/dist/bundling-sources/apps/play-runner-workers/src/child-manifest-resolver.ts +0 -108
- package/dist/bundling-sources/apps/play-runner-workers/src/child-play-await.ts +0 -374
- package/dist/bundling-sources/apps/play-runner-workers/src/child-play-submit.ts +0 -203
- package/dist/bundling-sources/shared_libs/play-runtime/child-execution-placement.ts +0 -14
- package/dist/bundling-sources/shared_libs/play-runtime/child-run-id.ts +0 -121
|
@@ -3,101 +3,106 @@ import {
|
|
|
3
3
|
type PlayStaticPipeline,
|
|
4
4
|
} from '../plays/static-pipeline';
|
|
5
5
|
import type { PlayCallExecution } from './play-call-execution';
|
|
6
|
-
import { resolveChildExecutionPlacement } from './child-execution-placement';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* `ctx.runPlay` is function composition. It has exactly one execution
|
|
9
|
+
* placement: inline in the caller's run. Do not add a scheduler fallback
|
|
10
|
+
* here: children that need their own run lifecycle must be top-level plays.
|
|
11
|
+
*/
|
|
12
|
+
export type ChildExecutionStrategy = 'inline';
|
|
9
13
|
|
|
10
14
|
export type ChildExecutionDecision = {
|
|
11
15
|
strategy: ChildExecutionStrategy;
|
|
12
|
-
reason:
|
|
13
|
-
| 'scalar_child'
|
|
14
|
-
| 'missing_static_contract'
|
|
15
|
-
| 'dataset_child'
|
|
16
|
-
| 'event_wait_child'
|
|
17
|
-
| 'explicit_timeout'
|
|
18
|
-
| 'explicit_inline'
|
|
19
|
-
| 'explicit_child_workflow';
|
|
16
|
+
reason: 'scalar_child' | 'explicit_inline';
|
|
20
17
|
};
|
|
21
18
|
|
|
19
|
+
export type CtxRunPlayInlineOnlyReason =
|
|
20
|
+
| 'missing_static_contract'
|
|
21
|
+
| 'dataset_child'
|
|
22
|
+
| 'event_wait_child'
|
|
23
|
+
| 'suspending_child'
|
|
24
|
+
| 'explicit_timeout'
|
|
25
|
+
| 'explicit_child_workflow';
|
|
26
|
+
|
|
27
|
+
/** Stable machine-readable prefix for every rejected ctx.runPlay shape. */
|
|
28
|
+
export const CTX_RUN_PLAY_INLINE_ONLY = 'CTX_RUN_PLAY_INLINE_ONLY';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* One public error for every unsupported child contract. The checker and
|
|
32
|
+
* runtime deliberately call this same helper so a dynamic child fails with
|
|
33
|
+
* the same actionable error as a statically known child.
|
|
34
|
+
*/
|
|
35
|
+
export function ctxRunPlayInlineOnlyMessage(
|
|
36
|
+
childPlayName: string,
|
|
37
|
+
reason: CtxRunPlayInlineOnlyReason,
|
|
38
|
+
): string {
|
|
39
|
+
const detail: Record<CtxRunPlayInlineOnlyReason, string> = {
|
|
40
|
+
missing_static_contract: 'its static contract could not be resolved',
|
|
41
|
+
dataset_child: 'it uses ctx.dataset(), ctx.csv(), or a Runtime Sheet',
|
|
42
|
+
event_wait_child: 'it waits for an event',
|
|
43
|
+
suspending_child: 'it attempted to suspend the parent execution',
|
|
44
|
+
explicit_timeout: 'it sets an explicit timeout',
|
|
45
|
+
explicit_child_workflow: 'it requests execution: "child-workflow"',
|
|
46
|
+
};
|
|
47
|
+
return (
|
|
48
|
+
`${CTX_RUN_PLAY_INLINE_ONLY}: ctx.runPlay("${childPlayName}") only composes a resolved scalar child; ` +
|
|
49
|
+
`${detail[reason]}. Move that work to a top-level play and compose only the scalar result.`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
22
53
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* independent durable state, so they remain scheduler jobs.
|
|
54
|
+
* Resolve an authored child contract. Any shape that would need a second run,
|
|
55
|
+
* durable scheduler state, or a suspension is rejected before invocation.
|
|
26
56
|
*/
|
|
27
57
|
export function resolveChildExecutionStrategy(input: {
|
|
28
58
|
pipeline: PlayStaticPipeline | null | undefined;
|
|
29
59
|
timeoutMs?: number | null;
|
|
30
|
-
|
|
60
|
+
hasExplicitTimeout?: boolean;
|
|
61
|
+
/** `child-workflow` remains accepted as parsed legacy source solely to emit
|
|
62
|
+
* the canonical migration error rather than silently scheduling it. */
|
|
63
|
+
execution?: PlayCallExecution | 'child-workflow' | null;
|
|
31
64
|
childPlayName?: string | null;
|
|
32
65
|
}): ChildExecutionDecision {
|
|
66
|
+
const childPlayName = input.childPlayName?.trim() || 'child';
|
|
33
67
|
if (input.execution === 'child-workflow') {
|
|
34
|
-
|
|
68
|
+
throw new Error(
|
|
69
|
+
ctxRunPlayInlineOnlyMessage(childPlayName, 'explicit_child_workflow'),
|
|
70
|
+
);
|
|
35
71
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
: !input.pipeline
|
|
41
|
-
? { strategy: 'scheduled', reason: 'missing_static_contract' }
|
|
42
|
-
: input.pipeline.tableNamespace ||
|
|
43
|
-
input.pipeline.sheetContract ||
|
|
44
|
-
steps.some((step) => step.type === 'dataset' || step.type === 'csv')
|
|
45
|
-
? { strategy: 'scheduled', reason: 'dataset_child' }
|
|
46
|
-
: steps.some(
|
|
47
|
-
(step) =>
|
|
48
|
-
step.type === 'tool' &&
|
|
49
|
-
(step.isEventWait || step.toolId === 'test_wait_for_event'),
|
|
50
|
-
)
|
|
51
|
-
? { strategy: 'scheduled', reason: 'event_wait_child' }
|
|
52
|
-
: { strategy: 'inline', reason: 'scalar_child' };
|
|
53
|
-
if (input.execution === 'inline') {
|
|
54
|
-
if (
|
|
55
|
-
authoredDecision.strategy === 'scheduled' &&
|
|
56
|
-
authoredDecision.reason !== 'missing_static_contract'
|
|
57
|
-
) {
|
|
58
|
-
throw new Error(
|
|
59
|
-
inlineExecutionRequiresScalarChildMessage(
|
|
60
|
-
input.childPlayName?.trim() || 'child',
|
|
61
|
-
authoredDecision.reason,
|
|
62
|
-
),
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
return { strategy: 'inline', reason: 'explicit_inline' };
|
|
72
|
+
if (!input.pipeline) {
|
|
73
|
+
throw new Error(
|
|
74
|
+
ctxRunPlayInlineOnlyMessage(childPlayName, 'missing_static_contract'),
|
|
75
|
+
);
|
|
66
76
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (placement.strategy === 'inline') {
|
|
72
|
-
return { strategy: 'inline', reason: 'scalar_child' };
|
|
77
|
+
if (input.hasExplicitTimeout === true || input.timeoutMs != null) {
|
|
78
|
+
throw new Error(
|
|
79
|
+
ctxRunPlayInlineOnlyMessage(childPlayName, 'explicit_timeout'),
|
|
80
|
+
);
|
|
73
81
|
}
|
|
74
|
-
return authoredDecision;
|
|
75
|
-
}
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
);
|
|
83
|
+
const steps = flattenStaticPipeline(input.pipeline);
|
|
84
|
+
if (
|
|
85
|
+
input.pipeline.tableNamespace ||
|
|
86
|
+
input.pipeline.sheetContract ||
|
|
87
|
+
steps.some((step) => step.type === 'dataset' || step.type === 'csv')
|
|
88
|
+
) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
ctxRunPlayInlineOnlyMessage(childPlayName, 'dataset_child'),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
if (
|
|
94
|
+
steps.some(
|
|
95
|
+
(step) =>
|
|
96
|
+
step.type === 'tool' &&
|
|
97
|
+
(step.isEventWait || step.toolId === 'test_wait_for_event'),
|
|
98
|
+
)
|
|
99
|
+
) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
ctxRunPlayInlineOnlyMessage(childPlayName, 'event_wait_child'),
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
strategy: 'inline',
|
|
106
|
+
reason: input.execution === 'inline' ? 'explicit_inline' : 'scalar_child',
|
|
107
|
+
};
|
|
103
108
|
}
|