{"record":{"id":"5b372ebe09fcb79c","repo":"pbakaus/impeccable","slug":"concept-seed-register-steers-a-re-roll-round-p-5b372e","errorCode":null,"errorMessage":"concept-seed: --register steers a re-roll round; pass --reroll <n> with it","messagePattern":"concept-seed: --register steers a re-roll round; pass --reroll <n> with it","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/concept-seed.mjs","lineNumber":316,"sourceCode":"  register = null,\n  mode = null,\n  grain = null,\n  platform = null,\n  candidateCount = 7,\n  catalogDir = CATALOG_DIR,\n  _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  }","sourceCodeStart":298,"sourceCodeEnd":334,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/concept-seed.mjs#L298-L334","documentation":"Thrown when `register` is set but `reroll` is less than 1. Register only has meaning on a re-roll round (reroll >= 1) — it steers an existing hand toward safer/bolder. Using it on the base round (reroll 0) is meaningless, so the function refuses rather than silently ignoring the flag.","triggerScenarios":"Passing register='safer' with reroll=0 (the default); passing register with reroll omitted entirely; a caller that sets register conditionally but always leaves reroll at 0.","commonSituations":"A user who wants 'a safer seed' but forgets they must be re-rolling; wiring register to a UI toggle without also wiring reroll.","solutions":["When using register, also pass reroll >= 1.","If you do not want a re-roll, drop the register argument entirely."],"exampleFix":"// before\nawait seedConcepts({ scope: 'direction', register: 'safer' }); // reroll defaults to 0 -> throws\n\n// after\nawait seedConcepts({ scope: 'direction', reroll: 1, register: 'safer' });","handlingStrategy":"validation","validationCode":"// Enforce the register+reroll precondition together.\nfunction validateRegisterUse({ register, reroll }) {\n  if (register != null && (!Number.isInteger(reroll) || reroll < 1)) {\n    throw new Error('register requires reroll >= 1');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --register with --reroll <n> where n >= 1.","If you do not want a re-roll, omit register.","Wire register and reroll together in UIs so one cannot be set without the other."],"tags":["validation","concept-seed","cli","preconditions"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}