deepline 0.2.9 → 0.2.10
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/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +22 -5
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +23 -20
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +470 -258
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/db-session.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +52 -22
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +38 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +19 -6
- package/dist/cli/index.js +12 -5
- package/dist/cli/index.mjs +12 -5
- package/dist/index.js +12 -5
- package/dist/index.mjs +12 -5
- package/package.json +1 -1
|
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
|
|
|
160
160
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
161
161
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
162
162
|
// release keeps lazy paging semantics independent of row residency.
|
|
163
|
-
version: '0.2.
|
|
163
|
+
version: '0.2.10',
|
|
164
164
|
contracts: {
|
|
165
165
|
api: {
|
|
166
166
|
name: 'sdk-http-api',
|
|
@@ -328,6 +328,7 @@ type ProjectionStep = {
|
|
|
328
328
|
nodeId: string;
|
|
329
329
|
status?: string;
|
|
330
330
|
label?: string;
|
|
331
|
+
artifactTableNamespace?: string | null;
|
|
331
332
|
updatedAt?: number | null;
|
|
332
333
|
progress?: PlayActivityProgress | null;
|
|
333
334
|
};
|
|
@@ -490,6 +491,19 @@ export function projectPlayRunActivity(input: {
|
|
|
490
491
|
)
|
|
491
492
|
.sort((left, right) => (right.updatedAt ?? 0) - (left.updatedAt ?? 0))[0];
|
|
492
493
|
if (pendingDataset) {
|
|
494
|
+
const activeDatasetStep = input.nodeStates?.find(
|
|
495
|
+
(candidate) =>
|
|
496
|
+
candidate.nodeId === input.activeNodeId &&
|
|
497
|
+
candidate.status === 'running' &&
|
|
498
|
+
candidate.artifactTableNamespace === pendingDataset.tableNamespace,
|
|
499
|
+
);
|
|
500
|
+
const datasetStep =
|
|
501
|
+
activeDatasetStep ??
|
|
502
|
+
input.nodeStates?.find(
|
|
503
|
+
(candidate) =>
|
|
504
|
+
candidate.artifactTableNamespace === pendingDataset.tableNamespace,
|
|
505
|
+
);
|
|
506
|
+
const datasetProgress = datasetStep?.progress ?? null;
|
|
493
507
|
return projection(
|
|
494
508
|
{
|
|
495
509
|
schemaVersion: 1,
|
|
@@ -502,17 +516,20 @@ export function projectPlayRunActivity(input: {
|
|
|
502
516
|
state: {
|
|
503
517
|
kind: 'active',
|
|
504
518
|
progress: {
|
|
505
|
-
completed:
|
|
519
|
+
completed:
|
|
520
|
+
datasetProgress?.completed ?? pendingDataset.persistedRows,
|
|
506
521
|
total:
|
|
507
|
-
|
|
522
|
+
datasetProgress?.total ??
|
|
523
|
+
(typeof pendingDataset.succeededRows === 'number' ||
|
|
508
524
|
typeof pendingDataset.failedRows === 'number'
|
|
509
525
|
? (pendingDataset.succeededRows ?? 0) +
|
|
510
526
|
(pendingDataset.failedRows ?? 0)
|
|
511
|
-
: undefined,
|
|
512
|
-
failed: pendingDataset.failedRows,
|
|
527
|
+
: undefined),
|
|
528
|
+
failed: datasetProgress?.failed ?? pendingDataset.failedRows,
|
|
513
529
|
},
|
|
514
530
|
},
|
|
515
|
-
observedAt:
|
|
531
|
+
observedAt:
|
|
532
|
+
datasetStep?.updatedAt ?? pendingDataset.updatedAt ?? observedAt,
|
|
516
533
|
},
|
|
517
534
|
now,
|
|
518
535
|
);
|
|
@@ -367,17 +367,8 @@ function isRetryableAppRuntimeResponse(input: {
|
|
|
367
367
|
// The app runtime may explicitly classify an otherwise-client-error status
|
|
368
368
|
// as transient. Keep the structured delivery contract authoritative rather
|
|
369
369
|
// than reducing every 4xx to permanent at the worker boundary.
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
parsed &&
|
|
374
|
-
typeof parsed === 'object' &&
|
|
375
|
-
!Array.isArray(parsed) &&
|
|
376
|
-
(parsed as { retryable?: unknown }).retryable === true
|
|
377
|
-
) {
|
|
378
|
-
return true;
|
|
379
|
-
}
|
|
380
|
-
} catch {}
|
|
370
|
+
const explicitRetryable = appRuntimeExplicitRetryable(input.body);
|
|
371
|
+
if (explicitRetryable !== null) return explicitRetryable;
|
|
381
372
|
if (
|
|
382
373
|
input.action === 'append_run_events' &&
|
|
383
374
|
input.status === 500 &&
|
|
@@ -391,6 +382,19 @@ function isRetryableAppRuntimeResponse(input: {
|
|
|
391
382
|
return isRetryableAppRuntimeResponseStatus(input.status);
|
|
392
383
|
}
|
|
393
384
|
|
|
385
|
+
function appRuntimeExplicitRetryable(body: string): boolean | null {
|
|
386
|
+
try {
|
|
387
|
+
const parsed = JSON.parse(body) as unknown;
|
|
388
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
const retryable = (parsed as { retryable?: unknown }).retryable;
|
|
392
|
+
return typeof retryable === 'boolean' ? retryable : null;
|
|
393
|
+
} catch {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
394
398
|
function isRetryableAppRuntimeResponseStatus(status: number): boolean {
|
|
395
399
|
return (
|
|
396
400
|
status === 429 ||
|
|
@@ -1158,15 +1162,14 @@ async function postAppRuntimeApi<TResponse>(
|
|
|
1158
1162
|
status: response.status,
|
|
1159
1163
|
code,
|
|
1160
1164
|
requestId,
|
|
1161
|
-
//
|
|
1162
|
-
//
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
}),
|
|
1165
|
+
// The structured response is authoritative even for a 5xx. Retrying an
|
|
1166
|
+
// explicitly deterministic database failure here turns one rejected SQL
|
|
1167
|
+
// statement into an unbounded outer-writer loop.
|
|
1168
|
+
retryable: isRetryableAppRuntimeResponse({
|
|
1169
|
+
action: body.action,
|
|
1170
|
+
status: response.status,
|
|
1171
|
+
body: responseText,
|
|
1172
|
+
}),
|
|
1170
1173
|
detail: summarizeAppRuntimeErrorBody(responseText),
|
|
1171
1174
|
boundaryLabel,
|
|
1172
1175
|
});
|