Part of #433. ## Task Auto-reindex stale files when `cora serve` starts, before accepting MCP connections. ## Implementation 1. Add function `check_and_reindex_if_stale(conn, project_id)` in `src/index/mod.rs` 2. Query: `SELECT path, fingerprint, last_indexed FROM files WHERE project_id = ?` 3. For each file, compute current mtime:size fingerprint 4. If changed → re-extract symbols + store 5. Call from `src/mcp/server.rs` before starting stdin loop ## Spec ``` $ cora serve [cora] Checking for stale files... [cora] Auto-indexed 3 changed files (42ms) [cora] MCP server ready on stdio ``` ## Performance - Stale check: stat() per tracked file — ~0.1ms per 100 files - Reindex: existing incremental pipeline (~9ms for no changes) - Must NOT block MCP startup > 1s ## Acceptance - Modify a file → run `cora serve` → new symbol appears in `brain_search` - No stale data after serve starts - Verbose logging shows what was reindexed ## Est: 1 day
Activity
ajianaz commentedon Aug 1, 2026
Implemented. Closing as completed — feature verified in codebase.