Fission-AI/OpenSpec · error · Error
Cannot resolve artifact outputs through a linked directory…
Error message
Cannot resolve artifact outputs through a linked directory cycle: ${currentDir} What it means
Raised by assertGlobDirectoryTraversal while resolving artifact output globs: walking the glob's directory segments revisited an already-visited canonical directory, i.e. the path traverses a symlinked directory cycle back inside the change tree. Resolution stops to avoid infinite traversal; the at-fault input is the output glob whose expansion crosses a link loop.
Solutions
- Remove the cyclic symlinks inside the change directory's output paths
- Restructure artifact output paths so they do not loop through linked directories
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/artifact-graph/outputs.ts:41 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/df0ef1dc287a121d.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/artifact-graph/outputs.ts:41
FileSystemUtils.assertPathWithin(changeDir, outputPath);
return outputPath;
}
function assertGlobDirectoryTraversal(
changeDir: string,
currentDir: string,
directorySegments: string[],
segmentIndex = 0,
visited = new Set<string>(),
canonicalChangeDir = FileSystemUtils.canonicalizeExistingPath(changeDir),
ancestors = new Set<string>()
): void {
if (segmentIndex >= directorySegments.length) return;
const canonicalDir = FileSystemUtils.canonicalizeExistingPath(currentDir);
FileSystemUtils.assertPathWithin(canonicalChangeDir, canonicalDir);
const visitKey = `${canonicalDir}\0${segmentIndex}`;
if (ancestors.has(visitKey)) {
throw new Error(`Cannot resolve artifact outputs through a linked directory cycle: ${currentDir}`);
}
if (visited.has(visitKey)) return;
visited.add(visitKey);
ancestors.add(visitKey);
try {
const segment = directorySegments[segmentIndex];
if (segment === '**') {
// `**` may consume no directory at all.
assertGlobDirectoryTraversal(
changeDir,
canonicalDir,
directorySegments,
segmentIndex + 1,
visited,
canonicalChangeDir,
ancestors
);View on GitHub (pinned to 6926ccb18a)