Expand description
Reads (spec/surface/README.md §2): ref resolution, whole-document reads,
block hydration at a resolution, the outline wire format, and the two
path-ordered list surfaces. Port of packages/core/src/core/read/*.
Result keys follow the reference’s spelling (id, path, raw, the row
rule of §1.2; renderedHashMatch, …) — the fixtures are generated from it.
Structs§
- Block
Node - A live block with its children (the containment forest).
- DocInfo
- A live document’s identity (
findDoc). - DocList
Row - One row of
docs_list(pathin the storage form; the wire roots it).
Enums§
- Resolution
- The resolution ladder.
- Resolved
Ref resolve_ref’s answer.
Constants§
- LIST_
DEFAULT_ LIMIT docs_list/docs_treedefault page size.- MANY_
CAP - Max refs honored per
docs_read_many/blocks_read_manycall.
Functions§
- block_
raw - A block’s raw bytes by hex hash (
""when unknown). - blocks_
read - §2
blocks_read: one block subtree at a resolution;Nonewhen the block is not live indoc_id. - blocks_
read_ many - §2
blocks_read_many:{ nodes, truncated, unresolved }. - docs_
list - §2
docs_list:{ items, truncated, cursor }. - docs_
outline - §2
docs_outline:{ text, truncated }. - docs_
read - §2
docs_read:{ id, path, rev, properties, raw }(+ids,hashes,parentswith ids) — the document’s row attributes under the surface’s names (§1.2, 3.0);Nonefor a missing doc. - docs_
read_ at - §2
docs_read { at }/docs_read_at(4.7): the document AS OF a revision —spec/store§6.2 reconstruct, the path as of the revision in the reference form. Noproperties: the properties table is current-state only (spec/properties), and recomputing the bag from the reconstructed bytes is not a one-call affair of the format layer (the inline fields come out of the ingest’s node projection) — so the time-travel read carries the bytes and nothing it would have to guess at (through 4.6docs_read_atreturned the CURRENT bag flaggedpropertiesAreCurrent: true).Nonewhenrevis not a revision of the (live) document. - docs_
read_ many - §2
docs_read_many:{ items, errors, truncated }. - docs_
tree - §2
docs_tree:{ prefix, depth, total, entries, truncated, cursor }. The tree is built over the storage form and rooted on the way out, so the prefix (/for the root), the entries and the cursor all speak the reference form (§1 “Paths”). - find_
doc_ by_ id - A live doc by id.
- find_
doc_ by_ path - A live doc by repo + path, in either form (
spec/surface§1 “Paths”). - find_
doc_ by_ ref - The id-or-path dispatch every doc-ref surface routes through: a
d_id is looked up by id only (never falling through to a path). - first_
words - The first
nwhitespace-separated words,…when cut. - load_
doc_ blocks - A document’s live blocks as an ordered forest (
ORDER BY parent_block, order_key; a row whose parent is not live is a root). - normalize_
tree_ prefix - Normalize a tree prefix to its storage form: no leading
/, and either empty or ending in/(either path form is accepted). - resolve_
ref - §2
resolve_ref: ann_node id → its live block, else its doc; ab_id → its live block; ad_id → the live doc; anything else → the live doc at that path;Nonewhen nothing matches. - token_
cost ceil(JSON length / 4): the token estimate every budget uses.