mushroomdb 0.6.5

Embedded graph database with Cypher queries, rule triggers, and Arrow export
Documentation
//! Reading a code graph back as answers.
//!
//! `ingest-git` writes a repository into the graph; this module reads it out
//! again, in the shapes a person or an assistant asks for. Each tool computes
//! a plain data structure and a renderer turns it into a short digest, so the
//! same answer serves a CLI, an HTTP response and an MCP tool without being
//! computed three ways.
//!
//! | Tool | Answers |
//! |---|---|
//! | [`explore`] | one target from as many sides as asked for: the three below in one call |
//! | [`repo_map`] | what is this repository, in one screen |
//! | [`brief`] | the same, for the start of a session, in a fixed byte budget |
//! | [`context`] | everything known about one file or symbol |
//! | [`impact`] | what else the files in a diff reach |
//! | [`owners`] | who has written a file, and when |
//! | [`why`] | what links two things, with the evidence |
//! | [`recall::recall_digest`] | which nodes a topic is closest to |
//! | [`remember::remember`] | write a note the graph can later recall |
//! | [`stale_concepts`] | which learned concepts have drifted from their sources |
//!
//! [`rules`] holds the `about_<label>` and `concept_sources` rule
//! definitions both `structure::ensure_rules_and_fulltext` (CLI) and
//! [`remember::remember`] need, so the two cannot declare them differently.
//!
//! Two rules hold across every tool here. The output is **deterministic** for
//! the same store state and the same caller-supplied "now": collections are
//! sorted, ties break on the key, floats print at a fixed precision, and every
//! answer is decided by the graph. The one value that is not is how long ago
//! the store was synced, which is measured against the system clock unless the
//! caller pins the time — see [`MapOptions::now_ts`]. And every string that
//! came out of the graph passes through [`sanitize`](render::sanitize) before
//! it reaches a rendered line, so repository content cannot forge a header or a
//! line break in an assistant's context.
//!
//! [`context`] is the one tool that reads anything outside the graph: the
//! source it quotes comes from the working tree, so what it shows is what is on
//! disk now. It quotes it only when asked — [`context_with`] with
//! [`ContextOptions::source`] — and otherwise answers with a pointer to it.

mod brief;
mod concepts;
mod context;
mod explore;
mod facts;
mod impact;
mod map;
mod owners;
mod path;
pub mod recall;
pub mod remember;
pub mod render;
pub mod rules;
mod why;

pub use brief::{brief, BriefOptions, BriefReport, EdgeTypeBrief, LabelBrief, Recipe, SchemaBrief};
pub use concepts::stale_concepts;
pub use context::{
    context, context_with, named_symbols, CallSites, ContextOptions, ContextReport, Target,
    MAX_SOURCE_LINES,
};
pub use explore::{explore, Depth, ExploreReport};
pub use impact::{
    impact, path_excluded, FileImpact, ImpactOptions, ImpactReport, Partner, DEFAULT_EXCLUDES,
    MIN_SHARED_COMMITS,
};
pub use map::{repo_map, MapCommunity, MapOptions, RepoMap, SyncInfo};
pub use owners::{owners, OwnersReport, QUARTERS};
pub use path::{shortest_path, MAX_HOPS, PATH_EDGES};
pub use recall::{
    identifier_terms, or_query, recall_digest, HINT, MAX_HITS, MAX_OUTPUT_BYTES, MAX_QUERY_TERMS,
    MIN_HIT_SCORE, UNTRUSTED_FRAMING,
};
pub use remember::{remember, RememberInput, NOTE_KINDS};
pub use render::{
    cap_lines, render_brief, render_context, render_explore, render_impact, render_map,
    render_owners, render_why, sanitize, DEFAULT_EXPLORE_BYTES, EMPTY_BRIEF, MAX_BRIEF_BYTES,
    MAX_CONTEXT_LINES, MAX_MAP_LINES, MAX_TOOL_LINES,
};
pub use why::{why, SharedCommits, WhyLink, WhyReport};