{"record":{"id":"62393d2aa742660a","repo":"nexu-io/open-design","slug":"could-not-create-revision","errorCode":null,"errorMessage":"Could not create revision","messagePattern":"Could not create revision","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/design-systems/generation-jobs.ts","lineNumber":265,"sourceCode":"      });\n      await runStep(job, 'apply-feedback', async () => {\n        await sleep(delayMs);\n        proposedBody = applyRevisionToBody(body ?? '', {\n          feedback,\n          ...(input.sectionTitle ? { sectionTitle: input.sectionTitle } : {}),\n        });\n        setStepMessage(job, 'apply-feedback', input.sectionTitle ? `Updated ${input.sectionTitle}` : 'Updated DESIGN.md');\n      });\n      await runStep(job, 'create-revision', async () => {\n        if (!body) throw new Error('Editable design system not found');\n        const revision = await createRevision(jobRoot, input.designSystemId, {\n          feedback,\n          baseBody: body,\n          proposedBody,\n          ...(input.sectionTitle ? { sectionTitle: input.sectionTitle } : {}),\n          jobId: job.id,\n        });\n        if (!revision) throw new Error('Could not create revision');\n        job.revisionId = revision.id;\n        setStepMessage(job, 'create-revision', `Created pending revision ${revision.id}`);\n      });\n      await runStep(job, 'prepare-review', async () => {\n        await sleep(delayMs);\n        setStepMessage(job, 'prepare-review', 'Updated review is ready');\n      });\n      completeJob(job, 'succeeded', 'Revision ready for review');\n    } catch (err) {\n      failJob(job, err instanceof Error ? err.message : String(err));\n    }\n  }\n\n  async function runTokenContractRebuild(\n    job: MutableJob,\n    input: DesignSystemTokenContractRebuildInput,\n  ): Promise<void> {\n    try {","sourceCodeStart":247,"sourceCodeEnd":283,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/design-systems/generation-jobs.ts#L247-L283","documentation":"createRevision (createUserDesignSystemRevision) returned null, meaning the revision writer could not persist a new revision record for the design system. The 'create-revision' step wraps this as a job failure. Causes include the design system directory being removed between read-draft and create-revision, a write conflict, or storage failure.","triggerScenarios":"runRevision reaches create-revision with a valid body and proposedBody, but createRevision returns null. Typical when the design system's directory disappeared mid-job, a slug/id collision occurs, or the revision store refuses the write.","commonSituations":"Race between two revision jobs on the same design system; daemon data dir permissions or disk-full; the design system was deleted after the draft was read.","solutions":["Retry the revision once the design system state is stable.","Confirm the design system still exists before retrying.","Check daemon data dir permissions and free disk space.","Avoid running concurrent revisions against the same design system."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"null","typeGuard":"null","tryCatchPattern":"try {\n  await startRevision({ designSystemId, root });\n} catch (err) {\n  if (err instanceof Error && /Could not create revision/i.test(err.message)) {\n    // verify the design system still exists, then retry once\n  } else throw err;\n}","preventionTips":["Prevent concurrent revision jobs against the same design system to avoid write races.","Keep the daemon data dir writable with adequate free space.","Re-confirm the design system exists immediately before retrying a failed revision."],"tags":["design-systems","revision","storage","race"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}