{"record":{"id":"5c13a7252bda8a22","repo":"nexu-io/open-design","slug":"revision-feedback-is-required","errorCode":null,"errorMessage":"Revision feedback is required","messagePattern":"Revision feedback is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/daemon/src/design-systems/generation-jobs.ts","lineNumber":236,"sourceCode":"        const files = designSystemId ? await listFiles(options.root, designSystemId) : [];\n        setStepMessage(job, 'register-files', `Registered ${files?.length ?? 0} files`);\n      });\n      await runStep(job, 'prepare-review', async () => {\n        await sleep(delayMs);\n        setStepMessage(job, 'prepare-review', 'Review workspace is ready');\n      });\n      completeJob(job, 'succeeded', 'Design system ready for review');\n    } catch (err) {\n      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');","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/apps/daemon/src/design-systems/generation-jobs.ts#L218-L254","documentation":"A design-system revision job needs user feedback describing what to change. cleanFeedback trims and collapses runs of blank lines; if the result is empty the revision cannot be applied, so runRevision throws a plain Error that failJob records on the job. The job transitions to 'failed' with this message.","triggerScenarios":"Submitting a revision job whose input.feedback is empty, whitespace-only, or only newlines. The check at generation-jobs.ts:236 fires before any draft is read.","commonSituations":"UI bug dropping the textarea value before submit; user clicked 'Revise' without typing; programmatic caller passed an empty feedback string.","solutions":["Provide non-empty feedback text describing the desired change.","Validate the feedback field in the UI before submitting the revision job.","If automating, guard input.feedback with a trim().length check."],"exampleFix":"// before\nstartRevision({ designSystemId, feedback: '   ' });\n\n// after\nstartRevision({ designSystemId, feedback: 'Increase body font size to 18px' });","handlingStrategy":"validation","validationCode":"function validateRevisionFeedback(feedback: string): string {\n  const trimmed = (feedback ?? '').trim().replace(/\\n{3,}/g, '\\n\\n');\n  if (!trimmed) throw new Error('Revision feedback is required');\n  return trimmed;\n}\n\nvalidateRevisionFeedback(input.feedback);","typeGuard":"function isNonEmptyFeedback(value: unknown): value is string {\n  return typeof value === 'string' && value.trim().length > 0;\n}","tryCatchPattern":"try {\n  await startRevision({ designSystemId, feedback });\n} catch (err) {\n  if (err instanceof Error && /Revision feedback is required/i.test(err.message)) {\n    // prompt the user for feedback before retrying\n  } else throw err;\n}","preventionTips":["Disable the Revise button until the feedback textarea has non-whitespace content.","Trim and validate feedback on the client before submitting the revision job.","For automated callers, assert input.feedback.trim().length > 0 before invoking the job."],"tags":["design-systems","revision","validation"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}