{"record":{"id":"21cc1d99e761e1fd","repo":"pbakaus/impeccable","slug":"concept-seed-every-challenger-tier-needs-at-least-21cc1d","errorCode":null,"errorMessage":"concept-seed: every challenger tier needs at least one approved concept","messagePattern":"concept-seed: every challenger tier needs at least one approved concept","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skill/scripts/lib/roll-selection.mjs","lineNumber":170,"sourceCode":"\nexport function* selectApprovedChallengers({ scope, key, reroll = 0, minRating = null, mode = null, concepts }) {\n  const approved = concepts.filter(concept => concept.status === 'approved');\n  // Direction chooses a durable identity, so it draws worlds; surface designs\n  // one page inside a committed identity, so it draws compositions. Duals serve\n  // both. A tier with no matching-strength approvals falls back to its full\n  // approved pool rather than starving the roll.\n  const wanted = scope === 'direction'\n    ? new Set(['world', 'dual'])\n    : new Set(['composition', 'dual']);\n\n  const approvedByTier = new Map();\n  for (const concept of approved) {\n    const tier = approvedByTier.get(concept.wellTier) || [];\n    tier.push(concept);\n    approvedByTier.set(concept.wellTier, tier);\n  }\n  if (WELL_TIERS.some(tier => !(approvedByTier.get(tier) || []).length)) {\n    throw new Error('concept-seed: every challenger tier needs at least one approved concept');\n  }\n\n  // Optional minimum-rating gate, applied per tier and skipped for any tier it\n  // would empty, so a thin tier degrades to its full approved pool.\n  if (minRating) {\n    for (const [tier, pool] of approvedByTier) {\n      const rated = pool.filter(concept => (concept.review?.rating || 0) >= minRating);\n      if (rated.length > 0) approvedByTier.set(tier, rated);\n    }\n  }\n  // Mode eligibility, per tier and skipped where it would empty a tier. Worlds\n  // used to be drawn with no mode awareness at all, so a build asking for an app\n  // UI could get six worlds that only make sense on a landing page. A world is an\n  // identity and identities transfer further than compositions do, so this is a\n  // ceiling the reviewer sets rather than a category assignment: eligible\n  // everywhere until someone says otherwise.\n  if (mode) {\n    for (const [tier, pool] of approvedByTier) {","sourceCodeStart":152,"sourceCodeEnd":188,"githubUrl":"https://github.com/pbakaus/impeccable/blob/d14711ae3d1a1dd62dee61a358d27f107c51ccd0/skill/scripts/lib/roll-selection.mjs#L152-L188","documentation":"Thrown by selectApprovedChallengers() in skill/scripts/lib/roll-selection.mjs when at least one of the three well tiers (WELL_TIERS = graphic, interaction, atmosphere) has zero approved concepts. The roll draws two challengers per tier so every tier must have a non-empty approved pool before mode/rating filters are applied; an empty tier would starve the roll.","triggerScenarios":"Calling selectApprovedChallengers({ scope, concepts }) where the concepts array has no entry with status==='approved' for one or more of the graphic/interaction/atmosphere wellTier values. Common during concept-seed before all three tiers have at least one concept reviewed and approved.","commonSituations":"Running a design roll (direction or surface scope) before completing concept review for every tier; a tier's concepts all still in 'pending'/'rejected'; concepts missing the wellTier field so they are not bucketed.","solutions":["Review and approve at least one concept in each of the graphic, interaction, and atmosphere tiers, then re-run the roll.","Check that each approved concept actually has wellTier set to one of the three tier strings — a missing/misspelled wellTier leaves the tier empty.","If a tier genuinely has no concepts, generate/seed concepts for that tier first via the concept-seed flow."],"exampleFix":"// before\n// concepts has approved graphic + atmosphere only, no interaction\nselectApprovedChallengers({ scope: 'surface', concepts });\n// after\n// approve one interaction-tier concept first, then roll","handlingStrategy":"validation","validationCode":"const TIERS = ['graphic', 'interaction', 'atmosphere'];\nconst approvedByTier = new Map(concepts.filter(c => c.status === 'approved').reduce((m, c) => {\n  const arr = m.get(c.wellTier) || []; arr.push(c); m.set(c.wellTier, arr); return m;\n}, new Map()));\nif (TIERS.some(t => !(approvedByTier.get(t) || []).length)) {\n  throw new Error('Approve at least one concept per tier first');\n}","typeGuard":"function tiersFullyApproved(concepts) {\n  const have = new Set(concepts.filter(c => c.status === 'approved' && c.wellTier).map(c => c.wellTier));\n  return ['graphic', 'interaction', 'atmosphere'].every(t => have.has(t));\n}","tryCatchPattern":null,"preventionTips":["Complete concept review for all three tiers before rolling.","Ensure every approved concept carries a valid wellTier."],"tags":["concept-seed","roll-selection","validation","design-flow"],"backgroundTag":null,"analyzedSha":"d14711ae3d1a1dd62dee61a358d27f107c51ccd0","analyzedAt":"2026-08-13T00:52:25.771Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}