Expand description
Persisted graph and fragment data structures.
Structs§
- AlsoIn
- Represents
AlsoIn. - Candidate
- Represents
Candidate. - Def
- Represents
Def. - Edges
ByKind - Represents
EdgesByKind. - FragDef
- Field order is significant: id, name, namespace, kind, line, methods, then the member-fact additions in that exact order – properties, fields, methodReturns – and after those extensionMethods, appended LAST. Each is omitted entirely when empty, so a type declaring none of them serializes exactly as it did before those additions.
- Frag
Extension Method - One
extensionMethodsentry. Serialized field order (name,thisType,arityMin,arityMax,thisArgs) is significant, and serde emits struct fields in declaration order. The two arity halves are NOT optional: they joined the schema with the v6 cache rename, so no fragment this reader can meet is missing them.arity_maxis signed because -1 is the unbounded-paramssentinel. - Frag
Fact - One declared type fact: the type NAME, plus its top-level
type-argument descriptors when the declaration carried any. Field order
(
type,args) is significant, andargsis omitted when absent. - Frag
Name - One declared member, with the line its own NAME token sits on.
Field order (
name,kind,line,owner) is significant, andowneris omitted when empty – which is how a markup or resource key, owned by no C# type, serializes with three fields. - FragRef
- Represents
FragRef. - Fragment
- Represents
Fragment. - Fragment
Cache Entry - Represents
FragmentCacheEntry. - Graph
- Represents
Graph. - Graph
File - One file that contributes a graph fragment: C# (defs, refs, member names),
markup (
x:Class/x:Name,.reswkeys – names only) or TS/JS (imports, exported declarations, call/JSX/dispatch references). - Graph
Name - One row of the full name index. Field order (
name,kind,file,line,owner) is significant;ownercarries the declaring type’s def id for a member and is omitted for a type, an enum member, and every markup or resource key. - Ordered
Map - Represents
OrderedMap. - Percent1
- Represents
Percent1. - Stats
- Represents
Stats.
Enums§
- AnyFragment
- The two shapes a cached fragment can have. Each rel is keyed to whichever
shape the file’s grammar produced; the
ts: 1tag is what tells them apart, on disk and at the resolver’s door. Untagged, and TS FIRST: a C#/markup fragment carries notskey (so the TS arm always fails on it) and a TS fragment carries nousings(so the C# arm always fails on it) – the discrimination is total in both directions, never a first-match-wins guess. - Edge
- The guess tag, appended LAST on every edge kind that can
carry it.
heuristic: trueis set only on an edge a heuristic tier emitted and never writesheuristic: false, so this side pairsskip_serializing_ifwithdefault: absent == precise, and a precise edge’s bytes are exactly what they were before the tag existed. Only the resolver’s heuristic tiers set it today (bothuses-member), but the flag lives on all three targeted kinds because the query layer’s heuristic adjacency is kind-keyed, so a future tier tagging auses-typeedge needs no schema change. - Frag
Using - Represents
FragUsing. - Rebuild
Outcome - Represents
RebuildOutcome.
Functions§
- fragment_
from_ extraction - Build a graph fragment from this crate’s extractor output.
Extraction.purposehas no fragment counterpart – the fragment is graph-only. - graph_
json_ path - Path to the graph artifact (
graph.json) forroot. - index_
is_ stale - Whether the fragments index is stale for the given graph files (any mtime mismatch, or a differing file count).
- markup_
fragment - Markup and resource files never reach the extractor: a
line scan reads them instead (see markup.rs). They still get a fragment even
when they declare nothing, because the fragments index is what tells
mapwhether the graph’s input set changed, and a file missing from it reads as a permanent mismatch.usingsis always empty: XAML has no using-directive equivalent, and thexmlns:prefix declarations that stand in for one are already resolved into fully-qualified ref names by the scan. - read_
fragments_ index - Read the fragments index (rel -> mtime). Used for the per-file reuse decision, independent of the graph rebuild.
- read_
graph - Reads and deserializes the repository graph, returning
Noneon failure. - rebuild_
graph fresh_fragments: fragments this run’s extractor produced for files that needed reparsing (the same set that got a fresh purpose signature in the realdevscout mapflow –mapcmd::map_repoassembles it).changed: from the caller’s ownindexIsStale-equivalent check againstcsFiles, passed in rather than recomputed so the unchanged path never opens any graph file.