@yielded/agent-storage-cloudflare 0.1.0-beta.167 → 0.1.0-beta.168
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.
- package/dist/DoMemoryStore.mjs +1 -1
- package/dist/DoMessageDeliveryStore.d.mts +1 -1
- package/dist/DoMessageDeliveryStore.mjs +3 -2
- package/dist/DoMessageDeliveryStore.mjs.map +1 -1
- package/dist/DoScheduleStore.mjs +16 -37
- package/dist/DoScheduleStore.mjs.map +1 -1
- package/dist/DoStorageConfig.d.mts +2 -10
- package/dist/DoStorageConfig.mjs +2 -11
- package/dist/DoStorageConfig.mjs.map +1 -1
- package/dist/{DoStorageError-CGuAfSwF.d.mts → DoStorageError-CxjMnzUA.d.mts} +7 -18
- package/dist/DoStorageError.d.mts +2 -2
- package/dist/DoStorageError.mjs +14 -30
- package/dist/DoStorageError.mjs.map +1 -1
- package/dist/DoStorageFailpoint.d.mts +1 -1
- package/dist/DoStorageFailpointTesting.d.mts +1 -1
- package/dist/{DoStorageVersion-iNSyi3cJ.d.mts → DoStorageVersion-DTFoLglB.d.mts} +3 -4
- package/dist/DoStorageVersion.d.mts +1 -1
- package/dist/DoStorageVersion.mjs +2 -2
- package/dist/DoStorageVersion.mjs.map +1 -1
- package/dist/DoSubmissionLedger.d.mts +7 -5
- package/dist/DoSubmissionLedger.mjs +378 -528
- package/dist/DoSubmissionLedger.mjs.map +1 -1
- package/dist/DoSubscriptionStore.mjs +5 -24
- package/dist/DoSubscriptionStore.mjs.map +1 -1
- package/dist/{DoThreadStore-D_83OjCH.d.mts → DoThreadStore-Bd4fTns3.d.mts} +17 -18
- package/dist/DoThreadStore-CwBvTLoq.mjs +468 -0
- package/dist/DoThreadStore-CwBvTLoq.mjs.map +1 -0
- package/dist/DoThreadStore.d.mts +2 -2
- package/dist/DoThreadStore.mjs +4 -529
- package/dist/MemoryProtocol.mjs +3 -3
- package/dist/MemoryProtocol.mjs.map +1 -1
- package/dist/PortProtocol.d.mts +11727 -3410
- package/dist/PortProtocol.mjs +103 -15
- package/dist/PortProtocol.mjs.map +1 -1
- package/dist/PortRouting.d.mts +14 -9
- package/dist/PortRouting.mjs +155 -29
- package/dist/PortRouting.mjs.map +1 -1
- package/dist/do-journal-Cawnsetj.mjs +761 -0
- package/dist/do-journal-Cawnsetj.mjs.map +1 -0
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/migrations-D_EP3KYf.mjs +148 -0
- package/dist/migrations-D_EP3KYf.mjs.map +1 -0
- package/dist/{owned-state-DHm2aRXx.mjs → owned-state-BHzUi0eb.mjs} +50 -19
- package/dist/owned-state-BHzUi0eb.mjs.map +1 -0
- package/package.json +1 -1
- package/src/DoMessageDeliveryStore.ts +2 -1
- package/src/DoScheduleStore.ts +19 -59
- package/src/DoStorageConfig.ts +2 -11
- package/src/DoStorageError.ts +3 -26
- package/src/DoStorageVersion.ts +1 -1
- package/src/DoSubmissionLedger.ts +1806 -2030
- package/src/DoSubscriptionStore.ts +5 -47
- package/src/DoThreadStore.ts +276 -622
- package/src/MemoryProtocol.ts +3 -3
- package/src/PortProtocol.ts +198 -12
- package/src/PortRouting.ts +527 -108
- package/src/internal/canonical-append.ts +15 -0
- package/src/internal/do-journal.ts +548 -1440
- package/src/internal/migrations.ts +184 -287
- package/src/internal/owned-state.ts +81 -30
- package/src/internal/prompt-checkpoint.ts +158 -0
- package/src/internal/storage-span.ts +2 -5
- package/dist/DoThreadStore.mjs.map +0 -1
- package/dist/do-journal-DUhjZkOf.mjs +0 -1352
- package/dist/do-journal-DUhjZkOf.mjs.map +0 -1
- package/dist/migrations-DtKz_Gxr.mjs +0 -306
- package/dist/migrations-DtKz_Gxr.mjs.map +0 -1
- package/dist/owned-state-DHm2aRXx.mjs.map +0 -1
- package/src/internal/message-delivery-schema.ts +0 -24
- package/src/internal/recovery-checkpoint-schema.ts +0 -17
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@yielded/agent-storage-cloudflare","version":"0.1.0-beta.
|
|
1
|
+
{"name":"@yielded/agent-storage-cloudflare","version":"0.1.0-beta.168","dependencies":{"@effect/platform-browser":"4.0.3","@effect/sql-sqlite-do":"4.0.3","@yielded/agent":"0.1.0-beta.168","@yielded/agent-storage-sql":"0.1.0-beta.168"},"devDependencies":{"@cloudflare/vitest-plugin":"1.4.0","@cloudflare/workers-types":"5.20260926.1","@effect/vitest":"4.0.3","@yielded/agent-testing":"0.1.0-beta.168","effect":"4.0.3","typescript":"7.0.2","vite":"npm:@voidzero-dev/vite-plus-core@1.1.0","vite-plus":"1.1.0","vitest":"5.0.3"},"peerDependencies":{"effect":"^4.0.3"},"exports":{".":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"./do-memory-store":{"types":"./dist/DoMemoryStore.d.mts","default":"./dist/DoMemoryStore.mjs"},"./do-schedule-store":{"types":"./dist/DoScheduleStore.d.mts","default":"./dist/DoScheduleStore.mjs"},"./do-storage-config":{"types":"./dist/DoStorageConfig.d.mts","default":"./dist/DoStorageConfig.mjs"},"./do-storage-error":{"types":"./dist/DoStorageError.d.mts","default":"./dist/DoStorageError.mjs"},"./do-storage-failpoint":{"types":"./dist/DoStorageFailpoint.d.mts","default":"./dist/DoStorageFailpoint.mjs"},"./do-storage-version":{"types":"./dist/DoStorageVersion.d.mts","default":"./dist/DoStorageVersion.mjs"},"./do-submission-ledger":{"types":"./dist/DoSubmissionLedger.d.mts","default":"./dist/DoSubmissionLedger.mjs"},"./do-subscription-store":{"types":"./dist/DoSubscriptionStore.d.mts","default":"./dist/DoSubscriptionStore.mjs"},"./do-thread-store":{"types":"./dist/DoThreadStore.d.mts","default":"./dist/DoThreadStore.mjs"},"./memory-protocol":{"types":"./dist/MemoryProtocol.d.mts","default":"./dist/MemoryProtocol.mjs"},"./port-protocol":{"types":"./dist/PortProtocol.d.mts","default":"./dist/PortProtocol.mjs"},"./port-routing":{"types":"./dist/PortRouting.d.mts","default":"./dist/PortRouting.mjs"},"./testing/do-storage-failpoint-testing":{"types":"./dist/DoStorageFailpointTesting.d.mts","default":"./dist/DoStorageFailpointTesting.mjs"},"./do-message-delivery-store":{"types":"./dist/DoMessageDeliveryStore.d.mts","default":"./dist/DoMessageDeliveryStore.mjs"}},"description":"Durable Object SQLite storage adapters and the routed port protocol for Effect Agent on Cloudflare.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/yielded-dev/agent.git","directory":"packages/storage-cloudflare"},"files":["dist","src"],"type":"module","sideEffects":[],"publishConfig":{"access":"public"},"scripts":{"build":"vp pack","check":"tsc --noEmit -p tsconfig.json"}}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BrowserCrypto } from "@effect/platform-browser";
|
|
1
2
|
import { SqlLifecycleSource } from "@yielded/agent-storage-sql/sql-lifecycle-publication";
|
|
2
3
|
import { makeSqlMessageDeliveryStore } from "@yielded/agent-storage-sql/sql-message-delivery-store";
|
|
3
4
|
import {
|
|
@@ -36,4 +37,4 @@ export const doMessageDeliveryStoreLayer = (limits?: MessageDeliveryStoreLimits)
|
|
|
36
37
|
}),
|
|
37
38
|
);
|
|
38
39
|
}),
|
|
39
|
-
);
|
|
40
|
+
).pipe(Layer.provide(BrowserCrypto.layer));
|
package/src/DoScheduleStore.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { upgradeV2Schedules } from "@yielded/agent-storage-sql/sql-storage-v2-upgrade";
|
|
2
1
|
import {
|
|
3
2
|
ScheduleCapacityError,
|
|
4
3
|
ScheduleDueCursor,
|
|
@@ -116,15 +115,12 @@ const unavailable = (operation: string): ScheduleStorageError =>
|
|
|
116
115
|
const corrupt = (operation: string): ScheduleStorageError =>
|
|
117
116
|
ScheduleStorageError.make({ operation, reason: "corrupt" });
|
|
118
117
|
|
|
119
|
-
const decodeRows =
|
|
118
|
+
const decodeRows = <A, I, R>(
|
|
120
119
|
schema: Schema.Codec<A, I, R>,
|
|
121
120
|
rows: ReadonlyArray<unknown>,
|
|
122
121
|
operation: string,
|
|
123
|
-
): Effect.
|
|
124
|
-
|
|
125
|
-
Effect.mapError(() => corrupt(operation)),
|
|
126
|
-
);
|
|
127
|
-
});
|
|
122
|
+
): Effect.Effect<A, ScheduleStorageError, R> =>
|
|
123
|
+
Schema.decodeUnknownEffect(schema)(rows).pipe(Effect.mapError(() => corrupt(operation)));
|
|
128
124
|
|
|
129
125
|
const decodeBoundary = <A, I, R>(
|
|
130
126
|
schema: Schema.Codec<A, I, R>,
|
|
@@ -133,7 +129,7 @@ const decodeBoundary = <A, I, R>(
|
|
|
133
129
|
): Effect.Effect<A, ScheduleStorageError, R> =>
|
|
134
130
|
Schema.decodeUnknownEffect(schema)(value).pipe(Effect.mapError(() => corrupt(operation)));
|
|
135
131
|
|
|
136
|
-
const decodeRecord = Effect.
|
|
132
|
+
const decodeRecord = Effect.fnUntraced(function* (
|
|
137
133
|
row: ScheduleRow,
|
|
138
134
|
): Effect.fn.Return<ScheduleRecord, ScheduleStorageError> {
|
|
139
135
|
const record = yield* Schema.decodeEffect(Schema.fromJsonString(ScheduleRecord))(
|
|
@@ -152,7 +148,7 @@ const decodeRecord = Effect.fn("DoScheduleStore.decodeRecord")(function* (
|
|
|
152
148
|
return record;
|
|
153
149
|
});
|
|
154
150
|
|
|
155
|
-
const encodeRecord = Effect.
|
|
151
|
+
const encodeRecord = Effect.fnUntraced(function* (
|
|
156
152
|
record: ScheduleRecord,
|
|
157
153
|
): Effect.fn.Return<string, ScheduleStorageError> {
|
|
158
154
|
const encoded = yield* Schema.encodeEffect(Schema.fromJsonString(ScheduleRecord))(record).pipe(
|
|
@@ -164,7 +160,7 @@ const encodeRecord = Effect.fn("DoScheduleStore.encodeRecord")(function* (
|
|
|
164
160
|
);
|
|
165
161
|
});
|
|
166
162
|
|
|
167
|
-
const initializeScheduleStore = Effect.
|
|
163
|
+
const initializeScheduleStore = Effect.fnUntraced(function* () {
|
|
168
164
|
const sql = yield* SqlClientService.SqlClient;
|
|
169
165
|
const operation = "initialize schedule store";
|
|
170
166
|
|
|
@@ -237,42 +233,6 @@ const initializeScheduleStore = Effect.fn("DoScheduleStore.initialize")(function
|
|
|
237
233
|
|
|
238
234
|
const state = yield* decodeRows(Schema.Array(ScheduleStoreStateRow), rawState, operation);
|
|
239
235
|
|
|
240
|
-
if (state.length === 1 && state[0].storage_version === 2) {
|
|
241
|
-
const failpoint = yield* ScheduleFailpoint;
|
|
242
|
-
|
|
243
|
-
yield* sql
|
|
244
|
-
.withTransaction(
|
|
245
|
-
Effect.gen(function* () {
|
|
246
|
-
const current = yield* sql<{
|
|
247
|
-
storage_version: number;
|
|
248
|
-
}>`SELECT storage_version FROM effect_agent_schedule_store_state WHERE singleton=1`;
|
|
249
|
-
|
|
250
|
-
if (current.length === 1 && current[0].storage_version === 3) return;
|
|
251
|
-
if (current.length !== 1 || current[0].storage_version !== 2)
|
|
252
|
-
return yield* corrupt("schedule version changed during upgrade");
|
|
253
|
-
yield* upgradeV2Schedules(MAX_STORED_SCHEDULE_BYTES);
|
|
254
|
-
yield* failpoint.hit("upgrade:before-version");
|
|
255
|
-
yield* sql`UPDATE effect_agent_schedule_store_state SET storage_version=3 WHERE singleton=1`;
|
|
256
|
-
yield* failpoint.hit("upgrade:after-version");
|
|
257
|
-
}),
|
|
258
|
-
)
|
|
259
|
-
.pipe(
|
|
260
|
-
Effect.catchTag("StorageUpgradeError", (error) =>
|
|
261
|
-
ScheduleStorageError.make({
|
|
262
|
-
reason: "corrupt",
|
|
263
|
-
operation: "upgrade v2 schedules",
|
|
264
|
-
cause: error,
|
|
265
|
-
}),
|
|
266
|
-
),
|
|
267
|
-
Effect.catchTag("SqlError", () => unavailable("upgrade v2 schedules")),
|
|
268
|
-
Effect.catchTag("ScheduleFailpointError", () =>
|
|
269
|
-
unavailable("upgrade v2 schedules failpoint"),
|
|
270
|
-
),
|
|
271
|
-
);
|
|
272
|
-
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
236
|
if (state.length !== 1 || state[0].storage_version !== CURRENT_SCHEDULE_STORE_VERSION) {
|
|
277
237
|
return yield* corrupt(
|
|
278
238
|
state.length === 1
|
|
@@ -289,7 +249,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
289
249
|
|
|
290
250
|
yield* initializeScheduleStore();
|
|
291
251
|
|
|
292
|
-
const readRows = Effect.
|
|
252
|
+
const readRows = Effect.fnUntraced(function* (
|
|
293
253
|
key: ScheduleKey,
|
|
294
254
|
operation: string,
|
|
295
255
|
): Effect.fn.Return<ReadonlyArray<ScheduleRow>, ScheduleStorageError> {
|
|
@@ -304,7 +264,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
304
264
|
return yield* decodeRows(Schema.Array(ScheduleRow), rows, operation);
|
|
305
265
|
});
|
|
306
266
|
|
|
307
|
-
const readOne = Effect.
|
|
267
|
+
const readOne = Effect.fnUntraced(function* (
|
|
308
268
|
key: ScheduleKey,
|
|
309
269
|
operation: string,
|
|
310
270
|
): Effect.fn.Return<ScheduleRecord | null, ScheduleStorageError> {
|
|
@@ -316,7 +276,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
316
276
|
return yield* decodeRecord(rows[0]);
|
|
317
277
|
});
|
|
318
278
|
|
|
319
|
-
const readNextDeadline = Effect.
|
|
279
|
+
const readNextDeadline = Effect.fnUntraced(function* (
|
|
320
280
|
owner: ScheduleOwner | undefined,
|
|
321
281
|
operation: string,
|
|
322
282
|
): Effect.fn.Return<number | null, ScheduleStorageError> {
|
|
@@ -342,7 +302,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
342
302
|
return decoded[0].deadline_at_millis;
|
|
343
303
|
});
|
|
344
304
|
|
|
345
|
-
const replaceAlarm = Effect.
|
|
305
|
+
const replaceAlarm = Effect.fnUntraced(function* (
|
|
346
306
|
replace: DoScheduleReplaceAlarm,
|
|
347
307
|
deadlineAtMillis: number | null,
|
|
348
308
|
operation: string,
|
|
@@ -364,7 +324,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
364
324
|
yield* scheduleFailpoint.hit("schedule:alarm:after");
|
|
365
325
|
});
|
|
366
326
|
|
|
367
|
-
const insert: ScheduleStore["Service"]["insert"] = Effect.
|
|
327
|
+
const insert: ScheduleStore["Service"]["insert"] = Effect.fnUntraced(
|
|
368
328
|
function* (record, ownerLimit) {
|
|
369
329
|
const operation = "insert schedule";
|
|
370
330
|
const canonical = yield* decodeBoundary(ScheduleRecord, record, operation);
|
|
@@ -423,13 +383,13 @@ const makeServices = Effect.gen(function* () {
|
|
|
423
383
|
},
|
|
424
384
|
);
|
|
425
385
|
|
|
426
|
-
const get: ScheduleStore["Service"]["get"] = Effect.
|
|
386
|
+
const get: ScheduleStore["Service"]["get"] = Effect.fnUntraced(function* (key) {
|
|
427
387
|
const canonical = yield* decodeBoundary(ScheduleKey, key, "get schedule");
|
|
428
388
|
|
|
429
389
|
return yield* readOne(canonical, "get schedule");
|
|
430
390
|
});
|
|
431
391
|
|
|
432
|
-
const list: ScheduleStore["Service"]["list"] = Effect.
|
|
392
|
+
const list: ScheduleStore["Service"]["list"] = Effect.fnUntraced(function* (
|
|
433
393
|
requestValue: SchedulePageRequest,
|
|
434
394
|
): Effect.fn.Return<SchedulePage, ScheduleStorageError> {
|
|
435
395
|
const operation = "list schedules";
|
|
@@ -463,7 +423,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
463
423
|
return { items, next: hasNext ? (items.at(-1)?.scheduleId ?? null) : null };
|
|
464
424
|
});
|
|
465
425
|
|
|
466
|
-
const change: ScheduleStore["Service"]["change"] = Effect.
|
|
426
|
+
const change: ScheduleStore["Service"]["change"] = Effect.fnUntraced(function* (
|
|
467
427
|
key,
|
|
468
428
|
change,
|
|
469
429
|
ownerLimit = defaultSchedulingLimits.maxSchedulesPerOwner,
|
|
@@ -522,7 +482,7 @@ const makeServices = Effect.gen(function* () {
|
|
|
522
482
|
return result.record;
|
|
523
483
|
});
|
|
524
484
|
|
|
525
|
-
const due: ScheduleStore["Service"]["due"] = Effect.
|
|
485
|
+
const due: ScheduleStore["Service"]["due"] = Effect.fnUntraced(function* (
|
|
526
486
|
nowMillis,
|
|
527
487
|
limit,
|
|
528
488
|
owner?: ScheduleOwner,
|
|
@@ -572,15 +532,15 @@ const makeServices = Effect.gen(function* () {
|
|
|
572
532
|
}));
|
|
573
533
|
});
|
|
574
534
|
|
|
575
|
-
const nextDeadline: ScheduleStore["Service"]["nextDeadline"] = Effect.
|
|
576
|
-
|
|
577
|
-
)
|
|
535
|
+
const nextDeadline: ScheduleStore["Service"]["nextDeadline"] = Effect.fnUntraced(function* (
|
|
536
|
+
owner?: ScheduleOwner,
|
|
537
|
+
) {
|
|
578
538
|
const operation = "query next schedule deadline";
|
|
579
539
|
|
|
580
540
|
return yield* readNextDeadline(owner, operation);
|
|
581
541
|
});
|
|
582
542
|
|
|
583
|
-
const prearm = Effect.
|
|
543
|
+
const prearm = Effect.fnUntraced(function* (
|
|
584
544
|
deadlineAtMillis: number,
|
|
585
545
|
): Effect.fn.Return<void, ScheduleStorageError | ScheduleFailpointError> {
|
|
586
546
|
yield* decodeBoundary(ScheduleInstant, deadlineAtMillis, "pre-arm schedule recovery");
|
package/src/DoStorageConfig.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Context, Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
const ObservationPollInterval = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
4
|
-
const OwnershipLeaseMillis = Schema.Int.check(Schema.isGreaterThan(0));
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* Default per-value byte bound, kept under the Durable Object platform's 2 MB SQLite value
|
|
@@ -26,13 +25,6 @@ export class DoStorageConfigValue extends Schema.Class<DoStorageConfigValue>(
|
|
|
26
25
|
"@effect-agent/storage-cloudflare/DoStorageConfigValue",
|
|
27
26
|
)({
|
|
28
27
|
observationPollInterval: ObservationPollInterval,
|
|
29
|
-
/**
|
|
30
|
-
* Submission ownership lease duration in milliseconds (D5). Inside one Durable Object the
|
|
31
|
-
* object itself is the serialized owner, so the lease's primary DC role is fencing work
|
|
32
|
-
* across DO incarnations (an evicted incarnation's claim becomes reclaimable); correctness
|
|
33
|
-
* never depends on it because every canonical append is fenced by producer epoch.
|
|
34
|
-
*/
|
|
35
|
-
ownershipLeaseDuration: OwnershipLeaseMillis,
|
|
36
28
|
/**
|
|
37
29
|
* Maximum bytes for any single stored text value (canonical batch/record JSON, admission
|
|
38
30
|
* input payload, checkpoint JSON). Enforced typed BEFORE any write; must stay under the
|
|
@@ -40,9 +32,8 @@ export class DoStorageConfigValue extends Schema.Class<DoStorageConfigValue>(
|
|
|
40
32
|
*/
|
|
41
33
|
maxStoredValueBytes: MaxStoredValueBytes,
|
|
42
34
|
/**
|
|
43
|
-
*
|
|
44
|
-
* Schema decoding
|
|
45
|
-
* scan is an explicit opt-in integrity audit rather than a startup requirement.
|
|
35
|
+
* Audit stored payload schemas, identities, and batch coverage while opening the store.
|
|
36
|
+
* Per-operation Schema decoding remains enabled; this complete scan is an explicit opt-in.
|
|
46
37
|
*/
|
|
47
38
|
verifyOnOpen: Schema.Boolean,
|
|
48
39
|
}) {}
|
package/src/DoStorageError.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CanonicalSequence
|
|
1
|
+
import { CanonicalSequence } from "@yielded/agent/records";
|
|
2
2
|
import { ThreadStoreDiagnostic } from "@yielded/agent/thread-store";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
|
|
@@ -72,26 +72,15 @@ export class DoValueBoundExceeded extends Schema.TaggedError<DoValueBoundExceede
|
|
|
72
72
|
*/
|
|
73
73
|
export class DoAppendConflict extends Schema.TaggedError<DoAppendConflict>()("DoAppendConflict", {
|
|
74
74
|
message: Schema.String,
|
|
75
|
-
reason: Schema.Literals(["batch-
|
|
75
|
+
reason: Schema.Literals(["batch-content", "record-identity", "tail", "stale-command"]),
|
|
76
76
|
actualTailSequence: Schema.optionalKey(CanonicalSequence),
|
|
77
|
-
actualTailDigest: Schema.optionalKey(Schema.String),
|
|
78
|
-
}) {}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* A producer epoch does not match the Thread's current writer registration. Appends
|
|
82
|
-
* require the exact registered epoch, so both older and newer unregistered epochs are fenced;
|
|
83
|
-
* a newer epoch takes over by materializing first.
|
|
84
|
-
*/
|
|
85
|
-
export class DoFenceRejected extends Schema.TaggedError<DoFenceRejected>()("DoFenceRejected", {
|
|
86
|
-
actualEpoch: ProducerEpoch,
|
|
87
|
-
message: Schema.String,
|
|
88
|
-
producerEpoch: ProducerEpoch,
|
|
89
77
|
}) {}
|
|
90
78
|
|
|
91
79
|
/** A checkpoint conflicts with a previously stored checkpoint at the same offset. */
|
|
92
80
|
export class DoCheckpointConflict extends Schema.TaggedError<DoCheckpointConflict>()(
|
|
93
81
|
"DoCheckpointConflict",
|
|
94
82
|
{
|
|
83
|
+
reason: Schema.Literals(["ahead-of-tail", "not-batch-boundary", "corrupt"]),
|
|
95
84
|
message: Schema.String,
|
|
96
85
|
},
|
|
97
86
|
) {}
|
|
@@ -105,10 +94,6 @@ export class DoCheckpointConflict extends Schema.TaggedError<DoCheckpointConflic
|
|
|
105
94
|
* locations. There is intentionally no Cloudflare-only location.
|
|
106
95
|
*/
|
|
107
96
|
export const DoStorageFailpointLocation = Schema.Literals([
|
|
108
|
-
"upgrade:before-mutation",
|
|
109
|
-
"upgrade:after-mutation",
|
|
110
|
-
"upgrade:before-version",
|
|
111
|
-
"upgrade:after-version",
|
|
112
97
|
"materialize:before",
|
|
113
98
|
"materialize:after",
|
|
114
99
|
"append:before",
|
|
@@ -119,8 +104,6 @@ export const DoStorageFailpointLocation = Schema.Literals([
|
|
|
119
104
|
"export:after-thread-read",
|
|
120
105
|
"save-checkpoint:before",
|
|
121
106
|
"save-checkpoint:after",
|
|
122
|
-
"save-recovery-checkpoint:before",
|
|
123
|
-
"save-recovery-checkpoint:after",
|
|
124
107
|
"ledger:admit:before",
|
|
125
108
|
"ledger:admit:after",
|
|
126
109
|
"ledger:mark-ready:before",
|
|
@@ -129,16 +112,10 @@ export const DoStorageFailpointLocation = Schema.Literals([
|
|
|
129
112
|
"ledger:claim:after",
|
|
130
113
|
"ledger:mark-input-applied:before",
|
|
131
114
|
"ledger:mark-input-applied:after",
|
|
132
|
-
"ledger:renew:before",
|
|
133
|
-
"ledger:renew:after",
|
|
134
|
-
"ledger:reserve-settlement:before",
|
|
135
|
-
"ledger:reserve-settlement:after",
|
|
136
115
|
"ledger:finalize-settlement:before",
|
|
137
116
|
"ledger:finalize-settlement:after",
|
|
138
117
|
"ledger:request-abort:before",
|
|
139
118
|
"ledger:request-abort:after",
|
|
140
|
-
"ledger:release:before",
|
|
141
|
-
"ledger:release:after",
|
|
142
119
|
"ledger:claim-joining:before",
|
|
143
120
|
"ledger:claim-joining:after",
|
|
144
121
|
"ledger:mark-joined:before",
|
package/src/DoStorageVersion.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Current adapter layout version; record encoding is versioned independently. */
|
|
2
2
|
export { CurrentDoStorageVersion } from "./internal/migrations.ts";
|