Fission-AI/OpenSpec · error

validation failed - duplicate requirement in REMOVED for…

Error message

${specName} validation failed - duplicate requirement in REMOVED for header "### Requirement: ${rem}"

What it means

Validation inside buildUpdatedSpec: two REMOVED delta entries normalize to the same requirement name. Duplicate removals are ambiguous (double-delete of one requirement), so the change's deltas are rejected before applying; the at-fault input is the duplicated '### Requirement: <rem>' header.

Solutions

  1. Delete the duplicate entry from the REMOVED list in the change spec
  2. Check for case/whitespace variants that fold to the same name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/specs-apply.ts:222 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/61f6587b4763089d. Report an issue: GitHub.

Appendix: source

Thrown at src/core/specs-apply.ts:222

      );
    }
    addedNames.add(name);
  }
  const modifiedNames = new Set<string>();
  for (const mod of plan.modified) {
    const name = normalizeRequirementName(mod.name);
    if (modifiedNames.has(name)) {
      throw new Error(
        `${specName} validation failed - duplicate requirement in MODIFIED for header "### Requirement: ${mod.name}"`
      );
    }
    modifiedNames.add(name);
  }
  const removedNamesSet = new Set<string>();
  for (const rem of plan.removed) {
    const name = normalizeRequirementName(rem);
    if (removedNamesSet.has(name)) {
      throw new Error(
        `${specName} validation failed - duplicate requirement in REMOVED for header "### Requirement: ${rem}"`
      );
    }
    removedNamesSet.add(name);
  }
  const renamedFromSet = new Set<string>();
  const renamedToSet = new Set<string>();
  for (const { from, to } of plan.renamed) {
    const fromNorm = normalizeRequirementName(from);
    const toNorm = normalizeRequirementName(to);
    if (renamedFromSet.has(fromNorm)) {
      throw new Error(
        `${specName} validation failed - duplicate FROM in RENAMED for header "### Requirement: ${from}"`
      );
    }
    if (renamedToSet.has(toNorm)) {
      throw new Error(
        `${specName} validation failed - duplicate TO in RENAMED for header "### Requirement: ${to}"`

View on GitHub (pinned to 6926ccb18a)