{"record":{"id":"2fb97307255d4c78","repo":"Fission-AI/OpenSpec","slug":"could-not-retire-capability-update-id-upda","errorCode":null,"errorMessage":"Could not retire capability '${update.id}': ${update.target} resolves outside ${mainSpecsDir}. Remove the external file by hand, or replace the symlink and rerun.","messagePattern":"Could not retire capability '(.+?)': (.+?) resolves outside (.+?)\\. Remove the external file by hand, or replace the symlink and rerun\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":825,"sourceCode":"    if ((error as NodeJS.ErrnoException).code === 'ENOENT') return { retired: false };\n    throw new Error(\n      `Could not retire capability '${update.id}': could not verify ${update.target} ` +\n        `before deletion (${error instanceof Error ? error.message : String(error)}).`\n    );\n  }\n\n  if (realSource !== undefined) {\n    let inside: boolean;\n    try {\n      inside = await isInsideRealDir(realSource, mainSpecsDir);\n    } catch (error) {\n      throw new Error(\n        `Could not retire capability '${update.id}': could not verify that ${update.target} ` +\n          `is inside ${mainSpecsDir} (${error instanceof Error ? error.message : String(error)}).`\n      );\n    }\n    if (!inside) {\n      throw new Error(\n        `Could not retire capability '${update.id}': ${update.target} resolves outside ` +\n          `${mainSpecsDir}. Remove the external file by hand, or replace the symlink and rerun.`\n      );\n    }\n  }\n\n  let displacedPath: string | undefined;\n  try {\n    await options.beforeMutate?.();\n    if (options.verifyDisplaced) {\n      const displaced = `${update.target}.openspec-retire-${randomUUID()}`;\n      displacedPath = displaced;\n      await fs.rename(update.target, displaced);\n      try {\n        await options.verifyDisplaced(displaced);\n        try {\n          await fs.lstat(update.target);\n          throw new Error(","sourceCodeStart":807,"sourceCodeEnd":843,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L807-L843","documentation":"Error \"Could not retire capability '${update.id}': ${update.target} resolves outside ${mainSpecsDir}. Remove the external file by hand, or replace the symlink and rerun.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:825 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the external file by hand if it is no longer needed","Replace the symlink with one that points inside the main specs directory, then rerun the archive","Move the referenced file into the main specs directory and update the link"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}