@crowandraven/evalkeeper 0.5.0 → 0.8.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/README.md +16 -0
- package/dist/activity.d.ts +58 -0
- package/dist/activity.js +125 -0
- package/dist/activity.js.map +1 -0
- package/dist/assertExpect.d.ts +52 -0
- package/dist/assertExpect.js +104 -0
- package/dist/assertExpect.js.map +1 -0
- package/dist/blind.d.ts +79 -0
- package/dist/blind.js +113 -0
- package/dist/blind.js.map +1 -0
- package/dist/cli/addPages.d.ts +6 -1
- package/dist/cli/addPages.js +19 -4
- package/dist/cli/addPages.js.map +1 -1
- package/dist/cli/main.d.ts +1 -1
- package/dist/cli/main.js +4 -3
- package/dist/cli/main.js.map +1 -1
- package/dist/compare.d.ts +38 -0
- package/dist/compare.js +62 -0
- package/dist/compare.js.map +1 -1
- package/dist/decisions.js +8 -0
- package/dist/decisions.js.map +1 -1
- package/dist/feedback.d.ts +17 -2
- package/dist/feedback.js +13 -2
- package/dist/feedback.js.map +1 -1
- package/dist/glossary.d.ts +22 -0
- package/dist/glossary.js +22 -0
- package/dist/glossary.js.map +1 -1
- package/dist/health.js +5 -3
- package/dist/health.js.map +1 -1
- package/dist/importCases.d.ts +76 -5
- package/dist/importCases.js +114 -14
- package/dist/importCases.js.map +1 -1
- package/dist/inInstructions.d.ts +47 -0
- package/dist/inInstructions.js +95 -0
- package/dist/inInstructions.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/memoryStore.js +3 -1
- package/dist/memoryStore.js.map +1 -1
- package/dist/readCheck.d.ts +116 -0
- package/dist/readCheck.js +321 -0
- package/dist/readCheck.js.map +1 -0
- package/dist/runner.d.ts +16 -0
- package/dist/runner.js +51 -3
- package/dist/runner.js.map +1 -1
- package/dist/settings.d.ts +81 -3
- package/dist/settings.js +160 -23
- package/dist/settings.js.map +1 -1
- package/dist/store.d.ts +10 -3
- package/dist/suggest.d.ts +10 -1
- package/dist/suggest.js +22 -4
- package/dist/suggest.js.map +1 -1
- package/dist/suiteContract.d.ts +23 -0
- package/dist/suiteContract.js +106 -0
- package/dist/suiteContract.js.map +1 -0
- package/dist/suites/crisisRisk.d.ts +83 -0
- package/dist/suites/crisisRisk.js +176 -0
- package/dist/suites/crisisRisk.js.map +1 -0
- package/dist/suites/crisisRiskCases.d.ts +40 -0
- package/dist/suites/crisisRiskCases.js +179 -0
- package/dist/suites/crisisRiskCases.js.map +1 -0
- package/dist/suites/hopelessness.d.ts +116 -0
- package/dist/suites/hopelessness.js +293 -0
- package/dist/suites/hopelessness.js.map +1 -0
- package/dist/suites/hopelessnessCases.d.ts +61 -0
- package/dist/suites/hopelessnessCases.js +242 -0
- package/dist/suites/hopelessnessCases.js.map +1 -0
- package/dist/suites/index.d.ts +11 -0
- package/dist/suites/index.js +12 -0
- package/dist/suites/index.js.map +1 -0
- package/dist/testing.d.ts +162 -12
- package/dist/testing.js +479 -115
- package/dist/testing.js.map +1 -1
- package/dist/types.d.ts +98 -0
- package/dist/types.js +68 -0
- package/dist/types.js.map +1 -1
- package/dist/weekly.d.ts +21 -3
- package/dist/weekly.js +18 -1
- package/dist/weekly.js.map +1 -1
- package/package.json +5 -1
- package/src/activity.ts +154 -0
- package/src/assertExpect.ts +168 -0
- package/src/blind.ts +138 -0
- package/src/cli/addPages.ts +20 -4
- package/src/cli/main.ts +4 -3
- package/src/compare.ts +85 -0
- package/src/decisions.ts +10 -0
- package/src/feedback.ts +20 -2
- package/src/glossary.ts +40 -0
- package/src/health.ts +5 -3
- package/src/importCases.ts +172 -33
- package/src/inInstructions.ts +105 -0
- package/src/index.ts +5 -0
- package/src/memoryStore.ts +2 -1
- package/src/readCheck.ts +458 -0
- package/src/runner.ts +74 -4
- package/src/settings.ts +192 -26
- package/src/store.ts +11 -3
- package/src/suggest.ts +33 -4
- package/src/suiteContract.ts +147 -0
- package/src/suites/crisisRisk.ts +250 -0
- package/src/suites/crisisRiskCases.ts +205 -0
- package/src/suites/hopelessness.ts +410 -0
- package/src/suites/hopelessnessCases.ts +286 -0
- package/src/suites/index.ts +11 -0
- package/src/testing.ts +646 -121
- package/src/types.ts +147 -0
- package/src/weekly.ts +39 -3
- package/starter/index.ts +8 -0
- package/templates/app/evals/[suite]/compare/page.tsx +385 -0
- package/templates/app/evals/[suite]/page.tsx +104 -31
- package/templates/app/evals/[suite]/rate/page.tsx +143 -0
- package/templates/app/evals/[suite]/runs/[runId]/page.tsx +84 -3
- package/templates/app/evals/[suite]/side-by-side/page.tsx +320 -0
- package/templates/app/evals/feedback/page.tsx +3 -0
- package/templates/app/evals/page.tsx +3 -0
- package/templates/components/evalkeeper/AnswerKey.tsx +2 -1
- package/templates/components/evalkeeper/DisagreementChip.tsx +35 -0
- package/templates/components/evalkeeper/ReadableOutput.tsx +97 -0
- package/templates/components/evalkeeper/RollBack.tsx +21 -1
- package/templates/components/evalkeeper/SettingsHistory.tsx +29 -5
- package/templates/components/evalkeeper/WeeklyCheck.tsx +34 -2
- package/templates/lib/evalkeeper/actions.ts +68 -4
- package/templates/lib/evalkeeper/weekly.ts +27 -4
package/dist/importCases.d.ts
CHANGED
|
@@ -18,10 +18,13 @@ export type ImportedCase = {
|
|
|
18
18
|
* each one on the pages before tests use it. Provisional: tests use them
|
|
19
19
|
* now, every score says it rests on unreviewed answers, and the rows carry
|
|
20
20
|
* `tag` so the review queue is findable. Use provisional only when the
|
|
21
|
-
* owner said so; `allowedBy` and `at` record who and when.
|
|
22
|
-
*
|
|
21
|
+
* owner said so; `allowedBy` and `at` record who and when. Confirmed: only
|
|
22
|
+
* for answers a person already reviewed in the system they come from;
|
|
23
|
+
* `confirmedBy` and `at` read who and when from each row, and the import
|
|
24
|
+
* is refused unless every row names both. Answers drafted by an agent or
|
|
25
|
+
* scraped from somewhere are never imported confirmed.
|
|
23
26
|
*/
|
|
24
|
-
export type ImportAnswers = {
|
|
27
|
+
export type ImportAnswers<Row = never> = {
|
|
25
28
|
status: "PENDING";
|
|
26
29
|
} | {
|
|
27
30
|
status: "PROVISIONAL";
|
|
@@ -33,6 +36,20 @@ export type ImportAnswers = {
|
|
|
33
36
|
at?: Date;
|
|
34
37
|
/** Added to each row's tags; default "needs-review". */
|
|
35
38
|
tag?: string;
|
|
39
|
+
} | {
|
|
40
|
+
status: "CONFIRMED";
|
|
41
|
+
/**
|
|
42
|
+
* The person who confirmed this row's answer in the old system,
|
|
43
|
+
* recorded as the rater. Never defaulted: a row without one stops
|
|
44
|
+
* the import.
|
|
45
|
+
*/
|
|
46
|
+
confirmedBy: (row: Row) => string | null | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* When they confirmed it: a Date, or text `Date` can read. Never
|
|
49
|
+
* defaulted: a row without one, or with one in the future, stops
|
|
50
|
+
* the import.
|
|
51
|
+
*/
|
|
52
|
+
at: (row: Row) => Date | string | null | undefined;
|
|
36
53
|
};
|
|
37
54
|
/** A row that couldn't be imported, and why. */
|
|
38
55
|
export type ImportProblem = {
|
|
@@ -44,13 +61,44 @@ export declare class CaseImportError extends Error {
|
|
|
44
61
|
readonly problems: ImportProblem[];
|
|
45
62
|
constructor(source: string, problems: ImportProblem[]);
|
|
46
63
|
}
|
|
64
|
+
/** What a suite's leak check removed from one imported case. */
|
|
65
|
+
export type ImportLeak = {
|
|
66
|
+
/** The row's id within its source. */
|
|
67
|
+
id: string;
|
|
68
|
+
/** A plain line for each item removed. */
|
|
69
|
+
removed: string[];
|
|
70
|
+
};
|
|
47
71
|
/** What an import did. */
|
|
48
72
|
export type ImportResult = {
|
|
49
73
|
/** Cases created. */
|
|
50
74
|
added: number;
|
|
51
75
|
/** Rows imported before (by source and id), left alone. */
|
|
52
76
|
skipped: number;
|
|
77
|
+
/**
|
|
78
|
+
* The cases added that the suite's `withoutLeaks` changed, and what it
|
|
79
|
+
* removed from each, for a person to check. Empty without a leak check.
|
|
80
|
+
*/
|
|
81
|
+
removed: ImportLeak[];
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Runs a suite's leak check (`withoutLeaks`) on an input about to be
|
|
85
|
+
* frozen into a case, and checks the result still fits the suite's input.
|
|
86
|
+
* Without a leak check, the input comes back as it was. Use it wherever
|
|
87
|
+
* cases are made outside `importCases`, such as an "add case" action.
|
|
88
|
+
*
|
|
89
|
+
* @param suite - The suite the case belongs to.
|
|
90
|
+
* @param input - The case's input, already checked against `suite.input`.
|
|
91
|
+
* @param sourceRef - What the case was made from, or null when added by
|
|
92
|
+
* hand.
|
|
93
|
+
* @returns The input to freeze, and what was removed from it.
|
|
94
|
+
* @throws When the leak check returns an input that doesn't fit the suite.
|
|
95
|
+
*/
|
|
96
|
+
export declare function withoutLeaks(suite: AnySuite, input: unknown, sourceRef: string | null): {
|
|
97
|
+
input: unknown;
|
|
98
|
+
removed: string[];
|
|
53
99
|
};
|
|
100
|
+
/** A note line saying what a leak check removed; null when nothing. */
|
|
101
|
+
export declare function leakNote(removed: readonly string[]): string | null;
|
|
54
102
|
/**
|
|
55
103
|
* Imports existing test data as cases for one suite. Every row is mapped
|
|
56
104
|
* and checked against the suite's input and answer schemas first; if any
|
|
@@ -61,6 +109,14 @@ export type ImportResult = {
|
|
|
61
109
|
* Splits: "DEV" for cases you tune against, "TEST" for a held-out file,
|
|
62
110
|
* "auto" (the default) for new cases, split like cases added by hand.
|
|
63
111
|
*
|
|
112
|
+
* A suite with a leak check (`withoutLeaks`) has it run on every input
|
|
113
|
+
* before it's frozen; `removed` in the result lists what it took out of
|
|
114
|
+
* each case, and the case's note says so too.
|
|
115
|
+
*
|
|
116
|
+
* Answers arrive pending unless `answers` says otherwise (see
|
|
117
|
+
* `ImportAnswers`); import them confirmed only when a person reviewed
|
|
118
|
+
* them in the old system, naming who and when on every row.
|
|
119
|
+
*
|
|
64
120
|
* Run it against your development database; an app's own guard should
|
|
65
121
|
* refuse a production one.
|
|
66
122
|
*
|
|
@@ -74,6 +130,20 @@ export type ImportResult = {
|
|
|
74
130
|
* map: (r) => ({ id: r.id, input: { body: r.text }, label: { queue: r.queue } }),
|
|
75
131
|
* split: "TEST",
|
|
76
132
|
* });
|
|
133
|
+
*
|
|
134
|
+
* // Answers people already reviewed in an old harness:
|
|
135
|
+
* await importCases({
|
|
136
|
+
* store,
|
|
137
|
+
* suite: ticketTriage,
|
|
138
|
+
* source: "old-harness",
|
|
139
|
+
* rows,
|
|
140
|
+
* map,
|
|
141
|
+
* answers: {
|
|
142
|
+
* status: "CONFIRMED",
|
|
143
|
+
* confirmedBy: (r) => r.reviewer,
|
|
144
|
+
* at: (r) => r.reviewedAt,
|
|
145
|
+
* },
|
|
146
|
+
* });
|
|
77
147
|
* ```
|
|
78
148
|
*/
|
|
79
149
|
export declare function importCases<Row>(opts: {
|
|
@@ -84,11 +154,12 @@ export declare function importCases<Row>(opts: {
|
|
|
84
154
|
rows: readonly Row[];
|
|
85
155
|
map: (row: Row, index: number) => ImportedCase;
|
|
86
156
|
split?: "DEV" | "TEST" | "auto";
|
|
87
|
-
answers?: ImportAnswers
|
|
157
|
+
answers?: ImportAnswers<Row>;
|
|
88
158
|
}): Promise<ImportResult>;
|
|
89
159
|
/**
|
|
90
160
|
* Adds a suite's `starter` cases as drafts with pending answers, for a
|
|
91
161
|
* person to confirm on the pages. Safe to run again: starters already
|
|
92
|
-
* added (by their input) are skipped.
|
|
162
|
+
* added (by their input) are skipped. A suite's leak check runs on each,
|
|
163
|
+
* as in `importCases`.
|
|
93
164
|
*/
|
|
94
165
|
export declare function importStarters(store: EvalStore, suite: AnySuite): Promise<ImportResult>;
|
package/dist/importCases.js
CHANGED
|
@@ -12,6 +12,42 @@ export class CaseImportError extends Error {
|
|
|
12
12
|
this.problems = problems;
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Runs a suite's leak check (`withoutLeaks`) on an input about to be
|
|
17
|
+
* frozen into a case, and checks the result still fits the suite's input.
|
|
18
|
+
* Without a leak check, the input comes back as it was. Use it wherever
|
|
19
|
+
* cases are made outside `importCases`, such as an "add case" action.
|
|
20
|
+
*
|
|
21
|
+
* @param suite - The suite the case belongs to.
|
|
22
|
+
* @param input - The case's input, already checked against `suite.input`.
|
|
23
|
+
* @param sourceRef - What the case was made from, or null when added by
|
|
24
|
+
* hand.
|
|
25
|
+
* @returns The input to freeze, and what was removed from it.
|
|
26
|
+
* @throws When the leak check returns an input that doesn't fit the suite.
|
|
27
|
+
*/
|
|
28
|
+
export function withoutLeaks(suite, input, sourceRef) {
|
|
29
|
+
if (!suite.withoutLeaks)
|
|
30
|
+
return { input, removed: [] };
|
|
31
|
+
const out = suite.withoutLeaks(input, { sourceRef });
|
|
32
|
+
const parsed = suite.input.safeParse(out.input);
|
|
33
|
+
if (!parsed.success)
|
|
34
|
+
throw new Error(`the leak check left an input that doesn't fit: ${parsed.error.issues[0]?.message ?? "invalid"}`);
|
|
35
|
+
return { input: parsed.data, removed: out.removed };
|
|
36
|
+
}
|
|
37
|
+
/** A note line saying what a leak check removed; null when nothing. */
|
|
38
|
+
export function leakNote(removed) {
|
|
39
|
+
return removed.length
|
|
40
|
+
? `Removed before freezing, as learned from this case: ${removed.join("; ")}.`
|
|
41
|
+
: null;
|
|
42
|
+
}
|
|
43
|
+
/** A date read from a row: a Date, or text Date can read; null if neither. */
|
|
44
|
+
function dateOf(v) {
|
|
45
|
+
if (v === null || v === undefined || v === "")
|
|
46
|
+
return null;
|
|
47
|
+
const d = v instanceof Date ? v : new Date(v);
|
|
48
|
+
return Number.isNaN(d.getTime()) ? null : d;
|
|
49
|
+
}
|
|
50
|
+
const day = (d) => d.toISOString().slice(0, 10);
|
|
15
51
|
const sourceRefOf = (source, id) => `${source}#${id}`;
|
|
16
52
|
/**
|
|
17
53
|
* Imports existing test data as cases for one suite. Every row is mapped
|
|
@@ -23,6 +59,14 @@ const sourceRefOf = (source, id) => `${source}#${id}`;
|
|
|
23
59
|
* Splits: "DEV" for cases you tune against, "TEST" for a held-out file,
|
|
24
60
|
* "auto" (the default) for new cases, split like cases added by hand.
|
|
25
61
|
*
|
|
62
|
+
* A suite with a leak check (`withoutLeaks`) has it run on every input
|
|
63
|
+
* before it's frozen; `removed` in the result lists what it took out of
|
|
64
|
+
* each case, and the case's note says so too.
|
|
65
|
+
*
|
|
66
|
+
* Answers arrive pending unless `answers` says otherwise (see
|
|
67
|
+
* `ImportAnswers`); import them confirmed only when a person reviewed
|
|
68
|
+
* them in the old system, naming who and when on every row.
|
|
69
|
+
*
|
|
26
70
|
* Run it against your development database; an app's own guard should
|
|
27
71
|
* refuse a production one.
|
|
28
72
|
*
|
|
@@ -36,11 +80,26 @@ const sourceRefOf = (source, id) => `${source}#${id}`;
|
|
|
36
80
|
* map: (r) => ({ id: r.id, input: { body: r.text }, label: { queue: r.queue } }),
|
|
37
81
|
* split: "TEST",
|
|
38
82
|
* });
|
|
83
|
+
*
|
|
84
|
+
* // Answers people already reviewed in an old harness:
|
|
85
|
+
* await importCases({
|
|
86
|
+
* store,
|
|
87
|
+
* suite: ticketTriage,
|
|
88
|
+
* source: "old-harness",
|
|
89
|
+
* rows,
|
|
90
|
+
* map,
|
|
91
|
+
* answers: {
|
|
92
|
+
* status: "CONFIRMED",
|
|
93
|
+
* confirmedBy: (r) => r.reviewer,
|
|
94
|
+
* at: (r) => r.reviewedAt,
|
|
95
|
+
* },
|
|
96
|
+
* });
|
|
39
97
|
* ```
|
|
40
98
|
*/
|
|
41
99
|
export async function importCases(opts) {
|
|
42
100
|
const { store, suite, source } = opts;
|
|
43
101
|
const answers = opts.answers ?? { status: "PENDING" };
|
|
102
|
+
const now = new Date();
|
|
44
103
|
// 1. Map and check every row before writing anything.
|
|
45
104
|
const problems = [];
|
|
46
105
|
const seen = new Set();
|
|
@@ -80,8 +139,33 @@ export async function importCases(opts) {
|
|
|
80
139
|
else
|
|
81
140
|
label = l.data;
|
|
82
141
|
}
|
|
83
|
-
|
|
84
|
-
|
|
142
|
+
let confirmed = null;
|
|
143
|
+
if (answers.status === "CONFIRMED") {
|
|
144
|
+
const by = answers.confirmedBy(row)?.trim();
|
|
145
|
+
const at = dateOf(answers.at(row));
|
|
146
|
+
if (!by)
|
|
147
|
+
problems.push({ id, problem: "no person who confirmed the answer" });
|
|
148
|
+
if (!at)
|
|
149
|
+
problems.push({ id, problem: "no date the answer was confirmed" });
|
|
150
|
+
else if (at > now)
|
|
151
|
+
problems.push({ id, problem: "a confirmation date in the future" });
|
|
152
|
+
if (by && at)
|
|
153
|
+
confirmed = { by, at };
|
|
154
|
+
}
|
|
155
|
+
if (!input.success)
|
|
156
|
+
return;
|
|
157
|
+
let cleaned;
|
|
158
|
+
try {
|
|
159
|
+
cleaned = withoutLeaks(suite, input.data, sourceRefOf(source, c.id));
|
|
160
|
+
}
|
|
161
|
+
catch (e) {
|
|
162
|
+
problems.push({
|
|
163
|
+
id,
|
|
164
|
+
problem: e instanceof Error ? e.message : String(e),
|
|
165
|
+
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
mapped.push({ ...c, ...cleaned, label, confirmed });
|
|
85
169
|
});
|
|
86
170
|
if (problems.length)
|
|
87
171
|
throw new CaseImportError(source, problems);
|
|
@@ -95,6 +179,7 @@ export async function importCases(opts) {
|
|
|
95
179
|
const at = answers.status === "PROVISIONAL" ? (answers.at ?? new Date()) : null;
|
|
96
180
|
let added = 0;
|
|
97
181
|
let skipped = 0;
|
|
182
|
+
const removed = [];
|
|
98
183
|
for (const c of mapped) {
|
|
99
184
|
const sourceRef = sourceRefOf(source, c.id);
|
|
100
185
|
if (refs.has(sourceRef)) {
|
|
@@ -107,17 +192,27 @@ export async function importCases(opts) {
|
|
|
107
192
|
: nextSplit(counts));
|
|
108
193
|
counts[split] += 1;
|
|
109
194
|
const labels = [];
|
|
110
|
-
if (c.label !== null)
|
|
111
|
-
|
|
112
|
-
|
|
195
|
+
if (c.label !== null) {
|
|
196
|
+
if (answers.status === "PROVISIONAL")
|
|
197
|
+
labels.push({
|
|
113
198
|
kind: "EXPECTED",
|
|
114
199
|
status: "PROVISIONAL",
|
|
115
200
|
value: c.label,
|
|
116
201
|
raterRole: "AGENT",
|
|
117
202
|
raterId: answers.rater,
|
|
118
|
-
note: `Drafted by ${answers.rater}; ${answers.allowedBy} allowed testing on it before review (${at
|
|
119
|
-
}
|
|
120
|
-
|
|
203
|
+
note: `Drafted by ${answers.rater}; ${answers.allowedBy} allowed testing on it before review (${at ? day(at) : ""}).`,
|
|
204
|
+
});
|
|
205
|
+
else if (c.confirmed)
|
|
206
|
+
labels.push({
|
|
207
|
+
kind: "EXPECTED",
|
|
208
|
+
status: "CONFIRMED",
|
|
209
|
+
value: c.label,
|
|
210
|
+
raterRole: "REVIEWER",
|
|
211
|
+
raterId: c.confirmed.by,
|
|
212
|
+
note: `Imported as reviewed from ${source}: ${c.confirmed.by} confirmed it there on ${day(c.confirmed.at)}.`,
|
|
213
|
+
});
|
|
214
|
+
else
|
|
215
|
+
labels.push({
|
|
121
216
|
kind: "EXPECTED",
|
|
122
217
|
status: "PENDING",
|
|
123
218
|
value: c.label,
|
|
@@ -125,31 +220,35 @@ export async function importCases(opts) {
|
|
|
125
220
|
raterId: null,
|
|
126
221
|
note: null,
|
|
127
222
|
});
|
|
223
|
+
}
|
|
128
224
|
const tags = [...(c.tags ?? [])];
|
|
129
225
|
if (answers.status === "PROVISIONAL" && c.label !== null) {
|
|
130
226
|
const tag = answers.tag ?? "needs-review";
|
|
131
227
|
if (!tags.includes(tag))
|
|
132
228
|
tags.push(tag);
|
|
133
229
|
}
|
|
230
|
+
const note = [c.note ?? null, leakNote(c.removed)]
|
|
231
|
+
.filter((n) => !!n)
|
|
232
|
+
.join(" ");
|
|
134
233
|
const data = {
|
|
135
234
|
suite: suite.key,
|
|
136
235
|
input: c.input,
|
|
137
236
|
tags,
|
|
138
237
|
split,
|
|
139
238
|
// In use only with an answer tests may grade against.
|
|
140
|
-
status: c.label !== null && answers.status
|
|
141
|
-
? "ACTIVE"
|
|
142
|
-
: "DRAFT",
|
|
239
|
+
status: c.label !== null && answers.status !== "PENDING" ? "ACTIVE" : "DRAFT",
|
|
143
240
|
source: "IMPORT",
|
|
144
241
|
sourceRef,
|
|
145
|
-
note:
|
|
242
|
+
note: note || null,
|
|
146
243
|
labels,
|
|
147
244
|
};
|
|
148
245
|
await store.createCase(data);
|
|
149
246
|
refs.add(sourceRef);
|
|
150
247
|
added += 1;
|
|
248
|
+
if (c.removed.length)
|
|
249
|
+
removed.push({ id: c.id, removed: c.removed });
|
|
151
250
|
}
|
|
152
|
-
return { added, skipped };
|
|
251
|
+
return { added, skipped, removed };
|
|
153
252
|
}
|
|
154
253
|
/** A short, stable id for a starter case: a hash of its input. */
|
|
155
254
|
function starterId(input) {
|
|
@@ -164,7 +263,8 @@ function starterId(input) {
|
|
|
164
263
|
/**
|
|
165
264
|
* Adds a suite's `starter` cases as drafts with pending answers, for a
|
|
166
265
|
* person to confirm on the pages. Safe to run again: starters already
|
|
167
|
-
* added (by their input) are skipped.
|
|
266
|
+
* added (by their input) are skipped. A suite's leak check runs on each,
|
|
267
|
+
* as in `importCases`.
|
|
168
268
|
*/
|
|
169
269
|
export function importStarters(store, suite) {
|
|
170
270
|
return importCases({
|
package/dist/importCases.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"importCases.js","sourceRoot":"","sources":["../src/importCases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"importCases.js","sourceRoot":"","sources":["../src/importCases.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA6D7C,0DAA0D;AAC1D,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,QAAQ,CAAkB;IACnC,YAAY,MAAc,EAAE,QAAyB;QACnD,KAAK,CACH,GAAG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AC,KAAK,CAAC;YACtB,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,KAAK,EAAE,CAAC,CAAC,KAAK;YACd,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,KAAK,EAAE,CAAC,CAAC,KAAK;SACf,CAAC;KACH,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds cases whose text appears in a feature's instructions. A case
|
|
3
|
+
* copied into the instructions as an example gets graded on an answer the
|
|
4
|
+
* model was handed, so its score rises without the model getting better.
|
|
5
|
+
* Pure.
|
|
6
|
+
*/
|
|
7
|
+
/** A stretch this long (after evening out) counts, even inside a longer text. */
|
|
8
|
+
export declare const IN_INSTRUCTIONS_MIN_CHARS = 20;
|
|
9
|
+
/** A whole case text this long counts when all of it appears. */
|
|
10
|
+
export declare const IN_INSTRUCTIONS_MIN_WHOLE = 12;
|
|
11
|
+
/** One case found in the instructions, with the words that matched. */
|
|
12
|
+
export type CaseInInstructions = {
|
|
13
|
+
caseId: string;
|
|
14
|
+
title: string;
|
|
15
|
+
/** The matching words, evened out (lowercase, no punctuation). */
|
|
16
|
+
found: string;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The cases whose input text appears in the instructions: all of one of
|
|
20
|
+
* its texts (when at least `minWhole` characters), or a run of whole words
|
|
21
|
+
* at least `minChars` long, after evening out case and punctuation. Use it
|
|
22
|
+
* to warn, not to fail: an example may belong in the instructions, and
|
|
23
|
+
* then the case should be rewritten or retired.
|
|
24
|
+
*
|
|
25
|
+
* @param cases - Each case's id, title, and input.
|
|
26
|
+
* @param instructions - Everything the model is told: system text, prompt
|
|
27
|
+
* templates, schema and tool descriptions (`instructionParts` in
|
|
28
|
+
* `@crowandraven/evalkeeper-ai-sdk` gives these).
|
|
29
|
+
* @param opts - Other lengths than `IN_INSTRUCTIONS_MIN_CHARS` and
|
|
30
|
+
* `IN_INSTRUCTIONS_MIN_WHOLE`.
|
|
31
|
+
* @returns The cases found, each with its longest matching words.
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* casesInInstructions(
|
|
35
|
+
* [{ id: "c1", title: "Broncos", input: { message: "the Broncos are hopeless" } }],
|
|
36
|
+
* ["Not hopeless: “The Broncos are hopeless!” is about a team."],
|
|
37
|
+
* ); // [{ caseId: "c1", title: "Broncos", found: "the broncos are hopeless" }]
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function casesInInstructions(cases: readonly {
|
|
41
|
+
id: string;
|
|
42
|
+
title: string;
|
|
43
|
+
input: unknown;
|
|
44
|
+
}[], instructions: readonly string[], opts?: {
|
|
45
|
+
minChars?: number;
|
|
46
|
+
minWhole?: number;
|
|
47
|
+
}): CaseInInstructions[];
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds cases whose text appears in a feature's instructions. A case
|
|
3
|
+
* copied into the instructions as an example gets graded on an answer the
|
|
4
|
+
* model was handed, so its score rises without the model getting better.
|
|
5
|
+
* Pure.
|
|
6
|
+
*/
|
|
7
|
+
/** A stretch this long (after evening out) counts, even inside a longer text. */
|
|
8
|
+
export const IN_INSTRUCTIONS_MIN_CHARS = 20;
|
|
9
|
+
/** A whole case text this long counts when all of it appears. */
|
|
10
|
+
export const IN_INSTRUCTIONS_MIN_WHOLE = 12;
|
|
11
|
+
/**
|
|
12
|
+
* Lowercase, apostrophes (straight or curly) dropped, and anything but
|
|
13
|
+
* letters and digits turned to single spaces, so "The Broncos are
|
|
14
|
+
* hopeless!" and "the broncos are hopeless" read the same.
|
|
15
|
+
*/
|
|
16
|
+
function evenOut(text) {
|
|
17
|
+
return text
|
|
18
|
+
.toLowerCase()
|
|
19
|
+
.replace(/[‘’']/g, "")
|
|
20
|
+
.replace(/[^\p{L}\p{N}]+/gu, " ")
|
|
21
|
+
.trim();
|
|
22
|
+
}
|
|
23
|
+
/** Every string in a value, however deep, in order. */
|
|
24
|
+
function stringsIn(value) {
|
|
25
|
+
if (typeof value === "string")
|
|
26
|
+
return [value];
|
|
27
|
+
if (Array.isArray(value))
|
|
28
|
+
return value.flatMap(stringsIn);
|
|
29
|
+
if (value && typeof value === "object")
|
|
30
|
+
return Object.values(value).flatMap(stringsIn);
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
/** The longest run of whole words from `text` that appears in `within`. */
|
|
34
|
+
function longestRun(text, within) {
|
|
35
|
+
const words = text.split(" ");
|
|
36
|
+
let best = "";
|
|
37
|
+
for (let i = 0; i < words.length; i++) {
|
|
38
|
+
let run = "";
|
|
39
|
+
for (let j = i; j < words.length; j++) {
|
|
40
|
+
const next = run ? `${run} ${words[j] ?? ""}` : (words[j] ?? "");
|
|
41
|
+
if (!` ${within} `.includes(` ${next} `))
|
|
42
|
+
break;
|
|
43
|
+
run = next;
|
|
44
|
+
}
|
|
45
|
+
if (run.length > best.length)
|
|
46
|
+
best = run;
|
|
47
|
+
}
|
|
48
|
+
return best;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The cases whose input text appears in the instructions: all of one of
|
|
52
|
+
* its texts (when at least `minWhole` characters), or a run of whole words
|
|
53
|
+
* at least `minChars` long, after evening out case and punctuation. Use it
|
|
54
|
+
* to warn, not to fail: an example may belong in the instructions, and
|
|
55
|
+
* then the case should be rewritten or retired.
|
|
56
|
+
*
|
|
57
|
+
* @param cases - Each case's id, title, and input.
|
|
58
|
+
* @param instructions - Everything the model is told: system text, prompt
|
|
59
|
+
* templates, schema and tool descriptions (`instructionParts` in
|
|
60
|
+
* `@crowandraven/evalkeeper-ai-sdk` gives these).
|
|
61
|
+
* @param opts - Other lengths than `IN_INSTRUCTIONS_MIN_CHARS` and
|
|
62
|
+
* `IN_INSTRUCTIONS_MIN_WHOLE`.
|
|
63
|
+
* @returns The cases found, each with its longest matching words.
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* casesInInstructions(
|
|
67
|
+
* [{ id: "c1", title: "Broncos", input: { message: "the Broncos are hopeless" } }],
|
|
68
|
+
* ["Not hopeless: “The Broncos are hopeless!” is about a team."],
|
|
69
|
+
* ); // [{ caseId: "c1", title: "Broncos", found: "the broncos are hopeless" }]
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export function casesInInstructions(cases, instructions, opts = {}) {
|
|
73
|
+
const minChars = opts.minChars ?? IN_INSTRUCTIONS_MIN_CHARS;
|
|
74
|
+
const minWhole = opts.minWhole ?? IN_INSTRUCTIONS_MIN_WHOLE;
|
|
75
|
+
const within = instructions.map(evenOut).join(" \u0000 ");
|
|
76
|
+
if (!within)
|
|
77
|
+
return [];
|
|
78
|
+
const found = [];
|
|
79
|
+
for (const c of cases) {
|
|
80
|
+
let best = "";
|
|
81
|
+
for (const raw of stringsIn(c.input)) {
|
|
82
|
+
const text = evenOut(raw);
|
|
83
|
+
if (!text)
|
|
84
|
+
continue;
|
|
85
|
+
const run = longestRun(text, within);
|
|
86
|
+
const counts = run.length >= minChars || (run === text && run.length >= minWhole);
|
|
87
|
+
if (counts && run.length > best.length)
|
|
88
|
+
best = run;
|
|
89
|
+
}
|
|
90
|
+
if (best)
|
|
91
|
+
found.push({ caseId: c.id, title: c.title, found: best });
|
|
92
|
+
}
|
|
93
|
+
return found;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=inInstructions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inInstructions.js","sourceRoot":"","sources":["../src/inInstructions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAE5C,iEAAiE;AACjE,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAU5C;;;;GAIG;AACH,SAAS,OAAO,CAAC,IAAY;IAC3B,OAAO,IAAI;SACR,WAAW,EAAE;SACb,OAAO,C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K,EAAE,IAAI,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -28,5 +28,10 @@ export * from "./weekly.js";
|
|
|
28
28
|
export * from "./settings.js";
|
|
29
29
|
export * from "./decisions.js";
|
|
30
30
|
export * from "./store.js";
|
|
31
|
+
export * from "./suiteContract.js";
|
|
32
|
+
export * from "./readCheck.js";
|
|
31
33
|
export * from "./labels.js";
|
|
34
|
+
export * from "./blind.js";
|
|
35
|
+
export * from "./inInstructions.js";
|
|
32
36
|
export * from "./importCases.js";
|
|
37
|
+
export * from "./activity.js";
|
package/dist/index.js
CHANGED
|
@@ -28,8 +28,13 @@ export * from "./weekly.js";
|
|
|
28
28
|
export * from "./settings.js";
|
|
29
29
|
export * from "./decisions.js";
|
|
30
30
|
export * from "./store.js";
|
|
31
|
+
export * from "./suiteContract.js";
|
|
32
|
+
export * from "./readCheck.js";
|
|
31
33
|
export * from "./labels.js";
|
|
34
|
+
export * from "./blind.js";
|
|
35
|
+
export * from "./inInstructions.js";
|
|
32
36
|
// Server-only (node:crypto): import from "@crowandraven/evalkeeper/runner".
|
|
33
37
|
// In-memory store for tests and demos: "@crowandraven/evalkeeper/memory".
|
|
34
38
|
export * from "./importCases.js";
|
|
39
|
+
export * from "./activity.js";
|
|
35
40
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc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CAAC;AACpC,4EAA4E;AAC5E,0EAA0E;AAC1E,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
package/dist/memoryStore.js
CHANGED
|
@@ -157,7 +157,9 @@ export function memoryStore() {
|
|
|
157
157
|
const at = now();
|
|
158
158
|
const l = { ...data, id: id("label"), createdAt: at, updatedAt: at };
|
|
159
159
|
c.labels.push(l);
|
|
160
|
-
|
|
160
|
+
// A skip isn't an answer: it leaves the case as tests last saw it.
|
|
161
|
+
if (data.status !== "SKIPPED")
|
|
162
|
+
c.updatedAt = at;
|
|
161
163
|
return l;
|
|
162
164
|
},
|
|
163
165
|
async setLabelStatus(labelId, status) {
|
package/dist/memoryStore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memoryStore.js","sourceRoot":"","sources":["../src/memoryStore.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,gBAAgB,GAIjB,MAAM,eAAe,CAAC;AAQvB;;;GAGG;AACH,MAAM,UAAU,WAAW;IAUzB,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,MAAM,IAAI,GAAgB,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAmB,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,MAAM,QAAQ,GAAsB,EAAE,CAAC;IACvC,MAAM,OAAO,GAAqB,EAAE,CAAC;IACrC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,EAAE,GAAG,CAAC,MAAc,EAAE,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;IACjE,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;IAE7B,OAAO;QACL,KAAK;QACL,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