class

TransFS::Document

Inherits Reference < Object

The folded state of a document — the result of replaying its claim log in order. This is derived, never stored on disk as truth (the log is truth; this is what the future SQLite index materializes). See §1, §6.

Constructors

fold(id : String, claims : Array(Claim)) : Document

Fold a log into a Document. Claims are applied in timestamp order so that a merged log (interleaved from two machines) folds deterministically; within equal timestamps, file order is the tiebreak. The sort key is {ts, original_index} because Crystal's sort_by is not stable on its own — and a batch (create+version+name) shares one timestamp, so without the index tiebreak the fold order would be undefined.

Source
load(root : String, id : String) : Document
Source
new(id : String)
Source

Class methods

all(root : String) : Array(Document)

Every document in the store, folded.

Source

Instance methods

created_at
Source
head

The current content = the newest version's hash (nil if no version yet: the document is a bare shell or a container). §5.

Source
name
Source
tags
Source
version_count
Source
version_hashes

Just the content hashes, oldest-first.

Source
versions
Source