You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current database file ~/.codecora/cora-code/graph.db only reflects the v1 purpose (symbol graph). After v5 migration adds reviews/findings/finding_events, the name is misleading.
Solution
Rename to cora.db as the single source of truth for all cora-code data.
Changes
src/data_dir.rs: Change graph_db_path() → cora_db_path(), rename file from graph.db to cora.db
Auto-migrate logic: On startup, if cora.db does not exist but graph.db does, rename it automatically:
n pub fn cora_db_path() -> PathBuf {
let new_path = cora_data_dir().join("cora.db");
let old_path = cora_data_dir().join("graph.db");
if !new_path.exists() && old_path.exists() {
if let Err(e) = std::fs::rename(&old_path, &new_path) {
eprintln!("Warning: failed to migrate graph.db → cora.db: {e}");
return old_path;
}
}
new_path
}
3. **Update all references**:
- `src/data_dir.rs` — function name + test assertion
- `src/index/mod.rs:29` — doc comment
- `src/index/schema.rs:131` — doc comment
4. **Update docs** (non-breaking, can be separate PR):
- `docs/standards/codecora-data-directory.md`
- `docs/code-intelligence.md`
- `docs/roadmap.md`
### Surface Area
| File | Type | Lines Changed |
|------|------|--------------|
| `src/data_dir.rs` | Code | ~15 |
| `src/index/mod.rs` | Doc comment | 1 |
| `src/index/schema.rs` | Doc comment | 1 |
| `CHANGELOG.md` | Historical — do not edit | — |
### Testing
- [ ] Unit test: `cora_db_path()` returns path ending in `cora.db`
- [ ] Integration test: if `graph.db` exists and `cora.db` does not, auto-rename happens
- [ ] Integration test: if both exist, `cora.db` takes precedence
- [ ] Existing tests pass (update assertion strings)
### Acceptance Criteria
- `cora index`, `cora review`, `cora scan` all use `cora.db`
- Existing `graph.db` auto-migrated on first run
- No data loss during migration
---
Ref: #356, #357, #358, #359 (v0.9.0 milestone)
Activity
ajianaz commentedon Jul 28, 2026
Resolved by PR #421. graph_db_path() now returns cora.db path, auto-migration from graph.db.