deepline 0.3.312 → 0.3.313
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/scheduler-backends/postgres.ts +60 -37
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +11 -6
- package/dist/cli/auth-56NYRTQK.js +31 -0
- package/dist/cli/{auth-ACDTPM3M.mjs → auth-LNA6WCQA.mjs} +4 -4
- package/dist/cli/{billing-FVBBJ77L.mjs → billing-D37QNIE3.mjs} +4 -4
- package/dist/cli/{billing-YTJFHEGU.js → billing-GJJUUCOZ.js} +70 -70
- package/dist/cli/{chunk-GTEDCRKC.mjs → chunk-3ZC4PHJ6.mjs} +1 -1
- package/dist/cli/{chunk-T4IJQKRE.js → chunk-4UXNEC5C.js} +26 -26
- package/dist/cli/{chunk-V7N6BJQD.js → chunk-6G7ZYA6E.js} +50 -50
- package/dist/cli/{chunk-6OGNRAS7.mjs → chunk-BLMO3JMZ.mjs} +2 -2
- package/dist/cli/{chunk-I25C4KL7.mjs → chunk-BS4GAUMH.mjs} +6 -6
- package/dist/cli/{chunk-ZH7KTVAB.mjs → chunk-CSH4PKPJ.mjs} +1 -1
- package/dist/cli/{chunk-WPTUKXIF.mjs → chunk-DOI3UBGV.mjs} +1 -1
- package/dist/cli/{chunk-YYU3PYVK.js → chunk-FJUIXWZF.js} +48 -48
- package/dist/cli/{chunk-TID5XLTZ.js → chunk-FSZTWQFK.js} +4 -4
- package/dist/cli/{chunk-6LLJWMYH.js → chunk-GQXEHX5X.js} +6 -6
- package/dist/cli/{chunk-AA66YTS7.mjs → chunk-HM2TSTCT.mjs} +1 -1
- package/dist/cli/{chunk-ZQJDRSR5.js → chunk-HY2SSFRI.js} +1 -1
- package/dist/cli/{chunk-7SW43OAX.js → chunk-I4FHFGMA.js} +60 -60
- package/dist/cli/{chunk-FQVTHBEH.js → chunk-JG2ZTDZV.js} +15 -15
- package/dist/cli/{chunk-6KKETQSI.js → chunk-KNGTN7NE.js} +6 -6
- package/dist/cli/{chunk-BRJOVSTH.js → chunk-MHETTUWR.js} +2 -2
- package/dist/cli/{chunk-NJNYWVEF.mjs → chunk-N2DXWS6W.mjs} +2 -2
- package/dist/cli/{chunk-NMZPK7LM.mjs → chunk-OTA5C7DD.mjs} +1 -1
- package/dist/cli/{chunk-QFSLMI42.js → chunk-P4N7233B.js} +220 -220
- package/dist/cli/{chunk-EHVJ7XXD.mjs → chunk-QCXDLOGA.mjs} +2 -2
- package/dist/cli/{chunk-VJDKV5RU.js → chunk-QQMKX7JW.js} +6 -6
- package/dist/cli/{chunk-MK4K5MQU.mjs → chunk-RDUS2EDE.mjs} +3 -3
- package/dist/cli/{chunk-OV6IFAXH.mjs → chunk-UQBMMN4U.mjs} +5 -5
- package/dist/cli/{chunk-ULI6UVV6.js → chunk-VSAYSOVC.js} +6 -6
- package/dist/cli/{chunk-ENSDO4SG.mjs → chunk-XFEPRIW7.mjs} +4 -4
- package/dist/cli/{chunk-NWFE4PGX.mjs → chunk-YZ5PP6TX.mjs} +1 -1
- package/dist/cli/{client-ENGOMTTU.mjs → client-6RVRZ4OY.mjs} +3 -3
- package/dist/cli/client-XUTMYJDL.js +20 -0
- package/dist/cli/{csv-6WOJC6NZ.js → csv-2UHRG67O.js} +12 -12
- package/dist/cli/{csv-ENKTPYAJ.mjs → csv-SBOHBKEG.mjs} +3 -3
- package/dist/cli/{db-DSCJZYJU.mjs → db-TUFTPYEA.mjs} +4 -4
- package/dist/cli/{db-BAEVP4QK.js → db-VRE7CLIQ.js} +20 -20
- package/dist/cli/{describe-X2AFAC4B.js → describe-GS5A2XH4.js} +15 -15
- package/dist/cli/{describe-PAUHJF7H.mjs → describe-WCBZTSOF.mjs} +8 -8
- package/dist/cli/{executions-LXS6NLCV.js → executions-ENMOOKWH.js} +6 -6
- package/dist/cli/{executions-R6JOR67D.mjs → executions-UTN3O372.mjs} +4 -4
- package/dist/cli/{feedback-HXP2D7K6.js → feedback-BLN6SIRG.js} +6 -6
- package/dist/cli/{feedback-CYRVNCGT.mjs → feedback-PXBA3AG7.mjs} +3 -3
- package/dist/cli/git-26D3VD2I.js +23 -0
- package/dist/cli/{git-XBYBZB4R.mjs → git-YDMIRW3Q.mjs} +4 -4
- package/dist/cli/index.js +74 -74
- package/dist/cli/index.mjs +31 -31
- package/dist/cli/{legacy-noops-AUNAFEZP.js → legacy-noops-CWTUWTDB.js} +7 -7
- package/dist/cli/{legacy-noops-OQP6VZKE.mjs → legacy-noops-OVG2SICQ.mjs} +4 -4
- package/dist/cli/{monitors-L2HAAPAL.mjs → monitors-ATIDXJA4.mjs} +4 -4
- package/dist/cli/{monitors-QSIZG3CJ.js → monitors-T63OPBTY.js} +85 -85
- package/dist/cli/{org-JUHQGBQE.js → org-7RVAPMRN.js} +60 -60
- package/dist/cli/{org-UCSN5XRC.mjs → org-NXKNIM3H.mjs} +4 -4
- package/dist/cli/{play-5AT2RB3M.mjs → play-B62OVHD4.mjs} +7 -7
- package/dist/cli/play-WM3NZVE7.js +152 -0
- package/dist/cli/{providers-CVG4L3VR.js → providers-EITVEGXD.js} +7 -7
- package/dist/cli/{providers-GVPAPZ4L.mjs → providers-U7B7JEYY.mjs} +4 -4
- package/dist/cli/{quickstart-7OIFIQG3.js → quickstart-G64F2XRU.js} +5 -5
- package/dist/cli/{quickstart-Y6ZU27LE.mjs → quickstart-VSWTYNJM.mjs} +3 -3
- package/dist/cli/{search-4I2Y2NKK.mjs → search-SKYTFKKF.mjs} +5 -5
- package/dist/cli/search-TXQJJQWY.js +26 -0
- package/dist/cli/{secrets-3Z4IUEBA.mjs → secrets-4DNS7KWS.mjs} +4 -4
- package/dist/cli/{secrets-O2UFLU52.js → secrets-JSFHSCGM.js} +13 -13
- package/dist/cli/{sessions-OMAXRY5I.mjs → sessions-HB7RQ4XN.mjs} +4 -4
- package/dist/cli/{sessions-T6MWWQRH.js → sessions-MLTYPPCG.js} +5 -5
- package/dist/cli/{settings-R4LO5NMY.js → settings-3PCKNBPU.js} +74 -74
- package/dist/cli/{settings-C47WXZY5.mjs → settings-BT5WCU65.mjs} +7 -7
- package/dist/cli/{setup-JPJVTIQ6.mjs → setup-EIWDTMCK.mjs} +6 -6
- package/dist/cli/{setup-FIUTV4DD.js → setup-EYZWTDJI.js} +41 -41
- package/dist/cli/skills-73T4BSDE.js +28 -0
- package/dist/cli/{skills-6WVTMKP5.mjs → skills-AQ3ORN2C.mjs} +4 -4
- package/dist/cli/{tools-TKS77TNU.mjs → tools-OFTB2BGP.mjs} +6 -6
- package/dist/cli/tools-ZGSOHWBY.js +38 -0
- package/dist/cli/{update-GD754XMA.mjs → update-ERQTFSAR.mjs} +6 -6
- package/dist/cli/update-L4V5TF7I.js +28 -0
- package/dist/cli/{workflow-OCUQCNXA.js → workflow-6D6NHUH4.js} +15 -15
- package/dist/cli/{workflow-YKQSPXQZ.mjs → workflow-SRLWGGBM.mjs} +5 -5
- package/dist/index.js +6 -6
- package/dist/index.mjs +3 -3
- package/dist/install-integrity.json +74 -74
- 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-TFDGA24W.js +0 -31
- package/dist/cli/client-T6YGH6TT.js +0 -20
- package/dist/cli/git-JOE2RM3Q.js +0 -23
- package/dist/cli/play-2SNMTZGK.js +0 -152
- package/dist/cli/search-DS36UHOX.js +0 -26
- package/dist/cli/skills-GLPKPF7R.js +0 -28
- package/dist/cli/tools-L3YLQ7BR.js +0 -38
- package/dist/cli/update-HXI35NME.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.313',
|
|
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: {
|
|
@@ -354,8 +354,10 @@ const POSTGRES_SCHEDULER_SCHEMA_INIT_STATEMENT_TIMEOUT_MS = 60_000;
|
|
|
354
354
|
// v60 indexes all sandbox leases by Run, including released custody history.
|
|
355
355
|
// v61 adds an operator-owned new-run projection cutover and admission pin.
|
|
356
356
|
// Existing namespace mode values and unpinned runs keep their behavior.
|
|
357
|
+
// v62 adds a deploy-owned index for per-run active outbox lease exclusion.
|
|
358
|
+
// Failed facts remain indexed: their live leases still fence the run.
|
|
357
359
|
// This marker records deployment work, never a runtime schema floor.
|
|
358
|
-
export const POSTGRES_SCHEDULER_SCHEMA_VERSION =
|
|
360
|
+
export const POSTGRES_SCHEDULER_SCHEMA_VERSION = 62;
|
|
359
361
|
const POSTGRES_SCHEDULER_SCHEMA_MIGRATIONS_TABLE =
|
|
360
362
|
'scheduler_schema_migrations';
|
|
361
363
|
export const POSTGRES_SCHEDULER_OPEN_RECOVERY_INDEX =
|
|
@@ -1986,6 +1988,15 @@ export async function hasCurrentPostgresSchedulerSchemaShape(
|
|
|
1986
1988
|
AND index_row.indrelid = to_regclass($3)
|
|
1987
1989
|
AND index_row.indisready AND index_row.indisvalid
|
|
1988
1990
|
)
|
|
1991
|
+
AND EXISTS (
|
|
1992
|
+
SELECT 1 FROM pg_index AS index_row
|
|
1993
|
+
JOIN pg_class AS index_class ON index_class.oid = index_row.indexrelid
|
|
1994
|
+
JOIN pg_namespace AS index_namespace ON index_namespace.oid = index_class.relnamespace
|
|
1995
|
+
WHERE index_namespace.nspname = $1
|
|
1996
|
+
AND index_class.relname = 'runtime_scheduler_outbox_run_lease_idx'
|
|
1997
|
+
AND index_row.indrelid = to_regclass($3)
|
|
1998
|
+
AND index_row.indisready AND index_row.indisvalid
|
|
1999
|
+
)
|
|
1989
2000
|
AND EXISTS (
|
|
1990
2001
|
SELECT 1 FROM pg_index AS index_row
|
|
1991
2002
|
JOIN pg_class AS index_class ON index_class.oid = index_row.indexrelid
|
|
@@ -4018,6 +4029,11 @@ export async function ensurePostgresSchedulerSchema(
|
|
|
4018
4029
|
)
|
|
4019
4030
|
WHERE delivered_at IS NULL AND ${searchLaneSql('outbox')} = true
|
|
4020
4031
|
`);
|
|
4032
|
+
await client.query(`
|
|
4033
|
+
CREATE INDEX IF NOT EXISTS runtime_scheduler_outbox_run_lease_idx
|
|
4034
|
+
ON ${tableName('outbox', options)} (run_id, lease_expires_at)
|
|
4035
|
+
WHERE delivered_at IS NULL AND lease_owner IS NOT NULL
|
|
4036
|
+
`);
|
|
4021
4037
|
await client.query(`
|
|
4022
4038
|
CREATE INDEX IF NOT EXISTS runtime_scheduler_outbox_lease_health_idx
|
|
4023
4039
|
ON ${tableName('outbox', options)}
|
|
@@ -4194,6 +4210,12 @@ const POSTGRES_SCHEDULER_RUNTIME_ADMIN_INDEXES = [
|
|
|
4194
4210
|
created_at, event_id)
|
|
4195
4211
|
WHERE delivered_at IS NULL AND ${searchLaneSql('outbox')} = true`,
|
|
4196
4212
|
},
|
|
4213
|
+
{
|
|
4214
|
+
name: 'runtime_scheduler_outbox_run_lease_idx',
|
|
4215
|
+
table: 'outbox',
|
|
4216
|
+
definition: `(run_id, lease_expires_at)
|
|
4217
|
+
WHERE delivered_at IS NULL AND lease_owner IS NOT NULL`,
|
|
4218
|
+
},
|
|
4197
4219
|
{
|
|
4198
4220
|
name: 'runtime_scheduler_outbox_lease_health_idx',
|
|
4199
4221
|
table: 'outbox',
|
|
@@ -17982,8 +18004,11 @@ function runLedgerPrecedesSql(
|
|
|
17982
18004
|
predecessor: string,
|
|
17983
18005
|
successor: string,
|
|
17984
18006
|
inclusive = false,
|
|
18007
|
+
searchOnly?: boolean,
|
|
17985
18008
|
): string {
|
|
17986
|
-
|
|
18009
|
+
const lane =
|
|
18010
|
+
searchOnly === undefined ? searchLaneSql(successor) : String(searchOnly);
|
|
18011
|
+
return `(${searchLaneSql(predecessor)} = ${lane} AND ${runLedgerPositionSql(predecessor)} ${inclusive ? '<=' : '<'} ${runLedgerPositionSql(successor)})`;
|
|
17987
18012
|
}
|
|
17988
18013
|
|
|
17989
18014
|
function searchLaneSql(alias: string): string {
|
|
@@ -18014,30 +18039,28 @@ function runLedgerTerminalPendingSql(
|
|
|
18014
18039
|
)`;
|
|
18015
18040
|
}
|
|
18016
18041
|
|
|
18017
|
-
function
|
|
18042
|
+
function runLedgerWaitingPendingSql(
|
|
18043
|
+
alias: string,
|
|
18018
18044
|
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
18019
|
-
|
|
18045
|
+
runIdSql = `${alias}.run_id`,
|
|
18020
18046
|
): string {
|
|
18021
|
-
return `SELECT
|
|
18047
|
+
return `EXISTS (SELECT 1
|
|
18022
18048
|
FROM ${tableName('outbox', options)} AS waiting_event
|
|
18023
|
-
WHERE waiting_event.
|
|
18049
|
+
WHERE waiting_event.run_id = ${runIdSql}
|
|
18050
|
+
AND waiting_event.event_type = ${RUN_EVENT_KIND_SQL_LITERAL.runWaiting}
|
|
18024
18051
|
-- Detached runner parks are transport-only and project no public wait.
|
|
18025
18052
|
AND waiting_event.payload_json->>'kind' IS DISTINCT FROM 'detached_runner'
|
|
18026
18053
|
AND waiting_event.delivered_at IS NULL
|
|
18027
18054
|
AND waiting_event.failed_at IS NULL
|
|
18028
|
-
AND coalesce(waiting_event.next_attempt_at, waiting_event.created_at) <= now()
|
|
18029
|
-
${runIdParameter ? `AND (${runIdParameter}::text IS NULL OR waiting_event.run_id = ${runIdParameter}::text)` : ''}`;
|
|
18030
|
-
}
|
|
18031
|
-
|
|
18032
|
-
function runLedgerWaitingPendingSql(alias: string): string {
|
|
18033
|
-
return `(${alias}.run_id IN (SELECT run_id FROM waiting_runs))`;
|
|
18055
|
+
AND coalesce(waiting_event.next_attempt_at, waiting_event.created_at) <= now())`;
|
|
18034
18056
|
}
|
|
18035
18057
|
|
|
18036
18058
|
function runLedgerUrgentLifecyclePendingSql(
|
|
18037
18059
|
alias: string,
|
|
18038
18060
|
options?: Pick<PostgresSchedulerOptions, 'schema'>,
|
|
18061
|
+
runIdSql?: string,
|
|
18039
18062
|
): string {
|
|
18040
|
-
return `(${runLedgerTerminalPendingSql(alias, options)} OR ${runLedgerWaitingPendingSql(alias)})`;
|
|
18063
|
+
return `(${runLedgerTerminalPendingSql(alias, options)} OR ${runLedgerWaitingPendingSql(alias, options, runIdSql)})`;
|
|
18041
18064
|
}
|
|
18042
18065
|
|
|
18043
18066
|
/**
|
|
@@ -18111,7 +18134,14 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18111
18134
|
const urgentLifecyclePendingSql = (alias: string) =>
|
|
18112
18135
|
input.searchOnly === true
|
|
18113
18136
|
? runLedgerTerminalPendingSql(alias, options)
|
|
18114
|
-
: runLedgerUrgentLifecyclePendingSql(
|
|
18137
|
+
: runLedgerUrgentLifecyclePendingSql(
|
|
18138
|
+
alias,
|
|
18139
|
+
options,
|
|
18140
|
+
// Every claimed row belongs to the selected run. An independent
|
|
18141
|
+
// wait probe evaluates once, instead of scanning its backlog for
|
|
18142
|
+
// each row whose delivery batch is being frozen.
|
|
18143
|
+
runId !== null ? '$2::text' : undefined,
|
|
18144
|
+
);
|
|
18115
18145
|
// Search is locally indexed and acknowledged; it has no remote ingress
|
|
18116
18146
|
// receipt to freeze. Preserve causal ordering/due/lease checks, but admit
|
|
18117
18147
|
// its full prefix instead of inheriting lifecycle's singleton transport.
|
|
@@ -18139,12 +18169,6 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18139
18169
|
),`
|
|
18140
18170
|
: ''
|
|
18141
18171
|
} ${
|
|
18142
|
-
input.searchOnly === true
|
|
18143
|
-
? ''
|
|
18144
|
-
: `waiting_runs AS MATERIALIZED (
|
|
18145
|
-
${runLedgerWaitingRunsSql(options, '$2')}
|
|
18146
|
-
), `
|
|
18147
|
-
}${
|
|
18148
18172
|
seekRunHead
|
|
18149
18173
|
? `pending_head AS MATERIALIZED (
|
|
18150
18174
|
SELECT pending.event_id
|
|
@@ -18207,7 +18231,7 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18207
18231
|
SELECT 1 FROM ${tableName('outbox', options)} AS active
|
|
18208
18232
|
WHERE active.run_id = candidate.run_id
|
|
18209
18233
|
AND ${pending('active')}
|
|
18210
|
-
AND ${searchLaneSql('active')} = ${
|
|
18234
|
+
AND ${searchLaneSql('active')} = ${input.searchOnly === true ? 'true' : 'false'}
|
|
18211
18235
|
AND active.lease_owner IS NOT NULL
|
|
18212
18236
|
AND active.lease_expires_at > now()
|
|
18213
18237
|
AND active.lease_owner IS DISTINCT FROM $3::text
|
|
@@ -18223,7 +18247,7 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18223
18247
|
FROM ${tableName('outbox', options)} AS predecessor
|
|
18224
18248
|
WHERE predecessor.run_id = candidate.run_id
|
|
18225
18249
|
AND ${pending('predecessor')}
|
|
18226
|
-
AND ${runLedgerPrecedesSql('predecessor', 'candidate')}
|
|
18250
|
+
AND ${runLedgerPrecedesSql('predecessor', 'candidate', false, input.searchOnly === true)}
|
|
18227
18251
|
)`
|
|
18228
18252
|
}
|
|
18229
18253
|
-- A new durable admission has no causal dependency on unrelated
|
|
@@ -18234,16 +18258,20 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18234
18258
|
-- predecessors. Giving priority only to a terminal head leaves a
|
|
18235
18259
|
-- finished run's earlier progress behind unrelated progress. The
|
|
18236
18260
|
-- predecessor checks still forbid skipping any fact within the run.
|
|
18237
|
-
|
|
18261
|
+
${
|
|
18262
|
+
runId !== null
|
|
18263
|
+
? ''
|
|
18264
|
+
: `ORDER BY
|
|
18238
18265
|
CASE
|
|
18239
18266
|
WHEN candidate.event_type = ${RUN_EVENT_KIND_SQL_LITERAL.runCreated} THEN 0
|
|
18240
18267
|
WHEN ${runLedgerTerminalPendingSql('candidate', options)} THEN 1
|
|
18241
|
-
${input.searchOnly === true ? '' : `WHEN ${runLedgerWaitingPendingSql('candidate')} THEN 2`}
|
|
18268
|
+
${input.searchOnly === true ? '' : `WHEN ${runLedgerWaitingPendingSql('candidate', options)} THEN 2`}
|
|
18242
18269
|
ELSE 3
|
|
18243
18270
|
END,
|
|
18244
18271
|
coalesce(candidate.next_attempt_at, candidate.created_at),
|
|
18245
18272
|
candidate.created_at,
|
|
18246
|
-
candidate.event_id
|
|
18273
|
+
candidate.event_id`
|
|
18274
|
+
}
|
|
18247
18275
|
FOR UPDATE SKIP LOCKED
|
|
18248
18276
|
LIMIT 1
|
|
18249
18277
|
), candidates AS MATERIALIZED (
|
|
@@ -18251,6 +18279,7 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18251
18279
|
FROM ${tableName('outbox', options)} AS outbox
|
|
18252
18280
|
JOIN head ON head.run_id = outbox.run_id
|
|
18253
18281
|
WHERE ${pending('outbox')}
|
|
18282
|
+
${runId !== null ? 'AND outbox.run_id = $2::text' : ''}
|
|
18254
18283
|
AND ${searchLaneSql('outbox')} = ${input.searchOnly === true ? 'true' : 'false'}
|
|
18255
18284
|
AND outbox.failed_at IS NULL
|
|
18256
18285
|
-- Admission is causally first and must be projected alone. A later
|
|
@@ -18302,7 +18331,7 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18302
18331
|
AND terminal_predecessor.event_type IN (
|
|
18303
18332
|
${RUN_EVENT_KIND_SQL_LITERAL.runCompleted}, ${RUN_EVENT_KIND_SQL_LITERAL.runFailed}, ${RUN_EVENT_KIND_SQL_LITERAL.runCancelled}
|
|
18304
18333
|
)
|
|
18305
|
-
AND ${runLedgerPrecedesSql('terminal_predecessor', 'outbox')}
|
|
18334
|
+
AND ${runLedgerPrecedesSql('terminal_predecessor', 'outbox', false, input.searchOnly === true)}
|
|
18306
18335
|
)
|
|
18307
18336
|
-- Claim only the contiguous due prefix. A delayed, leased, or failed
|
|
18308
18337
|
-- predecessor retains ownership of everything that follows it.
|
|
@@ -18311,7 +18340,7 @@ async function claimPostgresSchedulerOutboxPrefix(
|
|
|
18311
18340
|
FROM ${tableName('outbox', options)} AS predecessor
|
|
18312
18341
|
WHERE predecessor.run_id = outbox.run_id
|
|
18313
18342
|
AND ${pending('predecessor')}
|
|
18314
|
-
AND ${runLedgerPrecedesSql('predecessor', 'outbox')}
|
|
18343
|
+
AND ${runLedgerPrecedesSql('predecessor', 'outbox', false, input.searchOnly === true)}
|
|
18315
18344
|
AND (
|
|
18316
18345
|
(predecessor.event_type = ${RUN_SCHEDULER_OUTBOX_EVENT_TYPE_SQL_LITERAL.runEvents}
|
|
18317
18346
|
AND NOT (${ingressPrefixSql}))
|
|
@@ -20021,7 +20050,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20021
20050
|
SELECT pending.run_id,
|
|
20022
20051
|
pending.event_id,
|
|
20023
20052
|
pending.event_type,
|
|
20024
|
-
pending.payload_json,
|
|
20053
|
+
${needsLaunch ? 'pending.payload_json,' : ''}
|
|
20025
20054
|
pending.created_at,
|
|
20026
20055
|
pending.next_attempt_at,
|
|
20027
20056
|
pending.failed_at
|
|
@@ -20055,18 +20084,12 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20055
20084
|
run_id: string;
|
|
20056
20085
|
dispatch_launch_json: unknown;
|
|
20057
20086
|
}>(`
|
|
20058
|
-
WITH
|
|
20059
|
-
input.searchOnly === true
|
|
20060
|
-
? ''
|
|
20061
|
-
: `waiting_runs AS MATERIALIZED (
|
|
20062
|
-
${runLedgerWaitingRunsSql(options)}
|
|
20063
|
-
), `
|
|
20064
|
-
}heads AS MATERIALIZED (
|
|
20087
|
+
WITH heads AS MATERIALIZED (
|
|
20065
20088
|
SELECT DISTINCT ON (pending.run_id)
|
|
20066
20089
|
pending.run_id,
|
|
20067
20090
|
pending.event_id,
|
|
20068
20091
|
pending.event_type,
|
|
20069
|
-
pending.payload_json,
|
|
20092
|
+
${needsLaunch ? 'pending.payload_json,' : ''}
|
|
20070
20093
|
pending.created_at,
|
|
20071
20094
|
pending.next_attempt_at,
|
|
20072
20095
|
pending.failed_at
|
|
@@ -20098,7 +20121,7 @@ async function dispatchRunLedgerOutboxBatchWithScope(
|
|
|
20098
20121
|
: `CASE
|
|
20099
20122
|
WHEN head.event_type = ${RUN_EVENT_KIND_SQL_LITERAL.runCreated} THEN 0
|
|
20100
20123
|
WHEN ${runLedgerTerminalPendingSql('head', options)} THEN 1
|
|
20101
|
-
${input.searchOnly === true ? '' : `WHEN ${runLedgerWaitingPendingSql('head')} THEN 2`}
|
|
20124
|
+
${input.searchOnly === true ? '' : `WHEN ${runLedgerWaitingPendingSql('head', options)} THEN 2`}
|
|
20102
20125
|
ELSE 3
|
|
20103
20126
|
END,`
|
|
20104
20127
|
}
|
|
@@ -345,6 +345,7 @@ export function startRunLedgerOutboxRecovery(
|
|
|
345
345
|
const pendingObservability = new Set<symbol>();
|
|
346
346
|
const deliveries: Delivery[] = [];
|
|
347
347
|
let refill = false;
|
|
348
|
+
let observabilityRefill = false;
|
|
348
349
|
let dispatchFailed = false;
|
|
349
350
|
let completed = 0;
|
|
350
351
|
let attempted = 0;
|
|
@@ -420,11 +421,7 @@ export function startRunLedgerOutboxRecovery(
|
|
|
420
421
|
// cannot consume a notification that arrived after its query began.
|
|
421
422
|
if (canProbeObservability()) {
|
|
422
423
|
observabilityRequested = false;
|
|
423
|
-
|
|
424
|
-
pendingObservability.size < observabilityParallelism &&
|
|
425
|
-
pending.size < parallelism
|
|
426
|
-
)
|
|
427
|
-
launch(true);
|
|
424
|
+
launch(true);
|
|
428
425
|
}
|
|
429
426
|
if (canProbeLifecycle()) {
|
|
430
427
|
requested = false;
|
|
@@ -432,6 +429,14 @@ export function startRunLedgerOutboxRecovery(
|
|
|
432
429
|
}
|
|
433
430
|
// Productive completion permits immediate use of every free slot.
|
|
434
431
|
// Empty results grant no refill, so idle work cannot spin on scans.
|
|
432
|
+
if (observabilityRefill) {
|
|
433
|
+
while (
|
|
434
|
+
pendingObservability.size < observabilityParallelism &&
|
|
435
|
+
pending.size < parallelism
|
|
436
|
+
)
|
|
437
|
+
launch(true);
|
|
438
|
+
observabilityRefill = false;
|
|
439
|
+
}
|
|
435
440
|
if (refill) {
|
|
436
441
|
while (
|
|
437
442
|
pending.size < parallelism &&
|
|
@@ -477,7 +482,7 @@ export function startRunLedgerOutboxRecovery(
|
|
|
477
482
|
// Retryable rows own durable retry clocks. The SQL claim keeps their
|
|
478
483
|
// run ordered while successful slots keep unrelated runs moving.
|
|
479
484
|
if (delivery.observability) {
|
|
480
|
-
|
|
485
|
+
observabilityRefill = result.attempted > 0;
|
|
481
486
|
} else refill = result.attempted > 0;
|
|
482
487
|
}
|
|
483
488
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _chunkFJUIXWZFjs = require('./chunk-FJUIXWZF.js');
|
|
13
|
+
require('./chunk-GQXEHX5X.js');
|
|
14
|
+
require('./chunk-FSZTWQFK.js');
|
|
15
|
+
require('./chunk-XNYIZMNQ.js');
|
|
16
|
+
require('./chunk-HY2SSFRI.js');
|
|
17
|
+
require('./chunk-7P5AA3SN.js');
|
|
18
|
+
require('./chunk-OG64RBAC.js');
|
|
19
|
+
require('./chunk-COGTRVWW.js');
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkFJUIXWZFjs.EXIT_WORKSPACE_MISMATCH; exports.clearPendingClaim = _chunkFJUIXWZFjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkFJUIXWZFjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkFJUIXWZFjs.handleRegister; exports.handleStatus = _chunkFJUIXWZFjs.handleStatus; exports.handleWait = _chunkFJUIXWZFjs.handleWait; exports.readPendingAuthClaim = _chunkFJUIXWZFjs.readPendingAuthClaim; exports.registerAuthCommands = _chunkFJUIXWZFjs.registerAuthCommands; exports.reportSetupCompleted = _chunkFJUIXWZFjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkFJUIXWZFjs.resolvePendingAuthClaimForResume;
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
registerAuthCommands,
|
|
10
10
|
reportSetupCompleted,
|
|
11
11
|
resolvePendingAuthClaimForResume
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-BLMO3JMZ.mjs";
|
|
13
|
+
import "./chunk-CSH4PKPJ.mjs";
|
|
14
|
+
import "./chunk-DOI3UBGV.mjs";
|
|
15
15
|
import "./chunk-DLIRSHV6.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-HM2TSTCT.mjs";
|
|
17
17
|
import "./chunk-NXGCO4JB.mjs";
|
|
18
18
|
import "./chunk-WZYKRD7T.mjs";
|
|
19
19
|
import "./chunk-KRD6H754.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DeeplineClient,
|
|
3
3
|
iterateCursorPages
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YZ5PP6TX.mjs";
|
|
5
5
|
import "./chunk-CBVIJSHF.mjs";
|
|
6
6
|
import {
|
|
7
7
|
createTimestampedName,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
openInBrowser,
|
|
10
10
|
printCommandEnvelope,
|
|
11
11
|
shouldEmitJson
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CSH4PKPJ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
AuthError,
|
|
15
15
|
ConfigError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-DOI3UBGV.mjs";
|
|
17
17
|
import "./chunk-DLIRSHV6.mjs";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-HM2TSTCT.mjs";
|
|
19
19
|
import "./chunk-6IKARAYD.mjs";
|
|
20
20
|
import {
|
|
21
21
|
DeeplineError
|