{"record":{"id":"cf807a899e12318a","repo":"Fission-AI/OpenSpec","slug":"the-metadata-filename-retirement-authorization-cf807a","errorCode":null,"errorMessage":"The ${METADATA_FILENAME} retirement authorization is unavailable.","messagePattern":"The (.+?) retirement authorization is unavailable\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":1776,"sourceCode":"            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) {\n            if (p.outcome !== 'retire') continue;\n            const { retired, resolvedPath, displacedPath } = await retireSpec(\n              p.update,\n              mainSpecsDir,\n              {\n                silent: json,\n                deferDelete: true,\n                beforeMutate: async () => {\n                  if (retirementAuthorizationFingerprint === undefined) {\n                    throw new Error(\n                      `The ${METADATA_FILENAME} retirement authorization is unavailable.`\n                    );\n                  }\n                  await assertRetirementAuthorization(\n                    changeDir,\n                    retirementAuthorizationFingerprint\n                  );\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 retire them.`\n                    );\n                  }\n                  mutationAttempts.add(p.update.target);\n                },\n                verifyDisplaced: async (displacedPath) => {","sourceCodeStart":1758,"sourceCodeEnd":1794,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L1758-L1794","documentation":"Guard thrown in the retirement phase's beforeMutate hook when the captured retirement authorization fingerprint is undefined — i.e. no fingerprint of the change.json retirement section was recorded earlier (a preparation invariant was skipped or lost). Retiring requirements requires that authorization baseline, so retirement cannot proceed safely without it.","triggerScenarios":"Thrown at src/core/archive.ts:1776 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the archive so the retirement authorization is captured","Ensure .openspec.yaml is readable and stable during the archive"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","contentChangedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}