@microdelta/history 0.1.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 +14 -3
- package/dist/api/history.alpha.d.ts +2 -2
- package/dist/api/history.root.raw.alpha.d.ts +332 -19
- package/dist/api/history.root.raw.beta.d.ts +34 -2
- package/dist/api/history.root.raw.public.d.ts +34 -2
- package/dist/api/history.root.raw.untrimmed.d.ts +332 -19
- package/dist/api/history.shared.alpha.d.ts +328 -17
- package/dist/api/history.shared.beta.d.ts +30 -0
- package/dist/api/history.shared.public.d.ts +30 -0
- package/dist/api/history.shared.untrimmed.d.ts +328 -17
- package/dist/api/history.untrimmed.d.ts +2 -2
- package/dist/src/durable/contracts.d.ts +290 -17
- package/dist/src/durable/contracts.d.ts.map +1 -1
- package/dist/src/durable/errors.d.ts +26 -1
- package/dist/src/durable/errors.d.ts.map +1 -1
- package/dist/src/durable/errors.js +32 -1
- package/dist/src/durable/errors.js.map +1 -1
- package/dist/src/durable/index.d.ts.map +1 -1
- package/dist/src/durable/index.js +275 -95
- package/dist/src/durable/index.js.map +1 -1
- 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/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 +13 -4
- package/dist/src/durable/schema.d.ts.map +1 -1
- package/dist/src/durable/schema.js +74 -5
- package/dist/src/durable/schema.js.map +1 -1
- package/dist/src/durable/selected-index.d.ts.map +1 -1
- package/dist/src/durable/selected-index.js +3 -1
- package/dist/src/durable/selected-index.js.map +1 -1
- package/dist/src/index.d.ts +6 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -3
- package/dist/src/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Contracts of History's durable authority: the one consistency owner for
|
|
3
3
|
* immutable completed results, attempt history, the single logical writer,
|
|
4
|
-
* atomic publication, current pointers
|
|
5
|
-
* (PUB-001, ARC-007
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* atomic publication, current pointers, separate acceptance records, recorded
|
|
5
|
+
* promotions and Run Supervision's operation journal (PUB-001, ARC-007,
|
|
6
|
+
* RUN-011/012/017). These are project-private alpha shapes. They carry
|
|
7
|
+
* Resolution's provenance and evidence, promotion evidence and Supervision's
|
|
8
|
+
* journal records as versioned opaque records and never interpret Definition,
|
|
9
|
+
* Tracking, Resolution or Supervision meaning; deciding whether a result is
|
|
10
|
+
* currently acceptable remains Resolution's responsibility, and deciding what
|
|
11
|
+
* an operation or deferral means remains Supervision's.
|
|
12
|
+
*
|
|
13
|
+
* Every durable record belongs to exactly one environment namespace of one
|
|
14
|
+
* analysis: attempts, completed results, current heads, acceptance records,
|
|
15
|
+
* promotion records and journal records. Nothing recorded in one environment
|
|
16
|
+
* satisfies a lookup in another, except a completed result that an explicit
|
|
17
|
+
* promotion record names for that other environment (RUN-017).
|
|
9
18
|
* @packageDocumentation
|
|
10
19
|
*/
|
|
11
20
|
import type { IClockCapability, ISha256Capability, ISqliteCapability } from '@microdelta/machine';
|
|
@@ -14,7 +23,10 @@ import type { ICompletedNavigationReader, ICompletedResultReader, ICompletedResu
|
|
|
14
23
|
* The analysis and environment that scope every subject, attempt and result
|
|
15
24
|
* within one logical store. The same subject text in another analysis or
|
|
16
25
|
* environment is a different scoped subject (RES-001/002). Both are complete
|
|
17
|
-
* opaque non-empty strings compared by exact equality.
|
|
26
|
+
* opaque non-empty strings compared by exact equality. An environment is a
|
|
27
|
+
* namespace within one store (RUN-017): a trial and a production run of the
|
|
28
|
+
* same analysis use different environments of the same file, selected per
|
|
29
|
+
* call rather than process-wide.
|
|
18
30
|
* @alpha
|
|
19
31
|
*/
|
|
20
32
|
export interface IHistoryScope {
|
|
@@ -77,10 +89,31 @@ export interface IWriterLease {
|
|
|
77
89
|
/** The first effective time at which the lease is no longer valid. */
|
|
78
90
|
readonly expiresAt: number;
|
|
79
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Storage contention on a lease operation: another connection, possibly in
|
|
94
|
+
* another process, held SQLite's write lock past the host's bounded busy wait,
|
|
95
|
+
* so History could not decide and changed nothing, not even the clock
|
|
96
|
+
* high-water. It is a fact about storage, never about ownership (PUB-005): it
|
|
97
|
+
* neither grants nor refuses, and whether to try again is the caller's policy.
|
|
98
|
+
* @alpha
|
|
99
|
+
*/
|
|
100
|
+
export interface IWriterContention {
|
|
101
|
+
/** History could not take SQLite's write lock in time. */
|
|
102
|
+
readonly kind: 'contended';
|
|
103
|
+
/**
|
|
104
|
+
* The writer recorded at that moment, read without the write lock: its
|
|
105
|
+
* holder, fence and expiry as stored, whether or not the lease has expired.
|
|
106
|
+
* Undefined when no holder is recorded, or when that read was itself busy;
|
|
107
|
+
* History never guesses a holder.
|
|
108
|
+
*/
|
|
109
|
+
readonly writer: IWriterLease | undefined;
|
|
110
|
+
/** The host's diagnostic of the contention; it carries no stored values. */
|
|
111
|
+
readonly detail: string;
|
|
112
|
+
}
|
|
80
113
|
/**
|
|
81
114
|
* The outcome of asking for the single logical writer. `held` reports an
|
|
82
115
|
* observed unexpired holder, not a failed compare-and-swap (PUB-005), and
|
|
83
|
-
* grants nothing.
|
|
116
|
+
* grants nothing; `contended` reports that storage was too busy to decide.
|
|
84
117
|
* @alpha
|
|
85
118
|
*/
|
|
86
119
|
export type IWriterAcquisition = {
|
|
@@ -95,7 +128,20 @@ export type IWriterAcquisition = {
|
|
|
95
128
|
readonly holder: string;
|
|
96
129
|
/** When that holder's lease expires, in History's clock domain. */
|
|
97
130
|
readonly expiresAt: number;
|
|
98
|
-
};
|
|
131
|
+
} | IWriterContention;
|
|
132
|
+
/**
|
|
133
|
+
* The outcome of renewing a lease the caller holds: `renewed` with the later
|
|
134
|
+
* expiry, or `contended` when storage was too busy to decide, in which case
|
|
135
|
+
* the lease is exactly as it was and is neither renewed nor refused. A stale
|
|
136
|
+
* or expired lease is not an outcome but a refusal (`StaleWriterError`).
|
|
137
|
+
* @alpha
|
|
138
|
+
*/
|
|
139
|
+
export type IWriterRenewal = {
|
|
140
|
+
/** The lease was extended. */
|
|
141
|
+
readonly kind: 'renewed';
|
|
142
|
+
/** The same holder and fence with the new expiry. */
|
|
143
|
+
readonly lease: IWriterLease;
|
|
144
|
+
} | IWriterContention;
|
|
99
145
|
/** A request for the writer lease. @alpha */
|
|
100
146
|
export interface IWriterAcquisitionRequest {
|
|
101
147
|
/** The opaque non-empty identity of the prospective holder. */
|
|
@@ -226,8 +272,22 @@ export interface IAcceptanceRequest {
|
|
|
226
272
|
readonly reference: ICompletedResultReference;
|
|
227
273
|
/** Resolution's versioned acceptance evidence. */
|
|
228
274
|
readonly evidence: IVersionedRecord;
|
|
229
|
-
/**
|
|
275
|
+
/**
|
|
276
|
+
* Exact completed results the current verification followed. Each must be
|
|
277
|
+
* admissible in the accepting environment: published there, or named by a
|
|
278
|
+
* promotion into it.
|
|
279
|
+
*/
|
|
230
280
|
readonly dependencies: readonly ICompletedResultReference[];
|
|
281
|
+
/**
|
|
282
|
+
* The environment, within the result's analysis, whose current verification
|
|
283
|
+
* accepted the result. It is always explicit and never inferred from the
|
|
284
|
+
* reference: the caller names its own run environment. It may be the
|
|
285
|
+
* environment that published the result, or another environment into which
|
|
286
|
+
* a recorded promotion admits the result. The acceptance then belongs to
|
|
287
|
+
* that environment's namespace alone and never satisfies a lookup in any
|
|
288
|
+
* other environment.
|
|
289
|
+
*/
|
|
290
|
+
readonly environment: string;
|
|
231
291
|
}
|
|
232
292
|
/** One immutable current-acceptance record, separate from the result it names. @alpha */
|
|
233
293
|
export interface IAcceptanceRecord {
|
|
@@ -235,6 +295,8 @@ export interface IAcceptanceRecord {
|
|
|
235
295
|
readonly acceptanceId: number;
|
|
236
296
|
/** The accepted exact result. */
|
|
237
297
|
readonly reference: ICompletedResultReference;
|
|
298
|
+
/** The environment namespace whose verification recorded this acceptance. */
|
|
299
|
+
readonly environment: string;
|
|
238
300
|
/** The writer fence under which the acceptance was recorded. */
|
|
239
301
|
readonly fence: number;
|
|
240
302
|
/** Resolution's acceptance evidence, decoded and frozen. */
|
|
@@ -253,6 +315,174 @@ export type IResultVerification = {
|
|
|
253
315
|
readonly kind: 'inconsistent';
|
|
254
316
|
readonly detail: string;
|
|
255
317
|
};
|
|
318
|
+
/**
|
|
319
|
+
* Asks History to admit exact completed results of other environments into
|
|
320
|
+
* one target environment of the same analysis (RUN-017). A trial result
|
|
321
|
+
* satisfies a production lookup only through such a recorded promotion. The
|
|
322
|
+
* target names where the results are admitted; each reference keeps naming
|
|
323
|
+
* its own publishing environment. The evidence is the promoter's versioned
|
|
324
|
+
* record of who promoted what and why; History stores it opaquely.
|
|
325
|
+
* @alpha
|
|
326
|
+
*/
|
|
327
|
+
export interface IPromotionRequest {
|
|
328
|
+
/** The analysis and environment the results are admitted into. */
|
|
329
|
+
readonly target: IHistoryScope;
|
|
330
|
+
/**
|
|
331
|
+
* Distinct exact completed results of the target's analysis, none published
|
|
332
|
+
* in the target environment, in the promoter's order.
|
|
333
|
+
*/
|
|
334
|
+
readonly references: readonly ICompletedResultReference[];
|
|
335
|
+
/** The promoter's versioned evidence for this promotion. */
|
|
336
|
+
readonly evidence: IVersionedRecord;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* One immutable promotion record. It admits the named results as candidates,
|
|
340
|
+
* dependencies and acceptance targets in its target environment and changes
|
|
341
|
+
* nothing else: each result keeps its exact reference, envelope, provenance
|
|
342
|
+
* and acceptances, and no current head moves in any environment. The target
|
|
343
|
+
* environment's later verifications record their own acceptances.
|
|
344
|
+
* @alpha
|
|
345
|
+
*/
|
|
346
|
+
export interface IPromotionRecord {
|
|
347
|
+
/** Store-wide never-reused promotion identity, increasing in record order. */
|
|
348
|
+
readonly promotionId: number;
|
|
349
|
+
/** The analysis and environment the results were admitted into. */
|
|
350
|
+
readonly target: IHistoryScope;
|
|
351
|
+
/** The writer fence under which the promotion was recorded. */
|
|
352
|
+
readonly fence: number;
|
|
353
|
+
/** The promoter's evidence, decoded and frozen. */
|
|
354
|
+
readonly evidence: IVersionedRecord;
|
|
355
|
+
/** The admitted exact results, each in its own publishing scope, in recorded order. */
|
|
356
|
+
readonly references: readonly ICompletedResultReference[];
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Selects promotion records into one target environment, optionally only
|
|
360
|
+
* those naming one exact result.
|
|
361
|
+
* @alpha
|
|
362
|
+
*/
|
|
363
|
+
export interface IPromotionQuery {
|
|
364
|
+
/** The analysis and environment whose admitting promotions to read. */
|
|
365
|
+
readonly target: IHistoryScope;
|
|
366
|
+
/** When present, only promotions that name this exact result. */
|
|
367
|
+
readonly reference?: ICompletedResultReference;
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* One owner-defined journal record format and the exact format versions a
|
|
371
|
+
* journal port can read and write. A format is only a record's version tag:
|
|
372
|
+
* it never identifies a record or its collection. History compares the tag
|
|
373
|
+
* and versions for exact equality and never interprets the content.
|
|
374
|
+
* @alpha
|
|
375
|
+
*/
|
|
376
|
+
export interface IJournalFormat {
|
|
377
|
+
/** The owner-defined non-empty format identity. */
|
|
378
|
+
readonly format: string;
|
|
379
|
+
/** The positive safe-integer versions of that format this port understands. */
|
|
380
|
+
readonly versions: readonly number[];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* The formats a journal port is bound to. A stored record of an undeclared
|
|
384
|
+
* format or version is refused rather than returned or overwritten, so a
|
|
385
|
+
* caller never acts on, or clobbers, a record it does not understand.
|
|
386
|
+
* @alpha
|
|
387
|
+
*/
|
|
388
|
+
export interface IJournalDeclaration {
|
|
389
|
+
/** At least one declared format, each format named once. */
|
|
390
|
+
readonly formats: readonly IJournalFormat[];
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Locates one journal record: its environment namespace, owner-named
|
|
394
|
+
* collection and owner-defined key. The record's identity is exactly this
|
|
395
|
+
* address; its format tag may change between revisions only by
|
|
396
|
+
* compare-and-set.
|
|
397
|
+
* @alpha
|
|
398
|
+
*/
|
|
399
|
+
export interface IJournalAddress extends IHistoryScope {
|
|
400
|
+
/** The owner-named non-empty collection, such as Supervision's operations. */
|
|
401
|
+
readonly collection: string;
|
|
402
|
+
/** The owner-defined non-empty key, unique within the namespace and collection. */
|
|
403
|
+
readonly key: string;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Selects every record of one collection in one environment namespace.
|
|
407
|
+
* @alpha
|
|
408
|
+
*/
|
|
409
|
+
export interface IJournalQuery extends IHistoryScope {
|
|
410
|
+
/** The owner-named collection to list. */
|
|
411
|
+
readonly collection: string;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* One compare-and-set write of a journal commit. The expected revision is the
|
|
415
|
+
* revision the caller last read at this address; `0` asserts that the key has
|
|
416
|
+
* never been written in the collection, under any format. The record's
|
|
417
|
+
* format and version are its version tag and must be declared by the port.
|
|
418
|
+
* @alpha
|
|
419
|
+
*/
|
|
420
|
+
export interface IJournalWrite {
|
|
421
|
+
/** The owner-named non-empty collection. */
|
|
422
|
+
readonly collection: string;
|
|
423
|
+
/** The owner-defined non-empty key. */
|
|
424
|
+
readonly key: string;
|
|
425
|
+
/** The current revision the write replaces, or `0` for a new key. */
|
|
426
|
+
readonly expectedRevision: number;
|
|
427
|
+
/** The new owner-defined record. */
|
|
428
|
+
readonly record: IVersionedRecord;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* One atomic journal commit in one environment namespace: every write lands
|
|
432
|
+
* in the same transaction, or none does.
|
|
433
|
+
* @alpha
|
|
434
|
+
*/
|
|
435
|
+
export interface IJournalCommit extends IHistoryScope {
|
|
436
|
+
/** At least one write, each collection and key pair at most once. */
|
|
437
|
+
readonly writes: readonly IJournalWrite[];
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* One immutable revision of a journal record. Revisions of an address start
|
|
441
|
+
* at 1 and increase by one per committed write; earlier revisions are retained
|
|
442
|
+
* and never rewritten.
|
|
443
|
+
* @alpha
|
|
444
|
+
*/
|
|
445
|
+
export interface IJournalRecord extends IHistoryScope {
|
|
446
|
+
/** The owner-named collection. */
|
|
447
|
+
readonly collection: string;
|
|
448
|
+
/** The owner-defined key. */
|
|
449
|
+
readonly key: string;
|
|
450
|
+
/** This revision's number within its address, starting at 1. */
|
|
451
|
+
readonly revision: number;
|
|
452
|
+
/** Store-wide never-reused journal write identity, increasing in commit order. */
|
|
453
|
+
readonly sequence: number;
|
|
454
|
+
/** The writer fence under which this revision was committed. */
|
|
455
|
+
readonly fence: number;
|
|
456
|
+
/** The owner-defined record, decoded and frozen, with this revision's version tag. */
|
|
457
|
+
readonly record: IVersionedRecord;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Run Supervision's operation journal, stored by History (RUN-011/012). It
|
|
461
|
+
* keeps owner-defined operation and deferral records, such as an intent
|
|
462
|
+
* committed before a send or a "not before" deferral, atomically and under
|
|
463
|
+
* writer fencing, without interpreting them: History owns only namespacing,
|
|
464
|
+
* collections, revisions, fencing and the declared-version check. A commit
|
|
465
|
+
* needs the current writer lease and checks holder, fence and unexpired lease
|
|
466
|
+
* in the same transaction as its compare-and-set checks and writes; reads
|
|
467
|
+
* need no lease and never see an uncommitted write.
|
|
468
|
+
* @alpha
|
|
469
|
+
*/
|
|
470
|
+
export interface IOperationJournal {
|
|
471
|
+
/** The frozen formats and versions this port was opened with. */
|
|
472
|
+
readonly formats: readonly IJournalFormat[];
|
|
473
|
+
/**
|
|
474
|
+
* Commit every write in one transaction. The whole commit is refused,
|
|
475
|
+
* unchanged, for a stale lease, an undeclared format or version, a current
|
|
476
|
+
* revision whose stored format or version this port does not understand
|
|
477
|
+
* (checked first, since such a caller cannot have read it), or an expected
|
|
478
|
+
* revision that is not the address's current revision.
|
|
479
|
+
*/
|
|
480
|
+
commit(lease: IWriterLease, request: IJournalCommit): readonly IJournalRecord[];
|
|
481
|
+
/** The current revision at one address, or undefined if the key was never written there. */
|
|
482
|
+
read(address: IJournalAddress): IJournalRecord | undefined;
|
|
483
|
+
/** The current revision of every key in one collection, in order of first write. */
|
|
484
|
+
list(query: IJournalQuery): readonly IJournalRecord[];
|
|
485
|
+
}
|
|
256
486
|
/**
|
|
257
487
|
* Host capabilities and identity for opening a durable History store. Node
|
|
258
488
|
* access stays behind the injected SQLite and clock capabilities. The logical
|
|
@@ -287,6 +517,15 @@ export interface IDurableHistoryOptions {
|
|
|
287
517
|
* larger fence. A host reading that is not a nonnegative safe integer fails
|
|
288
518
|
* the operation without any change. This is a local single-file policy, not a
|
|
289
519
|
* distributed-time or liveness guarantee.
|
|
520
|
+
*
|
|
521
|
+
* Storage contention: every mutation, including acquisition, is one IMMEDIATE
|
|
522
|
+
* SQLite transaction. When another connection, possibly in another process,
|
|
523
|
+
* holds SQLite's write lock past the host's bounded busy wait, nothing
|
|
524
|
+
* changes. Acquisition and renewal, the lease operations a waiter repeats,
|
|
525
|
+
* report it as their `contended` outcome ({@link IWriterContention}), so
|
|
526
|
+
* contention is never mistaken for ownership or staleness (PUB-005). Any other
|
|
527
|
+
* operation fails with Machine's `SqliteBusyError`. Whether to try again is
|
|
528
|
+
* always the caller's policy, never History's.
|
|
290
529
|
* @alpha
|
|
291
530
|
*/
|
|
292
531
|
export interface IDurableHistory {
|
|
@@ -294,11 +533,20 @@ export interface IDurableHistory {
|
|
|
294
533
|
readonly logicalStore: string;
|
|
295
534
|
/** Exact selected reads over completed results, answered from their generated index. */
|
|
296
535
|
readonly reader: ICompletedResultReader & ICompletedNavigationReader;
|
|
297
|
-
/**
|
|
536
|
+
/**
|
|
537
|
+
* Acquire the single logical writer, or report the observed unexpired
|
|
538
|
+
* holder, or report storage contention with the recorded writer. Any other
|
|
539
|
+
* failure, such as damaged storage or an unusable clock, is thrown.
|
|
540
|
+
*/
|
|
298
541
|
acquireWriter(request: IWriterAcquisitionRequest): IWriterAcquisition;
|
|
299
|
-
/**
|
|
300
|
-
|
|
301
|
-
|
|
542
|
+
/**
|
|
543
|
+
* Extend a still-valid lease, or report storage contention, which leaves the
|
|
544
|
+
* lease as it was. A stale or expired lease is rejected with
|
|
545
|
+
* `StaleWriterError`. Only the expiry changes: the durable fence is left as
|
|
546
|
+
* it is, never rewritten from the presented lease.
|
|
547
|
+
*/
|
|
548
|
+
renewWriter(lease: IWriterLease, leaseMilliseconds: number): IWriterRenewal;
|
|
549
|
+
/** End a still-valid lease; the durable fence is left as it is, so the next grant still advances it. */
|
|
302
550
|
releaseWriter(lease: IWriterLease): void;
|
|
303
551
|
/** Inspect the recorded holder, if any, without granting authority. */
|
|
304
552
|
currentWriter(): IWriterLease | undefined;
|
|
@@ -321,9 +569,17 @@ export interface IDurableHistory {
|
|
|
321
569
|
abandonAttempt(lease: IWriterLease, request: IAbandonRequest): IAttemptRecord;
|
|
322
570
|
/** Report what durably happened to one identified execution, read-only. */
|
|
323
571
|
recoverAttempt(request: IAttemptRequest): IRecoveryOutcome;
|
|
324
|
-
/**
|
|
572
|
+
/**
|
|
573
|
+
* Completed results admissible for one scoped subject and version, latest
|
|
574
|
+
* publication first: those published in the subject's environment and those
|
|
575
|
+
* a recorded promotion admits into it. A promoted result keeps its own exact
|
|
576
|
+
* reference and envelope scope; nothing from any other environment appears.
|
|
577
|
+
*/
|
|
325
578
|
findCandidates(subject: IVersionedSubject): readonly ICompletedEnvelope[];
|
|
326
|
-
/**
|
|
579
|
+
/**
|
|
580
|
+
* The scoped subject's latest publication in its own environment, if any;
|
|
581
|
+
* never rewound by acceptance and never moved by a promotion.
|
|
582
|
+
*/
|
|
327
583
|
readCurrent(subject: IScopedSubject): ICompletedResultReference | undefined;
|
|
328
584
|
/** Read one exact result's metadata without loading its payload. */
|
|
329
585
|
readEnvelope(reference: ICompletedResultReference): ICompletedEnvelope;
|
|
@@ -331,8 +587,25 @@ export interface IDurableHistory {
|
|
|
331
587
|
verifyResult(reference: ICompletedResultReference): IResultVerification;
|
|
332
588
|
/** Record a current acceptance of an existing result without touching it or the current pointer. */
|
|
333
589
|
recordAcceptance(lease: IWriterLease, request: IAcceptanceRequest): IAcceptanceRecord;
|
|
334
|
-
/**
|
|
335
|
-
|
|
590
|
+
/**
|
|
591
|
+
* Acceptance records naming one exact result that were recorded in the
|
|
592
|
+
* named environment, in record order. The environment is always explicit:
|
|
593
|
+
* the publishing environment, or one a promotion admits the result into.
|
|
594
|
+
*/
|
|
595
|
+
readAcceptances(reference: ICompletedResultReference, environment: string): readonly IAcceptanceRecord[];
|
|
596
|
+
/**
|
|
597
|
+
* In one commit, record a promotion that admits exact results of other
|
|
598
|
+
* environments into the target environment. Nothing already recorded changes.
|
|
599
|
+
*/
|
|
600
|
+
promoteResults(lease: IWriterLease, request: IPromotionRequest): IPromotionRecord;
|
|
601
|
+
/** Promotion records into one environment, in record order. */
|
|
602
|
+
readPromotions(query: IPromotionQuery): readonly IPromotionRecord[];
|
|
603
|
+
/**
|
|
604
|
+
* Open Run Supervision's operation journal over this store, bound to the
|
|
605
|
+
* declared record formats and versions. The port shares this authority's
|
|
606
|
+
* connection, writer lease and lifetime.
|
|
607
|
+
*/
|
|
608
|
+
openJournal(declaration: IJournalDeclaration): IOperationJournal;
|
|
336
609
|
/** Release the SQLite file; later calls fail. */
|
|
337
610
|
close(): void;
|
|
338
611
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/durable/contracts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/durable/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,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
* Distinct failure classes of the durable History authority. Diagnostics must
|
|
3
3
|
* distinguish stale ownership, conflicting execution identity, invalid
|
|
4
|
-
* lifecycle transitions, unsupported storage and
|
|
4
|
+
* lifecycle transitions, unsupported storage, journal compare-and-set
|
|
5
|
+
* conflicts, undeclared journal record versions and integrity failures rather
|
|
5
6
|
* than report a generic miss (execution.md, required validation fixtures).
|
|
6
7
|
* None of these classes extends `TypeError`, so a reader never mistakes a
|
|
7
8
|
* storage failure for Value's rejection of a selection's shape.
|
|
@@ -66,4 +67,28 @@ export declare class HistoryClockError extends Error {
|
|
|
66
67
|
/** Create a clock refusal with a diagnostic message. */
|
|
67
68
|
constructor(message: string);
|
|
68
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* A journal commit's compare-and-set expectation does not hold: the presented
|
|
72
|
+
* expected revision is not the key's current revision (a new-key expectation
|
|
73
|
+
* met an existing key, or an update met a later or absent revision). The
|
|
74
|
+
* whole commit was rolled back unchanged; the caller must re-read before
|
|
75
|
+
* deciding again.
|
|
76
|
+
* @alpha
|
|
77
|
+
*/
|
|
78
|
+
export declare class JournalConflictError extends Error {
|
|
79
|
+
/** Create a compare-and-set rejection with a diagnostic message. */
|
|
80
|
+
constructor(message: string);
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A journal record's format or format version is not one the journal port
|
|
84
|
+
* declared. On a write the record is refused; on a read or list the stored
|
|
85
|
+
* record is refused rather than returned; a commit over a current revision of
|
|
86
|
+
* an undeclared version is refused rather than overwriting it. History never
|
|
87
|
+
* interprets or converts the content of another format version.
|
|
88
|
+
* @alpha
|
|
89
|
+
*/
|
|
90
|
+
export declare class JournalVersionError extends Error {
|
|
91
|
+
/** Create an undeclared-version refusal with a diagnostic message. */
|
|
92
|
+
constructor(message: string);
|
|
93
|
+
}
|
|
69
94
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/durable/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/durable/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,6DAA6D;gBAC1C,OAAO,EAAE,MAAM;CAInC;AAED;;;;;GAKG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,2DAA2D;gBACxC,OAAO,EAAE,MAAM;CAInC;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,oEAAoE;gBACjD,OAAO,EAAE,MAAM;CAInC;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,uEAAuE;gBACpD,OAAO,EAAE,MAAM;CAInC;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,wEAAwE;gBACrD,OAAO,EAAE,MAAM;CAInC;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,wDAAwD;gBACrC,OAAO,EAAE,MAAM;CAInC;AAED;;;;;;;GAOG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,oEAAoE;gBACjD,OAAO,EAAE,MAAM;CAInC;AAED;;;;;;;GAOG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,sEAAsE;gBACnD,OAAO,EAAE,MAAM;CAInC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Distinct failure classes of the durable History authority. Diagnostics must
|
|
3
3
|
* distinguish stale ownership, conflicting execution identity, invalid
|
|
4
|
-
* lifecycle transitions, unsupported storage and
|
|
4
|
+
* lifecycle transitions, unsupported storage, journal compare-and-set
|
|
5
|
+
* conflicts, undeclared journal record versions and integrity failures rather
|
|
5
6
|
* than report a generic miss (execution.md, required validation fixtures).
|
|
6
7
|
* None of these classes extends `TypeError`, so a reader never mistakes a
|
|
7
8
|
* storage failure for Value's rejection of a selection's shape.
|
|
@@ -84,4 +85,34 @@ export class HistoryClockError extends Error {
|
|
|
84
85
|
this.name = 'HistoryClockError';
|
|
85
86
|
}
|
|
86
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* A journal commit's compare-and-set expectation does not hold: the presented
|
|
90
|
+
* expected revision is not the key's current revision (a new-key expectation
|
|
91
|
+
* met an existing key, or an update met a later or absent revision). The
|
|
92
|
+
* whole commit was rolled back unchanged; the caller must re-read before
|
|
93
|
+
* deciding again.
|
|
94
|
+
* @alpha
|
|
95
|
+
*/
|
|
96
|
+
export class JournalConflictError extends Error {
|
|
97
|
+
/** Create a compare-and-set rejection with a diagnostic message. */
|
|
98
|
+
constructor(message) {
|
|
99
|
+
super(message);
|
|
100
|
+
this.name = 'JournalConflictError';
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A journal record's format or format version is not one the journal port
|
|
105
|
+
* declared. On a write the record is refused; on a read or list the stored
|
|
106
|
+
* record is refused rather than returned; a commit over a current revision of
|
|
107
|
+
* an undeclared version is refused rather than overwriting it. History never
|
|
108
|
+
* interprets or converts the content of another format version.
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
export class JournalVersionError extends Error {
|
|
112
|
+
/** Create an undeclared-version refusal with a diagnostic message. */
|
|
113
|
+
constructor(message) {
|
|
114
|
+
super(message);
|
|
115
|
+
this.name = 'JournalVersionError';
|
|
116
|
+
}
|
|
117
|
+
}
|
|
87
118
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/durable/errors.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/durable/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;;GAOG;AACH,MAAM,OAAO,qBAAsB,SAAQ,KAA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C,CAAC;CACF;AAED;;;;;;;GAOG;AACH,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAC5C,sEAAsE;IACtE,YAAmB,OAAe;QAChC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/durable/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/durable/index.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAQV,eAAe,EACf,sBAAsB,EAiBvB,MAAM,gBAAgB,CAAC;AAyDxB;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAguBnF"}
|