Expand description
store — walk, locate, and shard a db.md store.
A db.md store is one directory marked by an uppercase DB.md at its root.
Store::open is the single gate every store-walking subcommand goes
through; a missing DB.md is the NotAStore error (NOT_A_STORE). The
toolkit never guesses a store root.
Scale discipline lives here: Store::walk and the layer/type-folder
walks are SWEEP primitives used only by validate --all,
index rebuild, and stats. The interactive loop instead uses
Store::find_links_to / Store::find_links_to_any (embedded ripgrep,
presence-only) and the index.jsonl sidecar readers
(Store::find_by_type / Store::find_by_where /
Store::read_type_index) — never a whole-store parse. The batch
Store::find_links_to_any is what keeps the working-set validate’s
incoming-linker discovery a single store scan rather than one scan per
changed object.
Structs§
- NotA
Store - Returned when a path is opened as a store but has no
DB.mdat its root. Surfaced as the structured codeNOT_A_STOREwith a non-zero exit. - Store
- An opened db.md store: its root path plus the parsed
DB.mdConfig.
Enums§
- Layer
- The three canonical layers of a db.md store.
- Store
Error - Errors from store-level operations (walk, locate, shard, sidecar read).
Functions§
- infer_
type_ from_ path - Infer a content file’s canonical
typefrom its store-relative path — the inverse of [default_type_folder] and the single source of truth for path→type inference (the CLI’sfm initcalls this, never re-derives it). - layer_
for_ type - The canonical
Layeratype_belongs to, derived from its default type-folder (email→Sources,contact→Records,wiki-page→Wiki, unrecognized →Records). The write path uses this to decide whether an agent-supplied folder is in the right layer for the type before honouring its sub-folder choice.