Expand description
Operation request/response types and the gix-free read paths
(health, search).
Per-entity delta envelopes for memstead_changes_since live in
changes — backend-neutral so both the git-branch tree-diff
and any future folder-backend JSONL-walk produce the same shape.
Wire types for the agent-notes payload live in agent_notes —
pure data shapes, no gix. The producer functions
(agent_notes_since, read_memstead_ref) stay in
memstead-git-branch::ops::agent_notes because they read from a
gitdir.
The git-touching operation submodules (crud, export) still
live in memstead-git-branch and are re-exported into
memstead_git_branch::ops for downstream callers.
Re-exports§
pub use agent_notes::AgentNotesReport;pub use agent_notes::CommitNote;pub use branch_reset::BranchResetOutcome;pub use branch_reset::StrandedCrossMemRef;pub use changes::BackendChanges;pub use changes::ChangeEnvelope;pub use changes::ChangesReport;pub use changes::EMPTY_TREE_SHA;pub use changes::MemChangedNotice;pub use changes::NoticeByChange;pub use changes::NoticeChanges;pub use changes::RENAME_SIMILARITY_DEFAULT;pub use changes::RENAME_SIMILARITY_MAX;pub use changes::RENAME_SIMILARITY_MIN;pub use changes::folder_changes_since;pub use commit_envelope::CommitEnvelope;pub use commit_envelope::EntityChange;pub use diff::Diff;pub use diff::DiffConfig;pub use diff::EntityDiff;pub use diff::IncomingRipple;pub use export::MemExportBytes;pub use export::MemExportError;pub use transport::FetchOutcome;pub use transport::PullOutcome;pub use transport::PushOutcome;pub use transport::RemoteAddOutcome;pub use transport::UpdatedRef;
Modules§
- agent_
notes - Agent-notes wire types — pure data shapes for the
commit-trailer + workspace-
__MEMSTEAD-ref payload that the git-branch backend produces from its gitdir. - branch_
reset - Wire types for
Engine::branch_reset. - changes
- Backend-neutral entity-level delta surface for
memstead_changes_sincecallers. - commit_
envelope - Per-commit wire envelope and entity-change variants.
- diff
- Two-ref structural diff types.
- export
- Mem-archive export.
- health
- Health checks — missing required fields, staleness, scoring.
- integrity
- Integrity linter — read-time conformance findings.
- search
- Full-text search across entities with BM25 scoring via tantivy.
- transport
- Wire types for the three transport ops
Engine::fetch,Engine::pull,Engine::push.
Structs§
- Batch
Entry - Batch
Error - Per-item error envelope on a batch result. The shape matches the
MCP wire envelope for single-entry failures:
codeis the stableUPPER_SNAKE_CASEtoken fromcrate::EngineError::code();detailscarries the variant-specific recovery payload (e.g. declared list, allowed enum values, hash-mismatch current) when available, or an empty object for variants without a structured payload. - Batch
Result - Result of an atomic batch update — all-or-nothing.
- Context
Result - Context around an entity — neighbors, community, related entities.
- Create
Args - Arguments for creating an entity.
- Create
Result - Result of a create operation.
- Dangling
Link - One dangling wiki-link finding surfaced by
memstead_health include=["dangling_links"]. A link is dangling when its resolved target is a stub (i.e. the markdown file does not exist on disk). This is the post-delete / renamed-without-rewrite / typo signal. - Delete
Result - Result of a delete operation.
- Expansion
Info - Metadata attached to hits reached via graph expansion. The
primary hit that seeded the expansion is identified by
of;via_edgeis the exactrel_typestring;depthcounts hops from the seed. - Export
Result - Export result.
- Facets
- Fixed set of facet dimensions computed over the unpaginated hit set. Tier 1 freezes the dimensions; extend later only if empirical use demands it. Zero-count entries are excluded to keep the payload small.
- Folded
Tag - Case-drift audit entry. Surfaces when two or more casings of the same
canonical (lowercased) tag appear in the authored graph — the agent-hostile
bug where
decisionandDecisionlook like two healthy low-count tags in the case-sensitive primary surface. - Full
Refresh Report - What
Engine::full_refreshchanged — and, just as deliberately, what it SKIPPED. The refresh is additive-only: removals never take effect warm, and this report is how the caller learns whether its next call will succeed instead of guessing. - Health
Issue - Health
Report - Health check result for one entity.
- Health
Summary - Aggregated health report for the whole graph.
- Incoming
Ref - Serialisable projection of
store::InEdgeforCreateResult.incoming.sourceis the lowercaseEdgeSourcevariant:"explicit" | "hierarchy" | "body_link". - List
Result - List result with token totals.
- MemExport
Result - Result of a
.memmem-archive export. - Missing
Required Outgoing Block - Wire-shape entry inside
MissingRequiredOutgoing.missing. Lists the relationship-name alternatives and the rendered cardinality literal for one unsatisfiedRequiredOutgoingblock. Custom struct so the JSON output is{ "relationships": [...], "cardinality": "at_least_one" }— identical to the schema YAML shape, so an agent can copy the envelope’sdetails.missingentry directly into amemstead_relateplan without renaming fields. - Modified
Metadata - Metadata-level mutations applied by a single
memstead_updatecall. Same empty-vec-omit convention asModifiedSections; auto-timestamp metadata fields written by the engine are NOT surfaced here (they are engine-driven, not user-driven — the caller has nothing to react to). - Modified
Sections - Section-level mutations applied by a single
memstead_updatecall. Each vec lists the section keys that landed in that mutation mode. Empty inner vecs are serde-omitted so the wire stays quiet; the struct itself always serialises so the outermodified_sectionskey is a stable shape regardless of what the call actually touched. - Neighbor
Info - Parse
Recovery Entry - Per-entry result of an
apply_parse_recoverycall. One entry perPARSED_RELATION_INVALIDwarning the engine observed at the call site: the bulk-fix dispatches the writable-origin recoveries and reports the read-only-origin warnings as skipped. Wire-equivalent across MCP, CLI, and UniFFI surfaces; the renderer chooses the shape it prefers. - Parse
Recovery Report - Outcome of
Engine::apply_parse_recovery. Carries oneParseRecoveryEntryper parse-time-dropped relation observed at the call site plus the last successful commit sha for callers that want to pollmemstead_changes_sincefor the per-entity diff. An emptyentrieslist means the workspace was already clean. - Parsed
Relation Recovery - Abstract recovery action attached to a
PARSED_RELATION_INVALIDwarning when the source mem is writable. The shape is tool- agnostic: it names what to do, not which tool to call. A consumer (agent, bulk-fix orchestrator, app surface) mapskindto the concrete call on whichever MCP / CLI / UniFFI path it uses; the warning’s payload itself does not drift when the mutation surface evolves. - Patch
Arg - Arguments for a patch (substring replacement).
- Quarantined
MemReport - One quarantine-roster entry on
HealthSummary: the mem, the typed reason code, and the full reason message (repair command included — plan-01 material). - Query
- Flat query shape for full-text search. Four optional fields, all combined with implicit AND across fields.
- Refresh
Failure - One failed refresh item —
itemisschema-source:<which>,mount:<mem>,mount-manifest, orworkspace. - Relate
Arg - Arguments for a relate/unrelate operation.
- Relate
Result - Result of a relate operation.
- Relation
Unset Arg - One repair-shaped relation removal on
memstead_update—relations_unset: [{ rel_type, target }]. Symmetric withmetadata_unset: an absent(rel_type, target)pair is a silent no-op. Only accepted when the target entity currently fails the conformance check (REPAIR_NOT_NEEDEDotherwise) — the everyday detach path staysmemstead_relate(remove). - Reload
Report - Per-mem reload outcome — produced by [
Engine::reload_one_mem] and surfaced verbatim in thememstead_reloadMCP tool’s response when an explicit operator-triggered reload runs against a single mem. Auto-reloads on the read path consume this internally and emit aWarningHint::MemReloaded(which carriesmem,old_head,new_head,entities_loaded— the diff list is intentionally omitted from the lean warning payload; agents that need it callmemstead_changes_sincethemselves with the suppliedold_head). - Reload
Result - Rename
Result - Result of a rename operation.
- Schema
Heading Violation - Wire-shape entry inside
SchemaHeadingRoundtripViolation.violations— one section whose declared heading does not derive back to its declared key. Mirrorsmemstead_schema::HeadingKeyViolation, kept as a local struct so the warning’s JSON shape is owned here. - Score
Breakdown - Per-hit score components surfaced so agents can understand ranking.
- Search
Hit - A search result hit.
- Search
Result - Search result with metadata.
- Search
Scope - Scope filters for search and list operations.
- SetMem
Description Outcome - Result of
Engine::set_mem_description. Carries the (mem, old_description, new_description) triple so callers can surface the change without an extra read. - SetMem
Subject Outcome - Result of
Engine::set_mem_subject. The block sets/clears as a unit; old/new carry the whole block. - SetMem
Sync State Outcome - Result of
Engine::set_mem_sync_state. Carries the (mem, key, previous-token) triple so callers (CLI, MCP) can surface the change without an extra read. The token values are opaque to the engine — seeMemConfig::sync_state. - SetMem
Title Outcome - Result of
Engine::set_mem_title. Same shape discipline asSetMemDescriptionOutcome. - SetMem
Version Outcome - Result of
Engine::set_mem_version. Carries the (mem, old_version, new_version) triple so callers (CLI, MCP) can surface the change without an extra read. - Skipped
Mount - One mount declined by
export_markdownbecause the active backend doesn’t support in-place markdown regeneration. - Stale
Entity - Status
- Graph status — node / edge counts and schema distribution. Renamed from
the former
Statswhen thestatscommand becamestatus(bundle plan03-projection-promotion, D11); the fields are unchanged so every caller’s payload stays byte-compatible. - Subsection
Facet - One sub-section-level facet entry.
pathis ordered outermost → innermost, prefixed with the H2 section key (e.g.["specifies", "Response Shapes", "Markdown Output"]). Structured vector (not a delimiter-joined string) so headings containing punctuation don’t break the key. - Summary
Pair - Lead-section
(heading, value)for a search/list hit, resolved against the hit’s own mem schema at search time. Carried in-memory from the search op to the renderers; seeSearchHit::summary. - TagDistribution
- One entry in the tag distribution surface: an authored tag string, the
number of non-stub entities carrying it, and the per-entity-type breakdown
of those hits. Comparison is case-sensitive —
decisionandDecisioncount as distinct entries here (seetag_distribution_foldedfor the drift-aware sidecar). - TagVariant
- Term
Match - One snippet-level match recorded per (term, field).
heading_pathisSomewhen the match falls under an H3–H6 sub-heading; elements are ordered outermost → innermost. - Untagged
Stats - Aggregate count of non-stub entities with zero effective tags, broken
down by
entity_type. “Untagged” collapses three states: missingtagsmetadata, empty string value, and comma-only value (e.g.","). - Update
Args - Arguments for updating an entity.
- Update
Result - Result of an update operation.
Enums§
- Direction
- Health
Issue Code - Machine-readable condition discriminator for a
HealthIssue— the enumeration lives here, with the issue type, and is never re-derived per projection. A projection that lists issues carries the code; the code is NEVER only a message-string prefix (a projection that drops messages would silently collapse distinct conditions — the exact misdirectionSECTION_HEADING_MISMATCHexists to prevent). - Warning
Hint - Typed non-fatal issue surfaced from engine operations. Serialises as the
uniform
{ code, message, details }envelope so a generic warning handler (log sink, UI, alerting) can readcode+messagewithout branching on variant.Displayrenders the agent-facing text, reachable viaWarningHint::message; per-variant structured fields land underdetails, their shape keyed bycode.
Constants§
- OVERVIEW_
INCLUDE_ KEYS - Allowed
includekeys formemstead_overview— single source of truth shared across the lean MCP server, full MCP server, and the lean CLI’soverviewcommand. MirrorsHEALTH_INCLUDE_KEYSfor thehealthsurface. The CLI--includeflag validates against this list and surfacesUNKNOWN_INCLUDE_KEYwarnings, matching the MCP tool’s behaviour.
Functions§
- envelope
- Build the uniform
{ code, message, details }envelope used on both the warning wire (WarningHint’s customSerialize) and the MCP error wire (tool_error_with_payloadpayloads inengine_err_with_suggestions). Agents and other decoders branch oncode(UPPER_SNAKE_CASE, stable) and parsedetailsbycodewhen they need structured fields. - project_
incoming - Project
&[store::InEdge]into a sortedVec<IncomingRef>. Ordering by (rel_type, from) ascending — deterministic output despite the underlying HashMap iteration order.