{"record":{"id":"a15931b04cf185b2","repo":"Fission-AI/OpenSpec","slug":"cannot-fork-schema-with-linked-or-unsupported-entr-a15931","errorCode":null,"errorMessage":"Cannot fork schema with linked or unsupported entry: ${srcPath}","messagePattern":"Cannot fork schema with linked or unsupported entry: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/commands/schema.ts","lineNumber":290,"sourceCode":"  }\n  ancestors.add(canonicalSrc);\n  fs.mkdirSync(dest, { recursive: true });\n\n  try {\n    const entries = fs.readdirSync(src, { withFileTypes: true });\n    for (const entry of entries) {\n      const srcPath = path.join(src, entry.name);\n      const destPath = path.join(dest, entry.name);\n      const canonicalEntry = resolveSchemaCopyPath(allowedRoot, srcPath);\n      const stats = fs.statSync(canonicalEntry);\n\n      if (stats.isDirectory()) {\n        copyDirRecursive(canonicalEntry, destPath, allowedRoot, ancestors);\n      } else if (stats.isFile()) {\n        // Dereference confined links so the fork is an independent schema.\n        fs.copyFileSync(canonicalEntry, destPath);\n      } else {\n        throw new Error(`Cannot fork schema with linked or unsupported entry: ${srcPath}`);\n      }\n    }\n  } finally {\n    ancestors.delete(canonicalSrc);\n  }\n}\n\n/**\n * Verifies a schema tree before replacing or creating the fork destination.\n */\nfunction assertSchemaTreeCanBeCopied(\n  src: string,\n  allowedRoot = src,\n  ancestors = new Set<string>()\n): void {\n  const canonicalSrc = resolveSchemaCopyPath(allowedRoot, src);\n  if (ancestors.has(canonicalSrc)) {\n    throw new Error(`Cannot fork schema with a linked directory cycle: ${src}`);","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/commands/schema.ts#L272-L308","documentation":"Error \"Cannot fork schema with linked or unsupported entry: ${srcPath}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/commands/schema.ts:290 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}