{"record":{"id":"d93c04fcdd5de04c","repo":"nexu-io/open-design","slug":"editable-design-system-not-found","errorCode":null,"errorMessage":"Editable design system not found","messagePattern":"Editable design system not found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/design-systems/generation-jobs.ts","lineNumber":245,"sourceCode":"      failJob(job, err instanceof Error ? err.message : String(err));\n    }\n  }\n\n  async function runRevision(job: MutableJob, input: DesignSystemRevisionInput): Promise<void> {\n    try {\n      const jobRoot = input.root ?? options.root;\n      markJob(job, 'running', 'Starting revision');\n      const feedback = cleanFeedback(input.feedback);\n      if (!feedback) throw new Error('Revision feedback is required');\n      let body = input.body;\n      let proposedBody = '';\n      await runStep(job, 'read-draft', async () => {\n        if (!body) {\n          body = await readExistingDesignSystem(jobRoot, input.designSystemId, {\n            idPrefix: 'user:',\n          }) ?? undefined;\n        }\n        if (!body) throw new Error('Editable design system not found');\n        setStepMessage(job, 'read-draft', `Loaded ${input.designSystemId}`);\n      });\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,","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/design-systems/generation-jobs.ts#L227-L263","documentation":"The revision job reads the existing DESIGN.md body to apply feedback to. If neither input.body nor the stored design system at input.designSystemId yields a body (readExistingDesignSystem returns null), there is nothing to revise and the 'read-draft' step fails.","triggerScenarios":"runRevision called with a designSystemId whose stored DESIGN.md is missing, deleted, or never written, and no input.body override is supplied. readExistingDesignSystem resolves the design system and returns null.","commonSituations":"Stale designSystemId held by the client after the design system was deleted; imported snapshot without an editable body; daemon data dir moved so the stored file is unreachable; permissions issue reading the file.","solutions":["Verify the design system ID still exists in the design-systems list.","Re-open the design system from the current list to refresh the ID.","If the source is an import-only snapshot, generate a fresh editable draft instead of revising.","Check the daemon data dir is intact and readable."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const existing = await readDesignSystem(root, designSystemId, { idPrefix: 'user:' });\nif (!existing) {\n  throw new Error(`Design system ${designSystemId} has no editable body; cannot revise.`);\n}\nawait startRevision({ designSystemId, root });","typeGuard":"async function designSystemHasEditableBody(root: string, id: string): Promise<boolean> {\n  const body = await readDesignSystem(root, id, { idPrefix: 'user:' });\n  return typeof body === 'string' && body.trim().length > 0;\n}","tryCatchPattern":"try {\n  await startRevision({ designSystemId, root });\n} catch (err) {\n  if (err instanceof Error && /Editable design system not found/i.test(err.message)) {\n    // refresh the design-system list and have the user re-open it\n  } else throw err;\n}","preventionTips":["Refresh the designSystemId from the current design-system list before opening the revision flow.","Do not offer 'Revise' on import-only snapshots that lack an editable DESIGN.md.","Confirm the daemon data dir is intact so stored design systems remain readable."],"tags":["design-systems","revision","storage"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}