{"record":{"id":"c56b193b9f0c797d","repo":"Fission-AI/OpenSpec","slug":"errors-map-message-message-join","errorCode":null,"errorMessage":"errors.map(({ message }) => message).join(' ')","messagePattern":"errors\\.map\\(\\((.+?)\\) => message\\)\\.join\\(' '\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":1018,"sourceCode":"        } else if (snapshot.contentExisted) {\n          await fs.writeFile(snapshot.target, snapshot.content!);\n        } else {\n          const referent = path.resolve(path.dirname(snapshot.target), snapshot.symlink);\n          await fs.rm(referent, { force: true });\n        }\n        continue;\n      }\n      if (snapshot.content !== undefined) {\n        await fs.mkdir(path.dirname(snapshot.target), { recursive: true });\n        await fs.writeFile(snapshot.target, snapshot.content);\n        if (snapshot.mode !== undefined) await fs.chmod(snapshot.target, snapshot.mode);\n      }\n    } catch (error) {\n      errors.push(error instanceof Error ? error : new Error(String(error)));\n    }\n  }\n  if (errors.length > 0) {\n    throw new Error(errors.map(({ message }) => message).join(' '));\n  }\n}\n\nasync function finalizeRetirementBackups(\n  snapshots: SpecSnapshot[],\n  mainSpecsDir: string\n): Promise<void> {\n  const errors: string[] = [];\n  for (const snapshot of snapshots) {\n    if (snapshot.outcome !== 'retire' || snapshot.displacedPath === undefined) continue;\n    const displacedPath = snapshot.displacedPath;\n    try {\n      if (\n        snapshot.displacedFingerprint === undefined ||\n        (await fingerprintMovablePath(displacedPath)) !== snapshot.displacedFingerprint\n      ) {\n        throw new Error('the displaced spec changed after retirement verification');\n      }","sourceCodeStart":1000,"sourceCodeEnd":1036,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L1000-L1036","documentation":"Aggregation point in archive rollback: individual rollback step failures are collected and their messages joined with spaces into one combined error. The message is dynamically built from those step failures, so its text reflects whichever restore operations went wrong.","triggerScenarios":"Thrown at src/core/archive.ts:1018 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Address each listed per-snapshot failure in order","Check for locks/permissions on the spec paths and re-run the archive"],"exampleFix":null,"handlingStrategy":"try-catch","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"}