API reference
The library crates are deed (package deedar-deed) and deedar.
deedar-cli and deedar-mcp are binaries. Their commands are on the
reference page, and the server’s tools are on
the how-to. The data those types store is drawn on
the concepts page.
The tables below are generated from the rustdoc HTML of:
$ cargo doc --no-deps --locked -p deedar-deed -p deedar
Documenting the whole workspace would let the deedar binary replace
the deedar library pages, because both use that output directory.
./docs/build.sh runs the command above, exports these pages, builds
the HTML, and copies target/doc to rustdoc/ beside them. Each item
links there. The Sphinx search covers the tables. The copied rustdoc
has its own search box.
Crates#
rustdoc 0.7.1.
deed#
A named product of a unit of work: a deed the next unit opens by id.
Structs
Deed (struct). The work plus its identity. The next unit opens it by
id.DeedId (struct). Accession:
deed-<kind>-<slug>.Draft (struct). Constructor input.
from_draftis the shipped assemble.Evidence (struct). Writer-issued evidence about a deed.
FormField (struct).
MailMessageId (struct). RFC 5322 msg-id, stored as
<local@domain>.Measure (struct).
ProducedBy (struct). Who made the deed.
activity_idis an optional assignment id (a claimdagWorkIdwhen that graph is the caller).Step (struct).
Enums
Body (enum). Kind-specific product. Adding a variant does not rewrite the envelope.
Error (enum).
Face (enum). How a viewer looks at a deed. Face follows media type and body.
Grant (enum). Host or path the seat allowed this sitting.
Kind (enum). Closed catalog. Each kind is a handler.
Source (enum). Prior deed, a path, or a URL.
trailwalks deed sources.
Functions
walk_trail (fn). Walk
sourcesthat name other deeds.
Types
Result (type).
deedar#
One-writer deed store. Clients speak the Cap’n schema via Client.
deedar::log#
An append-only Merkle log over the deeds a store has issued, hashed as RFC 9162 (doi:10.17487/RFC9162): leaf SHA-256(0x00 || entry), node SHA-256(0x01 || left || right). Inclusion proofs catch a dropped deed; consistency proofs catch a rewritten log. Signatures alone bind neither. Gossip lives outside this file. Two consistent logs shown to two readers both verify here.
Structs
Entry (struct). One entry: the deed’s content address and the instant it was logged.
Head (struct). What a store publishes: how many entries it has, and the root over them.
Functions
consistency_proof (fn). The consistency proof that a tree of
oldleaves is a prefix of these, RFC 9162 section 2.1.4. The nodes recompute both roots; a rewritten log cannot produce a set that yields both.Nonewhenoldis zero or wider than the tree.from_hex (fn). A 32 byte hash from the lower-case hex
hexwrites. Any other text yields nothing.hex (fn). Hex, lower case, fixed width.
inclusion_proof (fn). The audit path for the leaf at
index, RFC 9162 section 2.1.3: sibling subtree roots, innermost first.leaf_hash (fn). Leaf hash,
SHA-256(0x00 || entry).node_hash (fn). Interior hash,
SHA-256(0x01 || left || right).root (fn). The Merkle root over
leaves, RFC 9162 section 2.1: the tree splits at the largest power of two below the width, which is the shape the proofs below are sound over.verify_consistency (fn). Whether the tree of
oldleaves withold_rootis a prefix of the tree ofnewleaves withnew_root; both roots are recomputed fromnodes.verify_inclusion (fn). Whether
leafsits atindexof a tree ofsizeleaves with that root.
deedar::receipt#
Checking a deed somebody else handed over.
Structs
Bridge (struct). One head against an earlier one from the same log: the consistency proof that catches a log rewritten between handovers.
Handover (struct). What checking a whole handover established.
Receipt (struct). One deed’s place in a log, as an export writes it beside the bytes.
SignedHead (struct). A head with a signature over it: RFC 9162’s signed tree head. Unsigned, a head is two numbers that arrived in the same bag as the deeds they vouch for.
Functions
check_handover (fn). Check every deed a handover carried, given the bag or the deeds directory.
check_since (fn). Whether the log behind
nowis the log behindkept, grown.head_beside (fn). The file a handover carries its signed head in.
kept_head (fn). Read the head a receiver kept from an earlier handover.
sign_head (fn). Sign a head with this host’s key.
deedar::vouch#
Signing a file that somebody else will open.
Structs
Functions
beside (fn). Where the signature for
pathlives.check (fn). Check the signature beside a file against the keys a reader accepts.
manifest_in (fn). The manifest inside a satchel, which is the file worth signing.
sign (fn). Sign a file, writing the signature beside it.
Structs
Audit (struct). What an audit found in both directions: logged and gone is tampering; served and never logged is a store that wants backfilling. A deed file that does not read, and that the log does not name, is unreadable.
Client (struct). Cap’n client. Same path the
deedarcommand uses.CreateRequest (struct). Agent and grants the writer stamps onto the deed.
Deed (struct). The work plus its identity. The next unit opens it by
id.DeedId (struct). Accession:
deed-<kind>-<slug>.Draft (struct). Constructor input.
from_draftis the shipped assemble.Evidence (struct). Writer-issued evidence about a deed.
Exporter (struct). One reading of the log, held for a handover of many deeds; see
FsStore::exporter. Every receipt is a lookup in a tree built once.Filter (struct). Which rows of
Client::listto keep.FormField (struct).
FsStore (struct). Directory of deeds, write-once bytes, and tombstones.
Imported (struct). What an import checked, and what it added to this store.
MailMessageId (struct). RFC 5322 msg-id, stored as
<local@domain>.Measure (struct).
Missing (struct). A deed the log names that the store no longer serves as logged.
Policy (struct). What
{store}/layoutsays about host attestation.ProducedBy (struct). Who made the deed.
activity_idis an optional assignment id (a claimdagWorkIdwhen that graph is the caller).Step (struct).
StoreUrl (struct).
DEEDAR_URLcontract:file:///abs/pathis the store.
Enums
Body (enum). Kind-specific product. Adding a variant does not rewrite the envelope.
Demand (enum). Whether a store demands an attestation before it will hand a deed over.
Error (enum).
Face (enum). How a viewer looks at a deed. Face follows media type and body.
Grant (enum). Host or path the seat allowed this sitting.
Kind (enum). Closed catalog. Each kind is a handler.
Request (enum).
Response (enum).
Source (enum). Prior deed, a path, or a URL.
trailwalks deed sources.UnsignedHead (enum). Whether an import appends under a head this store did not accept.
Walk (enum). Where the walk from one accession ended.
Constants
EXIT_UNTRUSTED_SIGNER (constant). Status of
deedar checkanddeedar vouch checkwhen the check finished and the signer was not one the reader accepts.PREFIX_CANDIDATES_SHOWN (constant). Accessions an ambiguous-prefix line prints.
Functions
decode_request (fn).
decode_response (fn).
deed_digest (fn). Content address of the canonical deed bytes.
default_store (fn). Where a seat keeps its store when nobody says otherwise.
encode_request (fn).
encode_response (fn).
ensure_dir (fn).
explain_accession (fn). The sentence for an accession that did not resolve to one deed.
imprint_hash (fn). SHA-256 of the on-disk
{id}.evidencefile bytes.is_write_once_addr (fn).
open (fn).
prefix_matches (fn). Accessions whose id, deed digest, or product path starts with
raw.resolve (fn). Slug accession, or
sha256:of deed bytes or a product path on a listed deed.store_dir (fn).
timestamp_req (fn). RFC 3161 TimeStampReq version 1. MessageImprint is SHA-256 of
hashed_message.walk_trail (fn). Walk
sourcesthat name other deeds.
Types
Result (type).