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
firston, 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.
- 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 islink_cli::CacheLinks, the JavaScript oneCacheLinksof@link-foundation/link-cli-client.
- CacheOptions
What a CacheLinksDecorator<TLinkAddress> enforces. Each is optional, and the default is neither.
- 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.
- 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 aRemapLinksreads 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)thatclink --tokensuses.
- 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).
- 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.
- LogRetentionPolicy
Retention policy for the transitions log:
- LogRetentionPolicy.Infinite keeps every transition forever.
- LogRetentionPolicy.Chunked processes the oldest
ChunkSizerecords once the live log reaches that size, archiving committed changes inArchiveDirectoryand 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.
- OffsetAddressMap<TLinkAddress>
Every address moved by the same offset: the network below reads at
offset + 1and 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
createPolicyof@link-foundation/ui-links; the Rust counterpart islink_cli::PermissionPolicy.
- PermissionsDecorator<TLinkAddress>
The store as one subject sees it (issue #149), the C# port of
withPermissionsof@link-foundation/ui-links; the Rust counterpart islink_cli::PermissionsDecorator.
- PersistentTransformationDecorator.PersistentTransformationQuery
The two halves a trigger query parses into.
- 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
RemapLinksof@link-foundation/link-cli-client, whose addresses above may be strings such as UUIDs; the Rust one islink_cli::RemapLinks.
- StoreFileLock
The operating system lock
--lock flocktakes on<db>.lock(issue #194), the same lock the Rust and JavaScriptclinktake, so that every implementation excludes the others:flock(2)on Unix andLockFileExover the whole file (offset 0, lengthu32::MAXtwice) on Windows. The system releases it when the holder exits.
- StoreLock
Store locking for
clinkinvocations (issue #194).
- StoreLockOptions
The parsed
--lock,--no-lockand--lock-timeoutoptions.
- StoreLockOwner
Who holds a store lock (issue #194). The record is a few
key=valuelines, the same in the C#, Rust and JavaScriptclink:pid=4242 host=build-7 pid_namespace=pid:[4026531836] start_time=1234567 acquired_at_ms=1764028800000 token=4242.5f0c2a9d1e3b4c6a program=clink (csharp) 5.2.1pid_namespaceandstart_timeare 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-timeoutpassed.
- StorePidLock
--lock pid(issue #194): a lock directory,<db>.lock.d, holding anownerrecord.
- TransactionsDecorator
The
uint-addressed transactions decorator used by theclinkCLI.
- TransactionsDecorator<TLinkAddress>
Bounds the durable journal by the retention policy (issue #195): rust/src/transactions/compaction.rs.
- TransitionsJournal
The append-only journal file
clinkkeeps 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 wrapperw = (Pair f), the pairp = (w t)and the outer(i: T p);- when another triplet took the outer
(T p), a duplicate paird = (p i)and the outer(i: T d); - an empty
fortis written asNothing.
The Rust counterpart is
link_cli::TripletsOverDoublets;docs/TRIPLETS.mdcompares the encoding with the alternatives.- a node
- 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::PermissionsDecoratorover aTripletsstore.
- 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 islink_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
typeSystemof@link-foundation/ui-links; the Rust counterpart islink_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.
- 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
UnionLinksof@link-foundation/link-cli-client, the Rust onelink_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
- PermissionMarkers<TLinkAddress>
The four points of the data permission rules are made of: the markers
AllowRead,AllowWriteandAllowReferenceof rules andAnything, 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 noAfter, 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), andNothing, which stands for the empty part inside wrappers and pairs.
- TripletQuery<TLinkAddress>
A restriction of EachTriplet(TripletQuery<TLinkAddress>):
nullmatches any value, the null link an emptyFromorTo.
- Triplet<TLinkAddress>
A triplet
(index: type from to);FromandToare the null link when empty.
- TypeMarkers<TLinkAddress>
The two points a type hierarchy needs: the root type
(Type: Type Type)and theExtendsmarker 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,
Anyand 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.
EnsureCreatedof 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.
- IPermissionPolicy<TLinkAddress>
Who may read, write and refer to what.
- 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
Tripletbecause a triplet store is still a doublet store:Create,UpdateandDeletekeep 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 typeS; - a type points at itself: the root
(Type: Type Type)is a point and a sub-type ofTis(S: T S), a value ofTwhose target is itself; - more parents (multiple inheritance) are pairs
(p: S T2)marked by(m: Extends p).
So
Type -> SubType -> … -> Valueis a chain of sources of any depth.- the type of a link is its source:
- 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
Commitreturns. 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.
- RowUndoPolicy
Undo source for an ordinary, immediately mutating storage adapter.
- StoreLockKind
The
--lockmechanism.
- 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.