{"record":{"id":"c9406078c20ac942","repo":"Fission-AI/OpenSpec","slug":"specname-validation-failed-requirement-presen","errorCode":null,"errorMessage":"${specName} validation failed - requirement present in multiple sections (RENAMED and REMOVED) for header \"### Requirement: ${from}\"${removedFoldMatch === fromNorm ? '' : ` (REMOVED spells it \"${removedFoldMatch}\")`}","messagePattern":"(.+?) validation failed - requirement present in multiple sections \\(RENAMED and REMOVED\\) for header \"### Requirement: (.+?)\"(.+?)\"\\)`\\}","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":270,"sourceCode":"  }\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) {\n    const fromNorm = normalizeRequirementName(from);\n    const toNorm = normalizeRequirementName(to);\n    // A REMOVED naming the FROM side contradicts the rename. This used to\n    // fail incidentally at apply time (the rename consumed the old header,\n    // so REMOVED hit \"not found\"); now that a missing REMOVED target is a\n    // no-op, the conflict must be rejected explicitly. Compared folded, so\n    // a case/whitespace variant cannot slip past the guard and degrade\n    // into a warned no-op.\n    const removedFoldMatch = [...removedNamesSet].find(\n      (r) => foldRequirementName(r) === foldRequirementName(fromNorm)\n    );\n    if (removedFoldMatch !== undefined) {\n      throw new Error(\n        `${specName} validation failed - requirement present in multiple sections (RENAMED and REMOVED) for header \"### Requirement: ${from}\"` +\n          (removedFoldMatch === fromNorm ? '' : ` (REMOVED spells it \"${removedFoldMatch}\")`)\n      );\n    }\n    if (modifiedNames.has(fromNorm)) {\n      throw new Error(\n        `${specName} validation failed - when a rename exists, MODIFIED must reference the NEW header \"### Requirement: ${to}\"`\n      );\n    }\n    // Detect ADDED colliding with a RENAMED TO\n    if (addedNames.has(toNorm)) {\n      throw new Error(\n        `${specName} validation failed - RENAMED TO header collides with ADDED for \"### Requirement: ${to}\"`\n      );\n    }\n  }\n  if (conflicts.length > 0) {\n    const c = conflicts[0];","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L252-L288","documentation":"Error \"${specName} validation failed - requirement present in multiple sections (RENAMED and REMOVED) for header \"### Requirement: ${from}\"${removedFoldMatch === fromNorm ? '' : ` (REMOVED spells it \"${removedFoldMatch}\")`}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:270 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"}