Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix: use shared root identity and run all cleanup cases on Windows

tt-a1i0c9d97d7f307
diff --git a/archify/renderers/shared/owned-temp-directory.mjs b/archify/renderers/shared/owned-temp-directory.mjs
index 7d4e2f5c..cc910f09 100644
--- a/archify/renderers/shared/owned-temp-directory.mjs
+++ b/archify/renderers/shared/owned-temp-directory.mjs
@@ -2,6 +2,7 @@ import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { setTimeout as delay } from 'node:timers/promises';
+import { sameEntry } from './path-semantics.mjs';
const retryable = new Set(['EBUSY', 'EPERM', 'EACCES', 'ENOTEMPTY']);
@@ -31,7 +32,11 @@ export function createOwnedTempDirectory(prefix, { parent = os.tmpdir() } = {})
const ancestors = [];
for (let current = canonicalParent; ; current = path.dirname(current)) {
ancestors.push(directoryIdentity(current));
- if (path.dirname(current) === current) break;
+ const parentRelation = sameEntry(current, path.dirname(current));
+ if (parentRelation.status === 'match') break;
+ if (parentRelation.status !== 'different') {
+ throw new Error(`Temporary directory ancestor identity is unavailable: ${current}`);
+ }
}
const verifyAncestors = () => {
// Check from the filesystem root down, before traversing a replaced parent.
diff --git a/scripts/run-windows-path-tests.mjs b/scripts/run-windows-path-tests.mjs
index b6cfa27b..32561376 100644
--- a/scripts/run-windows-path-tests.mjs
+++ b/scripts/run-windows-path-tests.mjs
@@ -537,6 +537,7 @@ const fullSuites = [
'test/skill-installation.test.mjs',
'test/copy-site-assets.test.mjs',
'test/path-boundary-contract.test.mjs',
+ 'test/temp-cleanup.test.mjs',
'test/path-semantics.test.mjs',
'test/portable-path.test.mjs',
'test/native-output-path.test.mjs',
@@ -558,7 +559,6 @@ const portabilitySuites = [
'test/cli.test.mjs',
'test/preview.test.mjs',
'test/visual-check.test.mjs',
- 'test/temp-cleanup.test.mjs',
'test/update-notifier.test.mjs',
];