Fission-AI/OpenSpec · error
validation failed - RENAMED TO header collides with ADDED…
Error message
${specName} validation failed - RENAMED TO header collides with ADDED for "### Requirement: ${to}" What it means
Validation inside buildUpdatedSpec: a RENAMED entry's TO header collides with a requirement in the ADDED section (same normalized name). Applying both would create two requirements with one name, so the delta set is rejected; at-fault input is the "### Requirement: <to>" header shared between a rename target and an addition.
Solutions
- Remove the ADDED entry for that requirement since the rename already produces it
- Rename the ADDED requirement or the RENAMED target to a different header
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/specs-apply.ts:282 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/91c0aa0fef5bfce6.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/specs-apply.ts:282
// a case/whitespace variant cannot slip past the guard and degrade
// into a warned no-op.
const removedFoldMatch = [...removedNamesSet].find(
(r) => foldRequirementName(r) === foldRequirementName(fromNorm)
);
if (removedFoldMatch !== undefined) {
throw new Error(
`${specName} validation failed - requirement present in multiple sections (RENAMED and REMOVED) for header "### Requirement: ${from}"` +
(removedFoldMatch === fromNorm ? '' : ` (REMOVED spells it "${removedFoldMatch}")`)
);
}
if (modifiedNames.has(fromNorm)) {
throw new Error(
`${specName} validation failed - when a rename exists, MODIFIED must reference the NEW header "### Requirement: ${to}"`
);
}
// Detect ADDED colliding with a RENAMED TO
if (addedNames.has(toNorm)) {
throw new Error(
`${specName} validation failed - RENAMED TO header collides with ADDED for "### Requirement: ${to}"`
);
}
}
if (conflicts.length > 0) {
const c = conflicts[0];
throw new Error(
`${specName} validation failed - requirement present in multiple sections (${c.a} and ${c.b}) for header "### Requirement: ${c.name}"`
);
}
const hasAnyDelta = plan.added.length + plan.modified.length + plan.removed.length + plan.renamed.length > 0;
if (!hasAnyDelta) {
throw new Error(
`Delta parsing found no operations for ${update.id}. ` +
`Provide ADDED/MODIFIED/REMOVED/RENAMED sections in change spec.`
);
}
View on GitHub (pinned to 6926ccb18a)