Expand description
Effect side of persistence: Ledger on disk, CAS, in-memory derived views, git checkpoints, queues. Implements kernel ports; holds no policy.
Structs§
- Attribution
- Attribution
Report - Block
Origin - The run and the building a block was put for.
- Bundle
- Export and restore. A namespace rather than a value: neither direction holds state between calls.
- Cas
- Chain
Halt - The verdict a writer shares with the proof of its history: once set it stays, and it carries the reason every refused write repeats.
- Chain
Snapshot - What a fold held after the line at
seq, and the chain hash that names that line. - Checkpoint
- Digest
Cache - Drift
- How far a branch has run from the upstream it tracks.
- Event
Queue - File
Patch - One file’s patch, with what could not be shown named rather than silently dropped.
- File
Work - What putting a tree in place cost the filesystem, counted by the code
that did the work (
crates/storage/spec/Worktree.lean§8-31). - HotView
- Jsonl
Ledger - The durable Ledger. See the module doc for the contract.
- Landing
- What one merge writes down: four values that arrive together and are
meaningless apart - a subject with nobody’s provenance under it says
who merged nothing.
reviewed_by_personadds oneReviewed-by: Name <email>trailer, and only when this repository’s git config also carriesuser.nameanduser.email: the city does not invent a person’s name. - Ledger
Index - seq → (segment file name, byte offset of the line start).
- Line
Check - Chain state between two lines: what the next line must continue.
- Line
Reader - Reads single lines by seq, holding one segment open across reads.
- Located
- Where a line sits in the history and whose it is.
- Manifest
- What a bundle claims to contain. Checked on restore, so a truncated or half-copied bundle is refused rather than restored quietly.
- Model
Choice - The model a run was given, and the thinking budget it was asked for.
- Open
Report - What open found and repaired, and what its tail recovery read and
checked (
crates/storage/spec/Jsonl.lean§8-34). - Patch
Line - One line of patch text, as a reader may see it.
- Planned
Merge - A merge that has been decided and not yet made.
- Proof
Count - What one proof read and computed: counts rather than time, so a test can hold them at two sizes of history.
- Proof
Records - Where a city’s records live, and whether this holder may write them.
- Proven
- A proof’s verdict, what it cost, and the first record it could not write, which changes no verdict.
- Provenance
- Who made a commit, and on whose behalf.
- Queue
Item - Renewals
- The keep-warm renewals the ledger holds: what the priced ones were
billed, an amount
totaland every cut already hold, so a cost view draws it as a line inside the total and never adds it again (storage D36); and how many showed what about the cache each was sent to keep (RenewalOutcome), which is how a cost view says how many arrived too late (storage D35). - Resident
- Entries in the order they were placed, each owned by one run and named by its address on disk.
- RunHot
- RunWaiting
- What a run waits for: the room it spoke to and the instant on the city’s clock at which it stops waiting.
- Sessions
- The slices over one city’s Ledger.
- Tail
Line - One line of the ledger, newest first: its bytes and what it is.
- Tail
Lines - The ledger’s lines from the newest back. The walk ends after the oldest line, or after the first failure it yields.
- Tail
Truncation - Unpriced
- The model calls that came back with no authoritative amount. They
add nothing to
total, so without this count a city whose provider never prices a call reads the same as a city that never ran one; the tokens are the one measure of their use the ledger does hold. - Withheld
- One line that was not echoed, and why.
- Working
Status - Where a repository stands right now.
- Worktree
Lease - A live tree: what it is called, where it is, and what it costs.
- Worktree
Name - A node’s name for its tree. A newtype because this string becomes a directory name and a git reference: the two ways it can be malformed are checked once, here.
- Worktrees
- The city’s trees.
- Write
Target - A write target the city has cleared: no alias at the name or at any directory above it, so a write here lands exactly where the name says.
Enums§
- Alias
Kind - The aliases one name can be. On Windows a junction and a symbolic
link are both reparse points and
file_type().is_symlink()answers true for either, which is why they share a variant: refusing the family is one rule, not one rule per reparse tag. The third member of the family - the hard link - is a regular file whose link count is above one (crates/storage/spec/Alias.lean§8-25,crates/storage/Spec.lean§3). - Base
Progress - How far a base checkpoint has got, reported as each step lands.
- Chain
Audit - What walking the whole chain found.
- Checked
Line - A line that passed: a typed record, or an explicitly ignorable line from a newer vocabulary that still counts in the chain.
- Head
- The far end of the comparison.
- Line
Fault - Why a line did not pass, in the order the check asks.
- Queue
Lane - Which lane a queue serves. The lanes differ in their accounting names and nothing else; the day they differ in behaviour is the day they become separate modules, and that exit condition is stated here rather than discovered later.
- Refreshed
- What one
LedgerIndex::refreshdid, and what it lifted off the disk doing it. - RunPhase
- A Run’s phase as the hot view sees it. Freezing is terminal here: the ledger may keep appending to a frozen Run’s history, but the phase never travels backwards.
- Snapshot
Fit - Whether the line a positioned read found at the snapshot’s seq is the line the snapshot was cut at.
- Snapshot
Start - Where a start folds from: the state after a snapshot and the lines past it, or genesis and the reason no snapshot served.
- Storage
Error - Crate root error; crosses the crate boundary only via
StorageError::into_ax. - Stored
Snapshot - What the snapshot directory holds.
- Whole
Fold - Why a start could not resume from the snapshot.
Constants§
- MANIFEST
- The name of the file that states what a bundle holds.
- RECENT_
FROZEN - How many frozen runs the hot view holds besides every active one,
and so how many a city view carries. A bound on the size of an
answer on the wire, not a machine reading, so it is a constant
(
crates/storage/spec/Hot.lean§8-5). - RESIDENT_
TOTAL_ BYTES - The whole read-back budget: 12 MiB for the views and the side index and 12 MiB of read-back, the figure Memory.lean’s budget table proposes until a reading replaces it.
Functions§
- audit_
chain - Walk every complete line of the ledger in
dirfrom genesis, each through the one per-line check, reading no record and writing none. Read-only; holds one segment at a time. - between
- What moved between
baseandhead, one row per file, path order. - blob_at
- The blob at
addrin the tree of commitoid, orNonewhen that place in the commit is not a file (a directory, a submodule, nothing). - ledger_
segments_ at - The ledger segments in
dir, in the order they must be read. - line_
check_ version - The rule version a record is written and accepted under.
- of_file
- The patch text of one file between
baseandhead. - open_
restored - Opens the restored ledger, so the city is one a writer can continue.
- parents_
of - Each commit’s parents, in the order the commit object states them;
Nonefor an oid the repository does not hold. The repository is opened once for the whole list. - prove_
chain - Prove the ledger in
dirfrom genesis, taking a segment’s record in place of checking its prefix line by line when the record’s rule version, entry state and digest all match, and writing a record for every segment proved whenrecordsmay be written. - read_
line - Judge one line (without its newline) as a record this build reads,
without the chain: the same answer
LineCheck::advancegives about the line’s own bytes, for a reader that reached the line through an index whose fold already walked the chain. - read_
raw_ lines_ at - Every complete line of the ledger in
dir, copied out. For callers that keep the lines themselves (fork, replay, fixtures); a fold that wants only what the lines say walksLedgerIndex::foldinginstead. - read_
snapshot - Read the snapshot
dirholds. - recorded_
effort - How an effort nobody asked for is recorded: as
Effort::None. - start_
from_ snapshot - Decide where folding the ledger in
ledger_dirstarts, given the snapshot insnapshot_dirand the fold rules’fold_version. - tail_
after - Where folding goes on after
snapshot, which the caller has already read and accepted: the lines after its seq when its line still sits there, or genesis with the reason it does not. - working_
status - What stands between
baseand the disk underscope, and where the repository itself stands. - write_
snapshot - Write
snapshotintodir(created when absent), replacing the one there.
Type Aliases§
- Write
Observer - The write-path observer: what a live reader (the control surface’s event stream) installs to hear each line once it is durable.