Docs/Start

How ledgers work

The common ledger operations for local and hosted authority.

Read as Markdown ↗
On this page

Source implementation

Veylar Record provides ledger creation, record rules, contributions, retrieval and outcome checks through CLI, SDK, MCP and hosted HTTP.

Files, attachments and authorized references are available. Archive/reopen and governed record/file erasure and ledger deletion are enabled. Consistent record snapshots and resumable, permission-aware changes are enabled. Accepted-history clone and explicit synchronization are enabled. Optional policy-governed offline preparation, explicit delivery, private status and safe withdrawal are enabled. Fenced local-to-hosted authority transfer and bounded ledger archive export/import are enabled in the source implementation. Check discovery for the selected environment before acting.

Create a ledger

Choose the local connection for in-process use, or an authenticated named connection for direct hosted use. No replica or sync bundle is needed for direct hosted calls.

Create a ledger · Shell
op-sys --output json ledgers create --name exampleop-sys selection update --ledger <ledger-id>op-sys --output json records append --payload '{"message":"Hello"}'op-sys --output json records list

Govern the ledger

Publish immutable contracts, then explicitly admit them. Configuration and access updates compare the ledger revision and require every permission relevant to the requested changes. Contributors cannot redefine the rules simply because they can append.

Record types and workflows belong to the consumer. An independent participant can use any interface within its ledger rights; account administration remains separate.

Recover an uncertain write

Save an operation ID before appending. Reuse it with identical input and the same principal. An uncertain response is not a rejection: records.outcome checks acceptance without retrying or scheduling delivery. An absent outcome does not cancel an in-flight request.

Read once, then follow changes

records.list fixes a snapshot boundary and returns its matching changes_from checkpoint. Finish every page before using that checkpoint. changes.feed returns accepted records, permitted definition context and removal identities.

Process each change page before saving checkpoint; an empty page may still have caught_up=false. Snapshot tokens last 15 minutes and change checkpoints renew for seven days. Permission changes, erasure or unavailable history may require a fresh snapshot.

Snapshots, changes and recovery

Recover an append

An online append asks the authority to validate and accept the record. Offline preparation requires allow_pending, an explicit records.prepare grant and retained authorized validation context. Pending work is separate from accepted history and never sends merely because connectivity returns.

Synchronize explicitly to deliver eligible work. Status and outcome checks never submit. Withdraw can prevent only a never-dispatched contribution; an absent outcome does not cancel an in-flight request. Keep the same operation identity and intended input when retrying.

Recover an append · Shell
op-sys ledgers sync --ledger-id <ledger-id>op-sys contributions status --ledger-id <ledger-id> --context-id default --operation-id <operation-id>op-sys records outcome --ledger-id <ledger-id> --operation-id <operation-id>

Pending contributions, files and recovery

Keep an authorized copy

Clone a hosted authority or publish a local authority's already accepted history to a hosted replica. The same record IDs and original acceptance are retained; synchronization alone does not grant write authority to the destination. Use ledgers.publish for the shared-authority workflow.

Explicit synchronize handles bounded history pages, referenced files and removal reconciliation. Status is read-only. Retained reads report their source observation; select the hosted connection for live access. Disconnected copies learn new revocations when they next connect.

Keep an authorized copy · Shell
op-sys ledgers clone --connection work --ledger-id <ledger-id>op-sys --connection local records list --ledger-id <ledger-id>op-sys ledgers sync --ledger-id <ledger-id>op-sys ledgers status --ledger-id <ledger-id>

Replica workflow, HTTP exchange and recovery

Move authority to hosting

ledgers.publish composes the protected authority transfer and retains a local replica. The lower-level authority operations remain available for explicit control and recovery. Publishing with mode=copy leaves authority local.

The handoff preserves record IDs, local authorship, files and retry outcomes. It fences the source before activating the destination and retains the local copy as a replica. Interrupted transfers require resume; they never automatically reopen the source for writes.

Move authority to hosting · Shell
op-sys --connection local authority status --ledger-id <ledger-id> --transfer-id <transfer-id>op-sys --connection local authority resume --ledger-id <ledger-id> --transfer-id <transfer-id>

Authority transfer, permissions and recovery

Optional ledger capabilities

Configure state rules on a ledger when acceptance must depend on previous records. Ordinary record submissions enforce those rules; state reconstruction is internal.

Hosted collections save ledger selections for repeated retrieval. Participant groups belong to authorization and require explicit ledger grants.

Authorization and participant groupsCross-ledger retrieval

Archive and erasure

Archive stops new contributions while preserving authorized reads, access administration and accepted outcome resolution. Reopen requires the current ledger revision.

Record/file erasure and ledger deletion are separate, irreversible operations. Hosted legal holds take precedence. Erased identities remain reserved; restoring an old backup cannot overwrite known removals.

Lifecycle operations and recovery

Exact contracts and examples

The source manual covers configuration, grants, pagination, errors and complete examples. The canonical catalog and OpenAPI provide machine-readable contracts and availability.

Files and referencesHow ledgers workConnection and identity manualOperation catalogOpenAPI