{"record":{"id":"5ee116c365f177e0","repo":"affaan-m/ECC","slug":"unknown-panel-selectedpanel-valid-panels-a","errorCode":null,"errorMessage":"Unknown panel: ${selectedPanel}. Valid panels: ${Array.from(VALID_PANELS).join(', ')}","messagePattern":"Unknown panel: (.+?)\\. Valid panels: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/skill-evolution/dashboard.js","lineNumber":353,"sourceCode":"    throw new Error(`Invalid now timestamp: ${now}`);\n  }\n\n  const dashboardOptions = { ...options, now };\n  const records = tracker.readSkillExecutionRecords(dashboardOptions);\n  const skillsById = health.discoverSkills(dashboardOptions);\n  const report = health.collectSkillHealth(dashboardOptions);\n  const summary = health.summarizeHealthReport(report);\n\n  const panelRenderers = {\n    'success-rate': () => renderSuccessRatePanel(records, report.skills, dashboardOptions),\n    'failures': () => renderFailureClusterPanel(records, dashboardOptions),\n    'amendments': () => renderAmendmentPanel(skillsById, dashboardOptions),\n    'versions': () => renderVersionTimelinePanel(skillsById, dashboardOptions),\n  };\n\n  const selectedPanel = options.panel || null;\n  if (selectedPanel && !VALID_PANELS.has(selectedPanel)) {\n    throw new Error(`Unknown panel: ${selectedPanel}. Valid panels: ${Array.from(VALID_PANELS).join(', ')}`);\n  }\n\n  const panels = {};\n  const textParts = [];\n\n  const header = [\n    'ECC Skill Health Dashboard',\n    `Generated: ${now}`,\n    `Skills: ${summary.total_skills} total, ${summary.healthy_skills} healthy, ${summary.declining_skills} declining`,\n    '',\n  ];\n\n  textParts.push(header.join('\\n'));\n\n  if (selectedPanel) {\n    const result = panelRenderers[selectedPanel]();\n    panels[selectedPanel] = result.data;\n    textParts.push(result.text);","sourceCodeStart":335,"sourceCodeEnd":371,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/skill-evolution/dashboard.js#L335-L371","documentation":"Thrown by renderDashboard when options.panel is set to a value not in VALID_PANELS (success-rate, failures, amendments, versions). A null/undefined panel renders all panels, so only a non-null unknown string triggers this.","triggerScenarios":"Calling renderDashboard({ panel: 'summary' }), renderDashboard({ panel: 'health' }), or any panel name outside the four valid keys. The error message lists the valid set.","commonSituations":"Using a panel name from an older/newer version where panels were renamed; typo; assuming a panel exists that was never implemented; copy-paste from docs that named a planned-but-unshipped panel.","solutions":["Use one of: 'success-rate', 'failures', 'amendments', 'versions'.","Omit options.panel (or pass null) to render every panel.","If you need a custom panel, the panelRenderers map inside renderDashboard must be extended in source — there is no plugin hook."],"exampleFix":"// before\nrenderDashboard({ panel: 'overview' });\n// throws: Unknown panel: overview. Valid panels: success-rate, failures, amendments, versions\n\n// after\nrenderDashboard({ panel: 'success-rate' });","handlingStrategy":"validation","validationCode":"const VALID_PANELS = new Set(['success-rate','failures','amendments','versions']);\nconst panel = opts.panel && VALID_PANELS.has(opts.panel) ? opts.panel : null;\nrenderDashboard({ ...opts, panel });","typeGuard":"function isValidPanel(p) {\n  return p == null || ['success-rate','failures','amendments','versions'].includes(p);\n}","tryCatchPattern":"try {\n  renderDashboard({ panel });\n} catch (err) {\n  if (/Unknown panel/.test(err.message)) renderDashboard({ ...opts, panel: null });\n  else throw err;\n}","preventionTips":["Treat panel names as an enum sourced from the same constant the module uses.","Default to null (all panels) when the requested panel is unknown rather than crashing.","Re-check valid panels when upgrading the skill-evolution module."],"tags":["dashboard","panel","validation"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}