{"record":{"id":"69f7126f2afd48c6","repo":"Fission-AI/OpenSpec","slug":"archive-rollback-would-overwrite-a-concurrent-chan","errorCode":null,"errorMessage":"Archive rollback would overwrite a concurrent change at ${snapshot.target}. The displaced spec was retained at ${snapshot.displacedPath}.","messagePattern":"Archive rollback would overwrite a concurrent change at (.+?)\\. The displaced spec was retained at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":911,"sourceCode":"            outcome,\n            ...(outcome === 'write' ? { expectedContent: Buffer.from(rebuilt) } : {}),\n          };\n        }\n        throw error;\n      }\n    })\n  );\n}\n\nasync function restoreSpecSnapshots(snapshots: SpecSnapshot[]): Promise<void> {\n  const errors: Error[] = [];\n  for (const snapshot of [...snapshots].reverse()) {\n    try {\n      if (snapshot.outcome === 'retire') {\n        if (snapshot.displacedPath !== undefined) {\n          try {\n            await fs.lstat(snapshot.target);\n            throw new Error(\n              `Archive rollback would overwrite a concurrent change at ${snapshot.target}. ` +\n                `The displaced spec was retained at ${snapshot.displacedPath}.`\n            );\n          } catch (error) {\n            if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n          }\n          await fs.rename(snapshot.displacedPath, snapshot.target);\n          snapshot.displacedPath = undefined;\n          continue;\n        }\n        try {\n          const current = await fs.lstat(snapshot.target);\n          const unchangedSymlink =\n            snapshot.symlink !== undefined &&\n            current.isSymbolicLink() &&\n            (await fs.readlink(snapshot.target)) === snapshot.symlink;\n          // Re-read to confirm the target still holds the snapshot content; a\n          // mismatch means a concurrent edit, and rollback throws below rather","sourceCodeStart":893,"sourceCodeEnd":929,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L893-L929","documentation":"Error \"Archive rollback would overwrite a concurrent change at ${snapshot.target}. The displaced spec was retained at ${snapshot.displacedPath}.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:911 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"}