{"record":{"id":"2639e10a5b7744a1","repo":"Fission-AI/OpenSpec","slug":"specname-removed-failed-for-header-require","errorCode":null,"errorMessage":"${specName} REMOVED failed for header \"### Requirement: ${name}\" - not found, but \"### Requirement: ${nameToBlock.get(nearMiss)!.name}\" exists; fix the header to match it exactly","messagePattern":"(.+?) REMOVED failed for header \"### Requirement: (.+?)\" - not found, but \"### Requirement: (.+?)\" exists; fix the header to match it exactly","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/specs-apply.ts","lineNumber":434,"sourceCode":"    renamedTargets.set(from, to);\n    renamedApplied++;\n  }\n\n  // REMOVED\n  let removedApplied = 0;\n  for (const name of plan.removed) {\n    const key = normalizeRequirementName(name);\n    if (!nameToBlock.has(key)) {\n      // Requirement gone from the baseline means the removal was already\n      // synced (early-sync pattern) — re-applying it is a no-op, not a\n      // failure. One signal does separate that from a mistyped header: a\n      // requirement that differs only in case or interior whitespace still\n      // being present. That is a typo, and stays a hard abort.\n      // For new specs the skip was already warned about above.\n      if (!isNewSpec) {\n        const nearMiss = [...nameToBlock.keys()].find((k) => foldRequirementName(k) === foldRequirementName(key));\n        if (nearMiss !== undefined) {\n          throw new Error(\n            `${specName} REMOVED failed for header \"### Requirement: ${name}\" - not found, but \"### Requirement: ${nameToBlock.get(nearMiss)!.name}\" exists; fix the header to match it exactly`\n          );\n        }\n        warn(\n          `${specName} - REMOVED requirement \"${name}\" is not in the current spec; treating it as already removed.`\n        );\n      }\n      continue;\n    }\n    nameToBlock.delete(key);\n    removedApplied++;\n  }\n\n  // MODIFIED\n  let modifiedApplied = 0;\n  for (const mod of plan.modified) {\n    const key = normalizeRequirementName(mod.name);\n    const currentBlock = nameToBlock.get(key);","sourceCodeStart":416,"sourceCodeEnd":452,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/specs-apply.ts#L416-L452","documentation":"Error \"${specName} REMOVED failed for header \"### Requirement: ${name}\" - not found, but \"### Requirement: ${nameToBlock.get(nearMiss)!.name}\" exists; fix the header to match it exactly\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/specs-apply.ts:434 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"}