{"record":{"id":"2c96678d1a85dfdf","repo":"Fission-AI/OpenSpec","slug":"could-not-track-the-displaced-main-spec-for-p-u","errorCode":null,"errorMessage":"Could not track the displaced main spec for '${p.update.id}' during retirement.","messagePattern":"Could not track the displaced main spec for '(.+?)' during retirement\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":1814,"sourceCode":"                    changeDir,\n                    retirementAuthorizationFingerprint!\n                  );\n                  if (\n                    (await fingerprintMovablePath(displacedPath)) !==\n                    p.targetMovableFingerprint\n                  ) {\n                    throw new Error(\n                      `Main spec '${p.update.id}' changed while archive was securing it for retirement.`\n                    );\n                  }\n                },\n                ...(isStoreSelectedRoot(root) ? { displayPath: p.update.target } : {}),\n              }\n            );\n            if (!retired) continue;\n            const retirementSnapshot = specSnapshotsByTarget.get(p.update.target);\n            if (retirementSnapshot === undefined || displacedPath === undefined) {\n              throw new Error(\n                `Could not track the displaced main spec for '${p.update.id}' during retirement.`\n              );\n            }\n            retirementSnapshot.displacedPath = displacedPath;\n            retirementSnapshot.displacedFingerprint = p.targetMovableFingerprint;\n            wroteAny = true;\n            // A rename applied on the way to the retirement still happened;\n            // folding every count in keeps the totals honest about the whole\n            // delta.\n            writeTotals.added += p.counts.added;\n            writeTotals.modified += p.counts.modified;\n            writeTotals.removed += p.counts.removed;\n            writeTotals.renamed += p.counts.renamed;\n            // Deleting a file is the one archive outcome a JSON consumer cannot\n            // infer from the totals, so it is recorded the way every other\n            // spec-merge divergence is. Purpose always goes with the file, so it\n            // is named too rather than left to the reader to work out, and the\n            // note carries the command that brings the file back.","sourceCodeStart":1796,"sourceCodeEnd":1832,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L1796-L1832","documentation":"Error \"Could not track the displaced main spec for '${p.update.id}' during retirement.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:1814 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"}