fix(FN-680): restore TaskStore project resolution and fresh schema writes

- fix TaskStore.getOrCreateForProject to resolve projects through BackwardCompat and support legacy .fusion/.kb detection
- add regression tests for exact-name project lookup, legacy cwd fallback, and fresh-schema task create/update persistence
- sync the tasks schema definition with missionId support so fresh databases match runtime migrations
- add project overview and selector styles for the multi-project dashboard UI
This commit is contained in:
gsxdsm
2026-04-01 13:48:01 -07:00
parent 27d2f25b42
commit 614c710de8
7 changed files with 724 additions and 108 deletions

View File

@@ -541,8 +541,8 @@ export class BackwardCompat {
const projects = await this.central.listProjects();
if (projects.length === 0) {
// No projects registered - check if cwd has a .kb/ directory
if (this.hasKbProject(cwd)) {
// No projects registered - check if cwd has a current .fusion project or legacy .kb project
if (this.hasProjectData(cwd)) {
// Auto-migrate this project
const coordinator = new MigrationCoordinator(this.central);
const result = await coordinator.registerSingleProject(cwd);
@@ -612,13 +612,17 @@ export class BackwardCompat {
}
/**
* Check if a directory contains a kb project.
* Check if a directory contains a current .fusion project or legacy .kb project.
*/
private hasKbProject(dir: string): boolean {
const kbDir = join(dir, ".kb");
const dbPath = join(kbDir, "kb.db");
private hasProjectData(dir: string): boolean {
return this.hasProjectDb(dir, ".fusion") || this.hasProjectDb(dir, ".kb");
}
if (!existsSync(kbDir)) return false;
private hasProjectDb(dir: string, folderName: ".fusion" | ".kb"): boolean {
const projectDir = join(dir, folderName);
const dbPath = join(projectDir, "kb.db");
if (!existsSync(projectDir)) return false;
if (!existsSync(dbPath)) return false;
try {