Fission-AI/OpenSpec · error · Error
Could not restore the staged source at ( ).
Error message
${copyError instanceof Error ? copyError.message : String(copyError)} Could not restore the staged source at ${stagedSource} (${restoreError instanceof Error ? restoreError.message : String(restoreError)}). What it means
Fallback-copy failure report: the staged copy to the destination failed and restoring the staged source back to its original location also failed; both error messages are included and the staged directory may need manual recovery.
Solutions
- Check both error parts: the copy failure and the staged-source restore failure
- Free disk space / release locks, then re-run; investigate the staged .openspec-move-* directory manually if it remains
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at src/core/archive.ts:523 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/d7a4a6a434011fe1.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/archive.ts:523
);
}
let destIsOurs = false;
let stagedFingerprint: string;
try {
stagedFingerprint = await fingerprintDirectoryContents(stagedSource);
await fs.mkdir(dest, { mode: 0o700 });
destIsOurs = true;
await copyDirContents(stagedSource, dest);
await options.verifyCopiedDestination?.(stagedSource);
await assertCopiedDirectoryUnchanged(stagedSource, dest, stagedFingerprint);
} catch (copyError) {
if (destIsOurs) {
await fs.rm(dest, { recursive: true, force: true }).catch(() => undefined);
}
try {
await fs.rename(stagedSource, src);
} catch (restoreError) {
throw new Error(
`${copyError instanceof Error ? copyError.message : String(copyError)} ` +
`Could not restore the staged source at ${stagedSource} ` +
`(${restoreError instanceof Error ? restoreError.message : String(restoreError)}).`
);
}
if ((copyError as NodeJS.ErrnoException).code === 'EEXIST') {
throw new ArchiveBlockedError(
'archive_target_exists',
`Archive '${path.basename(dest)}' already exists.`
);
}
throw copyError;
}
try {
await options.verifyCopiedDestination?.(stagedSource);
await assertCopiedDirectoryUnchanged(stagedSource, dest, stagedFingerprint);
} catch (verificationError) {
await fs.rm(dest, { recursive: true, force: true }).catch(() => undefined);View on GitHub (pinned to 6926ccb18a)