Code Understanding (AST)
ZoidMatter indexes source code via tree-sitter and retains code cards at three levels of detail (LOD). Unlike tenant memory, code cards are global — scoped by repo via tags, not by bank.
LOD Levels
| Level | Content |
|---|---|
| L0 | Topology — symbol names, kinds, file paths |
| L1 | Behavior — what each symbol does |
| L2 | Detail — full signatures and context |
Key Capabilities
- Indexing — parse a file and retain L0/L1/L2 cards (
zoid_ast_index). - Symbol search — by name, kind, file path, or LOD.
- Blast radius — every symbol transitively affected by changing a given card, with bounded depth/result caps.
- Task-shaped retrieval — embed a task description and return a ranked symbol subgraph (
zoid_ast_slice). - Gated source access —
zoid_ast_code_windowfetches raw source only when a caller provides a reason and an expected line count, and rejects if the actual count exceeds 2x.
AST Watcher
A file watcher tracks source changes and keeps the symbol graph in sync, passing real dirty sets and handling file-removal events so the index never goes stale.