{"record":{"id":"e0cdc50f4bdf93d0","repo":"Fission-AI/OpenSpec","slug":"directory-changed-while-archive-was-reading-dir","errorCode":null,"errorMessage":"Directory changed while archive was reading ${dir}.","messagePattern":"Directory changed while archive was reading (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":442,"sourceCode":"      } else if (stat.isFile()) {\n        const contentFingerprint = await fingerprintFile(entryPath);\n        const after = await fs.lstat(entryPath, { bigint: true });\n        if (statIdentity(stat) !== statIdentity(after)) {\n          throw new Error(`Path changed while archive was reading ${entryPath}.`);\n        }\n        updateHashField('type', 'file');\n        updateHashField('mode', (stat.mode & 0o7777n).toString());\n        updateHashField('content-sha256', contentFingerprint);\n      } else {\n        updateHashField('type', 'other');\n        updateHashField('mode', stat.mode.toString());\n        updateHashField('size', stat.size.toString());\n      }\n    }\n\n    const after = await fs.lstat(dir, { bigint: true });\n    if (statIdentity(before) !== statIdentity(after)) {\n      throw new Error(`Directory changed while archive was reading ${dir}.`);\n    }\n  };\n\n  await visit(root, '');\n  return hash.digest('hex');\n}\n\nasync function assertCopiedDirectoryUnchanged(\n  stagedSource: string,\n  destination: string,\n  expectedFingerprint: string\n): Promise<void> {\n  const sourceFingerprint = await fingerprintDirectoryContents(stagedSource);\n  const destinationFingerprint = await fingerprintDirectoryContents(destination);\n  if (\n    sourceFingerprint !== expectedFingerprint ||\n    destinationFingerprint !== expectedFingerprint\n  ) {","sourceCodeStart":424,"sourceCodeEnd":460,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L424-L460","documentation":"Error \"Directory changed while archive was reading ${dir}.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:442 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"}