Files
fusion/scripts/__tests__/no-tracked-plugin-reload-artifacts.test.mjs
gsxdsm 0eaa3c7b9a FN-8990: clean up plugin reload scratch files
Keep plugin hot-reload cache-busting copies ephemeral and remove legacy tracked artifacts.

- Delete tracked plugin reload scratch files.
- Remove temporary import copies after successful and failed reloads.
- Add cleanup and tracked-artifact regression coverage.

Files changed:
 .changeset/fn-8990-plugin-reload-scratch-cleanup.md       |   7 ++
 packages/core/src/__tests__/plugin-hot-reload.test.ts     |  25 ++++ -
 packages/core/src/plugins/plugin-loader.ts                |  16 ++-
 plugins/fusion-plugin-droid-runtime/src/.index.reload-1.ts |  84 ----------------
 plugins/fusion-plugin-droid-runtime/src/.index.reload-2.ts |  84 ----------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-1.ts | 108 --------------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-2.ts | 108 --------------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-3.ts | 108 --------------------
 plugins/fusion-plugin-openclaw-runtime/src/.index.reload-1.ts |  95 -----------------
 plugins/fusion-plugin-paperclip-runtime/src/.index.reload-1.ts | 112 ---------------------
 scripts/__tests__/no-tracked-plugin-reload-artifacts.test.mjs |  27 +++++
 11 files changed, 72 insertions(+), 702 deletions(-)

Fusion-Task-Id: FN-8990

Fusion-Task-Lineage: 2221ebaf-b8ab-4a3c-8934-addfa348c98c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 03:40:21 -07:00

28 lines
948 B
JavaScript

import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
import test from "node:test";
const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
/*
FNXC:PluginLoader 2026-08-11-09:58:
FN-8990 requires reload scratch copies to remain untracked. Gitignore cannot
remove a path already in git's index, so inspect tracked files directly.
*/
function getTrackedReloadArtifacts() {
return execFileSync("git", ["ls-files"], { cwd: rootDir, encoding: "utf8" })
.split("\n")
.filter((path) => /\.index\.reload-\d+\.ts$/.test(path));
}
test("plugin hot-reload scratch copies are never tracked", () => {
const artifacts = getTrackedReloadArtifacts();
assert.deepEqual(
artifacts,
[],
`Tracked plugin hot-reload scratch copies:\n${artifacts.map((path) => `- ${path}`).join("\n")}`,
);
});