deepline 0.3.516 → 0.3.518
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/observability/scheduled-jobs.json +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/bounded-batch-function.ts +21 -3
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +163 -63
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/vercel-production-gate.ts +32 -5
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-policy.ts +8 -13
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +119 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +8 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +12 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/detached-runner-readiness-pacing.ts +44 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +16 -6
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +42 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-completion-coalescer.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts +22 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -7
- package/dist/cli/{artifacts-KMWS32R5.js → artifacts-EAOGAB5K.js} +21 -19
- package/dist/cli/{artifacts-G56FISIE.mjs → artifacts-LGFPVJSE.mjs} +9 -7
- package/dist/cli/auth-CLNPH65D.js +43 -0
- package/dist/cli/{auth-RSS7MOBV.mjs → auth-FXXZIWLI.mjs} +5 -5
- package/dist/cli/{billing-2ALO3XEG.mjs → billing-4Q5WAB5D.mjs} +7 -7
- package/dist/cli/{billing-RCC6WBIZ.js → billing-ESZXVREA.js} +82 -82
- package/dist/cli/{chunk-ZFRN3B2R.mjs → chunk-2DRW5ALK.mjs} +1 -1
- package/dist/cli/{chunk-YS7AI7R6.js → chunk-2G6MARKU.js} +7 -7
- package/dist/cli/{chunk-LWUFEX26.mjs → chunk-2LBKIVIW.mjs} +2 -2
- package/dist/cli/{chunk-UW5QWTUG.js → chunk-3NMQ5EIV.js} +14 -14
- package/dist/cli/{chunk-Q47MAAHI.mjs → chunk-4YR3W2YB.mjs} +1 -1
- package/dist/cli/{chunk-4IIK6GIY.js → chunk-5X4P3MNG.js} +9 -9
- package/dist/cli/{chunk-LZROM6VQ.js → chunk-6IPKRQMH.js} +2 -2
- package/dist/cli/{chunk-W5I53WQ4.js → chunk-7X32UR2E.js} +96 -96
- package/dist/cli/{chunk-6ZLL5GDN.js → chunk-B26LSUCI.js} +2 -2
- package/dist/cli/{chunk-LCKAG5RL.mjs → chunk-B2MSOFEI.mjs} +2 -2
- package/dist/cli/{chunk-RB3OR32I.js → chunk-BVQDUYXJ.js} +16 -16
- package/dist/cli/{chunk-WCQ7JGDV.mjs → chunk-DYWQ72ZQ.mjs} +1 -1
- package/dist/cli/{chunk-N6Q5SDGA.js → chunk-ENVSFG5E.js} +44 -44
- package/dist/cli/{chunk-HY6KAW5H.mjs → chunk-G6BD4K3K.mjs} +5 -5
- package/dist/cli/{chunk-7R2V5Z6O.js → chunk-GDMO6MMY.js} +41 -41
- package/dist/cli/{chunk-PPYJXP4Z.js → chunk-HIJM54NU.js} +22 -22
- package/dist/cli/{chunk-D4OZSC3C.js → chunk-HYR34KFA.js} +5 -4
- package/dist/cli/{chunk-JB6FEEDQ.js → chunk-ICHUGGZ3.js} +2 -2
- package/dist/cli/{chunk-FIIBDWAO.js → chunk-J2UOHFDH.js} +53 -53
- package/dist/cli/{chunk-72L5HQ3J.js → chunk-JKSLK5PS.js} +5 -5
- package/dist/cli/{chunk-PKKSXXZ5.js → chunk-K5GUMXRT.js} +26 -26
- package/dist/cli/{chunk-V46UBZBJ.mjs → chunk-KIYDPAGX.mjs} +2 -2
- package/dist/cli/{chunk-X2YP36YP.mjs → chunk-KP5AAMJ3.mjs} +1 -1
- package/dist/cli/{chunk-ZMCQP4EU.mjs → chunk-KQV75ZUA.mjs} +10 -10
- package/dist/cli/{chunk-QG4LIOGI.mjs → chunk-L256EFFV.mjs} +2 -2
- package/dist/cli/{chunk-E7ZM2ZRD.mjs → chunk-L4RQDVCN.mjs} +5 -5
- package/dist/cli/{chunk-CKEZXNMV.js → chunk-LLO5UYI5.js} +6 -6
- package/dist/cli/{chunk-6ADGVZRX.mjs → chunk-LTCNF6KG.mjs} +5 -5
- package/dist/cli/{chunk-WE223LFR.js → chunk-M4DA3HTT.js} +16 -16
- package/dist/cli/{chunk-RB5EMAWD.mjs → chunk-MNWLM3FA.mjs} +1 -1
- package/dist/cli/{chunk-TZNQRKDF.js → chunk-NQFVQCCV.js} +1 -1
- package/dist/cli/{chunk-72MFP7V4.mjs → chunk-QX4QFGU7.mjs} +1 -1
- package/dist/cli/{chunk-QG3MRMU5.js → chunk-R4ZEJD5F.js} +4 -4
- package/dist/cli/{chunk-JPLEDOEW.mjs → chunk-RASCFMYI.mjs} +2 -2
- package/dist/cli/{chunk-VIZJIBI4.js → chunk-REEWKGQZ.js} +10 -10
- package/dist/cli/{chunk-J4VMWSQK.mjs → chunk-RFUJBBJE.mjs} +6 -6
- package/dist/cli/{chunk-C2SR3X7Y.mjs → chunk-RYHNKT4P.mjs} +2 -2
- package/dist/cli/{chunk-QUSYG3VP.js → chunk-SNFRDG7G.js} +3 -3
- package/dist/cli/{chunk-PMS3LQ6B.js → chunk-ST7WCRVQ.js} +5 -5
- package/dist/cli/{chunk-2YEFJHAF.mjs → chunk-TH2AQ4VG.mjs} +3 -3
- package/dist/cli/{chunk-CA24C3XL.mjs → chunk-TU5RR775.mjs} +3 -3
- package/dist/cli/{chunk-QX7WDG4V.js → chunk-UY5JSZDA.js} +11 -11
- package/dist/cli/{chunk-C72J6JE3.mjs → chunk-V6DIYGTK.mjs} +1 -1
- package/dist/cli/{chunk-YXGTO5XA.mjs → chunk-VE6FHVXZ.mjs} +5 -4
- package/dist/cli/{chunk-RLI6FDQM.js → chunk-VHFICSS7.js} +6 -6
- package/dist/cli/{chunk-PVVWKOEB.mjs → chunk-W3UFYU63.mjs} +1 -1
- package/dist/cli/{chunk-EYWP5JPU.mjs → chunk-WTQF2Z6X.mjs} +4 -4
- package/dist/cli/{chunk-5NU37KME.mjs → chunk-X6H3JGOP.mjs} +2 -2
- package/dist/cli/{chunk-H6BSB2YJ.mjs → chunk-XA7OTIYW.mjs} +1 -1
- package/dist/cli/{chunk-P6AADORO.js → chunk-XJ5NVLIP.js} +3 -3
- package/dist/cli/{chunk-Z3KLCDCB.mjs → chunk-YNIH4YTR.mjs} +5 -5
- package/dist/cli/{chunk-XEQBYK4B.js → chunk-ZJ3HEEGF.js} +7 -7
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-YXK5TB47.mjs → csv-KRGEVVN7.mjs} +4 -4
- package/dist/cli/{csv-RPR64UBS.js → csv-RLFOF4P4.js} +13 -13
- package/dist/cli/{db-UQYILAMF.mjs → db-2B6G4YO3.mjs} +6 -6
- package/dist/cli/{db-KO3JCGRG.js → db-NJC3NPOL.js} +27 -27
- package/dist/cli/{describe-P2OK5X2S.mjs → describe-BLJFAM4U.mjs} +18 -18
- package/dist/cli/describe-DRMUODJN.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/{executions-IQCRQXVA.mjs → executions-25XYBGJ5.mjs} +6 -6
- package/dist/cli/{executions-5Z7H7HV3.js → executions-ENELLT7A.js} +8 -8
- package/dist/cli/{feedback-ZO6A4HTV.mjs → feedback-5OAKHVQE.mjs} +5 -5
- package/dist/cli/{feedback-EDZJDARP.js → feedback-UPI2JQPL.js} +10 -10
- package/dist/cli/{git-OBXSILWM.mjs → git-MRYSIZV4.mjs} +5 -5
- package/dist/cli/git-P4OPT6Q7.js +25 -0
- package/dist/cli/index.js +145 -145
- package/dist/cli/index.mjs +44 -44
- package/dist/cli/{legacy-noops-HKXU2EU6.js → legacy-noops-DHEWQKER.js} +9 -9
- package/dist/cli/{legacy-noops-4UJM3FMN.mjs → legacy-noops-OJD5KYUO.mjs} +6 -6
- package/dist/cli/{monitors-7EP3Q2DX.js → monitors-22AFKUQN.js} +100 -100
- package/dist/cli/{monitors-ZXF2KCW7.mjs → monitors-24JM24NV.mjs} +7 -7
- package/dist/cli/{org-GFGOTUWP.js → org-HNYKUDJB.js} +72 -72
- package/dist/cli/{org-EDHCUR6V.mjs → org-I2X7ZZGQ.mjs} +6 -6
- package/dist/cli/{pages-EGEWMPJN.mjs → pages-4LSYUDES.mjs} +6 -6
- package/dist/cli/{pages-TLFQQL5S.js → pages-OUSF2RNH.js} +18 -18
- package/dist/cli/{play-NBO3MPDL.mjs → play-64XKQRA4.mjs} +18 -18
- package/dist/cli/{play-XDHJY5R4.js → play-ESY43EFW.js} +317 -317
- package/dist/cli/{providers-RU6BGEDM.js → providers-ENWSSRYR.js} +9 -9
- package/dist/cli/{providers-NXJ7WPNH.mjs → providers-VHK26CSP.mjs} +6 -6
- package/dist/cli/{quickstart-YBNDPNAR.mjs → quickstart-4NNLQMD7.mjs} +4 -4
- package/dist/cli/{quickstart-4ZZBMZPF.js → quickstart-TZ6IAUMS.js} +6 -6
- package/dist/cli/{run-LX52KVZM.mjs → run-DOH3AMYU.mjs} +23 -23
- package/dist/cli/{run-374CTJBV.js → run-RR7KPWP7.js} +41 -41
- package/dist/cli/search-SE6PM33H.js +33 -0
- package/dist/cli/{search-EH6JPV62.mjs → search-YFOCGXWL.mjs} +8 -8
- package/dist/cli/{search-output-NATLJOWW.js → search-output-AOTV6C36.js} +6 -6
- package/dist/cli/{search-output-XIQERUHF.mjs → search-output-IV2HSRLQ.mjs} +4 -4
- package/dist/cli/{secrets-A3UXDE5V.js → secrets-ATPM2AXV.js} +15 -15
- package/dist/cli/{secrets-VRJQFUKF.mjs → secrets-GMFCHPTV.mjs} +6 -6
- package/dist/cli/sessions-NN3H2KSE.js +18 -0
- package/dist/cli/{sessions-5TTH5FGZ.mjs → sessions-X3M4H2WY.mjs} +6 -6
- package/dist/cli/{settings-LX5EGLVT.js → settings-4V52LMWP.js} +86 -86
- package/dist/cli/{settings-VRGFTOTJ.mjs → settings-GRXFOR5V.mjs} +13 -13
- package/dist/cli/{setup-FXP5Y3Y6.mjs → setup-63WAXGPH.mjs} +10 -10
- package/dist/cli/{setup-QL4YWKOR.js → setup-OCCXAVQL.js} +50 -50
- package/dist/cli/skills-6XXVKQP4.js +37 -0
- package/dist/cli/{skills-ET4PMBJE.mjs → skills-IVGTO4NE.mjs} +8 -8
- package/dist/cli/tools-5COWG5TH.js +57 -0
- package/dist/cli/{tools-WPL3NZAA.mjs → tools-KGHX6MLB.mjs} +17 -17
- package/dist/cli/{update-OCAHAKL2.mjs → update-2OBZ4IUJ.mjs} +10 -10
- package/dist/cli/update-SQD25OCL.js +35 -0
- package/dist/cli/{workflow-CWO3XL4O.js → workflow-HGLO4V7R.js} +17 -17
- package/dist/cli/{workflow-NPZ2RLQG.mjs → workflow-ZZOATQYV.mjs} +7 -7
- package/dist/{client-K1g4ab5Y.d.mts → client-CpSiHSti.d.mts} +1 -1
- package/dist/{client-CQSPuqxh.d.ts → client-CswZYCGj.d.ts} +1 -1
- package/dist/{client-core-BksGf5Gd.d.mts → client-core-C1xVOg8Y.d.mts} +1 -1
- package/dist/{client-core-BlaqOlQ7.d.ts → client-core-D2pLt36Q.d.ts} +1 -1
- package/dist/{compiler-manifest-BliMS7ax.d.mts → compiler-manifest-B4mIIbw7.d.mts} +3 -3
- package/dist/{compiler-manifest-BliMS7ax.d.ts → compiler-manifest-B4mIIbw7.d.ts} +3 -3
- package/dist/{errors-BZ6Zq1cz.d.mts → errors-C2F4qzAq.d.mts} +1 -1
- package/dist/{errors-xfNscfS1.d.ts → errors-Gj9i5Rkd.d.ts} +1 -1
- package/dist/{index-DbvCg4zg.d.mts → index-5JZBufdF.d.mts} +1 -1
- package/dist/{index-FGdQv8J8.d.ts → index-BXtSj8bv.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +9 -9
- package/dist/index.mjs +6 -6
- package/dist/install-integrity.json +117 -116
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +3 -4
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +5 -5
- package/dist/server.mjs +3 -3
- package/package.json +1 -1
- package/dist/cli/auth-6EIEZ3UE.js +0 -43
- package/dist/cli/describe-BPX3U2BF.js +0 -50
- package/dist/cli/git-Y34J73QC.js +0 -25
- package/dist/cli/search-YS4DHSQC.js +0 -33
- package/dist/cli/sessions-EXII5VOV.js +0 -18
- package/dist/cli/skills-5L4CYX3V.js +0 -37
- package/dist/cli/tools-5V77VIUA.js +0 -57
- package/dist/cli/update-G5RSSWM5.js +0 -35
|
@@ -27,12 +27,31 @@ export type CompletedCall = {
|
|
|
27
27
|
undefinedValue?: true;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* An immutable completed-cache receipt a call hands to the freshness layer
|
|
32
|
+
* instead of writing it, so the call's finishing writes share one request.
|
|
33
|
+
*/
|
|
34
|
+
export type DeferredReceiptWrite = {
|
|
35
|
+
key: string;
|
|
36
|
+
output: unknown;
|
|
37
|
+
/** A pointer whose failure never fails the call (source-run replay pointer). */
|
|
38
|
+
bestEffort?: true;
|
|
39
|
+
sourceRunManifest?: true;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type DeferredReceiptPublication = {
|
|
43
|
+
defer(write: DeferredReceiptWrite): void;
|
|
44
|
+
};
|
|
45
|
+
|
|
30
46
|
type FreshnessStore = Pick<
|
|
31
47
|
DurableReceiptExecutionStore,
|
|
32
48
|
'enabled' | 'get' | 'complete'
|
|
33
49
|
> &
|
|
34
50
|
Partial<
|
|
35
|
-
Pick<
|
|
51
|
+
Pick<
|
|
52
|
+
DurableReceiptExecutionStore,
|
|
53
|
+
'getMany' | 'publishLatestCacheResult' | 'completeMany'
|
|
54
|
+
>
|
|
36
55
|
>;
|
|
37
56
|
|
|
38
57
|
/** Shape tag of a newest shared result entry (`ctx:{org}:cache:v1:*`). */
|
|
@@ -226,7 +245,12 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
226
245
|
requestedStaleAfterSeconds: number | null;
|
|
227
246
|
effectiveStaleAfterSeconds: number | null;
|
|
228
247
|
store: FreshnessStore;
|
|
229
|
-
|
|
248
|
+
/**
|
|
249
|
+
* `publication` collects receipts the call would otherwise write one by one.
|
|
250
|
+
* They are published together with this call's operation receipt, before the
|
|
251
|
+
* call returns, so customer code never observes a result that is not durable.
|
|
252
|
+
*/
|
|
253
|
+
execute: (publication: DeferredReceiptPublication) => Promise<T>;
|
|
230
254
|
completedAt?: (value: T) => number | undefined;
|
|
231
255
|
/**
|
|
232
256
|
* False keeps an empty or unsuccessful result out of the shared latest
|
|
@@ -469,6 +493,53 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
469
493
|
return stored;
|
|
470
494
|
};
|
|
471
495
|
|
|
496
|
+
/**
|
|
497
|
+
* Publish immutable completed-cache receipts. Every one is durable, or the
|
|
498
|
+
* call fails, before this returns; only a best-effort pointer may be lost.
|
|
499
|
+
*/
|
|
500
|
+
const publishFinishingWrites = async (
|
|
501
|
+
writes: readonly DeferredReceiptWrite[],
|
|
502
|
+
): Promise<void> => {
|
|
503
|
+
if (writes.length === 0) return;
|
|
504
|
+
const verify = async (key: string, answer: RuntimeStepReceipt | null) => {
|
|
505
|
+
if (answer?.status === 'completed' || answer?.status === 'skipped') {
|
|
506
|
+
return;
|
|
507
|
+
}
|
|
508
|
+
const stored = await input.store.get(key);
|
|
509
|
+
if (stored?.status !== 'completed' && stored?.status !== 'skipped') {
|
|
510
|
+
throw new Error(
|
|
511
|
+
key === operationKey || key.startsWith(`${cachePrefix}:reusable:`)
|
|
512
|
+
? 'Completed freshness receipt publication failed.'
|
|
513
|
+
: `Tool Result Receipt ${key} could not publish a completed result.`,
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
const { completeMany } = input.store;
|
|
518
|
+
if (!completeMany) {
|
|
519
|
+
for (const write of writes) {
|
|
520
|
+
try {
|
|
521
|
+
await verify(
|
|
522
|
+
write.key,
|
|
523
|
+
await input.store.complete(
|
|
524
|
+
write.key,
|
|
525
|
+
input.runId,
|
|
526
|
+
write.output,
|
|
527
|
+
COMPLETED_RECEIPT_CACHE_INSERT_LEASE_ID,
|
|
528
|
+
),
|
|
529
|
+
);
|
|
530
|
+
} catch (error) {
|
|
531
|
+
if (!write.bestEffort || isCancellationError(error)) throw error;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const required = writes.filter((write) => !write.bestEffort);
|
|
537
|
+
const answers = await completeMany.call(input.store, writes);
|
|
538
|
+
for (const write of required) {
|
|
539
|
+
await verify(write.key, answers.get(write.key) ?? null);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
|
|
472
543
|
const ttl = input.effectiveStaleAfterSeconds;
|
|
473
544
|
const admissionTime = now();
|
|
474
545
|
const currentPartition =
|
|
@@ -536,7 +607,29 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
536
607
|
}
|
|
537
608
|
}
|
|
538
609
|
|
|
539
|
-
const
|
|
610
|
+
const deferred: DeferredReceiptWrite[] = [];
|
|
611
|
+
let value: T;
|
|
612
|
+
try {
|
|
613
|
+
value = await input.execute({
|
|
614
|
+
defer: (write) => {
|
|
615
|
+
deferred.push(write);
|
|
616
|
+
},
|
|
617
|
+
});
|
|
618
|
+
} catch (error) {
|
|
619
|
+
// A deferred write is a result the call already received (the provider
|
|
620
|
+
// answered and was paid) before a later step threw, for example a durable
|
|
621
|
+
// suspension or a cancelled signal. Before deferral that result receipt
|
|
622
|
+
// was written at once, so a resumed call reused it instead of paying the
|
|
623
|
+
// provider again. Keep that: publish what was deferred, then rethrow the
|
|
624
|
+
// original error unchanged, because it may be suspension control flow.
|
|
625
|
+
// The operation and reusable pointers are not published, exactly as
|
|
626
|
+
// before. If this publication itself fails, the call keeps the documented
|
|
627
|
+
// at-least-once behavior and re-executes on resume.
|
|
628
|
+
if (deferred.length > 0) {
|
|
629
|
+
await publishFinishingWrites(deferred).catch(() => undefined);
|
|
630
|
+
}
|
|
631
|
+
throw error;
|
|
632
|
+
}
|
|
540
633
|
assertNoSecretTaint(value, 'Freshness call result');
|
|
541
634
|
const completedAt = input.completedAt?.(value) ?? now();
|
|
542
635
|
if (!Number.isSafeInteger(completedAt) || completedAt < 0) {
|
|
@@ -545,7 +638,9 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
545
638
|
const completed = completedCallForResult(value, completedAt);
|
|
546
639
|
|
|
547
640
|
// Recover this exact operation even if reusable publication fails afterwards.
|
|
548
|
-
|
|
641
|
+
const pointers: DeferredReceiptWrite[] = [
|
|
642
|
+
{ key: operationKey, output: completed },
|
|
643
|
+
];
|
|
549
644
|
// The same eligibility gates the policy bucket and the newest shared
|
|
550
645
|
// result: a failed, empty or non-final answer recovers within this run but
|
|
551
646
|
// is never handed to another call.
|
|
@@ -557,12 +652,27 @@ export async function executeWithFreshnessReceipt<T>(input: {
|
|
|
557
652
|
ttl === null
|
|
558
653
|
? 'indefinite'
|
|
559
654
|
: Math.floor(completed.completedAt / (ttl * 1000));
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
655
|
+
pointers.push({
|
|
656
|
+
key:
|
|
657
|
+
ttl === null
|
|
658
|
+
? `${cachePrefix}:reusable:indefinite`
|
|
659
|
+
: `${cachePrefix}:reusable:${ttl}:${completionPartition}`,
|
|
660
|
+
output: completed,
|
|
661
|
+
});
|
|
565
662
|
}
|
|
663
|
+
// One request carries the call's result receipt, its replay pointer and its
|
|
664
|
+
// operation and reusable receipts. The operation and reusable receipts name
|
|
665
|
+
// the result receipt only when the result is stored by reference; a pointer
|
|
666
|
+
// must never be visible before its referent, so that one case publishes the
|
|
667
|
+
// referent first. An inline operation receipt holds its own value.
|
|
668
|
+
const referent = completed.valueReceiptKey;
|
|
669
|
+
const pointersNeedReferent =
|
|
670
|
+
referent !== undefined &&
|
|
671
|
+
deferred.some((write) => write.key === referent && !write.bestEffort);
|
|
672
|
+
await publishFinishingWrites(
|
|
673
|
+
pointersNeedReferent ? deferred : [...deferred, ...pointers],
|
|
674
|
+
);
|
|
675
|
+
if (pointersNeedReferent) await publishFinishingWrites(pointers);
|
|
566
676
|
// A refresh publishes only the newest shared result, not a policy bucket.
|
|
567
677
|
if (
|
|
568
678
|
(ttl !== 0 || input.publishLatestOnRefresh === true) &&
|
|
@@ -721,7 +721,9 @@ export async function stageRunnerPayload(input: {
|
|
|
721
721
|
);
|
|
722
722
|
}
|
|
723
723
|
|
|
724
|
-
|
|
724
|
+
// The remote paths are fixed above, so the file uploads and the envelope
|
|
725
|
+
// upload run concurrently; both are awaited before the command is built.
|
|
726
|
+
const filesUpload = Promise.all(
|
|
725
727
|
[...uniqueLocalPaths.entries()].map(async ([localPath, remotePath]) => {
|
|
726
728
|
await timedRunnerPayloadUpload({
|
|
727
729
|
sandbox: input.sandbox,
|
|
@@ -736,6 +738,10 @@ export async function stageRunnerPayload(input: {
|
|
|
736
738
|
}),
|
|
737
739
|
);
|
|
738
740
|
|
|
741
|
+
// Awaited below; this only keeps a synchronous config failure from
|
|
742
|
+
// orphaning an in-flight upload rejection.
|
|
743
|
+
filesUpload.catch(() => undefined);
|
|
744
|
+
|
|
739
745
|
for (const [logicalPath, localPath] of Object.entries(
|
|
740
746
|
input.config.materializedFiles,
|
|
741
747
|
)) {
|
|
@@ -792,7 +798,7 @@ export async function stageRunnerPayload(input: {
|
|
|
792
798
|
}),
|
|
793
799
|
}),
|
|
794
800
|
);
|
|
795
|
-
await envelopeUpload;
|
|
801
|
+
await Promise.all([filesUpload, envelopeUpload]);
|
|
796
802
|
input.emitStage('upload:done', {
|
|
797
803
|
sandboxId: input.sandbox.id,
|
|
798
804
|
uploadedFileCount: uniqueLocalPaths.size + 1,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import type { DaytonaSandbox } from './daytona-lifecycle';
|
|
2
|
+
import {
|
|
3
|
+
createDetachedRunnerReadinessPacer,
|
|
4
|
+
DETACHED_RUNNER_READINESS_POLL_MS,
|
|
5
|
+
} from './detached-runner-readiness-pacing';
|
|
2
6
|
import { RUNTIME_RELIABILITY_POLICY } from '../../runtime-reliability-policy';
|
|
3
7
|
|
|
4
8
|
export type DetachedDaytonaStartupDiagnostic = {
|
|
@@ -380,8 +384,7 @@ export type DetachedDaytonaRunnerSupervisor = {
|
|
|
380
384
|
// Keep the handoff bounded while allowing a cold gateway to recover.
|
|
381
385
|
export const DAYTONA_RUNNER_READY_TIMEOUT_MS =
|
|
382
386
|
RUNTIME_RELIABILITY_POLICY.sandbox.runnerReadyTimeoutMs;
|
|
383
|
-
const DAYTONA_RUNNER_READY_POLL_MS =
|
|
384
|
-
const DAYTONA_RUNNER_READY_FAST_WINDOW_MS = 250;
|
|
387
|
+
const DAYTONA_RUNNER_READY_POLL_MS = DETACHED_RUNNER_READINESS_POLL_MS;
|
|
385
388
|
|
|
386
389
|
export type DetachedRunnerReadinessPort = (
|
|
387
390
|
baselineHeartbeatAt?: string | null,
|
|
@@ -631,10 +634,12 @@ export async function confirmDetachedDaytonaRunnerReady(input: {
|
|
|
631
634
|
);
|
|
632
635
|
const pollMs = Math.max(1, input.pollMs ?? DAYTONA_RUNNER_READY_POLL_MS);
|
|
633
636
|
const deadline = now() + timeoutMs;
|
|
634
|
-
const fastStartupDeadline = now() + DAYTONA_RUNNER_READY_FAST_WINDOW_MS;
|
|
635
637
|
let schedulerDiagnosis = 'no_readiness_response';
|
|
636
638
|
let schedulerReadinessResponses = 0;
|
|
637
|
-
|
|
639
|
+
const nextReadinessDelayMs = createDetachedRunnerReadinessPacer({
|
|
640
|
+
now,
|
|
641
|
+
pollMs,
|
|
642
|
+
});
|
|
638
643
|
|
|
639
644
|
while (now() < deadline) {
|
|
640
645
|
const read = await requestRunnerReadiness({
|
|
@@ -650,14 +655,10 @@ export async function confirmDetachedDaytonaRunnerReady(input: {
|
|
|
650
655
|
}
|
|
651
656
|
if (read.timedOut) break;
|
|
652
657
|
// A healthy store is waiting for a fresh heartbeat, not recovering from
|
|
653
|
-
// an outage
|
|
654
|
-
//
|
|
655
|
-
|
|
656
|
-
const fastStartupRead =
|
|
657
|
-
read.response !== null && now() < fastStartupDeadline;
|
|
658
|
-
const delayMs = fastStartupRead ? pollMs : retryDelayMs;
|
|
658
|
+
// an outage: poll it on the short healthy cadence. Unavailable reads keep
|
|
659
|
+
// exponential backoff.
|
|
660
|
+
const delayMs = nextReadinessDelayMs(read.response !== null);
|
|
659
661
|
await sleep(Math.min(delayMs, Math.max(1, deadline - now())));
|
|
660
|
-
retryDelayMs = fastStartupRead ? pollMs : Math.min(1_000, retryDelayMs * 2);
|
|
661
662
|
}
|
|
662
663
|
|
|
663
664
|
const inspect = (sandbox: DaytonaSandbox) =>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Poll pacing for the worker's detached-runner readiness fence, shared by the
|
|
3
|
+
* Daytona and Modal launchers.
|
|
4
|
+
*
|
|
5
|
+
* The fence itself is unchanged: the worker parks the attempt only after the
|
|
6
|
+
* scheduler store shows a heartbeat newer than the pre-exec baseline. This
|
|
7
|
+
* module only decides how long to wait between reads. A read that answered
|
|
8
|
+
* (`healthy`) is waiting for the runner's first heartbeat, not recovering from
|
|
9
|
+
* a store outage, so it polls on a short fixed cadence for the window in which
|
|
10
|
+
* a booting runner normally reports (Node start, bundle parse, gateway round
|
|
11
|
+
* trip). Unavailable reads, and healthy reads past that window, keep the
|
|
12
|
+
* exponential backoff that protects a degraded store.
|
|
13
|
+
*/
|
|
14
|
+
export const DETACHED_RUNNER_READINESS_POLL_MS = 50;
|
|
15
|
+
export const DETACHED_RUNNER_READINESS_FAST_WINDOW_MS = 250;
|
|
16
|
+
export const DETACHED_RUNNER_READINESS_HEALTHY_POLL_MS = 100;
|
|
17
|
+
export const DETACHED_RUNNER_READINESS_HEALTHY_WINDOW_MS = 4_000;
|
|
18
|
+
export const DETACHED_RUNNER_READINESS_MAX_BACKOFF_MS = 1_000;
|
|
19
|
+
|
|
20
|
+
export function createDetachedRunnerReadinessPacer(input: {
|
|
21
|
+
now: () => number;
|
|
22
|
+
pollMs?: number;
|
|
23
|
+
}): (healthy: boolean) => number {
|
|
24
|
+
const pollMs = Math.max(1, input.pollMs ?? DETACHED_RUNNER_READINESS_POLL_MS);
|
|
25
|
+
const startedAt = input.now();
|
|
26
|
+
let retryDelayMs = pollMs;
|
|
27
|
+
return (healthy) => {
|
|
28
|
+
const elapsedMs = input.now() - startedAt;
|
|
29
|
+
if (healthy && elapsedMs < DETACHED_RUNNER_READINESS_FAST_WINDOW_MS) {
|
|
30
|
+
retryDelayMs = pollMs;
|
|
31
|
+
return pollMs;
|
|
32
|
+
}
|
|
33
|
+
if (healthy && elapsedMs < DETACHED_RUNNER_READINESS_HEALTHY_WINDOW_MS) {
|
|
34
|
+
retryDelayMs = DETACHED_RUNNER_READINESS_HEALTHY_POLL_MS;
|
|
35
|
+
return DETACHED_RUNNER_READINESS_HEALTHY_POLL_MS;
|
|
36
|
+
}
|
|
37
|
+
const delayMs = retryDelayMs;
|
|
38
|
+
retryDelayMs = Math.min(
|
|
39
|
+
DETACHED_RUNNER_READINESS_MAX_BACKOFF_MS,
|
|
40
|
+
retryDelayMs * 2,
|
|
41
|
+
);
|
|
42
|
+
return delayMs;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
withRunnerSandboxProvider,
|
|
34
34
|
} from './daytona-payload-transport';
|
|
35
35
|
import { captureDetachedDaytonaRunnerReadinessBaseline } from './daytona-session-execution';
|
|
36
|
+
import { createDetachedRunnerReadinessPacer } from './detached-runner-readiness-pacing';
|
|
36
37
|
import {
|
|
37
38
|
isPlayRunRecoveryError,
|
|
38
39
|
recoveryForOpenModalCircuit,
|
|
@@ -242,7 +243,7 @@ export async function confirmDetachedModalRunnerReady(input: {
|
|
|
242
243
|
const cancellation = input.cancellation ?? new Promise<never>(() => {});
|
|
243
244
|
const timeoutMs = input.timeoutMs ?? MODAL_RUNNER_READY_TIMEOUT_MS;
|
|
244
245
|
const deadline = Date.now() + timeoutMs;
|
|
245
|
-
|
|
246
|
+
const nextDelayMs = createDetachedRunnerReadinessPacer({ now: Date.now });
|
|
246
247
|
while (Date.now() < deadline) {
|
|
247
248
|
const response = await Promise.race([
|
|
248
249
|
input.readiness(input.baselineHeartbeatAt).catch(() => null),
|
|
@@ -250,10 +251,11 @@ export async function confirmDetachedModalRunnerReady(input: {
|
|
|
250
251
|
]);
|
|
251
252
|
if (response?.ready) return;
|
|
252
253
|
await Promise.race([
|
|
253
|
-
new Promise<void>((resolve) =>
|
|
254
|
+
new Promise<void>((resolve) =>
|
|
255
|
+
setTimeout(resolve, nextDelayMs(response !== null)),
|
|
256
|
+
),
|
|
254
257
|
cancellation,
|
|
255
258
|
]);
|
|
256
|
-
delayMs = Math.min(1_000, delayMs * 2);
|
|
257
259
|
}
|
|
258
260
|
throw recoveryForRunnerStartupNotLive(
|
|
259
261
|
new Error(
|
|
@@ -703,6 +705,16 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
703
705
|
throw error;
|
|
704
706
|
}
|
|
705
707
|
|
|
708
|
+
// The baseline only has to predate this runner's first heartbeat, which
|
|
709
|
+
// cannot exist before exec. Read it while the payload uploads instead
|
|
710
|
+
// of serially after, as the Daytona launcher already does.
|
|
711
|
+
const baselineHeartbeatRead =
|
|
712
|
+
captureDetachedDaytonaRunnerReadinessBaseline({
|
|
713
|
+
readiness: readRunnerReadiness,
|
|
714
|
+
});
|
|
715
|
+
// Awaited (and its failure surfaced) below; this only keeps an upload
|
|
716
|
+
// failure from orphaning the read.
|
|
717
|
+
baselineHeartbeatRead.catch(() => undefined);
|
|
706
718
|
const uploadStartedAt = Date.now();
|
|
707
719
|
const payload = await Promise.race([
|
|
708
720
|
stageRunnerPayload({
|
|
@@ -740,9 +752,7 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
740
752
|
});
|
|
741
753
|
runtimeTiming.modalUploadMs = Date.now() - uploadStartedAt;
|
|
742
754
|
const baselineHeartbeatAt = await Promise.race([
|
|
743
|
-
|
|
744
|
-
readiness: readRunnerReadiness,
|
|
745
|
-
}),
|
|
755
|
+
baselineHeartbeatRead,
|
|
746
756
|
cancellationPromise,
|
|
747
757
|
]);
|
|
748
758
|
|
|
@@ -440,7 +440,11 @@ const POSTGRES_SCHEDULER_SCHEMA_INIT_STATEMENT_TIMEOUT_MS = 60_000;
|
|
|
440
440
|
// evidence, written where a stopped run's staged input is kept for `runs
|
|
441
441
|
// resume`. Absent on older runs, whose input an older build may have deleted.
|
|
442
442
|
// This marker records deployment work, never a runtime schema floor.
|
|
443
|
-
|
|
443
|
+
// v67 adds the deploy-owned partial index serving the staged-input expiry sweep
|
|
444
|
+
// (`runtime_scheduler_runs_staged_input_expiry_idx`). It is an optional
|
|
445
|
+
// optimization built concurrently, absent from the readiness shape, and this
|
|
446
|
+
// marker records deployment work, never a runtime schema floor.
|
|
447
|
+
export const POSTGRES_SCHEDULER_SCHEMA_VERSION = 67;
|
|
444
448
|
const POSTGRES_SCHEDULER_SCHEMA_MIGRATIONS_TABLE =
|
|
445
449
|
'scheduler_schema_migrations';
|
|
446
450
|
export const POSTGRES_SCHEDULER_OPEN_RECOVERY_INDEX =
|
|
@@ -2591,6 +2595,17 @@ export async function listPostgresSchedulerExpiredStagedInputRuns(
|
|
|
2591
2595
|
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
2592
2596
|
): Promise<Array<{ runId: string; orgId: string; playName: string }>> {
|
|
2593
2597
|
if (!(await runsArrayInputRetiredColumnPresent(client, options))) return [];
|
|
2598
|
+
const kept = await client.query<{ present: boolean }>(
|
|
2599
|
+
`SELECT EXISTS (
|
|
2600
|
+
SELECT 1 FROM pg_attribute
|
|
2601
|
+
WHERE attrelid = to_regclass($1)
|
|
2602
|
+
AND attname = 'array_input_kept_for_resume_at'
|
|
2603
|
+
AND NOT attisdropped
|
|
2604
|
+
) AS present`,
|
|
2605
|
+
[tableName('runs', options)],
|
|
2606
|
+
);
|
|
2607
|
+
// A scheduler schema older than v66 has no keep evidence to select on.
|
|
2608
|
+
if (kept.rows[0]?.present !== true) return [];
|
|
2594
2609
|
const result = await client.query<{
|
|
2595
2610
|
run_id: string;
|
|
2596
2611
|
org_id: string;
|
|
@@ -2601,6 +2616,11 @@ export async function listPostgresSchedulerExpiredStagedInputRuns(
|
|
|
2601
2616
|
WHERE status IN ('failed', 'cancelled')
|
|
2602
2617
|
AND array_input_started
|
|
2603
2618
|
AND array_input_retired_at IS NULL
|
|
2619
|
+
-- Only a run whose input was deliberately kept for resume. A run that
|
|
2620
|
+
-- ended before the keep decision had its input deleted at terminal and
|
|
2621
|
+
-- never gets this marker; selecting it would open a tenant connection
|
|
2622
|
+
-- per historical run to retire nothing.
|
|
2623
|
+
AND array_input_kept_for_resume_at IS NOT NULL
|
|
2604
2624
|
AND finished_at < now() - ($1::bigint * interval '1 millisecond')
|
|
2605
2625
|
ORDER BY coalesce(array_input_retire_attempted_at, finished_at) ASC
|
|
2606
2626
|
LIMIT $2`,
|
|
@@ -4540,6 +4560,14 @@ export async function ensurePostgresSchedulerSchema(
|
|
|
4540
4560
|
ON ${tableName('runs', options)} ((launch_json ->> 'absurdReleaseId'), run_id)
|
|
4541
4561
|
WHERE status IN ('queued', 'running', 'waiting')
|
|
4542
4562
|
`);
|
|
4563
|
+
await client.query(`
|
|
4564
|
+
CREATE INDEX IF NOT EXISTS runtime_scheduler_runs_staged_input_expiry_idx
|
|
4565
|
+
ON ${tableName('runs', options)} (coalesce(array_input_retire_attempted_at, finished_at))
|
|
4566
|
+
WHERE status IN ('failed', 'cancelled')
|
|
4567
|
+
AND array_input_started
|
|
4568
|
+
AND array_input_retired_at IS NULL
|
|
4569
|
+
AND array_input_kept_for_resume_at IS NOT NULL
|
|
4570
|
+
`);
|
|
4543
4571
|
}
|
|
4544
4572
|
await client.query(`
|
|
4545
4573
|
CREATE INDEX IF NOT EXISTS runtime_scheduler_receipts_run_idx
|
|
@@ -4761,6 +4789,19 @@ const POSTGRES_SCHEDULER_RUNTIME_ADMIN_INDEXES = [
|
|
|
4761
4789
|
definition: `((launch_json ->> 'absurdReleaseId'), run_id)
|
|
4762
4790
|
WHERE status IN ('queued', 'running', 'waiting')`,
|
|
4763
4791
|
},
|
|
4792
|
+
// Serves `listPostgresSchedulerExpiredStagedInputRuns` (the hourly
|
|
4793
|
+
// staged-input expiry sweep): the sweep's predicate and ORDER BY, so a pass
|
|
4794
|
+
// reads only the oldest unretired stopped runs. Deploy-owned and optional:
|
|
4795
|
+
// the sweep is correct without it and nothing gates on it.
|
|
4796
|
+
{
|
|
4797
|
+
name: 'runtime_scheduler_runs_staged_input_expiry_idx',
|
|
4798
|
+
table: 'runs',
|
|
4799
|
+
definition: `(coalesce(array_input_retire_attempted_at, finished_at))
|
|
4800
|
+
WHERE status IN ('failed', 'cancelled')
|
|
4801
|
+
AND array_input_started
|
|
4802
|
+
AND array_input_retired_at IS NULL
|
|
4803
|
+
AND array_input_kept_for_resume_at IS NOT NULL`,
|
|
4804
|
+
},
|
|
4764
4805
|
{
|
|
4765
4806
|
name: 'runtime_scheduler_rate_reservation_bucket_expiry_idx',
|
|
4766
4807
|
table: 'rate_reservations',
|
|
@@ -222,6 +222,13 @@ export class ReceiptCompletionCoalescer<TReceipt, TResult> {
|
|
|
222
222
|
*/
|
|
223
223
|
lightMaxBytes: number;
|
|
224
224
|
windowMs?: number;
|
|
225
|
+
/**
|
|
226
|
+
* Commit a request that finds the coalescer completely idle on the next
|
|
227
|
+
* timer turn instead of after `windowMs`. Same-turn peers still merge;
|
|
228
|
+
* requests arriving while a statement is open or in flight keep the full
|
|
229
|
+
* window. Statement contents, order, and admission are unchanged.
|
|
230
|
+
*/
|
|
231
|
+
flushImmediatelyWhenIdle?: boolean;
|
|
225
232
|
onStatement?: (record: ReceiptCompletionStatementRecord) => void;
|
|
226
233
|
/**
|
|
227
234
|
* Run identity of one request's receipts (every request carries receipts
|
|
@@ -281,6 +288,7 @@ export class ReceiptCompletionCoalescer<TReceipt, TResult> {
|
|
|
281
288
|
maxOpenGroups: Math.min(maxRetainedRequests, 128),
|
|
282
289
|
maxInFlightBatches: maxInFlightStatements,
|
|
283
290
|
flushMs: input.windowMs ?? RUNTIME_RECEIPT_GATEWAY_COMPLETION_COALESCE_MS,
|
|
291
|
+
flushImmediatelyWhenIdle: input.flushImmediatelyWhenIdle === true,
|
|
284
292
|
now: this.#now,
|
|
285
293
|
execute: async ({ key, values }) =>
|
|
286
294
|
await this.#commitRequests(key, values),
|
package/dist/bundling-sources/shared_libs/play-runtime/tool-call/runtime-step-receipts-adapter.ts
CHANGED
|
@@ -90,6 +90,17 @@ export type RuntimeStepToolResultReceiptsInput = {
|
|
|
90
90
|
result: ToolExecuteResult;
|
|
91
91
|
resultReceiptKey: string;
|
|
92
92
|
}) => void | Promise<void>;
|
|
93
|
+
/**
|
|
94
|
+
* Hands the canonical result write to a caller that publishes it together
|
|
95
|
+
* with the facts that name it, in one request, before the customer's call
|
|
96
|
+
* returns. `complete` then records nothing itself: the caller owns making the
|
|
97
|
+
* receipt durable and must do so before anything observes the result.
|
|
98
|
+
* Ignored when the call holds an execution fence, whose lock must stay held
|
|
99
|
+
* until the result is durable.
|
|
100
|
+
*/
|
|
101
|
+
deferPublication?: {
|
|
102
|
+
defer(write: { key: string; output: unknown }): void;
|
|
103
|
+
};
|
|
93
104
|
/** Injectable only for deterministic adapter conformance tests. */
|
|
94
105
|
sleep?: (milliseconds: number) => Promise<void>;
|
|
95
106
|
};
|
|
@@ -353,6 +364,17 @@ export function createRuntimeStepToolResultReceipts(
|
|
|
353
364
|
candidate.result,
|
|
354
365
|
record.resultReceiptKey,
|
|
355
366
|
);
|
|
367
|
+
if (input.deferPublication && !lock.required) {
|
|
368
|
+
input.deferPublication.defer({
|
|
369
|
+
key: record.resultReceiptKey,
|
|
370
|
+
output: serializeToolExecuteResult(storedResult),
|
|
371
|
+
});
|
|
372
|
+
await input.onStored?.({
|
|
373
|
+
result: storedResult,
|
|
374
|
+
resultReceiptKey: record.resultReceiptKey,
|
|
375
|
+
});
|
|
376
|
+
return { kind: 'stored', result: storedResult };
|
|
377
|
+
}
|
|
356
378
|
const persisted = await input.store.complete(
|
|
357
379
|
record.resultReceiptKey,
|
|
358
380
|
ownerRunId,
|
|
@@ -27,8 +27,7 @@ export const EXPLICIT_FRESHNESS_PLAY_AUTHORING_THRESHOLD = 11 as const;
|
|
|
27
27
|
// Edition 12 is reader-only until a later release pins it on new artifacts.
|
|
28
28
|
export const REQUEST_DIGEST_CALL_SLOT_PLAY_AUTHORING_THRESHOLD = 12 as const;
|
|
29
29
|
const EXPLICIT_FRESHNESS_STALE_AFTER_SECONDS_DESCRIPTION = [
|
|
30
|
-
'
|
|
31
|
-
'`0` is a fresh call (so is omitting it in editions before 11); a matching operation receipt still recovers that same operation after resume.',
|
|
30
|
+
'Optional. Omitted is the same as `0`: a fresh call with no cross-run reuse (edition 11 and before); a matching operation receipt still recovers that same operation after resume.',
|
|
32
31
|
'A positive integer accepts a completed, successful answer to the same request (workspace, credential, tool version) up to that many seconds old, otherwise the tool runs;',
|
|
33
32
|
'`null` accepts an answer of any age.',
|
|
34
33
|
'A reused answer makes no provider call and no provider charge.',
|
|
@@ -118,7 +117,7 @@ const PLAY_AUTHORING_CONTRACT_CHANGELOG_DETAILS = [
|
|
|
118
117
|
},
|
|
119
118
|
{
|
|
120
119
|
changed:
|
|
121
|
-
'
|
|
120
|
+
'Adds optional explicit freshness (omitted means 0) and semantic identity for supported durable calls, and gives edition 11 CSV datasets source-row occurrence identity so every input occurrence is processed even when key or rowIdentity: "key" is supplied. Edition 10 retains its list-getter behavior; editions 1–10 retain their admitted CSV identity and completed receipts. Non-CSV datasets keep explicit key deduplication.',
|
|
122
121
|
compatibilityOwner: 'Plays Runtime',
|
|
123
122
|
newWritesEnd: null,
|
|
124
123
|
readerRemoval: null,
|
|
@@ -180,7 +179,7 @@ export const PLAY_AUTHORING_RUNTIME_CAPABILITIES = [
|
|
|
180
179
|
capability: 'Freshness',
|
|
181
180
|
surface: '`staleAfterSeconds` on durable calls',
|
|
182
181
|
contract:
|
|
183
|
-
'New source in edition 11
|
|
182
|
+
'New source in edition 11 may choose freshness; omitting it means 0. Zero executes a new logical call, a positive integer is a maximum result age in seconds, and null allows indefinite reuse. A completed operation receipt separately recovers the same intended operation after resume.',
|
|
184
183
|
},
|
|
185
184
|
] as const;
|
|
186
185
|
|
|
@@ -1408,7 +1407,7 @@ export type PlayAuthoringRuntimeStepOptions = {
|
|
|
1408
1407
|
/**
|
|
1409
1408
|
* Durable freshness for one `deepline.fetch` call. The key identifies the request;
|
|
1410
1409
|
* `staleAfterSeconds` controls when that completed request may be reused across
|
|
1411
|
-
* Play runs.
|
|
1410
|
+
* Play runs. Optional: omitted is `0`. `null` reuses indefinitely,
|
|
1412
1411
|
* `0` executes on every new run, and a positive whole number sets the maximum
|
|
1413
1412
|
* result age. Retained results are supported only for read methods (GET, HEAD,
|
|
1414
1413
|
* OPTIONS); mutating methods require `0`. Transient calls do not retain results.
|
|
@@ -1660,7 +1659,7 @@ export interface PlayAuthoringRuntimeContext<
|
|
|
1660
1659
|
): Promise<T>;
|
|
1661
1660
|
|
|
1662
1661
|
/**
|
|
1663
|
-
* Execute a guarded HTTP request.
|
|
1662
|
+
* Execute a guarded HTTP request. Freshness is optional (omitted is `0`, a fresh call); only GET, HEAD, and OPTIONS can retain completed responses. Mutating methods must use `staleAfterSeconds: 0`; the choice governs only the completed call receipt, never dataset/request identity. Failed requests do not publish completed cache entries. A headers timeout leaves an upstream write's outcome unknown and does not establish whether its body was sent. The transport does not automatically retry that timed-out write, but a later invocation can execute it again. Mutating requests require provider-supported idempotency with the same key retained across retries and replay. Deadlines are platform-controlled; callers may cancel through `init.signal`. Pass `{ transient: true }` only on GET, HEAD, and OPTIONS when the response must not be retained in a receipt or checkpoint; edition 11 rejects transient writes. Edition 5+ throws `CtxFetchHttpError` for non-2xx; catch it only when the Play intentionally recovers, otherwise let it fail the Play. Editions 1–4 retain their previous response projections.
|
|
1664
1663
|
*
|
|
1665
1664
|
* @sdkReference runtime 170 deepline.fetch(key, url, init)
|
|
1666
1665
|
*/
|
|
@@ -2622,7 +2621,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
2622
2621
|
resolution: 'static-when-present',
|
|
2623
2622
|
issueCode: 'play_authoring_dataset_option_invalid',
|
|
2624
2623
|
description:
|
|
2625
|
-
'Edition 11
|
|
2624
|
+
'Edition 11 gives supported durable calls explicit optional freshness (omitted means 0) and semantic identity. CSV inputs always use source-row occurrence identity, even with rowIdentity: "key"; key-based dedup remains available for non-CSV inputs and editions 1–10.',
|
|
2626
2625
|
errorMessage: 'ctx.dataset run rowIdentity must be "source_row" or "key".',
|
|
2627
2626
|
},
|
|
2628
2627
|
'ctx.dataset.run.onRowError': {
|