@sekiban/dcb-runtime 0.2.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.
- package/LICENSE +86 -0
- package/README.md +13 -0
- package/dist/allocator/AllocatorDurableObject.d.ts +36 -0
- package/dist/allocator/AllocatorDurableObject.js +658 -0
- package/dist/allocator/IssuanceLedger.d.ts +188 -0
- package/dist/allocator/IssuanceLedger.js +608 -0
- package/dist/allocator/IssuanceReconciler.d.ts +41 -0
- package/dist/allocator/IssuanceReconciler.js +191 -0
- package/dist/allocator/OrderClock.d.ts +41 -0
- package/dist/allocator/OrderClock.js +92 -0
- package/dist/allocator/SortableUniqueId.d.ts +46 -0
- package/dist/allocator/SortableUniqueId.js +156 -0
- package/dist/allocator/types.d.ts +52 -0
- package/dist/allocator/types.js +1 -0
- package/dist/bootstrap/BootstrapCoordinatorDurableObject.d.ts +28 -0
- package/dist/bootstrap/BootstrapCoordinatorDurableObject.js +357 -0
- package/dist/bootstrap/BootstrapStoreAdapter.d.ts +51 -0
- package/dist/bootstrap/BootstrapStoreAdapter.js +162 -0
- package/dist/bootstrap/OperatorBootstrap.d.ts +20 -0
- package/dist/bootstrap/OperatorBootstrap.js +104 -0
- package/dist/bootstrap/manifest.d.ts +9 -0
- package/dist/bootstrap/manifest.js +115 -0
- package/dist/bootstrap/types.d.ts +75 -0
- package/dist/bootstrap/types.js +1 -0
- package/dist/cli/OperatorRepairCli.d.ts +11 -0
- package/dist/cli/OperatorRepairCli.js +108 -0
- package/dist/cloudflare.d.ts +164 -0
- package/dist/cloudflare.js +19487 -0
- package/dist/commit/CommitWorker.d.ts +101 -0
- package/dist/commit/CommitWorker.js +921 -0
- package/dist/commit/types.d.ts +25 -0
- package/dist/commit/types.js +13 -0
- package/dist/completeness/GlobalCompletenessReconciler.d.ts +77 -0
- package/dist/completeness/GlobalCompletenessReconciler.js +572 -0
- package/dist/completeness/types.d.ts +85 -0
- package/dist/completeness/types.js +6 -0
- package/dist/composition.d.ts +123 -0
- package/dist/composition.js +237 -0
- package/dist/cosmos.d.ts +11 -0
- package/dist/cosmos.js +1411 -0
- package/dist/d1-mv.d.ts +8 -0
- package/dist/d1-mv.js +2001 -0
- package/dist/d1.d.ts +16 -0
- package/dist/d1.js +3418 -0
- package/dist/diagnostics/G60DurableHop.d.ts +99 -0
- package/dist/diagnostics/G60DurableHop.js +248 -0
- package/dist/diagnostics/G65Admission.d.ts +23 -0
- package/dist/diagnostics/G65Admission.js +43 -0
- package/dist/diagnostics/G65DirectRing.d.ts +33 -0
- package/dist/diagnostics/G65DirectRing.js +85 -0
- package/dist/diagnostics/G69AdmissionAttempt.d.ts +43 -0
- package/dist/diagnostics/G69AdmissionAttempt.js +22 -0
- package/dist/downstream/DeliveryCore.d.ts +127 -0
- package/dist/downstream/DeliveryCore.js +304 -0
- package/dist/downstream/Doorbell.d.ts +43 -0
- package/dist/downstream/Doorbell.js +137 -0
- package/dist/downstream/DownstreamAdapter.d.ts +52 -0
- package/dist/downstream/DownstreamAdapter.js +299 -0
- package/dist/downstream/ExclusionLookup.d.ts +36 -0
- package/dist/downstream/ExclusionLookup.js +50 -0
- package/dist/downstream/InconsistencyDetector.d.ts +27 -0
- package/dist/downstream/InconsistencyDetector.js +82 -0
- package/dist/downstream/OutboxDrain.d.ts +35 -0
- package/dist/downstream/OutboxDrain.js +126 -0
- package/dist/downstream/types.d.ts +77 -0
- package/dist/downstream/types.js +64 -0
- package/dist/eventIdentity.d.ts +30 -0
- package/dist/eventIdentity.js +49 -0
- package/dist/eventRecord.d.ts +26 -0
- package/dist/eventRecord.js +53 -0
- package/dist/g42-probe.d.ts +9 -0
- package/dist/g42-probe.js +9 -0
- package/dist/http/SerializedQueryWorker.d.ts +58 -0
- package/dist/http/SerializedQueryWorker.js +497 -0
- package/dist/http/commitResponse.d.ts +46 -0
- package/dist/http/commitResponse.js +80 -0
- package/dist/http/testServiceId.d.ts +17 -0
- package/dist/http/testServiceId.js +14 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +19926 -0
- package/dist/journal/JournalDurableObject.d.ts +30 -0
- package/dist/journal/JournalDurableObject.js +481 -0
- package/dist/journal/JournalFirstTouchProbe.d.ts +190 -0
- package/dist/journal/JournalFirstTouchProbe.js +375 -0
- package/dist/journal/types.d.ts +116 -0
- package/dist/journal/types.js +52 -0
- package/dist/mv/MaterializedViewCatchUp.d.ts +60 -0
- package/dist/mv/MaterializedViewCatchUp.js +353 -0
- package/dist/mv/MaterializedViewRuntime.d.ts +80 -0
- package/dist/mv/MaterializedViewRuntime.js +328 -0
- package/dist/mv/MaterializedViewStore.d.ts +257 -0
- package/dist/mv/MaterializedViewStore.js +875 -0
- package/dist/mv/UnsafeWindowMaterializedView.d.ts +112 -0
- package/dist/mv/UnsafeWindowMaterializedView.js +495 -0
- package/dist/mv/index.d.ts +8 -0
- package/dist/mv/index.js +2357 -0
- package/dist/projection/LiveProjectionWorker.d.ts +86 -0
- package/dist/projection/LiveProjectionWorker.js +240 -0
- package/dist/projection/ProjectionRuntime.d.ts +113 -0
- package/dist/projection/ProjectionRuntime.js +346 -0
- package/dist/projection/ProjectorRegistry.d.ts +51 -0
- package/dist/projection/ProjectorRegistry.js +116 -0
- package/dist/query/ProjectionQueryStore.d.ts +102 -0
- package/dist/query/ProjectionQueryStore.js +185 -0
- package/dist/query/QueryRegistry.d.ts +22 -0
- package/dist/query/QueryRegistry.js +36 -0
- package/dist/read/SerializedReadWorker.d.ts +36 -0
- package/dist/read/SerializedReadWorker.js +225 -0
- package/dist/repair/RepairWorker.d.ts +72 -0
- package/dist/repair/RepairWorker.js +461 -0
- package/dist/safeWindow.d.ts +20 -0
- package/dist/safeWindow.js +36 -0
- package/dist/scope/ControlRouteScope.d.ts +22 -0
- package/dist/scope/ControlRouteScope.js +36 -0
- package/dist/scope/ScopeName.d.ts +34 -0
- package/dist/scope/ScopeName.js +67 -0
- package/dist/service/ServiceIdentityProvider.d.ts +35 -0
- package/dist/service/ServiceIdentityProvider.js +56 -0
- package/dist/store/CosmosEventStore.d.ts +126 -0
- package/dist/store/CosmosEventStore.js +950 -0
- package/dist/store/D1EventStore.d.ts +111 -0
- package/dist/store/D1EventStore.js +1111 -0
- package/dist/store/PostgresEventStore.d.ts +35 -0
- package/dist/store/PostgresEventStore.js +811 -0
- package/dist/store/provider.d.ts +25 -0
- package/dist/store/provider.js +32 -0
- package/dist/store/types.d.ts +205 -0
- package/dist/store/types.js +18 -0
- package/dist/tag/EventDigest.d.ts +40 -0
- package/dist/tag/EventDigest.js +158 -0
- package/dist/tag/TagDurableObject.d.ts +286 -0
- package/dist/tag/TagDurableObject.js +4071 -0
- package/dist/tag/TagSqlMeasurement.d.ts +26 -0
- package/dist/tag/TagSqlMeasurement.js +44 -0
- package/dist/tag/TagSqlSchema.d.ts +29 -0
- package/dist/tag/TagSqlSchema.js +211 -0
- package/dist/tag/types.d.ts +173 -0
- package/dist/tag/types.js +3 -0
- package/dist/tagstate/TagStateDurableObject.d.ts +57 -0
- package/dist/tagstate/TagStateDurableObject.js +499 -0
- package/dist/trace/AttributionRatio.d.ts +12 -0
- package/dist/trace/AttributionRatio.js +68 -0
- package/dist/trace/CloudflareTracing.d.ts +7 -0
- package/dist/trace/CloudflareTracing.js +9 -0
- package/dist/trace/CommitTrace.d.ts +405 -0
- package/dist/trace/CommitTrace.js +1008 -0
- package/dist/trace/CommitTraceConsoleSink.d.ts +68 -0
- package/dist/trace/CommitTraceConsoleSink.js +114 -0
- package/dist/trace/CommitTraceVerifier.d.ts +22 -0
- package/dist/trace/CommitTraceVerifier.js +295 -0
- package/dist/trace/ObservationStream.d.ts +118 -0
- package/dist/trace/ObservationStream.js +148 -0
- package/package.json +71 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { type TagEvent, type G43TagStateIncrementalPage, type G43TagStateIncrementalRequest } from "./types";
|
|
2
|
+
import type { DownstreamOutboxMessage } from "../downstream/types";
|
|
3
|
+
import type { SourceObligationPage } from "../completeness/types";
|
|
4
|
+
import { type DownstreamDoorbellBinding } from "../downstream/Doorbell";
|
|
5
|
+
import { type NativeTracing } from "../trace/CommitTrace";
|
|
6
|
+
import { type G43SqlMeasurementSnapshot } from "./TagSqlMeasurement";
|
|
7
|
+
declare const MAX_EPOCH: number;
|
|
8
|
+
/**
|
|
9
|
+
* G65 bounds derived writes, not the durable Tag commit. The value is short
|
|
10
|
+
* enough to keep the commit root near the G52 baseline while still allowing a
|
|
11
|
+
* healthy same-colo D1/doorbell attempt to complete before the response.
|
|
12
|
+
*/
|
|
13
|
+
export declare const G65_DERIVED_WRITE_BUDGET_MS = 300;
|
|
14
|
+
/**
|
|
15
|
+
* SDT-G98: first-append source-partition registration is on the commit path
|
|
16
|
+
* when G44 D1 is configured, but cold remote D1 registration routinely needs
|
|
17
|
+
* more than the doorbell/admission 300 ms budget. Keep registration on its own
|
|
18
|
+
* measured ceiling so multi-tag first-touch does not invent partial_write.
|
|
19
|
+
* Chosen from 2026-09-17 live cold-reserve observation (300 ms shared budget
|
|
20
|
+
* timed out registration) plus margin; refined against cold-loop evidence.
|
|
21
|
+
*/
|
|
22
|
+
export declare const G65_SOURCE_REGISTRATION_BUDGET_MS = 1500;
|
|
23
|
+
export declare const G65_SOURCE_REGISTRATION_MAX_ATTEMPTS = 3;
|
|
24
|
+
export declare const G65_SOURCE_REGISTRATION_RETRY_DELAY_MS = 25;
|
|
25
|
+
export declare const G65_GLOBAL_ADMISSION_HEADER = "x-sdt-global-admission";
|
|
26
|
+
interface TagDurableObjectEnv {
|
|
27
|
+
/** Global D1 receipt authority used only to verify a source acknowledgement. */
|
|
28
|
+
D1?: D1Database;
|
|
29
|
+
DOWNSTREAM_QUEUE?: Queue<DownstreamOutboxMessage>;
|
|
30
|
+
DOWNSTREAM_DOORBELL?: DownstreamDoorbellBinding;
|
|
31
|
+
AUTO_DRAIN_OUTBOX?: string;
|
|
32
|
+
DOMAIN_DELIVERY_CLASS?: string;
|
|
33
|
+
DIRECT_DOORBELL?: string;
|
|
34
|
+
DIRECT_DOORBELL_ALLOWED_VIEWS?: string;
|
|
35
|
+
DIRECT_DOORBELL_MAX_INVOCATIONS?: string;
|
|
36
|
+
DIRECT_DOORBELL_DEGRADATION?: string;
|
|
37
|
+
DIRECT_DOORBELL_RECEIVER_MODE?: string;
|
|
38
|
+
DIRECT_DOORBELL_SELF_BINDING_PROOF?: string;
|
|
39
|
+
}
|
|
40
|
+
/** A mismatched immutable tag identity is a typed 409, not an internal error. */
|
|
41
|
+
export declare class TagIdentityConflict extends Error {
|
|
42
|
+
constructor();
|
|
43
|
+
}
|
|
44
|
+
export declare class TagDurableObject implements DurableObject {
|
|
45
|
+
private readonly ctx;
|
|
46
|
+
private readonly env;
|
|
47
|
+
private readonly nativeTracing;
|
|
48
|
+
/** Constructor-scoped observation only; never persisted or used for control. */
|
|
49
|
+
private readonly activation;
|
|
50
|
+
/**
|
|
51
|
+
* Direct unit seams intentionally omit `storage.sql`. They exercise
|
|
52
|
+
* transport behavior only; deployed and Miniflare Tag DOs always use the
|
|
53
|
+
* normalized SQL path. Keeping this ephemeral fallback out of durable KV
|
|
54
|
+
* prevents a TAG_KEY record from remaining a second source of truth.
|
|
55
|
+
*/
|
|
56
|
+
private fallbackRecord;
|
|
57
|
+
private fallbackOutboxDeliveries;
|
|
58
|
+
/** Ephemeral test/evidence seam; never exposed as an HTTP route or stored. */
|
|
59
|
+
private g43SqlMeasurement;
|
|
60
|
+
/** Exercises alarm crash boundaries without adding a production control path. */
|
|
61
|
+
private g43SchedulerFault;
|
|
62
|
+
constructor(ctx: DurableObjectState, env: TagDurableObjectEnv, nativeTracing?: NativeTracing);
|
|
63
|
+
fetch(request: Request): Promise<Response>;
|
|
64
|
+
/** Identity-bound installed/absent inspection for G77 issuance reconciliation. */
|
|
65
|
+
private inspectG77Target;
|
|
66
|
+
/** Reconciler-only fence for never-contacted targets; creates durable tombstone state. */
|
|
67
|
+
private fenceAbsentG77Target;
|
|
68
|
+
alarm(): Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Structural-measurement seam used around a real handler request. The
|
|
71
|
+
* production wire cannot start it, and it neither changes control flow nor
|
|
72
|
+
* persists instrumentation. Completion is intentionally separate so the
|
|
73
|
+
* caller can first consume the response body (the specified boundary).
|
|
74
|
+
*/
|
|
75
|
+
beginG43SqlMeasurement(): void;
|
|
76
|
+
completeG43SqlMeasurement(): G43SqlMeasurementSnapshot;
|
|
77
|
+
/** Test-only fault seam for AC6's transactional re-arm crash boundaries. */
|
|
78
|
+
setG43SchedulerFaultForTest(fault: "before-rearm" | "after-rearm" | undefined): void;
|
|
79
|
+
/**
|
|
80
|
+
* Bounded source seam for the normal incremental TagState source read. Its
|
|
81
|
+
* direct-DO adapter above is transport-only; this method remains the one
|
|
82
|
+
* authority for cursor range reads and frozen-frontier completion.
|
|
83
|
+
*/
|
|
84
|
+
g43ReadAfter(sortableUniqueId: string, limit: number, through?: string): Promise<TagEvent[]>;
|
|
85
|
+
/**
|
|
86
|
+
* The bounded normal projection source operation: it reads only events
|
|
87
|
+
* newer than the supplied checkpoint and folds the fixed result window in
|
|
88
|
+
* memory. No existing history is reread.
|
|
89
|
+
*/
|
|
90
|
+
g43TagStateIncrementalCatchUp(input: G43TagStateIncrementalRequest): Promise<G43TagStateIncrementalPage>;
|
|
91
|
+
/** Full replay remains intentionally linear and is measurement-only info. */
|
|
92
|
+
g43TagStateRebuild(): Promise<readonly TagEvent[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Internal source-authority scanner for the G43 obligation seam. This is
|
|
95
|
+
* intentionally a DO RPC surface rather than a Worker route: it adds no
|
|
96
|
+
* role-facing HTTP API, and it does not share Queue/doorbell failure paths.
|
|
97
|
+
*/
|
|
98
|
+
g43ScanSourceObligations(tag: string, nowMs: number): Promise<unknown>;
|
|
99
|
+
/**
|
|
100
|
+
* G44's private source scanner RPC. It exposes only the normalized source
|
|
101
|
+
* obligation table, never Queue state or a role-facing Worker route. The
|
|
102
|
+
* caller fixes `upperBoundSequence` from the source partition registry
|
|
103
|
+
* before paging, so later commits cannot move a scan frontier mid-pass.
|
|
104
|
+
*/
|
|
105
|
+
g44ReadSourceObligations(input: Readonly<{
|
|
106
|
+
serviceId: string;
|
|
107
|
+
tag: string;
|
|
108
|
+
upperBoundSequence: number;
|
|
109
|
+
afterSequence: number;
|
|
110
|
+
limit: number;
|
|
111
|
+
}>): Promise<SourceObligationPage>;
|
|
112
|
+
/**
|
|
113
|
+
* G44's source acknowledgement guard. A transport success or an unjoined
|
|
114
|
+
* receipt is deliberately insufficient: the global event, local membership
|
|
115
|
+
* and exact source-obligation receipt must all be readable together.
|
|
116
|
+
*/
|
|
117
|
+
private globalReceiptMatches;
|
|
118
|
+
/**
|
|
119
|
+
* The first append on a Tag must make its source partition enumerable before
|
|
120
|
+
* the local event transaction starts. Once the local marker is registered,
|
|
121
|
+
* later appends never consult or await D1 for this fact; Queue admission is
|
|
122
|
+
* responsible for advancing the registered obligation sequence.
|
|
123
|
+
*/
|
|
124
|
+
private ensureSourcePartitionBeforeFirstAppend;
|
|
125
|
+
private sourcePartitionRegistrationStatus;
|
|
126
|
+
/**
|
|
127
|
+
* Refreshes the already-authorized source row with the committed local
|
|
128
|
+
* obligation sequence without putting D1 back on the response path. The
|
|
129
|
+
* first-append authority check above is the only registration operation that
|
|
130
|
+
* may refuse a commit; this post-append watermark is Queue/retry recovery
|
|
131
|
+
* work and is deliberately handed to waitUntil.
|
|
132
|
+
*/
|
|
133
|
+
private scheduleSourcePartitionWatermark;
|
|
134
|
+
private retrySourcePartitionRegistration;
|
|
135
|
+
private markSourcePartitionRegistration;
|
|
136
|
+
private registerSourcePartition;
|
|
137
|
+
private hasG44GlobalArrayAuthority;
|
|
138
|
+
private readG44GlobalArrayAuthority;
|
|
139
|
+
private traceCommitActor;
|
|
140
|
+
/**
|
|
141
|
+
* Internal Tag reads keep their Cloudflare parent solely from active async
|
|
142
|
+
* context; G30 does not add a correlation header or alter either /state or
|
|
143
|
+
* /head-facts just to label telemetry.
|
|
144
|
+
*/
|
|
145
|
+
private traceCommitReadActor;
|
|
146
|
+
private jsonBody;
|
|
147
|
+
private sqlStorage;
|
|
148
|
+
/**
|
|
149
|
+
* Rehydrate the legacy response shape only at a state/read boundary. The
|
|
150
|
+
* append path below deliberately does not call this method: it reads the
|
|
151
|
+
* head and candidate identities by index instead of deserializing history.
|
|
152
|
+
*/
|
|
153
|
+
private readStoredRecord;
|
|
154
|
+
/**
|
|
155
|
+
* Reads the scalar commit-response facts without rehydrating `tag_event`.
|
|
156
|
+
* Keep the identity and control/head consistency checks at this boundary:
|
|
157
|
+
* an internal caller is not allowed to turn an identity change into a
|
|
158
|
+
* plausible but stale response.
|
|
159
|
+
*/
|
|
160
|
+
private readHeadFacts;
|
|
161
|
+
private obligationArtifact;
|
|
162
|
+
private ensureSqlTag;
|
|
163
|
+
private writeCommittedSqlEvent;
|
|
164
|
+
private writeCommittedSqlMembership;
|
|
165
|
+
private writeCommittedSqlObligation;
|
|
166
|
+
private upsertSourcePartitionRegistration;
|
|
167
|
+
private writeCommittedSqlHead;
|
|
168
|
+
private writeCommittedSqlReceipt;
|
|
169
|
+
/**
|
|
170
|
+
* The normal append path deliberately probes only the indexed rows it needs
|
|
171
|
+
* (identity/control, this attempt, this reservation, and these candidates).
|
|
172
|
+
* It never calls `readStoredRecord`, so history size cannot turn append into
|
|
173
|
+
* a whole-array deserialize/copy/serialize operation.
|
|
174
|
+
*/
|
|
175
|
+
private appendSql;
|
|
176
|
+
/**
|
|
177
|
+
* SQL-native reservation transition. This deliberately reads only the
|
|
178
|
+
* control, epoch, tombstone, fence and reservation rows that participate in
|
|
179
|
+
* the transition; it never rehydrates tag_event history just to reserve.
|
|
180
|
+
*/
|
|
181
|
+
private acquireSql;
|
|
182
|
+
/**
|
|
183
|
+
* SQL-native cancel transition. It only mutates reservation/epoch/tombstone
|
|
184
|
+
* control rows, so a cancellation cannot hide a committed event, membership
|
|
185
|
+
* or obligation and does not rewrite event history.
|
|
186
|
+
*/
|
|
187
|
+
private cancelSql;
|
|
188
|
+
private writeSqlRecord;
|
|
189
|
+
private nextSqlAlarmDue;
|
|
190
|
+
private recordFor;
|
|
191
|
+
private write;
|
|
192
|
+
private commit;
|
|
193
|
+
private commitExpiryIfNeeded;
|
|
194
|
+
private acquire;
|
|
195
|
+
private cancel;
|
|
196
|
+
private seal;
|
|
197
|
+
/**
|
|
198
|
+
* Coordinator-only import admission. This is deliberately not a flag on
|
|
199
|
+
* /append: it never creates an outbox row, never accepts a reservation, and
|
|
200
|
+
* closes permanently once the coordinator reaches READY.
|
|
201
|
+
*/
|
|
202
|
+
private bootstrapAppend;
|
|
203
|
+
private closeBootstrap;
|
|
204
|
+
private directDoorbellPreflight;
|
|
205
|
+
private append;
|
|
206
|
+
/**
|
|
207
|
+
* Claim and run the opted-in direct unsafe path after the append transaction
|
|
208
|
+
* has committed, but before the 201 response is returned. The rows are
|
|
209
|
+
* handed to the Queue drain afterwards so the durable Queue remains the
|
|
210
|
+
* owner of global admission, ordering, retries, and DLQ recovery.
|
|
211
|
+
*
|
|
212
|
+
* A pending-row read can fail independently of the already committed
|
|
213
|
+
* append. In that case the caller falls back to the ordinary Queue drain;
|
|
214
|
+
* it never turns a durable acceptance into a response failure.
|
|
215
|
+
*/
|
|
216
|
+
private directDeliveryBeforeResponse;
|
|
217
|
+
/**
|
|
218
|
+
* Attempt the same idempotent D1 admission used by the Queue consumer.
|
|
219
|
+
* This is a derived write only: the Tag event, outbox obligation, and local
|
|
220
|
+
* receipt are already durable, and the Queue remains the guarantee.
|
|
221
|
+
*/
|
|
222
|
+
private globalAdmissionBeforeResponse;
|
|
223
|
+
private scheduleG65AdmissionAttempt;
|
|
224
|
+
/**
|
|
225
|
+
* Bound a derived attempt without cancelling or making its eventual result
|
|
226
|
+
* part of commit semantics. The rejection branch is attached immediately
|
|
227
|
+
* so a late D1/doorbell failure cannot become an unhandled rejection.
|
|
228
|
+
*/
|
|
229
|
+
private boundedDerivedWrite;
|
|
230
|
+
/**
|
|
231
|
+
* The append transaction has durably committed the Tag event, outbox
|
|
232
|
+
* obligation, and receipt before this handoff is started. A direct delivery
|
|
233
|
+
* has already run when `preclaimedRows` is present; the retained promise
|
|
234
|
+
* then performs only the unchanged Queue submission for those same bytes.
|
|
235
|
+
* With no preclaimed rows this remains the existing waitUntil-backed drain,
|
|
236
|
+
* including its direct-before-Queue behavior for alarms and fallback paths.
|
|
237
|
+
*/
|
|
238
|
+
private startAutoDrainBeforeResponse;
|
|
239
|
+
private deliverDirectRows;
|
|
240
|
+
private autoDrainOutbox;
|
|
241
|
+
/** G60 writes are observation-only and stay outside the append/drain result. */
|
|
242
|
+
private scheduleDurableHop;
|
|
243
|
+
private confirm;
|
|
244
|
+
private installFence;
|
|
245
|
+
private clearFence;
|
|
246
|
+
/**
|
|
247
|
+
* Returns Tag-side repair facts only. Journal observations are deliberately
|
|
248
|
+
* absent: they are progress telemetry and can never grant repair authority.
|
|
249
|
+
*/
|
|
250
|
+
private repairFacts;
|
|
251
|
+
/**
|
|
252
|
+
* Internal outbox handoff: enqueuedAt is persisted before any Queue send so
|
|
253
|
+
* a crash after send but before delivered marking replays the same clock
|
|
254
|
+
* fact. It never changes the immutable event/outbox row.
|
|
255
|
+
*/
|
|
256
|
+
private pendingOutbox;
|
|
257
|
+
/**
|
|
258
|
+
* Source-side obligation scanner. It deliberately does not call the Queue,
|
|
259
|
+
* the doorbell, `pendingOutbox`, or any detector. An obligation therefore
|
|
260
|
+
* remains visible when delivery is disabled, throws, or has not started.
|
|
261
|
+
*/
|
|
262
|
+
private scanOutboxObligations;
|
|
263
|
+
/** Record a retry or terminal poison disposition without changing the source event. */
|
|
264
|
+
private recordOutboxFailure;
|
|
265
|
+
/** Marks only a previously enqueued row; repeating a mark is harmless. */
|
|
266
|
+
private markOutboxDelivered;
|
|
267
|
+
/**
|
|
268
|
+
* The delivery handoff reads its universe from `tag_outbox_obligation`.
|
|
269
|
+
* It does not consult the Queue, a sink receipt, or a runner's expected
|
|
270
|
+
* count. Reserving the retry timestamp before the external handoff lets the
|
|
271
|
+
* single durable scheduler retry a crash/throw without treating delivery as
|
|
272
|
+
* the authority for obligation existence.
|
|
273
|
+
*/
|
|
274
|
+
private pendingSqlOutbox;
|
|
275
|
+
private markSqlOutboxDelivered;
|
|
276
|
+
private rearmScheduler;
|
|
277
|
+
private acquireRepairLease;
|
|
278
|
+
private renewRepairLease;
|
|
279
|
+
private unionRepairScope;
|
|
280
|
+
private applyRepair;
|
|
281
|
+
private auditRepair;
|
|
282
|
+
private clearRepairFence;
|
|
283
|
+
private setClockOffset;
|
|
284
|
+
private runAlarm;
|
|
285
|
+
}
|
|
286
|
+
export { MAX_EPOCH };
|