{"record":{"id":"c4c800a7f974d6d9","repo":"Fission-AI/OpenSpec","slug":"specname-validation-failed-duplicate-requirem","errorCode":null,"errorMessage":"${specName} validation failed - duplicate requirement in ADDED for header \"### Requirement: ${add.name}\"","messagePattern":"(.+?) validation failed - duplicate requirement in ADDED for header \"### Requirement: (.+?)\"","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":202,"sourceCode":"    warnings.push(message);\n    if (!options.silent) {\n      console.log(chalk.yellow(`⚠️  Warning: ${message}`));\n    }\n  };\n  // Read change spec content (delta-format expected)\n  assertTrustedSpecPath(update.sourceRoot, update.source);\n  const changeContent = await fs.readFile(update.source, 'utf-8');\n\n  // Parse deltas from the change spec file\n  const plan = parseDeltaSpec(changeContent);\n  const specName = update.id;\n\n  // Pre-validate duplicates within sections\n  const addedNames = new Set<string>();\n  for (const add of plan.added) {\n    const name = normalizeRequirementName(add.name);\n    if (addedNames.has(name)) {\n      throw new Error(\n        `${specName} validation failed - duplicate requirement in ADDED for header \"### Requirement: ${add.name}\"`\n      );\n    }\n    addedNames.add(name);\n  }\n  const modifiedNames = new Set<string>();\n  for (const mod of plan.modified) {\n    const name = normalizeRequirementName(mod.name);\n    if (modifiedNames.has(name)) {\n      throw new Error(\n        `${specName} validation failed - duplicate requirement in MODIFIED for header \"### Requirement: ${mod.name}\"`\n      );\n    }\n    modifiedNames.add(name);\n  }\n  const removedNamesSet = new Set<string>();\n  for (const rem of plan.removed) {\n    const name = normalizeRequirementName(rem);","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L184-L220","documentation":"Error \"${specName} validation failed - duplicate requirement in ADDED for header \"### Requirement: ${add.name}\"\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:202 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"}