Table of Contents

Namespace Foundation.Data.Doublets.Cli

Classes

AddressTable<TLinkAddress>

A table of the addresses above and below: an address below that has none above yet gets the next free one from first on, so the addresses of another system (a server, a service) read as addresses of our own range. Pairs and Add(TLinkAddress, TLinkAddress) keep the table across runs, in links or anywhere else.

AdvancedMixedQueryProcessor

The original uint query API, sharing the selected-address implementation.

AdvancedMixedQueryProcessor.Options
AdvancedMixedQueryProcessor.Pattern
AdvancedMixedQueryProcessor<T>
AdvancedMixedQueryProcessor<T>.Options
AdvancedMixedQueryProcessor<T>.Pattern
BasicQueryProcessor
BranchInfo

Metadata describing one branch in the version-control DAG.

CacheLinksDecorator<TLinkAddress>

A links store used as a cache: links can expire, and the store can be kept to a number of links by evicting the ones used least recently. It has the API of any other store, so only a store that selects it pays for it. See docs/ENGINE-CACHE.md. The Rust twin is link_cli::CacheLinks, the JavaScript one CacheLinks of @link-foundation/link-cli-client.

CacheOptions

What a CacheLinksDecorator<TLinkAddress> enforces. Each is optional, and the default is neither.

ChangesSimplifier
DoubletRoleExtensions
EnumerableExtensions
FileTransitionLog

Append-only, line-oriented transitions log backed by a single file: rust/src/transactions/log.rs FileTransitionLog.

ForbiddenException

A write a subject may not make (issue #149); the message is Forbidden: what.

InvalidLinkFormatException

Exception thrown when a link has an invalid format or structure.

InvalidQueryPatternException

Exception thrown when a query pattern is invalid or cannot be processed.

JournalRecord<TLinkAddress>

Complete legacy journal payload. Row-only values retain the v1 codec.

LinksExtensions
LinksExternalIds

The ids other systems give our links, stored as links (issue #149): a UUID of a service, an ObjectId of a document database, a URL, bound to a link of ours and back, so the code that talks to the other system never keeps a table of its own. The Rust counterpart is link_cli::LinksExternalIds; in JavaScript a RemapLinks reads the links under such ids directly.

LinksFacadeDisposer

Releases every IDisposable links facade (or transitions journal) reachable from a decorator chain.

LinksFileLock

Advisory lock over a links database, for consumers that open the same database file from more than one process.

LinksTokenTable

The tokens a links server knows, stored as links (issue #149): the authenticator of (auth: token) that clink --tokens uses.

LinksUndoLog<TLinkAddress>

The writes made to a store, kept to undo them: every change a write reports, and the names the links had before (issue #149).

LinksUniquenessAndUsagesRepointingExtensions
LinksUniquenessAndUsagesRepointingResolver<TLinkAddress>

Keeps every doublet unique: an update that would duplicate an existing link merges into it instead, re-pointing every link that used the merged-away address at the surviving one.

LinoDatabaseInput
LinoDatabaseOutput
LogRetentionPolicy

Retention policy for the transitions log:

  • LogRetentionPolicy.Infinite keeps every transition forever.
  • LogRetentionPolicy.Chunked processes the oldest ChunkSize records once the live log reaches that size, archiving committed changes in ArchiveDirectory and discarding aborted records.
  • LogRetentionPolicy.Sized drops the oldest transitions once the live log exceeds MaxTransitions, after verifying each is applied or rolled back. Pending writes remain in the live log.
LogRetentionPolicy.Chunked
LogRetentionPolicy.Infinite
LogRetentionPolicy.Sized
MixedQueryProcessor
MixedQueryProcessor.Options
NamedLinksDecorator<TLinkAddress>
NamedLinks<TLinkAddress>
NamedTypesDecorator<TLinkAddress>
OffsetAddressMap<TLinkAddress>

Every address moved by the same offset: the network below reads at offset + 1 and up, so networks moved by different offsets share no address and a UnionLinksDecorator<TLinkAddress> of them shadows nothing.

PermissionPolicy<TLinkAddress>

Permissions stored as links (issue #149), the C# port of createPolicy of @link-foundation/ui-links; the Rust counterpart is link_cli::PermissionPolicy.

PermissionsDecorator<TLinkAddress>

The store as one subject sees it (issue #149), the C# port of withPermissions of @link-foundation/ui-links; the Rust counterpart is link_cli::PermissionsDecorator.

PersistentTransformation
PersistentTransformationDecorator
PersistentTransformationDecorator.PersistentTransformationQuery

The two halves a trigger query parses into.

PinnedTypesDecorator<TLinkAddress>
PinnedTypes<TLinkAddress>
QueryConstants

Constants used in query processing for pattern matching and link notation.

QueryLimits

Finite admission profile used by checked causal queries. Ordinary stores opt in.

RemapLinksDecorator<TLinkAddress>

A links network under other addresses (issue #149): every address that goes down is mapped to the network's own, and every address that comes up is mapped back, so the code above never thinks about remapping. The JavaScript counterpart is RemapLinks of @link-foundation/link-cli-client, whose addresses above may be strings such as UUIDs; the Rust one is link_cli::RemapLinks.

SimpleLinksDecorator<TLinkAddress>
StoreFileLock

The operating system lock --lock flock takes on <db>.lock (issue #194), the same lock the Rust and JavaScript clink take, so that every implementation excludes the others: flock(2) on Unix and LockFileEx over the whole file (offset 0, length u32::MAX twice) on Windows. The system releases it when the holder exits.

StoreLock

Store locking for clink invocations (issue #194).

StoreLockOptions

The parsed --lock, --no-lock and --lock-timeout options.

StoreLockOwner

Who holds a store lock (issue #194). The record is a few key=value lines, the same in the C#, Rust and JavaScript clink:

pid=4242
host=build-7
pid_namespace=pid:[4026531836]
start_time=1234567
acquired_at_ms=1764028800000
token=4242.5f0c2a9d1e3b4c6a
program=clink (csharp) 5.2.1

pid_namespace and start_time are only known on Linux; elsewhere they are empty and the owner is judged by host and process id.

StoreLockedException

A store stayed locked until --lock-timeout passed.

StorePidLock

--lock pid (issue #194): a lock directory, <db>.lock.d, holding an owner record.

TransactionsDecorator

The uint-addressed transactions decorator used by the clink CLI.

TransactionsDecorator<TLinkAddress>

Bounds the durable journal by the retention policy (issue #195): rust/src/transactions/compaction.rs.

TransitionsJournal

The append-only journal file clink keeps next to its database (issue #195), and the one-time import of the older links-backed journal: rust/src/transactions/journal_file.rs.

TripletsLino

Triplets in Links Notation: one (index: type from to) per line (issue #151).

TripletsOverDoublets<TLinkAddress>

A decorator that stores triplets (index: type from to) in the doublets of the links it wraps (issue #151). The encoding keeps the convention of the type hierarchy of issue #148, the type of a link is its source:

  • a node (i: T 0 0) is the doublet (i: T i);
  • (i: T f t) is the wrapper w = (Pair f), the pair p = (w t) and the outer (i: T p);
  • when another triplet took the outer (T p), a duplicate pair d = (p i) and the outer (i: T d);
  • an empty f or t is written as Nothing.

The Rust counterpart is link_cli::TripletsOverDoublets; docs/TRIPLETS.md compares the encoding with the alternatives.

TripletsPermissionsDecorator<TLinkAddress>

Permissions on triplets (issues #149 and #152): the same rules as on doublets, judged on the triplet as a whole. The Rust counterpart is link_cli::PermissionsDecorator over a Triplets store.

TripletsQueryProcessor

Substitution queries over triplets: ((restriction) (substitution)), where every pattern has three parts, (index: type from to) or (type from to) (issue #151). The Rust counterpart is link_cli::process_triplets_query.

TypesDecorator<TLinkAddress>

A decorator that keeps a type hierarchy with recursive sub-typing and multiple inheritance in the links themselves. It is the C# port of typeSystem of @link-foundation/ui-links; the Rust counterpart is link_cli::TypesDecorator.

UndoableLinksDecorator<TLinkAddress>

A store that keeps every write in a LinksUndoLog<TLinkAddress> while Recording, so a request that fails can be undone whole (issue #149). The links server puts it under every session.

UnexpectedLinkStructureException

Exception thrown when a link structure doesn't match expected patterns.

UnicodeStringStorage<TLinkAddress>
UnionLinksDecorator<TLinkAddress>

Many links networks seen as one (issue #149): the joining decorator of a client's links with a server's, of a cache with its source, of the networks of several services. The JavaScript counterpart is UnionLinks of @link-foundation/link-cli-client, the Rust one link_cli::UnionLinks.

VersionControlDecorator

Decorator that sits above TransactionsDecorator and adds time travel (Checkout(long)), branching (Branch(string, long?), SwitchBranch(string)), and tagging (Tag(string, long?)) over the transitions log. Optional — when not instantiated the underlying transactions decorator behaves identically.

Structs

NameChange<TLinkAddress>
PermissionMarkers<TLinkAddress>

The four points of the data permission rules are made of: the markers AllowRead, AllowWrite and AllowReference of rules and Anything, which matches every subject or every link.

StorageRevision

Cheap fingerprint of a database file, used to answer "has anyone else written since I last looked?" without reparsing the database.

StoreLockLiveness

The liveness of a lock owner and, unless it runs, how that is known.

Transition<TLinkAddress>

A reversible write captured by the transactions layer. Holds both Before and After link states so the operation can be undone (replay After → Before) or replayed (Before → After).

TripletChange<TLinkAddress>

One change a query made: a creation has no Before, a deletion no After, and a read reports the same triplet on both sides.

TripletMarkers<TLinkAddress>

The two marker points of the encoding: Pair, the source of every wrapper (Pair f), and Nothing, which stands for the empty part inside wrappers and pairs.

TripletQuery<TLinkAddress>

A restriction of EachTriplet(TripletQuery<TLinkAddress>): null matches any value, the null link an empty From or To.

Triplet<TLinkAddress>

A triplet (index: type from to); From and To are the null link when empty.

TypeMarkers<TLinkAddress>

The two points a type hierarchy needs: the root type (Type: Type Type) and the Extends marker of extra parents. Extends is the null link when the hierarchy has no multiple inheritance.

Interfaces

IAddressMap<TLinkAddress>

How the addresses of a network below a RemapLinksDecorator<TLinkAddress> read above it (issue #149). Only addresses of links are mapped: the null link, Any and the other constants of the store read the same on both sides.

IComposedLinks<TLinkAddress>

A network made of other networks (issue #149), such as a UnionLinksDecorator<TLinkAddress> or a RemapLinksDecorator<TLinkAddress>: a link at a given address is created in the network the address is of, not by creating links in the primary one until the address comes up. EnsureCreated of LinksExtensions asks it, and so does every undo of a delete, such as the one of a write a permission layer refuses.

IDurableLinks

An optional persistence boundary for a links decorator.

INamedTypesLinks<TLinkAddress>
INamedTypes<TLinkAddress>
IPermissionPolicy<TLinkAddress>

Who may read, write and refer to what.

IPinnedTypes<TLinkAddress>
IReferencedLinks<TLinkAddress>

A store that answers for a reference apart from reading (issue #161): under a PermissionsDecorator<TLinkAddress> a subject may refer to a link it may not read, and a link it may not refer to is as missing as a deleted one.

ITransaction<TLinkAddress>

A live transaction handle. Disposal without commit rolls back automatically (R10).

ITransactionsLinks<TLinkAddress>

A links store with transactional semantics layered on top of the underlying INamedTypesLinks<TLinkAddress>.

ITransitionLogStore

Append-only store of serialized transitions and recovery markers: the journal of TransactionsDecorator<TLinkAddress>.

ITriplets<TLinkAddress>

The reads and writes of triplets stored in doublets (issue #151). The names end in Triplet because a triplet store is still a doublet store: Create, Update and Delete keep working on the doublets underneath.

ITypes<TLinkAddress>

A type hierarchy kept in the links themselves (issue #148):

  • the type of a link is its source: (v: S x) is a value of type S;
  • a type points at itself: the root (Type: Type Type) is a point and a sub-type of T is (S: T S), a value of T whose target is itself;
  • more parents (multiple inheritance) are pairs (p: S T2) marked by (m: Extends p).

So Type -> SubType -> … -> Value is a chain of sources of any depth.

IVersionControlLinks

Public surface of a links store wrapped with the version-control decorator: same INamedTypesLinks<TLinkAddress> surface plus branch/tag/checkout operations.

Enums

CommitMode

Sync flushes data-store side-effects before Commit returns. Async durably persists the transitions then applies the data-store side-effects on a background thread (already-applied side-effects are the common case for in-process inner stores).

DoubletRole

What a doublet is in the encoding.

LockMode

Requested sharing mode for a LinksFileLock.

PermissionAccess

What a rule allows.

PersistentTransformationKind
RowUndoPolicy

Undo source for an ordinary, immediately mutating storage adapter.

StoreLockKind

The --lock mechanism.

StoreLockLivenessState

Whether the owner of a store lock still runs, as far as this host can tell.

TransitionKind

The kind of write operation recorded by a transition.