Fission-AI/OpenSpec · error · RetirementBackupsRetainedError
${error.message} ${cleanupError instanceof Error ?…
Error message
${error.message} ${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)} What it means
Wraps cleanup failures during archive error handling: when MoveDestinationRetainedError triggers cleanup of the retained archive destination and that cleanup also fails, the original error message is concatenated with the cleanup error message so both the primary failure and the secondary cleanup failure are reported together.
Solutions
- Address the primary error first, then any cleanup error
- Check for leftover archive/staging directories and reconcile manually
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at src/core/archive.ts:1982 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/500b7850538d3691.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/archive.ts:1982
`The active delta for '${proposed.update.id}' changed during the fallback copy.`
);
}
}
}
};
await moveDirectory(changeDir, archivePath, {
verifyCopiedDestination: verifyArchivedDeltas,
});
changeArchived = true;
await verifyArchivedDeltas();
await finalizeRetirementBackups(specSnapshots, mainSpecsDir);
} catch (error) {
if (error instanceof MoveDestinationRetainedError) {
changeArchived = true;
try {
await finalizeRetirementBackups(specSnapshots, mainSpecsDir);
} catch (cleanupError) {
throw new RetirementBackupsRetainedError(
`${error.message} ${
cleanupError instanceof Error ? cleanupError.message : String(cleanupError)
}`
);
}
throw error;
}
if (error instanceof RetirementBackupsRetainedError) throw error;
const rollbackErrors: Error[] = [];
try {
await restoreSpecSnapshots(
specSnapshots.filter(({ target }) => mutationAttempts.has(target))
);
} catch (rollbackError) {
rollbackErrors.push(
rollbackError instanceof Error
? rollbackError
: new Error(String(rollbackError))View on GitHub (pinned to 6926ccb18a)