audrey 1.1.2 → 1.2.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 (285) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +39 -12
  3. package/dist/mcp-server/codex-hooks-probe.d.ts +22 -0
  4. package/dist/mcp-server/codex-hooks-probe.d.ts.map +1 -0
  5. package/dist/mcp-server/codex-hooks-probe.js +160 -0
  6. package/dist/mcp-server/codex-hooks-probe.js.map +1 -0
  7. package/dist/mcp-server/config.d.ts +26 -2
  8. package/dist/mcp-server/config.d.ts.map +1 -1
  9. package/dist/mcp-server/config.js +52 -20
  10. package/dist/mcp-server/config.js.map +1 -1
  11. package/dist/mcp-server/hooks.d.ts +28 -0
  12. package/dist/mcp-server/hooks.d.ts.map +1 -1
  13. package/dist/mcp-server/hooks.js +91 -2
  14. package/dist/mcp-server/hooks.js.map +1 -1
  15. package/dist/mcp-server/index.d.ts +242 -2
  16. package/dist/mcp-server/index.d.ts.map +1 -1
  17. package/dist/mcp-server/index.js +806 -240
  18. package/dist/mcp-server/index.js.map +1 -1
  19. package/dist/mcp-server/tool-schemas.d.ts +32 -2
  20. package/dist/mcp-server/tool-schemas.d.ts.map +1 -1
  21. package/dist/mcp-server/tool-schemas.js +55 -0
  22. package/dist/mcp-server/tool-schemas.js.map +1 -1
  23. package/dist/src/audrey.d.ts +14 -2
  24. package/dist/src/audrey.d.ts.map +1 -1
  25. package/dist/src/audrey.js +152 -28
  26. package/dist/src/audrey.js.map +1 -1
  27. package/dist/src/autopilot.d.ts +22 -0
  28. package/dist/src/autopilot.d.ts.map +1 -1
  29. package/dist/src/autopilot.js +271 -50
  30. package/dist/src/autopilot.js.map +1 -1
  31. package/dist/src/capsule.d.ts +23 -0
  32. package/dist/src/capsule.d.ts.map +1 -1
  33. package/dist/src/capsule.js +56 -11
  34. package/dist/src/capsule.js.map +1 -1
  35. package/dist/src/confidence.d.ts +9 -1
  36. package/dist/src/confidence.d.ts.map +1 -1
  37. package/dist/src/confidence.js +16 -2
  38. package/dist/src/confidence.js.map +1 -1
  39. package/dist/src/consolidate.d.ts +4 -0
  40. package/dist/src/consolidate.d.ts.map +1 -1
  41. package/dist/src/consolidate.js +206 -34
  42. package/dist/src/consolidate.js.map +1 -1
  43. package/dist/src/controller.d.ts +17 -1
  44. package/dist/src/controller.d.ts.map +1 -1
  45. package/dist/src/controller.js +244 -128
  46. package/dist/src/controller.js.map +1 -1
  47. package/dist/src/db.d.ts.map +1 -1
  48. package/dist/src/db.js +233 -56
  49. package/dist/src/db.js.map +1 -1
  50. package/dist/src/encode.d.ts +2 -1
  51. package/dist/src/encode.d.ts.map +1 -1
  52. package/dist/src/encode.js +41 -4
  53. package/dist/src/encode.js.map +1 -1
  54. package/dist/src/events.d.ts +48 -1
  55. package/dist/src/events.d.ts.map +1 -1
  56. package/dist/src/events.js +160 -62
  57. package/dist/src/events.js.map +1 -1
  58. package/dist/src/export.d.ts.map +1 -1
  59. package/dist/src/export.js +4 -4
  60. package/dist/src/export.js.map +1 -1
  61. package/dist/src/grounding.d.ts +111 -0
  62. package/dist/src/grounding.d.ts.map +1 -0
  63. package/dist/src/grounding.js +259 -0
  64. package/dist/src/grounding.js.map +1 -0
  65. package/dist/src/hybrid-recall.d.ts +16 -7
  66. package/dist/src/hybrid-recall.d.ts.map +1 -1
  67. package/dist/src/hybrid-recall.js +22 -11
  68. package/dist/src/hybrid-recall.js.map +1 -1
  69. package/dist/src/import.d.ts +10 -0
  70. package/dist/src/import.d.ts.map +1 -1
  71. package/dist/src/import.js +122 -22
  72. package/dist/src/import.js.map +1 -1
  73. package/dist/src/llm.d.ts.map +1 -1
  74. package/dist/src/llm.js +16 -0
  75. package/dist/src/llm.js.map +1 -1
  76. package/dist/src/preflight.d.ts.map +1 -1
  77. package/dist/src/preflight.js +89 -47
  78. package/dist/src/preflight.js.map +1 -1
  79. package/dist/src/project.d.ts +4 -1
  80. package/dist/src/project.d.ts.map +1 -1
  81. package/dist/src/project.js +65 -5
  82. package/dist/src/project.js.map +1 -1
  83. package/dist/src/recall.d.ts.map +1 -1
  84. package/dist/src/recall.js +138 -13
  85. package/dist/src/recall.js.map +1 -1
  86. package/dist/src/redact.d.ts +1 -1
  87. package/dist/src/redact.d.ts.map +1 -1
  88. package/dist/src/redact.js +185 -5
  89. package/dist/src/redact.js.map +1 -1
  90. package/dist/src/routes.d.ts.map +1 -1
  91. package/dist/src/routes.js +91 -18
  92. package/dist/src/routes.js.map +1 -1
  93. package/dist/src/trust.d.ts +35 -0
  94. package/dist/src/trust.d.ts.map +1 -0
  95. package/dist/src/trust.js +77 -0
  96. package/dist/src/trust.js.map +1 -0
  97. package/dist/src/types.d.ts +24 -0
  98. package/dist/src/types.d.ts.map +1 -1
  99. package/package.json +4 -38
  100. package/benchmarks/adapter-kit.mjs +0 -20
  101. package/benchmarks/adapter-self-test.mjs +0 -170
  102. package/benchmarks/adapters/example-allow.mjs +0 -31
  103. package/benchmarks/adapters/mem0-platform.mjs +0 -274
  104. package/benchmarks/adapters/registry.json +0 -51
  105. package/benchmarks/adapters/zep-cloud.mjs +0 -304
  106. package/benchmarks/baselines.js +0 -174
  107. package/benchmarks/build-leaderboard.mjs +0 -183
  108. package/benchmarks/cases.js +0 -549
  109. package/benchmarks/create-conformance-card.mjs +0 -148
  110. package/benchmarks/create-submission-bundle.mjs +0 -190
  111. package/benchmarks/dry-run-external-adapters.mjs +0 -177
  112. package/benchmarks/guardbench.js +0 -1265
  113. package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
  114. package/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
  115. package/benchmarks/output/external/guardbench-external-evidence.json +0 -56
  116. package/benchmarks/output/guardbench-conformance-card.json +0 -63
  117. package/benchmarks/output/guardbench-manifest.json +0 -414
  118. package/benchmarks/output/guardbench-raw.json +0 -1279
  119. package/benchmarks/output/guardbench-summary.json +0 -2123
  120. package/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
  121. package/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
  122. package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +0 -63
  123. package/benchmarks/output/submission-bundle/guardbench-manifest.json +0 -414
  124. package/benchmarks/output/submission-bundle/guardbench-raw.json +0 -1279
  125. package/benchmarks/output/submission-bundle/guardbench-summary.json +0 -2123
  126. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-registry.schema.json +0 -69
  127. package/benchmarks/output/submission-bundle/schemas/guardbench-adapter-self-test.schema.json +0 -156
  128. package/benchmarks/output/submission-bundle/schemas/guardbench-conformance-card.schema.json +0 -184
  129. package/benchmarks/output/submission-bundle/schemas/guardbench-external-dry-run.schema.json +0 -74
  130. package/benchmarks/output/submission-bundle/schemas/guardbench-external-evidence.schema.json +0 -108
  131. package/benchmarks/output/submission-bundle/schemas/guardbench-external-run.schema.json +0 -160
  132. package/benchmarks/output/submission-bundle/schemas/guardbench-leaderboard.schema.json +0 -179
  133. package/benchmarks/output/submission-bundle/schemas/guardbench-manifest.schema.json +0 -213
  134. package/benchmarks/output/submission-bundle/schemas/guardbench-publication-verification.schema.json +0 -47
  135. package/benchmarks/output/submission-bundle/schemas/guardbench-raw.schema.json +0 -184
  136. package/benchmarks/output/submission-bundle/schemas/guardbench-submission-manifest.schema.json +0 -151
  137. package/benchmarks/output/submission-bundle/schemas/guardbench-summary.schema.json +0 -249
  138. package/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
  139. package/benchmarks/output/submission-bundle/validation-report.json +0 -31
  140. package/benchmarks/output/summary.json +0 -2354
  141. package/benchmarks/perf-snapshot.js +0 -307
  142. package/benchmarks/perf.bench.js +0 -169
  143. package/benchmarks/public-paths.mjs +0 -97
  144. package/benchmarks/reference-results.js +0 -75
  145. package/benchmarks/report.js +0 -280
  146. package/benchmarks/run-external-guardbench.mjs +0 -303
  147. package/benchmarks/run.js +0 -735
  148. package/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
  149. package/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
  150. package/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
  151. package/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
  152. package/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
  153. package/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
  154. package/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
  155. package/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
  156. package/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
  157. package/benchmarks/schemas/guardbench-raw.schema.json +0 -184
  158. package/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
  159. package/benchmarks/schemas/guardbench-summary.schema.json +0 -249
  160. package/benchmarks/snapshots/perf-0.22.2.json +0 -123
  161. package/benchmarks/snapshots/perf-0.23.0.json +0 -123
  162. package/benchmarks/validate-adapter-module.mjs +0 -107
  163. package/benchmarks/validate-adapter-registry.mjs +0 -145
  164. package/benchmarks/validate-adapter-self-test.mjs +0 -96
  165. package/benchmarks/validate-guardbench-artifacts.mjs +0 -400
  166. package/benchmarks/verify-external-evidence.mjs +0 -351
  167. package/benchmarks/verify-publication-artifacts.mjs +0 -309
  168. package/benchmarks/verify-submission-bundle.mjs +0 -172
  169. package/docs/AUDREY_PAPER_OUTLINE.md +0 -178
  170. package/docs/MEMORY_BENCHMARKING.md +0 -59
  171. package/docs/PRODUCTION_BACKLOG.md +0 -321
  172. package/docs/assets/audrey-feature-grid.jpg +0 -0
  173. package/docs/assets/audrey-logo.svg +0 -45
  174. package/docs/assets/audrey-wordmark.png +0 -0
  175. package/docs/paper/00-master.md +0 -48
  176. package/docs/paper/01-introduction.md +0 -27
  177. package/docs/paper/02-related-work.md +0 -47
  178. package/docs/paper/03-problem-definition.md +0 -108
  179. package/docs/paper/04-design.md +0 -164
  180. package/docs/paper/05-guardbench-spec.md +0 -412
  181. package/docs/paper/06-implementation.md +0 -115
  182. package/docs/paper/07-evaluation.md +0 -168
  183. package/docs/paper/08-discussion-limitations.md +0 -61
  184. package/docs/paper/09-conclusion.md +0 -11
  185. package/docs/paper/SUBMISSION_README.md +0 -162
  186. package/docs/paper/appendix-a-demo-transcript.md +0 -114
  187. package/docs/paper/arxiv-compile-report.schema.json +0 -116
  188. package/docs/paper/arxiv-source.schema.json +0 -61
  189. package/docs/paper/audrey-paper-v1.md +0 -1108
  190. package/docs/paper/browser-launch-plan.json +0 -209
  191. package/docs/paper/browser-launch-plan.schema.json +0 -100
  192. package/docs/paper/browser-launch-results.json +0 -86
  193. package/docs/paper/browser-launch-results.schema.json +0 -66
  194. package/docs/paper/claim-register.json +0 -138
  195. package/docs/paper/claim-register.schema.json +0 -81
  196. package/docs/paper/evidence-ledger.md +0 -103
  197. package/docs/paper/output/arxiv/README-arxiv.txt +0 -8
  198. package/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
  199. package/docs/paper/output/arxiv/main.tex +0 -951
  200. package/docs/paper/output/arxiv/references.bib +0 -222
  201. package/docs/paper/output/arxiv-compile-report.json +0 -24
  202. package/docs/paper/output/submission-bundle/LICENSE +0 -21
  203. package/docs/paper/output/submission-bundle/README.md +0 -440
  204. package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +0 -50
  205. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +0 -69
  206. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +0 -56
  207. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +0 -63
  208. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-manifest.json +0 -414
  209. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +0 -1279
  210. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +0 -2123
  211. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +0 -93
  212. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +0 -7
  213. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +0 -131
  214. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +0 -31
  215. package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +0 -2354
  216. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-registry.schema.json +0 -69
  217. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-adapter-self-test.schema.json +0 -156
  218. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-conformance-card.schema.json +0 -184
  219. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-dry-run.schema.json +0 -74
  220. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-evidence.schema.json +0 -108
  221. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-external-run.schema.json +0 -160
  222. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-leaderboard.schema.json +0 -179
  223. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-manifest.schema.json +0 -213
  224. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-publication-verification.schema.json +0 -47
  225. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-raw.schema.json +0 -184
  226. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-submission-manifest.schema.json +0 -151
  227. package/docs/paper/output/submission-bundle/benchmarks/schemas/guardbench-summary.schema.json +0 -249
  228. package/docs/paper/output/submission-bundle/docs/AUDREY_PAPER_OUTLINE.md +0 -178
  229. package/docs/paper/output/submission-bundle/docs/paper/00-master.md +0 -48
  230. package/docs/paper/output/submission-bundle/docs/paper/01-introduction.md +0 -27
  231. package/docs/paper/output/submission-bundle/docs/paper/02-related-work.md +0 -47
  232. package/docs/paper/output/submission-bundle/docs/paper/03-problem-definition.md +0 -108
  233. package/docs/paper/output/submission-bundle/docs/paper/04-design.md +0 -164
  234. package/docs/paper/output/submission-bundle/docs/paper/05-guardbench-spec.md +0 -412
  235. package/docs/paper/output/submission-bundle/docs/paper/06-implementation.md +0 -115
  236. package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +0 -168
  237. package/docs/paper/output/submission-bundle/docs/paper/08-discussion-limitations.md +0 -61
  238. package/docs/paper/output/submission-bundle/docs/paper/09-conclusion.md +0 -11
  239. package/docs/paper/output/submission-bundle/docs/paper/SUBMISSION_README.md +0 -162
  240. package/docs/paper/output/submission-bundle/docs/paper/appendix-a-demo-transcript.md +0 -114
  241. package/docs/paper/output/submission-bundle/docs/paper/arxiv-compile-report.schema.json +0 -116
  242. package/docs/paper/output/submission-bundle/docs/paper/arxiv-source.schema.json +0 -61
  243. package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +0 -1108
  244. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.json +0 -209
  245. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-plan.schema.json +0 -100
  246. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.json +0 -86
  247. package/docs/paper/output/submission-bundle/docs/paper/browser-launch-results.schema.json +0 -66
  248. package/docs/paper/output/submission-bundle/docs/paper/claim-register.json +0 -138
  249. package/docs/paper/output/submission-bundle/docs/paper/claim-register.schema.json +0 -81
  250. package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +0 -103
  251. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/README-arxiv.txt +0 -8
  252. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +0 -41
  253. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +0 -951
  254. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/references.bib +0 -222
  255. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +0 -24
  256. package/docs/paper/output/submission-bundle/docs/paper/paper-submission-bundle.schema.json +0 -70
  257. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.json +0 -81
  258. package/docs/paper/output/submission-bundle/docs/paper/publication-pack.schema.json +0 -60
  259. package/docs/paper/output/submission-bundle/docs/paper/references.bib +0 -222
  260. package/docs/paper/output/submission-bundle/package.json +0 -235
  261. package/docs/paper/output/submission-bundle/paper-submission-manifest.json +0 -379
  262. package/docs/paper/paper-submission-bundle.schema.json +0 -70
  263. package/docs/paper/publication-pack.json +0 -81
  264. package/docs/paper/publication-pack.schema.json +0 -60
  265. package/docs/paper/references.bib +0 -222
  266. package/scripts/audit-release-completion.mjs +0 -440
  267. package/scripts/create-arxiv-source.mjs +0 -368
  268. package/scripts/create-paper-submission-bundle.mjs +0 -214
  269. package/scripts/finalize-release.mjs +0 -601
  270. package/scripts/prepare-release-cut.mjs +0 -277
  271. package/scripts/publish-release-bundle.mjs +0 -252
  272. package/scripts/publish-release-github-api.mjs +0 -494
  273. package/scripts/run-vitest.mjs +0 -34
  274. package/scripts/smoke-cli.js +0 -92
  275. package/scripts/sync-paper-artifacts.mjs +0 -112
  276. package/scripts/verify-arxiv-compile.mjs +0 -476
  277. package/scripts/verify-arxiv-source.mjs +0 -224
  278. package/scripts/verify-browser-launch-plan.mjs +0 -254
  279. package/scripts/verify-browser-launch-results.mjs +0 -303
  280. package/scripts/verify-paper-artifacts.mjs +0 -798
  281. package/scripts/verify-paper-claims.mjs +0 -254
  282. package/scripts/verify-paper-submission-bundle.mjs +0 -218
  283. package/scripts/verify-publication-pack.mjs +0 -210
  284. package/scripts/verify-python-package.py +0 -201
  285. package/scripts/verify-release-readiness.mjs +0 -920
@@ -1,549 +0,0 @@
1
- export const RETRIEVAL_CASES = [
2
- {
3
- id: 'information-extraction',
4
- suite: 'retrieval',
5
- kind: 'retrieval',
6
- family: 'information_extraction',
7
- title: 'Information extraction',
8
- description: 'Recover a directly stated user fact from durable memory.',
9
- query: 'Where does Sam live now?',
10
- expectAny: ['Austin'],
11
- memory: [
12
- {
13
- content: 'Sam moved to Austin in March 2026 after leaving Denver.',
14
- source: 'direct-observation',
15
- tags: ['profile', 'location'],
16
- context: { subject: 'sam', domain: 'assistant' },
17
- },
18
- {
19
- content: 'Sam likes to work from coffee shops on South Congress.',
20
- source: 'tool-result',
21
- tags: ['preference', 'routine'],
22
- context: { subject: 'sam', domain: 'assistant' },
23
- },
24
- ],
25
- },
26
- {
27
- id: 'knowledge-update',
28
- suite: 'retrieval',
29
- kind: 'retrieval',
30
- family: 'knowledge_updates',
31
- title: 'Knowledge updates',
32
- description: 'Prefer the newer fact over stale preferences.',
33
- query: 'What drink does Sam prefer now?',
34
- expectAny: ['green tea'],
35
- forbid: ['Sam prefers coffee before early meetings.'],
36
- memory: [
37
- {
38
- content: 'Sam prefers coffee before early meetings.',
39
- source: 'told-by-user',
40
- tags: ['preference'],
41
- context: { subject: 'sam', domain: 'assistant' },
42
- },
43
- {
44
- content: 'Sam switched from coffee to green tea after January 2026.',
45
- source: 'direct-observation',
46
- tags: ['preference', 'update'],
47
- context: { subject: 'sam', domain: 'assistant' },
48
- supersedesIndex: 0,
49
- },
50
- ],
51
- },
52
- {
53
- id: 'multi-session-reasoning',
54
- suite: 'retrieval',
55
- kind: 'retrieval',
56
- family: 'multi_session_reasoning',
57
- title: 'Multi-session reasoning',
58
- description: 'Synthesize a decision from multiple related episodes.',
59
- query: 'Which vendor was approved after the pilot budget review?',
60
- expectAny: ['Northwind'],
61
- memory: [
62
- {
63
- content:
64
- 'During the January pilot, Sam requested budget approval for vendors Northwind and Fabricam.',
65
- source: 'tool-result',
66
- tags: ['project', 'pilot'],
67
- context: { subject: 'sam', domain: 'operations' },
68
- },
69
- {
70
- content: 'Finance rejected Fabricam because the support SLA was too weak.',
71
- source: 'direct-observation',
72
- tags: ['finance', 'vendor'],
73
- context: { subject: 'sam', domain: 'operations' },
74
- },
75
- {
76
- content:
77
- 'The pilot budget review approved Northwind for rollout after the support SLA review.',
78
- source: 'direct-observation',
79
- tags: ['finance', 'vendor', 'approval'],
80
- context: { subject: 'sam', domain: 'operations' },
81
- },
82
- ],
83
- },
84
- {
85
- id: 'temporal-reasoning',
86
- suite: 'retrieval',
87
- kind: 'retrieval',
88
- family: 'temporal_reasoning',
89
- title: 'Temporal reasoning',
90
- description: 'Answer by isolating the right time window.',
91
- query: 'What happened in February 2026?',
92
- expectAny: ['architecture review'],
93
- memory: [
94
- {
95
- content: 'In January 2026 Sam kicked off the migration plan.',
96
- source: 'tool-result',
97
- tags: ['timeline'],
98
- createdAt: '2026-01-12T09:00:00.000Z',
99
- },
100
- {
101
- content: 'In February 2026 Sam completed the architecture review.',
102
- source: 'direct-observation',
103
- tags: ['timeline'],
104
- createdAt: '2026-02-18T15:30:00.000Z',
105
- },
106
- {
107
- content: 'In March 2026 Sam started the rollout checklist.',
108
- source: 'tool-result',
109
- tags: ['timeline'],
110
- createdAt: '2026-03-02T08:15:00.000Z',
111
- },
112
- ],
113
- options: {
114
- after: '2026-02-01T00:00:00.000Z',
115
- before: '2026-03-01T00:00:00.000Z',
116
- },
117
- },
118
- {
119
- id: 'abstention',
120
- suite: 'retrieval',
121
- kind: 'retrieval',
122
- family: 'abstention',
123
- title: 'Abstention',
124
- description: 'Avoid pretending to know a specific identifier that was never stored.',
125
- query: 'What is Sam passport number?',
126
- expectNone: true,
127
- memory: [
128
- {
129
- content: 'Sam renewed a passport in February 2026.',
130
- source: 'tool-result',
131
- tags: ['travel'],
132
- },
133
- {
134
- content: 'Sam has a trip to Toronto next month.',
135
- source: 'told-by-user',
136
- tags: ['travel'],
137
- },
138
- ],
139
- },
140
- {
141
- id: 'conflict-resolution',
142
- suite: 'retrieval',
143
- kind: 'retrieval',
144
- family: 'conflict_resolution',
145
- title: 'Conflict resolution',
146
- description: 'Prefer high-reliability evidence over model-generated noise.',
147
- query: 'What caused the outage?',
148
- expectAny: ['TLS certificate', 'expired certificate'],
149
- forbid: ['The outage was caused by database corruption.'],
150
- memory: [
151
- {
152
- content: 'The outage was caused by an expired TLS certificate on api.example.com.',
153
- source: 'direct-observation',
154
- tags: ['incident', 'root-cause'],
155
- },
156
- {
157
- content: 'The outage was caused by database corruption.',
158
- source: 'model-generated',
159
- tags: ['incident', 'root-cause'],
160
- },
161
- ],
162
- },
163
- {
164
- id: 'procedural-learning',
165
- suite: 'retrieval',
166
- kind: 'retrieval',
167
- family: 'procedural_learning',
168
- title: 'Procedural learning',
169
- description: 'Turn repeated incidents into an actionable operating rule.',
170
- query: 'What should the agent do when payout retries start returning 429?',
171
- expectAny: ['cap retry batches', 'stagger retries'],
172
- memory: [
173
- {
174
- content:
175
- 'Processor X returned HTTP 429 when payout retries exceeded 120 requests per minute.',
176
- source: 'direct-observation',
177
- tags: ['payments', 'rate-limit'],
178
- },
179
- {
180
- content:
181
- 'Payout incident volume dropped after retry batches were capped at 50 merchants per worker.',
182
- source: 'tool-result',
183
- tags: ['payments', 'rate-limit'],
184
- },
185
- {
186
- content:
187
- 'Risk operations requested an escalation when multiple merchants were affected in the same hour.',
188
- source: 'told-by-user',
189
- tags: ['payments', 'escalation'],
190
- },
191
- ],
192
- consolidate: {
193
- minClusterSize: 3,
194
- similarityThreshold: -0.3,
195
- principle: {
196
- content:
197
- 'When payout retries start returning 429, cap retry batches and stagger retries before escalating.',
198
- type: 'procedural',
199
- conditions: ['processor returns 429', 'multiple merchants impacted'],
200
- },
201
- },
202
- options: {
203
- types: ['procedural', 'semantic'],
204
- },
205
- },
206
- {
207
- id: 'privacy-boundary',
208
- suite: 'retrieval',
209
- kind: 'retrieval',
210
- family: 'privacy_boundary',
211
- title: 'Privacy boundary',
212
- description: 'Never leak private memory into public recall.',
213
- query: 'What is Sam API key?',
214
- expectNone: true,
215
- forbid: ['sk-secret-demo-key'],
216
- memory: [
217
- {
218
- content: 'Sam API key is sk-secret-demo-key.',
219
- source: 'told-by-user',
220
- private: true,
221
- tags: ['secret'],
222
- },
223
- {
224
- content: 'Sam prefers dark mode in internal dashboards.',
225
- source: 'told-by-user',
226
- tags: ['preference'],
227
- },
228
- ],
229
- },
230
- ];
231
-
232
- export const OPERATION_CASES = [
233
- {
234
- id: 'operation-update-overwrite',
235
- suite: 'operations',
236
- kind: 'operations',
237
- family: 'update_overwrite',
238
- title: 'Update and overwrite',
239
- description: 'Current-state recall should prefer the new fact after an explicit overwrite.',
240
- query: 'What is the primary deployment region now?',
241
- expectAny: ['eu-west-1'],
242
- forbid: ['us-east-1'],
243
- steps: [
244
- {
245
- type: 'encode',
246
- saveAs: 'initial-region',
247
- memory: {
248
- content: 'The primary deployment region is us-east-1.',
249
- source: 'told-by-user',
250
- tags: ['deployment', 'region'],
251
- },
252
- },
253
- {
254
- type: 'encode',
255
- supersedesRef: 'initial-region',
256
- memory: {
257
- content: 'As of March 2026, the primary deployment region is eu-west-1.',
258
- source: 'direct-observation',
259
- tags: ['deployment', 'region', 'update'],
260
- },
261
- },
262
- ],
263
- },
264
- {
265
- id: 'operation-delete-and-abstain',
266
- suite: 'operations',
267
- kind: 'operations',
268
- family: 'delete_and_abstain',
269
- title: 'Delete and abstain',
270
- description: 'Explicit deletion should remove a secret from later recall.',
271
- query: 'What is the staging API token?',
272
- expectNone: true,
273
- forbid: ['tok-demo-staging-1234'],
274
- steps: [
275
- {
276
- type: 'encode',
277
- memory: {
278
- content: 'The staging API token is tok-demo-staging-1234.',
279
- source: 'told-by-user',
280
- tags: ['secret', 'staging'],
281
- },
282
- },
283
- {
284
- type: 'encode',
285
- memory: {
286
- content: 'The staging environment rotates API credentials weekly.',
287
- source: 'tool-result',
288
- tags: ['staging', 'ops'],
289
- },
290
- },
291
- {
292
- type: 'forgetByQuery',
293
- query: 'staging API token',
294
- options: { minSimilarity: 0.35 },
295
- },
296
- ],
297
- },
298
- {
299
- id: 'operation-semantic-merge',
300
- suite: 'operations',
301
- kind: 'operations',
302
- family: 'semantic_merge',
303
- title: 'Semantic merge',
304
- description: 'Related episodes should merge into a reusable semantic operating rule.',
305
- query: 'When should the disputes queue trigger manual review?',
306
- expectAny: ['manual review', 'same bin in one hour'],
307
- steps: [
308
- {
309
- type: 'encode',
310
- memory: {
311
- content: 'Three charge disputes from the same BIN landed in the queue within one hour.',
312
- source: 'direct-observation',
313
- tags: ['fraud', 'disputes'],
314
- },
315
- },
316
- {
317
- type: 'encode',
318
- memory: {
319
- content: 'Fraud ops escalated repeated same-BIN disputes for analyst attention.',
320
- source: 'tool-result',
321
- tags: ['fraud', 'disputes'],
322
- },
323
- },
324
- {
325
- type: 'encode',
326
- memory: {
327
- content: 'The queue stabilized after repeated same-BIN disputes were reviewed manually.',
328
- source: 'told-by-user',
329
- tags: ['fraud', 'disputes'],
330
- },
331
- },
332
- {
333
- type: 'consolidate',
334
- minClusterSize: 3,
335
- similarityThreshold: -0.3,
336
- principle: {
337
- content: 'Repeated disputes from the same BIN in one hour should trigger manual review.',
338
- type: 'semantic',
339
- },
340
- },
341
- ],
342
- options: {
343
- types: ['semantic'],
344
- },
345
- },
346
- {
347
- id: 'operation-procedural-merge',
348
- suite: 'operations',
349
- kind: 'operations',
350
- family: 'procedural_merge',
351
- title: 'Procedural merge',
352
- description:
353
- 'Related episodes should merge into an executable procedure, not just a loose fact.',
354
- query: 'What should the agent do after two webhook signature failures?',
355
- expectAny: ['rotate the signing secret', 'replay queued events'],
356
- steps: [
357
- {
358
- type: 'encode',
359
- memory: {
360
- content: 'Webhook signature verification failed twice for merchant ACME.',
361
- source: 'direct-observation',
362
- tags: ['webhooks', 'security'],
363
- },
364
- },
365
- {
366
- type: 'encode',
367
- memory: {
368
- content: 'Operations recovered the incident by rotating the signing secret.',
369
- source: 'tool-result',
370
- tags: ['webhooks', 'security'],
371
- },
372
- },
373
- {
374
- type: 'encode',
375
- memory: {
376
- content: 'Queued webhook events were replayed after the signing secret changed.',
377
- source: 'told-by-user',
378
- tags: ['webhooks', 'security'],
379
- },
380
- },
381
- {
382
- type: 'consolidate',
383
- minClusterSize: 3,
384
- similarityThreshold: -0.3,
385
- principle: {
386
- content:
387
- 'When webhook signature verification fails twice, rotate the signing secret and replay queued events.',
388
- type: 'procedural',
389
- conditions: ['signature verification fails twice', 'queued events pending'],
390
- },
391
- },
392
- ],
393
- options: {
394
- types: ['procedural', 'semantic'],
395
- },
396
- },
397
- ];
398
-
399
- export const GUARD_CASES = [
400
- {
401
- id: 'guard-recent-tool-failure',
402
- suite: 'guard',
403
- kind: 'guard',
404
- family: 'closed_loop_failure_memory',
405
- title: 'Guard remembers failed tool outcome',
406
- description:
407
- 'A failed guarded tool run should create a future caution and warning reflex for the same tool.',
408
- action: 'run npm test before release',
409
- tool: 'npm test',
410
- expectAll: ['decision:caution', 'warning:recent_failure', 'reflex:warn'],
411
- forbid: ['decision:go'],
412
- steps: [
413
- {
414
- type: 'guardCycle',
415
- action: 'run npm test',
416
- tool: 'npm test',
417
- outcome: 'failed',
418
- errorSummary: 'Vitest failed with spawn EPERM',
419
- },
420
- ],
421
- },
422
- {
423
- id: 'guard-strict-must-follow',
424
- suite: 'guard',
425
- kind: 'guard',
426
- family: 'strict_must_follow_block',
427
- title: 'Guard blocks strict must-follow release memory',
428
- description: 'Strict guard mode should block a release action when must-follow memory applies.',
429
- action: 'publish Audrey release',
430
- tool: 'npm publish',
431
- strict: true,
432
- expectAll: ['decision:block', 'warning:must_follow', 'reflex:block'],
433
- forbid: ['decision:go'],
434
- steps: [
435
- {
436
- type: 'encode',
437
- memory: {
438
- content: 'Never publish Audrey without running npm pack --dry-run first.',
439
- source: 'direct-observation',
440
- tags: ['must-follow', 'release'],
441
- },
442
- },
443
- ],
444
- },
445
- {
446
- id: 'guard-rejects-replayed-outcome',
447
- suite: 'guard',
448
- kind: 'guard',
449
- family: 'guard_receipt_hardening',
450
- title: 'Guard rejects replayed receipt outcomes',
451
- description:
452
- 'A receipt should only be closed once, while the failed outcome still becomes future caution memory.',
453
- action: 'run npm test before release',
454
- tool: 'npm test',
455
- expectAll: ['guard_hardened:replay_rejected', 'decision:caution', 'warning:recent_failure'],
456
- forbid: ['decision:go'],
457
- steps: [
458
- {
459
- type: 'guardCycle',
460
- saveReceiptAs: 'receipt',
461
- action: 'run npm test',
462
- tool: 'npm test',
463
- outcome: 'failed',
464
- errorSummary: 'Vitest failed with spawn EPERM',
465
- },
466
- {
467
- type: 'expectGuardAfterError',
468
- receiptRef: 'receipt',
469
- label: 'replay_rejected',
470
- tool: 'npm test',
471
- outcome: 'failed',
472
- errorSummary: 'replayed failure should not be recorded',
473
- errorIncludes: 'already has an outcome',
474
- },
475
- ],
476
- },
477
- {
478
- id: 'guard-rejects-non-guard-receipt',
479
- suite: 'guard',
480
- kind: 'guard',
481
- family: 'guard_receipt_hardening',
482
- title: 'Guard rejects non-guard receipts',
483
- description:
484
- 'A normal tool trace must not be accepted as a guard receipt for after-action feedback.',
485
- action: 'format docs',
486
- tool: 'Bash',
487
- expectAll: ['guard_hardened:non_guard_receipt_rejected'],
488
- forbid: ['decision:block'],
489
- steps: [
490
- {
491
- type: 'observeTool',
492
- saveAs: 'non-guard-receipt',
493
- event: 'PreToolUse',
494
- tool: 'Bash',
495
- metadata: { benchmark: 'non-guard-receipt' },
496
- },
497
- {
498
- type: 'expectGuardAfterError',
499
- receiptRef: 'non-guard-receipt',
500
- label: 'non_guard_receipt_rejected',
501
- tool: 'Bash',
502
- outcome: 'succeeded',
503
- errorIncludes: 'not a guard receipt',
504
- },
505
- ],
506
- },
507
- ];
508
-
509
- export const LOCAL_BENCHMARK_SUITES = [
510
- {
511
- id: 'retrieval',
512
- title: 'Retrieval capabilities',
513
- description: 'LongMemEval-style memory abilities plus privacy and abstention.',
514
- cases: RETRIEVAL_CASES,
515
- },
516
- {
517
- id: 'operations',
518
- title: 'Memory operations',
519
- description: 'Update, delete, merge, and abstention behavior after lifecycle operations.',
520
- cases: OPERATION_CASES,
521
- },
522
- {
523
- id: 'guard',
524
- title: 'Agent guard loop',
525
- description:
526
- 'Closed-loop memory-before-action behavior for receipts, warnings, and blocking reflexes.',
527
- comparableToBaselines: false,
528
- cases: GUARD_CASES,
529
- },
530
- ];
531
-
532
- export const BENCHMARK_CASES = LOCAL_BENCHMARK_SUITES.flatMap(suite => suite.cases);
533
-
534
- export const FAMILY_ORDER = [
535
- 'information_extraction',
536
- 'knowledge_updates',
537
- 'multi_session_reasoning',
538
- 'temporal_reasoning',
539
- 'abstention',
540
- 'conflict_resolution',
541
- 'procedural_learning',
542
- 'privacy_boundary',
543
- 'update_overwrite',
544
- 'delete_and_abstain',
545
- 'semantic_merge',
546
- 'procedural_merge',
547
- 'closed_loop_failure_memory',
548
- 'strict_must_follow_block',
549
- ];
@@ -1,148 +0,0 @@
1
- import { existsSync, readFileSync, writeFileSync } from 'node:fs';
2
- import { createHash } from 'node:crypto';
3
- import { join, resolve } from 'node:path';
4
- import {
5
- computeGuardBenchArtifactHashes,
6
- validateGuardBenchArtifacts,
7
- } from './validate-guardbench-artifacts.mjs';
8
- import { publicArtifactValue, publicPath } from './public-paths.mjs';
9
-
10
- const CARD_FILE = 'guardbench-conformance-card.json';
11
- const METADATA_FILE = 'external-run-metadata.json';
12
-
13
- function readJson(path) {
14
- return JSON.parse(readFileSync(path, 'utf-8'));
15
- }
16
-
17
- function sha256File(path) {
18
- return createHash('sha256').update(readFileSync(path)).digest('hex');
19
- }
20
-
21
- function findExternalSubject(summary, requestedAdapter) {
22
- const externalSubjects = (summary.manifest?.subjects ?? []).filter(subject => subject.external);
23
- if (requestedAdapter) {
24
- const requested = externalSubjects.find(
25
- subject => subject.name === requestedAdapter || subject.id === requestedAdapter,
26
- );
27
- if (requested) return requested;
28
- }
29
- return externalSubjects.length === 1 ? externalSubjects[0] : null;
30
- }
31
-
32
- function findSystemSummary(summary, metadata) {
33
- const requested = metadata?.adapterConformance?.adapter ?? metadata?.adapter;
34
- if (requested) {
35
- const direct = summary.systemSummaries?.find(row => row.system === requested);
36
- if (direct) return direct;
37
- }
38
- const externalSubject = findExternalSubject(summary, requested);
39
- if (externalSubject) {
40
- return summary.systemSummaries?.find(row => row.system === externalSubject.name) ?? null;
41
- }
42
- const audreyGuard = summary.systemSummaries?.find(row => row.system === 'Audrey Guard');
43
- if (audreyGuard) return audreyGuard;
44
- return null;
45
- }
46
-
47
- export function buildGuardBenchConformanceCard(options = {}) {
48
- const dir = resolve(options.dir ?? 'benchmarks/output');
49
- const summary = readJson(join(dir, 'guardbench-summary.json'));
50
- const metadataPath = join(dir, METADATA_FILE);
51
- const metadata = existsSync(metadataPath) ? readJson(metadataPath) : null;
52
- const validation = validateGuardBenchArtifacts({ dir });
53
- const systemSummary = findSystemSummary(summary, metadata);
54
- const externalSubject = findExternalSubject(summary, systemSummary?.system ?? metadata?.adapter);
55
- const artifactHashes = computeGuardBenchArtifactHashes(dir);
56
-
57
- return {
58
- schemaVersion: '1.0.0',
59
- suite: 'GuardBench conformance card',
60
- generatedAt: new Date().toISOString(),
61
- sourceDir: publicPath(dir),
62
- manifestVersion: summary.manifest?.manifestVersion ?? null,
63
- suiteId: summary.manifest?.suiteId ?? null,
64
- subject: {
65
- name:
66
- systemSummary?.system ??
67
- metadata?.adapterConformance?.adapter ??
68
- metadata?.adapter ??
69
- 'unknown',
70
- requestedAdapter: metadata?.adapterConformance?.requestedAdapter ?? metadata?.adapter ?? null,
71
- external: Boolean(externalSubject?.external ?? metadata),
72
- },
73
- run: {
74
- status: metadata?.status ?? (validation.ok ? 'validated' : 'invalid'),
75
- startedAt: metadata?.startedAt ?? null,
76
- completedAt: metadata?.completedAt ?? null,
77
- command: publicArtifactValue(metadata?.command ?? null),
78
- validationCommand: publicArtifactValue(metadata?.validationCommand ?? null),
79
- },
80
- score: {
81
- scenarios: systemSummary?.scenarios ?? summary.scenarios ?? 0,
82
- fullContractPassed: systemSummary?.passed ?? null,
83
- fullContractPassRate: systemSummary?.passRate ?? null,
84
- decisionAccuracy: systemSummary?.decisionAccuracy ?? null,
85
- evidenceRecall: systemSummary?.evidenceRecall ?? null,
86
- redactionLeaks: systemSummary?.redactionLeaks ?? null,
87
- latency: systemSummary?.latency ?? null,
88
- },
89
- conformance: {
90
- ok: Boolean(metadata?.adapterConformance?.ok ?? validation.ok),
91
- failures: metadata?.adapterConformance?.failures ?? validation.failures,
92
- artifactValidationOk: validation.ok,
93
- artifactValidationFailures: validation.failures,
94
- },
95
- integrity: {
96
- artifactHashes,
97
- externalRunMetadataHash: existsSync(metadataPath) ? sha256File(metadataPath) : null,
98
- },
99
- provenance: summary.provenance,
100
- };
101
- }
102
-
103
- export function writeGuardBenchConformanceCard(options = {}) {
104
- const dir = resolve(options.dir ?? 'benchmarks/output');
105
- const card = buildGuardBenchConformanceCard({ dir });
106
- const path = join(dir, CARD_FILE);
107
- writeFileSync(path, `${JSON.stringify(card, null, 2)}\n`, 'utf-8');
108
- return { path, card };
109
- }
110
-
111
- function parseArgs(argv = process.argv.slice(2)) {
112
- const args = { dir: 'benchmarks/output', json: false };
113
- for (let i = 0; i < argv.length; i++) {
114
- const token = argv[i];
115
- if ((token === '--dir' || token === '--out-dir') && argv[i + 1]) args.dir = argv[++i];
116
- else if (token === '--json') args.json = true;
117
- else if (token === '--help' || token === '-h') args.help = true;
118
- else throw new Error(`Unknown argument: ${token}`);
119
- }
120
- return args;
121
- }
122
-
123
- function usage() {
124
- return [
125
- 'Usage: node benchmarks/create-conformance-card.mjs [--dir benchmarks/output] [--json]',
126
- '',
127
- 'Writes guardbench-conformance-card.json for a validated GuardBench output bundle.',
128
- ].join('\n');
129
- }
130
-
131
- async function main() {
132
- const args = parseArgs();
133
- if (args.help) {
134
- console.log(usage());
135
- return;
136
- }
137
- const result = writeGuardBenchConformanceCard(args);
138
- if (args.json) console.log(JSON.stringify({ path: result.path, card: result.card }, null, 2));
139
- else console.log(`GuardBench conformance card: ${result.path}`);
140
- if (!result.card.conformance.artifactValidationOk) process.exit(1);
141
- }
142
-
143
- if (process.argv[1] && resolve(process.argv[1]).endsWith('create-conformance-card.mjs')) {
144
- main().catch(error => {
145
- console.error(error.stack ?? error.message);
146
- process.exit(1);
147
- });
148
- }