Summary
SymbolTableBuilder.build_for_project loads symbols.json and returns it directly when present. There is no invalidation or incremental refresh, so stale symbol data can survive source edits and force full rescans when cache is bypassed.
Why this matters
- Performance: current behavior is all-or-nothing (full walk with
project_root.rglob("*.py")) when cache miss occurs.
- Correctness risk: stale cache can return outdated symbols.
Suggested direction
- Store per-file fingerprint metadata (mtime/size or content hash) in cache.
- Re-analyze only changed/added/deleted files and merge into existing symbol table.
- Keep a fast path for unchanged repositories.
Acceptance
- Cache hit with no file changes avoids full project scan.
- Editing one file only reprocesses that file.
- Existing symbol-table tests remain green and new tests cover invalidation behavior.
Code
refactron/analysis/symbol_table.py
Summary
SymbolTableBuilder.build_for_projectloadssymbols.jsonand returns it directly when present. There is no invalidation or incremental refresh, so stale symbol data can survive source edits and force full rescans when cache is bypassed.Why this matters
project_root.rglob("*.py")) when cache miss occurs.Suggested direction
Acceptance
Code
refactron/analysis/symbol_table.py