deepline 0.3.373 → 0.3.375
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/runner-backends/backends/daytona-payload-transport.ts +1 -53
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +15 -23
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +65 -3
- package/dist/cli/auth-B7CLYD7R.js +35 -0
- package/dist/cli/{auth-7BMCDCRH.mjs → auth-U3Y7DTIG.mjs} +6 -4
- package/dist/cli/{billing-GKI7B4JF.js → billing-P2DNRAND.js} +73 -73
- package/dist/cli/{billing-RZEHHMPU.mjs → billing-TKARGBO3.mjs} +4 -4
- package/dist/cli/{chunk-IUYKSTWB.mjs → chunk-4GP56LRE.mjs} +12 -12
- package/dist/cli/{chunk-JSK6GUY6.js → chunk-4WINCNNH.js} +13 -9
- package/dist/cli/{chunk-CLEB5KUZ.js → chunk-ADSZGPYZ.js} +1 -1
- package/dist/cli/{chunk-E6BZWURC.mjs → chunk-B2LFDTXZ.mjs} +15 -6
- package/dist/cli/{chunk-JP2YA3AV.mjs → chunk-B3TQIJ6L.mjs} +1 -1
- package/dist/cli/{chunk-NVZAZGHA.js → chunk-CUIBDSSS.js} +8 -8
- package/dist/cli/{chunk-E7MGPPM5.js → chunk-DAG4ZBTJ.js} +1495 -1495
- package/dist/cli/{chunk-YPVTQRUM.js → chunk-DHTG5CCI.js} +15 -6
- package/dist/cli/{chunk-EYXSAB7O.js → chunk-F5CU5ALX.js} +26 -26
- package/dist/cli/{chunk-46JCJ7FT.mjs → chunk-FWF24ULX.mjs} +13 -9
- package/dist/cli/{chunk-JHUMUIU6.js → chunk-GN5QM2BB.js} +6 -6
- package/dist/cli/{chunk-BM47AKUZ.js → chunk-HEF6UDGA.js} +235 -235
- package/dist/cli/{chunk-ORBVXCTL.js → chunk-HP4BE43N.js} +52 -51
- package/dist/cli/{chunk-YHHY2YHK.mjs → chunk-HSIVHAZA.mjs} +3 -3
- package/dist/cli/{chunk-P5JPGZNI.mjs → chunk-IG3GOO4T.mjs} +1 -1
- package/dist/cli/{chunk-ND4BVWWZ.js → chunk-IQTHRG6E.js} +15 -15
- package/dist/cli/{chunk-S5OTS6H5.js → chunk-KK4XPUVA.js} +8 -8
- package/dist/cli/{chunk-IHQQNWU4.js → chunk-LZUWGLM4.js} +2 -2
- package/dist/cli/{chunk-W3H422KP.js → chunk-M2HVNJ47.js} +60 -60
- package/dist/cli/{chunk-HNLXC5BP.mjs → chunk-M5QDOHLG.mjs} +1 -1
- package/dist/cli/{chunk-XMME4SCK.mjs → chunk-MKS7C3YR.mjs} +3 -2
- package/dist/cli/{chunk-ECA6NQYL.mjs → chunk-MPQSBHMA.mjs} +4 -4
- package/dist/cli/{chunk-D2CZ4Y5G.js → chunk-MTBQEND4.js} +15 -15
- package/dist/cli/{chunk-XJYUQBHY.js → chunk-NVXMPGM4.js} +65 -84
- package/dist/cli/{chunk-6JCVL7CE.mjs → chunk-QEEIEHGV.mjs} +2 -2
- package/dist/cli/{chunk-TB73PXE3.mjs → chunk-SJVJZOPT.mjs} +2 -2
- package/dist/cli/{chunk-QSV76EMO.mjs → chunk-STYH5U6W.mjs} +7 -7
- package/dist/cli/{chunk-R6TPSZLN.mjs → chunk-Z4ARN4X3.mjs} +2 -2
- package/dist/cli/{chunk-PZ26EKNC.mjs → chunk-ZFWU5V2A.mjs} +13 -32
- package/dist/cli/{chunk-Y32GUTEN.mjs → chunk-ZHXPNJQI.mjs} +1467 -1467
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-3FNCVMWA.mjs → csv-3FTYTEJ3.mjs} +3 -3
- package/dist/cli/{csv-NFQYQWWO.js → csv-WAEVGKHF.js} +12 -12
- package/dist/cli/{db-VA7HULGR.mjs → db-HUGGFIVS.mjs} +4 -4
- package/dist/cli/{db-CTLGRV3X.js → db-UDMDGNKO.js} +29 -29
- package/dist/cli/{describe-GXGRMP2M.mjs → describe-EOBOGTB5.mjs} +130 -20
- package/dist/cli/{describe-IUHOEPKY.js → describe-SIAKZYRK.js} +144 -34
- package/dist/cli/{executions-DSK3HRPU.js → executions-HYYP27MG.js} +6 -6
- package/dist/cli/{executions-OZQDZQIK.mjs → executions-O6Z2HSLK.mjs} +4 -4
- package/dist/cli/{feedback-KTMLMWKV.js → feedback-3DWSBHKS.js} +7 -7
- package/dist/cli/{feedback-ZOY7R4JD.mjs → feedback-RRAMGMQV.mjs} +3 -3
- package/dist/cli/{git-FIOI4IA2.mjs → git-KVAK7VOL.mjs} +4 -4
- package/dist/cli/git-M36KWCCG.js +23 -0
- package/dist/cli/index.js +106 -91
- package/dist/cli/index.mjs +63 -48
- package/dist/cli/{legacy-noops-KQZWSABN.mjs → legacy-noops-MQNCDMY7.mjs} +4 -4
- package/dist/cli/{legacy-noops-WXAYRQMQ.js → legacy-noops-V5GQXXUR.js} +7 -7
- package/dist/cli/{monitors-VHNWIF4V.mjs → monitors-6FB63TDM.mjs} +4 -4
- package/dist/cli/{monitors-LPUCHRNJ.js → monitors-RFGQILPW.js} +85 -85
- package/dist/cli/{org-GWHWBCMD.js → org-L33EPH2E.js} +64 -64
- package/dist/cli/{org-UW7NPGEY.mjs → org-TZPQDDVX.mjs} +4 -4
- package/dist/cli/{play-FNM2E66T.mjs → play-PU23OETO.mjs} +8 -8
- package/dist/cli/play-YR2XQARF.js +155 -0
- package/dist/cli/{providers-6D6R3PWX.js → providers-2RHIKO22.js} +7 -7
- package/dist/cli/{providers-XAZMYDWS.mjs → providers-QGQR6ZZF.mjs} +4 -4
- package/dist/cli/{quickstart-OK65PGZL.mjs → quickstart-24DQYBW7.mjs} +3 -3
- package/dist/cli/{quickstart-HBUWBVH6.js → quickstart-BGQVPI7W.js} +5 -5
- package/dist/cli/{search-XY6JOTS2.mjs → search-EUN7YFMX.mjs} +5 -5
- package/dist/cli/search-OHELMK6E.js +26 -0
- package/dist/cli/{secrets-W2LDLU2W.mjs → secrets-OOHN6LNJ.mjs} +4 -4
- package/dist/cli/{secrets-6CYCPK7T.js → secrets-XL7GUTQA.js} +13 -13
- package/dist/cli/{sessions-GOYEKNTJ.js → sessions-FD5XB7M2.js} +5 -5
- package/dist/cli/{sessions-JAX7PGXU.mjs → sessions-SDN4C3YS.mjs} +4 -4
- package/dist/cli/{settings-OACUQOCM.mjs → settings-3MXRXYXI.mjs} +7 -7
- package/dist/cli/{settings-QMFYFCT7.js → settings-6ZEKVAYL.js} +74 -74
- package/dist/cli/{setup-2KA5TZBZ.mjs → setup-DWTR6HNT.mjs} +6 -6
- package/dist/cli/{setup-36VOOGVA.js → setup-VKQ5EJZR.js} +41 -41
- package/dist/cli/skills-6GFW4GCW.js +28 -0
- package/dist/cli/{skills-QY4BX5ZX.mjs → skills-ISG5UUZW.mjs} +4 -4
- package/dist/cli/{tools-UCB2QRVC.mjs → tools-JTC3DR6M.mjs} +7 -7
- package/dist/cli/tools-LK4L6VCK.js +40 -0
- package/dist/cli/{update-327MHUO4.mjs → update-GMTVIHCG.mjs} +6 -6
- package/dist/cli/update-PSJLAW4Q.js +28 -0
- package/dist/cli/{workflow-G7BU54KW.js → workflow-2765Y3Y5.js} +15 -15
- package/dist/cli/{workflow-HJN4GA5A.mjs → workflow-3POT3VFY.mjs} +5 -5
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/install-integrity.json +76 -78
- 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/package.json +1 -1
- package/dist/cli/auth-BWCNRUG3.js +0 -33
- package/dist/cli/client-FO6LMHT4.mjs +0 -20
- package/dist/cli/client-KAWK7FJR.js +0 -20
- package/dist/cli/git-5P5FLEUC.js +0 -23
- package/dist/cli/play-EVBIC7Z5.js +0 -155
- package/dist/cli/search-6ZY2XWP2.js +0 -26
- package/dist/cli/skills-6GPIEPTP.js +0 -28
- package/dist/cli/tools-RTECP4WT.js +0 -40
- package/dist/cli/update-WR65EHBN.js +0 -28
|
@@ -200,7 +200,7 @@ export const SDK_RELEASE = {
|
|
|
200
200
|
// getters keep their established compatibility behavior.
|
|
201
201
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
202
202
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
203
|
-
version: '0.3.
|
|
203
|
+
version: '0.3.375',
|
|
204
204
|
updateSummary:
|
|
205
205
|
'Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.',
|
|
206
206
|
packageCapabilities: {
|
|
@@ -28,7 +28,6 @@ import {
|
|
|
28
28
|
RUNTIME_SANDBOX_MEMORY_ABORT_CODE,
|
|
29
29
|
RUNTIME_SANDBOX_MEMORY_ABORT_MESSAGE,
|
|
30
30
|
RUNTIME_SANDBOX_OOM_MESSAGE,
|
|
31
|
-
RUNTIME_CONTROL_PLANE_UNAVAILABLE_MESSAGE,
|
|
32
31
|
} from '../../run-failure';
|
|
33
32
|
import {
|
|
34
33
|
buildDaytonaPayloadMaterializerSource,
|
|
@@ -295,41 +294,6 @@ function watchdogMemoryAbortDiagnostic() {
|
|
|
295
294
|
return null;
|
|
296
295
|
}
|
|
297
296
|
|
|
298
|
-
function watchdogRunnerHeartbeatUnavailableDiagnostic() {
|
|
299
|
-
try {
|
|
300
|
-
if (!terminationDiagnosticPath) return null;
|
|
301
|
-
const diagnostic = JSON.parse(
|
|
302
|
-
fs.readFileSync(terminationDiagnosticPath, 'utf8'),
|
|
303
|
-
);
|
|
304
|
-
if (
|
|
305
|
-
!diagnostic ||
|
|
306
|
-
diagnostic.schemaVersion !== 1 ||
|
|
307
|
-
diagnostic.reason !== 'runner_heartbeat_unreachable'
|
|
308
|
-
) {
|
|
309
|
-
return null;
|
|
310
|
-
}
|
|
311
|
-
return {
|
|
312
|
-
heartbeatAttempt: Number.isSafeInteger(diagnostic.heartbeatAttempt)
|
|
313
|
-
? diagnostic.heartbeatAttempt
|
|
314
|
-
: null,
|
|
315
|
-
heartbeatAgeMs: Number.isFinite(diagnostic.heartbeatAgeMs)
|
|
316
|
-
? Math.max(0, diagnostic.heartbeatAgeMs)
|
|
317
|
-
: null,
|
|
318
|
-
leaseMs: Number.isFinite(diagnostic.leaseMs)
|
|
319
|
-
? Math.max(0, diagnostic.leaseMs)
|
|
320
|
-
: null,
|
|
321
|
-
lastErrorCode:
|
|
322
|
-
typeof diagnostic.lastErrorCode === 'string' &&
|
|
323
|
-
/^(?:E[A-Z0-9_]+|ERR_[A-Z0-9_]+|UND_ERR_[A-Z0-9_]+|TimeoutError|redirect_[0-9]{3}|http_[0-9]{3}|protocol_error|unknown)$/.test(
|
|
324
|
-
diagnostic.lastErrorCode,
|
|
325
|
-
)
|
|
326
|
-
? diagnostic.lastErrorCode
|
|
327
|
-
: 'unknown',
|
|
328
|
-
};
|
|
329
|
-
} catch {}
|
|
330
|
-
return null;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
297
|
function memoryAbortCause(diagnostic) {
|
|
334
298
|
const parts = [
|
|
335
299
|
${JSON.stringify(`${RUNTIME_SANDBOX_MEMORY_ABORT_CODE}: ${RUNTIME_SANDBOX_MEMORY_ABORT_MESSAGE}`)},
|
|
@@ -411,7 +375,6 @@ async function main() {
|
|
|
411
375
|
// SIGKILL does not collapse into the wrapper's generic exit code 1.
|
|
412
376
|
const sandboxKilled = exitCode === 137 || watchdogObservedChildSigkill();
|
|
413
377
|
const memoryAbort = watchdogMemoryAbortDiagnostic();
|
|
414
|
-
const heartbeatUnavailable = watchdogRunnerHeartbeatUnavailableDiagnostic();
|
|
415
378
|
const sandboxOom =
|
|
416
379
|
!memoryAbort &&
|
|
417
380
|
sandboxKilled &&
|
|
@@ -422,10 +385,6 @@ async function main() {
|
|
|
422
385
|
? memoryAbortCause(memoryAbort)
|
|
423
386
|
: sandboxOom
|
|
424
387
|
? 'RUNTIME_SANDBOX_OOM: ' + ${JSON.stringify(RUNTIME_SANDBOX_OOM_MESSAGE)}
|
|
425
|
-
: heartbeatUnavailable
|
|
426
|
-
? 'RUNTIME_CONTROL_PLANE_UNAVAILABLE: ' +
|
|
427
|
-
${JSON.stringify(RUNTIME_CONTROL_PLANE_UNAVAILABLE_MESSAGE)} +
|
|
428
|
-
' heartbeat=' + JSON.stringify(heartbeatUnavailable)
|
|
429
388
|
: sandboxKilled
|
|
430
389
|
? 'RUNTIME_SANDBOX_KILLED: ' + ${JSON.stringify(RUNTIME_SANDBOX_KILLED_MESSAGE)}
|
|
431
390
|
:
|
|
@@ -453,15 +412,6 @@ async function main() {
|
|
|
453
412
|
cause: synthesizedError,
|
|
454
413
|
}] }
|
|
455
414
|
: {}),
|
|
456
|
-
...(heartbeatUnavailable && !runtimeLimitExceeded && !memoryAbort && !sandboxOom
|
|
457
|
-
? { errors: [{
|
|
458
|
-
code: 'RUNTIME_CONTROL_PLANE_UNAVAILABLE',
|
|
459
|
-
phase: 'infrastructure',
|
|
460
|
-
message: ${JSON.stringify(RUNTIME_CONTROL_PLANE_UNAVAILABLE_MESSAGE)},
|
|
461
|
-
retryable: false,
|
|
462
|
-
cause: synthesizedError,
|
|
463
|
-
}] }
|
|
464
|
-
: {}),
|
|
465
415
|
...(sandboxOom
|
|
466
416
|
? { errors: [{
|
|
467
417
|
code: 'RUNTIME_SANDBOX_OOM',
|
|
@@ -480,9 +430,7 @@ async function main() {
|
|
|
480
430
|
cause: synthesizedError,
|
|
481
431
|
}] }
|
|
482
432
|
: {}),
|
|
483
|
-
logs:
|
|
484
|
-
? ['[runtime.failure_diagnostic] ' + JSON.stringify({ event: 'runner_heartbeat_unavailable', ...heartbeatUnavailable })]
|
|
485
|
-
: [],
|
|
433
|
+
logs: [],
|
|
486
434
|
stats: {},
|
|
487
435
|
steps: [],
|
|
488
436
|
checkpointDisposition: '${RUNNER_TERMINAL_CHECKPOINT_DISPOSITION.ABSENT}',
|
|
@@ -196,8 +196,6 @@ let heartbeatConfigRead = false;
|
|
|
196
196
|
let heartbeatConfig = null;
|
|
197
197
|
let heartbeatLastSuccessAtMs = 0;
|
|
198
198
|
let heartbeatAttempt = 0;
|
|
199
|
-
let heartbeatLastErrorCode = null;
|
|
200
|
-
let heartbeatStopBeforeLeaseMs = 0;
|
|
201
199
|
let stopRequested = false;
|
|
202
200
|
|
|
203
201
|
function readRunnerHeartbeatConfig() {
|
|
@@ -246,7 +244,7 @@ function stopRunnerHeartbeat() {
|
|
|
246
244
|
|
|
247
245
|
function runnerHeartbeatErrorCode(error) {
|
|
248
246
|
const code = error && typeof error.code === 'string' ? error.code : '';
|
|
249
|
-
if (/^(?:E[A-Z0-9_]+|ERR_[A-Z0-9_]+|UND_ERR_[A-Z0-9_]
|
|
247
|
+
if (/^(?:E[A-Z0-9_]+|ERR_[A-Z0-9_]+|UND_ERR_[A-Z0-9_]+|http_[0-9]{3}|redirect_[0-9]{3}|protocol_error)$/.test(code)) return code;
|
|
250
248
|
const name = error && typeof error.name === 'string' ? error.name : '';
|
|
251
249
|
if (name === 'AbortError' || name === 'TimeoutError') return name;
|
|
252
250
|
return 'unknown';
|
|
@@ -263,10 +261,6 @@ function startRunnerHeartbeatSupervisor() {
|
|
|
263
261
|
const handoffAt = Number(handoff && handoff.lastHeartbeatAtMs);
|
|
264
262
|
heartbeatLastSuccessAtMs = Number.isFinite(handoffAt) ? handoffAt : Date.now();
|
|
265
263
|
const cadenceMs = Math.max(250, Math.floor(config.leaseMs / ${RUNTIME_CLAIM_HEARTBEAT_DIVISOR}));
|
|
266
|
-
heartbeatStopBeforeLeaseMs = Math.max(
|
|
267
|
-
0,
|
|
268
|
-
config.leaseMs - cadenceMs - ${RUNNER_HEARTBEAT_REQUEST_TIMEOUT_MS},
|
|
269
|
-
);
|
|
270
264
|
process.stderr.write(
|
|
271
265
|
'[play-runner.heartbeat] watchdog_owner_started ' +
|
|
272
266
|
JSON.stringify({ runId: config.runId, cadenceMs, handoffHeartbeatAgeMs: Math.max(0, Date.now() - heartbeatLastSuccessAtMs) }) +
|
|
@@ -325,35 +319,33 @@ async function runnerHeartbeatTick() {
|
|
|
325
319
|
throw Object.assign(new Error('gateway_protocol_error'), { code: 'protocol_error' });
|
|
326
320
|
}
|
|
327
321
|
heartbeatLastSuccessAtMs = Date.now();
|
|
328
|
-
heartbeatLastErrorCode = null;
|
|
329
322
|
} catch (error) {
|
|
330
323
|
if (heartbeatStopped || settled) return;
|
|
331
|
-
|
|
324
|
+
const errorCode = controller.signal.aborted
|
|
332
325
|
? 'TimeoutError'
|
|
333
326
|
: runnerHeartbeatErrorCode(error);
|
|
334
327
|
const heartbeatAgeMs = Math.max(0, Date.now() - heartbeatLastSuccessAtMs);
|
|
335
328
|
process.stderr.write(
|
|
336
329
|
'[play-runner.heartbeat] watchdog_owner_retrying ' +
|
|
337
|
-
JSON.stringify({ runId: config.runId, attempt: heartbeatAttempt, durationMs: Math.max(0, Date.now() - startedAt), heartbeatAgeMs, errorCode
|
|
330
|
+
JSON.stringify({ runId: config.runId, attempt: heartbeatAttempt, durationMs: Math.max(0, Date.now() - startedAt), heartbeatAgeMs, errorCode }) +
|
|
338
331
|
'\\n',
|
|
339
332
|
);
|
|
340
|
-
//
|
|
341
|
-
//
|
|
342
|
-
//
|
|
343
|
-
|
|
333
|
+
// The gateway answered definitively: this token is invalid (401), out of
|
|
334
|
+
// scope (403), or its attempt is no longer the run's current one (404).
|
|
335
|
+
// Nothing else stops a superseded attempt's paid calls, so stop now.
|
|
336
|
+
const rejection = /^http_(401|403|404)$/.exec(errorCode);
|
|
337
|
+
if (rejection) {
|
|
344
338
|
stopRunnerHeartbeat();
|
|
345
|
-
const diagnostic = {
|
|
346
|
-
heartbeatAttempt,
|
|
347
|
-
heartbeatAgeMs,
|
|
348
|
-
leaseMs: config.leaseMs,
|
|
349
|
-
stopBeforeLeaseMs: heartbeatStopBeforeLeaseMs,
|
|
350
|
-
lastErrorCode: heartbeatLastErrorCode,
|
|
351
|
-
};
|
|
339
|
+
const diagnostic = { heartbeatAttempt, status: Number(rejection[1]) };
|
|
352
340
|
process.stderr.write(
|
|
353
|
-
'
|
|
341
|
+
'[play-runner.heartbeat] watchdog_owner_rejected ' + JSON.stringify(diagnostic) + '\\n',
|
|
354
342
|
);
|
|
355
|
-
stopChild('
|
|
343
|
+
stopChild('runner_heartbeat_rejected', diagnostic);
|
|
356
344
|
}
|
|
345
|
+
// Otherwise keep renewing. An unreachable or failing control plane is not
|
|
346
|
+
// evidence that this run is over: the scheduler owns the liveness verdict
|
|
347
|
+
// and confirms it only after it can accept heartbeats again. The runtime
|
|
348
|
+
// limit, the terminal channel above, and sandbox cleanup bound this process.
|
|
357
349
|
} finally {
|
|
358
350
|
clearTimeout(timeout);
|
|
359
351
|
if (heartbeatController === controller) heartbeatController = null;
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts
CHANGED
|
@@ -45,6 +45,7 @@ import {
|
|
|
45
45
|
} from '../app-runtime-api';
|
|
46
46
|
import { RUNTIME_CAPACITY_POLICY } from '../runtime-capacity-policy';
|
|
47
47
|
import { RUNTIME_RELIABILITY_POLICY } from '../runtime-reliability-policy';
|
|
48
|
+
import { RUNTIME_CLAIM_HEARTBEAT_DIVISOR } from '../runtime-constants';
|
|
48
49
|
import type { RuntimeTrafficPolicy } from '../runtime-traffic-policy';
|
|
49
50
|
import { runtimeLimitExceededCause } from '../run-failure';
|
|
50
51
|
import {
|
|
@@ -736,7 +737,7 @@ export class AbsurdExecutionOperationTimeoutError extends Error {
|
|
|
736
737
|
* park/resume seam without a real engine. */
|
|
737
738
|
export type AbsurdSuspensionContext = Pick<
|
|
738
739
|
TaskContext,
|
|
739
|
-
'sleepFor' | 'sleepUntil' | 'awaitEvent' | 'heartbeat'
|
|
740
|
+
'sleepFor' | 'sleepUntil' | 'awaitEvent' | 'heartbeat' | 'step'
|
|
740
741
|
>;
|
|
741
742
|
|
|
742
743
|
/** Injected DB + app-runtime seams so the handler is testable against real SQL
|
|
@@ -1284,6 +1285,46 @@ function signalData(
|
|
|
1284
1285
|
return null;
|
|
1285
1286
|
}
|
|
1286
1287
|
|
|
1288
|
+
const LIVENESS_CONFIRMATION_SLICES_PER_CADENCE = 4;
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* A stale heartbeat proves a lost runner only if the runner could have renewed
|
|
1292
|
+
* it. During a scheduler-store stall no runner can, and the worker's own
|
|
1293
|
+
* scheduling writes (`schedule_run` NOTIFYs) stall with it. So the worker
|
|
1294
|
+
* counts only short sleep slices that woke on time, and decides after two
|
|
1295
|
+
* heartbeat cadences of such observed availability. A late slice counts for
|
|
1296
|
+
* nothing. Slice times and lateness are checkpointed, so replay is
|
|
1297
|
+
* deterministic. Returns true when the runner stayed silent or the hard
|
|
1298
|
+
* ceiling arrived, false as soon as it renewed or pushed its terminal.
|
|
1299
|
+
*/
|
|
1300
|
+
async function confirmDetachedRunnerSilence(input: {
|
|
1301
|
+
ctx: AbsurdSuspensionContext;
|
|
1302
|
+
stepPrefix: string;
|
|
1303
|
+
cadenceMs: number;
|
|
1304
|
+
ceilingDeadlineMs: number;
|
|
1305
|
+
runnerResponded: () => Promise<boolean>;
|
|
1306
|
+
}): Promise<boolean> {
|
|
1307
|
+
const sliceMs = Math.floor(
|
|
1308
|
+
input.cadenceMs / LIVENESS_CONFIRMATION_SLICES_PER_CADENCE,
|
|
1309
|
+
);
|
|
1310
|
+
let observedMs = 0;
|
|
1311
|
+
for (let slice = 1; observedMs < 2 * input.cadenceMs; slice += 1) {
|
|
1312
|
+
const stepName = `${input.stepPrefix}:${slice}`;
|
|
1313
|
+
const wakeAtMs = await input.ctx.step(`${stepName}:at`, async () =>
|
|
1314
|
+
Math.min(input.ceilingDeadlineMs, Date.now() + sliceMs),
|
|
1315
|
+
);
|
|
1316
|
+
await input.ctx.sleepUntil(stepName, new Date(wakeAtMs));
|
|
1317
|
+
if (await input.runnerResponded()) return false;
|
|
1318
|
+
if (wakeAtMs >= input.ceilingDeadlineMs) return true;
|
|
1319
|
+
const lateMs = await input.ctx.step(
|
|
1320
|
+
`${stepName}:late`,
|
|
1321
|
+
async () => Date.now() - wakeAtMs,
|
|
1322
|
+
);
|
|
1323
|
+
if (lateMs <= sliceMs) observedMs += sliceMs;
|
|
1324
|
+
}
|
|
1325
|
+
return true;
|
|
1326
|
+
}
|
|
1327
|
+
|
|
1287
1328
|
/**
|
|
1288
1329
|
* Map a runner suspension onto an absurd durable primitive and return the
|
|
1289
1330
|
* checkpoint with the resolved boundary output. THROWS `SuspendTask` when the
|
|
@@ -1382,9 +1423,30 @@ export async function parkAndResolveSuspension(input: {
|
|
|
1382
1423
|
(Number.isFinite(renewedAtMs) ? renewedAtMs : suspension.startedAtMs) +
|
|
1383
1424
|
heartbeatTimeoutMs,
|
|
1384
1425
|
);
|
|
1385
|
-
if (renewedDeadlineMs
|
|
1386
|
-
break;
|
|
1426
|
+
if (renewedDeadlineMs > Date.now()) {
|
|
1427
|
+
if (renewedDeadlineMs === deadlineMs) break;
|
|
1428
|
+
continue;
|
|
1387
1429
|
}
|
|
1430
|
+
if (ceilingDeadlineMs <= Date.now()) break;
|
|
1431
|
+
const readRunnerTerminal = input.readRunnerTerminal;
|
|
1432
|
+
const readRunnerLiveness = input.readRunnerLiveness;
|
|
1433
|
+
const silent = await confirmDetachedRunnerSilence({
|
|
1434
|
+
ctx,
|
|
1435
|
+
stepPrefix: `${suspension.boundaryId}:liveness-confirm:${Number.isFinite(renewedAtMs) ? renewedAtMs : 'none'}`,
|
|
1436
|
+
cadenceMs: Math.floor(
|
|
1437
|
+
heartbeatTimeoutMs / RUNTIME_CLAIM_HEARTBEAT_DIVISOR,
|
|
1438
|
+
),
|
|
1439
|
+
ceilingDeadlineMs,
|
|
1440
|
+
runnerResponded: async () => {
|
|
1441
|
+
if (await readRunnerTerminal(suspension.runnerAttempt)) return true;
|
|
1442
|
+
const current = await readRunnerLiveness(suspension.runnerAttempt);
|
|
1443
|
+
const currentAtMs = current?.heartbeatAt
|
|
1444
|
+
? Date.parse(current.heartbeatAt)
|
|
1445
|
+
: Number.NaN;
|
|
1446
|
+
return Number.isFinite(currentAtMs) && !(currentAtMs <= renewedAtMs);
|
|
1447
|
+
},
|
|
1448
|
+
});
|
|
1449
|
+
if (silent) break;
|
|
1388
1450
|
}
|
|
1389
1451
|
// Truth is the persisted terminal (read by the caller's wake path); the
|
|
1390
1452
|
// absurd event carries no payload we trust.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkHP4BE43Njs = require('./chunk-HP4BE43N.js');
|
|
15
|
+
require('./chunk-GN5QM2BB.js');
|
|
16
|
+
require('./chunk-IQTHRG6E.js');
|
|
17
|
+
require('./chunk-XNYIZMNQ.js');
|
|
18
|
+
require('./chunk-7P5AA3SN.js');
|
|
19
|
+
require('./chunk-ADSZGPYZ.js');
|
|
20
|
+
require('./chunk-OG64RBAC.js');
|
|
21
|
+
require('./chunk-COGTRVWW.js');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkHP4BE43Njs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkHP4BE43Njs.authStatusLine; exports.clearPendingClaim = _chunkHP4BE43Njs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkHP4BE43Njs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkHP4BE43Njs.handleRegister; exports.handleStatus = _chunkHP4BE43Njs.handleStatus; exports.handleWait = _chunkHP4BE43Njs.handleWait; exports.httpJson = _chunkHP4BE43Njs.httpJson; exports.readPendingAuthClaim = _chunkHP4BE43Njs.readPendingAuthClaim; exports.registerAuthCommands = _chunkHP4BE43Njs.registerAuthCommands; exports.reportSetupCompleted = _chunkHP4BE43Njs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkHP4BE43Njs.resolvePendingAuthClaimForResume;
|
|
@@ -6,16 +6,17 @@ import {
|
|
|
6
6
|
handleRegister,
|
|
7
7
|
handleStatus,
|
|
8
8
|
handleWait,
|
|
9
|
+
httpJson,
|
|
9
10
|
readPendingAuthClaim,
|
|
10
11
|
registerAuthCommands,
|
|
11
12
|
reportSetupCompleted,
|
|
12
13
|
resolvePendingAuthClaimForResume
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-MKS7C3YR.mjs";
|
|
15
|
+
import "./chunk-M5QDOHLG.mjs";
|
|
16
|
+
import "./chunk-4GP56LRE.mjs";
|
|
16
17
|
import "./chunk-DLIRSHV6.mjs";
|
|
17
18
|
import "./chunk-NXGCO4JB.mjs";
|
|
18
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-IG3GOO4T.mjs";
|
|
19
20
|
import "./chunk-WZYKRD7T.mjs";
|
|
20
21
|
import "./chunk-KRD6H754.mjs";
|
|
21
22
|
export {
|
|
@@ -26,6 +27,7 @@ export {
|
|
|
26
27
|
handleRegister,
|
|
27
28
|
handleStatus,
|
|
28
29
|
handleWait,
|
|
30
|
+
httpJson,
|
|
29
31
|
readPendingAuthClaim,
|
|
30
32
|
registerAuthCommands,
|
|
31
33
|
reportSetupCompleted,
|