Skip to main content

simulator/ledger

packages/simulator/src/ledger

Purpose

Typed live and completed simulator ledgers.

Public surface

CompletedLedgerArtifacts

Interface
Complete immutable artifact text retrieved from a profile-owned store.

CompletedRunLedger

Interface
Fully validated immutable ledger whose streams cannot fail.

EncodedEventOf

TypeAlias
The closed encoded union persisted for a catalog.

EventCatalog

Class
The exact immutable event universe for one definition. The private type identifier makes catalog arguments nominal: a structural object cannot claim a schema, constructor list, and tag list that disagree.

EventCatalogDefinitionError

Class
Invalid catalogs fail during definition construction, before a run starts.

EventCatalogDefinitionFailure

TypeAlias
Represents event catalog definition failure conditions.

EventClass

TypeAlias
A schema-backed event constructor. The catalog retains both the schema and constructor faces so persisted values decode back into their exact class.

EventClassOf

TypeAlias
The closed constructor union declared by a catalog.

EventOf

TypeAlias
The closed instance union declared by a catalog.

JsonObject

TypeAlias
Represents json object values.

jsonValue

Variable
Validates and decodes json value values.

JsonValue

TypeAlias
Represents json value values.

LEDGER_FORMAT_VERSION

Variable
Provides the ledger format version runtime value.

LedgerAllocation

Interface
One storage-owned live allocation.

LedgerAllocationInput

Interface
Describes ledger allocation input.

LedgerArtifact

TypeAlias
Represents ledger artifact values.

ledgerArtifactFiles

Variable
The durable file name each ledger artifact is published under.

LedgerCatalogMismatch

Class
Implements ledger catalog mismatch.

LedgerCompletion

Class
The immutable publication marker for a completed ledger.

LedgerDefinitionMismatch

Class
Implements ledger definition mismatch.

ledgerDigest

Variable
Validates and decodes ledger digest values.

LedgerDigest

TypeAlias
Represents ledger digest values.

LedgerFailure

TypeAlias
Represents ledger failure conditions.

LedgerInvalid

Class
Implements ledger invalid.

LedgerInvalidReason

TypeAlias
Represents ledger invalid reason values.

LedgerManifest

Class
Definition and provenance bound to every completed ledger.

LedgerOpenError

TypeAlias
Represents ledger open error conditions.

LedgerRecord

Interface
One exact event envelope in a run ledger.

ledgerRef

Variable
Storage-owned identity that never exposes a filesystem path.

LedgerRef

TypeAlias
Represents ledger ref values.

LedgerSerializationError

Class
Reports ledger serialization failures.

LedgerStorage

Class
Outer layers provide the concrete ledger persistence implementation.

LedgerStorageError

Class
Stable failure at the ledger storage boundary.

LedgerStorageService

Interface
Describes ledger storage service.

makeLedgerRecordSchema

Function
The envelope schema shared by live commits and completed-ledger inspection. Returns: The created ledger record schema.

openLedger

Function
Validate a completed ledger before exposing its reusable typed record stream. The exact catalog is required; no unknown-event branch escapes. Returns: The open ledger result.

openLedgerArtifacts

Function
Validate already-retrieved durable artifacts without exposing their storage backend through the customer program. Returns: A validated completed ledger with infallible record streams.

readLedgerManifest

Variable
Inspect definition and provenance without granting access to unverified records.

RunLedger

Interface
Readable, definition-bound live ledger capability.

VersionedEventTag

TypeAlias
Stable persisted identity for an event class.

Files

  • append.ts
  • filesystem.ts
  • index.ts
  • read.ts
  • schema.ts
  • storage.ts