{"record":{"id":"923d30f684409850","repo":"pbakaus/impeccable","slug":"concept-seed-mode-must-be-persuade-operate-re","errorCode":null,"errorMessage":"concept-seed: --mode must be persuade, operate, read, or experience","messagePattern":"concept-seed: --mode must be persuade, operate, read, or experience","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/scripts/concept-seed.mjs","lineNumber":322,"sourceCode":"  _resolvedData = undefined,\n} = {}) {\n  if (scope !== 'surface' && scope !== 'direction') {\n    throw new Error('concept-seed: --scope must be direction or surface');\n  }\n  if (!Number.isInteger(reroll) || reroll < 0) {\n    throw new Error('concept-seed: --reroll must be a non-negative integer');\n  }\n  if (register !== null && register !== 'safer' && register !== 'bolder') {\n    throw new Error('concept-seed: --register must be safer or bolder');\n  }\n  if (register !== null && reroll < 1) {\n    throw new Error('concept-seed: --register steers a re-roll round; pass --reroll <n> with it');\n  }\n  if (register !== null && scope !== 'direction') {\n    throw new Error('concept-seed: --register applies to direction rounds only');\n  }\n  if (mode !== null && !SEED_MODES.has(mode)) {\n    throw new Error('concept-seed: --mode must be persuade, operate, read, or experience');\n  }\n  // Grain needs no mode: how much of the product is in play is independent of\n  // which register of work it is.\n  if (grain !== null && !COMPOSITION_GRAINS.includes(grain)) {\n    throw new Error(`concept-seed: --grain must be one of ${COMPOSITION_GRAINS.join(', ')}`);\n  }\n  if (platform !== null && !COMPOSITION_PLATFORMS.includes(platform)) {\n    throw new Error(`concept-seed: --platform must be one of ${COMPOSITION_PLATFORMS.join(', ')}`);\n  }\n  if (!Number.isInteger(candidateCount) || candidateCount < 5 || candidateCount > 7) {\n    throw new Error('concept-seed: --candidate-count must be an integer from 5 to 7');\n  }\n  const unit = (salt) => {\n    const h = crypto.createHash('sha256').update(`${scope}:${salt}:${key}`).digest();\n    return h.readUInt32BE(0) / 0xffffffff;\n  };\n  const indexSalt = reroll === 0 ? 'index' : `index:reroll-${reroll}`;\n  const buildIndex = 3 + Math.floor(unit(indexSalt) * (candidateCount - 2)); // 3..candidateCount","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/plugin/skills/impeccable/scripts/concept-seed.mjs#L304-L340","documentation":"Thrown when --mode is provided but is not one of the four SEED_MODES: persuade, operate, read, experience. Mode names the register of work the requested surface belongs to so appended compositions match; null/undefined means roll from the full approved pool and is allowed.","triggerScenarios":"Passing --mode with a typo or unsupported value ('reading', 'operational', 'sales', 'marketing'). The check is mode !== null && !SEED_MODES.has(mode), where SEED_MODES = {persuade, operate, read, experience}.","commonSituations":"CLI typo; a wrapper using a domain term instead of the four canonical modes; an outdated caller from before the mode set was fixed.","solutions":["Use exactly one of: --mode persuade, --mode operate, --mode read, --mode experience.","Omit --mode to roll compositions from the full approved pool."],"exampleFix":"# before\n$ node concept-seed.mjs --scope surface --mode reading ...\n\n# after\n$ node concept-seed.mjs --scope surface --mode read ...","handlingStrategy":"validation","validationCode":"const SEED_MODES = new Set(['persuade', 'operate', 'read', 'experience']);\nif (mode != null && !SEED_MODES.has(mode)) {\n  throw new Error(`--mode must be one of: ${[...SEED_MODES].join(', ')}`);\n}","typeGuard":"function isValidMode(value) {\n  return value == null || ['persuade','operate','read','experience'].includes(value);\n}","tryCatchPattern":"try {\n  await seedConcepts({ scope, mode });\n} catch (err) {\n  if (/--mode must be/.test(err.message)) {\n    console.error('Use --mode persuade|operate|read|experience, or omit it.');\n  } else throw err;\n}","preventionTips":["Parse --mode as an enum at the CLI boundary.","Document the four canonical modes; note that omitting is valid (full pool).","Share the SEED_MODES set between CLI parsing, the seeder, and the validator."],"tags":["concept-seed","validation","mode","cli-args"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}