deepline 0.3.543 → 0.3.544

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 (154) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +6 -0
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +3 -1
  4. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
  5. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +29 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +2 -1
  7. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +3 -0
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +3 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
  10. package/dist/cli/auth-ENBXAKQS.js +43 -0
  11. package/dist/cli/{auth-ITAELTOA.mjs → auth-IMWJAHPU.mjs} +5 -5
  12. package/dist/cli/{billing-33XVFDUJ.js → billing-Y55PR2PV.js} +92 -92
  13. package/dist/cli/{billing-WZ7RVZW4.mjs → billing-YQMW3QJI.mjs} +8 -8
  14. package/dist/cli/{chunk-F6VSQ5LN.js → chunk-22OBDYHP.js} +12 -12
  15. package/dist/cli/{chunk-23D224GI.js → chunk-3I26HMJ7.js} +9 -9
  16. package/dist/cli/{chunk-274WKLSY.mjs → chunk-3JDA23NN.mjs} +2 -2
  17. package/dist/cli/{chunk-TBCNL2T5.js → chunk-3KGMM4KS.js} +1 -1
  18. package/dist/cli/{chunk-HKJ26NRN.mjs → chunk-456RRXAP.mjs} +5 -5
  19. package/dist/cli/{chunk-2KTGZKRE.js → chunk-4PKHFW56.js} +15 -15
  20. package/dist/cli/{chunk-XFPVFWZR.mjs → chunk-57G4NYOL.mjs} +1 -1
  21. package/dist/cli/{chunk-XBM3KABD.mjs → chunk-5PR4VLLL.mjs} +2 -2
  22. package/dist/cli/{chunk-NLENABRU.js → chunk-7GNZEOTH.js} +6 -6
  23. package/dist/cli/{chunk-C35NLLSA.js → chunk-7HMMTSDA.js} +5 -5
  24. package/dist/cli/{chunk-NR3O56FT.mjs → chunk-BEQ7RQLT.mjs} +5 -5
  25. package/dist/cli/{chunk-BGAUADV4.js → chunk-C4P2KLWT.js} +41 -41
  26. package/dist/cli/{chunk-MCBUWK5K.js → chunk-COJHT2KF.js} +22 -22
  27. package/dist/cli/{chunk-3JZXU5OB.js → chunk-DF2X7GJG.js} +5 -5
  28. package/dist/cli/{chunk-DH43ECTN.mjs → chunk-DVDWAC2M.mjs} +2 -2
  29. package/dist/cli/{chunk-2NCJQEZH.js → chunk-DYDHLBSK.js} +53 -53
  30. package/dist/cli/{chunk-GRCFX2EG.js → chunk-G26VJCNT.js} +4 -4
  31. package/dist/cli/{chunk-J2F6F5GL.js → chunk-GQHRGBHV.js} +5 -5
  32. package/dist/cli/{chunk-4SKDSSPU.mjs → chunk-GV45TTI6.mjs} +2 -2
  33. package/dist/cli/{chunk-W2OPPSAZ.mjs → chunk-H4SAHB3Q.mjs} +3 -3
  34. package/dist/cli/{chunk-52YK3EII.mjs → chunk-HAQRF6DJ.mjs} +2 -2
  35. package/dist/cli/{chunk-SYOPHFKB.mjs → chunk-HBSWATOU.mjs} +5 -5
  36. package/dist/cli/{chunk-FNW2SGPD.mjs → chunk-HVJQF5BI.mjs} +2 -2
  37. package/dist/cli/{chunk-R57UCXQG.mjs → chunk-HXM2JUGD.mjs} +1 -1
  38. package/dist/cli/{chunk-STXG2LFC.js → chunk-IFIJ4DBJ.js} +2 -2
  39. package/dist/cli/{chunk-5MN3BKNB.js → chunk-JBWOE6AP.js} +16 -16
  40. package/dist/cli/{chunk-2LNTKICO.js → chunk-JWVG7ZPX.js} +3 -3
  41. package/dist/cli/{chunk-O2KLWUNI.js → chunk-KE6CSCUF.js} +44 -44
  42. package/dist/cli/{chunk-OELJKQOL.mjs → chunk-LPUBBUKX.mjs} +2 -2
  43. package/dist/cli/{chunk-XSN6BAZT.mjs → chunk-LQ6RRYXN.mjs} +5 -5
  44. package/dist/cli/{chunk-5VIPTLRX.mjs → chunk-LW274RO7.mjs} +1 -1
  45. package/dist/cli/{chunk-QFRMVI4S.js → chunk-ON56ISO6.js} +3 -3
  46. package/dist/cli/{chunk-46BEBZ3M.js → chunk-PDJ4UDCO.js} +29 -28
  47. package/dist/cli/{chunk-ZRT2PNYY.mjs → chunk-PFGOCUH3.mjs} +1 -1
  48. package/dist/cli/{chunk-NHKP2NSU.js → chunk-PKRW76XG.js} +2 -2
  49. package/dist/cli/{chunk-6SJZMMD5.mjs → chunk-PMW5YP72.mjs} +11 -11
  50. package/dist/cli/{chunk-D6YAU3CF.mjs → chunk-Q7ZOWNKR.mjs} +2 -1
  51. package/dist/cli/{chunk-SZNJENGT.mjs → chunk-REEOMNCO.mjs} +3 -3
  52. package/dist/cli/{chunk-YJYKZ2U3.js → chunk-RG34YBDE.js} +2 -2
  53. package/dist/cli/{chunk-ZSPBJB7I.mjs → chunk-RJPDCSTD.mjs} +4 -4
  54. package/dist/cli/{chunk-YE3T73BV.js → chunk-RUFR4PUO.js} +10 -10
  55. package/dist/cli/{chunk-AACKPOGA.mjs → chunk-SK3HPU2J.mjs} +1 -1
  56. package/dist/cli/{chunk-OAFKUHN5.mjs → chunk-SKS53WM6.mjs} +4 -4
  57. package/dist/cli/{chunk-EHUG6EUT.js → chunk-UHIAQPVA.js} +26 -26
  58. package/dist/cli/{chunk-DUGTPVT7.js → chunk-UNMNGRPB.js} +7 -7
  59. package/dist/cli/{chunk-DI3GL3T6.js → chunk-W7X4KH45.js} +99 -99
  60. package/dist/cli/{chunk-7AUQTNLB.mjs → chunk-WBSGPLH5.mjs} +2 -2
  61. package/dist/cli/{chunk-SU4K4SUU.mjs → chunk-WUEORIOY.mjs} +1 -1
  62. package/dist/cli/{chunk-VSJEOSYL.mjs → chunk-YIRVKMON.mjs} +1 -1
  63. package/dist/cli/{chunk-UJ6GOV7K.js → chunk-Z44YTSTA.js} +13 -13
  64. package/dist/cli/{chunk-JXG7HWBA.mjs → chunk-ZHY4T5M6.mjs} +1 -1
  65. package/dist/cli/{chunk-PX7XAVUC.js → chunk-ZY6FL4O4.js} +19 -19
  66. package/dist/cli/{concurrent-runs-help-Z6ODNL4E.mjs → concurrent-runs-help-KBWPKSTP.mjs} +6 -6
  67. package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
  68. package/dist/cli/{csv-5QW2HPHT.mjs → csv-M5EBEMZH.mjs} +4 -4
  69. package/dist/cli/{csv-SSOFTXHU.js → csv-XGGDZTQI.js} +13 -13
  70. package/dist/cli/{db-4LK5AJNO.js → db-CVPR54XK.js} +27 -27
  71. package/dist/cli/{db-K2JMR6EM.mjs → db-M6FJ6J6E.mjs} +6 -6
  72. package/dist/cli/describe-RUODIS6M.js +50 -0
  73. package/dist/cli/{describe-AXHQZHTT.mjs → describe-X6QA2U3C.mjs} +18 -18
  74. package/dist/cli/describe-core.d.mts +2 -2
  75. package/dist/cli/describe-core.d.ts +2 -2
  76. package/dist/cli/{executions-FY2XTX2W.mjs → executions-EHTS2XJX.mjs} +6 -6
  77. package/dist/cli/{executions-AATJQQAQ.js → executions-VJEEWN22.js} +8 -8
  78. package/dist/cli/{feedback-MKBPRGS6.mjs → feedback-76VGY4GP.mjs} +6 -6
  79. package/dist/cli/{feedback-QPVJER75.js → feedback-DQPUCUXO.js} +14 -14
  80. package/dist/cli/{git-AGRFZR3K.mjs → git-IY6DKKLR.mjs} +5 -5
  81. package/dist/cli/git-RLHTSYRY.js +25 -0
  82. package/dist/cli/index.js +142 -142
  83. package/dist/cli/index.mjs +44 -44
  84. package/dist/cli/{integrations-OUQ6U33M.mjs → integrations-242LE3TQ.mjs} +7 -7
  85. package/dist/cli/{integrations-R6OUFZXI.js → integrations-CQSTIKFY.js} +15 -15
  86. package/dist/cli/{legacy-noops-DVL2RRKL.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
  87. package/dist/cli/{legacy-noops-H7INM2QN.js → legacy-noops-U72DO6ZF.js} +9 -9
  88. package/dist/cli/{mcp-2Z2YVOLK.mjs → mcp-JJH6JR52.mjs} +4 -4
  89. package/dist/cli/{mcp-33F7D7WI.js → mcp-L473BKLJ.js} +24 -24
  90. package/dist/cli/{monitors-KDUJHAKJ.js → monitors-3TF2DOFD.js} +117 -102
  91. package/dist/cli/{monitors-NZD2WIKK.mjs → monitors-VSYHUBKC.mjs} +24 -9
  92. package/dist/cli/{org-EJW45RUA.mjs → org-S5VIKU2E.mjs} +6 -6
  93. package/dist/cli/{org-4PQGHLEB.js → org-YKVI2ZTI.js} +88 -88
  94. package/dist/cli/{play-3CM5RT5J.mjs → play-C7T5A3QM.mjs} +17 -17
  95. package/dist/cli/{play-MLHMQL4G.js → play-DOWEG45Y.js} +317 -317
  96. package/dist/cli/{providers-BHYBJI4R.mjs → providers-BMVVX3VD.mjs} +6 -6
  97. package/dist/cli/{providers-YBJG7277.js → providers-TAZPPFTB.js} +9 -9
  98. package/dist/cli/{quickstart-LL3MR562.mjs → quickstart-A3WKMKTW.mjs} +4 -4
  99. package/dist/cli/{quickstart-O7L2NNGJ.js → quickstart-HD6FQXGR.js} +6 -6
  100. package/dist/cli/{run-HJ2AR6CM.js → run-BVVV2UX7.js} +43 -43
  101. package/dist/cli/{run-OK545H5Q.mjs → run-FV7TWNOC.mjs} +23 -23
  102. package/dist/cli/{search-Z5ZKMRTX.mjs → search-MGK6WIKS.mjs} +7 -7
  103. package/dist/cli/search-VJFCWUZN.js +32 -0
  104. package/dist/cli/{search-output-SVW4DETG.js → search-output-6Y7KEPIE.js} +6 -6
  105. package/dist/cli/{search-output-Q5VHNUWG.mjs → search-output-GM7LDZKE.mjs} +4 -4
  106. package/dist/cli/{secrets-QIKIEFWB.mjs → secrets-4RFAR7YI.mjs} +6 -6
  107. package/dist/cli/{secrets-ENQWMCB5.js → secrets-SISXIXSZ.js} +15 -15
  108. package/dist/cli/{sessions-AETO22RF.mjs → sessions-CE3OMEG7.mjs} +6 -6
  109. package/dist/cli/sessions-OWWZJZXH.js +22 -0
  110. package/dist/cli/{settings-OFLIFTMZ.js → settings-4HPM3K4A.js} +85 -85
  111. package/dist/cli/{settings-G5RGRPFV.mjs → settings-E22IDSX2.mjs} +12 -12
  112. package/dist/cli/{setup-QW7Y62XD.js → setup-BDRSNLKX.js} +49 -49
  113. package/dist/cli/{setup-G4N3X6KG.mjs → setup-BK65MDZ6.mjs} +9 -9
  114. package/dist/cli/{skills-QRFQGHNA.mjs → skills-FI2GZMR4.mjs} +7 -7
  115. package/dist/cli/skills-ZLBFUAFR.js +36 -0
  116. package/dist/cli/tools-3K72VE33.js +57 -0
  117. package/dist/cli/{tools-52BH7UTF.mjs → tools-HMMWYUNW.mjs} +17 -17
  118. package/dist/cli/update-QZV6DH5V.js +34 -0
  119. package/dist/cli/{update-SDGZLAGL.mjs → update-WDKBSXV5.mjs} +9 -9
  120. package/dist/cli/{views-5QKAWYPI.js → views-775AUDWQ.js} +21 -21
  121. package/dist/cli/{views-3BIJFJMQ.mjs → views-JYIJCO23.mjs} +6 -6
  122. package/dist/cli/{workflow-G67RPWVY.js → workflow-4H6KQRFQ.js} +17 -17
  123. package/dist/cli/{workflow-QAK773FR.mjs → workflow-FKKHE3IU.mjs} +7 -7
  124. package/dist/{client-bd4QQIXo.d.mts → client-ANT3pyoa.d.mts} +1 -1
  125. package/dist/{client-D1ga52xq.d.ts → client-DD_FyJVd.d.ts} +1 -1
  126. package/dist/{client-core-CqfWNf2Q.d.mts → client-core-Dg9tKhdB.d.mts} +5 -0
  127. package/dist/{client-core-B6eMVx8h.d.ts → client-core-QHmo73k1.d.ts} +5 -0
  128. package/dist/index.d.mts +3 -3
  129. package/dist/index.d.ts +3 -3
  130. package/dist/index.js +9 -9
  131. package/dist/index.mjs +6 -6
  132. package/dist/install-integrity.json +114 -114
  133. package/dist/plays/play-description.d.mts +1 -1
  134. package/dist/plays/play-description.d.ts +1 -1
  135. package/dist/plays/run-request.d.mts +1 -1
  136. package/dist/plays/run-request.d.ts +1 -1
  137. package/dist/release.d.mts +1 -1
  138. package/dist/release.d.ts +1 -1
  139. package/dist/release.js +2 -2
  140. package/dist/release.mjs +1 -1
  141. package/dist/server.d.mts +2 -2
  142. package/dist/server.d.ts +2 -2
  143. package/dist/server.js +5 -5
  144. package/dist/server.mjs +3 -3
  145. package/package.json +1 -1
  146. package/dist/cli/auth-S6B5WUU5.js +0 -43
  147. package/dist/cli/concurrent-runs-help-E4OYD3DS.js +0 -21
  148. package/dist/cli/describe-AC6PLEFP.js +0 -50
  149. package/dist/cli/git-RUYFQEJX.js +0 -25
  150. package/dist/cli/search-UUNS6BCC.js +0 -32
  151. package/dist/cli/sessions-FNSUDERA.js +0 -22
  152. package/dist/cli/skills-3IXIY2IV.js +0 -36
  153. package/dist/cli/tools-MYBUMPKH.js +0 -57
  154. package/dist/cli/update-GT7574UU.js +0 -34
@@ -1613,6 +1613,11 @@ export type MonitorFleetSyncOptions = {
1613
1613
  dryRun?: boolean;
1614
1614
  /** Optimistic concurrency: refuse the write unless the fleet is at this generation. */
1615
1615
  expectedGeneration?: number;
1616
+ /**
1617
+ * Take over live monitors no Fleet owns whose key a source row renders,
1618
+ * keeping their radar (`adopt_existing: true`). Without it they are refused.
1619
+ */
1620
+ adoptExisting?: boolean;
1616
1621
  /** Stable retry key; generated by the caller when omitted. */
1617
1622
  idempotencyKey?: string;
1618
1623
  };
@@ -8360,6 +8365,7 @@ export class DeeplineClient {
8360
8365
  ? {}
8361
8366
  : { definition: definitionOrId }),
8362
8367
  ...(options?.dryRun ? { dry_run: true } : {}),
8368
+ ...(options?.adoptExisting ? { adopt_existing: true } : {}),
8363
8369
  ...(options?.expectedGeneration !== undefined
8364
8370
  ? { expected_generation: options.expectedGeneration }
8365
8371
  : {}),
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
205
205
  // getters keep their established compatibility behavior.
206
206
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
207
207
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
208
- version: '0.3.543',
208
+ version: '0.3.544',
209
209
  updateSummary: {
210
210
  introducedIn: '0.3.90',
211
211
  summary:
@@ -11,7 +11,9 @@ import {
11
11
  // 20,000 is the first step up from 1,000. The whole Fleet lifecycle is proven
12
12
  // on the fake TamRadar at 5,000 and 10,000, and deploy, re-plan, the global
13
13
  // audit and teardown at 100,000 (docs/plans/2026-10-22-monitor-load-testing.md,
14
- // Stage 10); the full 100,000 run gates the next raise.
14
+ // Stage 10). The next raise waits on two readers outside the Fleet: the Monitor
15
+ // Ledger refuses a workspace past 20,000 summaries (#10551), and the billing
16
+ // policy pass stops after 100,000 definitions (#10552); see #10553.
15
17
  export const MONITOR_FLEET_MAX_MEMBERS = 20_000;
16
18
 
17
19
  /**
@@ -17,7 +17,19 @@ export { FLEET_BLOCKED_BY } from './limits';
17
17
  // Rollout access is checked by convergence immediately before provider work,
18
18
  // not by this pure planner: an admitted plan can outlive rollout access.
19
19
 
20
- export type FleetMemberAction = 'create' | 'update' | 'remove' | 'blocked';
20
+ /**
21
+ * `adopt` is a takeover: a live monitor a named Batch deployed, which this
22
+ * Fleet now claims. It is a planning action only. The commit receives it as a
23
+ * `create`, and the commit transition, reading the monitor row itself,
24
+ * re-derives it into an update of the radar the provider already holds. It
25
+ * never reaches the provider as a create.
26
+ */
27
+ export type FleetMemberAction =
28
+ | 'create'
29
+ | 'adopt'
30
+ | 'update'
31
+ | 'remove'
32
+ | 'blocked';
21
33
 
22
34
  /** One monitor the fleet wants, fully resolved from its source row. */
23
35
  export type DesiredFleetMember = {
@@ -52,6 +64,20 @@ export type OwnedFleetMonitor = {
52
64
  firstMissingAt: number | null;
53
65
  };
54
66
 
67
+ /**
68
+ * A live monitor no Fleet owns yet that this Fleet may take over: the key was
69
+ * deployed by a named Batch and the provider holds its radar.
70
+ */
71
+ export type FleetTakeover = {
72
+ /** The provider already holds exactly the payload this Fleet renders. */
73
+ payloadMatches: boolean;
74
+ /**
75
+ * No named Batch deployed it: the sync's `adopt_existing` opt-in is what
76
+ * authorizes the takeover, and the commit is told so per member.
77
+ */
78
+ adoptExisting: boolean;
79
+ };
80
+
55
81
  export type PlannedFleetMember = {
56
82
  monitorKey: string;
57
83
  sourceKey: string;
@@ -62,6 +88,8 @@ export type PlannedFleetMember = {
62
88
  blockedBy?: string;
63
89
  /** True when the commit must be given a monitor seed for this key. */
64
90
  needsSeed: boolean;
91
+ /** An `adopt` the sync's opt-in authorizes, not a named Batch. */
92
+ adoptExisting?: true;
65
93
  };
66
94
 
67
95
  export type FleetPlan = {
@@ -80,6 +108,22 @@ export type FleetPlan = {
80
108
  unblocked: number;
81
109
  /** Creates for rows the fleet did not own a monitor for. Included in `creates`. */
82
110
  newRows: number;
111
+ /**
112
+ * Live named-Batch monitors this plan takes over with the payload the
113
+ * provider already holds: no provider call, the radar and its callback
114
+ * binding are kept. Not counted in `creates` or `updates`.
115
+ */
116
+ adopts: number;
117
+ /**
118
+ * Takeovers whose payload differs, so their radar is replaced as any update
119
+ * replaces one. Included in `updates`; never in `creates`.
120
+ */
121
+ adoptsWithUpdate: number;
122
+ /**
123
+ * Of `adopts` and `adoptsWithUpdate`: monitors no named Batch deployed,
124
+ * taken over only because the sync opted in with `adopt_existing`.
125
+ */
126
+ adoptsExisting: number;
83
127
  };
84
128
 
85
129
  export type FleetMembershipMember = {
@@ -147,6 +191,38 @@ export type FleetEntitlements = {
147
191
  monitorsPerEntity: number;
148
192
  };
149
193
 
194
+ /**
195
+ * The accounts `planFleetMembers` reads monitor counts for.
196
+ *
197
+ * Only a member the provider does not hold yet (no applied hash) reaches the
198
+ * per-account admission below; one already applied is counted, and an update
199
+ * never opens an account. Counting every desired member's account read
200
+ * 100,000 accounts on an unchanged 100,000-member re-plan, 23 s of it, to
201
+ * consult none of them. Matching mirrors `planFleetMembers` exactly: by
202
+ * monitor key, else by source key.
203
+ */
204
+ export function entityKeysAdmittedByPlan(input: {
205
+ desired: readonly DesiredFleetMember[];
206
+ owned: readonly OwnedFleetMonitor[];
207
+ }): string[] {
208
+ const ownedByKey = new Map(
209
+ input.owned.map((monitor) => [monitor.monitorKey, monitor]),
210
+ );
211
+ const ownedBySource = new Map<string, OwnedFleetMonitor>();
212
+ for (const monitor of input.owned) {
213
+ if (monitor.sourceKey) ownedBySource.set(monitor.sourceKey, monitor);
214
+ }
215
+ const keys = new Set<string>();
216
+ for (const desired of input.desired) {
217
+ const owned =
218
+ ownedByKey.get(desired.monitorKey) ??
219
+ ownedBySource.get(desired.sourceKey);
220
+ if ((owned?.appliedHash ?? null) !== null) continue;
221
+ keys.add(fleetEntityKeyFor(desired));
222
+ }
223
+ return [...keys];
224
+ }
225
+
150
226
  /**
151
227
  * Turn "what the fleet wants" plus "what it already owns" into commit members.
152
228
  *
@@ -166,6 +242,8 @@ export function planFleetMembers(input: {
166
242
  * is what costs allowance.
167
243
  */
168
244
  entityMonitorCounts: ReadonlyMap<string, number>;
245
+ /** Live monitors this fleet may take over, by monitor key. */
246
+ takeovers?: ReadonlyMap<string, FleetTakeover>;
169
247
  }): FleetPlan {
170
248
  const ownedByKey = new Map(
171
249
  input.owned.map((monitor) => [monitor.monitorKey, monitor]),
@@ -191,6 +269,9 @@ export function planFleetMembers(input: {
191
269
  let retries = 0;
192
270
  let unblocked = 0;
193
271
  let newRows = 0;
272
+ let adopts = 0;
273
+ let adoptsWithUpdate = 0;
274
+ let adoptsExisting = 0;
194
275
 
195
276
  const refuse = (member: PlannedFleetMember, blockedBy: string) => {
196
277
  blocked[blockedBy] = (blocked[blockedBy] ?? 0) + 1;
@@ -231,6 +312,29 @@ export function planFleetMembers(input: {
231
312
  continue;
232
313
  }
233
314
 
315
+ const takeover = owned
316
+ ? undefined
317
+ : input.takeovers?.get(desired.monitorKey);
318
+ if (takeover) {
319
+ // The monitor exists and is already counted against its account, so a
320
+ // takeover admits nothing against a limit and opens no account. The
321
+ // seed is still sent: if the monitor is deleted before the commit, the
322
+ // commit creates it from scratch as it would any new row.
323
+ members.push({
324
+ ...base,
325
+ action: 'adopt',
326
+ ...(takeover.adoptExisting ? { adoptExisting: true as const } : {}),
327
+ });
328
+ if (takeover.adoptExisting) adoptsExisting += 1;
329
+ if (takeover.payloadMatches) {
330
+ adopts += 1;
331
+ } else {
332
+ adoptsWithUpdate += 1;
333
+ updates += 1;
334
+ }
335
+ continue;
336
+ }
337
+
234
338
  const onEntity = entityCounts.get(entityKey) ?? 0;
235
339
  if (onEntity >= input.entitlements.monitorsPerEntity) {
236
340
  refuse(base, FLEET_BLOCKED_BY.monitorsPerEntity);
@@ -281,5 +385,8 @@ export function planFleetMembers(input: {
281
385
  retries,
282
386
  unblocked,
283
387
  newRows,
388
+ adopts,
389
+ adoptsWithUpdate,
390
+ adoptsExisting,
284
391
  };
285
392
  }
@@ -2,6 +2,10 @@ import { sha256Hex } from '../plays/row-identity';
2
2
  import { readProvenanceTag } from './log-provenance';
3
3
  import type { PlayRunFailureDetails } from './run-failure';
4
4
  import { emitPlayTelemetry } from './runtime-telemetry';
5
+ import {
6
+ isRuntimeSandboxProviderId,
7
+ type RuntimeSandboxProviderId,
8
+ } from './runtime-sandbox-provider-profile';
5
9
  import {
6
10
  TOOL_CALL_ERROR_ORIGINS,
7
11
  TOOL_CALL_NETWORK_KINDS,
@@ -574,10 +578,31 @@ export function playRunFailureDetailsOf(
574
578
  return typeof code === 'string' ? (first as PlayRunFailureDetails) : null;
575
579
  }
576
580
 
581
+ /**
582
+ * The sandbox provider a runner result proves it ran on (`stats.sandboxProvider`,
583
+ * set by the runner backend that created the sandbox), or null when the
584
+ * result carries none: a failure before any sandbox, or an older runner.
585
+ */
586
+ export function sandboxProviderOfRunnerResult(
587
+ result: unknown,
588
+ ): RuntimeSandboxProviderId | null {
589
+ if (!result || typeof result !== 'object') return null;
590
+ const stats = (result as { stats?: unknown }).stats;
591
+ if (!stats || typeof stats !== 'object') return null;
592
+ const provider = (stats as { sandboxProvider?: unknown }).sandboxProvider;
593
+ return isRuntimeSandboxProviderId(provider) ? provider : null;
594
+ }
595
+
577
596
  /**
578
597
  * One line per run that reached a terminal state: `play.run.finished`.
579
598
  * Emitted by the process that committed the terminal transition, after it
580
599
  * committed, so a run is reported once.
600
+ *
601
+ * `runtimeBackend` is the run's logical lane (its placement policy's
602
+ * compatibility backend), not where it ran: `daytona_modal_canary@1` and
603
+ * `modal_then_daytona@1` are Daytona-lane policies whose runs mostly execute
604
+ * on Modal. `sandboxProvider` is the provider the run's sandbox was actually
605
+ * created on, from the runner's own proof, or null when there is none.
581
606
  */
582
607
  export function emitPlayRunFinished(input: {
583
608
  orgId: string | null;
@@ -587,6 +612,7 @@ export function emitPlayRunFinished(input: {
587
612
  outcome: PlayRunOutcome;
588
613
  failure: PlayRunFailureDetails | null;
589
614
  runtimeBackend: string | null;
615
+ sandboxProvider: RuntimeSandboxProviderId | null;
590
616
  triggerSource: string | null;
591
617
  /** Where the terminal was committed. */
592
618
  committedBy: 'worker' | 'gateway';
@@ -610,6 +636,9 @@ export function emitPlayRunFinished(input: {
610
636
  failureCategory: oneOf(failure?.category, TOOL_CATEGORIES),
611
637
  failureName: token(failure?.name, CLASS_NAME),
612
638
  runtimeBackend: token(input.runtimeBackend, TOKEN),
639
+ sandboxProvider: isRuntimeSandboxProviderId(input.sandboxProvider)
640
+ ? input.sandboxProvider
641
+ : null,
613
642
  triggerSource: token(input.triggerSource, TOKEN),
614
643
  committedBy: input.committedBy,
615
644
  },
@@ -3458,7 +3458,8 @@ async function run(
3458
3458
  settlement.failedRows += failedRows;
3459
3459
  settlement.columns = datasetWrittenColumnOrder({
3460
3460
  contract: sheetContract,
3461
- rows: input.rows,
3461
+ // Completed rows arrive as map outcomes; the row itself is `data`.
3462
+ rows: input.rows.map((row) => row.data),
3462
3463
  outputFields: input.outputFields,
3463
3464
  existing: settlement.columns,
3464
3465
  });
@@ -8383,6 +8383,9 @@ export async function recoverAbsurdRuntimeOverdueDetachedRunnerCeilings(input: {
8383
8383
  outcome: 'failed',
8384
8384
  failure: normalizePlayRunFailure(failedResult.error),
8385
8385
  runtimeBackend: claim.launch.runtimeBackend ?? null,
8386
+ // The detached runner's suspension records where its sandbox was
8387
+ // created; historical records without it are Daytona.
8388
+ sandboxProvider: suspension.sandboxProvider ?? 'daytona',
8386
8389
  triggerSource: claim.launch.triggerSource ?? null,
8387
8390
  committedBy: 'worker',
8388
8391
  });
@@ -311,6 +311,7 @@ import {
311
311
  } from '../runtime-telemetry';
312
312
  import {
313
313
  emitPlayRunFinished,
314
+ sandboxProviderOfRunnerResult,
314
315
  playRunFailureDetailsOf,
315
316
  } from '../durable-summary-events';
316
317
  import { buildAbsurdPlayRunTask } from './absurd-play-run-task';
@@ -19111,6 +19112,7 @@ export async function executePostgresSchedulerClaim(
19111
19112
  outcome: 'completed',
19112
19113
  failure: null,
19113
19114
  runtimeBackend: claim.launch.runtimeBackend ?? null,
19115
+ sandboxProvider: sandboxProviderOfRunnerResult(output),
19114
19116
  triggerSource: claim.launch.triggerSource ?? null,
19115
19117
  committedBy: 'worker',
19116
19118
  });
@@ -19206,6 +19208,7 @@ export async function executePostgresSchedulerClaim(
19206
19208
  outcome: 'failed',
19207
19209
  failure: playRunFailureDetailsOf(terminalFailureResult),
19208
19210
  runtimeBackend: claim.launch.runtimeBackend ?? null,
19211
+ sandboxProvider: sandboxProviderOfRunnerResult(terminalFailureResult),
19209
19212
  triggerSource: claim.launch.triggerSource ?? null,
19210
19213
  committedBy: 'worker',
19211
19214
  });
@@ -91,7 +91,7 @@ const RUNTIME_EVENT_LOG_POSITION_EXPRESSION = `jsonb_set(
91
91
  // Migration readiness tracks this projection body independently of scheduler
92
92
  // wire and schema versions. Bump when a changed trigger must be reinstalled.
93
93
  export const RUNTIME_EVENT_SEARCH_OUTBOX_PROJECTION_MARKER =
94
- 'runtime-event-search-epoch-resume-lifecycle-reuse';
94
+ 'runtime-event-search-epoch-resume-lifecycle-reuse-dataset-columns';
95
95
  /** Trusted trigger-authored state; absent on already-projected legacy rows. */
96
96
  export const RUNTIME_EVENT_DEFERRED_PROJECTION_FIELD =
97
97
  '_runtimeSearchProjectionPending';
@@ -0,0 +1,43 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ var _chunkDYDHLBSKjs = require('./chunk-DYDHLBSK.js');
18
+ require('./chunk-ZY6FL4O4.js');
19
+ require('./chunk-ON56ISO6.js');
20
+ require('./chunk-G26VJCNT.js');
21
+ require('./chunk-2GJZLIKW.js');
22
+ require('./chunk-XNYIZMNQ.js');
23
+ require('./chunk-BBTKAASQ.js');
24
+ require('./chunk-3KGMM4KS.js');
25
+ require('./chunk-OG64RBAC.js');
26
+ require('./chunk-COGTRVWW.js');
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+ exports.EXIT_WORKSPACE_MISMATCH = _chunkDYDHLBSKjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkDYDHLBSKjs.authStatusLine; exports.clearPendingClaim = _chunkDYDHLBSKjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkDYDHLBSKjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkDYDHLBSKjs.handleRegister; exports.handleStatus = _chunkDYDHLBSKjs.handleStatus; exports.handleWait = _chunkDYDHLBSKjs.handleWait; exports.httpJson = _chunkDYDHLBSKjs.httpJson; exports.readPendingAuthClaim = _chunkDYDHLBSKjs.readPendingAuthClaim; exports.readStatusBanner = _chunkDYDHLBSKjs.readStatusBanner; exports.registerAuthCommands = _chunkDYDHLBSKjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkDYDHLBSKjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkDYDHLBSKjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkDYDHLBSKjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkDYDHLBSKjs.statusBannerLine;
@@ -14,14 +14,14 @@ import {
14
14
  reportSetupCompleted,
15
15
  resolvePendingAuthClaimForResume,
16
16
  statusBannerLine
17
- } from "./chunk-W2OPPSAZ.mjs";
18
- import "./chunk-DH43ECTN.mjs";
19
- import "./chunk-R57UCXQG.mjs";
20
- import "./chunk-JXG7HWBA.mjs";
17
+ } from "./chunk-H4SAHB3Q.mjs";
18
+ import "./chunk-DVDWAC2M.mjs";
19
+ import "./chunk-HXM2JUGD.mjs";
20
+ import "./chunk-ZHY4T5M6.mjs";
21
21
  import "./chunk-CQBIO6HW.mjs";
22
22
  import "./chunk-DLIRSHV6.mjs";
23
23
  import "./chunk-JL2OTMSG.mjs";
24
- import "./chunk-ZRT2PNYY.mjs";
24
+ import "./chunk-PFGOCUH3.mjs";
25
25
  import "./chunk-WZYKRD7T.mjs";
26
26
  import "./chunk-KRD6H754.mjs";
27
27
  export {