{"record":{"id":"a05e77a3b3859555","repo":"pbakaus/impeccable","slug":"concept-seed-register-steers-a-re-roll-round-p","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":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/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/plugin/skills/impeccable/scripts/concept-seed.mjs#L298-L334","documentation":"Thrown when --register is set but --reroll is less than 1. Registers only apply to re-roll rounds (they steer what a non-first round instructs), so passing a register on round 0 is meaningless and rejected. This guards against silently ignoring the flag.","triggerScenarios":"Passing --register safer|bolder together with --reroll 0 (or omitting --reroll, which defaults to 0). The guard is register !== null && reroll < 1.","commonSituations":"User wants steering on the first round; forgetting that register is a re-roll-only concept; a UI that exposes both controls independently.","solutions":["Pair --register with --reroll >= 1 (e.g. --reroll 1 --register bolder).","If you want steering on the first draw, note that registers are defined only for re-roll rounds; rerun the base key at --reroll 1 instead."],"exampleFix":"# before\n$ node concept-seed.mjs --scope direction --register bolder ...\n# (reroll defaults to 0)\n\n# after\n$ node concept-seed.mjs --scope direction --reroll 1 --register bolder ...","handlingStrategy":"validation","validationCode":"if (register != null && !(Number.isInteger(reroll) && reroll >= 1)) {\n  throw new Error('--register requires --reroll >= 1');\n}","typeGuard":"function registerRerollPairValid(register, reroll) {\n  return register == null || (Number.isInteger(reroll) && reroll >= 1);\n}","tryCatchPattern":"try {\n  await seedConcepts({ scope: 'direction', register, reroll });\n} catch (err) {\n  if (/register steers a re-roll round/.test(err.message)) {\n    console.error('Pair --register with --reroll >= 1.');\n  } else throw err;\n}","preventionTips":["In the CLI, auto-suggest --reroll 1 when --register is given without it.","Document that register is a re-roll-only concept near the --register flag help.","Validate the register+reroll pair at the CLI boundary before calling the seeder."],"tags":["concept-seed","validation","register","reroll","cli-args"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}