Skip to main content

Module docs

Module docs 

Source
Expand description

Docs in Cloud (C0 2.2): the engine adapter of lean_ctx_doc.

The crate holds the model (pages, sections, notes, anchors, the lowest-seq fold and the doc state); this module feeds it the replica’s verified events and turns its EventSpecs into signed class-W events, queued in the replica like every other write, so offline is fine and the next push sends them. Every string of every body passes the outbound screen first; one blocked text refuses the whole batch and nothing is queued.

Structs§

GitAt
Anchor digests at one commit: the tracked files of its tree, each file’s bytes read once through a single git cat-file --batch. The migrator pins an emspace page at the commit emspace pinned it at, so the first re-check against HEAD reproduces emspace’s stale set.
Vault
The linked vault of a checkout, opened for reading and writing docs.

Functions§

digest_now
The digest anchor has in the checkout now (C0 2.2 doc_anchor_digest); None when a file: or dir: target is gone.
head_commit
The commit the checkout is at, for an anchor’s commit.
log_events
The replica’s verified events in the crate’s shape, then this engine’s queued events in HLC order after them: a write right after another one (an edit, then a confirm) bases its CAS on the queued head, which Cloud has by then, and reads show the engine’s own writes at once.
new_id
A fresh id for the crate’s writers: n_… for nodes, e_… for edges.
page_anchors
The anchors of a page as stored (anchors field), parsed back.
pin
Parses file:…, dir:… or glob:… (role derived, mode content; shape: is a dir: in shape mode) and pins it at the checkout’s digest.
push_queued
Sends the queued events of root’s vault (one push). The tool hands this to crate::background, so a doc write never waits for Cloud.
queue_specs
Screens, chains, signs and queues specs in order. Returns the queued event ids; nothing is queued when one body is screened out.
queue_specs_at
queue_specs continuing the HLC clock of events queued before it in the same run (the sync’s re-checks); returns the clock after the last.
recheck
The recheck of every page’s derived anchors against the checkout: one anchor_state + drift pair (CAS-exempt) per page whose verdict changed. Matching bytes never write fresh: only a confirm does.
require_docs_protocol
Doc writes need a C0 2.2 Cloud (doc node types, base_event CAS): a 2.0 or 2.1 Cloud refuses them. The engine records the answered minor at start (relay_v2::protocol_minor).
screen_all
Screens every body of specs; the first blocked text refuses all.
space
The doc pages of the place as the replica holds them.
tracked_files
The files git tracks in the checkout at root (repo-relative, /), the file set every C0 2.2 anchor digest is computed over; None outside git.
with_vault
Opens the vault linked to the checkout at root and runs f on it. Local only: nothing here contacts Cloud.