@crowandraven/evalkeeper 0.13.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.
Files changed (90) hide show
  1. package/dist/drafts.d.ts +2 -0
  2. package/dist/drafts.js +3 -1
  3. package/dist/drafts.js.map +1 -1
  4. package/dist/failures.d.ts +16 -0
  5. package/dist/failures.js +40 -0
  6. package/dist/failures.js.map +1 -0
  7. package/dist/health.js +2 -1
  8. package/dist/health.js.map +1 -1
  9. package/dist/index.d.ts +1 -0
  10. package/dist/index.js +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/legs.d.ts +4 -1
  13. package/dist/legs.js +6 -2
  14. package/dist/legs.js.map +1 -1
  15. package/dist/next/actions.js +53 -9
  16. package/dist/next/actions.js.map +1 -1
  17. package/dist/next/route.js +2 -1
  18. package/dist/next/route.js.map +1 -1
  19. package/dist/next/weekly.d.ts +7 -2
  20. package/dist/next/weekly.js +5 -3
  21. package/dist/next/weekly.js.map +1 -1
  22. package/dist/prune.d.ts +4 -1
  23. package/dist/prune.js +11 -2
  24. package/dist/prune.js.map +1 -1
  25. package/dist/react/AddCase.d.ts +12 -2
  26. package/dist/react/AddCase.js +70 -8
  27. package/dist/react/AddCase.js.map +1 -1
  28. package/dist/react/AnswerKey.js +11 -5
  29. package/dist/react/AnswerKey.js.map +1 -1
  30. package/dist/react/CaseMenu.d.ts +6 -1
  31. package/dist/react/CaseMenu.js +5 -2
  32. package/dist/react/CaseMenu.js.map +1 -1
  33. package/dist/react/CompareView.js +4 -4
  34. package/dist/react/CompareView.js.map +1 -1
  35. package/dist/react/FeedbackView.js +3 -3
  36. package/dist/react/FeedbackView.js.map +1 -1
  37. package/dist/react/HubSections.js +3 -4
  38. package/dist/react/HubSections.js.map +1 -1
  39. package/dist/react/PriorityPicker.d.ts +21 -0
  40. package/dist/react/PriorityPicker.js +47 -0
  41. package/dist/react/PriorityPicker.js.map +1 -0
  42. package/dist/react/RunView.js +21 -5
  43. package/dist/react/RunView.js.map +1 -1
  44. package/dist/react/SettingsHistory.js +3 -3
  45. package/dist/react/SettingsHistory.js.map +1 -1
  46. package/dist/react/SuiteSections.d.ts +4 -0
  47. package/dist/react/SuiteSections.js +57 -33
  48. package/dist/react/SuiteSections.js.map +1 -1
  49. package/dist/react/WeeklyCheck.js +4 -8
  50. package/dist/react/WeeklyCheck.js.map +1 -1
  51. package/dist/react/app.d.ts +2 -0
  52. package/dist/react/app.js.map +1 -1
  53. package/dist/react/format.d.ts +2 -2
  54. package/dist/react/format.js +4 -2
  55. package/dist/react/format.js.map +1 -1
  56. package/dist/react/pieces.d.ts +11 -0
  57. package/dist/react/pieces.js +17 -2
  58. package/dist/react/pieces.js.map +1 -1
  59. package/dist/runner.d.ts +7 -2
  60. package/dist/runner.js +5 -2
  61. package/dist/runner.js.map +1 -1
  62. package/dist/suggest.js +25 -7
  63. package/dist/suggest.js.map +1 -1
  64. package/package.json +10 -10
  65. package/src/drafts.ts +6 -1
  66. package/src/failures.ts +50 -0
  67. package/src/health.ts +2 -1
  68. package/src/index.ts +1 -0
  69. package/src/legs.ts +8 -2
  70. package/src/next/actions.ts +54 -9
  71. package/src/next/route.ts +2 -1
  72. package/src/next/weekly.ts +15 -4
  73. package/src/prune.ts +15 -1
  74. package/src/react/AddCase.tsx +98 -11
  75. package/src/react/AnswerKey.tsx +74 -14
  76. package/src/react/CaseMenu.tsx +24 -0
  77. package/src/react/CompareView.tsx +19 -4
  78. package/src/react/FeedbackView.tsx +13 -3
  79. package/src/react/HubSections.tsx +10 -5
  80. package/src/react/PriorityPicker.tsx +143 -0
  81. package/src/react/RunView.tsx +41 -6
  82. package/src/react/SettingsHistory.tsx +3 -3
  83. package/src/react/SuiteSections.tsx +192 -184
  84. package/src/react/WeeklyCheck.tsx +12 -6
  85. package/src/react/app.ts +2 -0
  86. package/src/react/format.ts +4 -2
  87. package/src/react/pieces.tsx +34 -1
  88. package/src/runner.ts +11 -4
  89. package/src/suggest.ts +26 -7
  90. package/templates/lib/evalkeeper/actions.ts +4 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  FAVOR_TEXT,
3
+ allPassed,
3
4
  answerKeyHealth,
4
5
  attacksFrom,
5
6
  barStatus,
6
7
  checkBar,
7
8
  draftAnswers,
8
- draftsToTarget,
9
9
  newStarters,
10
10
  orderRows,
11
11
  pctBeside,
@@ -24,6 +24,7 @@ import {
24
24
  } from "../index.js";
25
25
  import { AnswerKey } from "./AnswerKey.js";
26
26
  import { ModelMenu } from "./ModelMenu.js";
27
+ import { PriorityPicker } from "./PriorityPicker.js";
27
28
  import { Tabs } from "./Tabs.js";
28
29
  import {
29
30
  Link,
@@ -37,17 +38,11 @@ import {
37
38
  Select,
38
39
  Spinner,
39
40
  Submit,
40
- TextInput,
41
41
  Tip,
42
42
  } from "./pieces.js";
43
- import { pct, LINK } from "./format.js";
43
+ import { pct, LINK, QUIET_BUTTON } from "./format.js";
44
44
  import { ChevronDown, RotateCw, ShieldAlert, Sparkles } from "lucide-react";
45
- import {
46
- evalsPath,
47
- type EvalAppConfig,
48
- type FormAction,
49
- attacksResisted,
50
- } from "./app.js";
45
+ import { evalsPath, type EvalAppConfig, attacksResisted } from "./app.js";
51
46
  import { SettingsHistory } from "./SettingsHistory.js";
52
47
 
53
48
  /**
@@ -86,12 +81,14 @@ export async function loadSuitePage(app: EvalAppConfig, key: string) {
86
81
  const choosesHere = !isInjectionSuite(suite);
87
82
  // The suite's priority, or the one an admin chose in its settings.
88
83
  const priority = priorityOf(suite, liveSettings.settings);
89
- const s = choosesHere
90
- ? suggest(rows, suite.checks, priority, app.models, { attacks })
91
- : null;
92
84
  const testing =
93
85
  rows.some((r) => r.testing) ||
94
86
  attackBoards.some((a) => a.rows.some((r) => r.testing));
87
+ // No suggestion while a test runs: it would weigh half a board.
88
+ const s =
89
+ choosesHere && !testing
90
+ ? suggest(rows, suite.checks, priority, app.models, { attacks })
91
+ : null;
95
92
  // What testing each model would cost now, attack cases included,
96
93
  // counting answers it would reuse.
97
94
  const estimates = new Map(
@@ -112,7 +109,30 @@ export async function loadSuitePage(app: EvalAppConfig, key: string) {
112
109
  const showAttacks = attackBoards.some((a) => a.cases > 0);
113
110
  const live = rows.find((r) => r.live);
114
111
  // What would keep the answer key useful, from the same tests.
115
- const health = answerKeyHealth(cases, b.caseResults);
112
+ const current = rows.filter((r) => r.test && !r.test.stale && !r.baseline);
113
+ const testedAt = current.reduce<Date | null>(
114
+ (m, r) => (r.test && (!m || r.test.at > m) ? r.test.at : m),
115
+ null,
116
+ );
117
+ const health = answerKeyHealth(cases, b.caseResults, new Date(), testedAt);
118
+ // For each split case, which models got it fully right and which didn't,
119
+ // so a person sees the disagreement before deciding.
120
+ const split = new Set(health.split.map((c) => c.id));
121
+ const splitBy: Record<string, { right: string[]; wrong: string[] }> = {};
122
+ if (split.size)
123
+ await Promise.all(
124
+ current
125
+ .filter((r) => !r.variant)
126
+ .map(async (r) => {
127
+ if (!r.test) return;
128
+ for (const o of await app.store.listOutputs(r.test.runId)) {
129
+ if (!split.has(o.caseId) || o.error) continue;
130
+ const side = allPassed(o.scores) ? "right" : "wrong";
131
+ const entry = (splitBy[o.caseId] ??= { right: [], wrong: [] });
132
+ if (!entry[side].includes(r.label)) entry[side].push(r.label);
133
+ }
134
+ }),
135
+ );
116
136
 
117
137
  return {
118
138
  app,
@@ -135,6 +155,7 @@ export async function loadSuitePage(app: EvalAppConfig, key: string) {
135
155
  health,
136
156
  cases,
137
157
  priority,
158
+ splitBy,
138
159
  };
139
160
  }
140
161
 
@@ -146,12 +167,14 @@ export type SuitePageData = NonNullable<
146
167
  /** A share as a whole percent, or a dash when there's nothing to show. */
147
168
  const asPct = (x: number | null) => (x === null ? "—" : pct(x));
148
169
 
149
- /** The choices when changing it: accuracy is always held. */
150
- const CHOICES = {
151
- quality: "Accuracy alone",
152
- speed: "Speed",
153
- cost: "Cost",
154
- } as const;
170
+ /**
171
+ * What a priority means for the suggestion, as a sentence: the
172
+ * explanation without its leading name ("cost: this runs…").
173
+ */
174
+ const whyFavor = (favor: SuitePriority["favor"]) => {
175
+ const text = FAVOR_TEXT[favor].replace(/^\w+: /, "");
176
+ return `${text.charAt(0).toUpperCase()}${text.slice(1)}.`;
177
+ };
155
178
 
156
179
  /** The suite's priority, as the page names it. */
157
180
  const FAVORS = { cost: "cost", speed: "speed", quality: "accuracy" } as const;
@@ -165,17 +188,13 @@ const VS: Record<string, string> = {
165
188
 
166
189
  /** The suite's name, what it tests, and its priority. */
167
190
  export function SuiteHeader({ data }: { data: SuitePageData }) {
168
- const { app, suite, priority } = data;
191
+ const { app, suite } = data;
169
192
  return (
170
193
  <>
171
194
  <div className="space-y-2">
172
195
  <BackLink href={app.basePath}>Evals</BackLink>
173
196
  <h1 className="text-2xl font-semibold">{suite.label}</h1>
174
197
  <p className="readable text-muted">{suite.description}</p>
175
- <p className="readable text-sm text-muted">
176
- Priority: {FAVOR_TEXT[priority.favor]}.
177
- <InfoTip term="priority" />
178
- </p>
179
198
  </div>
180
199
  </>
181
200
  );
@@ -212,15 +231,31 @@ export function ChosenOnBase({ data }: { data: SuitePageData }) {
212
231
 
213
232
  /** Which models to make live and the fallback, and why; shown when nothing would change too. */
214
233
  export function SuggestionCard({ data }: { data: SuitePageData }) {
215
- const { app, key, s } = data;
234
+ const { app, key, s, choosesHere, testing } = data;
235
+ if (choosesHere && testing)
236
+ return (
237
+ <section className="space-y-3" aria-labelledby="suggestion">
238
+ <h2 id="suggestion" className="text-lg font-semibold">
239
+ Suggested
240
+ <InfoTip term="suggestion" />
241
+ </h2>
242
+ <Card>
243
+ <p className="readable text-sm text-muted">
244
+ Waiting for the tests running now to finish. The suggestion weighs
245
+ every model&apos;s finished test, so it follows then.
246
+ </p>
247
+ </Card>
248
+ </section>
249
+ );
216
250
  return (
217
251
  <>
218
252
  {/* Shown when nothing would change too, so a higher score that
219
- isn't enough to switch for comes with its reason. */}
253
+ isn't enough to switch for comes with its reason. A section like
254
+ Models: the heading outside, Use these beside it. */}
220
255
  {s && (
221
- <Card className="space-y-3">
222
- <div className="flex flex-wrap items-start justify-between gap-3">
223
- <h2 className="font-semibold">
256
+ <section className="space-y-3" aria-labelledby="suggestion">
257
+ <div className="flex items-center justify-between gap-4">
258
+ <h2 id="suggestion" className="text-lg font-semibold">
224
259
  {s.same ? "No change suggested" : "Suggested"}
225
260
  <InfoTip term="suggestion" />
226
261
  </h2>
@@ -233,23 +268,25 @@ export function SuggestionCard({ data }: { data: SuitePageData }) {
233
268
  </form>
234
269
  )}
235
270
  </div>
236
- {!s.same && (
237
- <p>
238
- Live: <strong>{s.live.label}</strong>
239
- {s.fallback && (
240
- <>
241
- {" "}
242
- · Fallback: <strong>{s.fallback.label}</strong>
243
- </>
244
- )}
245
- </p>
246
- )}
247
- <ul className="readable list-disc space-y-1 pl-5 text-sm text-muted">
248
- {s.reasons.map((r) => (
249
- <li key={r}>{r}</li>
250
- ))}
251
- </ul>
252
- </Card>
271
+ <Card className="space-y-3">
272
+ {!s.same && (
273
+ <p>
274
+ Live: <strong>{s.live.label}</strong>
275
+ {s.fallback && (
276
+ <>
277
+ {" "}
278
+ · Fallback: <strong>{s.fallback.label}</strong>
279
+ </>
280
+ )}
281
+ </p>
282
+ )}
283
+ <ul className="readable list-disc space-y-1 pl-5 text-sm text-muted">
284
+ {s.reasons.map((r) => (
285
+ <li key={r}>{r}</li>
286
+ ))}
287
+ </ul>
288
+ </Card>
289
+ </section>
253
290
  )}
254
291
  </>
255
292
  );
@@ -311,16 +348,20 @@ export function ModelTable({ data }: { data: SuitePageData }) {
311
348
  <div className="flex items-center justify-between gap-4">
312
349
  <div className="flex flex-wrap items-center gap-2">
313
350
  <h2 className="text-lg font-semibold">Models</h2>
314
- <Tip term="favors" side="bottom" id="favors">
315
- <Chip tone="neutral">Favors {FAVORS[priority.favor]}</Chip>
316
- </Tip>
317
- {choosesHere && app.actions.setPriority && (
318
- <PriorityControl
351
+ {/* Why this priority, in its words: the page says it once. */}
352
+ {choosesHere && app.actions.setPriority ? (
353
+ <PriorityPicker
319
354
  action={app.actions.setPriority}
320
355
  suite={key}
321
356
  favor={priority.favor}
322
357
  own={suite.priority.favor}
358
+ label={`Favors ${FAVORS[priority.favor]}`}
359
+ why={whyFavor(priority.favor)}
323
360
  />
361
+ ) : (
362
+ <Tip text={whyFavor(priority.favor)} side="bottom" id="favors">
363
+ <Chip tone="neutral">Favors {FAVORS[priority.favor]}</Chip>
364
+ </Tip>
324
365
  )}
325
366
  </div>
326
367
  <div className="flex items-center gap-4">
@@ -476,11 +517,14 @@ export function ModelTable({ data }: { data: SuitePageData }) {
476
517
  <Score right={r.test.right} total={r.test.total} />
477
518
  </Link>
478
519
  {!r.test.stale && r.test.failedAnswers > 0 && (
479
- <span className="text-xs text-muted">
520
+ <Link
521
+ href={`${evalsPath(app, key, "runs", r.test.runId)}#failed`}
522
+ className="text-xs text-muted hover:underline"
523
+ >
480
524
  {r.test.failedAnswers}{" "}
481
525
  {r.test.failedAnswers === 1 ? "answer" : "answers"}{" "}
482
- failed: test again
483
- </span>
526
+ failed: see why
527
+ </Link>
484
528
  )}
485
529
  </div>
486
530
  ) : (
@@ -907,44 +951,6 @@ export function AnswerKeyToolsSection({ data }: { data: SuitePageData }) {
907
951
  </form>
908
952
  </Card>
909
953
  ),
910
- actions.draftMore && suite.draftMore && inUse.length > 0 && (
911
- <details
912
- key="draft"
913
- className="group rounded-lg border border-line bg-card"
914
- >
915
- <summary className="flex cursor-pointer list-none items-center justify-between gap-3 p-4 text-sm font-medium">
916
- <span className="flex items-center gap-1.5">
917
- <Sparkles aria-hidden className="h-4 w-4" />
918
- Draft {draftsToTarget(inUse.length)} more cases
919
- </span>
920
- <ChevronDown
921
- aria-hidden
922
- className="h-4 w-4 transition-transform group-open:rotate-180"
923
- />
924
- </summary>
925
- <form action={actions.draftMore} className="space-y-3 px-4 pb-4">
926
- <input type="hidden" name="suite" value={key} />
927
- <div>
928
- <label htmlFor="draft-focus" className="block text-sm font-medium">
929
- Anything to focus on? (optional)
930
- </label>
931
- <TextInput
932
- id="draft-focus"
933
- name="focus"
934
- maxLength={500}
935
- placeholder="e.g. longer, messier notes; more than one owner"
936
- className="mt-1 w-full rounded-md border border-line bg-card px-3 py-2 text-sm"
937
- />
938
- <p className="readable mt-1 text-xs text-muted">
939
- A model looks at the cases you have and covers what&apos;s
940
- missing. Drafts need your review and count only once you confirm
941
- them.
942
- </p>
943
- </div>
944
- <Submit>Draft cases</Submit>
945
- </form>
946
- </details>
947
- ),
948
954
  ].filter(Boolean);
949
955
  if (!parts.length) return null;
950
956
  return <div className="space-y-3">{parts}</div>;
@@ -1049,69 +1055,6 @@ export function AnswerKeySection({ data }: { data: SuitePageData }) {
1049
1055
  );
1050
1056
  }
1051
1057
 
1052
- /** "Free: all 16 reused" or "~$0.03, 4 of 16 reused", under a model's buttons. */
1053
- /**
1054
- * Changing what a feature's suggestion favors: accuracy, speed, or cost.
1055
- * It's saved as a new settings version, with an optional reason, so it
1056
- * shows under Versions and can be rolled back.
1057
- */
1058
- function PriorityControl({
1059
- action,
1060
- suite,
1061
- favor,
1062
- own,
1063
- }: {
1064
- action: FormAction;
1065
- suite: string;
1066
- favor: SuitePriority["favor"];
1067
- /** The suite's own priority, from its code. */
1068
- own: SuitePriority["favor"];
1069
- }) {
1070
- return (
1071
- <details className="group relative text-sm font-normal">
1072
- <summary className="cursor-pointer list-none text-accent hover:underline">
1073
- Change
1074
- </summary>
1075
- <form
1076
- action={action}
1077
- className="absolute left-0 z-20 mt-2 w-72 space-y-3 rounded-md border border-line bg-card p-4 shadow-lg"
1078
- >
1079
- <input type="hidden" name="suite" value={suite} />
1080
- <div>
1081
- <label htmlFor="favor" className="block font-medium">
1082
- Once accuracy holds, favor
1083
- </label>
1084
- <Select
1085
- id="favor"
1086
- name="favor"
1087
- defaultValue={favor}
1088
- className="mt-1 w-full rounded-md border border-line bg-card px-3 py-2"
1089
- >
1090
- {(["quality", "speed", "cost"] as const).map((f) => (
1091
- <option key={f} value={f}>
1092
- {CHOICES[f]}
1093
- {f === own ? " (the suite's own)" : ""}
1094
- </option>
1095
- ))}
1096
- </Select>
1097
- </div>
1098
- <div>
1099
- <label htmlFor="favor-reason" className="block font-medium">
1100
- Why? <span className="font-normal text-muted">(optional)</span>
1101
- </label>
1102
- <TextInput
1103
- id="favor-reason"
1104
- name="reason"
1105
- maxLength={300}
1106
- className="mt-1 w-full rounded-md border border-line bg-card px-3 py-2"
1107
- />
1108
- </div>
1109
- <Submit>Save as a new version</Submit>
1110
- </form>
1111
- </details>
1112
- );
1113
- }
1114
-
1115
1058
  /**
1116
1059
  * What testing a model costs now, as the menu says it: "free, all 34
1117
1060
  * reused", "~$0.10, 15 of 34 reused". Null before any cases.
@@ -1195,7 +1138,7 @@ function UnderAttack({
1195
1138
  * an injection suite, whose cases are made from its base suite's.
1196
1139
  */
1197
1140
  export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1198
- const { app, key, suite, health: h, choosesHere } = data;
1141
+ const { app, key, suite, health: h, choosesHere, splitBy } = data;
1199
1142
  const thin = h.tags.filter(([, n]) => n === 1).map(([t]) => t);
1200
1143
  const needs =
1201
1144
  h.easyToRetire.length ||
@@ -1213,7 +1156,7 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1213
1156
  {title(c)}
1214
1157
  </a>
1215
1158
  );
1216
- const { retireEasy, retireStaleDrafts } = app.actions;
1159
+ const { retireEasy, retireStaleDrafts, keepAnswer } = app.actions;
1217
1160
  const cases = (n: number) => `${n} ${n === 1 ? "case" : "cases"}`;
1218
1161
  const drafts = (n: number) => `${n} ${n === 1 ? "draft" : "drafts"}`;
1219
1162
  const { draftMore } = app.actions;
@@ -1231,18 +1174,59 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1231
1174
  <div className="readable space-y-3">
1232
1175
  <h3 className="font-medium">Check these answers</h3>
1233
1176
  {h.split.length > 0 && (
1234
- <div className="space-y-1">
1177
+ <div className="space-y-2">
1235
1178
  <p>
1236
- Models split about evenly on {cases(h.split.length)}. That
1237
- usually means the answer key is wrong or the case has no clear
1238
- answer. Open each one: fix the answer, or retire the case if
1239
- there&apos;s no right one.
1179
+ Models split about evenly on {cases(h.split.length)}: some
1180
+ give the answer key&apos;s answer, some don&apos;t. For each,
1181
+ decide who&apos;s right. Keep the answer if it&apos;s right,
1182
+ fix it if the models were, or retire the case if there&apos;s
1183
+ no right answer.
1240
1184
  <InfoTip term="splitCases" />
1241
1185
  </p>
1242
- <ul className="list-disc space-y-0.5 pl-5">
1243
- {h.split.map((c) => (
1244
- <li key={c.id}>{caseLink(c)}</li>
1245
- ))}
1186
+ <ul className="space-y-2">
1187
+ {h.split.map((c) => {
1188
+ const by = splitBy[c.id];
1189
+ const names = (xs: string[]) =>
1190
+ new Intl.ListFormat("en-US").format(xs);
1191
+ return (
1192
+ <li
1193
+ key={c.id}
1194
+ className="space-y-2 rounded-md bg-tint p-3"
1195
+ >
1196
+ <div className="font-medium">{caseLink(c)}</div>
1197
+ {by && (
1198
+ <p className="text-xs text-muted">
1199
+ {by.right.length > 0 &&
1200
+ `Gave the answer key's answer: ${names(by.right)}. `}
1201
+ {by.wrong.length > 0 &&
1202
+ `Didn't: ${names(by.wrong)}.`}
1203
+ </p>
1204
+ )}
1205
+ <div className="flex flex-wrap items-center gap-2">
1206
+ {keepAnswer && (
1207
+ <form action={keepAnswer}>
1208
+ <input type="hidden" name="suite" value={key} />
1209
+ <input type="hidden" name="case" value={c.id} />
1210
+ <Submit variant="quiet">
1211
+ The answer is right
1212
+ </Submit>
1213
+ </form>
1214
+ )}
1215
+ <a
1216
+ href={`#case-${c.id}`}
1217
+ className={`inline-flex items-center rounded-md px-3 py-1.5 text-sm ${QUIET_BUTTON}`}
1218
+ >
1219
+ Fix the answer
1220
+ </a>
1221
+ <form action={app.actions.retireCase}>
1222
+ <input type="hidden" name="suite" value={key} />
1223
+ <input type="hidden" name="case" value={c.id} />
1224
+ <Submit variant="quiet">Retire it</Submit>
1225
+ </form>
1226
+ </div>
1227
+ </li>
1228
+ );
1229
+ })}
1246
1230
  </ul>
1247
1231
  </div>
1248
1232
  )}
@@ -1274,26 +1258,50 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1274
1258
  or two to each.
1275
1259
  <InfoTip term="tagCoverage" />
1276
1260
  </p>
1277
- <ul className="flex flex-wrap gap-1.5">
1278
- {thin.map((t) => (
1279
- <li key={t}>
1280
- <Chip tone="warn">{t}</Chip>
1281
- </li>
1282
- ))}
1283
- </ul>
1284
- {draftMore && suite.draftMore && (
1285
- <form action={draftMore}>
1261
+ {draftMore && suite.draftMore ? (
1262
+ <form action={draftMore} className="space-y-2">
1286
1263
  <input type="hidden" name="suite" value={key} />
1287
- <input
1288
- type="hidden"
1289
- name="focus"
1290
- value={`Cases on these topics: ${thin.join(", ")}`.slice(
1291
- 0,
1292
- 500,
1293
- )}
1294
- />
1295
- <Submit variant="quiet">Draft cases for these topics</Submit>
1264
+ <ul className="flex flex-wrap gap-1.5">
1265
+ {thin.map((t) => (
1266
+ <li key={t}>
1267
+ <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">
1268
+ <input
1269
+ type="checkbox"
1270
+ name="topic"
1271
+ value={t}
1272
+ className="h-3 w-3 accent-amber-700"
1273
+ />
1274
+ {t}
1275
+ </label>
1276
+ </li>
1277
+ ))}
1278
+ </ul>
1279
+ <Submit variant="quiet">
1280
+ Draft cases for the topics you picked
1281
+ </Submit>
1282
+ <p className="readable text-xs text-muted">
1283
+ Two drafts a topic, to confirm like any draft. Pick none to
1284
+ cover them all.
1285
+ </p>
1296
1286
  </form>
1287
+ ) : (
1288
+ <>
1289
+ <ul className="flex flex-wrap gap-1.5">
1290
+ {thin.map((t) => (
1291
+ <li key={t}>
1292
+ <a
1293
+ href={`#add-case=${encodeURIComponent(t)}`}
1294
+ 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"
1295
+ >
1296
+ {t}
1297
+ </a>
1298
+ </li>
1299
+ ))}
1300
+ </ul>
1301
+ <p className="readable text-xs text-muted">
1302
+ Pick a topic to add a case with it already tagged.
1303
+ </p>
1304
+ </>
1297
1305
  )}
1298
1306
  <details className="group">
1299
1307
  <summary className="cursor-pointer text-muted">
@@ -7,8 +7,9 @@ import {
7
7
  RefreshWhile,
8
8
  Submit,
9
9
  Tip,
10
+ LocalDate,
10
11
  } from "./pieces.js";
11
- import { pct, dayOf, LINK } from "./format.js";
12
+ import { pct, LINK } from "./format.js";
12
13
  import { evalsPath, type EvalAppConfig } from "./app.js";
13
14
 
14
15
  /**
@@ -37,11 +38,16 @@ export function WeeklyCheck({
37
38
  </div>
38
39
  <Card className="space-y-4">
39
40
  <p className="readable text-sm text-muted">
40
- {weekly.running > 0
41
- ? `Running now: ${weekly.running} quick set${weekly.running === 1 ? "" : "s"} left. `
42
- : weekly.lastAt
43
- ? `Last run ${dayOf(weekly.lastAt)}, ${money(weekly.costUsd)}. `
44
- : "Not run yet. "}
41
+ {weekly.running > 0 ? (
42
+ `Running now: ${weekly.running} quick set${weekly.running === 1 ? "" : "s"} left. `
43
+ ) : weekly.lastAt ? (
44
+ <>
45
+ Last run <LocalDate date={weekly.lastAt} />,{" "}
46
+ {money(weekly.costUsd)}.{" "}
47
+ </>
48
+ ) : (
49
+ "Not run yet. "
50
+ )}
45
51
  Every Monday, each live model answers its suite&apos;s quick set
46
52
  again, so a quiet change by its provider shows up here. It also flags
47
53
  models retiring soon and features people rate poorly. Suites that can
package/src/react/app.ts CHANGED
@@ -43,6 +43,8 @@ export type EvalActions = {
43
43
  useDraftsProvisionally?: FormAction;
44
44
  /** Changing what a feature's suggestion favors, as a settings version. */
45
45
  setPriority?: FormAction;
46
+ /** Keeping a split case's answer as right, after checking it. */
47
+ keepAnswer?: FormAction;
46
48
  runWeeklyNow: () => Promise<void>;
47
49
  /** Blind rating; only for an app with the rate page. */
48
50
  rateBlind?: FormAction;
@@ -20,21 +20,23 @@ export const QUIET_BUTTON =
20
20
  * A day, with the month as a word so no reader mistakes it:
21
21
  * "Oct 28, 2026" (10/28 is the 10th of the 28th month in most of the world).
22
22
  */
23
- export const dayOf = (d: Date): string =>
23
+ export const dayOf = (d: Date, timeZone?: string): string =>
24
24
  d.toLocaleDateString("en-US", {
25
25
  month: "short",
26
26
  day: "numeric",
27
27
  year: "numeric",
28
+ ...(timeZone ? { timeZone } : {}),
28
29
  });
29
30
 
30
31
  /** A day and time, the same way: "Oct 28, 2026, 3:04 PM". */
31
- export const momentOf = (d: Date): string =>
32
+ export const momentOf = (d: Date, timeZone?: string): string =>
32
33
  d.toLocaleString("en-US", {
33
34
  month: "short",
34
35
  day: "numeric",
35
36
  year: "numeric",
36
37
  hour: "numeric",
37
38
  minute: "2-digit",
39
+ ...(timeZone ? { timeZone } : {}),
38
40
  });
39
41
 
40
42
  /**
@@ -4,6 +4,7 @@ import {
4
4
  createContext,
5
5
  createElement,
6
6
  useContext,
7
+ useSyncExternalStore,
7
8
  type ComponentType,
8
9
  type ReactNode,
9
10
  } from "react";
@@ -11,7 +12,7 @@ import { useFormStatus } from "react-dom";
11
12
  import { ArrowLeft, Info, LoaderCircle } from "lucide-react";
12
13
  import { GLOSSARY, type GlossaryTerm } from "../glossary.js";
13
14
  import type { HealthFlag, HealthStatus } from "../health.js";
14
- import { pct, QUIET_BUTTON } from "./format.js";
15
+ import { dayOf, momentOf, pct, QUIET_BUTTON } from "./format.js";
15
16
 
16
17
  /**
17
18
  * The pieces Evalkeeper's screens are built from. Each draws Evalkeeper's
@@ -471,3 +472,35 @@ export function RefreshWhile(props: RefreshWhileProps) {
471
472
  const C = useSwapped("RefreshWhile");
472
473
  return C ? createElement(C, props) : null;
473
474
  }
475
+
476
+ /** A store that never changes, for useSyncExternalStore. */
477
+ const noChange = () => () => {};
478
+
479
+ /**
480
+ * A date in the viewer's own time zone: "Oct 29, 2026", or with the time.
481
+ * A server formats in its own zone (UTC on most hosts), which can show
482
+ * tomorrow's date in someone's evening, so this renders UTC first and the
483
+ * viewer's zone once the page loads, inside a <time> with the instant.
484
+ */
485
+ export function LocalDate({
486
+ date,
487
+ time = false,
488
+ }: {
489
+ date: Date | string;
490
+ /** Include the time of day. */
491
+ time?: boolean;
492
+ }) {
493
+ const d = new Date(date);
494
+ // False on the server and while hydrating, true once in the browser.
495
+ const here = useSyncExternalStore(
496
+ noChange,
497
+ () => true,
498
+ () => false,
499
+ );
500
+ const zone = here ? undefined : "UTC";
501
+ return (
502
+ <time dateTime={d.toISOString()}>
503
+ {time ? momentOf(d, zone) : dayOf(d, zone)}
504
+ </time>
505
+ );
506
+ }