{"record":{"id":"edd83a8fd5437fc0","repo":"Fission-AI/OpenSpec","slug":"a-concurrent-file-appeared-at-update-target-whi","errorCode":null,"errorMessage":"A concurrent file appeared at ${update.target} while archive was retiring it.","messagePattern":"A concurrent file appeared at (.+?) while archive was retiring it\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":843,"sourceCode":"      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(\n            `A concurrent file appeared at ${update.target} while archive was retiring it.`\n          );\n        } catch (targetError) {\n          if ((targetError as NodeJS.ErrnoException).code !== 'ENOENT') throw targetError;\n        }\n        if (!options.deferDelete) await fs.unlink(displaced);\n      } catch (error) {\n        try {\n          await fs.lstat(update.target);\n          throw new Error(\n            `${error instanceof Error ? error.message : String(error)} ` +\n              `A concurrent file now occupies ${update.target}; the displaced spec was retained at ${displaced}.`\n          );\n        } catch (targetError) {\n          if ((targetError as NodeJS.ErrnoException).code !== 'ENOENT') throw targetError;\n        }\n        await fs.rename(displaced, update.target);\n        throw error;","sourceCodeStart":825,"sourceCodeEnd":861,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L825-L861","documentation":"Error \"A concurrent file appeared at ${update.target} while archive was retiring it.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:843 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"}