class

TransFS::Library

Inherits Reference < Object

The claim-log core: the operations that the CLI (and later the GUI, and the mount) all go through — the model described in docs/architecture.md.

Constructors

new(root : String)
Source

Instance methods

add(filepath : String, name : String | Nil = nil, ts : Time = Time.utc) : Document

Archive a file as a new document (one create claim + one version claim, optionally a name). Returns the folded Document.

Ordering (§3 durability): write the content blob FIRST, then the claims that reference it. A crash in between leaves an orphan blob — harmless garbage in a content-addressed store, swept by GC — never a dangling ref.

Source
add_version(doc : Document, filepath : String, ts : Time = Time.utc) : Document

Archive a new version of an existing document from a file. Content-first ordering as in add; the new version's parent is the document's current head (so versions form a fork-detectable DAG, §3).

Source
blob_path(hex : String) : String

The on-disk path of a content blob (by hex hash). For readers that want to stream/seek the blob directly (e.g. the FUSE mount's zero-copy read) rather than load it whole via read.

Source
document(id : String) : Document | Nil

Look up a document by full id or a unique hex prefix (git-style). The opaque id is never meant to be typed in full by a human; a short prefix that uniquely resolves is enough. Raises on an ambiguous prefix.

Source
documents
Source
index

The materialized facet index. Lazily opened (and self-rebuilt if missing), so pure log operations don't pay for it unless a query needs it.

Source
read(doc : Document) : Bytes | Nil

Read a document's current content bytes (head version), or nil.

Source
rename(doc : Document, name : String, ts : Time = Time.utc) : Document

Set the document's blessed label (a name claim; latest wins on fold).

Source
root
Source
tag(doc : Document, add : Array(String) = [] of String, del : Array(String) = [] of String, ts : Time = Time.utc) : Document

Add and/or remove tags (a single tag claim). A no-op if both lists empty.

Source