Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions skills/skill-creator/assets/eval_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,12 @@ <h1>Eval Set Review: <span id="skill-name">__SKILL_NAME_PLACEHOLDER__</span></h1
}

function escapeHtml(text) {
const div = document.createElement('div');
div.textContent = text;
return div.innerHTML;
return String(text ?? '')
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;');
}

function updateQuery(idx, value) { evalItems[idx].query = value; updateSummary(); }
Expand Down
19 changes: 11 additions & 8 deletions skills/skill-creator/eval-viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -1097,9 +1097,12 @@ <h2>Review Complete</h2>
}

function escapeHtml(text) {
const div = document.createElement("div");
div.textContent = text;
return div.innerHTML;
return String(text ?? "")
.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;")
.replace(/"/g, "&quot;")
.replace(/'/g, "&#39;");
}

// ---- View switching ----
Expand Down Expand Up @@ -1129,9 +1132,9 @@ <h2>Review Complete</h2>
html += "<h2 style='font-family: Poppins, sans-serif; margin-bottom: 0.5rem;'>Benchmark Results</h2>";
html += "<p style='color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1.25rem;'>";
if (metadata.skill_name) html += "<strong>" + escapeHtml(metadata.skill_name) + "</strong> &mdash; ";
if (metadata.timestamp) html += metadata.timestamp + " &mdash; ";
if (metadata.evals_run) html += "Evals: " + metadata.evals_run.join(", ") + " &mdash; ";
html += (metadata.runs_per_configuration || "?") + " runs per configuration";
if (metadata.timestamp) html += escapeHtml(metadata.timestamp) + " &mdash; ";
if (metadata.evals_run) html += "Evals: " + escapeHtml(metadata.evals_run.join(", ")) + " &mdash; ";
html += escapeHtml(metadata.runs_per_configuration || "?") + " runs per configuration";
html += "</p>";

// Summary table
Expand Down Expand Up @@ -1225,7 +1228,7 @@ <h2>Review Complete</h2>
const r = run.result || {};
const prClass = r.pass_rate >= 0.8 ? "benchmark-delta-positive" : r.pass_rate < 0.5 ? "benchmark-delta-negative" : "";
html += '<tr class="' + rowClass + '">';
html += "<td>" + configLabel + "</td>";
html += "<td>" + escapeHtml(configLabel) + "</td>";
html += "<td>" + run.run_number + "</td>";
html += '<td class="' + prClass + '">' + ((r.pass_rate || 0) * 100).toFixed(0) + "% (" + (r.passed || 0) + "/" + (r.total || 0) + ")</td>";
if (hasTime) html += "<td>" + (r.time_seconds != null ? r.time_seconds.toFixed(1) : "—") + "</td>";
Expand All @@ -1238,7 +1241,7 @@ <h2>Review Complete</h2>
const avgRate = rates.reduce((a, b) => a + b, 0) / rates.length;
const avgPrClass = avgRate >= 0.8 ? "benchmark-delta-positive" : avgRate < 0.5 ? "benchmark-delta-negative" : "";
html += '<tr class="benchmark-row-avg ' + rowClass + '">';
html += "<td>" + configLabel + "</td>";
html += "<td>" + escapeHtml(configLabel) + "</td>";
html += "<td>Avg</td>";
html += '<td class="' + avgPrClass + '">' + (avgRate * 100).toFixed(0) + "%</td>";
if (hasTime) {
Expand Down