Skip to main content

Module summary

Module summary 

Source
Expand description

Cacheable graph node summary for AST cache.

This module defines a lightweight graph-native representation optimized for caching. Unlike full graph storage, the cached summary contains only fields needed to rebuild query-facing metadata without Node types.

§Size Budget

The cached summary targets ≤256 bytes per node (postcard serialization). This keeps memory footprint reasonable for the 50 MB default cache.

§Excluded Fields

The following fields from NodeEntry are excluded from the cache payload:

  • Docstrings: Can be large (100-1000 bytes), rarely needed for search
  • Body hashes: Recomputed during graph build when needed
  • Graph IDs: Node IDs are graph-specific and not stable across runs

§Example

use sqry_core::cache::GraphNodeSummary;
use sqry_core::graph::unified::CodeGraph;

let graph = CodeGraph::new();
let entry = graph.nodes().get(/* node id */).unwrap();
let summary = GraphNodeSummary::from_entry(entry, &graph).unwrap();

// Serialize for cache storage
let bytes = postcard::to_allocvec(&summary)?;
assert!(bytes.len() <= 256);

Structs§

GraphNodeSummary
Lightweight node summary for cache storage.