feat(FN-1644): rename default global data directory from ~/.pi/fusion to ~/.fusion

- Change default global directory from ~/.pi/fusion to ~/.fusion
- Add migration logic to copy existing data from old directory to new location
- Update all core packages (store, settings, central-core, central-db) to use new default path
- Update all documentation references from ~/.pi/fusion to ~/.fusion
- Add test for ~/.pi/fusion migration path with updated mock paths
- Include changeset for @gsxdsm/fusion minor version bump
This commit is contained in:
Fusion
2026-04-15 13:33:27 -07:00
committed by gsxdsm
parent af4df19e94
commit 0c8089b1d2
24 changed files with 107 additions and 48 deletions

View File

@@ -743,7 +743,7 @@ The dashboard exposes run-audit retrieval and correlation endpoints for inspecti
- `GET /api/config` - Server configuration
- `GET /api/settings` - Merged settings (project overrides global)
- `PUT /api/settings` - Update project-level settings (rejects global-only fields)
- `GET /api/settings/global` - Global user settings (~/.pi/fusion/settings.json)
- `GET /api/settings/global` - Global user settings (~/.fusion/settings.json)
- `PUT /api/settings/global` - Update global user settings
- `GET /api/settings/scopes` - Settings separated by scope: { global, project }
- `GET /api/models` - Available AI models

View File

@@ -344,7 +344,7 @@ export function fetchMemoryBackendStatus(projectId?: string): Promise<MemoryBack
return api<MemoryBackendStatus>(withProjectId("/memory/backend", projectId));
}
/** Fetch global (user-level) settings from ~/.pi/fusion/settings.json */
/** Fetch global (user-level) settings from ~/.fusion/settings.json */
export function fetchGlobalSettings(): Promise<GlobalSettings> {
return api<GlobalSettings>("/settings/global");
}

View File

@@ -18,7 +18,7 @@ import { applyPresetToSelection, generateUniquePresetId } from "../utils/modelPr
*
* Each section groups related settings fields under a sidebar nav item.
* Sections have a `scope` to indicate where their settings are stored:
* - "global": User-level settings stored in ~/.pi/fusion/settings.json (shared across projects)
* - "global": User-level settings stored in ~/.fusion/settings.json (shared across projects)
* - "project": Project-specific settings stored in .fusion/config.json
* - undefined: Section operates independently of settings storage (e.g. authentication)
*

View File

@@ -182,7 +182,7 @@ function unloadThemeDataStylesheet(): void {
/**
* Custom hook for theme management.
*
* Source of truth: backend global settings (`~/.pi/fusion/settings.json`).
* Source of truth: backend global settings (`~/.fusion/settings.json`).
*
* Behavior:
* - Initializes from localStorage cache to avoid pre-hydration theme flash

View File

@@ -91,7 +91,7 @@ function createMockGlobalSettingsStore() {
return {
getSettings: vi.fn().mockResolvedValue({}),
updateSettings: vi.fn().mockResolvedValue({}),
getSettingsPath: vi.fn().mockReturnValue("/fake/home/.pi/fusion/settings.json"),
getSettingsPath: vi.fn().mockReturnValue("/fake/home/.fusion/settings.json"),
init: vi.fn().mockResolvedValue(false),
};
}

View File

@@ -2147,7 +2147,7 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
/**
* GET /api/settings/global
* Returns the global (user-level) settings from ~/.pi/fusion/settings.json.
* Returns the global (user-level) settings from ~/.fusion/settings.json.
* Does NOT include computed/server-only fields like githubTokenConfigured.
*/
router.get("/settings/global", async (_req, res) => {
@@ -2165,7 +2165,7 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
/**
* PUT /api/settings/global
* Update global (user-level) settings in ~/.pi/fusion/settings.json.
* Update global (user-level) settings in ~/.fusion/settings.json.
* These settings persist across all fn projects for the current user.
*/
router.put("/settings/global", async (req, res) => {

View File

@@ -10,7 +10,7 @@ function createMockGlobalSettingsStore() {
return {
getSettings: vi.fn().mockResolvedValue({}),
updateSettings: vi.fn().mockResolvedValue({}),
getSettingsPath: vi.fn().mockReturnValue("/fake/home/.pi/fusion/settings.json"),
getSettingsPath: vi.fn().mockReturnValue("/fake/home/.fusion/settings.json"),
init: vi.fn().mockResolvedValue(false),
};
}