{"record":{"id":"5cf43abdb78da5b0","repo":"Fission-AI/OpenSpec","slug":"archive-rollback-would-overwrite-a-concurrent-chan-5cf43a","errorCode":null,"errorMessage":"Archive rollback would overwrite a concurrent change at ${snapshot.target}.","messagePattern":"Archive rollback would overwrite a concurrent change at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":937,"sourceCode":"          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\n          // than overwrite it (CodeQL js/file-system-race is intentional here).\n          const unchangedFile =\n            snapshot.symlink === undefined &&\n            snapshot.content !== undefined &&\n            current.isFile() &&\n            (await fs.readFile(snapshot.target)).equals(snapshot.content);\n          if (unchangedSymlink || unchangedFile) continue;\n          throw new Error(\n            `Archive rollback would overwrite a concurrent change at ${snapshot.target}.`\n          );\n        } catch (error) {\n          if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n        }\n      } else {\n        let current;\n        try {\n          current = await fs.lstat(snapshot.target);\n        } catch (error) {\n          if (\n            (error as NodeJS.ErrnoException).code === 'ENOENT' &&\n            !snapshot.existed\n          ) {\n            continue;\n          }\n          throw error;\n        }","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L919-L955","documentation":"Error \"Archive rollback would overwrite a concurrent change at ${snapshot.target}.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:937 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"}