{"record":{"id":"33e05456c679e979","repo":"Yeachan-Heo/oh-my-codex","slug":"autoresearch-candidate-artifact-description-is-req","errorCode":null,"errorMessage":"autoresearch candidate artifact description is required","messagePattern":"autoresearch candidate artifact description is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/autoresearch/runtime.ts","lineNumber":1042,"sourceCode":"  } catch {\n    throw new Error('autoresearch candidate artifact must be valid JSON');\n  }\n  if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {\n    throw new Error('autoresearch candidate artifact must be a JSON object');\n  }\n  const record = parsed as Record<string, unknown>;\n  const status = record.status;\n  if (status !== 'candidate' && status !== 'noop' && status !== 'abort' && status !== 'interrupted') {\n    throw new Error('autoresearch candidate artifact status must be candidate|noop|abort|interrupted');\n  }\n  if (record.candidate_commit !== null && typeof record.candidate_commit !== 'string') {\n    throw new Error('autoresearch candidate artifact candidate_commit must be string|null');\n  }\n  if (typeof record.base_commit !== 'string' || !record.base_commit.trim()) {\n    throw new Error('autoresearch candidate artifact base_commit is required');\n  }\n  if (typeof record.description !== 'string') {\n    throw new Error('autoresearch candidate artifact description is required');\n  }\n  if (!Array.isArray(record.notes) || record.notes.some((note) => typeof note !== 'string')) {\n    throw new Error('autoresearch candidate artifact notes must be a string array');\n  }\n  if (typeof record.created_at !== 'string' || !record.created_at.trim()) {\n    throw new Error('autoresearch candidate artifact created_at is required');\n  }\n  return {\n    status,\n    candidate_commit: record.candidate_commit,\n    base_commit: record.base_commit,\n    description: record.description,\n    notes: record.notes,\n    created_at: record.created_at,\n  };\n}\n\nasync function readCandidateArtifact(candidateFile: string): Promise<AutoresearchCandidateArtifact> {","sourceCodeStart":1024,"sourceCodeEnd":1060,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/autoresearch/runtime.ts#L1024-L1060","documentation":"The required description field must be present and a string. It carries the human-readable summary of what the candidate change does.","triggerScenarios":"A worker omitting description entirely, or emitting it as a non-string (number, object, null) — commonly when the model returns the summary only in prose outside the JSON artifact.","commonSituations":"Models putting the description in surrounding text instead of the JSON, template branches that skip description for noop/abort statuses even though it is required, or description: null placeholders.","solutions":["Always include a non-null string description in the artifact, even for noop/abort (e.g. 'no change needed')","Update the worker prompt/template with a full example artifact showing description populated on every status","Validate required fields in the worker harness before writing the artifact file"],"exampleFix":"// before\n{\"status\":\"noop\",\"base_commit\":\"abc\",\"candidate_commit\":null,\"notes\":[]}\n// after\n{\"status\":\"noop\",\"base_commit\":\"abc\",\"candidate_commit\":null,\"description\":\"no change required\",\"notes\":[]}","handlingStrategy":"validation","validationCode":"const parsed = JSON.parse(raw) as Record<string, unknown>;\nif (typeof parsed.description !== 'string' || parsed.description.length === 0) {\n  throw new Error('artifact description missing; worker must summarize the change');\n}","typeGuard":"function hasDescription(v: unknown): v is { description: string } {\n  return typeof v === 'object' && v !== null && typeof (v as any).description === 'string';\n}","tryCatchPattern":"try { const a = parseAutoresearchCandidateArtifact(raw); }\ncatch (e) { if (e instanceof Error && e.message.includes('description is required')) { /* add a string summary, e.g. 'no change required', and retry */ } throw e; }","preventionTips":["Require a description string on every status branch, including noop/abort","Provide a full example artifact in the worker prompt","Validate required fields in the harness before writing the artifact file"],"tags":["autoresearch","required-field","description","artifact"],"backgroundTag":"required-field-missing","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}