You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(archive): allow REMOVED requirements when creating new spec files (#403) (#404)
When creating a new spec file, REMOVED requirements are now ignored
with a warning instead of causing archive to fail. This enables
refactoring scenarios where old fields are removed while documenting
a capability for the first time.
Fixes#403
`${specName}: target spec does not exist; only ADDED requirements are allowed for new specs.`
457
+
`${specName}: target spec does not exist; only ADDED requirements are allowed for new specs. MODIFIED and RENAMED operations require an existing spec.`
457
458
);
458
459
}
460
+
// Warn about REMOVED requirements being ignored for new specs
461
+
if(plan.removed.length>0){
462
+
console.log(
463
+
chalk.yellow(
464
+
`⚠️ Warning: ${specName} - ${plan.removed.length} REMOVED requirement(s) ignored for new spec (nothing to remove).`
// Verify error message mentions MODIFIED not allowed for new specs
204
+
expect(console.log).toHaveBeenCalledWith(
205
+
expect.stringContaining('new-capability: target spec does not exist; only ADDED requirements are allowed for new specs. MODIFIED and RENAMED operations require an existing spec.')
206
+
);
207
+
expect(console.log).toHaveBeenCalledWith('Aborted. No files were changed.');
// Verify error message mentions RENAMED not allowed for new specs
242
+
expect(console.log).toHaveBeenCalledWith(
243
+
expect.stringContaining('another-capability: target spec does not exist; only ADDED requirements are allowed for new specs. MODIFIED and RENAMED operations require an existing spec.')
244
+
);
245
+
expect(console.log).toHaveBeenCalledWith('Aborted. No files were changed.');
0 commit comments