@microdelta/history 0.0.0 → 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/README.md +30 -4
- package/dist/api/history.alpha.d.ts +3 -0
- package/dist/api/history.beta.d.ts +3 -0
- package/dist/api/history.conformance.store.alpha.d.ts +3 -0
- package/dist/api/history.conformance.store.beta.d.ts +3 -0
- package/dist/api/history.conformance.store.public.d.ts +3 -0
- package/dist/api/history.conformance.store.raw.alpha.d.ts +215 -0
- package/dist/api/history.conformance.store.raw.beta.d.ts +215 -0
- package/dist/api/history.conformance.store.raw.public.d.ts +215 -0
- package/dist/api/history.conformance.store.raw.untrimmed.d.ts +215 -0
- package/dist/api/history.conformance.store.untrimmed.d.ts +3 -0
- package/dist/api/history.public.d.ts +3 -0
- package/dist/api/history.root.raw.alpha.d.ts +1371 -0
- package/dist/api/history.root.raw.beta.d.ts +425 -0
- package/dist/api/history.root.raw.public.d.ts +425 -0
- package/dist/api/history.root.raw.untrimmed.d.ts +1372 -0
- package/dist/api/history.shared.alpha.d.ts +1402 -0
- package/dist/api/history.shared.beta.d.ts +456 -0
- package/dist/api/history.shared.public.d.ts +456 -0
- package/dist/api/history.shared.untrimmed.d.ts +1403 -0
- package/dist/api/history.untrimmed.d.ts +3 -0
- package/dist/api/tsdoc-metadata.json +11 -0
- package/dist/src/completed-results.d.ts +99 -0
- package/dist/src/completed-results.d.ts.map +1 -0
- package/dist/src/completed-results.js +2 -0
- package/dist/src/completed-results.js.map +1 -0
- package/dist/src/durable/contracts.d.ts +612 -0
- package/dist/src/durable/contracts.d.ts.map +1 -0
- package/dist/src/durable/contracts.js +2 -0
- package/dist/src/durable/contracts.js.map +1 -0
- package/dist/src/durable/errors.d.ts +94 -0
- package/dist/src/durable/errors.d.ts.map +1 -0
- package/dist/src/durable/errors.js +118 -0
- package/dist/src/durable/errors.js.map +1 -0
- package/dist/src/durable/index.d.ts +9 -0
- package/dist/src/durable/index.d.ts.map +1 -0
- package/dist/src/durable/index.js +770 -0
- package/dist/src/durable/index.js.map +1 -0
- package/dist/src/durable/journal.d.ts +53 -0
- package/dist/src/durable/journal.d.ts.map +1 -0
- package/dist/src/durable/journal.js +174 -0
- package/dist/src/durable/journal.js.map +1 -0
- package/dist/src/durable/locator.d.ts +31 -0
- package/dist/src/durable/locator.d.ts.map +1 -0
- package/dist/src/durable/locator.js +50 -0
- package/dist/src/durable/locator.js.map +1 -0
- package/dist/src/durable/records.d.ts +40 -0
- package/dist/src/durable/records.d.ts.map +1 -0
- package/dist/src/durable/records.js +74 -0
- package/dist/src/durable/records.js.map +1 -0
- package/dist/src/durable/schema.d.ts +37 -0
- package/dist/src/durable/schema.d.ts.map +1 -0
- package/dist/src/durable/schema.js +335 -0
- package/dist/src/durable/schema.js.map +1 -0
- package/dist/src/durable/selected-index.d.ts +94 -0
- package/dist/src/durable/selected-index.d.ts.map +1 -0
- package/dist/src/durable/selected-index.js +594 -0
- package/dist/src/durable/selected-index.js.map +1 -0
- package/dist/src/index.d.ts +28 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +15 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/store/index.d.ts +128 -0
- package/dist/src/store/index.d.ts.map +1 -0
- package/dist/src/store/index.js +33 -0
- package/dist/src/store/index.js.map +1 -0
- package/dist/src/store/memory/index.d.ts +24 -0
- package/dist/src/store/memory/index.d.ts.map +1 -0
- package/dist/src/store/memory/index.js +162 -0
- package/dist/src/store/memory/index.js.map +1 -0
- package/dist/src/types.d.ts +100 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/test/conformance/store/index.d.ts +34 -0
- package/dist/test/conformance/store/index.d.ts.map +1 -0
- package/dist/test/conformance/store/index.js +368 -0
- package/dist/test/conformance/store/index.js.map +1 -0
- package/package.json +48 -8
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result History & Publication. This entry exposes the existing row Store,
|
|
3
|
+
* its memory adapter and compatibility schema unchanged, the exact
|
|
4
|
+
* completed-result reading ports, and the project-private alpha durable
|
|
5
|
+
* authority that owns attempts, the single logical writer, atomic publication,
|
|
6
|
+
* acceptance records, environment namespaces, recorded promotions and Run
|
|
7
|
+
* Supervision's opaque operation journal. It never decides candidate validity
|
|
8
|
+
* or freshness and never interprets journal records.
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/* Excluded from this release type: AttemptConflictError */
|
|
13
|
+
|
|
14
|
+
/* Excluded from this release type: AttemptStateError */
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Create a memory Store with linearizable CAS in a single JavaScript isolate.
|
|
18
|
+
* Each mutation snapshots its arguments before checking and changing the maps;
|
|
19
|
+
* the qualifying check and write have no await or caller callback between them.
|
|
20
|
+
* Values and fingerprints have separate indexes, so verification never touches
|
|
21
|
+
* payloads. The injected snapshot capability owns its supported value domain
|
|
22
|
+
* and failure behavior. This is a test backend, not durable or shared across
|
|
23
|
+
* processes.
|
|
24
|
+
*
|
|
25
|
+
* Only row storage is implemented here. Publication across multiple rows,
|
|
26
|
+
* generation allocation, lease ownership, and reclamation belong to higher layers.
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
export declare function createMemoryStore(capability: ISnapshotCapability, options?: MemoryStoreOptions): Store;
|
|
30
|
+
|
|
31
|
+
/** The first observed difference in a persisted read or a nested verification. @public */
|
|
32
|
+
export declare type Divergence = {
|
|
33
|
+
read: RecordedRead;
|
|
34
|
+
was: Fingerprint;
|
|
35
|
+
now: Fingerprint | 'missing';
|
|
36
|
+
} | {
|
|
37
|
+
read: Extract<RecordedRead, {
|
|
38
|
+
kind: 'memo';
|
|
39
|
+
}>;
|
|
40
|
+
nested: Divergence;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** Insert-only storage encountered an existing complete tuple. @public */
|
|
44
|
+
export declare class DuplicateRowError extends Error {
|
|
45
|
+
/** Identify an insert conflict without modifying the retained row. @public */
|
|
46
|
+
constructor(message?: string);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** An immutable value node and its caller-computed fingerprint. @public */
|
|
50
|
+
export declare interface FieldRow {
|
|
51
|
+
key: ResultKey;
|
|
52
|
+
generation: number;
|
|
53
|
+
path: Path;
|
|
54
|
+
fingerprint: Fingerprint;
|
|
55
|
+
value: unknown;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Compatibility shapes for the scaffold row Store. Their names and string paths
|
|
60
|
+
* describe that storage port, not the target Value Semantics or identity model.
|
|
61
|
+
*/
|
|
62
|
+
/** Opaque, stable, hex-encoded content digest; equality is string equality. @public */
|
|
63
|
+
export declare type Fingerprint = string & {
|
|
64
|
+
readonly __fp: unique symbol;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** Stored fingerprints cannot be compared with this runtime's algorithm. @public */
|
|
68
|
+
export declare class FingerprintAlgorithmMismatchError extends Error {
|
|
69
|
+
/** Name both identifiers so migrations are explicit rather than silent misses. @public */
|
|
70
|
+
constructor(storedAlgorithm: string, runtimeAlgorithm: string);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Writable generation columns; tuple identity cannot change after insertion. @public */
|
|
74
|
+
export declare type GenerationPatch = Partial<Omit<GenerationRow, 'key' | 'generation'>>;
|
|
75
|
+
|
|
76
|
+
/** A retained attempt, with lifecycle and numbering supplied by its caller. @public */
|
|
77
|
+
export declare interface GenerationRow {
|
|
78
|
+
key: ResultKey;
|
|
79
|
+
generation: number;
|
|
80
|
+
state: GenerationState;
|
|
81
|
+
reads: RecordedRead[];
|
|
82
|
+
identity: Identity | undefined;
|
|
83
|
+
startedAt: number;
|
|
84
|
+
endedAt: number | null;
|
|
85
|
+
cost: Record<string, number>;
|
|
86
|
+
arrival: string;
|
|
87
|
+
abandonReason?: 'error' | 'lease-expired' | 'refused';
|
|
88
|
+
error?: {
|
|
89
|
+
message: string;
|
|
90
|
+
stack?: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Retained lifecycle states interpreted by repository and claim, not by storage. @public */
|
|
95
|
+
export declare type GenerationState = 'claimed' | 'current' | 'superseded' | 'abandoned';
|
|
96
|
+
|
|
97
|
+
/* Excluded from this release type: HistoryClockError */
|
|
98
|
+
|
|
99
|
+
/* Excluded from this release type: HistoryIntegrityError */
|
|
100
|
+
|
|
101
|
+
/* Excluded from this release type: HistorySchemaError */
|
|
102
|
+
|
|
103
|
+
/* Excluded from this release type: IAbandonRequest */
|
|
104
|
+
|
|
105
|
+
/* Excluded from this release type: IAcceptanceRecord */
|
|
106
|
+
|
|
107
|
+
/* Excluded from this release type: IAcceptanceRequest */
|
|
108
|
+
|
|
109
|
+
/* Excluded from this release type: IAddressSegment */
|
|
110
|
+
|
|
111
|
+
/* Excluded from this release type: IAttemptRecord */
|
|
112
|
+
|
|
113
|
+
/* Excluded from this release type: IAttemptRequest */
|
|
114
|
+
|
|
115
|
+
/* Excluded from this release type: IAttemptState */
|
|
116
|
+
|
|
117
|
+
/* Excluded from this release type: IClockCapability */
|
|
118
|
+
|
|
119
|
+
/* Excluded from this release type: ICompletedEnvelope */
|
|
120
|
+
|
|
121
|
+
/* Excluded from this release type: ICompletedNavigationReader */
|
|
122
|
+
|
|
123
|
+
/* Excluded from this release type: ICompletedProjectionReader */
|
|
124
|
+
|
|
125
|
+
/* Excluded from this release type: ICompletedResultReader */
|
|
126
|
+
|
|
127
|
+
/* Excluded from this release type: ICompletedResultReference */
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Compatibility identity shape stored in scaffold rows. It does not establish
|
|
131
|
+
* target subject identity, binding correspondence, or collection semantics.
|
|
132
|
+
* @public
|
|
133
|
+
*/
|
|
134
|
+
export declare type Identity = {
|
|
135
|
+
kind: 'type';
|
|
136
|
+
type: string;
|
|
137
|
+
key: string;
|
|
138
|
+
} | {
|
|
139
|
+
kind: 'step';
|
|
140
|
+
name: string;
|
|
141
|
+
inputs: readonly Identity[];
|
|
142
|
+
} | {
|
|
143
|
+
kind: 'member';
|
|
144
|
+
of: Identity;
|
|
145
|
+
path: Path;
|
|
146
|
+
} | {
|
|
147
|
+
kind: 'collection';
|
|
148
|
+
step: string;
|
|
149
|
+
source: Identity;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/* Excluded from this release type: IDurableHistory */
|
|
153
|
+
|
|
154
|
+
/* Excluded from this release type: IDurableHistoryOptions */
|
|
155
|
+
|
|
156
|
+
/* Excluded from this release type: IHistoryScope */
|
|
157
|
+
|
|
158
|
+
/* Excluded from this release type: IJournalAddress */
|
|
159
|
+
|
|
160
|
+
/* Excluded from this release type: IJournalCommit */
|
|
161
|
+
|
|
162
|
+
/* Excluded from this release type: IJournalDeclaration */
|
|
163
|
+
|
|
164
|
+
/* Excluded from this release type: IJournalFormat */
|
|
165
|
+
|
|
166
|
+
/* Excluded from this release type: IJournalQuery */
|
|
167
|
+
|
|
168
|
+
/* Excluded from this release type: IJournalRecord */
|
|
169
|
+
|
|
170
|
+
/* Excluded from this release type: IJournalWrite */
|
|
171
|
+
|
|
172
|
+
/** A patch attempted to modify an immutable address or managed CAS version. @public */
|
|
173
|
+
export declare class InvalidStorePatchError extends Error {
|
|
174
|
+
/** Identify a structurally forbidden patch before any columns are changed. @public */
|
|
175
|
+
constructor(message?: string);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Excluded from this release type: IOperation */
|
|
179
|
+
|
|
180
|
+
/* Excluded from this release type: IOperationJournal */
|
|
181
|
+
|
|
182
|
+
/* Excluded from this release type: IPromotionQuery */
|
|
183
|
+
|
|
184
|
+
/* Excluded from this release type: IPromotionRecord */
|
|
185
|
+
|
|
186
|
+
/* Excluded from this release type: IPromotionRequest */
|
|
187
|
+
|
|
188
|
+
/* Excluded from this release type: IRecoveryOutcome */
|
|
189
|
+
|
|
190
|
+
/* Excluded from this release type: IResultVerification */
|
|
191
|
+
|
|
192
|
+
/* Excluded from this release type: IScopedSubject */
|
|
193
|
+
|
|
194
|
+
/* Excluded from this release type: ISelectedFact */
|
|
195
|
+
|
|
196
|
+
/* Excluded from this release type: ISelectedFingerprintRequest */
|
|
197
|
+
|
|
198
|
+
/* Excluded from this release type: ISelectedFingerprintResolution */
|
|
199
|
+
|
|
200
|
+
/* Excluded from this release type: ISelectedNode */
|
|
201
|
+
|
|
202
|
+
/* Excluded from this release type: ISelectedReadRequest */
|
|
203
|
+
|
|
204
|
+
/* Excluded from this release type: ISha256Capability */
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Produces a synchronous detached copy of primitives, arrays, ordinary objects'
|
|
208
|
+
* enumerable string-keyed properties, Date, RegExp, Map, Set, ArrayBuffer, and
|
|
209
|
+
* typed-array/DataView contents. It preserves cycles and repeated references
|
|
210
|
+
* within one copy and isolates both input and returned snapshots. Functions,
|
|
211
|
+
* symbols, and raw SharedArrayBuffer values fail. Getters may run; nonenumerable
|
|
212
|
+
* and symbol-keyed properties and arbitrary class prototypes are not preserved.
|
|
213
|
+
* This contract defines neither durable encoding nor canonical identity. It is
|
|
214
|
+
* public because History's direct memory-store constructor requires injection.
|
|
215
|
+
* @public
|
|
216
|
+
*/
|
|
217
|
+
declare interface ISnapshotCapability {
|
|
218
|
+
/** Return a detached copy or throw before a caller mutates owned state. */
|
|
219
|
+
snapshot<T>(value: T): T;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Excluded from this release type: ISqliteCapability */
|
|
223
|
+
|
|
224
|
+
/* Excluded from this release type: ISqliteConnection */
|
|
225
|
+
|
|
226
|
+
/* Excluded from this release type: ISqliteRow */
|
|
227
|
+
|
|
228
|
+
/* Excluded from this release type: ISqliteRunResult */
|
|
229
|
+
|
|
230
|
+
/* Excluded from this release type: ISqliteStatement */
|
|
231
|
+
|
|
232
|
+
/* Excluded from this release type: ISqliteSynchronousResult */
|
|
233
|
+
|
|
234
|
+
/* Excluded from this release type: ISqliteValue */
|
|
235
|
+
|
|
236
|
+
/* Excluded from this release type: IStageRequest */
|
|
237
|
+
|
|
238
|
+
/* Excluded from this release type: IValueProjectionDescriptor */
|
|
239
|
+
|
|
240
|
+
/* Excluded from this release type: IValueProjectionFact */
|
|
241
|
+
|
|
242
|
+
/* Excluded from this release type: IValueProjectionMember */
|
|
243
|
+
|
|
244
|
+
/* Excluded from this release type: IValueProjectionTraversal */
|
|
245
|
+
|
|
246
|
+
/* Excluded from this release type: IVersionedRecord */
|
|
247
|
+
|
|
248
|
+
/* Excluded from this release type: IVersionedSubject */
|
|
249
|
+
|
|
250
|
+
/* Excluded from this release type: IWriterAcquisition */
|
|
251
|
+
|
|
252
|
+
/* Excluded from this release type: IWriterAcquisitionRequest */
|
|
253
|
+
|
|
254
|
+
/* Excluded from this release type: IWriterContention */
|
|
255
|
+
|
|
256
|
+
/* Excluded from this release type: IWriterLease */
|
|
257
|
+
|
|
258
|
+
/* Excluded from this release type: IWriterRenewal */
|
|
259
|
+
|
|
260
|
+
/* Excluded from this release type: JournalConflictError */
|
|
261
|
+
|
|
262
|
+
/* Excluded from this release type: JournalVersionError */
|
|
263
|
+
|
|
264
|
+
/** Options for the isolated, non-durable test backend. @public */
|
|
265
|
+
export declare interface MemoryStoreOptions {
|
|
266
|
+
/** Metadata compatibility identifier; the initial store format uses sha256. */
|
|
267
|
+
fingerprintAlgorithm?: string;
|
|
268
|
+
/* Excluded from this release type: _onValueRead */
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** An update targeted a generation that has never been inserted. @public */
|
|
272
|
+
export declare class MissingRowError extends Error {
|
|
273
|
+
/** Identify an absent update target; updates never implicitly insert. @public */
|
|
274
|
+
constructor(message?: string);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/* Excluded from this release type: openDurableHistory */
|
|
278
|
+
|
|
279
|
+
/** Observable call outcomes; an unmemoized named execution has no storage key. @public */
|
|
280
|
+
export declare type Outcome = {
|
|
281
|
+
kind: 'served';
|
|
282
|
+
key: ResultKey;
|
|
283
|
+
generation: number;
|
|
284
|
+
} | {
|
|
285
|
+
kind: 'executed';
|
|
286
|
+
key: ResultKey;
|
|
287
|
+
generation: number;
|
|
288
|
+
} | {
|
|
289
|
+
kind: 'checked';
|
|
290
|
+
key: ResultKey;
|
|
291
|
+
wouldExecute: boolean;
|
|
292
|
+
divergence?: Divergence;
|
|
293
|
+
} | {
|
|
294
|
+
kind: 'refused';
|
|
295
|
+
key: ResultKey;
|
|
296
|
+
reason: unknown;
|
|
297
|
+
} | {
|
|
298
|
+
kind: 'failed';
|
|
299
|
+
key: ResultKey;
|
|
300
|
+
error: unknown;
|
|
301
|
+
} | {
|
|
302
|
+
kind: 'abandoned';
|
|
303
|
+
key: ResultKey;
|
|
304
|
+
reason: 'error' | 'lease-expired' | 'refused';
|
|
305
|
+
} | {
|
|
306
|
+
kind: 'ran';
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/** A legacy row-storage address, not the future structured semantic path. @public */
|
|
310
|
+
export declare type Path = string;
|
|
311
|
+
|
|
312
|
+
/** Legacy persisted read rows; target observation encoding remains undecided. @public */
|
|
313
|
+
export declare type RecordedRead = {
|
|
314
|
+
kind: 'field';
|
|
315
|
+
arg: number;
|
|
316
|
+
path: Path;
|
|
317
|
+
fingerprint: Fingerprint;
|
|
318
|
+
} | {
|
|
319
|
+
kind: 'whole';
|
|
320
|
+
arg: number;
|
|
321
|
+
fingerprint: Fingerprint;
|
|
322
|
+
} | {
|
|
323
|
+
kind: 'memo';
|
|
324
|
+
key: ResultKey;
|
|
325
|
+
generation: number;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
/** Complete storage tuple. Backends must preserve boundaries between all three parts. @public */
|
|
329
|
+
export declare type ResultKey = {
|
|
330
|
+
step: string;
|
|
331
|
+
revision: number;
|
|
332
|
+
subjectHash: string;
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
/* Excluded from this release type: StaleWriterError */
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Storage mechanism for independent rows, with linearizable subject CAS.
|
|
339
|
+
* All inputs and returned rows are detached snapshots: caller mutation cannot
|
|
340
|
+
* alter persisted data. Values may only change by inserting another generation.
|
|
341
|
+
* There is no transaction spanning these methods; callers must not infer atomic
|
|
342
|
+
* claim/generation publication from the per-row CAS guarantee.
|
|
343
|
+
* @public
|
|
344
|
+
*/
|
|
345
|
+
export declare interface Store {
|
|
346
|
+
/** Return detached format metadata; opening code must reject algorithm mismatches. */
|
|
347
|
+
meta(): Promise<StoreMetadata>;
|
|
348
|
+
/** Read a detached subject snapshot, or undefined for an absent tuple. */
|
|
349
|
+
getSubject(key: ResultKey): Promise<SubjectRow | undefined>;
|
|
350
|
+
/** Insert only; duplicate tuples reject, as do versions outside safe integers. */
|
|
351
|
+
putSubject(row: SubjectRow): Promise<void>;
|
|
352
|
+
/**
|
|
353
|
+
* Atomically apply a shallow column patch only when the stored version matches.
|
|
354
|
+
* Success increments that version once, even for an empty patch; a missing or
|
|
355
|
+
* stale row returns false without changes. Key/version properties reject at
|
|
356
|
+
* runtime, including extras passed from untyped JavaScript callers.
|
|
357
|
+
* An exhausted MAX_SAFE_INTEGER version rejects rather than reporting success
|
|
358
|
+
* without advancing the token. Neither rejection changes the stored row.
|
|
359
|
+
*/
|
|
360
|
+
casSubject(key: ResultKey, expectedVersion: number, patch: SubjectPatch): Promise<boolean>;
|
|
361
|
+
/** Read a detached generation, or undefined for an absent tuple. */
|
|
362
|
+
getGeneration(key: ResultKey, generation: number): Promise<GenerationRow | undefined>;
|
|
363
|
+
/** Return detached rows for exactly this complete key; ordering is unspecified. */
|
|
364
|
+
listGenerations(key: ResultKey): Promise<GenerationRow[]>;
|
|
365
|
+
/** Insert only; generation numbers are supplied, never allocated by storage. */
|
|
366
|
+
putGeneration(row: GenerationRow): Promise<void>;
|
|
367
|
+
/** Patch an existing row; missing tuples and attempts to change its key reject. */
|
|
368
|
+
updateGeneration(key: ResultKey, generation: number, patch: GenerationPatch): Promise<void>;
|
|
369
|
+
/**
|
|
370
|
+
* Insert an atomic batch of immutable fields. Duplicate addresses, within the
|
|
371
|
+
* batch or already stored, reject the whole batch without inserting anything.
|
|
372
|
+
* This proposed storage refinement enforces retained-value immutability.
|
|
373
|
+
*/
|
|
374
|
+
putFields(rows: FieldRow[]): Promise<void>;
|
|
375
|
+
/** Return requested field snapshots; absent paths are omitted. */
|
|
376
|
+
getFields(key: ResultKey, generation: number, paths: Path[]): Promise<FieldRow[]>;
|
|
377
|
+
/** Return requested fingerprints without reading/deserializing any field value. */
|
|
378
|
+
getFingerprints(key: ResultKey, generation: number, paths: Path[]): Promise<Map<Path, Fingerprint>>;
|
|
379
|
+
/**
|
|
380
|
+
* Query leases strictly less than now, oldest first, with at most limit rows.
|
|
381
|
+
* Zero limit returns no rows. This query never sweeps or changes a claim.
|
|
382
|
+
*/
|
|
383
|
+
expiredClaims(now: number, limit: number): Promise<SubjectRow[]>;
|
|
384
|
+
/** Release resources owned by this store. */
|
|
385
|
+
close(): Promise<void>;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** Persisted format identifiers, checked before using a store's fingerprints. @public */
|
|
389
|
+
export declare interface StoreMetadata {
|
|
390
|
+
schemaVersion: number;
|
|
391
|
+
fingerprintAlgorithm: string;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
/** Legacy row subject shape; future author-supplied subject identity is separate. @public */
|
|
395
|
+
export declare type Subject = Extract<Identity, {
|
|
396
|
+
kind: 'step';
|
|
397
|
+
}>;
|
|
398
|
+
|
|
399
|
+
/** Writable subject columns; the complete key and CAS token cannot be patched. @public */
|
|
400
|
+
export declare type SubjectPatch = Partial<Omit<SubjectRow, 'key' | 'version'>>;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* One compare-and-set row per complete result key. Repository owns generation
|
|
404
|
+
* meaning; claim owns lease meaning. Storage only preserves and patches columns.
|
|
405
|
+
* @public
|
|
406
|
+
*/
|
|
407
|
+
export declare interface SubjectRow {
|
|
408
|
+
key: ResultKey;
|
|
409
|
+
subject: Subject;
|
|
410
|
+
/** Nonnegative safe-integer CAS token, incremented once per successful CAS. */
|
|
411
|
+
version: number;
|
|
412
|
+
currentGeneration: number | null;
|
|
413
|
+
claim: null | {
|
|
414
|
+
generation: number;
|
|
415
|
+
holder: string;
|
|
416
|
+
leaseUntil: number;
|
|
417
|
+
progress: {
|
|
418
|
+
fingerprint: Fingerprint;
|
|
419
|
+
value: unknown;
|
|
420
|
+
} | null;
|
|
421
|
+
};
|
|
422
|
+
durations: number[];
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export { }
|