@substrat-run/adapter-cloudflare 0.235.0 → 0.237.0

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 (73) hide show
  1. package/dist/broker-facet-seam.d.ts +126 -0
  2. package/dist/broker-facet-seam.d.ts.map +1 -0
  3. package/dist/broker-facet-seam.js +67 -0
  4. package/dist/broker-facet-seam.js.map +1 -0
  5. package/dist/connection-sweep-do.d.ts +3 -3
  6. package/dist/connection-sweep-do.d.ts.map +1 -1
  7. package/dist/connection-sweep-do.js +1 -1
  8. package/dist/connection-sweep-do.js.map +1 -1
  9. package/dist/control-plane-do.d.ts +19 -12
  10. package/dist/control-plane-do.d.ts.map +1 -1
  11. package/dist/control-plane-do.js +68 -38
  12. package/dist/control-plane-do.js.map +1 -1
  13. package/dist/delivery-broker-do.d.ts +31 -1
  14. package/dist/delivery-broker-do.d.ts.map +1 -1
  15. package/dist/delivery-broker-do.js +122 -12
  16. package/dist/delivery-broker-do.js.map +1 -1
  17. package/dist/delivery-broker-facet.d.ts +46 -0
  18. package/dist/delivery-broker-facet.d.ts.map +1 -0
  19. package/dist/delivery-broker-facet.js +71 -0
  20. package/dist/delivery-broker-facet.js.map +1 -0
  21. package/dist/delivery-broker-supervisor-do.d.ts +88 -0
  22. package/dist/delivery-broker-supervisor-do.d.ts.map +1 -0
  23. package/dist/delivery-broker-supervisor-do.js +381 -0
  24. package/dist/delivery-broker-supervisor-do.js.map +1 -0
  25. package/dist/directory-cutover.d.ts +9 -0
  26. package/dist/directory-cutover.d.ts.map +1 -1
  27. package/dist/directory-cutover.js +33 -4
  28. package/dist/directory-cutover.js.map +1 -1
  29. package/dist/directory-split-inventory.js +1 -1
  30. package/dist/directory-split-inventory.js.map +1 -1
  31. package/dist/host.d.ts +33 -2
  32. package/dist/host.d.ts.map +1 -1
  33. package/dist/host.js +72 -1
  34. package/dist/host.js.map +1 -1
  35. package/dist/index.d.ts +5 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +8 -1
  38. package/dist/index.js.map +1 -1
  39. package/dist/peer-read-evidence.d.ts +118 -0
  40. package/dist/peer-read-evidence.d.ts.map +1 -0
  41. package/dist/peer-read-evidence.js +223 -0
  42. package/dist/peer-read-evidence.js.map +1 -0
  43. package/dist/route-read-model.d.ts +9 -0
  44. package/dist/route-read-model.d.ts.map +1 -1
  45. package/dist/route-read-model.js +34 -20
  46. package/dist/route-read-model.js.map +1 -1
  47. package/dist/route-resolver.d.ts +23 -3
  48. package/dist/route-resolver.d.ts.map +1 -1
  49. package/dist/route-resolver.js +12 -9
  50. package/dist/route-resolver.js.map +1 -1
  51. package/dist/scope-do.d.ts.map +1 -1
  52. package/dist/scope-do.js +5 -1
  53. package/dist/scope-do.js.map +1 -1
  54. package/dist/scope-supervisor-do.d.ts +8 -0
  55. package/dist/scope-supervisor-do.d.ts.map +1 -1
  56. package/dist/scope-supervisor-do.js +74 -3
  57. package/dist/scope-supervisor-do.js.map +1 -1
  58. package/dist/scope-work.d.ts +1 -1
  59. package/dist/scope-work.js +1 -1
  60. package/dist/scope-work.js.map +1 -1
  61. package/dist/supervisor-identity.d.ts +82 -0
  62. package/dist/supervisor-identity.d.ts.map +1 -0
  63. package/dist/supervisor-identity.js +128 -0
  64. package/dist/supervisor-identity.js.map +1 -0
  65. package/dist/supplied-delivery-broker.d.ts +3 -0
  66. package/dist/supplied-delivery-broker.d.ts.map +1 -1
  67. package/dist/supplied-delivery-broker.js +3 -0
  68. package/dist/supplied-delivery-broker.js.map +1 -1
  69. package/dist/tenant-due-work-do.d.ts +46 -2
  70. package/dist/tenant-due-work-do.d.ts.map +1 -1
  71. package/dist/tenant-due-work-do.js +62 -12
  72. package/dist/tenant-due-work-do.js.map +1 -1
  73. package/package.json +12 -12
@@ -0,0 +1,381 @@
1
+ /**
2
+ * Track B (broker RFC §6.2, #3466): the delivery broker's supervisor — the class a script would
3
+ * execute for its brokers when a broker runs as a facet. Platform code only. Switched: nothing on
4
+ * `main` exports it from a deployed script, and the uploader supplies the broker as an object, so
5
+ * every broker still runs as it did (`docs/architecture/scope-facets.md` §8).
6
+ *
7
+ * One object per broker, `brokerName(tenant, app, environment)`, as today, in two layers:
8
+ *
9
+ * - **This supervisor** receives every call, holds the alarm, holds the platform's bindings (the
10
+ * `SCOPE` namespace, the control plane's origin, the platform secret), and keeps one table of its
11
+ * own, `_substrat_supervisor`, in the object's storage: the rollback fence's marker, the wake the
12
+ * facet asked for, and the scopes whose handoffs it carried. Its SQL names that table literally.
13
+ * - **The facet** holds the broker: the kernel's `BrokerStore` over a SQLite database of its own,
14
+ * its retries, pauses, lanes and dead letter. Its code arrives inert (`code`, the
15
+ * `defineDeliveryBrokerFacet` class bundled as text), and is loaded through the Worker Loader with
16
+ * `globalOutbound: null` and an empty env.
17
+ *
18
+ * **The pins** come from the object's own name, which the platform chose when it addressed the
19
+ * broker (`idFromName(brokerName(…))`), never from the facet. An object with no name, or named for
20
+ * another app than this script's, refuses every call. The isolate id is the whole name under the
21
+ * release, so two tenants, two apps or two environments never share an isolate, and the name can be
22
+ * compiled into the facet's entry as a constant: the loader caches an isolate's code under its id.
23
+ *
24
+ * **The alarm** is armed before every call into the facet but a read (`BROKER_READ_METHODS`) and `sync()`ed, as the scope supervisor's
25
+ * is (`spikes/scope-facet-wakeups`): a message the facet accepts lives in the facet's database and
26
+ * the alarm in this object's, so no single commit holds both, and the pre-arm is what keeps an
27
+ * accepted message from ever being left without a wake. After the call, the facet's answer carries
28
+ * the broker's next wake, read from its store, and the alarm moves to it once no call is in flight.
29
+ * A call that fails leaves a wake `prearmMs` out; the alarm arms again before it forwards, so a pass
30
+ * that dies halfway runs again from this alarm.
31
+ *
32
+ * **What reaches out** goes through a handle made per call (`BrokerPlatformHandle`): a scope read, a
33
+ * witness, a drain or a lake ship. Each is pinned to this broker's tenant, and a scope is reachable
34
+ * only once a handoff from it has passed through this supervisor (`#admit`), so a facet can never
35
+ * read a scope of another tenant that shares the app's `SCOPE` namespace.
36
+ */
37
+ import { DurableObject, RpcTarget } from 'cloudflare:workers';
38
+ import { brokerIdsOf, DeliveryFailure, } from '@substrat-run/kernel';
39
+ import { BROKER_FACET, BROKER_FACET_CLASS, BROKER_READ_METHODS, BROKER_SCOPE_READS, BrokerFacetFenced, brokerRpcMethods, holdsBrokerData, } from './broker-facet-seam.js';
40
+ import { askControlPlaneToDrain, askControlPlaneToShip } from './delivery-broker-platform.js';
41
+ import { servedBySupervisor } from './scope-facets.js';
42
+ /** See `DeliveryBrokerSupervisorOptions.prearmMs`. */
43
+ export const DEFAULT_BROKER_PREARM_MS = 30_000;
44
+ /** The generated module the supervisor puts in front of the bundle, so the env stays empty. */
45
+ const FACET_ENTRY_MODULE = 'substrat-broker-facet.js';
46
+ /** The marker table's keys; a vouched scope is `scope:<id>`. */
47
+ const KEY_SERVED_SINCE = 'served_since';
48
+ const KEY_WANT_AT = 'want_at';
49
+ const SCOPE_KEY = 'scope:';
50
+ /**
51
+ * The module the facet is loaded through: the bundle's class, constructed with the broker's name as a
52
+ * constant compiled into code, so the Worker Loader's env stays `{}` and no binding or secret reaches
53
+ * the facet. The name is safe as a constant because the isolate id carries all of it. Exported for
54
+ * the test that reads it.
55
+ */
56
+ export function brokerFacetEntrySource(mainModule, className, constants) {
57
+ return [
58
+ `import * as bundle from ${JSON.stringify(`./${mainModule}`)};`,
59
+ `const constants = Object.freeze(${JSON.stringify(constants)});`,
60
+ `const Facet = bundle[${JSON.stringify(className)}];`,
61
+ `if (typeof Facet !== 'function') throw new Error(${JSON.stringify(`broker bundle: no export '${className}'`)});`,
62
+ `export class ${BROKER_FACET_CLASS} extends Facet {`,
63
+ ` constructor(ctx, env) { super(ctx, { ...constants }); }`,
64
+ `}`,
65
+ ].join('\n');
66
+ }
67
+ /** A delivery failure as plain values, since its detail does not survive the RPC hop (`BrokerAsk`). */
68
+ function askFailed(err) {
69
+ const message = err instanceof Error ? err.message : String(err);
70
+ if (!(err instanceof DeliveryFailure))
71
+ return { ok: false, message };
72
+ return {
73
+ ok: false,
74
+ message,
75
+ ...(err.status !== undefined ? { status: err.status } : {}),
76
+ ...(err.retryAfterMs !== undefined ? { retryAfterMs: err.retryAfterMs } : {}),
77
+ ...(err.permanent !== undefined ? { permanent: err.permanent } : {}),
78
+ };
79
+ }
80
+ /**
81
+ * What a broker facet may ask its supervisor for during one call (`BrokerPlatformHandle`). Built per
82
+ * call and passed with it. Every request is pinned to this broker's tenant and to a scope whose
83
+ * handoff passed through this supervisor; the secret and the bindings are read here and never handed on.
84
+ */
85
+ class BrokerPlatform extends RpcTarget {
86
+ #pins;
87
+ #env;
88
+ #vouched;
89
+ constructor(pins, env, vouched) {
90
+ super();
91
+ this.#pins = pins;
92
+ this.#env = env;
93
+ this.#vouched = vouched;
94
+ }
95
+ #scope(what, scopeId) {
96
+ if (typeof scopeId !== 'string' || !this.#vouched(scopeId)) {
97
+ throw new Error(`broker supervisor: ${what} refused: no handoff from that scope has reached this broker`);
98
+ }
99
+ const ns = this.#env.SCOPE;
100
+ if (!ns)
101
+ throw new Error(`broker supervisor: ${what} refused: no scope namespace is bound`);
102
+ return ns.get(ns.idFromName(scopeId));
103
+ }
104
+ #message(what, m) {
105
+ if (m?.tenantId !== this.#pins.tenantId)
106
+ throw new Error(`broker supervisor: ${what} refused: it names another tenant than this broker's`);
107
+ this.#scope(what, m.scopeId);
108
+ return { tenantId: this.#pins.tenantId, scopeId: m.scopeId };
109
+ }
110
+ async scopeState(scopeId, read, id) {
111
+ if (!BROKER_SCOPE_READS.includes(read)) {
112
+ throw new Error(`broker supervisor: a scope read refused: '${String(read)}' is not a broker's`);
113
+ }
114
+ return this.#scope('a scope read', scopeId)[read](id);
115
+ }
116
+ async witness(scopeId, after, before, limit, since) {
117
+ return this.#scope('a witness read', scopeId).deliveryWitness(after, before, limit, ...(since === undefined ? [] : [since]));
118
+ }
119
+ async drain(message) {
120
+ const m = this.#message('a drain ask', message);
121
+ try {
122
+ return { ok: true, value: await askControlPlaneToDrain(this.#env, m) };
123
+ }
124
+ catch (err) {
125
+ return askFailed(err);
126
+ }
127
+ }
128
+ async ship(message) {
129
+ const m = this.#message('a lake ship', message);
130
+ try {
131
+ return { ok: true, value: await askControlPlaneToShip(this.#env, m) };
132
+ }
133
+ catch (err) {
134
+ return askFailed(err);
135
+ }
136
+ }
137
+ }
138
+ const FORWARD = Symbol('broker supervisor forward');
139
+ export function defineDeliveryBrokerSupervisorDO(options) {
140
+ const prearmMs = options.prearmMs ?? DEFAULT_BROKER_PREARM_MS;
141
+ if (!(prearmMs > 0))
142
+ throw new Error('broker supervisor: prearmMs must be positive');
143
+ // The platform's own surface, whatever a bundle adds: no app code is read to decide it.
144
+ const forwarded = new Set([...brokerRpcMethods(), ...(options.forward ?? [])]);
145
+ class DeliveryBrokerSupervisor extends DurableObject {
146
+ /** Calls into the facet that have armed and not yet settled: the pre-arm is theirs while > 0. */
147
+ #inflight = 0;
148
+ /** Why this object refuses every call (a fence, or a name it cannot serve), or null. */
149
+ #fenced;
150
+ #pins;
151
+ constructor(ctx, env) {
152
+ super(ctx, env);
153
+ const storage = ctx.storage;
154
+ const named = ctx.id.name;
155
+ const ids = brokerIdsOf(named);
156
+ const app = env.SUBSTRAT_VERTICAL ?? options.app;
157
+ // Before anything is written: a name this supervisor cannot pin, or an existing broker's rows.
158
+ if (named === undefined || ids.tenantId === '' || ids.app === '') {
159
+ this.#pins = null;
160
+ this.#fenced = 'broker supervisor: this object has no broker name (tenant/app[@environment]) to pin its facet to';
161
+ return;
162
+ }
163
+ if (ids.app !== app) {
164
+ this.#pins = null;
165
+ this.#fenced = `broker supervisor: this object is named for app '${ids.app}', and this script serves '${app}'`;
166
+ return;
167
+ }
168
+ this.#pins = { name: named, tenantId: ids.tenantId, app: ids.app, ...(ids.environment ? { environment: ids.environment } : {}) };
169
+ if (!servedBySupervisor(storage) && holdsBrokerData(storage)) {
170
+ this.#fenced =
171
+ 'BrokerFacetFenced: this broker holds messages in its own object storage (it ran before brokers ' +
172
+ 'became facets). The broker supervisor serves new brokers only, and moving a broker into a facet ' +
173
+ 'is not built: serve this script with the broker class as an object';
174
+ return;
175
+ }
176
+ this.#fenced = null;
177
+ // The rollback fence's marker, before any call can reach the facet (`assertBrokerNotSupervised`).
178
+ storage.sql.exec(`CREATE TABLE IF NOT EXISTS _substrat_supervisor (key TEXT PRIMARY KEY, value TEXT NOT NULL)`);
179
+ storage.sql.exec(`INSERT OR IGNORE INTO _substrat_supervisor (key, value) VALUES (?, ?)`, KEY_SERVED_SINCE, new Date().toISOString());
180
+ }
181
+ // -- the supervisor's own table ---------------------------------------------------------
182
+ #read(key) {
183
+ const row = this.ctx.storage.sql
184
+ .exec(`SELECT value FROM _substrat_supervisor WHERE key = ?`, key)
185
+ .toArray()[0];
186
+ return row?.value ?? null;
187
+ }
188
+ #write(key, value) {
189
+ if (value === null)
190
+ this.ctx.storage.sql.exec(`DELETE FROM _substrat_supervisor WHERE key = ?`, key);
191
+ else
192
+ this.ctx.storage.sql.exec(`INSERT OR REPLACE INTO _substrat_supervisor (key, value) VALUES (?, ?)`, key, value);
193
+ }
194
+ #wantAt() {
195
+ const v = this.#read(KEY_WANT_AT);
196
+ return v === null ? null : Number(v);
197
+ }
198
+ #want(at) {
199
+ const current = this.#wantAt();
200
+ if (current === null || at < current)
201
+ this.#write(KEY_WANT_AT, String(at));
202
+ }
203
+ /** Has a handoff from this scope passed through here? What the handle reaches a scope by. */
204
+ #vouched(scopeId) {
205
+ return this.#read(SCOPE_KEY + scopeId) !== null;
206
+ }
207
+ // -- the pins ---------------------------------------------------------------------------
208
+ #refuseIfFenced() {
209
+ if (this.#fenced !== null || this.#pins === null)
210
+ throw new BrokerFacetFenced(this.#fenced ?? 'broker supervisor: unpinned');
211
+ return this.#pins;
212
+ }
213
+ /**
214
+ * What a call names, checked before it reaches the facet: every tenant a scope's call or a
215
+ * relayed envelope names is this broker's, and each scope a handoff names is recorded as one this broker may reach.
216
+ */
217
+ #admit(pins, method, args) {
218
+ const refuse = (what) => {
219
+ throw new Error(`broker supervisor: '${method}' refused: it names ${what} than this broker's`);
220
+ };
221
+ if (method === 'handOff') {
222
+ const messages = Array.isArray(args[0]) ? args[0] : [];
223
+ const start = args[1]?.start;
224
+ const scopes = new Set();
225
+ for (const m of [...messages, ...(start ? [start] : [])]) {
226
+ if (m?.tenantId !== pins.tenantId)
227
+ refuse('another tenant');
228
+ if (typeof m.scopeId !== 'string' || m.scopeId === '')
229
+ refuse('no scope');
230
+ scopes.add(m.scopeId);
231
+ }
232
+ for (const scopeId of scopes) {
233
+ this.ctx.storage.sql.exec(`INSERT OR IGNORE INTO _substrat_supervisor (key, value) VALUES (?, ?)`, SCOPE_KEY + scopeId, pins.tenantId);
234
+ }
235
+ }
236
+ else if (method === 'marks') {
237
+ if (args[0] !== pins.tenantId)
238
+ refuse('another tenant');
239
+ }
240
+ else if (method === 'eraseSubject' || method === 'acceptRelayed') {
241
+ // A subject's erasure, or a relayed envelope (#3469): its `tenantId` is the tenant it is for.
242
+ if (args[0]?.tenantId !== pins.tenantId)
243
+ refuse('another tenant');
244
+ }
245
+ }
246
+ // -- the facet --------------------------------------------------------------------------
247
+ #facet(pins) {
248
+ const release = this.env.SUBSTRAT_VERSION_ID ?? 'unversioned';
249
+ const id = `${release}:broker:${pins.name}`;
250
+ return this.ctx.facets.get(BROKER_FACET, () => {
251
+ const worker = this.env.SCOPE_LOADER.get(id, () => this.#code(pins));
252
+ return { class: worker.getDurableObjectClass(BROKER_FACET_CLASS) };
253
+ });
254
+ }
255
+ #code(pins) {
256
+ const code = typeof options.code === 'function' ? options.code(this.env) : options.code;
257
+ if (FACET_ENTRY_MODULE in code.modules)
258
+ throw new Error(`broker bundle: '${FACET_ENTRY_MODULE}' is the supervisor's`);
259
+ return {
260
+ compatibilityDate: code.compatibilityDate,
261
+ ...(code.compatibilityFlags ? { compatibilityFlags: [...code.compatibilityFlags] } : {}),
262
+ mainModule: FACET_ENTRY_MODULE,
263
+ modules: {
264
+ ...code.modules,
265
+ [FACET_ENTRY_MODULE]: brokerFacetEntrySource(code.mainModule, code.className ?? BROKER_FACET_CLASS, {
266
+ SUBSTRAT_BROKER_NAME: pins.name,
267
+ }),
268
+ },
269
+ env: {},
270
+ globalOutbound: null,
271
+ ...(options.limits ? { limits: { ...options.limits } } : {}),
272
+ };
273
+ }
274
+ #handle(pins) {
275
+ return new BrokerPlatform(pins, this.env, (scopeId) => this.#vouched(scopeId));
276
+ }
277
+ // -- the alarm --------------------------------------------------------------------------
278
+ /** Arm no later than `prearmMs` from now, and wait until that is durable. */
279
+ async #preArm() {
280
+ const at = Date.now() + prearmMs;
281
+ const current = await this.ctx.storage.getAlarm();
282
+ if (current === null || current > at)
283
+ await this.ctx.storage.setAlarm(at);
284
+ await this.ctx.storage.sync();
285
+ }
286
+ /** What a settled call tells the supervisor: the broker's next wake, or that the call failed. */
287
+ #note(reply) {
288
+ if (reply === undefined)
289
+ this.#want(Date.now() + prearmMs);
290
+ else if (reply.wakeAt !== null)
291
+ this.#want(reply.wakeAt);
292
+ }
293
+ /** Move the alarm to the wake wanted; while a call is in flight, only ever earlier. */
294
+ async #settleAlarm() {
295
+ const target = this.#wantAt();
296
+ const current = await this.ctx.storage.getAlarm();
297
+ if (this.#inflight > 0) {
298
+ if (target !== null && (current === null || target < current))
299
+ await this.ctx.storage.setAlarm(target);
300
+ return;
301
+ }
302
+ if (target === null) {
303
+ if (current !== null)
304
+ await this.ctx.storage.deleteAlarm();
305
+ }
306
+ else if (current !== target) {
307
+ await this.ctx.storage.setAlarm(target);
308
+ }
309
+ }
310
+ /** One call into the facet, under the pre-arm. */
311
+ async [FORWARD](method, args) {
312
+ const pins = this.#refuseIfFenced();
313
+ if (!forwarded.has(method))
314
+ throw new Error(`broker supervisor: '${method}' is not forwarded`);
315
+ this.#admit(pins, method, args);
316
+ // A read accepts and moves nothing, so it needs no wake of its own: no pre-arm, no settle.
317
+ if (BROKER_READ_METHODS.has(method))
318
+ return (await this.#facet(pins).supervisedCall(method, args, this.#handle(pins))).value;
319
+ this.#inflight += 1;
320
+ let reply;
321
+ try {
322
+ await this.#preArm();
323
+ reply = await this.#facet(pins).supervisedCall(method, args, this.#handle(pins));
324
+ return reply.value;
325
+ }
326
+ finally {
327
+ this.#inflight -= 1;
328
+ try {
329
+ this.#note(reply);
330
+ await this.#settleAlarm();
331
+ }
332
+ catch (err) {
333
+ // The pre-arm stands, so a failure here costs an early alarm, never a lost one.
334
+ console.error('substrat: broker supervisor could not settle its alarm', err);
335
+ }
336
+ }
337
+ }
338
+ async alarm() {
339
+ if (this.#fenced !== null || this.#pins === null)
340
+ return;
341
+ const pins = this.#pins;
342
+ this.#inflight += 1;
343
+ let reply;
344
+ try {
345
+ // Arm again first, so this pass is covered whatever happens below.
346
+ await this.#preArm();
347
+ const want = this.#wantAt();
348
+ if (want !== null && want <= Date.now())
349
+ this.#write(KEY_WANT_AT, null);
350
+ reply = await this.#facet(pins).supervisedCall('alarm', [], this.#handle(pins));
351
+ }
352
+ catch (err) {
353
+ console.error('substrat: broker facet alarm failed; armed again', err);
354
+ }
355
+ finally {
356
+ this.#inflight -= 1;
357
+ try {
358
+ this.#note(reply);
359
+ await this.#settleAlarm();
360
+ }
361
+ catch (err) {
362
+ console.error('substrat: broker supervisor could not settle its alarm', err);
363
+ }
364
+ }
365
+ }
366
+ }
367
+ // The broker's RPC surface, each method a call into the facet under the pre-arm.
368
+ for (const name of forwarded) {
369
+ if (Object.prototype.hasOwnProperty.call(DeliveryBrokerSupervisor.prototype, name))
370
+ continue;
371
+ Object.defineProperty(DeliveryBrokerSupervisor.prototype, name, {
372
+ value: function (...args) {
373
+ return this[FORWARD](name, args);
374
+ },
375
+ writable: true,
376
+ configurable: true,
377
+ });
378
+ }
379
+ return DeliveryBrokerSupervisor;
380
+ }
381
+ //# sourceMappingURL=delivery-broker-supervisor-do.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delivery-broker-supervisor-do.js","sourceRoot":"","sources":["../src/delivery-broker-supervisor-do.ts"],"names":[],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ACH,CAAC;QACH,CAAC;KACF;IAED,iFAAiF;IACjF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,wBAAwB,CAAC,SAAS,EAAE,IAAI,CAAC;YAAE,SAAS;QAC7F,MAAM,CAAC,cAAc,CAAC,wBAAwB,CAAC,SAAS,EAAE,IAAI,EAAE;YAC9D,KAAK,EAAE,UAA0C,GAAG,IAAe;gBACjE,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACnC,CAAC;YACD,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,IAAI;SACnB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,wBAAwB,CAAC;AAClC,CAAC"}
@@ -14,6 +14,12 @@ import type { TupleOp, TupleOpResult, TupleRead } from './directory-tenant-tuple
14
14
  export declare const CUTOVER_TABLES: readonly string[];
15
15
  export declare const CUTOVER_TABLE_SET: ReadonlySet<string>;
16
16
  export type CutoverState = 'on' | 'draining' | 'off';
17
+ /** A staff read of the gates for a future flip on. */
18
+ export interface CutoverPreflight {
19
+ tenantId: string;
20
+ status: 'ready' | 'blocked' | 'on' | 'draining';
21
+ reason: string | null;
22
+ }
17
23
  /** The flag as the registry records it (`directory_tenant_cutover`). */
18
24
  export interface CutoverRecord {
19
25
  tenantId: string;
@@ -344,6 +350,9 @@ export declare class DirectoryCutover {
344
350
  firstOf(owner: string): readonly string[] | null;
345
351
  /** Why `tenantId` may not be flipped on now, or null. Synchronous: run in the flip's transaction. */
346
352
  refusal(tenantId: string): string | null;
353
+ private preflightGate;
354
+ /** Ask the same gates as a flip on, without changing either object's marker or data. */
355
+ preflight(tenantId: string): Promise<CutoverPreflight>;
347
356
  /**
348
357
  * Flip a tenant on (gated, `refusal`) or off (draining, then off once the directory holds every
349
358
  * write the object made first). Answers the tenant's row as it stands after the call.
@@ -1 +1 @@
1
- {"version":3,"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BzB"}
@@ -53,8 +53,8 @@
53
53
  *
54
54
  * **The gate, in code** (`refusal`, in the same transaction as the flag's write): the switch is on;
55
55
  * 3b's dual-write is on for every table a tenant object holds; 3d's comparison is on and its last
56
- * finished comparison of this tenant verified, with nothing in flight, nothing truncated, after the
57
- * last table was switched on, within `verifyMaxAgeMs`, and its receipt (`DirectoryVerify.receiptOf`)
56
+ * finished comparison of this tenant verified, with nothing in flight and neither rows nor routing
57
+ * entries truncated, after the last table was switched on, within `verifyMaxAgeMs`, and its receipt (`DirectoryVerify.receiptOf`)
58
58
  * shows every table the flip freezes in (`CUTOVER_TABLES`) compared; 3c's backfill filled it if it ran; the
59
59
  * tenant is `active`; nothing for it is queued in the dual-write's outbox or its claim work; and the
60
60
  * object holds nothing parked (asked just before).
@@ -268,6 +268,7 @@ export function tenantCutoverParityOf(tenantId, known, directory, registry, cove
268
268
  }
269
269
  /** Why a receipt with changes in flight is not evidence: the gate's refusal (`refusal`) and this read's reason. */
270
270
  const CHANGES_IN_FLIGHT = 'the last comparison of this tenant had changes in flight';
271
+ const ROUTES_TRUNCATED = 'the last comparison of this tenant read only part of its routing entries (truncated)';
271
272
  /** The flag's frozen tables judged against the tenant's comparison receipt (`DirectoryVerify.receiptOf`). */
272
273
  export function cutoverCoverageOf(frozen, receipt) {
273
274
  if (!receipt) {
@@ -286,6 +287,8 @@ export function cutoverCoverageOf(frozen, receipt) {
286
287
  return { standing: 'incomplete', ...at, reason: `the last comparison of this tenant stopped on an error: ${result.error}` };
287
288
  if (result.truncated > 0)
288
289
  return { standing: 'incomplete', ...at, reason: 'the last comparison of this tenant read a range only in part (truncated)' };
290
+ if (result.entries?.truncated)
291
+ return { standing: 'incomplete', ...at, reason: ROUTES_TRUNCATED };
289
292
  if (!result.verified)
290
293
  return { standing: 'incomplete', ...at, reason: 'the last comparison of this tenant did not verify' };
291
294
  if (receipt.tables === null) {
@@ -402,6 +405,7 @@ export const CUTOVER_ALARM_TENANTS = 50;
402
405
  const DRAIN_PAGES = 20;
403
406
  const tenantPrefix = tenantOwnerOf('');
404
407
  const conflict = (message) => substratError('conflict', message);
408
+ const parkedReason = (count) => `its object holds ${count} parked change(s)`;
405
409
  /** The directory's half of 3e, one per `ControlPlaneDO` instance while the switch is on or a tenant is not off. */
406
410
  export class DirectoryCutover {
407
411
  options;
@@ -492,8 +496,10 @@ export class DirectoryCutover {
492
496
  return 'the comparison has not finished for this tenant';
493
497
  if (!result.verified)
494
498
  return 'the last comparison of this tenant found differences';
495
- if (result.inFlight > 0)
499
+ if (result.inFlight > 0 || result.entries?.inFlight)
496
500
  return `${CHANGES_IN_FLIGHT}; compare again`;
501
+ if (result.entries?.truncated)
502
+ return ROUTES_TRUNCATED;
497
503
  if (result.filled === false)
498
504
  return 'the backfill had not filled this tenant when it was compared';
499
505
  const lastSince = [...since.values()].sort().at(-1) ?? '';
@@ -520,6 +526,29 @@ export class DirectoryCutover {
520
526
  }
521
527
  return null;
522
528
  }
529
+ preflightGate(tenantId) {
530
+ const state = this.flag(tenantId)?.state;
531
+ if (state === 'on' || state === 'draining')
532
+ return { tenantId, status: state, reason: null };
533
+ const reason = this.refusal(tenantId);
534
+ return { tenantId, status: reason === null ? 'ready' : 'blocked', reason };
535
+ }
536
+ /** Ask the same gates as a flip on, without changing either object's marker or data. */
537
+ async preflight(tenantId) {
538
+ const before = this.preflightGate(tenantId);
539
+ if (before.status !== 'ready')
540
+ return before;
541
+ const parked = await this.options.sender.parked(tenantOwnerOf(tenantId)).catch(() => undefined);
542
+ // The local conditions can change while the tenant object answers. A real flip will check again.
543
+ const after = this.preflightGate(tenantId);
544
+ if (after.status !== 'ready')
545
+ return after;
546
+ if (parked === undefined)
547
+ return { tenantId, status: 'blocked', reason: "the tenant object's parked changes could not be read" };
548
+ if (parked > 0)
549
+ return { tenantId, status: 'blocked', reason: parkedReason(parked) };
550
+ return after;
551
+ }
523
552
  /**
524
553
  * Flip a tenant on (gated, `refusal`) or off (draining, then off once the directory holds every
525
554
  * write the object made first). Answers the tenant's row as it stands after the call.
@@ -534,7 +563,7 @@ export class DirectoryCutover {
534
563
  // and a batch for this tenant holds outbox rows until it is acknowledged, which the gate refuses.
535
564
  const parked = await this.options.sender.parked(owner);
536
565
  if (parked > 0)
537
- throw conflict(`directory cutover refused for ${tenantId}: its object holds ${parked} parked change(s)`);
566
+ throw conflict(`directory cutover refused for ${tenantId}: ${parkedReason(parked)}`);
538
567
  this.options.transaction(() => {
539
568
  const refused = this.refusal(tenantId);
540
569
  if (refused)