deepline 0.3.16 → 0.3.18

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.
Files changed (27) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +7 -0
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/integrations/bettercontact-execution-policy.ts +29 -0
  4. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +45 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +19 -3
  6. package/dist/bundling-sources/shared_libs/play-runtime/bettercontact-batching.ts +726 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +45 -24
  8. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +254 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
  10. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +6 -2
  11. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +28 -3
  12. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +3 -1
  13. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +5 -2
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +344 -26
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +50 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1 -1
  17. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +378 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/runtime-reliability-policy.ts +391 -0
  19. package/dist/bundling-sources/shared_libs/play-runtime/runtime-traffic-policy.ts +125 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +21 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +36 -39
  22. package/dist/cli/index.js +265 -1
  23. package/dist/cli/index.mjs +265 -1
  24. package/dist/index.js +265 -1
  25. package/dist/index.mjs +265 -1
  26. package/dist/install-integrity.json +6 -0
  27. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -1047,7 +1047,7 @@ var SDK_RELEASE = {
1047
1047
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1048
1048
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1049
1049
  // getters keep their established compatibility behavior.
1050
- version: "0.3.16",
1050
+ version: "0.3.18",
1051
1051
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1052
1052
  contracts: {
1053
1053
  api: {
@@ -1245,8 +1245,259 @@ var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
1245
1245
  var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
1246
1246
  var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
1247
1247
 
1248
+ // ../shared_libs/play-runtime/runtime-incident-drills.ts
1249
+ var RUNTIME_TEST_FAULT_IDS = [
1250
+ "receipt_complete_write_fail",
1251
+ "receipt_fail_write_fail",
1252
+ "worker_receipt_complete_write_fail",
1253
+ "invocation_response_delivery_abort",
1254
+ "receipt_gateway_hold_ms",
1255
+ "receipt_claim_query_hold_once_ms",
1256
+ "receipt_claim_response_timeout",
1257
+ "modal_sandbox_create_resource_exhausted",
1258
+ "runtime_sheet_page_tail_hold_ms"
1259
+ ];
1260
+ var LOCAL_TOPOLOGY = ["local_daytona"];
1261
+ var LOCAL_AND_PREVIEW_TOPOLOGIES = [
1262
+ "local_daytona",
1263
+ "preview_fly",
1264
+ "preview_direct_modal"
1265
+ ];
1266
+ var MODAL_PREVIEW_TOPOLOGY = ["preview_direct_modal"];
1267
+ var RUNTIME_INCIDENT_DRILL_CATALOG = [
1268
+ {
1269
+ id: "local_worker_process_outage",
1270
+ description: "Interrupt the scheduler worker in the selected non-production runtime topology.",
1271
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1272
+ control: {
1273
+ kind: "process",
1274
+ component: "worker",
1275
+ modes: ["pause", "crash"]
1276
+ },
1277
+ expected: {
1278
+ outcome: "The same logical run stays durable through the worker outage and completes after the selected topology recovers.",
1279
+ safetyFacts: ["same_logical_run", "no_false_success"]
1280
+ },
1281
+ verification: {
1282
+ kind: "local_black_box",
1283
+ target: "local-component-outage-recovery-e2e"
1284
+ }
1285
+ },
1286
+ {
1287
+ id: "local_gateway_process_outage",
1288
+ description: "Interrupt the receipt gateway in the selected non-production runtime topology.",
1289
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1290
+ control: {
1291
+ kind: "process",
1292
+ component: "gateway",
1293
+ modes: ["pause", "crash"]
1294
+ },
1295
+ expected: {
1296
+ outcome: "In-flight work recovers only at a safe receipt boundary and the same logical run completes after the gateway recovers.",
1297
+ safetyFacts: [
1298
+ "same_logical_run",
1299
+ "no_false_success",
1300
+ "bounded_provider_execution"
1301
+ ]
1302
+ },
1303
+ verification: {
1304
+ kind: "local_black_box",
1305
+ target: "local-component-outage-recovery-e2e"
1306
+ }
1307
+ },
1308
+ {
1309
+ id: "local_runtime_process_outage",
1310
+ description: "Interrupt both runtime components in the selected non-production topology.",
1311
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1312
+ control: { kind: "process", component: "all", modes: ["pause", "crash"] },
1313
+ expected: {
1314
+ outcome: "Durable work waits through the combined outage; it never becomes a false success or creates a second logical run.",
1315
+ safetyFacts: ["same_logical_run", "no_false_success"]
1316
+ },
1317
+ verification: {
1318
+ kind: "local_black_box",
1319
+ target: "local-component-outage-recovery-e2e"
1320
+ }
1321
+ },
1322
+ {
1323
+ id: "receipt_complete_write_fail",
1324
+ description: "Fail the next durable receipt-completion write.",
1325
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1326
+ control: {
1327
+ kind: "runtime_test_fault",
1328
+ defaultValue: 1,
1329
+ valueMeaning: "occurrence"
1330
+ },
1331
+ expected: {
1332
+ outcome: "The failed run is loud, and a later bounded recovery may repeat the affected provider operation if its prior completion was not durable.",
1333
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1334
+ },
1335
+ verification: {
1336
+ kind: "local_black_box",
1337
+ target: "receipt-persist-failure-run-fatal-e2e"
1338
+ }
1339
+ },
1340
+ {
1341
+ id: "receipt_fail_write_fail",
1342
+ description: "Fail the next durable receipt-failure write.",
1343
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1344
+ control: {
1345
+ kind: "runtime_test_fault",
1346
+ defaultValue: 1,
1347
+ valueMeaning: "occurrence"
1348
+ },
1349
+ expected: {
1350
+ outcome: "The failure is loud; recovery remains bounded and may repeat an operation whose prior outcome was not durably recorded.",
1351
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1352
+ },
1353
+ verification: {
1354
+ kind: "focused_regression",
1355
+ target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
1356
+ }
1357
+ },
1358
+ {
1359
+ id: "worker_receipt_complete_write_fail",
1360
+ description: "Fail the worker-side receipt-completion write once.",
1361
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1362
+ control: {
1363
+ kind: "runtime_test_fault",
1364
+ defaultValue: 1,
1365
+ valueMeaning: "occurrence"
1366
+ },
1367
+ expected: {
1368
+ outcome: "The worker reports the persistence failure loudly; bounded recovery may repeat work whose completion was not durable.",
1369
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1370
+ },
1371
+ verification: {
1372
+ kind: "focused_regression",
1373
+ target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
1374
+ }
1375
+ },
1376
+ {
1377
+ id: "invocation_response_delivery_abort",
1378
+ description: "Abort one receipt-gateway response after invocation delivery.",
1379
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1380
+ control: {
1381
+ kind: "runtime_test_fault",
1382
+ defaultValue: 1,
1383
+ valueMeaning: "occurrence"
1384
+ },
1385
+ expected: {
1386
+ outcome: "The same logical run completes through receipt replay; recovery remains bounded if the provider outcome must be retried.",
1387
+ safetyFacts: ["same_logical_run", "bounded_provider_execution"]
1388
+ },
1389
+ verification: {
1390
+ kind: "local_black_box",
1391
+ target: "invocation-delivery-replay-e2e"
1392
+ }
1393
+ },
1394
+ {
1395
+ id: "receipt_gateway_hold_ms",
1396
+ description: "Hold one checked-out receipt-gateway scheduler client.",
1397
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1398
+ control: {
1399
+ kind: "runtime_test_fault",
1400
+ defaultValue: 500,
1401
+ valueMeaning: "milliseconds"
1402
+ },
1403
+ expected: {
1404
+ outcome: "The request is delayed inside the real gateway pool and either completes within its deadline or follows bounded transport recovery.",
1405
+ safetyFacts: ["bounded_provider_execution"]
1406
+ },
1407
+ verification: {
1408
+ kind: "local_black_box",
1409
+ target: "agent-heavy-gateway-load-e2e"
1410
+ }
1411
+ },
1412
+ {
1413
+ id: "receipt_claim_query_hold_once_ms",
1414
+ description: "Hold one physical receipt-claim query.",
1415
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1416
+ control: {
1417
+ kind: "runtime_test_fault",
1418
+ defaultValue: 500,
1419
+ valueMeaning: "milliseconds"
1420
+ },
1421
+ expected: {
1422
+ outcome: "The checked-out claim either completes or times out through bounded recovery; an ambiguous outcome may be retried within its budget.",
1423
+ safetyFacts: ["bounded_provider_execution"]
1424
+ },
1425
+ verification: {
1426
+ kind: "local_black_box",
1427
+ target: "receipt-claim-deadline-recovery-e2e"
1428
+ }
1429
+ },
1430
+ {
1431
+ id: "receipt_claim_response_timeout",
1432
+ description: "Report one fully received receipt-claim response as timed out.",
1433
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1434
+ control: {
1435
+ kind: "runtime_test_fault",
1436
+ defaultValue: 1,
1437
+ valueMeaning: "occurrence"
1438
+ },
1439
+ expected: {
1440
+ outcome: "The same logical run completes by replaying the committed receipt response or uses bounded recovery if that response is unavailable.",
1441
+ safetyFacts: ["same_logical_run", "bounded_provider_execution"]
1442
+ },
1443
+ verification: {
1444
+ kind: "local_black_box",
1445
+ target: "receipt-ambiguous-response-recovery-e2e"
1446
+ }
1447
+ },
1448
+ {
1449
+ id: "modal_sandbox_create_resource_exhausted",
1450
+ description: "Make Modal sandbox creation return RESOURCE_EXHAUSTED before user code.",
1451
+ topologies: MODAL_PREVIEW_TOPOLOGY,
1452
+ control: {
1453
+ kind: "runtime_test_fault",
1454
+ defaultValue: 1,
1455
+ valueMeaning: "occurrence"
1456
+ },
1457
+ expected: {
1458
+ outcome: "The same logical run enters bounded pre-code defer/recovery and later retries sandbox startup; no user code or provider call precedes the retry.",
1459
+ safetyFacts: [
1460
+ "same_logical_run",
1461
+ "no_user_code_before_recovery",
1462
+ "bounded_provider_execution"
1463
+ ]
1464
+ },
1465
+ verification: {
1466
+ kind: "preview_black_box",
1467
+ target: "modal-sandbox-recovery-e2e"
1468
+ }
1469
+ },
1470
+ {
1471
+ id: "runtime_sheet_page_tail_hold_ms",
1472
+ description: "Hold one runtime-sheet tail-page operation.",
1473
+ topologies: LOCAL_TOPOLOGY,
1474
+ control: {
1475
+ kind: "runtime_test_fault",
1476
+ defaultValue: 500,
1477
+ valueMeaning: "milliseconds"
1478
+ },
1479
+ expected: {
1480
+ outcome: "Page-tail work stays pending during the bounded hold, then completes without losing or duplicating rows.",
1481
+ safetyFacts: ["all_rows_settle_once"]
1482
+ },
1483
+ verification: {
1484
+ kind: "local_black_box",
1485
+ target: "page-tail-sheet-write-hold-e2e"
1486
+ }
1487
+ }
1488
+ ];
1489
+ function isRuntimeTestFaultDrill(drill) {
1490
+ return drill.control.kind === "runtime_test_fault" && RUNTIME_TEST_FAULT_IDS.some((faultId) => faultId === drill.id);
1491
+ }
1492
+ function runtimeTestFaultDrills() {
1493
+ return RUNTIME_INCIDENT_DRILL_CATALOG.filter(isRuntimeTestFaultDrill);
1494
+ }
1495
+
1248
1496
  // ../shared_libs/play-runtime/test-runtime-seams.ts
1249
1497
  var PLAY_RUNTIME_TEST_FAULT_HEADER = "x-deepline-test-fault";
1498
+ var SUPPORTED_RUNTIME_TEST_FAULTS = new Set(
1499
+ runtimeTestFaultDrills().map(({ id }) => id)
1500
+ );
1250
1501
  var MAX_RUNTIME_TEST_POLICY_MS = 10 * 6e4;
1251
1502
 
1252
1503
  // src/http.ts
@@ -3772,6 +4023,16 @@ function resolveTheirstackClientTimeoutMs(endpointId, payload) {
3772
4023
  return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
3773
4024
  }
3774
4025
 
4026
+ // ../shared_libs/integrations/bettercontact-execution-policy.ts
4027
+ var BETTERCONTACT_LAUNCHER_CLIENT_TIMEOUT_MS = 12e4;
4028
+ var BETTERCONTACT_LAUNCHER_TOOL_IDS = /* @__PURE__ */ new Set([
4029
+ "bettercontact_enrich",
4030
+ "bettercontact_bulk_enrich"
4031
+ ]);
4032
+ function usesExtendedBetterContactLauncherBudget(toolId) {
4033
+ return BETTERCONTACT_LAUNCHER_TOOL_IDS.has(toolId.trim().toLowerCase());
4034
+ }
4035
+
3775
4036
  // ../shared_libs/play-runtime/backend.ts
3776
4037
  var PLAY_RUNTIME_BACKENDS = {
3777
4038
  localProcess: "local_process",
@@ -4052,6 +4313,9 @@ function resolveToolExecuteTimeoutMs(toolId, input2) {
4052
4313
  input2
4053
4314
  );
4054
4315
  if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
4316
+ if (usesExtendedBetterContactLauncherBudget(normalized)) {
4317
+ return BETTERCONTACT_LAUNCHER_CLIENT_TIMEOUT_MS;
4318
+ }
4055
4319
  return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
4056
4320
  }
4057
4321
  var RUNS_FAILED_LOG_LIMIT = 20;
@@ -1033,7 +1033,7 @@ var SDK_RELEASE = {
1033
1033
  // 0.3.0 introduces raw-v2: complete scrubbed provider responses are
1034
1034
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1035
1035
  // getters keep their established compatibility behavior.
1036
- version: "0.3.16",
1036
+ version: "0.3.18",
1037
1037
  updateSummary: "New raw-v2 tool responses preserve complete scrubbed provider envelopes at toolResponse.rawV2, including JSON:API included resources, links, cursors, and totals. Existing toolResponse.raw and declared getters keep working unchanged.",
1038
1038
  contracts: {
1039
1039
  api: {
@@ -1231,8 +1231,259 @@ var RUNTIME_ENVIRONMENT_TOKEN_HEADER = "x-deepline-runtime-environment-token";
1231
1231
  var ABSURD_RELEASE_OVERRIDE_HEADER = "x-deepline-absurd-release";
1232
1232
  var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
1233
1233
 
1234
+ // ../shared_libs/play-runtime/runtime-incident-drills.ts
1235
+ var RUNTIME_TEST_FAULT_IDS = [
1236
+ "receipt_complete_write_fail",
1237
+ "receipt_fail_write_fail",
1238
+ "worker_receipt_complete_write_fail",
1239
+ "invocation_response_delivery_abort",
1240
+ "receipt_gateway_hold_ms",
1241
+ "receipt_claim_query_hold_once_ms",
1242
+ "receipt_claim_response_timeout",
1243
+ "modal_sandbox_create_resource_exhausted",
1244
+ "runtime_sheet_page_tail_hold_ms"
1245
+ ];
1246
+ var LOCAL_TOPOLOGY = ["local_daytona"];
1247
+ var LOCAL_AND_PREVIEW_TOPOLOGIES = [
1248
+ "local_daytona",
1249
+ "preview_fly",
1250
+ "preview_direct_modal"
1251
+ ];
1252
+ var MODAL_PREVIEW_TOPOLOGY = ["preview_direct_modal"];
1253
+ var RUNTIME_INCIDENT_DRILL_CATALOG = [
1254
+ {
1255
+ id: "local_worker_process_outage",
1256
+ description: "Interrupt the scheduler worker in the selected non-production runtime topology.",
1257
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1258
+ control: {
1259
+ kind: "process",
1260
+ component: "worker",
1261
+ modes: ["pause", "crash"]
1262
+ },
1263
+ expected: {
1264
+ outcome: "The same logical run stays durable through the worker outage and completes after the selected topology recovers.",
1265
+ safetyFacts: ["same_logical_run", "no_false_success"]
1266
+ },
1267
+ verification: {
1268
+ kind: "local_black_box",
1269
+ target: "local-component-outage-recovery-e2e"
1270
+ }
1271
+ },
1272
+ {
1273
+ id: "local_gateway_process_outage",
1274
+ description: "Interrupt the receipt gateway in the selected non-production runtime topology.",
1275
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1276
+ control: {
1277
+ kind: "process",
1278
+ component: "gateway",
1279
+ modes: ["pause", "crash"]
1280
+ },
1281
+ expected: {
1282
+ outcome: "In-flight work recovers only at a safe receipt boundary and the same logical run completes after the gateway recovers.",
1283
+ safetyFacts: [
1284
+ "same_logical_run",
1285
+ "no_false_success",
1286
+ "bounded_provider_execution"
1287
+ ]
1288
+ },
1289
+ verification: {
1290
+ kind: "local_black_box",
1291
+ target: "local-component-outage-recovery-e2e"
1292
+ }
1293
+ },
1294
+ {
1295
+ id: "local_runtime_process_outage",
1296
+ description: "Interrupt both runtime components in the selected non-production topology.",
1297
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1298
+ control: { kind: "process", component: "all", modes: ["pause", "crash"] },
1299
+ expected: {
1300
+ outcome: "Durable work waits through the combined outage; it never becomes a false success or creates a second logical run.",
1301
+ safetyFacts: ["same_logical_run", "no_false_success"]
1302
+ },
1303
+ verification: {
1304
+ kind: "local_black_box",
1305
+ target: "local-component-outage-recovery-e2e"
1306
+ }
1307
+ },
1308
+ {
1309
+ id: "receipt_complete_write_fail",
1310
+ description: "Fail the next durable receipt-completion write.",
1311
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1312
+ control: {
1313
+ kind: "runtime_test_fault",
1314
+ defaultValue: 1,
1315
+ valueMeaning: "occurrence"
1316
+ },
1317
+ expected: {
1318
+ outcome: "The failed run is loud, and a later bounded recovery may repeat the affected provider operation if its prior completion was not durable.",
1319
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1320
+ },
1321
+ verification: {
1322
+ kind: "local_black_box",
1323
+ target: "receipt-persist-failure-run-fatal-e2e"
1324
+ }
1325
+ },
1326
+ {
1327
+ id: "receipt_fail_write_fail",
1328
+ description: "Fail the next durable receipt-failure write.",
1329
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1330
+ control: {
1331
+ kind: "runtime_test_fault",
1332
+ defaultValue: 1,
1333
+ valueMeaning: "occurrence"
1334
+ },
1335
+ expected: {
1336
+ outcome: "The failure is loud; recovery remains bounded and may repeat an operation whose prior outcome was not durably recorded.",
1337
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1338
+ },
1339
+ verification: {
1340
+ kind: "focused_regression",
1341
+ target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
1342
+ }
1343
+ },
1344
+ {
1345
+ id: "worker_receipt_complete_write_fail",
1346
+ description: "Fail the worker-side receipt-completion write once.",
1347
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1348
+ control: {
1349
+ kind: "runtime_test_fault",
1350
+ defaultValue: 1,
1351
+ valueMeaning: "occurrence"
1352
+ },
1353
+ expected: {
1354
+ outcome: "The worker reports the persistence failure loudly; bounded recovery may repeat work whose completion was not durable.",
1355
+ safetyFacts: ["retry_or_explicit_recovery", "bounded_provider_execution"]
1356
+ },
1357
+ verification: {
1358
+ kind: "focused_regression",
1359
+ target: "tests/lib/plays/runtime-test-fault-registry.test.ts"
1360
+ }
1361
+ },
1362
+ {
1363
+ id: "invocation_response_delivery_abort",
1364
+ description: "Abort one receipt-gateway response after invocation delivery.",
1365
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1366
+ control: {
1367
+ kind: "runtime_test_fault",
1368
+ defaultValue: 1,
1369
+ valueMeaning: "occurrence"
1370
+ },
1371
+ expected: {
1372
+ outcome: "The same logical run completes through receipt replay; recovery remains bounded if the provider outcome must be retried.",
1373
+ safetyFacts: ["same_logical_run", "bounded_provider_execution"]
1374
+ },
1375
+ verification: {
1376
+ kind: "local_black_box",
1377
+ target: "invocation-delivery-replay-e2e"
1378
+ }
1379
+ },
1380
+ {
1381
+ id: "receipt_gateway_hold_ms",
1382
+ description: "Hold one checked-out receipt-gateway scheduler client.",
1383
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1384
+ control: {
1385
+ kind: "runtime_test_fault",
1386
+ defaultValue: 500,
1387
+ valueMeaning: "milliseconds"
1388
+ },
1389
+ expected: {
1390
+ outcome: "The request is delayed inside the real gateway pool and either completes within its deadline or follows bounded transport recovery.",
1391
+ safetyFacts: ["bounded_provider_execution"]
1392
+ },
1393
+ verification: {
1394
+ kind: "local_black_box",
1395
+ target: "agent-heavy-gateway-load-e2e"
1396
+ }
1397
+ },
1398
+ {
1399
+ id: "receipt_claim_query_hold_once_ms",
1400
+ description: "Hold one physical receipt-claim query.",
1401
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1402
+ control: {
1403
+ kind: "runtime_test_fault",
1404
+ defaultValue: 500,
1405
+ valueMeaning: "milliseconds"
1406
+ },
1407
+ expected: {
1408
+ outcome: "The checked-out claim either completes or times out through bounded recovery; an ambiguous outcome may be retried within its budget.",
1409
+ safetyFacts: ["bounded_provider_execution"]
1410
+ },
1411
+ verification: {
1412
+ kind: "local_black_box",
1413
+ target: "receipt-claim-deadline-recovery-e2e"
1414
+ }
1415
+ },
1416
+ {
1417
+ id: "receipt_claim_response_timeout",
1418
+ description: "Report one fully received receipt-claim response as timed out.",
1419
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
1420
+ control: {
1421
+ kind: "runtime_test_fault",
1422
+ defaultValue: 1,
1423
+ valueMeaning: "occurrence"
1424
+ },
1425
+ expected: {
1426
+ outcome: "The same logical run completes by replaying the committed receipt response or uses bounded recovery if that response is unavailable.",
1427
+ safetyFacts: ["same_logical_run", "bounded_provider_execution"]
1428
+ },
1429
+ verification: {
1430
+ kind: "local_black_box",
1431
+ target: "receipt-ambiguous-response-recovery-e2e"
1432
+ }
1433
+ },
1434
+ {
1435
+ id: "modal_sandbox_create_resource_exhausted",
1436
+ description: "Make Modal sandbox creation return RESOURCE_EXHAUSTED before user code.",
1437
+ topologies: MODAL_PREVIEW_TOPOLOGY,
1438
+ control: {
1439
+ kind: "runtime_test_fault",
1440
+ defaultValue: 1,
1441
+ valueMeaning: "occurrence"
1442
+ },
1443
+ expected: {
1444
+ outcome: "The same logical run enters bounded pre-code defer/recovery and later retries sandbox startup; no user code or provider call precedes the retry.",
1445
+ safetyFacts: [
1446
+ "same_logical_run",
1447
+ "no_user_code_before_recovery",
1448
+ "bounded_provider_execution"
1449
+ ]
1450
+ },
1451
+ verification: {
1452
+ kind: "preview_black_box",
1453
+ target: "modal-sandbox-recovery-e2e"
1454
+ }
1455
+ },
1456
+ {
1457
+ id: "runtime_sheet_page_tail_hold_ms",
1458
+ description: "Hold one runtime-sheet tail-page operation.",
1459
+ topologies: LOCAL_TOPOLOGY,
1460
+ control: {
1461
+ kind: "runtime_test_fault",
1462
+ defaultValue: 500,
1463
+ valueMeaning: "milliseconds"
1464
+ },
1465
+ expected: {
1466
+ outcome: "Page-tail work stays pending during the bounded hold, then completes without losing or duplicating rows.",
1467
+ safetyFacts: ["all_rows_settle_once"]
1468
+ },
1469
+ verification: {
1470
+ kind: "local_black_box",
1471
+ target: "page-tail-sheet-write-hold-e2e"
1472
+ }
1473
+ }
1474
+ ];
1475
+ function isRuntimeTestFaultDrill(drill) {
1476
+ return drill.control.kind === "runtime_test_fault" && RUNTIME_TEST_FAULT_IDS.some((faultId) => faultId === drill.id);
1477
+ }
1478
+ function runtimeTestFaultDrills() {
1479
+ return RUNTIME_INCIDENT_DRILL_CATALOG.filter(isRuntimeTestFaultDrill);
1480
+ }
1481
+
1234
1482
  // ../shared_libs/play-runtime/test-runtime-seams.ts
1235
1483
  var PLAY_RUNTIME_TEST_FAULT_HEADER = "x-deepline-test-fault";
1484
+ var SUPPORTED_RUNTIME_TEST_FAULTS = new Set(
1485
+ runtimeTestFaultDrills().map(({ id }) => id)
1486
+ );
1236
1487
  var MAX_RUNTIME_TEST_POLICY_MS = 10 * 6e4;
1237
1488
 
1238
1489
  // src/http.ts
@@ -3758,6 +4009,16 @@ function resolveTheirstackClientTimeoutMs(endpointId, payload) {
3758
4009
  return usesExtendedTheirstackJobSearchBudget(endpointId, payload) ? THEIRSTACK_SLOW_JOB_SEARCH_CLIENT_TIMEOUT_MS : null;
3759
4010
  }
3760
4011
 
4012
+ // ../shared_libs/integrations/bettercontact-execution-policy.ts
4013
+ var BETTERCONTACT_LAUNCHER_CLIENT_TIMEOUT_MS = 12e4;
4014
+ var BETTERCONTACT_LAUNCHER_TOOL_IDS = /* @__PURE__ */ new Set([
4015
+ "bettercontact_enrich",
4016
+ "bettercontact_bulk_enrich"
4017
+ ]);
4018
+ function usesExtendedBetterContactLauncherBudget(toolId) {
4019
+ return BETTERCONTACT_LAUNCHER_TOOL_IDS.has(toolId.trim().toLowerCase());
4020
+ }
4021
+
3761
4022
  // ../shared_libs/play-runtime/backend.ts
3762
4023
  var PLAY_RUNTIME_BACKENDS = {
3763
4024
  localProcess: "local_process",
@@ -4038,6 +4299,9 @@ function resolveToolExecuteTimeoutMs(toolId, input2) {
4038
4299
  input2
4039
4300
  );
4040
4301
  if (theirstackTimeoutMs !== null) return theirstackTimeoutMs;
4302
+ if (usesExtendedBetterContactLauncherBudget(normalized)) {
4303
+ return BETTERCONTACT_LAUNCHER_CLIENT_TIMEOUT_MS;
4304
+ }
4041
4305
  return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
4042
4306
  }
4043
4307
  var RUNS_FAILED_LOG_LIMIT = 20;