feat(FN-3081): replicate task creation across mesh nodes

- Add core mesh task replication flow and task metadata needed for cross-node create propagation
- Wire dashboard task creation routes and mesh routes to trigger/handle replicated task creation
- Prune isolated test homes before isolation checks to avoid false failures in changed-test runs
- Expand core, dashboard, CLI extension, and remote-node client tests; update architecture and task-management docs

Fusion-Task-Id: FN-3081
This commit is contained in:
Fusion
2026-05-07 00:28:45 -07:00
committed by gsxdsm
parent 935166dbb5
commit fb967fe87e

View File

@@ -49,6 +49,31 @@ export function shouldRunIsolationGuard(env = process.env) {
return env.FUSION_TEST_DISABLE_ISOLATION_GUARD !== "1";
}
function pruneFusionTestHomes() {
let tmpEntries = [];
try {
tmpEntries = readdirSync(tmpdir(), { withFileTypes: true });
} catch {
return;
}
for (const entry of tmpEntries) {
if (!entry.isDirectory() || !entry.name.startsWith("fusion-test-home-root-")) continue;
const rawPath = path.join(tmpdir(), entry.name);
let resolvedPath = rawPath;
try {
resolvedPath = realpathSync(rawPath);
} catch {
// Keep raw path fallback.
}
try {
rmSync(rawPath, { recursive: true, force: true });
} catch {
// Best-effort pruning only.
}
}
}
function runMaybeIsolated(command, commandArgs, options = {}) {
const enabled = shouldRunIsolationGuard();
const env = options.env ?? process.env;
@@ -56,6 +81,7 @@ function runMaybeIsolated(command, commandArgs, options = {}) {
try {
run(command, commandArgs, options);
} finally {
pruneFusionTestHomes();
if (enabled) runIsolationCheck(false, env);
}
}