{"record":{"id":"6e9b07e8c6603bbe","repo":"affaan-m/ECC","slug":"task-description-is-required","errorCode":null,"errorMessage":"task_description is required","messagePattern":"task_description is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/skill-evolution/tracker.js","lineNumber":66,"sourceCode":"  }\n\n  const skillId = input.skill_id || input.skillId;\n  const skillVersion = input.skill_version || input.skillVersion;\n  const taskDescription = input.task_description || input.task_attempted || input.taskAttempted;\n  const outcome = input.outcome;\n  const recordedAt = input.recorded_at || options.now || new Date().toISOString();\n  const userFeedback = input.user_feedback || input.userFeedback || null;\n\n  if (typeof skillId !== 'string' || skillId.trim().length === 0) {\n    throw new Error('skill_id is required');\n  }\n\n  if (typeof skillVersion !== 'string' || skillVersion.trim().length === 0) {\n    throw new Error('skill_version is required');\n  }\n\n  if (typeof taskDescription !== 'string' || taskDescription.trim().length === 0) {\n    throw new Error('task_description is required');\n  }\n\n  if (!VALID_OUTCOMES.has(outcome)) {\n    throw new Error('outcome must be one of success, failure, or partial');\n  }\n\n  if (userFeedback !== null && !VALID_FEEDBACK.has(userFeedback)) {\n    throw new Error('user_feedback must be accepted, corrected, rejected, or null');\n  }\n\n  if (Number.isNaN(Date.parse(recordedAt))) {\n    throw new Error('recorded_at must be an ISO timestamp');\n  }\n\n  return {\n    skill_id: skillId,\n    skill_version: skillVersion,\n    task_description: taskDescription,","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/skill-evolution/tracker.js#L48-L84","documentation":"normalizeExecutionRecord in scripts/lib/skill-evolution/tracker.js validates every field of an execution record before persisting it. It throws 'task_description is required' when the taskDescription argument is not a non-empty string (missing, non-string, or whitespace-only). The library refuses to record executions without a human-readable description of the task performed.","triggerScenarios":"Calling record() (or normalizeExecutionRecord directly) with taskDescription undefined/null, with a non-string value (e.g. an object from a parsed options bag), or with a whitespace-only string like '' or '   '.","commonSituations":"Hook scripts building the record from CLI args or env vars that omit --task-description; programmatically constructing the record object and forgetting the field; upstream tools that pass structured task metadata instead of a string; templated scripts where the placeholder was never filled in.","solutions":["Pass a non-empty descriptive string as the taskDescription argument to record()/normalizeExecutionRecord.","If the value comes from CLI/env/config, default or trim it before calling: (raw ?? '').trim() and fall back to a meaningful label if empty.","If a structured object was passed by mistake, serialize the relevant fields to a string first (e.g. JSON.stringify or a formatter)."],"exampleFix":"// before\ntracker.record({ skillId, skillVersion, taskDescription: undefined, outcome: 'success' });\n\n// after\nconst taskDescription = (process.argv.find(a => a.startsWith('--task='))?.slice(7) ?? 'unspecified task').trim();\ntracker.record({ skillId, skillVersion, taskDescription, outcome: 'success' });","handlingStrategy":"validation","validationCode":"function assertTaskDescription(taskDescription) {\n  if (typeof taskDescription !== 'string' || taskDescription.trim().length === 0) {\n    throw new Error('task_description must be a non-empty string before calling record()');\n  }\n}","typeGuard":"function hasTaskDescription(v) {\n  return typeof v === 'string' && v.trim().length > 0;\n}","tryCatchPattern":"try {\n  tracker.record(record);\n} catch (err) {\n  if (err.message === 'task_description is required') {\n    console.error('Execution record missing task_description; supply a non-empty string describing the task.');\n    process.exitCode = 1;\n    return;\n  }\n  throw err;\n}","preventionTips":["Build execution records through a single factory function that requires and trims taskDescription.","Default missing descriptions to a derived label (e.g. the skill name plus command) instead of letting undefined through.","Trim user-supplied text so whitespace-only input cannot slip through."],"tags":["validation","required-field","skill-evolution"],"backgroundTag":"empty-required-field","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}