Purpose
Display live project stats (files indexed, chunks, memories, KB entries) in the brain TUI sidebar.
Design
-
Add getProjectStats() function in src/status.ts (or new src/stats.ts):
- Query DB for: document count, chunk count, memory count, KB entry count
- Cache for 30s (no need to re-query on every status update)
-
Extend BrainStatusEvent payload in src/status.ts:
- Add optional
stats field: { documents: number, chunks: number, memories: number, kbEntries: number }
-
Extend BrainStatusBar in src/tui.tsx:
- Sidebar variant: add third row below progress bar showing compact stats
- Format:
📄 142 files · 🧩 847 chunks · 🧠 23 memories · 📚 5 KB
- Only show when stats available and state is "ready"
Acceptance
- Project stats visible in TUI sidebar when brain is ready
- Counts update after ingest completes
- No flicker (30s cache)
- Tests: stats computation, TUI rendering with stats
Purpose
Display live project stats (files indexed, chunks, memories, KB entries) in the brain TUI sidebar.
Design
Add
getProjectStats()function insrc/status.ts(or newsrc/stats.ts):Extend
BrainStatusEventpayload insrc/status.ts:statsfield:{ documents: number, chunks: number, memories: number, kbEntries: number }Extend
BrainStatusBarinsrc/tui.tsx:📄 142 files · 🧩 847 chunks · 🧠 23 memories · 📚 5 KBAcceptance