Skip to main content

Module entity

Module entity 

Source
Expand description

Re-export shim over memstead_base::entity plus the git-touching git_tree_source submodule that stays in this crate.

Downstream consumers (memstead-mcp, memstead-cli, memstead-swift) reach the entity surface through memstead_git_branch::entity::* exactly as before; the inner types come from memstead-base.

Modules§

generator
Entity → Markdown generator. Deterministic output for roundtrip stability.
git_tree_source
Git-tree-backed entity source — reads .md blobs out of a mem ref’s tree without a working tree on disk.
id
Entity ID parsing, generation, and path mapping.
loader
Filesystem walker — loads all .md files from mem directories into entities.
parser
Markdown → Entity parser. Handles YAML frontmatter, sections, wiki-links.
source
Entity source abstraction — where markdown comes from.
store_builder
Shared helper for turning ParseResults into a populated Store.
writer
Entity → markdown projection writer for the export paths.

Structs§

Entity
A parsed entity with metadata, sections, and relationships.
EntityId
Unique entity identifier: mem--entity-path.
HeadingSpan
A single H3–H6 heading span recorded under one H2 section. Byte offsets reference the raw section content (the string stored in Entity.sections[key]). Spans are stored flat — level skips (H2 → H4 without H3) are tolerated and ancestry is resolved at query time via offset containment, not by inserting virtual intermediate spans.
ParseResult
Result of parsing a markdown file. Includes the entity, extracted inline links, and parse-time warnings (e.g. duplicate section headings).
Relationship
A declared relationship in the Relationships section.

Enums§

MetadataValue
A metadata value with type coercion matching the JS parser behavior.
StubKind
Typed provenance for stub entities. Set at stub creation and lives for the engine instance’s lifetime. Boot reconstructs stubs via the parser and always tags them LoadTime; the ForwardReference and Residual variants therefore only appear during the engine lifetime in which they were created and reduce to LoadTime after a reload — this is intentional (“annotation, not state”) and consistent with the “no tombstones” decision.

Functions§

normalise_description
Normalise a per-edge description from the wire/argument surface: trims surrounding whitespace and collapses empty / whitespace-only inputs to None. Applied at every mutation entry-point so the renderer never emits a bare em-dash followed by zero characters and the posture-validation step sees a canonical input.
resolve_cross_mem_refs
Rewrite relationship and inline-link targets whose slug has a "<mem>--<rest>" shape where <mem> is a visible-writable mem name. Same-mem wiki-links (no -- prefix, or a prefix that is not a known mem) are left unchanged — the resolver is additive and byte- identical for inputs without a known-mem prefix.