{"record":{"id":"36cc6199e4a46382","repo":"eyaltoledano/claude-task-master","slug":"invalid-strength-level-strength-must-be-one-o","errorCode":null,"errorMessage":"Invalid strength level: ${strength}. Must be one of: ${VALID_STRENGTHS.join(', ')}","messagePattern":"Invalid strength level: (.+?)\\. Must be one of: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/scope-adjustment.js","lineNumber":620,"sourceCode":" * @param {string} tasksPath - Path to tasks.json file\n * @param {Array<number>} taskIds - Array of task IDs to scope up\n * @param {string} strength - Strength level ('light', 'regular', 'heavy')\n * @param {string} customPrompt - Optional custom instructions\n * @param {Object} context - Context object with projectRoot, tag, etc.\n * @param {string} outputFormat - Output format ('text' or 'json')\n * @returns {Promise<Object>} Results of the scope-up operation\n */\nexport async function scopeUpTask(\n\ttasksPath,\n\ttaskIds,\n\tstrength = 'regular',\n\tcustomPrompt = null,\n\tcontext = {},\n\toutputFormat = 'text'\n) {\n\t// Validate inputs\n\tif (!validateStrength(strength)) {\n\t\tthrow new Error(\n\t\t\t`Invalid strength level: ${strength}. Must be one of: ${VALID_STRENGTHS.join(', ')}`\n\t\t);\n\t}\n\n\tconst { projectRoot = '.', tag = 'master' } = context;\n\n\t// Read tasks data\n\tconst data = readJSON(tasksPath, projectRoot, tag);\n\tconst tasks = data?.tasks || [];\n\n\t// Validate all task IDs exist\n\tfor (const taskId of taskIds) {\n\t\tif (!taskExists(tasks, taskId)) {\n\t\t\tthrow new Error(`Task with ID ${taskId} not found`);\n\t\t}\n\t}\n\n\tconst updatedTasks = [];","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/scope-adjustment.js#L602-L638","documentation":"scopeUpTask() validates its strength parameter against VALID_STRENGTHS before doing anything. Strength controls how aggressively the AI expands the task; anything outside the allowed set (e.g. 'extreme', 3, undefined) is rejected up front with a message listing the accepted values.","triggerScenarios":"Calling scopeUpTask(taskIds, strength) with a misspelled strength like 'higer', an out-of-range value like 'medium-plus', a numeric instead of string value, or forgetting the argument so strength is undefined.","commonSituations":"Custom scripts written against an older API where strengths differed, guessing values without checking docs, dynamic UIs passing raw user input unvalidated, or CLI flag typos (--strenght).","solutions":["Use one of the documented VALID_STRENGTHS values exactly as listed in the error message (check the exported VALID_STRENGTHS constant in scope-adjustment.js).","If the value comes from user input or config, whitelist-validate it: if (!VALID_STRENGTHS.includes(strength)) fallback to a default.","Check for typos and case sensitivity — values are compared exactly, not case-insensitively.","Ensure you are passing the strength in the correct positional argument order: (taskIds, strength, customPrompt, context, outputFormat)."],"exampleFix":"// before\nawait scopeUpTask([5], 'extreme');\n// after\nawait scopeUpTask([5], 'intense'); // must be one of VALID_STRENGTHS, e.g. 'gentle' | 'regular' | 'intense'","handlingStrategy":"validation","validationCode":"const VALID_STRENGTHS = ['gentle', 'regular', 'intense']; // see scope-adjustment.js export\nif (!VALID_STRENGTHS.includes(strength)) {\n  throw new Error(`strength must be one of ${VALID_STRENGTHS.join(', ')}, got: ${JSON.stringify(strength)}`);\n}\nawait scopeUpTask(taskIds, strength);","typeGuard":"function isValidStrength(v) {\n  return typeof v === 'string' && ['gentle', 'regular', 'intense'].includes(v);\n}","tryCatchPattern":"try {\n  await scopeUpTask([taskId], strength);\n} catch (err) {\n  if (err.message.includes('Invalid strength level')) {\n    console.error(`'${strength}' is not supported. Allowed: check VALID_STRENGTHS in scope-adjustment.js`);\n  } else throw err;\n}","preventionTips":["Import and reuse the exported VALID_STRENGTHS constant instead of hardcoding strings","Validate user/config-supplied strength values against the whitelist before calling","Match case and spelling exactly; trim whitespace from inputs","Double-check positional argument order: (taskIds, strength, ...)"],"tags":["validation","invalid-argument","api-misuse"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}