{"record":{"id":"134d80db8a6d53de","repo":"Fission-AI/OpenSpec","slug":"the-metadata-filename-retirement-authorization","errorCode":null,"errorMessage":"The ${METADATA_FILENAME} retirement authorization changed before archive could complete.","messagePattern":"The (.+?) retirement authorization changed before archive could complete\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/core/archive.ts","lineNumber":809,"sourceCode":"}\n\n/** Fail closed if the metadata authorizing a retirement leaves its snapshot. */\nasync function assertRetirementAuthorization(\n  changeDir: string,\n  expectedFingerprint: string,\n  options: { verifyMarker?: boolean } = {}\n): Promise<void> {\n  const metadataPath = path.join(changeDir, METADATA_FILENAME);\n  const before = await fingerprintPortableContent(metadataPath);\n  const markerStillDeclared =\n    options.verifyMarker === false || readRetireCapabilitiesMarker(changeDir).declared;\n  const after = await fingerprintPortableContent(metadataPath);\n  if (\n    before !== expectedFingerprint ||\n    after !== expectedFingerprint ||\n    !markerStillDeclared\n  ) {\n    throw new Error(\n      `The ${METADATA_FILENAME} retirement authorization changed before archive could complete.`\n    );\n  }\n}\n\nasync function fingerprintSpecInputs(update: SpecUpdate): Promise<string> {\n  return `${await fingerprintPath(update.source)}\\n${await fingerprintPath(update.target)}`;\n}\n\nasync function mutationTargetIdentity(mutation: SpecMutation): Promise<string> {\n  try {\n    const stat = await fs.stat(mutation.update.target, { bigint: true });\n    return `${stat.dev}:${stat.ino}`;\n  } catch (error) {\n    if ((error as NodeJS.ErrnoException).code === 'ENOENT') {\n      const parent = path.dirname(mutation.update.target);\n      const realParent = await fs.realpath(parent).catch(() => path.resolve(parent));\n      return `missing:${path.join(realParent, path.basename(mutation.update.target))}`;","sourceCodeStart":791,"sourceCodeEnd":827,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/archive.ts#L791-L827","documentation":"Error \"The ${METADATA_FILENAME} retirement authorization changed before archive could complete.\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/archive.ts:809 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"}