Skip to main content

Module rendering

Module rendering 

Source
Expand description

Deterministic scratch-workspace rendering.

Renders a notebook change to the file tree its schema generates paths declare: artifact notes are read directly from the notebook directory (notebooks are plain git-backed folders; nb-api exposes their paths) and copied byte-for-byte, so identical notes always produce a byte-identical tree. Rendering writes only to scratch destinations — never to the repository working tree.

Structs§

RenderedDocument
One document of a rendered change tree.

Enums§

RenderError
Errors from rendering.

Functions§

aggregate_content_hash
Computes the aggregate content hash of a rendered document set: the SHA-256 hex digest over the sorted (tree_path, body hash) pairs. The aggregate identifies the exact reviewable content of a change — any body edit, addition, removal, or rename of a rendered document changes the value — so review verdicts bind it. Sorting makes the digest independent of enumeration order; a NUL separates path from hash and a newline terminates each pair so adjacent fields cannot alias across pair boundaries.
render_documents
Renders a change’s artifact notes into an ordered document list: artifacts in schema declaration order, documents within a folder artifact sorted by path. Notes the change has not authored yet (absent files) are skipped; control-plane files (meta, the work todo note) belong to no artifact and never render.
review_diff
Builds a unified diff between a change’s durable documents (those with merge targets) and the current contents of their repository targets, in git diff format suitable for external review tooling. Target provenance headers are stripped before comparing, so the diff shows document changes rather than header churn. Unchanged targets are omitted; absent targets diff from /dev/null.
write_tree
Writes a rendered document list as a file tree, replacing any previous contents of destination so stale files never survive a re-render.