{"record":{"id":"294793ebe17fb34f","repo":"different-ai/openwork","slug":"healthy-app-version-must-use-the-stable-x-y-z-form","errorCode":null,"errorMessage":"Healthy app version must use the stable x.y.z format.","messagePattern":"Healthy app version must use the stable x\\.y\\.z format\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/recovery.mjs","lineNumber":46,"sourceCode":"  return path.join(app.getPath(\"userData\"), RECOVERY_STATE_FILENAME);\n}\n\nexport async function readRecoveryState(app, distribution) {\n  try {\n    const parsed = JSON.parse(await readFile(statePath(app), \"utf8\"));\n    if (parsed?.distribution !== distribution) return { currentVersion: null, previousVersion: null };\n    return {\n      currentVersion: stableVersion(parsed.currentVersion),\n      previousVersion: stableVersion(parsed.previousVersion),\n    };\n  } catch {\n    return { currentVersion: null, previousVersion: null };\n  }\n}\n\nexport async function recordHealthyVersion(app, distribution, rawVersion) {\n  const version = stableVersion(rawVersion);\n  if (!version) throw new Error(\"Healthy app version must use the stable x.y.z format.\");\n  const previous = await readRecoveryState(app, distribution);\n  const state = {\n    distribution,\n    currentVersion: version,\n    previousVersion: previous.currentVersion && previous.currentVersion !== version\n      ? previous.currentVersion\n      : previous.previousVersion,\n    writtenAt: new Date().toISOString(),\n  };\n  const outputPath = statePath(app);\n  await mkdir(path.dirname(outputPath), { recursive: true });\n  const temporaryPath = `${outputPath}.${process.pid}.tmp`;\n  await writeFile(temporaryPath, `${JSON.stringify(state, null, 2)}\\n`, \"utf8\");\n  await rename(temporaryPath, outputPath);\n  return state;\n}\n\nexport function recoveryManifestName(platform, arch, distribution) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/recovery.mjs#L28-L64","documentation":"Error \"Healthy app version must use the stable x.y.z format.\" thrown in different-ai/openwork.","triggerScenarios":"Thrown at apps/desktop/electron/recovery.mjs:46 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":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}