@crowandraven/evalkeeper 0.12.0 → 0.14.0
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.
- package/dist/drafts.d.ts +2 -0
- package/dist/drafts.js +3 -1
- package/dist/drafts.js.map +1 -1
- package/dist/failures.d.ts +16 -0
- package/dist/failures.js +40 -0
- package/dist/failures.js.map +1 -0
- package/dist/glossary.d.ts +4 -2
- package/dist/glossary.js +4 -2
- package/dist/glossary.js.map +1 -1
- package/dist/health.d.ts +35 -2
- package/dist/health.js +31 -6
- package/dist/health.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/legs.d.ts +4 -1
- package/dist/legs.js +6 -2
- package/dist/legs.js.map +1 -1
- package/dist/next/actions.js +79 -15
- package/dist/next/actions.js.map +1 -1
- package/dist/next/route.js +2 -1
- package/dist/next/route.js.map +1 -1
- package/dist/next/weekly.d.ts +7 -2
- package/dist/next/weekly.js +5 -3
- package/dist/next/weekly.js.map +1 -1
- package/dist/next/wiring.d.ts +6 -0
- package/dist/order.d.ts +18 -0
- package/dist/order.js +53 -0
- package/dist/order.js.map +1 -0
- package/dist/prisma/index.d.ts +1 -0
- package/dist/prisma/index.js +3 -0
- package/dist/prisma/index.js.map +1 -1
- package/dist/prune.d.ts +4 -1
- package/dist/prune.js +11 -2
- package/dist/prune.js.map +1 -1
- package/dist/react/AddCase.d.ts +12 -2
- package/dist/react/AddCase.js +70 -8
- package/dist/react/AddCase.js.map +1 -1
- package/dist/react/AnswerKey.js +11 -5
- package/dist/react/AnswerKey.js.map +1 -1
- package/dist/react/CaseMenu.d.ts +6 -1
- package/dist/react/CaseMenu.js +5 -2
- package/dist/react/CaseMenu.js.map +1 -1
- package/dist/react/CompareView.js +4 -4
- package/dist/react/CompareView.js.map +1 -1
- package/dist/react/FeedbackView.js +3 -3
- package/dist/react/FeedbackView.js.map +1 -1
- package/dist/react/HubSections.js +11 -10
- package/dist/react/HubSections.js.map +1 -1
- package/dist/react/ModelMenu.d.ts +13 -4
- package/dist/react/ModelMenu.js +12 -7
- package/dist/react/ModelMenu.js.map +1 -1
- package/dist/react/PriorityPicker.d.ts +21 -0
- package/dist/react/PriorityPicker.js +47 -0
- package/dist/react/PriorityPicker.js.map +1 -0
- package/dist/react/RateView.js +1 -0
- package/dist/react/RateView.js.map +1 -1
- package/dist/react/RunView.js +21 -5
- package/dist/react/RunView.js.map +1 -1
- package/dist/react/SettingsHistory.js +3 -3
- package/dist/react/SettingsHistory.js.map +1 -1
- package/dist/react/SuiteSections.d.ts +6 -0
- package/dist/react/SuiteSections.js +100 -39
- package/dist/react/SuiteSections.js.map +1 -1
- package/dist/react/WeeklyCheck.js +4 -8
- package/dist/react/WeeklyCheck.js.map +1 -1
- package/dist/react/app.d.ts +4 -0
- package/dist/react/app.js.map +1 -1
- package/dist/react/format.d.ts +2 -2
- package/dist/react/format.js +4 -2
- package/dist/react/format.js.map +1 -1
- package/dist/react/pieces.d.ts +21 -1
- package/dist/react/pieces.js +67 -2
- package/dist/react/pieces.js.map +1 -1
- package/dist/runner.d.ts +7 -2
- package/dist/runner.js +5 -2
- package/dist/runner.js.map +1 -1
- package/dist/settings.d.ts +14 -0
- package/dist/settings.js +24 -2
- package/dist/settings.js.map +1 -1
- package/dist/suggest.js +25 -7
- package/dist/suggest.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +32 -0
- package/dist/testing.js.map +1 -1
- package/dist/types.d.ts +12 -0
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -1
- package/package.json +10 -10
- package/schema/evalkeeper.prisma +3 -0
- package/src/drafts.ts +6 -1
- package/src/failures.ts +50 -0
- package/src/glossary.ts +6 -2
- package/src/health.ts +55 -7
- package/src/index.ts +2 -0
- package/src/legs.ts +8 -2
- package/src/next/actions.ts +96 -17
- package/src/next/route.ts +2 -1
- package/src/next/weekly.ts +15 -4
- package/src/next/wiring.ts +6 -0
- package/src/order.ts +64 -0
- package/src/prisma/index.ts +5 -0
- package/src/prune.ts +15 -1
- package/src/react/AddCase.tsx +98 -11
- package/src/react/AnswerKey.tsx +74 -14
- package/src/react/CaseMenu.tsx +24 -0
- package/src/react/CompareView.tsx +19 -4
- package/src/react/FeedbackView.tsx +13 -3
- package/src/react/HubSections.tsx +18 -11
- package/src/react/ModelMenu.tsx +24 -7
- package/src/react/PriorityPicker.tsx +143 -0
- package/src/react/RateView.tsx +1 -0
- package/src/react/RunView.tsx +41 -6
- package/src/react/SettingsHistory.tsx +3 -3
- package/src/react/SuiteSections.tsx +418 -251
- package/src/react/WeeklyCheck.tsx +12 -6
- package/src/react/app.ts +4 -0
- package/src/react/format.ts +4 -2
- package/src/react/pieces.tsx +96 -2
- package/src/runner.ts +11 -4
- package/src/settings.ts +37 -2
- package/src/suggest.ts +26 -7
- package/src/testing.ts +35 -1
- package/src/types.ts +18 -0
- package/templates/lib/evalkeeper/actions.ts +8 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { ChevronDown, X } from "lucide-react";
|
|
5
|
+
import { Button, Select, Submit, TextInput } from "./pieces.js";
|
|
6
|
+
/** The choices when changing it: accuracy is always held. */
|
|
7
|
+
const CHOICES = {
|
|
8
|
+
quality: "Accuracy alone",
|
|
9
|
+
speed: "Speed",
|
|
10
|
+
cost: "Cost",
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The "Favors …" chip as a button: it opens what the priority means and
|
|
14
|
+
* a form to change it, saved as a new settings version with an optional
|
|
15
|
+
* reason, so it shows under Versions and can be rolled back. Closes with
|
|
16
|
+
* its X, Escape, or a click outside.
|
|
17
|
+
*/
|
|
18
|
+
export function PriorityPicker({ action, suite, favor, own, label, why, }) {
|
|
19
|
+
const [open, setOpen] = useState(false);
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!open)
|
|
23
|
+
return;
|
|
24
|
+
const close = (e) => {
|
|
25
|
+
if (e instanceof KeyboardEvent
|
|
26
|
+
? e.key === "Escape"
|
|
27
|
+
: !ref.current?.contains(e.target))
|
|
28
|
+
setOpen(false);
|
|
29
|
+
};
|
|
30
|
+
document.addEventListener("mousedown", close);
|
|
31
|
+
document.addEventListener("keydown", close);
|
|
32
|
+
return () => {
|
|
33
|
+
document.removeEventListener("mousedown", close);
|
|
34
|
+
document.removeEventListener("keydown", close);
|
|
35
|
+
};
|
|
36
|
+
}, [open]);
|
|
37
|
+
return (_jsxs("div", { ref: ref, className: "relative text-sm font-normal", children: [_jsxs(Button, { type: "button", "aria-haspopup": "dialog", "aria-expanded": open, onClick: () => {
|
|
38
|
+
setOpen(!open);
|
|
39
|
+
}, className: "inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-full bg-tint px-2.5 text-xs font-medium leading-none text-muted hover:text-ink", children: [label, _jsx(ChevronDown, { "aria-hidden": true, className: "h-3 w-3" })] }), open && (_jsxs("div", { role: "dialog", "aria-label": "What this feature favors", className: "absolute left-0 z-20 mt-2 w-80 rounded-md border border-line bg-card p-4 shadow-lg", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsx("p", { className: "text-muted", children: why }), _jsx(Button, { type: "button", "aria-label": "Close", title: "Close", onClick: () => {
|
|
40
|
+
setOpen(false);
|
|
41
|
+
}, className: "-mr-1 -mt-1 inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted hover:bg-tint hover:text-ink", children: _jsx(X, { "aria-hidden": true, className: "h-4 w-4" }) })] }), _jsxs("form", { action: action,
|
|
42
|
+
// Closes once saved (after the submit is read).
|
|
43
|
+
onSubmit: () => setTimeout(() => {
|
|
44
|
+
setOpen(false);
|
|
45
|
+
}), className: "mt-4 space-y-3", children: [_jsx("input", { type: "hidden", name: "suite", value: suite }), _jsxs("div", { children: [_jsx("label", { htmlFor: "favor", className: "block font-medium", children: "Once accuracy holds, favor" }), _jsx(Select, { id: "favor", name: "favor", defaultValue: favor, className: "mt-1 w-full rounded-md border border-line bg-card px-3 py-2", children: ["quality", "speed", "cost"].map((f) => (_jsxs("option", { value: f, children: [CHOICES[f], f === own ? " (the suite's own)" : ""] }, f))) })] }), _jsxs("div", { children: [_jsxs("label", { htmlFor: "favor-reason", className: "block font-medium", children: ["Why? ", _jsx("span", { className: "font-normal text-muted", children: "(optional)" })] }), _jsx(TextInput, { id: "favor-reason", name: "reason", maxLength: 300, className: "mt-1 w-full rounded-md border border-line bg-card px-3 py-2" })] }), _jsx(Submit, { children: "Save as a new version" })] })] }))] }));
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=PriorityPicker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PriorityPicker.js","sourceRoot":"","sources":["../../src/react/PriorityPicker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMhE,6DAA6D;AAC7D,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,gBAAgB;IACzB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;CACJ,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,GAAG,EACH,KAAK,EACL,GAAG,GAWJ;IACC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAEzC,SAAS,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|
@@ -18,6 +18,7 @@ export async function RateView({ app, suite: key, rater, }) {
|
|
|
18
18
|
const fields = suite?.fields;
|
|
19
19
|
if (!suite ||
|
|
20
20
|
suite.caseKind !== "imported" ||
|
|
21
|
+
suite.rateBlind === false ||
|
|
21
22
|
!fields ||
|
|
22
23
|
!(suite.labelFromForm || app.answerEditors[key]))
|
|
23
24
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RateView.js","sourceRoot":"","sources":["../../src/react/RateView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;GAKG;AAEH,uFAAuF;AACvF,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,EAC7B,GAAG,EACH,KAAK,EAAE,GAAG,EACV,KAAK,GAON;IACC,MAAM,KAAK,GAAG,KAAK,CAAC;IACpB,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,CAAC;IAC7B,IACE,CAAC,KAAK;QACN,KAAK,CAAC,QAAQ,KAAK,UAAU;QAC7B,CAAC,MAAM;QACP,CAAC,CAAC,KAAK,CAAC,aAAa,IAAI,GAAG,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;QAEhD,OAAO,IAAI,CAAC;IACd,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,SA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,GAAG,GAAI,EAChD,gBAAO,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,GAAI,EACnD,KAAC,GAAG,IAAC,OAAO,QAAC,IAAI,EAAC,MAAM,EAAC,EAAE,EAAC,WAAW,YACrC,KAAC,MAAM,IAAC,OAAO,EAAC,OAAO,qBAAc,GACjC,IACD,IACF,CACR,CAAC,CAAC,CAAC,CACF,MAAC,IAAI,IAAC,SAAS,EAAC,WAAW,aACzB,aAAI,SAAS,EAAC,eAAe,6CAAkC,EAC/D,aAAG,SAAS,EAAC,6BAA6B,kEAEvC,KAAK,CAAC,OAAO,GAAG,CAAC;gCAChB,oFAAoF,IACpF,EACJ,KAAC,IAAI,IAAC,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,SAAS,EAAE,WAAW,IAAI,EAAE,uCAEtD,IACF,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
package/dist/react/RunView.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { evalsPath } from "./app.js";
|
|
3
|
-
import { Link } from "./pieces.js";
|
|
4
|
-
import { allPassed, money, summarize } from "../index.js";
|
|
3
|
+
import { Link, LocalDate } from "./pieces.js";
|
|
4
|
+
import { allPassed, failureHints, money, summarize } from "../index.js";
|
|
5
5
|
import { FieldValues } from "./Fields.js";
|
|
6
6
|
import { ReadableOutput } from "./ReadableOutput.js";
|
|
7
7
|
import { BackLink, Card } from "./pieces.js";
|
|
8
|
-
import { pct,
|
|
8
|
+
import { pct, LINK } from "./format.js";
|
|
9
9
|
/** One test: every answer, with what each check found. */
|
|
10
10
|
/** One test: every answer, with what each check found. Null when it doesn't exist. */
|
|
11
11
|
export async function RunView({ app, suite: key, runId, }) {
|
|
@@ -23,11 +23,27 @@ export async function RunView({ app, suite: key, runId, }) {
|
|
|
23
23
|
};
|
|
24
24
|
const metrics = run.metrics;
|
|
25
25
|
const summary = metrics ? summarize(metrics, suite.checks) : null;
|
|
26
|
+
// Answers that never came back first, then wrong ones, then right ones,
|
|
27
|
+
// so what needs a look is at the top.
|
|
28
|
+
const rank = (o) => o.error ? 0 : allPassed(o.scores ?? null) ? 2 : 1;
|
|
29
|
+
const ordered = [...outputs].sort((a, b) => rank(a) - rank(b));
|
|
30
|
+
const failed = outputs.filter((o) => o.error);
|
|
31
|
+
// Why they failed, counted: "timed out after 60s (3)".
|
|
32
|
+
const reasons = [
|
|
33
|
+
...failed
|
|
34
|
+
.reduce((m, o) => {
|
|
35
|
+
const why = (o.error ?? "").split("\n")[0]?.slice(0, 120) ?? "";
|
|
36
|
+
return m.set(why, (m.get(why) ?? 0) + 1);
|
|
37
|
+
}, new Map())
|
|
38
|
+
.entries(),
|
|
39
|
+
];
|
|
26
40
|
const label = (k) => suite.checks.find((c) => c.key === k)?.label ?? k;
|
|
27
|
-
return (_jsxs("div", { className: "space-y-6", children: [_jsx(BackLink, { href: evalsPath(app, key), children: suite.label }), _jsxs("div", { className: "space-y-1", children: [_jsxs("h1", { className: "text-2xl font-semibold", children: [app.models[run.model]?.label ?? run.model, " on ", suite.label] }), _jsxs("p", { className: "text-sm text-muted", children: [
|
|
41
|
+
return (_jsxs("div", { className: "space-y-6", children: [_jsx(BackLink, { href: evalsPath(app, key), children: suite.label }), _jsxs("div", { className: "space-y-1", children: [_jsxs("h1", { className: "text-2xl font-semibold", children: [app.models[run.model]?.label ?? run.model, " on ", suite.label] }), _jsxs("p", { className: "text-sm text-muted", children: [_jsx(LocalDate, { date: run.startedAt, time: true }), " \u00B7 ", run.status.toLowerCase(), metrics && ` · spent ${money(metrics.costUsd)}`] }), run.error && _jsx("p", { className: "readable text-bad", children: run.error })] }), summary && (_jsxs(Card, { className: "space-y-2", children: [_jsxs("p", { className: "text-lg", children: [summary.right, " of ", summary.total, " answers fully right (", pct(summary.total ? summary.right / summary.total : 0), ")"] }), _jsx("p", { className: "readable text-sm text-muted", children: summary.trust }), failed.length > 0 && (_jsxs("p", { className: "readable text-sm text-bad", children: [failed.length, " ", failed.length === 1 ? "answer" : "answers", " ", "didn't come back:", " ", reasons.map(([why, n]) => `${why} (${n})`).join("; "), ".", " ", _jsxs("a", { href: "#failed", className: LINK, children: ["See ", failed.length === 1 ? "it" : "them"] })] })), failureHints(failed.map((o) => o.error)).map((hint) => (_jsx("p", { className: "readable text-sm text-muted", children: hint }, hint))), summary.problems.length > 0 && (_jsx("ul", { className: "readable list-disc pl-5 text-sm", children: summary.problems.map((p) => (_jsxs("li", { children: [p.label, ": failed ", p.failed, " of ", p.of] }, p.key))) }))] })), _jsx(Card, { className: "space-y-3", children: ordered.map((o, i) => {
|
|
28
42
|
const checks = o.scores ?? null;
|
|
29
43
|
const ok = allPassed(checks);
|
|
30
|
-
return (_jsxs("div", {
|
|
44
|
+
return (_jsxs("div", {
|
|
45
|
+
// The summary's "See them" lands on the first failed answer.
|
|
46
|
+
id: o.error && i === 0 ? "failed" : undefined, className: "scroll-mt-4 rounded-md bg-tint p-3 text-sm", children: [_jsxs("div", { className: "flex justify-between gap-4", children: [_jsx("span", { className: "font-medium", children: titleOf(o.caseId) }), _jsx("span", { className: o.error ? "text-bad" : ok ? "text-good" : "text-warn", children: o.error ? "No answer" : ok ? "Right" : "Wrong" })] }), o.error && _jsx("p", { className: "text-bad", children: o.error }), !o.error && o.output !== null && (_jsx("div", { className: "mt-2", children: suite.fields && suite.labelFromOutput ? (_jsx(FieldValues, { fields: suite.fields.label, values: suite.labelFromOutput(o.output), prefix: `${o.id}-` })) : (_jsx(ReadableOutput, { value: o.output })) })), suite.decisions &&
|
|
31
47
|
checks?.some((c) => c.given !== undefined) && (_jsx("ul", { className: "mt-2 space-y-0.5 text-xs", children: checks
|
|
32
48
|
.filter((c) => c.given !== undefined)
|
|
33
49
|
.map((c) => (_jsxs("li", { children: [_jsxs("span", { className: "text-muted", children: [label(c.key), ":"] }), " ", c.given, " ", _jsx("span", { className: c.pass ? "text-good" : "text-warn", children: c.pass ? "right" : "wrong" })] }, c.key))) })), checks
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunView.js","sourceRoot":"","sources":["../../src/react/RunView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"RunView.js","sourceRoot":"","sources":["../../src/react/RunView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,0DAA0D;AAE1D,sFAAsF;AACtF,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,EAC5B,GAAG,EACH,KAAK,EAAE,GAAG,EACV,KAAK,GAMN;IACC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,KAAK,GAAG;QAAE,OAAO,IAAI,CAAC;IAC3C,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC3C,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzC,G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KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,QAAI,CAAC,CAAC,IAAI,IAAI,QAAQ,KAD7B,CAAC,CAAC,GAAG,CAET,CACL,CAAC,EACH,MAAM;gCACL,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,EAAE,CAAC;iCAChC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;iCACZ,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACb,aAAW,SAAS,EAAC,kCAAkC,+BAC3C,CAAC,CAAC,QAAQ,wBAAU,CAAC,CAAC,MAAM,cAAK,CAAC,CAAC,GAAG,KAD1C,CAAC,CAEL,CACL,CAAC,EACH,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CACtB,KAAC,IAAI,IACH,IAAI,EAAE,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAC/C,SAAS,EAAE,6BAA6B,IAAI,EAAE,gDAGzC,CACR,KAnEI,CAAC,CAAC,EAAE,CAoEL,CACP,CAAC;gBACJ,CAAC,CAAC,GACG,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { LINK } from "./format.js";
|
|
3
3
|
import { GLOSSARY, describeChange, } from "../index.js";
|
|
4
4
|
import { RollBack } from "./RollBack.js";
|
|
5
|
-
import { Link, Chip, InfoTip, Tip } from "./pieces.js";
|
|
5
|
+
import { Link, Chip, InfoTip, Tip, LocalDate } from "./pieces.js";
|
|
6
6
|
import { evalsPath } from "./app.js";
|
|
7
7
|
const KIND = {
|
|
8
8
|
CHANGE: {
|
|
@@ -64,7 +64,7 @@ export function HistoryEntries({ app, suite, entries, liveId, label, defaults, p
|
|
|
64
64
|
return (_jsxs("article", { "aria-label": `Version ${e.to.number}: ${kind.text}`, className: box, children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("span", { className: "flex flex-wrap items-center gap-2", children: [_jsxs("span", { className: "font-medium", children: ["v", e.to.number] }), _jsx(Tip, { text: kind.help, id: `kind-${e.id}`, children: _jsx(Chip, { tone: kind.tone, children: kind.text }) }), isLive && _jsx(Chip, { tone: "live", children: "Live now" })] }), _jsxs("span", { className: "text-xs text-muted", children: [e.by ??
|
|
65
65
|
(e.kind === "OUTSIDE"
|
|
66
66
|
? "Found by the system"
|
|
67
|
-
: "System"), " ", "\u00B7 ",
|
|
67
|
+
: "System"), " ", "\u00B7 ", _jsx(LocalDate, { date: e.createdAt, time: true })] })] }), _jsx("ul", { className: "readable list-disc pl-5", children: (e.kind === "ROLLBACK"
|
|
68
68
|
? [`Back to v${e.to.number}: ${label(e.to.model)} live`]
|
|
69
69
|
: e.kind === "DEPLOY"
|
|
70
70
|
? [unchanged(e.to), "The instructions in code changed"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsHistory.js","sourceRoot":"","sources":["../../src/react/SettingsHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SettingsHistory.js","sourceRoot":"","sources":["../../src/react/SettingsHistory.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,QAAQ,EACR,cAAc,GAIf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClE,OAAO,EAAE,SAAS,EAAsB,MAAM,UAAU,CAAC;AAEzD,MAAM,IAAI,GAGN;IACF,MAAM,EAAE;QACN,IAAI,EAAE,SAAS;QACf,IAAI,EAA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CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,CAC1C,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACd,uBAAgB,IAAI,IAAX,IAAI,CAAa,CAC3B,CAAC,GACC,EACJ,CAAC,CAAC,MAAM,IAAI,YAAG,SAAS,EAAC,qBAAqB,YAAE,CAAC,CAAC,MAAM,GAAK,EAC9D,eAAK,SAAS,EAAC,mCAAmC,aAC/C,MAAM,IAAI,CACT,KAAC,IAAI,IACH,IAAI,EAAE,SAAS,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAC3C,SAAS,EAAE,WAAW,IAAI,EAAE,mCAGvB,CACR,EACA,CAAC,MAAM,IAAI,CACV,KAAC,QAAQ,IACP,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC,gBAAgB,EACpC,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAClB,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,EACnB,IAAI,EAAE,CAAC,CAAC,IAAI,GACZ,CACH,IACG,KAtDD,CAAC,CAAC,EAAE,CAuDD,CACX,CAAC;QACJ,CAAC,CAAC,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SuitePriority } from "../index.js";
|
|
1
2
|
import { type EvalAppConfig } from "./app.js";
|
|
2
3
|
/**
|
|
3
4
|
* Everything a suite's page shows, loaded together: on a remote database
|
|
@@ -57,6 +58,11 @@ export declare function loadSuitePage(app: EvalAppConfig, key: string): Promise<
|
|
|
57
58
|
live: import("../board.js").BoardRow | undefined;
|
|
58
59
|
health: import("../prune.js").AnswerKeyHealth<import("../store.js").CaseRecord>;
|
|
59
60
|
cases: import("../store.js").CaseRecord[];
|
|
61
|
+
priority: SuitePriority;
|
|
62
|
+
splitBy: Record<string, {
|
|
63
|
+
right: string[];
|
|
64
|
+
wrong: string[];
|
|
65
|
+
}>;
|
|
60
66
|
} | null>;
|
|
61
67
|
/** What `loadSuitePage` returns, for sections and custom pages. */
|
|
62
68
|
export type SuitePageData = NonNullable<Awaited<ReturnType<typeof loadSuitePage>>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { FAVOR_TEXT, answerKeyHealth, attacksFrom, barStatus, checkBar, draftAnswers,
|
|
2
|
+
import { FAVOR_TEXT, allPassed, answerKeyHealth, attacksFrom, barStatus, checkBar, draftAnswers, newStarters, orderRows, pctBeside, priorityGain, priorityOf, isInjectionSuite, meanCalibrationError, money, probabilityQuality, perAnswer, retiresLabel, seconds, seriousMistakes, suggest, } from "../index.js";
|
|
3
3
|
import { AnswerKey } from "./AnswerKey.js";
|
|
4
4
|
import { ModelMenu } from "./ModelMenu.js";
|
|
5
|
+
import { PriorityPicker } from "./PriorityPicker.js";
|
|
5
6
|
import { Tabs } from "./Tabs.js";
|
|
6
|
-
import { Link, BackLink, Card, RefreshWhile, Chip, IconSubmit, InfoTip, Score, Select, Spinner, Submit,
|
|
7
|
-
import { pct, LINK } from "./format.js";
|
|
7
|
+
import { Link, BackLink, Card, RefreshWhile, Chip, IconSubmit, InfoTip, Score, Select, Spinner, Submit, Tip, } from "./pieces.js";
|
|
8
|
+
import { pct, LINK, QUIET_BUTTON } from "./format.js";
|
|
8
9
|
import { ChevronDown, RotateCw, ShieldAlert, Sparkles } from "lucide-react";
|
|
9
10
|
import { evalsPath, attacksResisted } from "./app.js";
|
|
10
11
|
import { SettingsHistory } from "./SettingsHistory.js";
|
|
@@ -40,11 +41,14 @@ export async function loadSuitePage(app, key) {
|
|
|
40
41
|
const attacks = attacksFrom(attackBoards);
|
|
41
42
|
// An injection suite's models are chosen on its base suite's page.
|
|
42
43
|
const choosesHere = !isInjectionSuite(suite);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
: null;
|
|
44
|
+
// The suite's priority, or the one an admin chose in its settings.
|
|
45
|
+
const priority = priorityOf(suite, liveSettings.settings);
|
|
46
46
|
const testing = rows.some((r) => r.testing) ||
|
|
47
47
|
attackBoards.some((a) => a.rows.some((r) => r.testing));
|
|
48
|
+
// No suggestion while a test runs: it would weigh half a board.
|
|
49
|
+
const s = choosesHere && !testing
|
|
50
|
+
? suggest(rows, suite.checks, priority, app.models, { attacks })
|
|
51
|
+
: null;
|
|
48
52
|
// What testing each model would cost now, attack cases included,
|
|
49
53
|
// counting answers it would reuse.
|
|
50
54
|
const estimates = new Map(await Promise.all(rows.map(async (r) => [
|
|
@@ -58,7 +62,28 @@ export async function loadSuitePage(app, key) {
|
|
|
58
62
|
const showAttacks = attackBoards.some((a) => a.cases > 0);
|
|
59
63
|
const live = rows.find((r) => r.live);
|
|
60
64
|
// What would keep the answer key useful, from the same tests.
|
|
61
|
-
const
|
|
65
|
+
const current = rows.filter((r) => r.test && !r.test.stale && !r.baseline);
|
|
66
|
+
const testedAt = current.reduce((m, r) => (r.test && (!m || r.test.at > m) ? r.test.at : m), null);
|
|
67
|
+
const health = answerKeyHealth(cases, b.caseResults, new Date(), testedAt);
|
|
68
|
+
// For each split case, which models got it fully right and which didn't,
|
|
69
|
+
// so a person sees the disagreement before deciding.
|
|
70
|
+
const split = new Set(health.split.map((c) => c.id));
|
|
71
|
+
const splitBy = {};
|
|
72
|
+
if (split.size)
|
|
73
|
+
await Promise.all(current
|
|
74
|
+
.filter((r) => !r.variant)
|
|
75
|
+
.map(async (r) => {
|
|
76
|
+
if (!r.test)
|
|
77
|
+
return;
|
|
78
|
+
for (const o of await app.store.listOutputs(r.test.runId)) {
|
|
79
|
+
if (!split.has(o.caseId) || o.error)
|
|
80
|
+
continue;
|
|
81
|
+
const side = allPassed(o.scores) ? "right" : "wrong";
|
|
82
|
+
const entry = (splitBy[o.caseId] ??= { right: [], wrong: [] });
|
|
83
|
+
if (!entry[side].includes(r.label))
|
|
84
|
+
entry[side].push(r.label);
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
62
87
|
return {
|
|
63
88
|
app,
|
|
64
89
|
key,
|
|
@@ -79,10 +104,22 @@ export async function loadSuitePage(app, key) {
|
|
|
79
104
|
live,
|
|
80
105
|
health,
|
|
81
106
|
cases,
|
|
107
|
+
priority,
|
|
108
|
+
splitBy,
|
|
82
109
|
};
|
|
83
110
|
}
|
|
84
111
|
/** A share as a whole percent, or a dash when there's nothing to show. */
|
|
85
112
|
const asPct = (x) => (x === null ? "—" : pct(x));
|
|
113
|
+
/**
|
|
114
|
+
* What a priority means for the suggestion, as a sentence: the
|
|
115
|
+
* explanation without its leading name ("cost: this runs…").
|
|
116
|
+
*/
|
|
117
|
+
const whyFavor = (favor) => {
|
|
118
|
+
const text = FAVOR_TEXT[favor].replace(/^\w+: /, "");
|
|
119
|
+
return `${text.charAt(0).toUpperCase()}${text.slice(1)}.`;
|
|
120
|
+
};
|
|
121
|
+
/** The suite's priority, as the page names it. */
|
|
122
|
+
const FAVORS = { cost: "cost", speed: "speed", quality: "accuracy" };
|
|
86
123
|
const VS = {
|
|
87
124
|
BETTER: "More accurate",
|
|
88
125
|
SAME: "About as accurate",
|
|
@@ -92,7 +129,7 @@ const VS = {
|
|
|
92
129
|
/** The suite's name, what it tests, and its priority. */
|
|
93
130
|
export function SuiteHeader({ data }) {
|
|
94
131
|
const { app, suite } = data;
|
|
95
|
-
return (_jsx(_Fragment, { children: _jsxs("div", { className: "space-y-2", children: [_jsx(BackLink, { href: app.basePath, children: "Evals" }), _jsx("h1", { className: "text-2xl font-semibold", children: suite.label }), _jsx("p", { className: "readable text-muted", children: suite.description })
|
|
132
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "space-y-2", children: [_jsx(BackLink, { href: app.basePath, children: "Evals" }), _jsx("h1", { className: "text-2xl font-semibold", children: suite.label }), _jsx("p", { className: "readable text-muted", children: suite.description })] }) }));
|
|
96
133
|
}
|
|
97
134
|
/** On an injection suite: models are chosen on its base suite, with a link there. */
|
|
98
135
|
export function ChosenOnBase({ data }) {
|
|
@@ -101,9 +138,11 @@ export function ChosenOnBase({ data }) {
|
|
|
101
138
|
}
|
|
102
139
|
/** Which models to make live and the fallback, and why; shown when nothing would change too. */
|
|
103
140
|
export function SuggestionCard({ data }) {
|
|
104
|
-
const { app, key, s } = data;
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
const { app, key, s, choosesHere, testing } = data;
|
|
142
|
+
if (choosesHere && testing)
|
|
143
|
+
return (_jsxs("section", { className: "space-y-3", "aria-labelledby": "suggestion", children: [_jsxs("h2", { id: "suggestion", className: "text-lg font-semibold", children: ["Suggested", _jsx(InfoTip, { term: "suggestion" })] }), _jsx(Card, { children: _jsx("p", { className: "readable text-sm text-muted", children: "Waiting for the tests running now to finish. The suggestion weighs every model's finished test, so it follows then." }) })] }));
|
|
144
|
+
return (_jsx(_Fragment, { children: s && (_jsxs("section", { className: "space-y-3", "aria-labelledby": "suggestion", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("h2", { id: "suggestion", className: "text-lg font-semibold", children: [s.same ? "No change suggested" : "Suggested", _jsx(InfoTip, { term: "suggestion" })] }), !s.same &&
|
|
145
|
+
!(s.retestLive && (!s.fallback || s.fallback.fallback)) && (_jsxs("form", { action: app.actions.useSuggestion, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx(Submit, { children: "Use these" })] }))] }), _jsxs(Card, { className: "space-y-3", children: [!s.same && (_jsxs("p", { children: ["Live: ", _jsx("strong", { children: s.live.label }), s.fallback && (_jsxs(_Fragment, { children: [" ", "\u00B7 Fallback: ", _jsx("strong", { children: s.fallback.label })] }))] })), _jsx("ul", { className: "readable list-disc space-y-1 pl-5 text-sm text-muted", children: s.reasons.map((r) => (_jsx("li", { children: r }, r))) })] })] })) }));
|
|
107
146
|
}
|
|
108
147
|
/** Cases whose words appear in the feature's instructions. */
|
|
109
148
|
export function CasesInInstructions({ data }) {
|
|
@@ -112,18 +151,30 @@ export function CasesInInstructions({ data }) {
|
|
|
112
151
|
}
|
|
113
152
|
/** Every model the feature can use: its latest test, how it compares with live, under attack, and buttons to test it or choose it. */
|
|
114
153
|
export function ModelTable({ data }) {
|
|
115
|
-
const { app, key, suite, rows, attackBoards, choosesHere, estimates, showAttacks, live, } = data;
|
|
116
|
-
|
|
154
|
+
const { app, key, suite, rows, attackBoards, choosesHere, estimates, showAttacks, live, s, priority, } = data;
|
|
155
|
+
const suggestedLive = s && !s.keepLive ? s.live.key : null;
|
|
156
|
+
const suggestedFallback = s?.fallback && !s.fallback.fallback ? s.fallback.key : null;
|
|
157
|
+
const ordered = orderRows(rows, suite.checks, priority, {
|
|
158
|
+
live: suggestedLive,
|
|
159
|
+
});
|
|
160
|
+
return (_jsx(_Fragment, { children: _jsxs("section", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between gap-4", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("h2", { className: "text-lg font-semibold", children: "Models" }), choosesHere && app.actions.setPriority ? (_jsx(PriorityPicker, { action: app.actions.setPriority, suite: key, favor: priority.favor, own: suite.priority.favor, label: `Favors ${FAVORS[priority.favor]}`, why: whyFavor(priority.favor) })) : (_jsx(Tip, { text: whyFavor(priority.favor), side: "bottom", id: "favors", children: _jsxs(Chip, { tone: "neutral", children: ["Favors ", FAVORS[priority.favor]] }) }))] }), _jsx("div", { className: "flex items-center gap-4", children: _jsxs("form", { action: app.actions.testAll, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx(Submit, { variant: "quiet", children: "Test every model" })] }) })] }), _jsx(Card, { className: "overflow-x-auto p-0 lg:overflow-visible", children: _jsxs("table", { className: "w-full text-sm", children: [_jsx("thead", { className: "text-left text-muted", children: _jsxs("tr", { className: "border-b border-line", children: [_jsx("th", { className: "p-3 font-normal", children: "Model" }), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "score", side: "bottom", children: "Accuracy" }) }), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "seriousMistakes", side: "bottom", children: "Serious mistakes" }) }), showAttacks && (_jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "attacksResisted", side: "bottom", children: "Attacks resisted" }) })), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "time", side: "bottom", align: "end", children: "Speed" }) }), suite.decisions && (_jsxs(_Fragment, { children: [_jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "probabilityQuality", side: "bottom", children: "Probability quality" }) }), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "calibrationError", side: "bottom", align: "end", children: "Calibration error" }) })] })), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "cost", side: "bottom", align: "end", children: "Cost" }) }), _jsx("th", { className: "p-3 font-normal", children: _jsx(Tip, { term: "againstLive", side: "bottom", align: "end", children: "Against live" }) }), _jsx("th", { className: "p-3" })] }) }), _jsx("tbody", { children: ordered.map((r) => (_jsxs("tr", { className: "border-b border-line last:border-0", children: [_jsx("td", { className: "p-3", children: _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("span", { className: r.live ? "font-semibold" : "font-medium", children: r.label }), r.live && (_jsx(Tip, { term: "live", side: "bottom", id: `live-${r.key}`, children: _jsx(Chip, { tone: "live", children: "Live" }) })), r.fallback && (_jsx(Tip, { term: "fallback", side: "bottom", id: `fallback-${r.key}`, children: _jsx(Chip, { tone: "fallback", children: "Fallback" }) })), (r.key === suggestedLive ||
|
|
161
|
+
r.key === suggestedFallback) && (_jsx(Tip, { term: "suggestion", side: "bottom", id: `suggested-${r.key}`, children: _jsx(Chip, { tone: "suggested", children: r.key === suggestedLive
|
|
162
|
+
? "Suggested"
|
|
163
|
+
: "Suggested fallback" }) })), retiresLabel(app.models, r.model) && (_jsx(Tip, { term: "retiring", side: "bottom", id: `retiring-${r.key}`, children: _jsxs(Chip, { tone: "warn", children: ["Retires ", retiresLabel(app.models, r.model)] }) })), suite.decisions && app.models[r.model]?.decisions && (_jsx(Tip, { term: app.models[r.model]?.decisions === "native"
|
|
117
164
|
? "nativeProbabilities"
|
|
118
165
|
: "promptedProbabilities", side: "bottom", id: `decisions-${r.key}`, children: _jsx(Chip, { tone: "neutral", children: app.models[r.model]?.decisions === "native"
|
|
119
166
|
? "Native probabilities"
|
|
120
|
-
: "Prompted" }) })), r.test?.stale && (_jsx(Tip, { term: "outOfDate", side: "bottom", id: `stale-${r.key}`, children: _jsx(Chip, { tone: "neutral", children: "Out of date" }) }))] }) }), _jsx("td", { className: "p-3", children: r.testing ? (_jsx("span", { role: "status", title: "Testing", className: "inline-flex text-accent", children: _jsx(Spinner, {}) })) : r.test ? (_jsx(Link, { href: evalsPath(app, key, "runs", r.test.runId), children: _jsx(Score, { right: r.test.right, total: r.test.total }) })) : (_jsx("span", { className: "text-muted", children: r.failed ?? "Not tested" })) }), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? seriousMistakes(r, suite.checks) : "—" }), showAttacks && (_jsx("td", { className: "p-3", children: _jsx("div", { className: "flex flex-col gap-1", children: attackBoards.map((a) => (_jsx(UnderAttack, { app: app, attackSuite: a.suite.key, attackLabel: a.suite.label, row: a.rows.find((x) => x.key === r.key), resisted: attacksResisted(r.key, [a]) }, a.suite.key))) }) })), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? seconds(r.test.avgMs) : "—" }), suite.decisions && (_jsxs(_Fragment, { children: [_jsx("td", { className: "p-3 tabular-nums", children: asPct(r.test ? probabilityQuality(r.test.measures) : null) }), _jsx("td", { className: "p-3 tabular-nums", children: asPct(r.test ? meanCalibrationError(r.test.measures) : null) })] })), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? perAnswer(r.test.costPerAnswer) : "—" }), _jsx("td", { className: "p-3", children: r.vsLive && live?.test && r.test && !r.live ? (
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
167
|
+
: "Prompted" }) })), r.test?.stale && (_jsx(Tip, { term: "outOfDate", side: "bottom", id: `stale-${r.key}`, children: _jsx(Chip, { tone: "neutral", children: "Out of date" }) }))] }) }), _jsx("td", { className: "p-3", children: r.testing ? (_jsx("span", { role: "status", title: "Testing", className: "inline-flex text-accent", children: _jsx(Spinner, {}) })) : r.test ? (_jsxs("div", { className: "flex flex-col gap-0.5", children: [_jsx(Link, { href: evalsPath(app, key, "runs", r.test.runId), children: _jsx(Score, { right: r.test.right, total: r.test.total }) }), !r.test.stale && r.test.failedAnswers > 0 && (_jsxs(Link, { href: `${evalsPath(app, key, "runs", r.test.runId)}#failed`, className: "text-xs text-muted hover:underline", children: [r.test.failedAnswers, " ", r.test.failedAnswers === 1 ? "answer" : "answers", " ", "failed: see why"] }))] })) : (_jsx("span", { className: "text-muted", children: r.failed ?? "Not tested" })) }), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? seriousMistakes(r, suite.checks) : "—" }), showAttacks && (_jsx("td", { className: "p-3", children: _jsx("div", { className: "flex flex-col gap-1", children: attackBoards.map((a) => (_jsx(UnderAttack, { app: app, attackSuite: a.suite.key, attackLabel: a.suite.label, row: a.rows.find((x) => x.key === r.key), resisted: attacksResisted(r.key, [a]) }, a.suite.key))) }) })), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? seconds(r.test.avgMs) : "—" }), suite.decisions && (_jsxs(_Fragment, { children: [_jsx("td", { className: "p-3 tabular-nums", children: asPct(r.test ? probabilityQuality(r.test.measures) : null) }), _jsx("td", { className: "p-3 tabular-nums", children: asPct(r.test ? meanCalibrationError(r.test.measures) : null) })] })), _jsx("td", { className: "p-3 tabular-nums", children: r.test ? perAnswer(r.test.costPerAnswer) : "—" }), _jsx("td", { className: "p-3", children: r.vsLive && live?.test && r.test && !r.live ? (_jsxs(Link, { href: `${evalsPath(app, key, "compare")}?${new URLSearchParams({ a: live.test.runId, b: r.test.runId })}`, className: LINK, children: [VS[r.vsLive], (r.vsLive === "SAME" || r.vsLive === "BETTER") &&
|
|
168
|
+
priorityGain(r, live, priority) &&
|
|
169
|
+
`, ${priorityGain(r, live, priority)}`] })) : r.vsLive ? (VS[r.vsLive]) : ("—") }), _jsx("td", { className: "p-3", children: _jsx("div", { className: "flex justify-end", children: _jsx(ModelMenu, { suite: key, model: r.model, label: r.label, test: {
|
|
170
|
+
action: app.actions.testModel,
|
|
171
|
+
text: r.test ? "Test again" : "Test",
|
|
172
|
+
note: estimateText(estimates.get(r.key)),
|
|
173
|
+
}, makeLive: choosesHere && !r.live && r.canMakeLive
|
|
174
|
+
? app.actions.makeLive
|
|
175
|
+
: null, makeFallback: choosesHere && r.canMakeFallback
|
|
176
|
+
? app.actions.makeFallback
|
|
177
|
+
: null, effort: r.variant ? r.effort : undefined }) }) })] }, r.key))) })] }) })] }) }));
|
|
127
178
|
}
|
|
128
179
|
/**
|
|
129
180
|
* Testing a model at a reasoning setting other than the feature's: less
|
|
@@ -167,7 +218,7 @@ export function CheckBreakdownSection({ data }) {
|
|
|
167
218
|
].map(([k, text]) => (_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx("span", { className: `inline-block h-3 w-3 rounded ${BAR_TONE[k]}` }), text] }, k))) }), _jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full text-left text-sm", children: [_jsx("thead", { className: "text-xs text-muted", children: _jsxs("tr", { children: [_jsx("th", { className: "py-2 pr-4 font-normal", children: "Check" }), _jsx("th", { className: "py-2 pr-4 font-normal", children: "Bar" }), tested.map((r) => (_jsx("th", { className: "py-2 pr-3 font-normal", children: r.label }, r.key)))] }) }), _jsxs("tbody", { children: [checks.map((c) => (_jsxs("tr", { children: [_jsxs("td", { className: "py-1.5 pr-4", children: [_jsx("span", { className: "mr-2", children: c.label }), _jsx(Chip, { tone: c.severity === "serious" ? "serious" : "neutral", children: c.severity })] }), _jsx("td", { className: "py-1.5 pr-4 tabular-nums text-muted", children: pct(checkBar(c)) }), tested.map((r) => {
|
|
168
219
|
const x = r.test?.byCheck[c.key];
|
|
169
220
|
const rate = x?.n ? x.passed / x.n : null;
|
|
170
|
-
return (_jsx("td", { className: "py-1 pr-2", children: rate === null ? (_jsx("span", { className: "text-muted", children: "\u2013" })) : (_jsx("span", { className: `inline-block rounded px-2 py-0.5 tabular-nums ${BAR_TONE[barStatus(rate, checkBar(c))]}`, children:
|
|
221
|
+
return (_jsx("td", { className: "py-1 pr-2", children: rate === null ? (_jsx("span", { className: "text-muted", children: "\u2013" })) : (_jsx("span", { className: `inline-block rounded px-2 py-0.5 tabular-nums ${BAR_TONE[barStatus(rate, checkBar(c))]}`, children: pctBeside(rate, checkBar(c)) })) }, r.key));
|
|
171
222
|
})] }, c.key))), _jsxs("tr", { children: [_jsx("td", { className: "py-1.5 pr-4", children: "Answers with no mistakes at all" }), _jsx("td", {}), tested.map((r) => (_jsxs("td", { className: "py-1.5 pr-3 tabular-nums", children: [r.test?.answersRight, " of ", r.test?.answers] }, r.key)))] })] })] }) })] })] }));
|
|
172
223
|
}
|
|
173
224
|
/** The feature's settings history, with rollback; not on an injection suite. */
|
|
@@ -178,11 +229,14 @@ export function Versions({ data }) {
|
|
|
178
229
|
/** Each check: what it checks, its severity and bar, and how the live model does. */
|
|
179
230
|
export function ChecksSection({ data }) {
|
|
180
231
|
const { suite, live } = data;
|
|
181
|
-
return (_jsx(_Fragment, { children: _jsxs("section", { className: "space-y-3", children: [_jsxs("h2", { className: "text-lg font-semibold", children: ["Checks", _jsx(InfoTip, { term: "checks" })] }), _jsx("div", { className: "grid gap-3 md:grid-cols-2", children:
|
|
232
|
+
return (_jsx(_Fragment, { children: _jsxs("section", { className: "space-y-3", children: [_jsxs("h2", { className: "text-lg font-semibold", children: ["Checks", _jsx(InfoTip, { term: "checks" })] }), _jsx("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
233
|
+
...suite.checks.filter((c) => c.severity === "serious"),
|
|
234
|
+
...suite.checks.filter((c) => c.severity !== "serious"),
|
|
235
|
+
].map((c) => {
|
|
182
236
|
const rate = live?.test?.byCheck[c.key];
|
|
183
237
|
return (_jsxs(Card, { className: "space-y-1", children: [_jsxs("div", { className: "flex justify-between gap-4", children: [_jsx("h3", { className: "font-medium", children: c.label }), _jsx(Tip, { term: c.severity, id: `severity-${c.key}`, children: _jsx(Chip, { tone: c.severity === "serious" ? "serious" : "neutral", children: c.severity }) })] }), _jsx("p", { className: "readable text-sm text-muted", children: c.description }), _jsxs("p", { className: "text-sm", children: [rate && rate.n > 0 && (_jsxs(_Fragment, { children: ["Live:", " ", _jsx("span", { className: rate.passed / rate.n >= checkBar(c)
|
|
184
238
|
? "text-good"
|
|
185
|
-
: "text-warn", children:
|
|
239
|
+
: "text-warn", children: pctBeside(rate.passed / rate.n, checkBar(c)) }), " ", "(", rate.passed, "/", rate.n, ") \u00B7", " "] })), _jsx(Tip, { term: "bar", id: `bar-${c.key}`, children: _jsxs("span", { className: "text-muted", children: ["Bar: ", pct(checkBar(c))] }) })] })] }, c.key));
|
|
186
240
|
}) })] }) }));
|
|
187
241
|
}
|
|
188
242
|
/**
|
|
@@ -211,7 +265,6 @@ export function AnswerKeyToolsSection({ data }) {
|
|
|
211
265
|
actions.addStarters && fresh.length > 0 && (_jsxs(Card, { className: "space-y-3", children: [_jsxs("p", { className: "readable text-sm", children: [inUse.length
|
|
212
266
|
? `${fresh.length} more starter ${fresh.length === 1 ? "case is" : "cases are"} ready.`
|
|
213
267
|
: `No cases yet. Start with the suite's ${fresh.length} starter ${fresh.length === 1 ? "case" : "cases"}.`, " ", "Each needs your review and counts only once you confirm it, unless the suite's author already reviewed it."] }), _jsxs("form", { action: actions.addStarters, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsxs(Submit, { variant: inUse.length ? "quiet" : "primary", children: [_jsx(Sparkles, { "aria-hidden": true, className: "mr-1.5 inline h-4 w-4" }), "Add ", fresh.length, " starter ", fresh.length === 1 ? "case" : "cases"] })] })] }, "starters")),
|
|
214
|
-
actions.draftMore && suite.draftMore && inUse.length > 0 && (_jsxs("details", { className: "group rounded-lg border border-line bg-card", children: [_jsxs("summary", { className: "flex cursor-pointer list-none items-center justify-between gap-3 p-4 text-sm font-medium", children: [_jsxs("span", { className: "flex items-center gap-1.5", children: [_jsx(Sparkles, { "aria-hidden": true, className: "h-4 w-4" }), "Draft ", draftsToTarget(inUse.length), " more cases"] }), _jsx(ChevronDown, { "aria-hidden": true, className: "h-4 w-4 transition-transform group-open:rotate-180" })] }), _jsxs("form", { action: actions.draftMore, className: "space-y-3 px-4 pb-4", children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsxs("div", { children: [_jsx("label", { htmlFor: "draft-focus", className: "block text-sm font-medium", children: "Anything to focus on? (optional)" }), _jsx(TextInput, { id: "draft-focus", name: "focus", maxLength: 500, placeholder: "e.g. longer, messier notes; more than one owner", className: "mt-1 w-full rounded-md border border-line bg-card px-3 py-2 text-sm" }), _jsx("p", { className: "readable mt-1 text-xs text-muted", children: "A model looks at the cases you have and covers what's missing. Drafts need your review and count only once you confirm them." })] }), _jsx(Submit, { children: "Draft cases" })] })] }, "draft")),
|
|
215
268
|
].filter(Boolean);
|
|
216
269
|
if (!parts.length)
|
|
217
270
|
return null;
|
|
@@ -223,6 +276,7 @@ export function AnswerKeySection({ data }) {
|
|
|
223
276
|
// A feature's attack cases are a tab of its answer key.
|
|
224
277
|
const attacked = attackBoards.filter((a) => a.cases > 0);
|
|
225
278
|
const cases = (_jsx(AnswerKey, { app: app, suite: suite, rows: rows, heading: _jsxs("h2", { className: "text-lg font-semibold", children: ["Answer key (", b.cases, " cases in use)", _jsx(InfoTip, { term: "answerKey" })] }), tools: _jsxs(_Fragment, { children: [suite.caseKind === "imported" &&
|
|
279
|
+
suite.rateBlind !== false &&
|
|
226
280
|
(suite.labelFromForm || app.answerEditors[key]) && (_jsx(Tip, { control: true, term: "rateBlind", side: "bottom", align: "end", children: _jsx(Link, { href: evalsPath(app, key, "rate"), className: "inline-flex items-center rounded-md border border-accent/40 bg-card px-3 py-1.5 text-sm text-accent hover:bg-accent/10", children: "Rate blind" }) })), _jsxs("form", { action: app.actions.rescore, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx(Tip, { control: true, term: "rescore", side: "bottom", align: "end", children: _jsx(IconSubmit, { label: "Rescore tests", icon: _jsx(RotateCw, { "aria-hidden": true, className: "h-4 w-4" }) }) })] })] }) }));
|
|
227
281
|
return (
|
|
228
282
|
// The weekly check links here to review drafts.
|
|
@@ -231,19 +285,21 @@ export function AnswerKeySection({ data }) {
|
|
|
231
285
|
...attacked.map((a) => ({
|
|
232
286
|
id: a.suite.key,
|
|
233
287
|
title: `Attacks (${a.cases})`,
|
|
234
|
-
panel: (_jsx(AnswerKey, { app: app, readOnly: true, suite: a.suite, rows: a.rows, heading: _jsx("p", { className: "readable text-sm text-muted", children: "Each is a confirmed case with an attack planted where untrusted text goes, and keeps that case's answer. A model's Test runs them, and they follow the cases as answers change." }) })),
|
|
288
|
+
panel: (_jsx(AnswerKey, { app: app, readOnly: true, suite: a.suite, rows: a.rows, heading: _jsx("p", { className: "readable text-sm text-muted", children: "Each is a confirmed case with an attack planted where untrusted text goes, and keeps that case's answer. A model's Test runs them, and they follow the cases as answers change." }), tools: _jsxs(_Fragment, { children: [_jsx("a", { href: "https://seanhudson.github.io/evalkeeper/guides/suites/#more-attacks", className: LINK, children: "Add an attack" }), app.actions.makeAttackCases && (_jsxs("form", { action: app.actions.makeAttackCases, children: [_jsx("input", { type: "hidden", name: "suite", value: a.suite.key }), _jsx(Submit, { variant: "quiet", children: "Update attack cases" })] }))] }) })),
|
|
235
289
|
})),
|
|
236
290
|
] })) }));
|
|
237
291
|
}
|
|
238
|
-
/**
|
|
239
|
-
|
|
292
|
+
/**
|
|
293
|
+
* What testing a model costs now, as the menu says it: "free, all 34
|
|
294
|
+
* reused", "~$0.10, 15 of 34 reused". Null before any cases.
|
|
295
|
+
*/
|
|
296
|
+
function estimateText(estimate) {
|
|
240
297
|
if (!estimate || estimate.answers === 0)
|
|
241
298
|
return null;
|
|
242
299
|
const { answers, reused, costUsd } = estimate;
|
|
243
|
-
|
|
244
|
-
? `
|
|
245
|
-
: `${costUsd === null ? "
|
|
246
|
-
return (_jsx(Tip, { text: "What testing this model costs now. Answers an identical request gave in the last 7 days are reused for free.", id: `estimate-${id}`, side: "bottom", align: "end", children: _jsx("span", { className: "whitespace-nowrap text-xs text-muted", children: text }) }));
|
|
300
|
+
return reused === answers
|
|
301
|
+
? `free, all ${answers} reused`
|
|
302
|
+
: `${costUsd === null ? "cost unknown" : `~${money(costUsd)}`}${reused ? `, ${reused} of ${answers} reused` : ""}`;
|
|
247
303
|
}
|
|
248
304
|
/**
|
|
249
305
|
* A model's serious mistakes on one injection suite, linked to that test,
|
|
@@ -255,11 +311,7 @@ function UnderAttack({ app, attackSuite, attackLabel, row, resisted, }) {
|
|
|
255
311
|
if (row?.testing)
|
|
256
312
|
return (_jsx("span", { role: "status", title: "Testing", className: "inline-flex text-accent", children: _jsx(Spinner, {}) }));
|
|
257
313
|
if (row?.test)
|
|
258
|
-
return (
|
|
259
|
-
? " · out of date"
|
|
260
|
-
: row.test.failedAnswers
|
|
261
|
-
? " · answers failed"
|
|
262
|
-
: ""] }));
|
|
314
|
+
return (_jsx(Link, { href: evalsPath(app, attackSuite, "runs", row.test.runId), title: attackLabel, className: "tabular-nums", children: row.test.stale ? (`${resisted ? pct(resisted.resisted / resisted.of) : "—"} · out of date`) : row.test.failedAnswers && !resisted ? (_jsx(Tip, { term: "attackFailures", side: "bottom", id: `attack-failed-${row.key}`, children: _jsxs("span", { className: "text-warn", children: [row.test.failedAnswers, " failed: test again"] }) })) : resisted ? (pct(resisted.resisted / resisted.of)) : ("—") }));
|
|
263
315
|
// Not tested yet: the model's Test runs the attacks with its cases.
|
|
264
316
|
return _jsx("span", { className: "text-muted", children: "\u2014" });
|
|
265
317
|
}
|
|
@@ -270,7 +322,7 @@ function UnderAttack({ app, attackSuite, attackLabel, row, resisted, }) {
|
|
|
270
322
|
* an injection suite, whose cases are made from its base suite's.
|
|
271
323
|
*/
|
|
272
324
|
export function AnswerKeyHealthSection({ data }) {
|
|
273
|
-
const { app, key, suite, health: h, choosesHere } = data;
|
|
325
|
+
const { app, key, suite, health: h, choosesHere, splitBy } = data;
|
|
274
326
|
const thin = h.tags.filter(([, n]) => n === 1).map(([t]) => t);
|
|
275
327
|
const needs = h.easyToRetire.length ||
|
|
276
328
|
h.split.length ||
|
|
@@ -284,10 +336,19 @@ export function AnswerKeyHealthSection({ data }) {
|
|
|
284
336
|
return p.success ? suite.title(p.data) : "(case)";
|
|
285
337
|
};
|
|
286
338
|
const caseLink = (c) => (_jsx("a", { href: `#case-${c.id}`, className: LINK, children: title(c) }));
|
|
287
|
-
const { retireEasy, retireStaleDrafts } = app.actions;
|
|
339
|
+
const { retireEasy, retireStaleDrafts, keepAnswer } = app.actions;
|
|
288
340
|
const cases = (n) => `${n} ${n === 1 ? "case" : "cases"}`;
|
|
289
341
|
const drafts = (n) => `${n} ${n === 1 ? "draft" : "drafts"}`;
|
|
290
|
-
|
|
342
|
+
const { draftMore } = app.actions;
|
|
343
|
+
const check = h.split.length > 0 || h.duplicates.length > 0;
|
|
344
|
+
const retire = h.easyToRetire.length > 0 || h.staleDrafts.length > 0;
|
|
345
|
+
return (_jsxs("section", { className: "space-y-3", "aria-labelledby": "answer-key-health", children: [_jsxs("h2", { id: "answer-key-health", className: "text-lg font-semibold", children: ["Answer key health", _jsx(InfoTip, { term: "answerKeyHealth" })] }), _jsxs(Card, { className: "space-y-6 text-sm", children: [check && (_jsxs("div", { className: "readable space-y-3", children: [_jsx("h3", { className: "font-medium", children: "Check these answers" }), h.split.length > 0 && (_jsxs("div", { className: "space-y-2", children: [_jsxs("p", { children: ["Models split about evenly on ", cases(h.split.length), ": some give the answer key's answer, some don't. For each, decide who's right. Keep the answer if it's right, fix it if the models were, or retire the case if there's no right answer.", _jsx(InfoTip, { term: "splitCases" })] }), _jsx("ul", { className: "space-y-2", children: h.split.map((c) => {
|
|
346
|
+
const by = splitBy[c.id];
|
|
347
|
+
const names = (xs) => new Intl.ListFormat("en-US").format(xs);
|
|
348
|
+
return (_jsxs("li", { className: "space-y-2 rounded-md bg-tint p-3", children: [_jsx("div", { className: "font-medium", children: caseLink(c) }), by && (_jsxs("p", { className: "text-xs text-muted", children: [by.right.length > 0 &&
|
|
349
|
+
`Gave the answer key's answer: ${names(by.right)}. `, by.wrong.length > 0 &&
|
|
350
|
+
`Didn't: ${names(by.wrong)}.`] })), _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [keepAnswer && (_jsxs("form", { action: keepAnswer, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx("input", { type: "hidden", name: "case", value: c.id }), _jsx(Submit, { variant: "quiet", children: "The answer is right" })] })), _jsx("a", { href: `#case-${c.id}`, className: `inline-flex items-center rounded-md px-3 py-1.5 text-sm ${QUIET_BUTTON}`, children: "Fix the answer" }), _jsxs("form", { action: app.actions.retireCase, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx("input", { type: "hidden", name: "case", value: c.id }), _jsx(Submit, { variant: "quiet", children: "Retire it" })] })] })] }, c.id));
|
|
351
|
+
}) })] })), h.duplicates.length > 0 && (_jsxs("div", { className: "space-y-1", children: [_jsxs("p", { children: ["These pairs share nearly all their words, so each counts twice. Keep the clearer one and retire the other.", _jsx(InfoTip, { term: "nearDuplicates" })] }), _jsx("ul", { className: "list-disc space-y-0.5 pl-5", children: h.duplicates.map(([a, b]) => (_jsxs("li", { children: [caseLink(a), " and ", caseLink(b)] }, `${a.id}-${b.id}`))) })] }))] })), thin.length > 0 && (_jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "font-medium", children: "Add cases here" }), _jsxs("p", { className: "readable", children: [thin.length, " ", thin.length === 1 ? "topic has" : "topics have", " ", "only one case, so the score on each rests on a single example: one mistake swings it, and a fix can't be confirmed. Add a case or two to each.", _jsx(InfoTip, { term: "tagCoverage" })] }), draftMore && suite.draftMore ? (_jsxs("form", { action: draftMore, className: "space-y-2", children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsx("ul", { className: "flex flex-wrap gap-1.5", children: thin.map((t) => (_jsx("li", { children: _jsxs("label", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-800 has-[:checked]:bg-amber-300 dark:bg-amber-500/15 dark:text-amber-200 dark:has-[:checked]:bg-amber-500/40", children: [_jsx("input", { type: "checkbox", name: "topic", value: t, className: "h-3 w-3 accent-amber-700" }), t] }) }, t))) }), _jsx(Submit, { variant: "quiet", children: "Draft cases for the topics you picked" }), _jsx("p", { className: "readable text-xs text-muted", children: "Two drafts a topic, to confirm like any draft. Pick none to cover them all." })] })) : (_jsxs(_Fragment, { children: [_jsx("ul", { className: "flex flex-wrap gap-1.5", children: thin.map((t) => (_jsx("li", { children: _jsx("a", { href: `#add-case=${encodeURIComponent(t)}`, className: "inline-flex rounded-full bg-amber-100 px-2 py-0.5 text-xs text-amber-800 hover:underline dark:bg-amber-500/15 dark:text-amber-200", children: t }) }, t))) }), _jsx("p", { className: "readable text-xs text-muted", children: "Pick a topic to add a case with it already tagged." })] })), _jsxs("details", { className: "group", children: [_jsx("summary", { className: "cursor-pointer text-muted", children: "Show all topics" }), _jsx("ul", { className: "mt-2 flex flex-wrap gap-1.5", children: h.tags.map(([t, n]) => (_jsx("li", { children: _jsxs(Chip, { tone: n === 1 ? "warn" : "neutral", children: [t, " \u00B7 ", n] }) }, t))) })] })] })), retire && (_jsxs("div", { className: "readable space-y-3", children: [_jsx("h3", { className: "font-medium", children: "Retire these" }), h.easyToRetire.length > 0 && (_jsxs("div", { className: "space-y-2", children: [_jsxs("p", { children: ["Every current model gets ", cases(h.easy.length), " fully right, so they no longer tell models apart. Retire", " ", h.easyToRetire.length, " and keep", " ", h.easy.length - h.easyToRetire.length, " as a floor, so a test still catches a model that breaks the basics. Recent tests are rescored for free.", _jsx(InfoTip, { term: "easyCases" })] }), retireEasy && (_jsxs("form", { action: retireEasy, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsxs(Submit, { variant: "quiet", children: ["Retire ", h.easyToRetire.length, " easy", " ", h.easyToRetire.length === 1 ? "case" : "cases"] })] }))] })), h.staleDrafts.length > 0 && (_jsxs("div", { className: "space-y-2", children: [_jsxs("p", { children: [drafts(h.staleDrafts.length), " nobody reviewed in 30 days. The weekly check retires them on its own.", _jsx(InfoTip, { term: "oldDrafts" })] }), retireStaleDrafts && (_jsxs("form", { action: retireStaleDrafts, children: [_jsx("input", { type: "hidden", name: "suite", value: key }), _jsxs(Submit, { variant: "quiet", children: ["Retire ", h.staleDrafts.length, " old", " ", h.staleDrafts.length === 1 ? "draft" : "drafts", " now"] })] }))] }))] }))] })] }));
|
|
291
352
|
}
|
|
292
353
|
/**
|
|
293
354
|
* A suite's page as Evalkeeper arranges it, or null for a suite you don't
|