diff --git a/index.html b/index.html index 90bb61e..9673cc6 100644 --- a/index.html +++ b/index.html @@ -10577,8 +10577,8 @@ Analyze and refine. Output ONLY the JSON object:` } ${escapeHtml(shortModel)} - ${current.score}pts - ${current.isWinner ? '✦' : ''} + ${Number(current.score) || 0}pts + ${current.isWinner === true ? '✦' : ''} ← → @@ -12187,8 +12187,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; msg.imageName = String(msg.imageName).slice(0, 100).replace(/[<>"'&]/g, ''); } if (Array.isArray(msg.liquidVersions)) { + msg.liquidVersions = msg.liquidVersions.filter(v => v && typeof v === 'object' && !Array.isArray(v)); for (const v of msg.liquidVersions) { - if (!v || typeof v !== 'object') continue; v.improvements = (Array.isArray(v.improvements) ? v.improvements : []) .filter(x => typeof x === 'string').slice(0, 10).map(s => s.slice(0, 200)); v.label = typeof v.label === 'string' ? v.label.slice(0, 60) : ''; @@ -12198,6 +12198,15 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; v.content = typeof v.content === 'string' ? v.content : ''; } } + if (Array.isArray(msg.raceResponses)) { + msg.raceResponses = msg.raceResponses.filter(r => r && typeof r === 'object' && !Array.isArray(r)); + for (const r of msg.raceResponses) { + r.model = typeof r.model === 'string' ? r.model.slice(0, 100) : ''; + r.content = typeof r.content === 'string' ? r.content : ''; + r.score = Number.isFinite(r.score) ? r.score : 0; + r.isWinner = r.isWinner === true; + } + } } } // Validate strategy logs @@ -12207,8 +12216,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; log.model = typeof log.model === 'string' ? log.model.slice(0, 100) : ''; log.query = typeof log.query === 'string' ? log.query : ''; if (Array.isArray(log.results)) { + log.results = log.results.filter(r => r && typeof r === 'object' && !Array.isArray(r)); for (const r of log.results) { - if (!r || typeof r !== 'object') continue; r.strategy = typeof r.strategy === 'string' ? r.strategy.slice(0, 100) : ''; r.error = typeof r.error === 'string' ? r.error.slice(0, 200) : ''; r.contentPreview = typeof r.contentPreview === 'string' ? r.contentPreview.slice(0, 300) : ''; @@ -13079,7 +13088,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`;
Duration:${escapeHtml(String(magic.duration || 'N/A'))}
Models:${parseInt(magic.successfulModels) || 0}/${parseInt(magic.totalModels) || 0} collected
Scored:${parseInt(magic.scoredResponses) || 0} responses fed to orchestrator
- ${magic.topModel ? `
Top Model:${escapeHtml(magic.topModel.split('/')[1] || magic.topModel)} (${magic.topScore || 'N/A'})
` : ''} + ${magic.topModel ? `
Top Model:${escapeHtml(magic.topModel.split('/')[1] || magic.topModel)} (${escapeHtml(String(magic.topScore || 'N/A'))})
` : ''} ${consortiumModelGridHtml} ${consortiumLogsHtml} `; @@ -13100,7 +13109,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; const scoreItems = magic.all_scores.map(s => { const isWinner = s.template === magic.template; const cls = isWinner ? 'winner' : 'success'; - return `${isWinner ? '👑' : '✓'} ${escapeHtml(s.template)} (${s.score})`; + return `${isWinner ? '👑' : '✓'} ${escapeHtml(s.template)} (${Number(s.score) || 0})`; }).join(''); templateGridHtml = `
${scoreItems}
`; } @@ -13119,10 +13128,10 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; detailsHtml = `
Combo:${escapeHtml(magic.template || 'unknown')}${magic.combo ? ' [' + escapeHtml(magic.combo) + ']' : ''}
-
Score:${magic.score || 'N/A'}
+
Score:${Number(magic.score) || 'N/A'}
Model:${escapeHtml(magic.model?.split('/')[1] || magic.model || 'unknown')}
-
Duration:${magic.duration || 'N/A'}
- ${magic.combos_attempted ? `
Combos:${magic.combos_succeeded || 0}/${magic.combos_attempted} succeeded, ${magic.combos_failed || 0} refused
` : ''} +
Duration:${escapeHtml(String(magic.duration || 'N/A'))}
+ ${magic.combos_attempted ? `
Combos:${parseInt(magic.combos_succeeded) || 0}/${parseInt(magic.combos_attempted)} succeeded, ${parseInt(magic.combos_failed) || 0} refused
` : ''} ${templateGridHtml} ${plinyLogsHtml} ${magic.systemPrompt ? `
System Prompt:
${escapeHtml(magic.systemPrompt.slice(0, 500))}${magic.systemPrompt.length > 500 ? '...' : ''}
` : ''} @@ -13135,7 +13144,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; const scoreItems = magic.scores.map(s => { const isWinner = s.technique === magic.techniqueLabel; const color = s.score >= 80 ? '#00ff41' : s.score >= 60 ? '#ffaa00' : '#ff3e3e'; - return `${isWinner ? '👑 ' : ''}${escapeHtml(s.technique)} ${s.score}`; + return `${isWinner ? '👑 ' : ''}${escapeHtml(s.technique)} ${Number(s.score) || 0}`; }).join(''); scoresHtml = `
${scoreItems}
`; } @@ -13145,7 +13154,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`;
Winner:${escapeHtml(magic.techniqueLabel || magic.technique || 'unknown')}
Sampling:temp=${parseFloat(magic.temperature) || 'N/A'} top_p=${parseFloat(magic.topP) || 'N/A'}
Model:${escapeHtml(magic.model?.split('/')[1] || magic.model || 'unknown')}
-
Variants:${magic.variants_succeeded || '?'}/${magic.variants_total || '?'} succeeded, ${magic.variants_refused || 0} refused
+
Variants:${parseInt(magic.variants_succeeded) || '?'}/${parseInt(magic.variants_total) || '?'} succeeded, ${parseInt(magic.variants_refused) || 0} refused
Duration:${escapeHtml(String(magic.duration || 'N/A'))}
${magic.triggers_found?.length > 0 ? `
Triggers:${escapeHtml(magic.triggers_found.join(', '))}
` : ''} ${scoresHtml} @@ -13261,7 +13270,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`;
${modeIcon} - ${magic.mode} + ${escapeHtml(String(magic.mode))} ${summaryText} ▼
@@ -16695,8 +16704,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; } // Sanitize liquid version history if (Array.isArray(msg.liquidVersions)) { + msg.liquidVersions = msg.liquidVersions.filter(v => v && typeof v === 'object' && !Array.isArray(v)); for (const v of msg.liquidVersions) { - if (!v || typeof v !== 'object') continue; if (Array.isArray(v.improvements)) { v.improvements = v.improvements .filter(x => typeof x === 'string') @@ -16712,6 +16721,16 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; v.content = typeof v.content === 'string' ? v.content : ''; } } + // Sanitize race responses + if (Array.isArray(msg.raceResponses)) { + msg.raceResponses = msg.raceResponses.filter(r => r && typeof r === 'object' && !Array.isArray(r)); + for (const r of msg.raceResponses) { + r.model = typeof r.model === 'string' ? r.model.slice(0, 100) : ''; + r.content = typeof r.content === 'string' ? r.content : ''; + r.score = Number.isFinite(r.score) ? r.score : 0; + r.isWinner = r.isWinner === true; + } + } } } @@ -16724,8 +16743,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; log.model = typeof log.model === 'string' ? log.model.slice(0, 100) : ''; log.query = typeof log.query === 'string' ? log.query : ''; if (Array.isArray(log.results)) { + log.results = log.results.filter(r => r && typeof r === 'object' && !Array.isArray(r)); for (const r of log.results) { - if (!r || typeof r !== 'object') continue; r.strategy = typeof r.strategy === 'string' ? r.strategy.slice(0, 100) : ''; r.error = typeof r.error === 'string' ? r.error.slice(0, 200) : ''; r.contentPreview = typeof r.contentPreview === 'string' ? r.contentPreview.slice(0, 300) : ''; @@ -16790,6 +16809,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; if (confirm('Are you sure you want to delete ALL data? This includes all conversations, logs, and settings. This cannot be undone!')) { if (confirm('This is your last chance. Delete everything?')) { localStorage.removeItem('g0dm0d3-state'); + localStorage.removeItem('g0dm0d3-apikey'); + localStorage.removeItem('g0dm0d3-venice-apikey'); location.reload(); } }