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. |
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 | |
RecoveryIntent | One effect a committed operation requires. key must be stable across restarts. |
RecoveryOptions | |
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. |