Skip to main content

Module overview

Module overview 

Source
Expand description

The overview composer was relocated into memstead-base (its sole engine-type parameter already is memstead_base::Engine, and it imports only memstead-base + memstead-schema + std) so the lean memstead-mcp build — which does not depend on memstead-engine — can render the identical overview from one rendering authority.

Re-exported here so every existing memstead_engine::overview::* consumer (the full MCP server, the full CLI, serve’s HTML overview, engine tests) compiles unchanged.

Structs§

OverviewArgs
Composer input — packed from the MCP OverviewParams or the CLI Args at the call site. chunk is intentionally NOT here: the surface decides how to chunk the output (MCP wraps with apply_chunking at a transport budget; CLI does the same at its own default), so the composer just returns markdown.
OverviewOutput
Composer output — rendered markdown plus the structured bits the surface needs to assemble its final envelope. extra_frontmatter is the (key, value) slot the surface threads into its own chunking helper (preserved at every chunk’s head).

Enums§

ComposeOverviewError
Typed input failures the composer surfaces. The MCP wrapper maps each variant to its existing envelope (INVALID_INPUT, UNKNOWN_MEM); the full CLI does the same to its CLI error codes.
Surface
Which surface is rendering. The composer branches on this only for inline command-name hints — never for content or shape. Adding a new surface (e.g. UniFFI) is an additive variant; today the macOS app consumes structured engine data, not rendered markdown, so two variants suffice.

Constants§

ALLOWED_OVERVIEW_INCLUDE_KEYS
Heavy-content include keys the composer recognises. Order is the greedy-fill priority order: mem_distribution, community_members, community_bridges, dangling_links. include-listed keys force inclusion regardless of budget; unlisted keys greedy-fill until the budget is exhausted, then surface as hints.
DEFAULT_OVERVIEW_BUDGET
Default token budget for heavy content. Matches the MCP tool’s pre-lift constant and the public-facing description.

Functions§

build_workspace_policy_entries
Compute the set of workspace-policy entries to surface in memstead_overview. Returns (label, value) pairs in stable display order. Only values that deviate from the engine default appear — a fresh workspace produces an empty Vec and the policy section / frontmatter is omitted altogether.
compose_overview
Compose the overview markdown for either surface.
find_schema
Find a schema in the unified engine’s catalogue matching the given memstead_schema::SchemaRef. Mem-pinned first, then workspace, then built-ins. Mirrors memstead_mem_create’s resolution order so memstead_schema(name=<ref>) resolves any pin memstead_mem_create would accept — built-in, workspace-pinned, or mem-pinned.
mem_schema_ref
Resolve the per-mem schema pin from the unified engine’s mounts() shape.
render_workspace_policy_flow
Render workspace-policy entries as an inline YAML flow mapping suitable for embedding into a single frontmatter line: _policy: {require_notes: true, cross_mem_links: named}. Returns None when there are no entries so the frontmatter slot stays empty.