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 againstHEADreproduces emspace’s stale set. - Vault
- The linked vault of a checkout, opened for reading and writing docs.
Functions§
- digest_
now - The digest
anchorhas in the checkout now (C0 2.2doc_anchor_digest);Nonewhen afile:ordir: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 (
anchorsfield), parsed back. - pin
- Parses
file:…,dir:…orglob:…(rolederived, modecontent;shape:is adir: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 tocrate::background, so a doc write never waits for Cloud. - queue_
specs - Screens, chains, signs and queues
specsin order. Returns the queued event ids; nothing is queued when one body is screened out. - queue_
specs_ at queue_specscontinuing the HLCclockof 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+driftpair (CAS-exempt) per page whose verdict changed. Matching bytes never writefresh: only a confirm does. - require_
docs_ protocol - Doc writes need a C0 2.2 Cloud (doc node types,
base_eventCAS): 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;Noneoutside git. - with_
vault - Opens the vault linked to the checkout at
rootand runsfon it. Local only: nothing here contacts Cloud.