{"record":{"id":"d802e4ee4be752ba","repo":"Fission-AI/OpenSpec","slug":"verificationerror-instanceof-error-verificatio","errorCode":null,"errorMessage":"${verificationError instanceof Error ? verificationError.message : String(verificationError)} Could not restore the staged source at ${stagedSource} (${restoreError instanceof Error ? restoreError.message : String(restoreError)}).","messagePattern":"(.+?) Could not restore the staged source at (.+?) \\((.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":545,"sourceCode":"          );\n        }\n        if ((copyError as NodeJS.ErrnoException).code === 'EEXIST') {\n          throw new ArchiveBlockedError(\n            'archive_target_exists',\n            `Archive '${path.basename(dest)}' already exists.`\n          );\n        }\n        throw copyError;\n      }\n      try {\n        await options.verifyCopiedDestination?.(stagedSource);\n        await assertCopiedDirectoryUnchanged(stagedSource, dest, stagedFingerprint);\n      } catch (verificationError) {\n        await fs.rm(dest, { recursive: true, force: true }).catch(() => undefined);\n        try {\n          await fs.rename(stagedSource, src);\n        } catch (restoreError) {\n          throw new Error(\n            `${verificationError instanceof Error ? verificationError.message : String(verificationError)} ` +\n              `Could not restore the staged source at ${stagedSource} ` +\n              `(${restoreError instanceof Error ? restoreError.message : String(restoreError)}).`\n          );\n        }\n        throw verificationError;\n      }\n      try {\n        await fs.rm(stagedSource, { recursive: true, force: true });\n      } catch (cleanupError) {\n        // Recursive removal may already have deleted part of the source. The\n        // destination is now the only complete copy, so never erase it while\n        // trying to make this failed move look atomic.\n        throw new MoveDestinationRetainedError(\n          `Copied ${src} to ${dest}, but could not remove the staged source at ` +\n            `${stagedSource} completely ` +\n            `(${cleanupError instanceof Error ? cleanupError.message : String(cleanupError)}). ` +\n            'The complete destination was retained for recovery.'","sourceCodeStart":527,"sourceCodeEnd":563,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L527-L563","documentation":"Error \"${verificationError instanceof Error ? verificationError.message : String(verificationError)} Could not restore the staged source at ${stagedSource} (${restoreError instanceof Error ? restoreError.message : String(restoreError)}).\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:545 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}