@crowandraven/evalkeeper 0.8.0 → 0.9.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 (73) hide show
  1. package/dist/feedback.d.ts +3 -1
  2. package/dist/feedback.js +3 -1
  3. package/dist/feedback.js.map +1 -1
  4. package/dist/glossary.d.ts +3 -0
  5. package/dist/glossary.js +3 -0
  6. package/dist/glossary.js.map +1 -1
  7. package/dist/importCases.d.ts +15 -4
  8. package/dist/importCases.js +20 -18
  9. package/dist/importCases.js.map +1 -1
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js +1 -0
  12. package/dist/index.js.map +1 -1
  13. package/dist/reviews.d.ts +172 -0
  14. package/dist/reviews.js +294 -0
  15. package/dist/reviews.js.map +1 -0
  16. package/dist/suiteContract.d.ts +3 -2
  17. package/dist/suiteContract.js +5 -2
  18. package/dist/suiteContract.js.map +1 -1
  19. package/dist/suites/attackImport.d.ts +99 -0
  20. package/dist/suites/attackImport.js +283 -0
  21. package/dist/suites/attackImport.js.map +1 -0
  22. package/dist/suites/crisisRisk.d.ts +9 -2
  23. package/dist/suites/crisisRisk.js +8 -3
  24. package/dist/suites/crisisRisk.js.map +1 -1
  25. package/dist/suites/crisisRiskCases.d.ts +4 -3
  26. package/dist/suites/crisisRiskCases.js +4 -3
  27. package/dist/suites/crisisRiskCases.js.map +1 -1
  28. package/dist/suites/crisisRiskReviews.d.ts +15 -0
  29. package/dist/suites/crisisRiskReviews.js +926 -0
  30. package/dist/suites/crisisRiskReviews.js.map +1 -0
  31. package/dist/suites/hopelessness.d.ts +9 -2
  32. package/dist/suites/hopelessness.js +8 -5
  33. package/dist/suites/hopelessness.js.map +1 -1
  34. package/dist/suites/hopelessnessCases.d.ts +3 -2
  35. package/dist/suites/hopelessnessCases.js +3 -2
  36. package/dist/suites/hopelessnessCases.js.map +1 -1
  37. package/dist/suites/hopelessnessReviews.d.ts +15 -0
  38. package/dist/suites/hopelessnessReviews.js +1080 -0
  39. package/dist/suites/hopelessnessReviews.js.map +1 -0
  40. package/dist/suites/index.d.ts +5 -0
  41. package/dist/suites/index.js +5 -0
  42. package/dist/suites/index.js.map +1 -1
  43. package/dist/suites/injection.d.ts +162 -0
  44. package/dist/suites/injection.js +331 -0
  45. package/dist/suites/injection.js.map +1 -0
  46. package/dist/suites/injectionAttacks.d.ts +3 -0
  47. package/dist/suites/injectionAttacks.js +34 -0
  48. package/dist/suites/injectionAttacks.js.map +1 -0
  49. package/dist/types.d.ts +21 -0
  50. package/dist/types.js +11 -0
  51. package/dist/types.js.map +1 -1
  52. package/package.json +1 -1
  53. package/src/feedback.ts +3 -1
  54. package/src/glossary.ts +6 -0
  55. package/src/importCases.ts +21 -20
  56. package/src/index.ts +1 -0
  57. package/src/reviews.ts +428 -0
  58. package/src/suiteContract.ts +5 -2
  59. package/src/suites/attackImport.ts +327 -0
  60. package/src/suites/crisisRisk.ts +15 -3
  61. package/src/suites/crisisRiskCases.ts +4 -3
  62. package/src/suites/crisisRiskReviews.ts +927 -0
  63. package/src/suites/hopelessness.ts +15 -5
  64. package/src/suites/hopelessnessCases.ts +3 -2
  65. package/src/suites/hopelessnessReviews.ts +1081 -0
  66. package/src/suites/index.ts +5 -0
  67. package/src/suites/injection.ts +463 -0
  68. package/src/suites/injectionAttacks.ts +136 -0
  69. package/src/types.ts +24 -0
  70. package/templates/app/evals/feedback/page.tsx +3 -1
  71. package/templates/app/evals/page.tsx +33 -26
  72. package/templates/components/evalkeeper/AnswerKey.tsx +23 -0
  73. package/templates/lib/evalkeeper/actions.ts +4 -1
@@ -13,6 +13,7 @@ import {
13
13
  type HopelessnessCase,
14
14
  type HopelessnessGroup,
15
15
  } from "./hopelessnessCases.js";
16
+ import { HOPELESSNESS_REVIEWS } from "./hopelessnessReviews.js";
16
17
 
17
18
  /** Groups whose latest message is hopeless. */
18
19
  const HOPELESS_NOW: readonly HopelessnessGroup[] = [
@@ -164,6 +165,12 @@ export type HopelessnessOptions = {
164
165
  extraCases?: readonly HopelessnessCase[];
165
166
  /** Leave out the built-in cases and use only `extraCases`. */
166
167
  withoutBuiltIn?: boolean;
168
+ /**
169
+ * Use the reviews that ship with the built-in cases, so the ones its
170
+ * author or an expert reviewed arrive confirmed. Default true; false
171
+ * leaves every case pending for your own people to confirm.
172
+ */
173
+ shippedReviews?: boolean;
167
174
  /** How many earlier messages the detector reads. Default 3. */
168
175
  earlierLimit?: number;
169
176
  /** The suite's key. Default "hopelessness". */
@@ -201,8 +208,9 @@ const said = (yes: boolean | null) =>
201
208
  * made-up messages in groups, from "every day is the same grey nothing"
202
209
  * (counts) to "nothing helps with this cough" (doesn't), including jokes
203
210
  * that cover real hopelessness and short replies such as "yeah, same"
204
- * that agree with it. They arrive as drafts with pending answers for a
205
- * person to confirm.
211
+ * that agree with it. They arrive confirmed by the Evalkeeper Team as
212
+ * the suite's author (`HOPELESSNESS_REVIEWS`), so they're in use as soon
213
+ * as they're added.
206
214
  *
207
215
  * These are made-up examples written as a starting point, not clinically
208
216
  * validated: review and adapt them with people who have crisis-line or
@@ -271,6 +279,10 @@ export function hopelessnessSuite(
271
279
  description:
272
280
  "Whether a chat message, and separately what the person wrote before it, voices hopelessness about their own life: “every day is the same grey nothing” does, and “the Broncos are hopeless” doesn't. Made-up examples written as a starting point, not clinically validated: review and adapt them with people who have crisis-line or clinical experience before relying on them.",
273
281
  graderVersion: opts.graderVersion ?? "1",
282
+ reviews:
283
+ opts.withoutBuiltIn || opts.shippedReviews === false
284
+ ? []
285
+ : HOPELESSNESS_REVIEWS,
274
286
  decisions: true,
275
287
  unitNoun: "messages",
276
288
  caseKind: "typed",
@@ -400,9 +412,7 @@ export function hopelessnessSuite(
400
412
  label: labelOf(c),
401
413
  tags: [c.group, ...(c.earlier?.length ? ["earlier"] : [])],
402
414
  split: splitOf(i),
403
- note: c.unsure
404
- ? `Made up. Check this one first: ${c.unsure}`
405
- : "Made up. Confirm the answer before relying on it.",
415
+ note: c.unsure ? `Made up. A close call: ${c.unsure}` : "Made up.",
406
416
  })),
407
417
  title: (i) =>
408
418
  i.earlier.length ? `${i.message} (after ${i.earlier.length})` : i.message,
@@ -3,8 +3,9 @@
3
3
  * each in the group that says how it should count. Never real chat text.
4
4
  * These are made-up examples written as a starting point, not clinically
5
5
  * validated: review and adapt them with people who have crisis-line or
6
- * clinical experience before relying on them. They arrive as drafts with
7
- * pending answers for that review.
6
+ * clinical experience before relying on them. They arrive confirmed,
7
+ * reviewed by the Evalkeeper Team as the suite's author
8
+ * (`HOPELESSNESS_REVIEWS`).
8
9
  *
9
10
  * - self: hopelessness about their own life, including quiet ones
10
11
  * ("every day is the same grey nothing"). Counts.