Sync / API
foldkit-durable
foldkit-durable — a durable, ordered operation log with snapshots.
Storage and ordering only; application semantics live in the reduce the
caller supplies. Append is atomic and idempotent by operation identity,
committed order is stable, and compaction never changes the logical state a
replay would produce.
Namespaces
Codec | Encodes a value to JSON-compatible data and decodes it back strictly. |
Journal | A durable journal; see journal.ts. Declared here beside the Journal namespace, since a type and a const of one name must come from one module. |
journalMetrics | Counters an application can scrape; the default registry already collects them. |
Functions
Values
ActorId | The trusted actor a principal commits as. |
Cursor | A read position in a document; 0 is the start. |
DocumentId | A journal's partition key: one authoritative document per key. |
makeJournal | Opens a durable, ordered operation log with a snapshot and cursor per key. |
OpId | The stable identity of one operation within its document. |
Sequence | A committed operation's position in a document; 1-based and gap-free. |
Classes
Interfaces
AuthorizationRequest | The application's policy decision for an operation, against the authoritative snapshot. |
Committed | An operation as the journal committed it, with its authoritative order and actor. |
Cursors | Named cursors over documents and the runs parked behind them, stored beside the effect ledger. Every write names the epoch it was decided in and does… |
EffectRecord | The durable record of one externally visible effect. |
JournalDefinition | One journal's service tag together with the layer that satisfies it, both built from the same type parameters, so the tag cannot be read back as a journal… |
JournalOptions | |
JournalShape | |
JournalStore | What the store under a journal guarantees of concurrent writes. It has the shape of StoreCapabilities in @doeixd/metakit/store, which this package does not… |
JudgeRequest | What a law sees: the snapshot before the operation and the one it leaves, with the operation as stamped. |
ParkedRun | A run set aside so its cursor could move past it, kept until a person resolves it. |
RecoveryIntent | One effect a committed operation requires. key must be stable across restarts. |
RecoveryOptions | |
TrackedCursor | Where a named piece of work over one document has reached, in the document's current epoch: every commit at or before cursor was handled or set aside. A… |
ValidationRequest | Structural checks that run before a commit and throw when the operation is invalid. |
Types
AppendError | |
AppendResult | The outcome of append. AlreadyCommitted means the operation is known but its payload was compacted away, so no Committed operation can be returned; a caller… |
AuthorizationDecision | What authorize answers. true allows and false refuses; the object form refuses with the rule's own reason, which reaches the caller on… |
CodecInput | What JournalOptions.operation and .snapshot accept: an Effect Schema.Codec, or the function pair for an application that does not use Schema. A schema that… |
EffectStatus | |
JournalStoreOptions | JournalOptions without the file: the store is the SqlClient the core Journal.layer is given. |
JudgeDecision | What judge answers: true when every law holds, or the first broken one, by its id, its words and the snapshot fields it names. |
ReplayResult | The outcome of replay for a reconnecting client: either the incremental operations committed after the client's cursor, or the authoritative snapshot when… |