{"record":{"id":"e898914b23cbd4e4","repo":"Fission-AI/OpenSpec","slug":"spec-inputs-for-p-update-id-changed-before-ar","errorCode":null,"errorMessage":"Spec inputs for '${p.update.id}' changed before archive could write them.","messagePattern":"Spec inputs for '(.+?)' changed before archive could write them\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":1748,"sourceCode":"            const writeTotals = { added: 0, modified: 0, removed: 0, renamed: 0 };\n            let wroteAny = false;\n          for (const p of prepared) {\n            // Deletions are deferred to the loop below.\n            if (p.outcome !== 'write') continue;\n            const { added, modified, removed, renamed } = p.counts;\n            if (added + modified + removed + renamed === 0) {\n              // Every operation was already synced: rewriting the file would\n              // only churn normalization differences into it.\n              continue;\n            }\n            await writeUpdatedSpec(p.update, p.rebuilt, p.counts, {\n              silent: json,\n              beforeMutate: async () => {\n                if (\n                  (await fingerprintSpecInputs(p.update)) !==\n                  `${p.sourceFingerprint}\\n${p.targetFingerprint}`\n                ) {\n                  throw new Error(\n                    `Spec inputs for '${p.update.id}' changed before archive could write them.`\n                  );\n                }\n                mutationAttempts.add(p.update.target);\n              },\n              // Cross-root paths must be absolute when a store is selected.\n              ...(isStoreSelectedRoot(root) ? { displayPath: p.update.target } : {}),\n            });\n            wroteAny = true;\n            writeTotals.added += added;\n            writeTotals.modified += modified;\n            writeTotals.removed += removed;\n            writeTotals.renamed += renamed;\n          }\n\n          // Retirements run only after every write has succeeded. If any\n          // later mutation fails, the snapshots below restore every target.\n          for (const p of prepared) {","sourceCodeStart":1730,"sourceCodeEnd":1766,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L1730-L1766","documentation":"Error \"Spec inputs for '${p.update.id}' changed before archive could write them.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:1748 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"}