Expand description
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 |
|---|---|
repo_map | what is this repository, in one screen |
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 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.
Re-exports§
pub use recall::or_query;pub use recall::recall_digest;pub use recall::HINT;pub use recall::MAX_EDGES_PER_HIT;pub use recall::MAX_EDGE_CANDIDATES;pub use recall::MAX_HITS;pub use recall::MAX_OUTPUT_BYTES;pub use recall::MAX_QUERY_TERMS;pub use recall::UNTRUSTED_FRAMING;pub use remember::remember;pub use remember::RememberInput;pub use remember::NOTE_KINDS;pub use render::render_context;pub use render::render_impact;pub use render::render_map;pub use render::render_owners;pub use render::render_why;pub use render::sanitize;pub use render::MAX_CONTEXT_LINES;pub use render::MAX_MAP_LINES;pub use render::MAX_TOOL_LINES;
Modules§
- recall
recall— a short digest of the graph nodes closest to a topic.- remember
remember— write aNotethe graph can laterrecall.- render
- Turning graph facts into lines an assistant reads.
- rules
- Rule definitions more than one write path needs to agree on.
Structs§
- Context
Report - One file or symbol, from every side the graph can see it.
- File
Impact - What changing one file reaches.
- Impact
Options - How much of the graph one
impactcall reports per file. - Impact
Report - What a set of changed files reaches.
- MapCommunity
- One group of files that change and import together.
- MapOptions
- What
repo_mapis allowed to spend and how much it may print. - Owners
Report - Who has written a file, and when.
- Partner
- One file the change reaches, and whether the caller has it open already.
- RepoMap
- The repository, summarised.
- Sync
Info - How current the graph is: the sha it was synced to, and how long ago that sync ran.
- WhyLink
- One rule-written edge, and what makes it true.
- WhyReport
- How
aandbare linked, if they are.
Enums§
- Target
- What a
contextcall was asked about, once resolved.
Constants§
- DEFAULT_
EXCLUDES - The paths a repository carries that are not its source: build output, vendored dependencies, generated bundles, and lockfiles nobody reads.
- MAX_
HOPS - Longest chain a
whyfallback will look for. - MAX_
SOURCE_ LINES - Source lines quoted at most, whichever end of a symbol they come from.
- PATH_
EDGES - The edge types a path may be walked over, in the order the digests name them. Every one of them says one part of a repository depends on, changes with, or talks about another.
- QUARTERS
- Quarters of history the report covers, counting back from the one “now” falls in.
Functions§
- context
- Everything known about
target. - impact
- What changing
filesreaches, one report per file. - owners
- Who wrote
path. - path_
excluded - Whether
pathmatches any ofpatterns. - repo_
map - Summarise the repository the store was built from.
- shortest_
path - The shortest chain of
edge_typesedges fromatob, as(edge type, node reached)hops — so a two-hop answer is[(IMPORTS, x), (CO_CHANGED, b)]andais the caller’s own starting point. - stale_
concepts - Concepts whose recorded source hashes no longer match the files they were
learned from, as
(concept key, reason), sorted by key. - why
- Why
aandbare linked.