deepline 0.1.243 → 0.1.245

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 (71) hide show
  1. package/README.md +1 -1
  2. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +5 -25
  3. package/dist/bundling-sources/sdk/src/release.ts +25 -26
  4. package/dist/bundling-sources/sdk/src/types.ts +1 -1
  5. package/dist/bundling-sources/shared_libs/play-runtime/backend.ts +2 -21
  6. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +5 -6
  7. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +6 -13
  8. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +9 -26
  9. package/dist/bundling-sources/shared_libs/play-runtime/internal-step-ids.ts +1 -2
  10. package/dist/bundling-sources/shared_libs/play-runtime/map-row-identity.ts +1 -1
  11. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +191 -29
  12. package/dist/bundling-sources/shared_libs/play-runtime/play-latency-trace.ts +1 -1
  13. package/dist/bundling-sources/shared_libs/play-runtime/providers.ts +1 -36
  14. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +2 -3
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/index.ts +0 -7
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1 -12
  17. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-pg.ts +2 -3
  18. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver.ts +5 -15
  19. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -21
  20. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +3 -4
  21. package/dist/bundling-sources/shared_libs/plays/artifact-kind-guard.ts +16 -29
  22. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -8
  23. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +21 -712
  24. package/dist/bundling-sources/shared_libs/plays/bundling/limits.ts +1 -18
  25. package/dist/cli/index.js +28 -71
  26. package/dist/cli/index.mjs +28 -71
  27. package/dist/{compiler-manifest-CYcwzSOJ.d.ts → compiler-manifest-DlE7dnRm.d.mts} +2 -8
  28. package/dist/{compiler-manifest-CYcwzSOJ.d.mts → compiler-manifest-DlE7dnRm.d.ts} +2 -8
  29. package/dist/index.d.mts +2 -2
  30. package/dist/index.d.ts +2 -2
  31. package/dist/index.js +23 -22
  32. package/dist/index.mjs +23 -22
  33. package/dist/plays/bundle-play-file.d.mts +7 -22
  34. package/dist/plays/bundle-play-file.d.ts +7 -22
  35. package/dist/plays/bundle-play-file.mjs +26 -614
  36. package/package.json +2 -2
  37. package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +0 -4504
  38. package/dist/bundling-sources/apps/play-runner-workers/src/dedup-do.ts +0 -1386
  39. package/dist/bundling-sources/apps/play-runner-workers/src/durable-object-deploy-handoff.ts +0 -30
  40. package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +0 -8385
  41. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/README.md +0 -21
  42. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/batching.ts +0 -251
  43. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/coordinator-progress.ts +0 -289
  44. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/csv-rows.ts +0 -85
  45. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/customer-console.ts +0 -23
  46. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/dataset-handles.ts +0 -528
  47. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/harness-receipt-store.ts +0 -229
  48. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/ledger-event-batches.ts +0 -81
  49. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/live-progress.ts +0 -22
  50. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +0 -920
  51. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-latency-profile.ts +0 -90
  52. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/output-datasets.ts +0 -475
  53. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/receipts.ts +0 -570
  54. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/result-dataset-persistence.ts +0 -50
  55. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/row-isolation.ts +0 -5
  56. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/run-work-dispatcher.ts +0 -519
  57. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-batch.ts +0 -107
  58. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-dispatch.ts +0 -2541
  59. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-http-errors.ts +0 -7
  60. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-receipts.ts +0 -227
  61. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/work-budget.ts +0 -130
  62. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/worker-platform-budget.ts +0 -39
  63. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/workflow-preview.ts +0 -26
  64. package/dist/bundling-sources/apps/play-runner-workers/src/runtime-api-retry.ts +0 -23
  65. package/dist/bundling-sources/apps/play-runner-workers/src/workflow-instance-create.ts +0 -47
  66. package/dist/bundling-sources/apps/play-runner-workers/src/workflow-retry-state.ts +0 -167
  67. package/dist/bundling-sources/apps/play-runner-workers/src/workflow-retry.ts +0 -91
  68. package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +0 -329
  69. package/dist/bundling-sources/sdk/src/worker-play-entry.ts +0 -240
  70. package/dist/bundling-sources/shared_libs/play-runtime/governor/coordinator-rate-state-backend.ts +0 -252
  71. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-neon-serverless.ts +0 -217
package/README.md CHANGED
@@ -326,7 +326,7 @@ V2 prebuilt play sources are authored directly in `src/lib/plays/v2/`. After
326
326
  editing them, regenerate the committed Workers and share-page artifacts:
327
327
 
328
328
  ```bash
329
- bun scripts/regen.ts workers-prebuilt prebuilt-share-pages
329
+ bun scripts/regen.ts prebuilt-share-pages
330
330
  ```
331
331
 
332
332
  ## File structure
@@ -44,7 +44,7 @@ const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
44
44
  const SDK_PACKAGE_ROOT = resolve(MODULE_DIR, '..', '..');
45
45
  const SOURCE_REPO_ROOT = resolve(SDK_PACKAGE_ROOT, '..');
46
46
  const HAS_SOURCE_BUNDLING_SOURCES = existsSync(
47
- resolve(SOURCE_REPO_ROOT, 'apps', 'play-runner-workers', 'src', 'entry.ts'),
47
+ resolve(SOURCE_REPO_ROOT, 'shared_libs', 'plays', 'bundling', 'index.ts'),
48
48
  );
49
49
  const PACKAGED_BUNDLING_SOURCE_ROOT = resolve(
50
50
  SDK_PACKAGE_ROOT,
@@ -54,10 +54,10 @@ const PACKAGED_BUNDLING_SOURCE_ROOT = resolve(
54
54
  const HAS_PACKAGED_BUNDLING_SOURCES = existsSync(
55
55
  resolve(
56
56
  PACKAGED_BUNDLING_SOURCE_ROOT,
57
- 'apps',
58
- 'play-runner-workers',
59
- 'src',
60
- 'entry.ts',
57
+ 'shared_libs',
58
+ 'plays',
59
+ 'bundling',
60
+ 'index.ts',
61
61
  ),
62
62
  );
63
63
  const PROJECT_ROOT = HAS_SOURCE_BUNDLING_SOURCES
@@ -75,20 +75,6 @@ const SDK_ENTRY_FILE = resolve(SDK_SOURCE_ROOT, 'index.ts');
75
75
  const SDK_TYPES_ENTRY_FILE = HAS_SOURCE_BUNDLING_SOURCES
76
76
  ? SDK_ENTRY_FILE
77
77
  : resolve(SDK_PACKAGE_ROOT, 'dist', 'index.d.ts');
78
- const SDK_WORKERS_ENTRY_FILE = resolve(SDK_SOURCE_ROOT, 'worker-play-entry.ts');
79
- const WORKERS_HARNESS_ENTRY_FILE = resolve(
80
- PROJECT_ROOT,
81
- 'apps',
82
- 'play-runner-workers',
83
- 'src',
84
- 'entry.ts',
85
- );
86
- const WORKERS_HARNESS_FILES_DIR = resolve(
87
- PROJECT_ROOT,
88
- 'apps',
89
- 'play-runner-workers',
90
- 'src',
91
- );
92
78
  let hasWarnedAboutNonDevelopmentBundling = false;
93
79
 
94
80
  /**
@@ -150,12 +136,6 @@ export function createSdkPlayBundlingAdapter(): PlayBundlingAdapter {
150
136
  HAS_SOURCE_BUNDLING_SOURCES || !existsSync(SDK_TYPES_ENTRY_FILE)
151
137
  ? SDK_ENTRY_FILE
152
138
  : SDK_TYPES_ENTRY_FILE,
153
- sdkWorkersEntryFile: SDK_WORKERS_ENTRY_FILE,
154
- workersHarnessEntryFile: WORKERS_HARNESS_ENTRY_FILE,
155
- workersHarnessFilesDir: WORKERS_HARNESS_FILES_DIR,
156
- workersRuntimeFingerprintDirs: [
157
- resolve(PROJECT_ROOT, 'shared_libs', 'play-runtime'),
158
- ],
159
139
  discoverPackagedLocalFiles,
160
140
  warnAboutNonDevelopmentBundling,
161
141
  };
@@ -5,13 +5,13 @@
5
5
  * happens at publish time: on push to main, `.github/workflows/sdk-release.yml`
6
6
  * (via `scripts/sdk-release-autobump.ts`) compares the built package against
7
7
  * the latest published npm tarball and, when the content changed, stamps the
8
- * next unpublished patch into `version` + `supportPolicy.latest` in the CI
9
- * workspace only and publishes it in the same run. That patch stamp is not
8
+ * next unpublished patch into `version` in the CI workspace only and
9
+ * publishes it in the same run. That patch stamp is not
10
10
  * committed back to main; production endpoints read npm metadata when they
11
11
  * need the newest patch-level SDK/CLI version.
12
12
  *
13
13
  * Edit THIS file by hand only for deliberate release decisions:
14
- * - minor/major version bumps (set `version` and `supportPolicy.latest`),
14
+ * - minor/major version bumps (set `version`),
15
15
  * - `apiContract` cutovers (see `docs/sdk-runtime-compatibility.md`),
16
16
  * - support-window moves (`minimumSupported` / `deprecatedBelow`).
17
17
  * The automation never touches `apiContract`, `minimumSupported`, or
@@ -36,8 +36,6 @@
36
36
  export type SdkReleaseChannel = 'latest' | 'next' | 'beta';
37
37
 
38
38
  export type SdkSupportPolicy = {
39
- /** Checked-in latest policy value; publish-time patch latest is read from npm. */
40
- latest: string;
41
39
  /**
42
40
  * Anything strictly below this returns `status: "unsupported"` from
43
41
  * `/api/v2/sdk/compat` and the CLI must hard-fail with the update command.
@@ -113,10 +111,11 @@ export const SDK_RELEASE = {
113
111
  // 0.1.241 hard-cuts published and launched plays to immutable cjs_node20
114
112
  // artifacts. Older clients can submit esm_workers artifacts that the Absurd
115
113
  // runtime intentionally no longer compiles at publish or launch time.
116
- version: '0.1.243',
117
- apiContract: '2026-07-immutable-cjs-play-artifacts-hard-cutover',
114
+ // 0.1.242 removes the retired Workers/ESM compiler, generated bundles, and
115
+ // deploy-time artifact migration. Play authoring now has one CJS contract.
116
+ version: '0.1.245',
117
+ apiContract: '2026-07-cjs-absurd-only-play-runtime-hard-cutover',
118
118
  supportPolicy: {
119
- latest: '0.1.243',
120
119
  minimumSupported: '0.1.53',
121
120
  deprecatedBelow: '0.1.219',
122
121
  commandMinimumSupported: [
@@ -128,61 +127,61 @@ export const SDK_RELEASE = {
128
127
  },
129
128
  {
130
129
  command: 'plays',
131
- minimumSupported: '0.1.111',
130
+ minimumSupported: '0.1.241',
132
131
  reason:
133
- 'Play file commands now use dataset-native list getters and result row datasets.',
132
+ 'Older SDK CLI versions predate dataset-native Play results and can emit the retired esm_workers artifact contract. Update before checking, publishing, or running plays.',
134
133
  },
135
134
  {
136
135
  command: 'plays run',
137
- minimumSupported: '0.1.111',
136
+ minimumSupported: '0.1.241',
138
137
  reason:
139
- 'Play run results now promote row-shaped outputs into dataset handles for safe export.',
138
+ 'Older SDK CLI versions predate dataset-native Play results and can emit the retired esm_workers artifact contract.',
140
139
  },
141
140
  {
142
141
  command: 'run',
143
142
  displayCommand: 'plays run',
144
- minimumSupported: '0.1.111',
143
+ minimumSupported: '0.1.241',
145
144
  reason:
146
- 'Play run results now promote row-shaped outputs into dataset handles for safe export.',
145
+ 'Older SDK CLI versions predate dataset-native Play results and can emit the retired esm_workers artifact contract.',
147
146
  },
148
147
  {
149
148
  command: 'plays check',
150
- minimumSupported: '0.1.111',
149
+ minimumSupported: '0.1.241',
151
150
  reason:
152
- 'Play file checks now validate dataset-native list getter authoring.',
151
+ 'Older SDK CLI versions predate dataset-native Play authoring and validate against the retired esm_workers artifact contract.',
153
152
  },
154
153
  {
155
154
  command: 'check',
156
155
  displayCommand: 'plays check',
157
- minimumSupported: '0.1.111',
156
+ minimumSupported: '0.1.241',
158
157
  reason:
159
- 'Play file checks now validate dataset-native list getter authoring.',
158
+ 'Older SDK CLI versions predate dataset-native Play authoring and validate against the retired esm_workers artifact contract.',
160
159
  },
161
160
  {
162
161
  command: 'plays publish',
163
- minimumSupported: '0.1.111',
162
+ minimumSupported: '0.1.241',
164
163
  reason:
165
- 'Published play artifacts now target dataset-native list getters and result row datasets.',
164
+ 'Older SDK CLI versions predate dataset-native Play artifacts and can publish the retired esm_workers artifact contract.',
166
165
  },
167
166
  {
168
167
  command: 'publish',
169
168
  displayCommand: 'plays publish',
170
- minimumSupported: '0.1.111',
169
+ minimumSupported: '0.1.241',
171
170
  reason:
172
- 'Published play artifacts now target dataset-native list getters and result row datasets.',
171
+ 'Older SDK CLI versions predate dataset-native Play artifacts and can publish the retired esm_workers artifact contract.',
173
172
  },
174
173
  {
175
174
  command: 'plays set-live',
176
- minimumSupported: '0.1.111',
175
+ minimumSupported: '0.1.241',
177
176
  reason:
178
- 'Published play artifacts now target dataset-native list getters and result row datasets.',
177
+ 'Older SDK CLI versions predate dataset-native Play artifacts and can publish the retired esm_workers artifact contract.',
179
178
  },
180
179
  {
181
180
  command: 'set-live',
182
181
  displayCommand: 'plays set-live',
183
- minimumSupported: '0.1.111',
182
+ minimumSupported: '0.1.241',
184
183
  reason:
185
- 'Published play artifacts now target dataset-native list getters and result row datasets.',
184
+ 'Older SDK CLI versions predate dataset-native Play artifacts and can publish the retired esm_workers artifact contract.',
186
185
  },
187
186
  {
188
187
  command: 'runs',
@@ -1221,7 +1221,7 @@ export interface StartPlayRunRequest {
1221
1221
  waitForCompletionMs?: number;
1222
1222
  /**
1223
1223
  * Per-run execution profile override. The server defaults to absurd. The
1224
- * workers_edge profile is disabled; most callers should leave this unset.
1224
+ * Only `absurd` is accepted; most callers should leave this unset.
1225
1225
  */
1226
1226
  profile?: string;
1227
1227
  /** Optional per-run provider execution mode for eval/smoke runs. */
@@ -1,27 +1,17 @@
1
1
  export const PLAY_RUNTIME_BACKENDS = {
2
2
  localProcess: 'local_process',
3
3
  daytona: 'daytona',
4
- // Artifact/runtime contract for Cloudflare Dynamic Workers. This is no
5
- // longer a standalone runner backend; use profile=workers_edge so the
6
- // cf-workflows scheduler owns loading and execution.
7
- cloudflareWorkers: 'cloudflare_workers',
8
4
  } as const;
9
5
 
10
6
  export type PlayRuntimeBackendId =
11
7
  (typeof PLAY_RUNTIME_BACKENDS)[keyof typeof PLAY_RUNTIME_BACKENDS];
12
8
 
13
9
  /**
14
- * The runtime shape of a built play artifact. Different runner backends need
15
- * different bundle outputs:
16
- * - cjs_node20: Daytona + local-process (full Node.js sandbox).
17
- * - esm_workers: Cloudflare Workers (V8 isolate, no `fs`/`child_process`).
18
- *
19
- * The CLI selects which kind to build based on the target backend; the worker
20
- * validates the kind matches the backend it's about to dispatch to.
10
+ * The one executable Play artifact contract. Daytona and local-process both
11
+ * load CommonJS under Node 20.
21
12
  */
22
13
  export const PLAY_ARTIFACT_KINDS = {
23
14
  cjsNode20: 'cjs_node20',
24
- esmWorkers: 'esm_workers',
25
15
  } as const;
26
16
 
27
17
  export type PlayArtifactKind =
@@ -49,11 +39,6 @@ export const PLAY_BACKEND_DESCRIPTORS: Record<
49
39
  artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
50
40
  label: 'Daytona sandbox',
51
41
  },
52
- [PLAY_RUNTIME_BACKENDS.cloudflareWorkers]: {
53
- id: PLAY_RUNTIME_BACKENDS.cloudflareWorkers,
54
- artifactKind: PLAY_ARTIFACT_KINDS.esmWorkers,
55
- label: 'Cloudflare Dynamic Workers',
56
- },
57
42
  };
58
43
 
59
44
  export function describePlayBackend(
@@ -84,10 +69,6 @@ export function normalizePlayRuntimeBackend(
84
69
  return PLAY_RUNTIME_BACKENDS.localProcess;
85
70
  }
86
71
 
87
- if (normalized === PLAY_RUNTIME_BACKENDS.cloudflareWorkers) {
88
- return PLAY_RUNTIME_BACKENDS.cloudflareWorkers;
89
- }
90
-
91
72
  throw new Error(
92
73
  `Unsupported play runtime backend "${normalized}". Expected one of: ${Object.values(
93
74
  PLAY_RUNTIME_BACKENDS,
@@ -1,11 +1,9 @@
1
1
  /**
2
2
  * Play Execution Governor — the deep module that owns execution policy.
3
3
  *
4
- * Both runner Adapters (`cjs_node20`, `esm_workers`) gate their work through one
5
- * Governor instance per run-attempt so the substrates cannot diverge on
6
- * concurrency, budgets, or pacing. Adapters keep only substrate mechanism (how
7
- * to resolve a row, batch a tool call, or submit a child); the Governor owns the
8
- * "may I, and how many at once" policy. See ADR 0007 + CONTEXT.md.
4
+ * The CJS runner gates work through one Governor instance per run-attempt. The
5
+ * runner owns execution mechanics; the Governor owns the "may I, and how many
6
+ * at once" policy. See ADR 0007 + CONTEXT.md.
9
7
  *
10
8
  * Surface (small, by design):
11
9
  * - acquireRowSlot / acquireToolSlot → blocking leases
@@ -283,7 +281,8 @@ export function createPlayExecutionGovernor(
283
281
  }
284
282
 
285
283
  const scopeFor = (toolId: string | undefined, provider: string) =>
286
- scopeByTool.get(toolId ?? '') ?? ([orgBucket(provider), ''] as [string, string]);
284
+ scopeByTool.get(toolId ?? '') ??
285
+ ([orgBucket(provider), ''] as [string, string]);
287
286
 
288
287
  async function resolveAdaptivePacing(toolId: string): Promise<{
289
288
  provider: string;
@@ -2,10 +2,8 @@
2
2
  * Play Execution Governor — the single policy table.
3
3
  *
4
4
  * This is the ONE source of truth for every concurrency, budget, and pacing
5
- * number in the play runtime. Both runner Adapters (`cjs_node20` in-process and
6
- * `esm_workers` cloud) resolve their limits from here, so the two substrates
7
- * cannot drift. See ADR 0007 and the "Play Execution Governor" entry in
8
- * CONTEXT.md.
5
+ * number in the CJS/Node play runtime. See ADR 0007 and the "Play Execution
6
+ * Governor" entry in CONTEXT.md.
9
7
  *
10
8
  * Tuning philosophy (product decision):
11
9
  * - Caps are explicit resource admission boundaries. A run should queue behind
@@ -51,13 +49,9 @@ export interface ExecutionBudgetPolicy {
51
49
  /**
52
50
  * Per-provider rate pacing — the real outbound throughput governor.
53
51
  *
54
- * SUBSTRATE NOTE: the per-provider request RATE (`requestsPerWindow`/`windowMs`
55
- * from a provider's `PacingRule`s) is enforced on BOTH substrates. A rule's
56
- * optional `maxConcurrency` (simultaneous-in-flight cap) is enforced only on
57
- * `cjs_node20`; on `esm_workers` it is intentionally excluded from the pacing
58
- * contract because a fanned-out run cannot guarantee the per-isolate release
59
- * signal an in-flight count needs, so only the org-wide tool-concurrency
60
- * backstop applies there. See PacingRule.maxConcurrency in rate-state-backend.ts.
52
+ * Per-provider request rate and optional in-flight concurrency are enforced by
53
+ * the same CJS/Node substrate. See PacingRule.maxConcurrency in
54
+ * rate-state-backend.ts.
61
55
  */
62
56
  export interface ExecutionPacingPolicy {
63
57
  /** RPS applied to a provider that declares no explicit rate limit. */
@@ -120,7 +114,7 @@ export const SHARED_EXECUTION_POLICY: ResolvedExecutionPolicy = {
120
114
  },
121
115
  };
122
116
 
123
- export type AdapterId = 'cjs_node20' | 'esm_workers';
117
+ export type AdapterId = 'cjs_node20';
124
118
 
125
119
  /**
126
120
  * One level deep on purpose: each policy section is a flat record of numbers, so
@@ -141,7 +135,6 @@ type PolicyOverride = {
141
135
  */
142
136
  export const ADAPTER_POLICY_OVERRIDES: Record<AdapterId, PolicyOverride> = {
143
137
  cjs_node20: {},
144
- esm_workers: {},
145
138
  };
146
139
 
147
140
  /** Merge the shared policy with any documented Adapter override. */
@@ -1,14 +1,9 @@
1
1
  /**
2
2
  * Rate State Backend — the one swappable seam of the Play Execution Governor.
3
3
  *
4
- * Per-`(org, provider)` rate windows are the only execution state that cannot be
5
- * process-local: on `esm_workers` a run fans child plays across isolates, so the
6
- * window must be shared. Everything else the Governor owns (budgets, concurrency
7
- * slots) stays Governor-local and threads down the lineage via the snapshot.
8
- *
9
- * Adapters: an in-memory backend for the single-process `cjs_node20` runner, and
10
- * a shared backend (Run Coordination Cache Durable Object, or server-side Redis)
11
- * for `esm_workers`. See ADR 0007 and CONTEXT.md (Rate State Backend).
4
+ * Per-`(org, provider)` rate windows are shared across CJS runner processes.
5
+ * Everything else the Governor owns stays local to one run attempt and threads
6
+ * down the lineage via the snapshot. See ADR 0007 and CONTEXT.md.
12
7
  */
13
8
 
14
9
  /** A single resolved rate rule for a bucket (from rate-limit-definitions). */
@@ -19,16 +14,8 @@ export interface PacingRule {
19
14
  /**
20
15
  * Optional simultaneous-in-flight cap for this rule.
21
16
  *
22
- * SUBSTRATE NOTE: `maxConcurrency` is enforced ONLY on `cjs_node20` (the
23
- * single-process {@link RateStateBackend} can hold a reliable in-flight count
24
- * and release it on permit.release). On `esm_workers` it is intentionally NOT
25
- * enforced: a run fans across V8 isolates and a dying isolate cannot guarantee
26
- * the release signal a leased in-flight count would require, so the
27
- * coordinator DO debits `requestsPerWindow` only. The Governor's global
28
- * tool-concurrency semaphore is the cross-isolate in-flight backstop there.
29
- * `requestsPerWindow`/`windowMs` (the request-RATE governor) ARE enforced on
30
- * both substrates. See coordinator-rate-state-backend.ts and dedup-do.ts
31
- * (computeRateAcquire) for the workers side.
17
+ * The CJS runtime holds a reliable in-flight count and releases it on
18
+ * permit.release. `requestsPerWindow`/`windowMs` enforce request rate.
32
19
  */
33
20
  readonly maxConcurrency: number | null;
34
21
  }
@@ -60,25 +47,21 @@ export interface PacingPermit {
60
47
  * Discriminates the backend so the Governor can adapt its policy to it. Only
61
48
  * `app_runtime_postgres` (the Absurd/Node substrate's DB-backed pacer) is
62
49
  * db-authoritative: it runs the whole token-bucket + AIMD in Postgres, so the
63
- * Governor's in-memory adaptive admission must become a passthrough and defer
64
- * pacing to the row. The in-memory and coordinator backends leave `kind`
65
- * undefined and keep the Governor's in-memory adaptive admission (byte-identical
66
- * to today).
50
+ * Governor's in-memory adaptive admission becomes a passthrough and defers
51
+ * pacing to the row. The in-memory backend leaves `kind` undefined.
67
52
  */
68
53
  export type RateStateBackendKind = 'app_runtime_postgres';
69
54
 
70
55
  export interface RateStateBackend {
71
56
  /**
72
57
  * When present, tells the Governor this backend owns pacing authoritatively.
73
- * Absent on the in-memory and coordinator backends — those keep the Governor's
74
- * in-memory adaptive admission.
58
+ * Absent on the in-memory backend.
75
59
  */
76
60
  readonly kind?: RateStateBackendKind;
77
61
 
78
62
  /**
79
63
  * Block until one outbound call is permitted for `bucketId` under all `rules`
80
- * (request windows always; per-rule `maxConcurrency` only on the in-memory
81
- * `cjs_node20` backend — see {@link PacingRule.maxConcurrency}), then debit and
64
+ * (request windows and per-rule `maxConcurrency`), then debit and
82
65
  * return a permit. `bucketId` is `${orgId}:${provider}` so the window is global
83
66
  * per (org, provider). Resolves immediately when `rules` is empty (provider has
84
67
  * no configured limit — pacing is a no-op, the global tool-concurrency backstop
@@ -6,8 +6,7 @@
6
6
  * machine-generated source line range (`lines_<startLine>_<endLine>`, built in
7
7
  * `src/lib/plays/static-analysis.ts` → `createCodeStageForStatements`). The
8
8
  * execution plan / runtime node ids namespace every substep by its type
9
- * (`getStaticSubstepNodeId` in `src/lib/plays/step-progress.ts` and
10
- * `apps/play-runner-workers/src/entry.ts`), so glue nodes are ALWAYS
9
+ * (`getStaticSubstepNodeId` in `src/lib/plays/step-progress.ts`), so glue nodes are ALWAYS
11
10
  * `run_javascript:<alias>` on the wire (ledger stepsById, snapshot
12
11
  * nodeStates, `play.step.*` stream events).
13
12
  *
@@ -3,7 +3,7 @@ import {
3
3
  derivePlayRowIdentityFromKey,
4
4
  // Relative (not '@shared_libs/...') because this file ships inside the
5
5
  // packed SDK's dist/bundling-sources graph (reachable from the
6
- // apps/play-runner-workers entry), where only relative imports resolve.
6
+ // packaged runner entry), where only relative imports resolve.
7
7
  } from '../plays/row-identity';
8
8
  import type { MapExecutionScope } from './ctx-types';
9
9