{"record":{"id":"632bb093b7df9fd6","repo":"pbakaus/impeccable","slug":"concept-seed-platform-must-be-one-of-composit","errorCode":null,"errorMessage":"concept-seed: --platform must be one of ${COMPOSITION_PLATFORMS.join(', ')}","messagePattern":"concept-seed: --platform must be one of (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"plugin/skills/impeccable/scripts/concept-seed.mjs","lineNumber":330,"sourceCode":"  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\n  // Surface scope deals a hand of three grounded structures: one card is not\n  // a choice, and the full ranked list would hand selection back to the\n  // model's taste. The dice pick all three; the primary index leads. The\n  // no-lineup rule stays direction-only, where it was written for worlds.\n  const dealtIndices = [buildIndex];\n  for (let draw = 0; scope === 'surface' && dealtIndices.length < Math.min(3, candidateCount); draw += 1) {\n    const idx = 1 + Math.floor(unit(`${indexSalt}:deal-${draw}`) * candidateCount);\n    if (!dealtIndices.includes(idx)) dealtIndices.push(idx);","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/plugin/skills/impeccable/scripts/concept-seed.mjs#L312-L348","documentation":"Thrown when --platform is provided but is not one of COMPOSITION_PLATFORMS: web, ios, android. Platform is a HARD filter: compositions needing hover/pointer do not degrade on a phone, they are excluded, so an unknown platform value would silently filter nothing. null/undefined means eligible everywhere and is allowed.","triggerScenarios":"Passing --platform with a value like 'desktop', 'mobile', 'tablet', 'mac', 'windows' — none are valid. The check is platform !== null && !COMPOSITION_PLATFORMS.includes(platform).","commonSituations":"Using 'desktop' or 'mobile' (the skill's project-level platform axis uses 'adaptive', but the seeder's platform filter is web/ios/android only); CLI typo.","solutions":["Use exactly one of: --platform web, --platform ios, --platform android.","Omit --platform to keep compositions eligible on all targets."],"exampleFix":"# before\n$ node concept-seed.mjs --scope surface --platform mobile ...\n\n# after\n$ node concept-seed.mjs --scope surface --platform web ...","handlingStrategy":"validation","validationCode":"const COMPOSITION_PLATFORMS = ['web', 'ios', 'android'];\nif (platform != null && !COMPOSITION_PLATFORMS.includes(platform)) {\n  throw new Error(`--platform must be one of: ${COMPOSITION_PLATFORMS.join(', ')}`);\n}","typeGuard":"function isValidPlatform(value) {\n  return value == null || ['web','ios','android'].includes(value);\n}","tryCatchPattern":"try {\n  await seedConcepts({ scope, platform });\n} catch (err) {\n  if (/--platform must be one of/.test(err.message)) {\n    console.error('Use --platform web|ios|android, or omit it.');\n  } else throw err;\n}","preventionTips":["Parse --platform as an enum; reject 'desktop'/'mobile' at the CLI.","Note in docs that platform is a hard filter, not a degradation hint.","Share the COMPOSITION_PLATFORMS constant across CLI, seeder, and validator."],"tags":["concept-seed","validation","platform","cli-args"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}