refactor: remove legacy kb compatibility

Drops the .kb/kb.db migration path, legacy backup filename handling, and
backward-compat test suites. Renames internal kbDir identifiers to
fusionDir and hasKbProject/isValidKbProject to their fusion equivalents.

- Remove needsCentralMigration, autoMigrateToCentral, and the
  "needs-migration" FirstRunState; checkAndMigrate and KB_SKIP_MIGRATION
  env var are gone
- Remove LEGACY_BACKUP_DIR and canonicalizeBackupDir; listBackups no
  longer matches kb-* filenames
- Delete backward-compat.test.ts and store-backward-compat.test.ts;
  update remaining tests to new 3-state first-run model

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-23 16:55:46 -07:00
parent 32da0aedac
commit a269f4829f
36 changed files with 365 additions and 1194 deletions

View File

@@ -51,8 +51,8 @@ export class RoutineStore extends EventEmitter<RoutineStoreEvents> {
*/
private get db(): Database {
if (!this._db) {
const kbDir = `${this.rootDir}/.fusion`;
this._db = new Database(kbDir);
const fusionDir = `${this.rootDir}/.fusion`;
this._db = new Database(fusionDir);
this._db.init();
}
return this._db;