@crowandraven/evalkeeper 0.14.0 → 0.16.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 (51) hide show
  1. package/dist/glossary.d.ts +1 -0
  2. package/dist/glossary.js +1 -0
  3. package/dist/glossary.js.map +1 -1
  4. package/dist/health.d.ts +24 -0
  5. package/dist/health.js +61 -7
  6. package/dist/health.js.map +1 -1
  7. package/dist/react/HubSections.d.ts +4 -1
  8. package/dist/react/HubSections.js +30 -12
  9. package/dist/react/HubSections.js.map +1 -1
  10. package/dist/react/InfoPopover.d.ts +19 -0
  11. package/dist/react/InfoPopover.js +46 -0
  12. package/dist/react/InfoPopover.js.map +1 -0
  13. package/dist/react/PriorityPicker.js +6 -20
  14. package/dist/react/PriorityPicker.js.map +1 -1
  15. package/dist/react/SettingsHistory.d.ts +2 -1
  16. package/dist/react/SettingsHistory.js +32 -24
  17. package/dist/react/SettingsHistory.js.map +1 -1
  18. package/dist/react/ShowEarlier.d.ts +11 -0
  19. package/dist/react/ShowEarlier.js +19 -0
  20. package/dist/react/ShowEarlier.js.map +1 -0
  21. package/dist/react/SuiteSections.d.ts +6 -8
  22. package/dist/react/SuiteSections.js +45 -25
  23. package/dist/react/SuiteSections.js.map +1 -1
  24. package/dist/react/WeeklyCheck.js +2 -2
  25. package/dist/react/WeeklyCheck.js.map +1 -1
  26. package/dist/react/app.d.ts +3 -1
  27. package/dist/react/app.js.map +1 -1
  28. package/dist/react/pieces.d.ts +18 -1
  29. package/dist/react/pieces.js +29 -0
  30. package/dist/react/pieces.js.map +1 -1
  31. package/dist/runner.js +7 -1
  32. package/dist/runner.js.map +1 -1
  33. package/dist/types.d.ts +2 -1
  34. package/dist/types.js.map +1 -1
  35. package/dist/weekly.js +4 -2
  36. package/dist/weekly.js.map +1 -1
  37. package/package.json +1 -1
  38. package/src/glossary.ts +2 -0
  39. package/src/health.ts +81 -9
  40. package/src/react/HubSections.tsx +124 -40
  41. package/src/react/InfoPopover.tsx +100 -0
  42. package/src/react/PriorityPicker.tsx +6 -27
  43. package/src/react/SettingsHistory.tsx +112 -74
  44. package/src/react/ShowEarlier.tsx +57 -0
  45. package/src/react/SuiteSections.tsx +146 -96
  46. package/src/react/WeeklyCheck.tsx +14 -3
  47. package/src/react/app.ts +3 -2
  48. package/src/react/pieces.tsx +37 -1
  49. package/src/runner.ts +7 -1
  50. package/src/types.ts +2 -1
  51. package/src/weekly.ts +7 -2
@@ -7,6 +7,7 @@ import {
7
7
  type Settings,
8
8
  } from "../index.js";
9
9
  import { RollBack } from "./RollBack.js";
10
+ import { ShowEarlier } from "./ShowEarlier.js";
10
11
  import { Link, Chip, InfoTip, Tip, LocalDate } from "./pieces.js";
11
12
  import { evalsPath, type EvalAppConfig } from "./app.js";
12
13
 
@@ -46,12 +47,16 @@ const KIND: Record<
46
47
  },
47
48
  };
48
49
 
50
+ /** A version's card, on the page's background. */
51
+ const BOX = "space-y-2 rounded-md border border-line bg-card p-3 text-sm";
52
+
49
53
  type Evidence = { runId?: string | null; live?: string | null };
50
54
 
51
55
  /**
52
56
  * A feature's settings history: every switch, newest first, with what
53
57
  * changed, who, why, and the evidence; any earlier version can be made
54
- * live again, with a reason.
58
+ * live again, with a reason. The newest and live versions show; earlier
59
+ * ones open with a toggle.
55
60
  */
56
61
  export function SettingsHistory({
57
62
  app,
@@ -70,12 +75,33 @@ export function SettingsHistory({
70
75
  /** The settings in code, shown as v1 until the first change. */
71
76
  defaults: Settings;
72
77
  }) {
78
+ const heading = (
79
+ <h2 id="history" className="text-lg font-semibold">
80
+ Versions
81
+ <InfoTip term="versions" />
82
+ </h2>
83
+ );
84
+ // The newest version shows, and the live one when it's older (the first
85
+ // that points at it: a rollback points at the version it restored).
86
+ const live = entries.findIndex((e) => e.to.id === liveId);
87
+ const recent = (_e: HistoryEntry, i: number) => i === 0 || i === live;
88
+ const entry = (e: HistoryEntry) => (
89
+ <VersionEntry key={e.id} {...{ app, suite, e, liveId, label, box: BOX }} />
90
+ );
91
+ if (entries.some((e, i) => !recent(e, i)))
92
+ return (
93
+ <section className="space-y-3" aria-labelledby="history">
94
+ <ShowEarlier
95
+ heading={heading}
96
+ noun="versions"
97
+ recent={entries.filter(recent).map(entry)}
98
+ earlier={entries.filter((e, i) => !recent(e, i)).map(entry)}
99
+ />
100
+ </section>
101
+ );
73
102
  return (
74
103
  <section className="space-y-3" aria-labelledby="history">
75
- <h2 id="history" className="text-lg font-semibold">
76
- Versions
77
- <InfoTip term="versions" />
78
- </h2>
104
+ {heading}
79
105
  <HistoryEntries
80
106
  app={app}
81
107
  suite={suite}
@@ -112,7 +138,7 @@ export function HistoryEntries({
112
138
  /** No tint behind each version, for a list already on a tint. */
113
139
  plain?: boolean;
114
140
  }) {
115
- const box = `space-y-2 text-sm ${plain ? "py-2" : "rounded-md border border-line bg-card p-3"}`;
141
+ const box = plain ? "space-y-2 py-2 text-sm" : BOX;
116
142
  if (entries.length === 0)
117
143
  return (
118
144
  <article aria-label="Version 1: Defaults" className={box}>
@@ -135,74 +161,86 @@ export function HistoryEntries({
135
161
  );
136
162
  return (
137
163
  <div className="space-y-2">
138
- {entries.map((e) => {
139
- const kind = KIND[e.kind];
140
- const ev = (e.evidence ?? {}) as Evidence;
141
- const testId = ev.runId ?? ev.live ?? null;
142
- const isLive = e.to.id === liveId;
143
- // Said outright: "same models" read as the app switching models.
144
- const unchanged = (v: typeof e.to) =>
145
- `Models unchanged: ${label(v.model)} live${v.fallbackModel ? `, ${label(v.fallbackModel)} fallback` : ""}`;
146
- return (
147
- <article
148
- key={e.id}
149
- aria-label={`Version ${e.to.number}: ${kind.text}`}
150
- className={box}
151
- >
152
- <div className="flex flex-wrap items-center justify-between gap-2">
153
- <span className="flex flex-wrap items-center gap-2">
154
- <span className="font-medium">v{e.to.number}</span>
155
- <Tip text={kind.help} id={`kind-${e.id}`}>
156
- <Chip tone={kind.tone}>{kind.text}</Chip>
157
- </Tip>
158
- {isLive && <Chip tone="live">Live now</Chip>}
159
- </span>
160
- <span className="text-xs text-muted">
161
- {e.by ??
162
- (e.kind === "OUTSIDE"
163
- ? "Found by the system"
164
- : "System")}{" "}
165
- · <LocalDate date={e.createdAt} time />
166
- </span>
167
- </div>
168
- <ul className="readable list-disc pl-5">
169
- {(e.kind === "ROLLBACK"
170
- ? [`Back to v${e.to.number}: ${label(e.to.model)} live`]
171
- : e.kind === "DEPLOY"
172
- ? [unchanged(e.to), "The instructions in code changed"]
173
- : e.kind === "INSTRUCTIONS"
174
- ? [
175
- unchanged(e.to),
176
- "The instructions were edited at runtime",
177
- ]
178
- : describeChange(e.from, e.to, label)
179
- ).map((line) => (
180
- <li key={line}>{line}</li>
181
- ))}
182
- </ul>
183
- {e.reason && <p className="readable text-muted">{e.reason}</p>}
184
- <div className="flex flex-wrap items-center gap-3">
185
- {testId && (
186
- <Link
187
- href={evalsPath(app, suite, "runs", testId)}
188
- className={`text-xs ${LINK}`}
189
- >
190
- The test behind it
191
- </Link>
192
- )}
193
- {!isLive && (
194
- <RollBack
195
- action={app.actions.rollBackSettings}
196
- suite={suite}
197
- versionId={e.to.id}
198
- number={e.to.number}
199
- kind={e.kind}
200
- />
201
- )}
202
- </div>
203
- </article>
204
- );
205
- })}
164
+ {entries.map((e) => (
165
+ <VersionEntry key={e.id} {...{ app, suite, e, liveId, label, box }} />
166
+ ))}
206
167
  </div>
207
168
  );
208
169
  }
170
+
171
+ /** One version: what changed, who and when, why, its evidence, and rollback. */
172
+ function VersionEntry({
173
+ app,
174
+ suite,
175
+ e,
176
+ liveId,
177
+ label,
178
+ box,
179
+ }: {
180
+ app: EvalAppConfig;
181
+ suite: string;
182
+ e: HistoryEntry;
183
+ liveId: string | null;
184
+ label: (model: string) => string;
185
+ box: string;
186
+ }) {
187
+ const kind = KIND[e.kind];
188
+ const ev = (e.evidence ?? {}) as Evidence;
189
+ const testId = ev.runId ?? ev.live ?? null;
190
+ const isLive = e.to.id === liveId;
191
+ // Said outright: "same models" read as the app switching models.
192
+ const unchanged = (v: typeof e.to) =>
193
+ `Models unchanged: ${label(v.model)} live${v.fallbackModel ? `, ${label(v.fallbackModel)} fallback` : ""}`;
194
+ return (
195
+ <article
196
+ aria-label={`Version ${e.to.number}: ${kind.text}`}
197
+ className={box}
198
+ >
199
+ <div className="flex flex-wrap items-center justify-between gap-2">
200
+ <span className="flex flex-wrap items-center gap-2">
201
+ <span className="font-medium">v{e.to.number}</span>
202
+ <Tip text={kind.help} id={`kind-${e.id}`}>
203
+ <Chip tone={kind.tone}>{kind.text}</Chip>
204
+ </Tip>
205
+ {isLive && <Chip tone="live">Live now</Chip>}
206
+ </span>
207
+ <span className="text-xs text-muted">
208
+ {e.by ?? (e.kind === "OUTSIDE" ? "Found by the system" : "System")} ·{" "}
209
+ <LocalDate date={e.createdAt} time />
210
+ </span>
211
+ </div>
212
+ <ul className="readable list-disc pl-5">
213
+ {(e.kind === "ROLLBACK"
214
+ ? [`Back to v${e.to.number}: ${label(e.to.model)} live`]
215
+ : e.kind === "DEPLOY"
216
+ ? [unchanged(e.to), "The instructions in code changed"]
217
+ : e.kind === "INSTRUCTIONS"
218
+ ? [unchanged(e.to), "The instructions were edited at runtime"]
219
+ : describeChange(e.from, e.to, label)
220
+ ).map((line) => (
221
+ <li key={line}>{line}</li>
222
+ ))}
223
+ </ul>
224
+ {e.reason && <p className="readable text-muted">{e.reason}</p>}
225
+ <div className="flex flex-wrap items-center gap-3">
226
+ {testId && (
227
+ <Link
228
+ href={evalsPath(app, suite, "runs", testId)}
229
+ className={`text-xs ${LINK}`}
230
+ >
231
+ The test behind it
232
+ </Link>
233
+ )}
234
+ {!isLive && (
235
+ <RollBack
236
+ action={app.actions.rollBackSettings}
237
+ suite={suite}
238
+ versionId={e.to.id}
239
+ number={e.to.number}
240
+ kind={e.kind}
241
+ />
242
+ )}
243
+ </div>
244
+ </article>
245
+ );
246
+ }
@@ -0,0 +1,57 @@
1
+ "use client";
2
+
3
+ import { useId, useState } from "react";
4
+ import { ChevronDown } from "lucide-react";
5
+ import { Button } from "./pieces.js";
6
+
7
+ /**
8
+ * A section whose earlier items stay folded until asked for: the heading
9
+ * with a toggle across from it, the recent items, then the rest when open.
10
+ */
11
+ export function ShowEarlier({
12
+ heading,
13
+ recent,
14
+ earlier,
15
+ noun,
16
+ }: {
17
+ heading: React.ReactNode;
18
+ recent: React.ReactNode;
19
+ earlier: React.ReactNode[];
20
+ /** What the items are, plural: "versions". */
21
+ noun: string;
22
+ }) {
23
+ const [open, setOpen] = useState(false);
24
+ const id = useId();
25
+ return (
26
+ <>
27
+ <div className="flex items-center justify-between gap-4">
28
+ {heading}
29
+ <Button
30
+ type="button"
31
+ aria-expanded={open}
32
+ aria-controls={open ? id : undefined}
33
+ onClick={() => {
34
+ setOpen(!open);
35
+ }}
36
+ className="inline-flex items-center gap-1 text-sm text-muted hover:text-ink"
37
+ >
38
+ {open
39
+ ? `Hide earlier ${noun}`
40
+ : `Show ${earlier.length} earlier ${earlier.length === 1 ? noun.replace(/s$/, "") : noun}`}
41
+ <ChevronDown
42
+ aria-hidden
43
+ className={`h-4 w-4 transition-transform ${open ? "rotate-180" : ""}`}
44
+ />
45
+ </Button>
46
+ </div>
47
+ <div className="space-y-2">
48
+ {recent}
49
+ {open && (
50
+ <div id={id} className="space-y-2">
51
+ {earlier}
52
+ </div>
53
+ )}
54
+ </div>
55
+ </>
56
+ );
57
+ }
@@ -25,6 +25,9 @@ import {
25
25
  import { AnswerKey } from "./AnswerKey.js";
26
26
  import { ModelMenu } from "./ModelMenu.js";
27
27
  import { PriorityPicker } from "./PriorityPicker.js";
28
+ import { InfoPopover } from "./InfoPopover.js";
29
+ import { GLOSSARY } from "../glossary.js";
30
+ import type { AnswerGuide } from "../types.js";
28
31
  import { Tabs } from "./Tabs.js";
29
32
  import {
30
33
  Link,
@@ -41,7 +44,7 @@ import {
41
44
  Tip,
42
45
  } from "./pieces.js";
43
46
  import { pct, LINK, QUIET_BUTTON } from "./format.js";
44
- import { ChevronDown, RotateCw, ShieldAlert, Sparkles } from "lucide-react";
47
+ import { Plus, RotateCw, ShieldAlert, Sparkles } from "lucide-react";
45
48
  import { evalsPath, type EvalAppConfig, attacksResisted } from "./app.js";
46
49
  import { SettingsHistory } from "./SettingsHistory.js";
47
50
 
@@ -342,6 +345,8 @@ export function ModelTable({ data }: { data: SuitePageData }) {
342
345
  const ordered = orderRows(rows, suite.checks, priority, {
343
346
  live: suggestedLive,
344
347
  });
348
+ const tunable = tunableModels(data);
349
+ const columns = 7 + (showAttacks ? 1 : 0) + (suite.decisions ? 2 : 0);
345
350
  return (
346
351
  <>
347
352
  <section className="space-y-3">
@@ -617,6 +622,15 @@ export function ModelTable({ data }: { data: SuitePageData }) {
617
622
  </tr>
618
623
  ))}
619
624
  </tbody>
625
+ {tunable.length > 0 && (
626
+ <tfoot>
627
+ <tr>
628
+ <td colSpan={columns} className="p-2">
629
+ <TestSettingForm data={data} tunable={tunable} />
630
+ </td>
631
+ </tr>
632
+ </tfoot>
633
+ )}
620
634
  </table>
621
635
  </Card>
622
636
  </section>
@@ -625,52 +639,71 @@ export function ModelTable({ data }: { data: SuitePageData }) {
625
639
  }
626
640
 
627
641
  /**
628
- * Testing a model at a reasoning setting other than the feature's: less
629
- * reasoning is faster and cheaper, more can be more accurate. Each setting
630
- * gets its own row in the model table. Shows only when a model the feature
631
- * may use lists its settings in your catalog.
642
+ * The models a feature may use that list reasoning settings in your
643
+ * catalog, each with its settings; empty when there's nothing to test.
632
644
  */
633
- export function TestSettingSection({ data }: { data: SuitePageData }) {
634
- const { app, key, operation, choosesHere } = data;
635
- const tunable = app.runner.modelsFor(operation).flatMap((m) => {
645
+ function tunableModels(data: SuitePageData) {
646
+ const { app, operation, choosesHere } = data;
647
+ if (!choosesHere) return [];
648
+ return app.runner.modelsFor(operation).flatMap((m) => {
636
649
  const efforts = app.models[m]?.efforts;
637
650
  return efforts?.length
638
651
  ? [{ model: m, label: app.models[m]?.label ?? m, efforts }]
639
652
  : [];
640
653
  });
641
- if (!choosesHere || !tunable.length) return null;
654
+ }
655
+
656
+ /**
657
+ * Testing a model at a reasoning setting other than the feature's: less
658
+ * reasoning is faster and cheaper, more can be more accurate. Each setting
659
+ * gets its own row in the model table. The table's last row, inset.
660
+ */
661
+ function TestSettingForm({
662
+ data,
663
+ tunable,
664
+ }: {
665
+ data: SuitePageData;
666
+ tunable: ReturnType<typeof tunableModels>;
667
+ }) {
668
+ const { app, key } = data;
642
669
  return (
643
670
  <form
644
671
  action={app.actions.testModel}
645
- className="flex flex-wrap items-end gap-2"
672
+ className="flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md bg-tint px-3 py-2.5"
646
673
  >
647
674
  <input type="hidden" name="suite" value={key} />
648
- <div>
649
- <label htmlFor="test-setting" className="block text-sm font-medium">
650
- Test a reasoning setting
651
- <InfoTip term="reasoningSetting" id="test-setting" />
652
- </label>
653
- <Select
654
- id="test-setting"
655
- name="setting"
656
- className="mt-1 rounded-md border border-line bg-card px-3 py-2 text-sm"
657
- >
658
- {tunable.map((t) => (
659
- <optgroup key={t.model} label={t.label}>
660
- {t.efforts.map((e) => (
661
- <option key={e} value={JSON.stringify([t.model, e])}>
662
- {t.label} · {e} reasoning
663
- </option>
664
- ))}
665
- </optgroup>
666
- ))}
667
- </Select>
668
- </div>
675
+ <label htmlFor="test-setting" className="text-sm font-medium">
676
+ Test a reasoning setting
677
+ <InfoTip term="reasoningSetting" id="test-setting" />
678
+ </label>
679
+ <Select
680
+ id="test-setting"
681
+ name="setting"
682
+ className="rounded-md border border-line bg-card px-3 py-1.5 text-sm"
683
+ >
684
+ {tunable.map((t) => (
685
+ <optgroup key={t.model} label={t.label}>
686
+ {t.efforts.map((e) => (
687
+ <option key={e} value={JSON.stringify([t.model, e])}>
688
+ {t.label} · {e} reasoning
689
+ </option>
690
+ ))}
691
+ </optgroup>
692
+ ))}
693
+ </Select>
669
694
  <Submit variant="quiet">Test this setting</Submit>
670
695
  </form>
671
696
  );
672
697
  }
673
698
 
699
+ /**
700
+ * @deprecated The model table's last row holds this now; it renders
701
+ * nothing. Remove it from your page.
702
+ */
703
+ export function TestSettingSection(_props: { data: SuitePageData }) {
704
+ return null;
705
+ }
706
+
674
707
  const BAR_TONE = {
675
708
  meets:
676
709
  "bg-emerald-100 text-emerald-900 dark:bg-emerald-500/15 dark:text-emerald-200",
@@ -853,8 +886,8 @@ export function ChecksSection({ data }: { data: SuitePageData }) {
853
886
  }
854
887
 
855
888
  /**
856
- * Ways to fill the answer key, beside adding a case by hand: how to judge
857
- * an answer, testing with draft answers before review, an injection
889
+ * Ways to fill the answer key, beside adding a case by hand: testing with
890
+ * draft answers before review, an injection
858
891
  * suite's attack cases, starter cases not added yet, and more drafts from
859
892
  * the suite's `draftMore`. Each shows only when it applies and your app
860
893
  * passes its action.
@@ -865,42 +898,8 @@ export function AnswerKeyToolsSection({ data }: { data: SuitePageData }) {
865
898
  const inUse = cases.filter((c) => c.status !== "RETIRED");
866
899
  const drafts = draftAnswers(cases);
867
900
  const fresh = newStarters(suite.starter, cases);
868
- const guide =
869
- suite.answerGuide ??
870
- (suite.labelHelp ? { points: [{ text: suite.labelHelp }] } : null);
871
901
  const injection = isInjectionSuite(suite) ? suite : null;
872
902
  const parts = [
873
- guide && (
874
- <details
875
- key="guide"
876
- className="group rounded-lg border border-line bg-card"
877
- >
878
- <summary className="flex cursor-pointer list-none items-center justify-between gap-3 p-4 text-sm font-medium">
879
- How to judge an answer
880
- <ChevronDown
881
- aria-hidden
882
- className="h-4 w-4 transition-transform group-open:rotate-180"
883
- />
884
- </summary>
885
- <div className="readable space-y-2 px-4 pb-4 text-sm">
886
- {guide.lead && <p className="font-medium">{guide.lead}</p>}
887
- {(() => {
888
- const items = guide.points.map((p, n) => (
889
- <li key={n}>
890
- {p.term && <strong>{p.term} </strong>}
891
- {p.text}
892
- </li>
893
- ));
894
- return guide.ordered ? (
895
- <ol className="list-decimal space-y-1 pl-5">{items}</ol>
896
- ) : (
897
- <ul className="list-disc space-y-1 pl-5">{items}</ul>
898
- );
899
- })()}
900
- {guide.note && <p className="text-muted">{guide.note}</p>}
901
- </div>
902
- </details>
903
- ),
904
903
  actions.useDraftsProvisionally && drafts.length > 0 && (
905
904
  <Card key="provisional" className="space-y-3">
906
905
  <p className="readable text-sm">
@@ -955,21 +954,59 @@ export function AnswerKeyToolsSection({ data }: { data: SuitePageData }) {
955
954
  if (!parts.length) return null;
956
955
  return <div className="space-y-3">{parts}</div>;
957
956
  }
957
+ /** A suite's answer guide: its lead-in, points (numbered when in order), and note. */
958
+ function AnswerGuideText({ guide }: { guide: AnswerGuide }) {
959
+ const items = guide.points.map((p, n) => (
960
+ <li key={n}>
961
+ {p.term && <strong>{p.term} </strong>}
962
+ {p.text}
963
+ </li>
964
+ ));
965
+ return (
966
+ <div className="space-y-2">
967
+ {guide.lead && <p>{guide.lead}</p>}
968
+ {guide.ordered ? (
969
+ <ol className="list-decimal space-y-1 pl-5">{items}</ol>
970
+ ) : (
971
+ <ul className="list-disc space-y-1 pl-5">{items}</ul>
972
+ )}
973
+ {guide.note && <p className="text-muted">{guide.note}</p>}
974
+ </div>
975
+ );
976
+ }
977
+
958
978
  /** The answer key: the cases in use and their answers, with ways to add and rate them. */
959
979
  export function AnswerKeySection({ data }: { data: SuitePageData }) {
960
980
  const { app, key, b, suite, rows, attackBoards } = data;
961
981
  // A feature's attack cases are a tab of its answer key.
962
982
  const attacked = attackBoards.filter((a) => a.cases > 0);
983
+ const guide =
984
+ suite.answerGuide ??
985
+ (suite.labelHelp ? { points: [{ text: suite.labelHelp }] } : null);
963
986
  const cases = (
964
987
  <AnswerKey
965
988
  app={app}
966
989
  suite={suite}
967
990
  rows={rows}
968
991
  heading={
969
- <h2 className="text-lg font-semibold">
970
- Answer key ({b.cases} cases in use)
971
- <InfoTip term="answerKey" />
972
- </h2>
992
+ guide ? (
993
+ // The guide's list can't sit inside the heading; its button sits beside it.
994
+ <div className="flex items-center">
995
+ <h2 className="text-lg font-semibold">
996
+ Answer key ({b.cases} cases in use)
997
+ </h2>
998
+ <InfoPopover label="About the answer key">
999
+ <p className="text-muted">{GLOSSARY.answerKey}</p>
1000
+ <p className="font-medium">How to judge an answer</p>
1001
+ <AnswerGuideText guide={guide} />
1002
+ </InfoPopover>
1003
+ </div>
1004
+ ) : (
1005
+ <h2 className="text-lg font-semibold">
1006
+ Answer key ({b.cases} cases in use)
1007
+ <InfoTip term="answerKey" />
1008
+ </h2>
1009
+ )
973
1010
  }
974
1011
  tools={
975
1012
  <>
@@ -1171,16 +1208,17 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1171
1208
  {/* What to do, in order: fix doubtful answers, fill thin spots, prune. */}
1172
1209
  <Card className="space-y-6 text-sm">
1173
1210
  {check && (
1174
- <div className="readable space-y-3">
1175
- <h3 className="font-medium">Check these answers</h3>
1211
+ <div className="space-y-3">
1212
+ <h3 className="font-medium">Answers worth a second look</h3>
1176
1213
  {h.split.length > 0 && (
1177
1214
  <div className="space-y-2">
1178
- <p>
1215
+ <p className="readable">
1179
1216
  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.
1217
+ give the answer key&apos;s answer, some don&apos;t. That often
1218
+ means the answer is wrong or the case is unclear, and either
1219
+ one makes every score less trustworthy. For each, decide
1220
+ who&apos;s right: keep the answer, fix it, or retire the case
1221
+ if there&apos;s no right answer.
1184
1222
  <InfoTip term="splitCases" />
1185
1223
  </p>
1186
1224
  <ul className="space-y-2">
@@ -1195,7 +1233,7 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1195
1233
  >
1196
1234
  <div className="font-medium">{caseLink(c)}</div>
1197
1235
  {by && (
1198
- <p className="text-xs text-muted">
1236
+ <p className="readable text-xs text-muted">
1199
1237
  {by.right.length > 0 &&
1200
1238
  `Gave the answer key's answer: ${names(by.right)}. `}
1201
1239
  {by.wrong.length > 0 &&
@@ -1231,7 +1269,7 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1231
1269
  </div>
1232
1270
  )}
1233
1271
  {h.duplicates.length > 0 && (
1234
- <div className="space-y-1">
1272
+ <div className="readable space-y-1">
1235
1273
  <p>
1236
1274
  These pairs share nearly all their words, so each counts
1237
1275
  twice. Keep the clearer one and retire the other.
@@ -1285,23 +1323,36 @@ export function AnswerKeyHealthSection({ data }: { data: SuitePageData }) {
1285
1323
  </p>
1286
1324
  </form>
1287
1325
  ) : (
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>
1326
+ <div className="space-y-2">
1327
+ <p className="readable text-muted">
1328
+ Pick a topic to open Add a case with it already tagged.
1329
+ </p>
1330
+ <div className="flex flex-wrap items-center gap-3">
1331
+ <ul className="flex flex-wrap gap-1.5">
1332
+ {thin.map((t) => (
1333
+ <li key={t}>
1334
+ <a
1335
+ href={`#add-case=${encodeURIComponent(t)}`}
1336
+ 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"
1337
+ >
1338
+ {t}
1339
+ </a>
1340
+ </li>
1341
+ ))}
1342
+ </ul>
1343
+ <a
1344
+ href="#add-case="
1345
+ className={`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm ${QUIET_BUTTON}`}
1346
+ >
1347
+ <Plus aria-hidden className="h-4 w-4" />
1348
+ Add a case
1349
+ </a>
1350
+ </div>
1301
1351
  <p className="readable text-xs text-muted">
1302
- Pick a topic to add a case with it already tagged.
1352
+ A suite with <code>draftMore</code> drafts whole cases for the
1353
+ topics you pick instead.
1303
1354
  </p>
1304
- </>
1355
+ </div>
1305
1356
  )}
1306
1357
  <details className="group">
1307
1358
  <summary className="cursor-pointer text-muted">
@@ -1391,7 +1442,6 @@ export async function SuitePage({
1391
1442
  <SuggestionCard data={data} />
1392
1443
  <CasesInInstructions data={data} />
1393
1444
  <ModelTable data={data} />
1394
- <TestSettingSection data={data} />
1395
1445
  <CheckBreakdownSection data={data} />
1396
1446
  <Versions data={data} />
1397
1447
  <ChecksSection data={data} />
@@ -5,6 +5,7 @@ import {
5
5
  InfoTip,
6
6
  Link,
7
7
  RefreshWhile,
8
+ Spinner,
8
9
  Submit,
9
10
  Tip,
10
11
  LocalDate,
@@ -32,9 +33,19 @@ export function WeeklyCheck({
32
33
  Weekly check
33
34
  <InfoTip term="weeklyCheck" />
34
35
  </h2>
35
- <form action={app.actions.runWeeklyNow}>
36
- <Submit variant="quiet">Run it now</Submit>
37
- </form>
36
+ {weekly.running > 0 ? (
37
+ <span
38
+ role="status"
39
+ className="inline-flex items-center gap-2 rounded-md px-3 py-1.5 text-sm text-muted"
40
+ >
41
+ <Spinner />
42
+ Running
43
+ </span>
44
+ ) : (
45
+ <form action={app.actions.runWeeklyNow}>
46
+ <Submit variant="quiet">Run it now</Submit>
47
+ </form>
48
+ )}
38
49
  </div>
39
50
  <Card className="space-y-4">
40
51
  <p className="readable text-sm text-muted">