Conversation
27348db to
7c811df
Compare
JesseHerrick
left a comment
There was a problem hiding this comment.
Overall the code and migration path looks good, @egze! I tested on my machine and the migration went perfectly.
I have just a few minor notes.
Since this will require a full reindex, I'd say we should wait until the next version that requires an indexVersion bump. We should have one of those soon due to the changes we'll need for worktree support without reindexing, so I'd wait for that release.
Now, on whether this is necessary at all: I'm not 100% convinced. I personally like the simplicity of having the .dexter.db files in the root, but had we started with .dexter/dexter.db then I wouldn't have any issue with that either. So I am curious if others feel as strongly as you do about the need for a separate directory. I don't feel super strongly about this, I just don't love that we need to do a migration.
7c811df to
c8bdd9b
Compare
c8bdd9b to
dfd09b1
Compare
Summary
<project>/.dexter.dbto<project>/.dexter/dexter.dbso the repo root stays clean and future dexter artifacts have a dedicated scratch space.dexter initor LSP startup: legacy.dexter.dband its-shm/-walsiblings are deleted and a fresh index is built in the new folder. No user action required beyond updating their own.gitignore.internal/storevia newDBPath,DBDir,LegacyDBPath, andFindProjectRoothelpers. The duplicated root-marker walks incmd/main.goandinternal/lsp/server.goare gone; the LSP call sites now have an inline comment documenting why they intentionally don't passmix.exsas an extra marker.dexter-vscode,dexter-zed) continue to work via their existingmix.exs/.gitfallback markers and can be updated separately.Test plan
make test— all packages pass (store, lsp, integration)make lint— 0 issuesTestDBPath,TestDBDir,TestLegacyDBPath,TestFindProjectRoot(6 subtests),TestOpen_CreatesDexterFolder,TestOpen_MigratesLegacyLayout,TestOpen_MigrationWithPartialLegacyFilesTestIntegration_LegacyMigrationruns against the real binary, seeds legacy files, runs plaindexter init(no--force), asserts legacy deletion + new DB exists +dexter lookupstill worksdexter initcreates.dexter/dexter.db; legacy.dexter.db*files are deleted and rebuilt on next init.gitignorerecommendation lands correctly in README Quick startroot_markersstill include the legacy.dexter.dbso mid-upgrade users stay anchoredNote
Medium Risk
Moderate risk because it changes on-disk index location and project-root discovery for both CLI and LSP, which could break indexing/lookup if path resolution or migration logic is wrong.
Overview
Moves the SQLite index from
.dexter.dbat the project root to.dexter/dexter.db, and updates docs and.gitignoreguidance accordingly.Centralizes database path + root discovery in
internal/storevia new helpers (DBPath,DBDir,LegacyDBPath,FindProjectRoot), rewiring the CLI and LSP to use them (with the LSP explicitly avoidingmix.exsanchoring to keep monorepo behavior).Adds automatic cleanup-based migration: if legacy
.dexter.db/WAL/SHM files exist, they are deleted and the index is rebuilt in.dexter/; unit + integration tests were updated/added to cover the new layout, migration, and root-marker behavior.Reviewed by Cursor Bugbot for commit dfd09b1. Bugbot is set up for automated code reviews on this repo. Configure here.