loopengine 0.4.11 → 0.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1413,7 +1413,7 @@ ${renderMarkdownScript}
|
|
|
1413
1413
|
(workflowPageId ? '<section class="wf-section"><div class="wf-audit-tools"><a class="primary" href="/agents/' + encodeURIComponent(name) + '/workflows/' + encodeURIComponent(w.id) + '/audit/report">Open the report</a><a href="' + auditHref + '">See everything in Audit ' + String.fromCharCode(8594) + '</a></div></section>' : '');
|
|
1414
1414
|
}
|
|
1415
1415
|
|
|
1416
|
-
// The Evaluation tab: the
|
|
1416
|
+
// The Evaluation tab: the success criteria, the eval cases (saved, then
|
|
1417
1417
|
// suggested from real runs), and Evaluate.
|
|
1418
1418
|
function workflowEvaluationHtml(w) {
|
|
1419
1419
|
var evals = w.evals || { cases: [], criteria: [], rounds: [] };
|
|
@@ -1428,16 +1428,16 @@ ${renderMarkdownScript}
|
|
|
1428
1428
|
var pill = !r || !r.total ? '' : '<span class="le-pill ' + (r.passed === r.total ? 'good' : r.passed * 2 >= r.total ? 'ask' : 'bad') + ' wf-crit-rate">' + r.passed + ' / ' + r.total + '</span>';
|
|
1429
1429
|
return '<li class="wf-crit"><span><strong>' + escapeHtml(c.text) + '</strong><br><span class="wf-crit-kind">' + escapeHtml(critKindText(c)) + '</span></span>' + pill + '</li>';
|
|
1430
1430
|
}).join('');
|
|
1431
|
-
var critSection = '<h4 class="wf-sub">
|
|
1431
|
+
var critSection = '<h4 class="wf-sub">Success criteria</h4>' +
|
|
1432
1432
|
'<p class="hint" style="margin:0">' + (evals.criteria && evals.criteria.length
|
|
1433
|
-
? 'What every good result must get right. Each eval case is checked against every
|
|
1434
|
-
: 'What every good result must get right.
|
|
1433
|
+
? 'What every good result must get right. Each eval case is checked against every criterion, yes or no.'
|
|
1434
|
+
: 'What every good result must get right. None set yet, so each eval case is only compared with its good result. Add the criteria that matter, or have them suggested from its instructions.') + '</p>' +
|
|
1435
1435
|
'<ul class="wf-crits">' + critList + '</ul>' +
|
|
1436
|
-
'<div class="wf-crit-bar"><button type="button" class="wf-crit-edit">' + (evals.criteria && evals.criteria.length ? 'Edit the
|
|
1436
|
+
'<div class="wf-crit-bar"><button type="button" class="wf-crit-edit">' + (evals.criteria && evals.criteria.length ? 'Edit the success criteria' : 'Add success criteria') + '</button></div>' +
|
|
1437
1437
|
'<div class="wf-crit-form" hidden>' +
|
|
1438
1438
|
'<div class="wf-crit-rows">' + (evals.criteria && evals.criteria.length ? evals.criteria : []).map(critRowHtml).join('') + '</div>' +
|
|
1439
|
-
'<div class="wf-crit-bar"><button type="button" class="plain wf-crit-add">+ Add
|
|
1440
|
-
'<span style="flex:1"></span><button type="button" class="plain wf-crit-cancel">Cancel</button><button type="button" class="wf-crit-save">Save
|
|
1439
|
+
'<div class="wf-crit-bar"><button type="button" class="plain wf-crit-add">+ Add a criterion</button><button type="button" class="plain wf-crit-draft">Suggest from its instructions</button>' +
|
|
1440
|
+
'<span style="flex:1"></span><button type="button" class="plain wf-crit-cancel">Cancel</button><button type="button" class="wf-crit-save">Save success criteria</button></div>' +
|
|
1441
1441
|
'<span class="hint wf-crit-status"></span>' +
|
|
1442
1442
|
'</div>';
|
|
1443
1443
|
var latest = {};
|
|
@@ -1450,7 +1450,7 @@ ${renderMarkdownScript}
|
|
|
1450
1450
|
var values = Object.keys(c.params || {}).map(function (k) { var v = String(c.params[k]); return escapeHtml(k) + ': ' + escapeHtml(v.length > 60 ? v.slice(0, 60) + String.fromCharCode(8230) : v); }).join(DOT);
|
|
1451
1451
|
var fails = last && last.checks ? last.checks.filter(function (x) { return !x.pass; }) : [];
|
|
1452
1452
|
var pill = !last ? ''
|
|
1453
|
-
: last.checks ? (fails.length ? '<span class="le-pill bad">' + fails.length + ' of ' + last.checks.length + '
|
|
1453
|
+
: last.checks ? (fails.length ? '<span class="le-pill bad">' + fails.length + ' of ' + last.checks.length + ' criteria missed</span>' : '<span class="le-pill good">Passed all ' + last.checks.length + '</span>')
|
|
1454
1454
|
: typeof last.score === 'number' ? '<span class="le-pill ' + (last.score >= 4 ? 'good' : last.score === 3 ? 'ask' : 'bad') + '">' + last.score + ' / 5</span>' : '<span class="le-pill bad">Not scored</span>';
|
|
1455
1455
|
var why = !last ? ''
|
|
1456
1456
|
: last.checks ? (fails.length ? '<ul class="wf-case-fails">' + fails.map(function (x) { return '<li><strong>' + escapeHtml(critName[x.criterionId] || x.criterionId) + '</strong>' + (x.reason ? ': ' + escapeHtml(x.reason) : '') + '</li>'; }).join('') + '</ul>' : '')
|
|
@@ -1473,14 +1473,14 @@ ${renderMarkdownScript}
|
|
|
1473
1473
|
}).join('');
|
|
1474
1474
|
var lastLine = !round ? ''
|
|
1475
1475
|
: '<p class="wf-eval-last"><strong>Last evaluation: ' + escapeHtml(new Date(round.at).toLocaleDateString(undefined, { month: 'short', day: 'numeric' })) + (round.briefVersion ? ', version ' + round.briefVersion + ' of its instructions' : '') + '</strong>' +
|
|
1476
|
-
(checked ? String.fromCharCode(8212) + ' ' + round.allPassed + ' of ' + round.cases.length + ' cases
|
|
1476
|
+
(checked ? String.fromCharCode(8212) + ' ' + round.allPassed + ' of ' + round.cases.length + ' cases met every success criterion.' : '') +
|
|
1477
1477
|
' <details class="wf-eval-details"><summary>Details</summary>Ran with ' + escapeHtml(round.model) + DOT + 'judged by ' + escapeHtml(round.judge) + DOT + escapeHtml(new Date(round.at).toLocaleString()) + '</details></p>';
|
|
1478
1478
|
return '<section class="wf-section">' + critSection + '</section>' +
|
|
1479
1479
|
'<section class="wf-section"><h4 class="wf-sub">Eval cases' + (evals.cases.length ? ' (' + evals.cases.length + ')' : '') + '</h4>' +
|
|
1480
1480
|
'<p class="hint" style="margin:0">Real runs saved to check every change against.</p>' +
|
|
1481
1481
|
(cases ? '<ul class="wf-cases">' + cases + '</ul>' : '<p class="hint" style="margin:0">None yet: add suggested ones below, or save any run from its case page.</p>') +
|
|
1482
1482
|
'<div class="wf-evals-bar"><button type="button" class="wf-evals-run"' + (!evals.cases.length || running ? ' disabled' : '') + '>' + (running ? 'Evaluating ' + running.done + ' of ' + running.total + String.fromCharCode(8230) : 'Evaluate') + '</button>' +
|
|
1483
|
-
'<span class="hint">Runs every eval case again with the current instructions and checks each result against the
|
|
1483
|
+
'<span class="hint">Runs every eval case again with the current instructions and checks each result against the success criteria. Nothing is sent, refunded or submitted.</span></div>' +
|
|
1484
1484
|
lastLine + '</section>' +
|
|
1485
1485
|
(workflowPageId ? '<section class="wf-section"><h4 class="wf-sub">Suggested eval cases</h4><div class="wf-candidates"><p class="hint" style="margin:0">Looking through its runs' + String.fromCharCode(8230) + '</p></div></section>' : '');
|
|
1486
1486
|
}
|
package/dist/web/change-log.js
CHANGED
|
@@ -22,7 +22,7 @@ const LABELS = [
|
|
|
22
22
|
[/^\/agents\/[^/]+\/workflows\/[^/]+\/versions\/(\d+)\/restore$/, (_method, m) => `Restored brief version ${m[1]}`],
|
|
23
23
|
[/^\/agents\/[^/]+\/workflows\/[^/]+\/messages$/, 'Changed where messages go'],
|
|
24
24
|
[/^\/agents\/[^/]+\/workflows\/[^/]+\/triggers/, 'Changed webhook triggers'],
|
|
25
|
-
[/^\/agents\/[^/]+\/workflows\/[^/]+\/evals\/criteria/, 'Changed the
|
|
25
|
+
[/^\/agents\/[^/]+\/workflows\/[^/]+\/evals\/criteria/, 'Changed the success criteria'],
|
|
26
26
|
[/^\/agents\/[^/]+\/workflows\/[^/]+\/evals/, 'Changed eval cases'],
|
|
27
27
|
[/^\/agents\/[^/]+\/schedules/, 'Changed schedules'],
|
|
28
28
|
[/^\/schedules\//, 'Changed a schedule'],
|
|
@@ -127,7 +127,7 @@ function lineChanges(before, after) {
|
|
|
127
127
|
* field. A text of several lines, or a long one, is told as lines added
|
|
128
128
|
* and removed; anything else as its value before and after. */
|
|
129
129
|
// Always told as lines, however short: what an agent reads.
|
|
130
|
-
const TEXT_FIELDS = new Set(['instructions', 'shared policies', '
|
|
130
|
+
const TEXT_FIELDS = new Set(['instructions', 'shared policies', 'success criteria']);
|
|
131
131
|
export function describeChanges(before, after) {
|
|
132
132
|
const out = [];
|
|
133
133
|
for (const field of [...new Set([...Object.keys(before), ...Object.keys(after)])]) {
|
package/dist/web/inbox-page.js
CHANGED
|
@@ -386,7 +386,7 @@ ${renderMarkdownScript}
|
|
|
386
386
|
}
|
|
387
387
|
|
|
388
388
|
// Save this run as one of its workflow's eval cases (owners, admins and
|
|
389
|
-
// editors): a test it must keep passing. Then the
|
|
389
|
+
// editors): a test it must keep passing. Then the success criteria it
|
|
390
390
|
// suggests, from what people corrected in it, to add or not.
|
|
391
391
|
function evalCaseHtml(c) {
|
|
392
392
|
var run = c.run;
|
|
@@ -429,7 +429,7 @@ ${renderMarkdownScript}
|
|
|
429
429
|
var fresh = suggestions.filter(function (s) { return have.indexOf(s.text) === -1; });
|
|
430
430
|
if (!fresh.length) return;
|
|
431
431
|
box.hidden = false;
|
|
432
|
-
box.innerHTML = '<h4>Add to its
|
|
432
|
+
box.innerHTML = '<h4>Add to its success criteria?</h4><p class="hint" style="margin:0">From what people corrected in this run. Each becomes a criterion every eval case is judged on.</p>' +
|
|
433
433
|
fresh.map(function (s, i) { return '<div class="ib-suggest-row"><span>' + esc(s.text) + '</span><button type="button" class="ib-btn plain" data-suggest="' + i + '">Add</button></div>'; }).join('');
|
|
434
434
|
box.addEventListener('click', function (ev) {
|
|
435
435
|
var b = ev.target.closest('[data-suggest]');
|
|
@@ -185,7 +185,7 @@ export interface EvalRunDeps {
|
|
|
185
185
|
/** Runs every case once and scores it, recording progress as it goes.
|
|
186
186
|
* Throws when a round is already running or there are no cases. */
|
|
187
187
|
export declare function startEvalRound(deps: EvalRunDeps): Promise<EvalRound>;
|
|
188
|
-
/**
|
|
188
|
+
/** Success criteria a run suggests (the Evaluation tab's),
|
|
189
189
|
* from what people corrected in it: a denial's reason, a changed
|
|
190
190
|
* request, a bad result's note, a question it had to ask. */
|
|
191
191
|
export declare function suggestedCriteria(run: WorkflowRun): {
|
|
@@ -343,7 +343,7 @@ const clip = (text, max) => {
|
|
|
343
343
|
return flat.length > max ? flat.slice(0, max - 1) + '…' : flat;
|
|
344
344
|
};
|
|
345
345
|
const shown = (v) => clip(v === undefined ? '(none)' : typeof v === 'string' ? v : JSON.stringify(v), 80);
|
|
346
|
-
/**
|
|
346
|
+
/** Success criteria a run suggests (the Evaluation tab's),
|
|
347
347
|
* from what people corrected in it: a denial's reason, a changed
|
|
348
348
|
* request, a bad result's note, a question it had to ask. */
|
|
349
349
|
export function suggestedCriteria(run) {
|