fix(FN-2897): harden npm bundle packaging and merge recovery flows

- Strip private @fusion/* workspace devDependencies from the published CLI manifest via prepare-publish-manifest and package metadata updates
- Replace cross-spawn usage and add staged bundle layout assertions to verify resolver output in dist packaging
- Add per-task/project model override resolution across core, dashboard settings/task modals, and route coverage with new regression tests
- Strengthen engine merge/recovery handling for paused/interrupted/squash paths and surface merger timeline activity with additional self-healing and merger tests
- Add changesets for npm bundle dependency fixes, project model override stabilization, and FTS5 corruption recovery

Fusion-Task-Id: FN-2897
This commit is contained in:
Fusion
2026-04-28 18:23:13 -07:00
committed by gsxdsm
parent 3f061460b9
commit 7960b3d4c6
10 changed files with 103 additions and 39 deletions

View File

@@ -49,13 +49,15 @@ export type ClaudeCliExtensionResolution =
* module's location, and fall back to `require.resolve` for monorepo
* dev/test runs where this file executes from `src/` rather than `dist/`.
*/
export function resolveClaudeCliExtension(): ClaudeCliExtensionResolution {
export function resolveClaudeCliExtensionFromModuleUrl(
moduleUrl: string,
): ClaudeCliExtensionResolution {
let pkgJsonPath: string | undefined;
// Bundled lookup: when running from dist/, sibling dir dist/pi-claude-cli/
// holds the staged extension. Walk up a few levels to also catch nested
// layouts (e.g. dist/commands/foo.js) without hard-coding depth.
const here = dirname(fileURLToPath(import.meta.url));
const here = dirname(fileURLToPath(moduleUrl));
for (const rel of ["pi-claude-cli", "../pi-claude-cli", "../../pi-claude-cli"]) {
const candidate = resolve(here, rel, "package.json");
if (existsSync(candidate)) {
@@ -113,6 +115,10 @@ export function resolveClaudeCliExtension(): ClaudeCliExtensionResolution {
};
}
export function resolveClaudeCliExtension(): ClaudeCliExtensionResolution {
return resolveClaudeCliExtensionFromModuleUrl(import.meta.url);
}
/**
* Compute the paths to append to `discoverAndLoadExtensions`' configuredPaths
* based on the user's `useClaudeCli` setting.