Expand description
Holographic codebase pack generator.
Produces a cache-stable, model-readable representation of a codebase that pre-loads enough information into an LLM’s context to answer most codebase questions without tool calls.
§Format
Each symbol gets one entry:
## <symbol_name>
L2: <signature> [<file>:<line>]
L3: <surprise facts only>L2 (signature) is always present — it anchors the model’s prior. L3 (surprise) is present only when the function deviates from what a trained model would predict.
§Cross-references
Uses the SQLite index (occurrence + block + scope_binding tables) for precise, disambiguated cross-references — not regex word matching.
§Surprise detection
Uses skeleton-frequency analysis: lines whose aggressive_skeleton is rare across the codebase are “surprising”; lines whose skeleton is common are “expected” (the model’s prior handles them).
Structs§
- Hierarchical
Pack - Pack
Entry - A pack entry parsed into searchable fields.
- Symbol
Enums§
- Gate
Decision - Gate decision returned by
should_inject_pack. - Pack
Format - Pack format — controls which layers are included.
- Slice
Decision - Slice a full pack for a specific query using BM25 scoring.
Functions§
- adaptive_
slice - Slice a pack for a specific query, but only if the classifier says it’s worth it. Returns (sliced_content, decision) so callers can log/meter the decision.
- compute_
complexity_ score - Compute a composite complexity score for the codebase from the SQLite index.
- compute_
complexity_ score_ for - C12: Complexity score using an already-open connection. Combines 5 query_row calls into fewer queries via prepare_cached.
- gate_
decision - Decide whether to inject the pack based on the codebase’s complexity score.
- gate_
decision_ for - C1: Gate decision using an already-open connection (no double open).
- generate_
hierarchical_ pack - Generate a hierarchical pack: top-level map + per-module packs.
- generate_
pack - Generate a holographic pack for a codebase.
- generate_
pack_ auto - Auto-mode: gate + hotspot selection combined.
- generate_
pack_ hotspot - Generate a hotspot-selected pack: top-K symbols by composite score.
- generate_
pack_ hotspot_ with - C1: Hotspot pack using an already-open connection.
- parse_
pack_ entries - Parse a full pack string into individual entries.
- should_
inject_ pack - Convenience: run the full gate pipeline for a codebase path.
- should_
slice_ for_ query - Classify a query text to decide whether the sliced pack is worth sending.
- slice_
pack_ for_ query - “which symbols to include” problem that hotspot selection can’t solve.