deepline 0.3.546 → 0.3.547
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/client-core.ts +13 -0
- package/dist/bundling-sources/sdk/src/index.ts +7 -1
- package/dist/bundling-sources/sdk/src/integrations.ts +17 -7
- package/dist/bundling-sources/sdk/src/play.ts +71 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +13 -4
- package/dist/bundling-sources/sdk/src/types.ts +33 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +7 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +19 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +17 -2
- package/dist/bundling-sources/shared_libs/play-runtime/async-operation.ts +57 -5
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +295 -52
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +10 -1
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-decision-tracker.ts +135 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-fail-open.ts +177 -0
- package/dist/bundling-sources/shared_libs/play-runtime/docflow-node-io.ts +99 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +16 -10
- package/dist/bundling-sources/shared_libs/play-runtime/fenced-call-diagnostics.ts +211 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-capacity-policy.ts +52 -14
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +21 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +68 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +11 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +48 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +6 -1
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +716 -51
- package/dist/bundling-sources/shared_libs/plays/docflow-decision-arms.ts +146 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-flow-order.ts +94 -0
- package/dist/bundling-sources/shared_libs/plays/docflow-unreached-reason.ts +10 -1
- package/dist/bundling-sources/shared_libs/plays/docflow.ts +787 -117
- package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +8 -2
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +6 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +13 -0
- package/dist/bundling-sources/shared_libs/product-notifications/billing-sales.ts +25 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +56 -0
- package/dist/cli/auth-AC5277PI.js +43 -0
- package/dist/cli/{auth-KFWG72AZ.mjs → auth-WJEY4IDX.mjs} +5 -5
- package/dist/cli/{billing-OQVOAZ4S.js → billing-IJITDDRQ.js} +96 -96
- package/dist/cli/{billing-MMZ336HO.mjs → billing-PHJUDYF3.mjs} +10 -10
- package/dist/cli/{chunk-TBWYZOSV.js → chunk-2AHY47SI.js} +3 -3
- package/dist/cli/{chunk-MXQP7CXZ.js → chunk-2HPTLBNB.js} +3 -3
- package/dist/cli/{chunk-TI6DTURF.js → chunk-4WAM6TLD.js} +7 -1
- package/dist/cli/{chunk-JARZ47OP.mjs → chunk-56MEAGWA.mjs} +2 -2
- package/dist/cli/{chunk-GYTSDSQD.mjs → chunk-5SFHPMBY.mjs} +11 -11
- package/dist/cli/{chunk-Z3UEBFIN.js → chunk-ABLTVG3J.js} +41 -41
- package/dist/cli/{chunk-LX2TC3HO.mjs → chunk-AEQ5VWZ5.mjs} +4 -4
- package/dist/cli/{chunk-MI7X6V6V.mjs → chunk-CKIRKYW7.mjs} +3 -3
- package/dist/cli/{chunk-2JHYYB3F.js → chunk-CSPHSNBW.js} +3 -3
- package/dist/cli/{chunk-IVWU7SJC.js → chunk-D6OIEH47.js} +5 -5
- package/dist/cli/{chunk-KUK7ARXA.mjs → chunk-DIUNDLSX.mjs} +2 -2
- package/dist/cli/{chunk-RO66FPTS.mjs → chunk-DJI5CLLW.mjs} +1 -1
- package/dist/cli/{chunk-LIJKRDDG.js → chunk-DZC7LMYM.js} +6 -6
- package/dist/cli/{chunk-UQJBV5PM.js → chunk-E2OIYPB4.js} +10 -10
- package/dist/cli/{chunk-JA633HRV.mjs → chunk-ECUD4QPD.mjs} +3 -3
- package/dist/cli/{chunk-VPERQ3U6.mjs → chunk-ESCVHDNY.mjs} +5 -5
- package/dist/cli/{chunk-JVOUQFHT.js → chunk-FFBXLFKV.js} +1 -1
- package/dist/cli/{chunk-3DUNNZB6.mjs → chunk-FMQXAOVE.mjs} +4 -4
- package/dist/cli/{chunk-HXIR3VQL.mjs → chunk-FZHMNK6F.mjs} +7 -1
- package/dist/cli/{chunk-PU3ZAG6V.mjs → chunk-G6KW764N.mjs} +1 -1
- package/dist/cli/{chunk-EEG46QZY.mjs → chunk-G6XTCG3J.mjs} +2 -2
- package/dist/cli/{chunk-EEJHB76U.js → chunk-GIGAYLY6.js} +12 -12
- package/dist/cli/{chunk-BLYW6FFB.js → chunk-GJA2PRHJ.js} +2 -2
- package/dist/cli/{chunk-H7Q5IDO3.js → chunk-GJOGFWX3.js} +20 -20
- package/dist/cli/{chunk-6Y5TU3R7.mjs → chunk-GPAWLXW3.mjs} +1 -1
- package/dist/cli/{chunk-5W4ENHWM.js → chunk-GZFZZQL4.js} +285 -264
- package/dist/cli/{chunk-P7A3H6G5.mjs → chunk-HARZ4AAX.mjs} +1 -1
- package/dist/cli/{chunk-MEGHIX4M.js → chunk-HFIFKP3A.js} +5 -5
- package/dist/cli/{chunk-LHE2TSV6.mjs → chunk-IGAK22XO.mjs} +1 -1
- package/dist/cli/{chunk-VTK3HGMN.mjs → chunk-IKYN6PLO.mjs} +5 -5
- package/dist/cli/{chunk-UREAIHUU.mjs → chunk-ITLZBDSR.mjs} +3 -3
- package/dist/cli/{chunk-6LG7MLJ2.js → chunk-IVFFCAV2.js} +44 -44
- package/dist/cli/{chunk-SYTWWVIQ.js → chunk-K3GMDSUX.js} +5 -5
- package/dist/cli/{chunk-WKHPLBJK.js → chunk-L5J6UJ2X.js} +15 -15
- package/dist/cli/{chunk-X5KOHDJN.mjs → chunk-L6QE2XVM.mjs} +1 -1
- package/dist/cli/{chunk-SH32HL7I.js → chunk-LMLSOHTU.js} +53 -53
- package/dist/cli/{chunk-JCWNF44W.js → chunk-MBQELFL7.js} +22 -22
- package/dist/cli/{chunk-Z7SXGOIQ.mjs → chunk-MF7PCM6C.mjs} +1 -1
- package/dist/cli/{chunk-F2VEFMU5.js → chunk-MO7TGNXB.js} +13 -13
- package/dist/cli/{chunk-7ZW67ME6.mjs → chunk-MOZEAGSR.mjs} +1 -1
- package/dist/cli/{chunk-5VNQMVCU.js → chunk-N63U5CRG.js} +26 -26
- package/dist/cli/{chunk-JCH4UNNS.js → chunk-NBYFQZ6O.js} +2 -2
- package/dist/cli/{chunk-BTFUAGHC.js → chunk-OVYXYTEP.js} +16 -16
- package/dist/cli/{chunk-J65HJCJO.mjs → chunk-PBMO36BP.mjs} +2 -2
- package/dist/cli/{chunk-F5YQXCP3.js → chunk-PVQCX6KQ.js} +50 -7
- package/dist/cli/{chunk-K2XELBPF.mjs → chunk-QLE3QKJ2.mjs} +5 -5
- package/dist/cli/{chunk-VAT2SXFF.js → chunk-QU3K3IY6.js} +12 -12
- package/dist/cli/{chunk-JYG4XZLT.js → chunk-REAFIEV5.js} +99 -99
- package/dist/cli/{chunk-5OEFXAKP.mjs → chunk-RMCCB3XY.mjs} +50 -7
- package/dist/cli/{chunk-HJR2DDJS.mjs → chunk-RXRC2COC.mjs} +2 -2
- package/dist/cli/{chunk-4AZLGNXV.js → chunk-SAJWYN4B.js} +4 -4
- package/dist/cli/{chunk-VXTTAYOT.mjs → chunk-TNJG4ZPN.mjs} +3 -3
- package/dist/cli/{chunk-PMDHY2YK.js → chunk-VNOQEDVC.js} +7 -7
- package/dist/cli/{chunk-GOOF7E2B.mjs → chunk-VPF54TXQ.mjs} +5 -5
- package/dist/cli/{chunk-2HSZCQMT.mjs → chunk-WYT3H6JD.mjs} +1 -1
- package/dist/cli/{chunk-OAKWSLKS.mjs → chunk-XMBVHJPR.mjs} +28 -7
- package/dist/cli/{chunk-7MY7KWJS.mjs → chunk-XNTDTAKC.mjs} +1 -1
- package/dist/cli/{chunk-5V7NZKGG.js → chunk-YURGAKI3.js} +2 -2
- package/dist/cli/{chunk-ND7SFRQL.js → chunk-YVKLF7RW.js} +2 -2
- package/dist/cli/{chunk-6FBDTYR2.mjs → chunk-Z2YGQZWV.mjs} +2 -2
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{concurrent-runs-help-C2O5YKQA.mjs → concurrent-runs-help-ZNGP563R.mjs} +6 -6
- package/dist/cli/concurrent-runs-help-ZYISYOQA.js +21 -0
- package/dist/cli/{csv-Z4DNGR54.mjs → csv-VAHQHYYV.mjs} +4 -4
- package/dist/cli/{csv-MJDNOIQJ.js → csv-X6D4ZELE.js} +13 -13
- package/dist/cli/{db-4RL2BNOF.mjs → db-4G4S2VOV.mjs} +7 -7
- package/dist/cli/{db-S5QVPK5E.js → db-YA5ZGVEX.js} +28 -28
- package/dist/cli/{describe-L4P5SZLQ.mjs → describe-EVXEM2S6.mjs} +19 -19
- package/dist/cli/describe-GYYSLZLV.js +50 -0
- package/dist/cli/describe-core.d.mts +4 -4
- package/dist/cli/describe-core.d.ts +4 -4
- package/dist/cli/{executions-MFZ2Z36O.js → executions-5YC7ABF6.js} +9 -9
- package/dist/cli/{executions-RR6O3XK5.mjs → executions-HR6CTN5M.mjs} +7 -7
- package/dist/cli/{feedback-EQBQ3ABB.mjs → feedback-GEU5SPLR.mjs} +6 -6
- package/dist/cli/{feedback-YDAG7VH2.js → feedback-MJHSYLFF.js} +14 -14
- package/dist/cli/git-FZIQZNI4.js +25 -0
- package/dist/cli/{git-YGLCCU35.mjs → git-NPFF6QUS.mjs} +5 -5
- package/dist/cli/index.js +146 -146
- package/dist/cli/index.mjs +45 -45
- package/dist/cli/{integrations-IQXYMRMW.js → integrations-YPHFI77G.js} +19 -17
- package/dist/cli/{integrations-FWYXSBHK.mjs → integrations-Z7EGVBHF.mjs} +11 -9
- package/dist/cli/{legacy-noops-U7LI7UXC.js → legacy-noops-246E3KKG.js} +9 -9
- package/dist/cli/{legacy-noops-I4YRIX5F.mjs → legacy-noops-5IYCFWWX.mjs} +6 -6
- package/dist/cli/{mcp-QJBMB6VS.mjs → mcp-WUYGZXPI.mjs} +4 -4
- package/dist/cli/{mcp-GX2UKKWU.js → mcp-YTYTW67G.js} +24 -24
- package/dist/cli/{monitors-Z6EGKYJP.mjs → monitors-73DQKCU7.mjs} +26 -8
- package/dist/cli/{monitors-WCJYINGX.js → monitors-SA6ILD6Z.js} +119 -101
- package/dist/cli/{org-NNHICBR2.mjs → org-WVQRB2KX.mjs} +7 -7
- package/dist/cli/{org-7SKG423N.js → org-X7ELDV7B.js} +89 -89
- package/dist/cli/{play-CXDFPJ7Z.mjs → play-QI6V2EUQ.mjs} +295 -67
- package/dist/cli/{play-4P4DTG3Q.js → play-QTYOAJPE.js} +897 -669
- package/dist/cli/{providers-VQLQ7DTR.mjs → providers-DPVMVDS4.mjs} +7 -7
- package/dist/cli/{providers-EE4TUE3O.js → providers-XXFLVREV.js} +10 -10
- package/dist/cli/{quickstart-RVXHK4WA.js → quickstart-33ISXQJU.js} +6 -6
- package/dist/cli/{quickstart-IYNJRB5G.mjs → quickstart-YWGNHULM.mjs} +4 -4
- package/dist/cli/{run-R3F34KU3.js → run-BWHZXLTD.js} +45 -45
- package/dist/cli/{run-VBQPPMEX.mjs → run-J6FCAKQC.mjs} +25 -25
- package/dist/cli/search-JCWJX2XD.js +32 -0
- package/dist/cli/{search-B7R62HX5.mjs → search-Z3UU3WBB.mjs} +8 -8
- package/dist/cli/{search-output-LNQQXIGZ.mjs → search-output-OJYY4J7E.mjs} +4 -4
- package/dist/cli/{search-output-LWHWEPOT.js → search-output-YIPV74ME.js} +6 -6
- package/dist/cli/{secrets-QBOZ7WTD.js → secrets-UXRJCEN4.js} +16 -16
- package/dist/cli/{secrets-NM3VAJLO.mjs → secrets-YZZN2WST.mjs} +7 -7
- package/dist/cli/{sessions-R5BSIJ4I.mjs → sessions-ITCGPD7Z.mjs} +6 -6
- package/dist/cli/sessions-NA4SJH6Q.js +22 -0
- package/dist/cli/{settings-POYWKNRD.js → settings-LAFYMILP.js} +86 -86
- package/dist/cli/{settings-S4PN7WLY.mjs → settings-ZP2LSVNM.mjs} +13 -13
- package/dist/cli/{setup-VHB4Z654.js → setup-4AL3XYM5.js} +49 -49
- package/dist/cli/{setup-PFLXVBTL.mjs → setup-WEQAQSYC.mjs} +9 -9
- package/dist/cli/{skills-W2TELEU7.mjs → skills-NQH4HFW2.mjs} +7 -7
- package/dist/cli/skills-XZ4Y6SZ7.js +36 -0
- package/dist/cli/{tools-M4FA6N3Y.mjs → tools-CXK2GSI4.mjs} +18 -18
- package/dist/cli/tools-WJQ6Y7E4.js +57 -0
- package/dist/cli/{update-W7LIHEA7.mjs → update-3ROF3Z75.mjs} +9 -9
- package/dist/cli/update-ZLRLTBRD.js +34 -0
- package/dist/cli/{views-KTVPV6UP.mjs → views-AOUHVGV2.mjs} +7 -7
- package/dist/cli/{views-DJXAGD7V.js → views-XJFO5CEH.js} +22 -22
- package/dist/cli/{workflow-NVZDJKH2.js → workflow-GY3DBHXX.js} +18 -18
- package/dist/cli/{workflow-LGKCRODX.mjs → workflow-KBS2QJK6.mjs} +8 -8
- package/dist/{client-Tp1LSULB.d.mts → client-D1uWA2Vc.d.mts} +1 -1
- package/dist/{client-CCyWJqAI.d.ts → client-Hz7SsBXs.d.ts} +1 -1
- package/dist/{client-core-BpYiYEfu.d.ts → client-core-D3Ad7Flt.d.ts} +554 -504
- package/dist/{client-core-D8eCZz3O.d.mts → client-core-Db_e63Hb.d.mts} +554 -504
- package/dist/{compiler-manifest-EBWEUj0b.d.ts → compiler-manifest-BqwVrOri.d.mts} +38 -18
- package/dist/{compiler-manifest-EBWEUj0b.d.mts → compiler-manifest-BqwVrOri.d.ts} +38 -18
- package/dist/{errors-CParKUQR.d.mts → errors-BU8FB99X.d.mts} +1 -1
- package/dist/{errors-Qt0OTA7_.d.ts → errors-DfVN_FUG.d.ts} +1 -1
- package/dist/{index-CoqDkIw0.d.ts → index-BGnvtYGc.d.ts} +6 -1
- package/dist/{index-BMUVCNp7.d.mts → index-DjZgwpGw.d.mts} +6 -1
- package/dist/index.d.mts +28 -8
- package/dist/index.d.ts +28 -8
- package/dist/index.js +64 -39
- package/dist/index.mjs +32 -7
- package/dist/install-integrity.json +133 -128
- 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 +620 -124
- package/dist/plays/play-description.d.mts +3 -3
- package/dist/plays/play-description.d.ts +3 -3
- 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 +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-W32GMYND.js +0 -43
- package/dist/cli/concurrent-runs-help-6QT7ZR4W.js +0 -21
- package/dist/cli/describe-VLU2LUDJ.js +0 -50
- package/dist/cli/git-E6W44F5M.js +0 -25
- package/dist/cli/search-UUVFXZRA.js +0 -32
- package/dist/cli/sessions-K3PD73Q2.js +0 -22
- package/dist/cli/skills-QNE2EYT3.js +0 -36
- package/dist/cli/tools-3RLI4HGF.js +0 -57
- package/dist/cli/update-UT6KIW2W.js +0 -34
|
@@ -26,9 +26,10 @@ export const RUNTIME_CAPACITY_POLICY = {
|
|
|
26
26
|
*/
|
|
27
27
|
maxActiveLaneMachines: 8,
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
29
|
+
* Started/pending worker budget shared by historical (draining) release
|
|
30
|
+
* lanes, counted over their own Machines. The active lane grows against
|
|
31
|
+
* maxActiveLaneMachines instead, so draining lanes cannot hold new runs at
|
|
32
|
+
* the warm floor. Existing claim owners and rollback holds are retained.
|
|
32
33
|
*/
|
|
33
34
|
maxFleetMachines: 8,
|
|
34
35
|
workerSlotsPerMachine: 8,
|
|
@@ -44,7 +45,7 @@ export const RUNTIME_CAPACITY_POLICY = {
|
|
|
44
45
|
* boots it in about 1.3 s, against about 12 s for a new Machine, which
|
|
45
46
|
* waits for its app-scoped static egress IP before it can reach the
|
|
46
47
|
* database (16% of fresh boots crashed on that wait, 2026-11-10/11).
|
|
47
|
-
* Six is the whole burst headroom (
|
|
48
|
+
* Six is the whole burst headroom (maxActiveLaneMachines - activeLaneMachines);
|
|
48
49
|
* 99% of 161 Production bursts added at most six Machines in their first
|
|
49
50
|
* minute. More could never start at once inside the fleet budget. Fly
|
|
50
51
|
* bills a stopped Machine's rootfs at $0.15 per GB-month.
|
|
@@ -169,13 +170,23 @@ export function desiredAbsurdLaneMachines(input: {
|
|
|
169
170
|
* not free budget until Fly confirms them. This function never removes workers.
|
|
170
171
|
*
|
|
171
172
|
* Restore the active warm floor first, even when that reports budget debt.
|
|
172
|
-
*
|
|
173
|
-
*
|
|
173
|
+
* Historical runnable lanes share maxFleetMachines (counted over their own
|
|
174
|
+
* Machines) in round-robin order; the active lane grows to
|
|
175
|
+
* maxActiveLaneMachines (counted over its own Machines). Neither partition can
|
|
176
|
+
* starve the other. Persist nextCursor between reconciliations so repeated
|
|
174
177
|
* single-slot openings do not always favor the first historical release.
|
|
175
178
|
*/
|
|
176
179
|
export function planAbsurdWorkerFleetGrowth(input: {
|
|
177
180
|
existingMachines: number;
|
|
181
|
+
/**
|
|
182
|
+
* Started and pending Machines on the active release lane, out of
|
|
183
|
+
* existingMachines. The active lane grows against maxActiveLaneMachines and
|
|
184
|
+
* historical lanes against maxFleetMachines, each counting only its own
|
|
185
|
+
* Machines, so neither can starve the other.
|
|
186
|
+
*/
|
|
187
|
+
activeLaneMachines: number;
|
|
178
188
|
maxFleetMachines?: number;
|
|
189
|
+
maxActiveLaneMachines?: number;
|
|
179
190
|
activeWarmFloorMissing: number;
|
|
180
191
|
demands: readonly {
|
|
181
192
|
releaseId: string;
|
|
@@ -203,6 +214,17 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
203
214
|
const maxFleetMachines = requireMachineCount(
|
|
204
215
|
input.maxFleetMachines ?? RUNTIME_CAPACITY_POLICY.absurd.maxFleetMachines,
|
|
205
216
|
);
|
|
217
|
+
const maxActiveLaneMachines = requireMachineCount(
|
|
218
|
+
input.maxActiveLaneMachines ??
|
|
219
|
+
RUNTIME_CAPACITY_POLICY.absurd.maxActiveLaneMachines,
|
|
220
|
+
);
|
|
221
|
+
const activeLaneMachines = requireMachineCount(input.activeLaneMachines);
|
|
222
|
+
if (activeLaneMachines > physicalCount) {
|
|
223
|
+
throw new Error(
|
|
224
|
+
'Active-lane Machines cannot exceed the physical worker fleet.',
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
const historicalPhysicalCount = physicalCount - activeLaneMachines;
|
|
206
228
|
const warmFloorMissing = requireMachineCount(input.activeWarmFloorMissing);
|
|
207
229
|
const cursor = input.cursor ?? '';
|
|
208
230
|
if (typeof cursor !== 'string') {
|
|
@@ -259,10 +281,10 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
259
281
|
activeLane?.remaining ?? 0,
|
|
260
282
|
);
|
|
261
283
|
for (let seat = 0; seat < warmFloorGrowth; seat += 1) grant(activeLane!);
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
);
|
|
284
|
+
// Historical lanes share maxFleetMachines, counted over their own Machines.
|
|
285
|
+
// On 2026-11-18 one shared budget let nine draining lanes (18 Machines) hold
|
|
286
|
+
// the active lane at its 2-Machine warm floor, and new runs queued 6-12 s.
|
|
287
|
+
let available = Math.max(0, maxFleetMachines - historicalPhysicalCount);
|
|
266
288
|
const historical = lanes
|
|
267
289
|
.filter((lane) => !lane.demand.active && lane.remaining > 0)
|
|
268
290
|
.sort((a, b) =>
|
|
@@ -294,27 +316,43 @@ export function planAbsurdWorkerFleetGrowth(input: {
|
|
|
294
316
|
}
|
|
295
317
|
index = (index + 1) % historical.length;
|
|
296
318
|
}
|
|
297
|
-
|
|
319
|
+
// The active lane grows against its own cap, after its warm floor.
|
|
320
|
+
let activeAvailable = Math.max(
|
|
321
|
+
0,
|
|
322
|
+
maxActiveLaneMachines - activeLaneMachines - warmFloorGrowth,
|
|
323
|
+
);
|
|
324
|
+
while (activeAvailable > 0 && activeLane && activeLane.remaining > 0) {
|
|
298
325
|
grant(activeLane);
|
|
299
|
-
|
|
326
|
+
activeAvailable -= 1;
|
|
300
327
|
}
|
|
301
328
|
let allocatedCount = 0;
|
|
329
|
+
let activeAllocated = 0;
|
|
302
330
|
let deferredCount = 0;
|
|
303
331
|
const allocations = lanes.map((lane) => {
|
|
304
|
-
|
|
332
|
+
const laneAllocated =
|
|
305
333
|
lane.allocation.startMachineIds.length + lane.allocation.createCount;
|
|
334
|
+
allocatedCount += laneAllocated;
|
|
335
|
+
if (lane.demand.active) activeAllocated += laneAllocated;
|
|
306
336
|
deferredCount += lane.remaining;
|
|
307
337
|
return { ...lane.allocation, deferredCount: lane.remaining };
|
|
308
338
|
});
|
|
309
339
|
const projectedPhysicalCount = requireMachineCount(
|
|
310
340
|
physicalCount + allocatedCount,
|
|
311
341
|
);
|
|
342
|
+
const historicalAllocated = allocatedCount - activeAllocated;
|
|
312
343
|
return {
|
|
313
344
|
allocations,
|
|
314
345
|
nextCursor,
|
|
315
346
|
physicalCount,
|
|
316
347
|
projectedPhysicalCount,
|
|
317
|
-
|
|
348
|
+
// Debt is reported per partition; the warm floor may exceed the active
|
|
349
|
+
// cap only when protected capacity already fills it.
|
|
350
|
+
budgetDebt:
|
|
351
|
+
Math.max(
|
|
352
|
+
0,
|
|
353
|
+
historicalPhysicalCount + historicalAllocated - maxFleetMachines,
|
|
354
|
+
) +
|
|
355
|
+
Math.max(0, activeLaneMachines + activeAllocated - maxActiveLaneMachines),
|
|
318
356
|
deferredCount,
|
|
319
357
|
warmFloorGrowth,
|
|
320
358
|
maxFleetMachines,
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts
CHANGED
|
@@ -776,10 +776,23 @@ function isTransientHeartbeatTimeout(error: unknown): boolean {
|
|
|
776
776
|
);
|
|
777
777
|
}
|
|
778
778
|
|
|
779
|
-
function capacityDeferralSeconds(
|
|
779
|
+
export function capacityDeferralSeconds(
|
|
780
|
+
error: unknown,
|
|
781
|
+
runId: string,
|
|
782
|
+
generation?: number,
|
|
783
|
+
): number {
|
|
780
784
|
if (!isRuntimeSchedulerCapacityError(error)) return 5;
|
|
785
|
+
// A run repeatedly rejected at the workspace cap does not need to claim
|
|
786
|
+
// another generation every 15 seconds. Preserve short retries on young
|
|
787
|
+
// runs and use the existing durable task defer for older generations.
|
|
788
|
+
const workspaceCapFloorSeconds =
|
|
789
|
+
error instanceof RuntimeSandboxCapacityLimitError &&
|
|
790
|
+
generation !== undefined &&
|
|
791
|
+
generation >= 5
|
|
792
|
+
? 60
|
|
793
|
+
: 1;
|
|
781
794
|
const baseSeconds = Math.max(
|
|
782
|
-
|
|
795
|
+
workspaceCapFloorSeconds,
|
|
783
796
|
Math.ceil(runtimeSchedulerCapacityRetryAfterMs(error) / 1_000),
|
|
784
797
|
);
|
|
785
798
|
// Keep a saturated fleet from waking every parked run in the same second.
|
|
@@ -4121,6 +4134,12 @@ async function executeAbsurdAttemptAdapter(
|
|
|
4121
4134
|
options,
|
|
4122
4135
|
),
|
|
4123
4136
|
);
|
|
4137
|
+
if (error instanceof RuntimeSandboxCapacityLimitError) {
|
|
4138
|
+
throw new DeferTask(
|
|
4139
|
+
error.message,
|
|
4140
|
+
capacityDeferralSeconds(error, runId, generation),
|
|
4141
|
+
);
|
|
4142
|
+
}
|
|
4124
4143
|
throw error;
|
|
4125
4144
|
}
|
|
4126
4145
|
await salvageAbsurdFinalAttemptTerminal({
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts
CHANGED
|
@@ -1191,6 +1191,14 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1191
1191
|
return;
|
|
1192
1192
|
}
|
|
1193
1193
|
if (event.type === 'docflow.node.completed') {
|
|
1194
|
+
// A decision's completion is re-emitted carrying the arm it took; a
|
|
1195
|
+
// repeat of the same invocation without it must not erase that arm.
|
|
1196
|
+
const decision =
|
|
1197
|
+
event.decision ??
|
|
1198
|
+
(current?.nodeIo?.attempt === event.attempt &&
|
|
1199
|
+
current.nodeIo.invocationId === event.invocationId
|
|
1200
|
+
? current.nodeIo.decision
|
|
1201
|
+
: undefined);
|
|
1194
1202
|
setNodeProgress(event.nodeId, {
|
|
1195
1203
|
startedAt: current?.startedAt ?? event.at,
|
|
1196
1204
|
completedAt: event.at,
|
|
@@ -1202,6 +1210,7 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1202
1210
|
outputs: event.outputs,
|
|
1203
1211
|
...(event.outputsTruncated ? { outputsTruncated: true } : {}),
|
|
1204
1212
|
error: null,
|
|
1213
|
+
...(decision ? { decision } : {}),
|
|
1205
1214
|
},
|
|
1206
1215
|
});
|
|
1207
1216
|
scheduleFlush(true);
|
|
@@ -1560,6 +1569,14 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1560
1569
|
continue;
|
|
1561
1570
|
}
|
|
1562
1571
|
const at = observation.settledAt ?? observation.startedAt ?? Date.now();
|
|
1572
|
+
// Durable observations carry no decision arm; the live completion that
|
|
1573
|
+
// recorded one for this same invocation keeps it.
|
|
1574
|
+
const decision =
|
|
1575
|
+
observation.status === 'completed' &&
|
|
1576
|
+
current?.nodeIo?.attempt === observation.attempt &&
|
|
1577
|
+
current.nodeIo.invocationId === (observation.invocationId ?? undefined)
|
|
1578
|
+
? current.nodeIo.decision
|
|
1579
|
+
: undefined;
|
|
1563
1580
|
setNodeProgress(nodeId, {
|
|
1564
1581
|
startedAt: current?.startedAt ?? observation.startedAt ?? at,
|
|
1565
1582
|
...(observation.status === 'started' ? {} : { completedAt: at }),
|
|
@@ -1581,6 +1598,7 @@ export function createPostgresSchedulerProgressReporter(input: {
|
|
|
1581
1598
|
: observation.status === 'completed'
|
|
1582
1599
|
? { error: null }
|
|
1583
1600
|
: {}),
|
|
1601
|
+
...(decision ? { decision } : {}),
|
|
1584
1602
|
},
|
|
1585
1603
|
});
|
|
1586
1604
|
}
|
|
@@ -19815,6 +19815,74 @@ export async function getPostgresSchedulerObservationsForRuns(
|
|
|
19815
19815
|
return result.rows.map(mapObservationRow);
|
|
19816
19816
|
}
|
|
19817
19817
|
|
|
19818
|
+
/**
|
|
19819
|
+
* The newest settled observation of EVERY node for a bounded page of runs, in
|
|
19820
|
+
* one org-scoped read over the observations primary key — what a runs grid's
|
|
19821
|
+
* per-step columns summarize. Same winner rule as the one-node read: highest
|
|
19822
|
+
* attempt, then latest invocation.
|
|
19823
|
+
*/
|
|
19824
|
+
export async function getPostgresSchedulerSettledObservationsForRuns(
|
|
19825
|
+
client: PostgresSchedulerQueryClient,
|
|
19826
|
+
input: { runIds: readonly string[] },
|
|
19827
|
+
options: PostgresSchedulerReceiptOptions,
|
|
19828
|
+
): Promise<DocflowObservationRecord[]> {
|
|
19829
|
+
const runIds = [
|
|
19830
|
+
...new Set(input.runIds.map((runId) => runId.trim()).filter(Boolean)),
|
|
19831
|
+
];
|
|
19832
|
+
if (runIds.length === 0) return [];
|
|
19833
|
+
const result = await client.query<ObservationRow>(
|
|
19834
|
+
`
|
|
19835
|
+
SELECT DISTINCT ON (run_id, node_id)
|
|
19836
|
+
run_id, attempt, node_id, invocation_seq, invocation_id, status,
|
|
19837
|
+
inputs_json, outputs_json, inputs_truncated, outputs_truncated,
|
|
19838
|
+
error, started_at, settled_at
|
|
19839
|
+
FROM ${tableName('observations', options)}
|
|
19840
|
+
WHERE org_id = $1
|
|
19841
|
+
AND run_id = ANY($2::text[])
|
|
19842
|
+
AND status IN ('completed', 'failed')
|
|
19843
|
+
ORDER BY run_id, node_id, attempt DESC, invocation_seq DESC
|
|
19844
|
+
`,
|
|
19845
|
+
[receiptOrgId(options), runIds],
|
|
19846
|
+
);
|
|
19847
|
+
return result.rows.map(mapObservationRow);
|
|
19848
|
+
}
|
|
19849
|
+
|
|
19850
|
+
/**
|
|
19851
|
+
* The diagram each run of a bounded page pinned at launch: the `docflow` of
|
|
19852
|
+
* the static pipeline frozen into its contract snapshot. A run's steps are
|
|
19853
|
+
* read against the diagram it ran with, not the Play's current one, so an
|
|
19854
|
+
* edited diagram never relabels or drops an old run's recorded steps. Read
|
|
19855
|
+
* through the runs primary key, org-scoped; the JSON path is extracted in the
|
|
19856
|
+
* database so the rest of the launch never leaves it. Runs without a pinned
|
|
19857
|
+
* diagram are absent.
|
|
19858
|
+
*/
|
|
19859
|
+
export async function getPostgresSchedulerPinnedDocflowsForRuns(
|
|
19860
|
+
client: PostgresSchedulerQueryClient,
|
|
19861
|
+
input: { runIds: readonly string[] },
|
|
19862
|
+
options: PostgresSchedulerReceiptOptions,
|
|
19863
|
+
): Promise<Map<string, unknown>> {
|
|
19864
|
+
const runIds = [
|
|
19865
|
+
...new Set(input.runIds.map((runId) => runId.trim()).filter(Boolean)),
|
|
19866
|
+
];
|
|
19867
|
+
if (runIds.length === 0) return new Map();
|
|
19868
|
+
const result = await client.query<{ run_id: string; docflow: unknown }>(
|
|
19869
|
+
`
|
|
19870
|
+
SELECT run_id,
|
|
19871
|
+
launch_json #> '{contractSnapshot,staticPipeline,docflow}' AS docflow
|
|
19872
|
+
FROM ${tableName('runs', options)}
|
|
19873
|
+
WHERE org_id = $1
|
|
19874
|
+
AND run_id = ANY($2::text[])
|
|
19875
|
+
`,
|
|
19876
|
+
[receiptOrgId(options), runIds],
|
|
19877
|
+
);
|
|
19878
|
+
const docflows = new Map<string, unknown>();
|
|
19879
|
+
for (const row of result.rows) {
|
|
19880
|
+
if (row.docflow && typeof row.docflow === 'object')
|
|
19881
|
+
docflows.set(row.run_id, row.docflow);
|
|
19882
|
+
}
|
|
19883
|
+
return docflows;
|
|
19884
|
+
}
|
|
19885
|
+
|
|
19818
19886
|
export async function countPostgresSchedulerReceipts(
|
|
19819
19887
|
client: PostgresSchedulerQueryClient,
|
|
19820
19888
|
input: {
|
|
@@ -310,8 +310,11 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
310
310
|
/** Resume the one unresolved Daytona create for this run, if present. */
|
|
311
311
|
resumePendingDaytonaOperation?: boolean;
|
|
312
312
|
/**
|
|
313
|
-
* The `play.concurrent_runs` entitlement the launch carries.
|
|
314
|
-
*
|
|
313
|
+
* The `play.concurrent_runs` entitlement the launch carries. Any unexpired
|
|
314
|
+
* time-limited row in the mirrored org limit cache wins, raising or
|
|
315
|
+
* lowering the limit, so an operator can resize an org's already-queued
|
|
316
|
+
* runs; otherwise this, then the mirrored cap, then the runtime default.
|
|
317
|
+
* A permanent mirrored row never outranks the launch.
|
|
315
318
|
*/
|
|
316
319
|
entitlementLimit?: number | null;
|
|
317
320
|
},
|
|
@@ -392,7 +395,12 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
392
395
|
`
|
|
393
396
|
WITH observed AS MATERIALIZED (
|
|
394
397
|
SELECT
|
|
395
|
-
coalesce(
|
|
398
|
+
coalesce((
|
|
399
|
+
SELECT override."limit" FROM ${cache} AS override
|
|
400
|
+
WHERE override.org_id = $1
|
|
401
|
+
AND override.expires_at IS NOT NULL
|
|
402
|
+
AND override.expires_at > clock_timestamp()
|
|
403
|
+
), $14::integer, capacity.configured_limit) AS "limit",
|
|
396
404
|
capacity.active_leases,
|
|
397
405
|
coalesce((
|
|
398
406
|
SELECT jsonb_agg(pending)
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
isQueryResultDatasetReadRequest,
|
|
5
5
|
} from './query-result-dataset';
|
|
6
6
|
|
|
7
|
+
const WORKSPACE_CALENDAR_LIST_ALIAS =
|
|
8
|
+
'events.google-calendar.calendars.list-workspace';
|
|
9
|
+
|
|
7
10
|
const ALWAYS_FRESH_INTEGRATION_TOOL_IDS = new Set([
|
|
8
11
|
'google_workspace_request',
|
|
9
12
|
'google_workspace_export_dataset',
|
|
@@ -12,6 +15,8 @@ const ALWAYS_FRESH_INTEGRATION_TOOL_IDS = new Set([
|
|
|
12
15
|
// Google sharing and the current credential must be checked on every call.
|
|
13
16
|
'google_calendar_availability_get_free_busy',
|
|
14
17
|
'google_calendar_availability_get_workspace_free_busy',
|
|
18
|
+
'google_calendar_availability_list_workspace_calendars',
|
|
19
|
+
WORKSPACE_CALENDAR_LIST_ALIAS,
|
|
15
20
|
'google_calendar_availability_query_free_busy',
|
|
16
21
|
'google_calendar_availability_get_booking_event',
|
|
17
22
|
'google_calendar_availability_insert_event',
|
|
@@ -33,6 +38,8 @@ const ALWAYS_FRESH_INTEGRATION_READ_TOOL_IDS = new Set([
|
|
|
33
38
|
'google_workspace_request',
|
|
34
39
|
'google_calendar_availability_get_free_busy',
|
|
35
40
|
'google_calendar_availability_get_workspace_free_busy',
|
|
41
|
+
'google_calendar_availability_list_workspace_calendars',
|
|
42
|
+
WORKSPACE_CALENDAR_LIST_ALIAS,
|
|
36
43
|
'google_calendar_availability_query_free_busy',
|
|
37
44
|
'google_calendar_availability_get_booking_event',
|
|
38
45
|
]);
|
|
@@ -175,7 +182,8 @@ export function reusableWindowEligibility(
|
|
|
175
182
|
return refuse(
|
|
176
183
|
'workspace',
|
|
177
184
|
toolId,
|
|
178
|
-
toolId.startsWith('google_calendar_availability_')
|
|
185
|
+
toolId.startsWith('google_calendar_availability_') ||
|
|
186
|
+
toolId === WORKSPACE_CALENDAR_LIST_ALIAS
|
|
179
187
|
? 'checks current calendar access on every call'
|
|
180
188
|
: 'works on a live Google Workspace file whose edits and conflict checks must be seen each run',
|
|
181
189
|
);
|
|
@@ -2030,6 +2030,54 @@ export function createToolExecuteResult<TResult = unknown>(input: {
|
|
|
2030
2030
|
return wrapper;
|
|
2031
2031
|
}
|
|
2032
2032
|
|
|
2033
|
+
const DOCFLOW_TOOL_RESULT_PREVIEW_FIELDS = 16;
|
|
2034
|
+
|
|
2035
|
+
/**
|
|
2036
|
+
* A plain-data view of a tool result for diagram node previews, which never
|
|
2037
|
+
* invoke getters on authored values. A tool result is runtime-owned: its
|
|
2038
|
+
* fields read the provider response through runtime accessors, so this view
|
|
2039
|
+
* resolves them here, bounded and fail-safe.
|
|
2040
|
+
*
|
|
2041
|
+
* Enumerable keys are the tool's declared outputs, in declared order (so every
|
|
2042
|
+
* run of a node previews the same fields in the same order), each resolved
|
|
2043
|
+
* through `result.field(name)`. `fields` (the catalog tree, as plain data) and
|
|
2044
|
+
* `status` stay readable by an `out:` path without crowding the preview. A
|
|
2045
|
+
* result with no declared outputs, and any other value, is returned unchanged.
|
|
2046
|
+
*/
|
|
2047
|
+
export function docflowToolResultPreviewProjection(value: unknown): unknown {
|
|
2048
|
+
let outputs: string[];
|
|
2049
|
+
try {
|
|
2050
|
+
if (!isToolExecuteResult(value)) return value;
|
|
2051
|
+
const extractors = (value._metadata as { extractors?: unknown })
|
|
2052
|
+
.extractors;
|
|
2053
|
+
outputs = isRecord(extractors) ? Object.keys(extractors) : [];
|
|
2054
|
+
} catch {
|
|
2055
|
+
return value;
|
|
2056
|
+
}
|
|
2057
|
+
if (outputs.length === 0) return value;
|
|
2058
|
+
const projection: Record<string, unknown> = {};
|
|
2059
|
+
for (const name of outputs.slice(0, DOCFLOW_TOOL_RESULT_PREVIEW_FIELDS)) {
|
|
2060
|
+
try {
|
|
2061
|
+
projection[name] = (value as { field(name: string): unknown }).field(
|
|
2062
|
+
name,
|
|
2063
|
+
);
|
|
2064
|
+
} catch {
|
|
2065
|
+
// An ambiguous or unreadable field is left out of the preview.
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
let tree: unknown = null;
|
|
2069
|
+
try {
|
|
2070
|
+
tree = JSON.parse(JSON.stringify(value.fields ?? {}) ?? 'null');
|
|
2071
|
+
} catch {
|
|
2072
|
+
tree = null;
|
|
2073
|
+
}
|
|
2074
|
+
Object.defineProperties(projection, {
|
|
2075
|
+
fields: { value: tree, enumerable: false },
|
|
2076
|
+
status: { value: value.status, enumerable: false },
|
|
2077
|
+
});
|
|
2078
|
+
return projection;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2033
2081
|
export function isToolExecuteResult(
|
|
2034
2082
|
value: unknown,
|
|
2035
2083
|
): value is ToolExecuteResult {
|
|
@@ -234,6 +234,10 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
|
|
|
234
234
|
'docflow_binding_drift',
|
|
235
235
|
'docflow_branch_labels_required',
|
|
236
236
|
'docflow_branch_requires_decision',
|
|
237
|
+
'docflow_decision_arms_incomplete',
|
|
238
|
+
'docflow_decision_outside_region',
|
|
239
|
+
'docflow_region_exits_unlabeled',
|
|
240
|
+
'docflow_show_undeclared',
|
|
237
241
|
'docflow_direction_not_top_down',
|
|
238
242
|
'docflow_directive_ignored',
|
|
239
243
|
'docflow_dataset_unrepresented',
|
|
@@ -245,7 +249,8 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
|
|
|
245
249
|
'play_dataset_column_order_unknown',
|
|
246
250
|
'docflow_layout_complexity',
|
|
247
251
|
'docflow_topology_invalid',
|
|
248
|
-
'
|
|
252
|
+
'docflow_io_missing',
|
|
253
|
+
'docflow_box_is_sketch',
|
|
249
254
|
'docflow_input_not_found',
|
|
250
255
|
'docflow_output_not_found',
|
|
251
256
|
'docflow_label_counts_rows',
|