{"record":{"id":"bb8b3678795ba674","repo":"Fission-AI/OpenSpec","slug":"specname-validation-failed-duplicate-to-in-re","errorCode":null,"errorMessage":"${specName} validation failed - duplicate TO in RENAMED for header \"### Requirement: ${to}\"","messagePattern":"(.+?) validation failed - duplicate TO in RENAMED for header \"### Requirement: (.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":239,"sourceCode":"    if (removedNamesSet.has(name)) {\n      throw new Error(\n        `${specName} validation failed - duplicate requirement in REMOVED for header \"### Requirement: ${rem}\"`\n      );\n    }\n    removedNamesSet.add(name);\n  }\n  const renamedFromSet = new Set<string>();\n  const renamedToSet = new Set<string>();\n  for (const { from, to } of plan.renamed) {\n    const fromNorm = normalizeRequirementName(from);\n    const toNorm = normalizeRequirementName(to);\n    if (renamedFromSet.has(fromNorm)) {\n      throw new Error(\n        `${specName} validation failed - duplicate FROM in RENAMED for header \"### Requirement: ${from}\"`\n      );\n    }\n    if (renamedToSet.has(toNorm)) {\n      throw new Error(\n        `${specName} validation failed - duplicate TO in RENAMED for header \"### Requirement: ${to}\"`\n      );\n    }\n    renamedFromSet.add(fromNorm);\n    renamedToSet.add(toNorm);\n  }\n\n  // Pre-validate cross-section conflicts\n  const conflicts: Array<{ name: string; a: string; b: string }> = [];\n  for (const n of modifiedNames) {\n    if (removedNamesSet.has(n)) conflicts.push({ name: n, a: 'MODIFIED', b: 'REMOVED' });\n    if (addedNames.has(n)) conflicts.push({ name: n, a: 'MODIFIED', b: 'ADDED' });\n  }\n  for (const n of addedNames) {\n    if (removedNamesSet.has(n)) conflicts.push({ name: n, a: 'ADDED', b: 'REMOVED' });\n  }\n  // Renamed interplay: MODIFIED must reference the NEW header, not FROM\n  for (const { from, to } of plan.renamed) {","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L221-L257","documentation":"Error \"${specName} validation failed - duplicate TO in RENAMED for header \"### Requirement: ${to}\"\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:239 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"}