@opengeni/worker-bundle 0.11.2 → 0.11.8

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.
@@ -296,9 +296,11 @@ export async function sessionWorkflow(input: SessionWorkflowInput): Promise<void
296
296
  const capacityCheckBackstop =
297
297
  input.maxCapacityChecksPerRun ?? CODEX_CAPACITY_CHECKS_PER_RUN_BACKSTOP;
298
298
  if (workflowInfo().continueAsNewSuggested || capacityChecksThisRun >= capacityCheckBackstop) {
299
- // The waiter/outbox is durable in Postgres. A fresh workflow run reads
300
- // it before goal continuation, reconstructs its timer, and turns any
301
- // unobserved wake revision into an immediate evaluation.
299
+ // The waiter and exact nonterminal turn are durable in Postgres, and
300
+ // the old attempt is already closed. A fresh workflow run reads the
301
+ // waiter before goal continuation, reconstructs its timer, and turns
302
+ // any unobserved wake revision into an immediate evaluation. This is
303
+ // an ownerless-attempt boundary, not a settled-turn boundary.
302
304
  // A quiescence proof is the one signal that is not merely a replaceable
303
305
  // wake hint. It may have arrived while the reconciliation activity was
304
306
  // running, so commit it before crossing this nested continue-as-new
@@ -324,11 +326,12 @@ export async function sessionWorkflow(input: SessionWorkflowInput): Promise<void
324
326
  // decision so no accepted physical fact can be dropped with run history.
325
327
  await persistPendingQuiescenceProofs();
326
328
  // History-overflow guard. The top of the loop is the only safe
327
- // continueAsNew boundary: no turn is mid-flight (every path that reaches a
328
- // new iteration settled or recovered its turn first). Every interruption
329
- // is already durable in Postgres, so ordinary Temporal signals are
330
- // replaceable wake hints and none must be carried into the next workflow
331
- // run. A
329
+ // continueAsNew boundary: no activity attempt owns a turn. A same logical
330
+ // turn may still be nonterminal (`recovering` or `waiting_capacity`), but
331
+ // its dispatch attempt has closed and all recovery/wait truth is durable
332
+ // in Postgres. Every interruption is already durable there too, so ordinary
333
+ // Temporal signals are replaceable wake hints and none must be carried into
334
+ // the next workflow run. A
332
335
  // buffered userMessage/queueChanged signal only
333
336
  // bumps `wakeups`, and its turn was written to Postgres BEFORE the signal
334
337
  // was sent, so the fresh run observes it on its first durable work peek
@@ -604,9 +607,9 @@ export async function sessionWorkflow(input: SessionWorkflowInput): Promise<void
604
607
  }
605
608
 
606
609
  if (outcome.kind === "failure") {
607
- // A capacity settlement may have committed just before the activity
608
- // transport/worker failed. Recover that durable boundary before generic
609
- // failSession can overwrite the capacity-idle session.
610
+ // A capacity wait may have committed just before the activity
611
+ // transport/worker failed. Recover that durable same-turn boundary
612
+ // before generic failSession can overwrite the nonterminal turn.
610
613
  {
611
614
  const capacityWait = await activity.getCodexCapacityWait({
612
615
  workspaceId,