audrey 1.1.3 → 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 +93 -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 +3 -37
  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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,98 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.0 - 2026-08-21
4
+
5
+ ### Grounding — memories are checked against the project, not just aged
6
+
7
+ Confidence has always answered whether a memory is recent, well-sourced, and
8
+ uncontradicted. Nothing answered whether it is still true. A procedure that
9
+ says to deploy with `npm run deploy:prod` kept full confidence after that
10
+ script was deleted, and every recall raised it further, because retrieval
11
+ counts as reinforcement. Stale memory is worse than absent memory: Guard
12
+ states it with evidence attached, so the agent follows it into a wall.
13
+
14
+ - When a memory is written, Audrey records the checkable claims in it — repository-relative paths and package script names — but only the ones that resolve at that moment. A claim that never resolved is a guess about someone's typo; a claim that resolved once and no longer does is the world having changed underneath a memory that still asserts it. Only the second kind is stored, which is what makes a later break worth reporting.
15
+ - Anchors are re-checked during the maintenance sweep, on `audrey dream`, on demand via `audrey ground`, and through the `memory_ground` MCP tool. A path or script that comes back clears the broken state, so a reverted delete or a branch switch does not permanently discredit a memory.
16
+ - A broken memory keeps its content and its place in the store. Recall labels it, states plainly what it still refers to, and applies a 0.5 confidence multiplier so it stops leading by default while staying readable and repairable.
17
+ - A broken memory can no longer escalate into the capsule's `must_follow` section. That section is the one that can force a strict-mode Guard block, and a rule naming a file that no longer exists is a rule nobody can follow; such memories surface under `uncertain_or_disputed` instead.
18
+ - Unanchored memories are left unlabelled. Absence of anchors is not a clean bill of health, and presenting it as one would be the same mistake in the other direction.
19
+ - A project that cannot be read — a moved checkout, a missing drive — reports unknown rather than broken. Memories are never discredited because the machine changed.
20
+
21
+ ### Memory privacy
22
+
23
+ - `memory_encode`, `POST /v1/encode`, and `Audrey.encode` now redact content, context values, and affect labels before anything reaches the episodes table, the full-text index, or the embedding model. Previously only tool-trace capture was redacted; a secret pasted into an explicit "remember this" call was stored in plaintext. The MCP tool result now echoes the stored (redacted) content plus a redaction summary instead of reflecting the caller's raw input, and batch encodes embed the redacted text rather than the original.
24
+ - A dedicated redaction rule catches multi-word passphrases and BIP39-style mnemonics (eight or more space- or hyphen-joined lowercase words). The previous identifier exemption treated exactly that shape as a machine identifier and let it through.
25
+ - `redactJson` handles a literal `__proto__` key as ordinary data: the nested value is redacted and preserved instead of silently vanishing through the prototype setter.
26
+ - A filesystem-path shape raises the entropy bar for the high-entropy secret rule instead of exempting the value outright. Long mixed-case paths can cross the plain entropy gate, which mangled stored `cwd` metadata and silently broke Guard project scoping; a blanket exemption fixed that but opened a wider hole, because AWS secret access keys draw from an alphabet containing `/` and roughly one in seventeen lands in a path-like shape by chance. Measured against 20,000 generated keys: 5.78% stored verbatim before, 0.02% after, with every path in a corpus of absolute, relative, temp-directory and toolchain paths still preserved intact.
27
+ - Sensitive key detection matches the sensitive word anywhere in a compound key rather than only as its suffix. `aws_secret_access_key` and `stripe_secret_key` matched nothing before, which also stopped `redactJson`'s sensitive-ancestor fallback from covering their values — so both redaction layers missed the field name credentials actually ship under. Plural collection fields such as `tokens` stay unmatched.
28
+ - `memory_import` and `POST /v1/import` redact content, context, and affect before anything is stored or embedded, and strip the reserved trust marker the same way every other ingestion boundary does. Import previously did neither, so a snapshot could carry secrets into storage verbatim and grant itself verified control-memory trust — the one path that bypassed both of this release's security additions. Imported timestamps must now parse as real dates.
29
+ - `memory_export` escapes markup in its response. It was the one tool returning stored memory content without the anti-injection escaping its siblings apply.
30
+ - Memories marked `private` are excluded from the episode content sent to a configured cloud LLM during consolidation. They still consolidate through the local heuristic path.
31
+ - The first cloud LLM completion in a process prints a one-time stderr notice naming the provider and endpoint before any memory content leaves the machine.
32
+
33
+ ### Guard trust and provenance
34
+
35
+ - A must-follow memory only escalates to a high-severity directive (capable of forcing a strict-mode block) when its source is `direct-observation` or `told-by-user` **and** its context carries the `audrey_trust: user-verified` marker, which only Autopilot's genuine user-prompt capture can set — MCP, HTTP, and CLI encode boundaries strip it from caller-supplied context. Previously any caller could self-report a trusted source and plant a durable directive into every future Guard decision. Trusted-source memories created before this release are grandfathered at medium severity: still surfaced, never alone sufficient to force a strict block.
36
+ - `Audrey.afterAction` accepts `overrideReason` for recording a succeeded outcome against a receipt that was blocked for a policy reason rather than an exact repeated failure. The reason is written into the event metadata as durable evidence. Exact-repeat-failure blocks still cannot be recorded as succeeded this way; they require a fresh acknowledged `beforeAction`. Exact-repeat detection now applies uniformly across the library API, MCP tools, HTTP routes, and CLI, which previously enforced different subsets of these checks.
37
+ - Generated hooks now guard `MultiEdit` and every `mcp__*` tool from connected MCP servers, excluding Audrey's own memory tools so Guard preflight does not recursively fire on `memory_recall` and its siblings.
38
+ - Preflight reuses the failure analysis its capsule already computed instead of scanning `memory_events` a second time, and its tagged must-follow sweep only runs when a must-follow tag exists anywhere in the store.
39
+ - A failure in that tagged must-follow sweep now surfaces as a high-severity memory-health warning. It was swallowed, so the sweep that exists precisely to catch a control directive the capsule ranked too low could drop it and say nothing.
40
+ - `memory_recall` strips the reserved trust marker from caller-supplied context, matching `POST /v1/recall`. Query-side context feeds match scoring and is never persisted, so this closes no exploit on its own; it keeps the rule "the marker does not cross an external boundary in either direction" true of every boundary rather than resting on a per-handler judgement.
41
+ - The `memory_encode` response falls back to redacted content when re-reading the stored row fails, instead of echoing the caller's raw input. The fallback was the one path that could return a secret the storage boundary had just scrubbed.
42
+
43
+ ### Performance
44
+
45
+ - `recentFailures()` replaced three correlated per-row subqueries with a single materialized window-function pass backed by a new composite index on `(tool_name, outcome, created_at, actor_agent)`. Measured before the fix: about 199 ms per call at 10,000 `memory_events` rows and about 24 s at 100,000 rows — inside a Guard check whose hook timeout is 30 s. Measured after (`npm run bench:scale`, 50,000 events): 22 ms p95. This query runs on every prompt and every guarded tool call.
46
+ - Database open no longer re-scans episodes, semantics, and procedures for unsynced embeddings on every hook process. A persisted per-table high-water mark plus partial indexes reduce a steady-state open to one `MAX(id)` comparison per table. The mark is keyed on memory id rather than rowid: SQLite hands out `max(rowid)+1`, so deleting the row holding the current maximum makes the next insert reuse that rowid, and a rowid mark then reads the new row as already synced and drops it from its vector table permanently. Memory ids are ULIDs, which a delete never recycles. Schema migrates to v15; each migration commits atomically with its version bump.
47
+ - Consolidation's near-duplicate merge lookup uses the vec0 index instead of computing a cosine distance against every active memory for the agent. That scan ran once per extracted principle inside the consolidation write transaction, holding SQLite's write lock against concurrent Guard hooks. Measured: 2.2 ms at 500 active semantics and 176 ms at 30,000 before, 0.08 ms and 6.1 ms after. `benchmarks/scale.bench.js` now gates this path, which it seeded but never measured.
48
+ - Guard's must-follow existence probe is backed by a partial index. The leading-wildcard `LIKE` scanned the whole episodes table on the hottest path in the system; measured at 50,000 episodes with no match, 3.54 ms before and 0.003 ms after.
49
+ - `memory_events` has retention: Autopilot maintenance prunes events older than 90 days by default (`deleteEventsBefore` batches deletes and reports the count). The table previously grew without bound for the life of an install.
50
+ - `benchmarks/scale.bench.js` seeds tens of thousands of rows and asserts p95 budgets for the hook hot path (`recentFailures`, capsule build, preflight, cold reopen), which the 20-row benchmark that previously gated releases could not catch.
51
+
52
+ ### Recall quality
53
+
54
+ - Hybrid recall normalizes the FTS signal onto the same scale as the vector score before weighting. The previous fusion mixed a raw 0–1 vector score against reciprocal-rank terms two orders of magnitude smaller, so the nominal 0.7 FTS weight contributed at most ~0.023 and exact keyword or identifier matches almost always lost to loosely similar vector hits.
55
+ - Confidence rewards independent corroboration: `source_type_diversity`, already tracked and reinforced on every semantic memory, now feeds a bounded bonus in the confidence formula. Two identically-supported memories are no longer scored the same when one is backed by three independent source types and the other by three copies of the same source.
56
+ - Consolidation checks new principles against existing active memories and merges near-duplicates (evidence union, reinforcement bookkeeping) instead of minting a redundant semantic or procedure on every dream cycle; recall's duplicate suppression also breaks equal-reliability ties deterministically for near-identical content instead of letting both duplicates through.
57
+ - Capsules accept `excludeIds`, and Autopilot passes the session's already-injected set, so exclusion happens before the character budget is spent and later capsules surface next-ranked unseen memories instead of going quiet while re-fetching content the session has already seen.
58
+
59
+ ### Dependencies
60
+
61
+ - Took the available production dependency fixes: `hono` 4.12 to 4.13 (cross-user data disclosure through retained SSR output, CORS ReDoS, `Connection` header handling), `@hono/node-server` 1.19.14 to 1.19.17 (path traversal via encoded backslash on Windows), plus `body-parser`, `fast-uri`, and `tar`. All are within the declared ranges; no major versions moved.
62
+ - Two high-severity `sharp` advisories remain, reached through `@huggingface/transformers`, which declares a range with no patched release. Audrey never imports `sharp`, so a text-only embedding pipeline does not execute it, but it is installed and the advisory is real. Recorded in the README production checklist rather than suppressed.
63
+
64
+ ### Autopilot
65
+
66
+ - Worktree checkouts resolve to their repository's common root, so all worktrees of one repo share a memory namespace instead of fragmenting must-follow rules and failure history per checkout. A drive-qualified pointer (`C:/repo/.git/worktrees/...`) read on a POSIX host is treated as absolute rather than joined onto the worktree directory, so it fails by not existing instead of silently resolving to a path that never did.
67
+ - A named host's generated config uses that host's own agent name instead of inheriting an ambient `AUDREY_AGENT`. Autopilot exports that variable into every hook process, so `audrey install --host codex` run from inside a hooked Claude Code session wrote `claude-code` into Codex's config and pointed both hosts at one memory namespace — in exactly the session where someone is most likely to run the install. The unnamed `generic` host, which has no identity of its own, still honors an explicitly exported name.
68
+ - The Python client accepts an affect without `valence`, matching the TypeScript type and the MCP schemas, which both made it optional. Python was rejecting payloads the server accepts.
69
+ - Only the `global-preference` tag crosses project boundaries. Generic `preference`-class tags no longer leak project-local memories into every other project's packets.
70
+ - Hook processes derive their internal embedding and LLM timeouts from the invoked event's declared host timeout, leaving margin to exit cleanly instead of being killed mid-write by the host.
71
+
72
+ ### Diagnostics
73
+
74
+ - `audrey doctor` inspects Claude Code hook installs (present handlers, unparseable runtime, missing node/entrypoint paths) with the same depth previously applied only to Codex, and warns when an installed hook entrypoint's version differs from the running CLI — the two known causes of memory packets silently stopping.
75
+ - Hook failures append to a small rotating log under the data directory, independent of the SQLite store, and doctor surfaces the recent failure history. Previously a hook crash left no trace beyond that process's stderr.
76
+ - The MCP tools that return stored memory content directly (`memory_recall`, `memory_capsule`, `memory_greeting`, `memory_guard_before`, `memory_preflight`, `memory_reflexes`) apply the same evidence-not-authority framing and markup escaping as the auto-injected packet, and `memory_recall` no longer silently drops the `partial_failure` degradation signal its HTTP counterpart already reported.
77
+
78
+ ### HTTP surface
79
+
80
+ - `POST /v1/encode` strips the reserved trust-context marker from caller-supplied `context` before it reaches storage, and `POST /v1/recall` does the same for its `context` match parameter (including the nested `recall.context` that `POST /v1/capsule` forwards to it), so an HTTP caller can no longer self-certify a memory or query as genuine user-stated direction.
81
+ - Adds `POST /v1/promote`, gated behind `AUDREY_ENABLE_ADMIN_TOOLS=1` like `/v1/export`, `/v1/import`, and `/v1/forget`. It mirrors the `memory_promote` MCP tool and CLI command.
82
+ - `POST /v1/guard/after` validates `outcome` against the real enum (`succeeded`, `failed`, `blocked`, `skipped`, `unknown`) instead of a bare type assertion, returning 400 with a specific message on an invalid value instead of a raw SQLite constraint error.
83
+ - `POST /v1/guard/after` accepts `override_reason` / `overrideReason`, plumbed through to `Audrey.afterAction` for recording a succeeded outcome against a Guard receipt that was blocked for a reason other than an exact repeated failure.
84
+ - Every route now honors a per-call `agent` in the request body as a fallback when the `X-Audrey-Agent` header is absent. This makes the Python client's per-call `agent` keyword argument actually take effect; previously it was silently ignored because every route resolved the acting agent from the header only. The header still wins when both are present.
85
+
86
+ ### Provider configuration
87
+
88
+ - Cloud embedding and LLM providers are never auto-selected from an ambient `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`. Leaving `AUDREY_EMBEDDING_PROVIDER` or `AUDREY_LLM_PROVIDER` unset (or `auto`) uses local embeddings and local heuristic reflection; a cloud provider requires explicitly setting the variable, and doing so without the matching API key now fails loudly instead of running unconfigured.
89
+
90
+ ### Repository hygiene and packaging
91
+
92
+ - `docs/PRODUCTION_BACKLOG.md` was tracked in git and listed in `package.json`'s `files` array, so an internal P0/P1/P2 backlog, pricing notes, and launch-postmortem detail shipped in every `npm install audrey` tarball. It has been removed from git tracking and from `files`; the content is preserved locally, outside the repo. `docs/AUDREY_PAPER_OUTLINE.md` is removed from `files` too — it is a pre-writing outline, not something a library consumer needs — but stays tracked in git because `scripts/create-paper-submission-bundle.mjs` reads it as a real build input.
93
+ - Trims the published npm package to what a consumer of the library or MCP server actually needs: `dist/`, `examples/`, `README.md`, `CHANGELOG.md`, `SECURITY.md`, and `LICENSE`. Benchmarks, the compiled arXiv PDF, submission bundles, and other repo-only documentation no longer ship. Measured with `npm pack --dry-run`: 399 files / 965.3 kB packed / 4.0 MB unpacked before, 217 files / 332.7 kB packed / 1.5 MB unpacked after.
94
+ - Removes the `pretest` lifecycle hook that made every `npm test` silently run a full rebuild plus the entire benchmark and paper pipeline, including `paper:sync`, which unconditionally overwrote `README.md` and three files under `docs/paper/`. `npm test` is now just the Vitest run; `tests/setup/ensure-release-artifacts.js` already generates the fixtures those tests need. `npm run test:artifacts` remains available as an explicit script; its benchmark steps stay folded into `release:gate`, `release:gate:sandbox`, and `release:gate:paper`, and its paper steps (`paper:sync` onward) remain exclusive to `release:gate:paper`, same as before this change. `release:gate` now builds and runs the performance benchmark explicitly instead of relying on the removed hook to do it implicitly.
95
+
3
96
  ## 1.1.3 - 2026-07-13
4
97
 
5
98
  ### MCP Registry publishing fixes
package/README.md CHANGED
@@ -60,7 +60,7 @@ Autopilot then closes the loop:
60
60
  | A tool failure is reported | Forms a durable, sanitized failure memory for the next attempt |
61
61
  | The turn stops or context compacts | Runs lightweight, due-only consolidation without holding the conversation open |
62
62
 
63
- Infrastructure failures are fail-open by default: a broken memory service must not strand a developer. Teams that need enforcement can set `AUDREY_HOOK_FAIL_CLOSED=1`.
63
+ Each hook event carries a host-declared timeout (30 seconds for the `PreToolUse` Guard check); Audrey races its own internal embedding/LLM timeout a few seconds ahead of that deadline so it can exit cleanly instead of losing the race to the host's kill. Infrastructure failures are fail-open by default: if Audrey itself errors or runs out of time, the tool call proceeds unguarded rather than freezing the session. Set `AUDREY_HOOK_FAIL_CLOSED=1` to deny the action instead when the `PreToolUse` check fails this way; other lifecycle hooks (session start, prompt recall, post-tool bookkeeping) have no "deny" to fall back to and always degrade open regardless of this setting.
64
64
 
65
65
  ## A small story about a failed deploy
66
66
 
@@ -94,11 +94,34 @@ Audrey treats memory as more than a pile of text chunks.
94
94
 
95
95
  Every context packet includes memory IDs, confidence, provenance where available, and a reason for inclusion. Uncertain or disputed memories are labeled as such. Retrieved content is wrapped with a simple rule: memory is evidence, not authority; current system and user instructions always win.
96
96
 
97
+ ## When a memory stops being true
98
+
99
+ Age is not the only way a memory goes wrong. A note saying "ship with `npm run deploy:prod`" is perfectly recent, well sourced, and completely wrong the day that script is deleted. Worse, every recall reinforces it, because retrieval counts as evidence that a memory is useful. A confidently stated, well-supported, false instruction is more damaging than no memory at all.
100
+
101
+ So Audrey checks. When a memory is written, it records the claims inside it that can be verified against the project — repository-relative paths and package script names — and keeps only the ones that resolve at that moment. That last part is what makes the signal worth anything: a claim that never resolved is a guess about a typo, while a claim that resolved once and no longer does is the world moving out from under a memory that still asserts it.
102
+
103
+ ```bash
104
+ audrey ground
105
+ ```
106
+
107
+ ```text
108
+ [audrey] Grounding memories against /home/you/project
109
+ [audrey] Checked 14: 12 still true, 2 broken, 0 repaired.
110
+ [audrey] 01K8ZQ... references a missing npm_script: deploy:prod
111
+ [audrey] 01K8ZR... references a missing path: scripts/release.mjs
112
+ ```
113
+
114
+ Broken memories are not deleted. They keep their content, say plainly what they still refer to, and take a confidence penalty so they stop leading by default while remaining readable and repairable. They also stop being eligible for the packet's must-follow section — that is the section that can force a Guard block, and a rule naming a file that no longer exists is a rule nobody can follow.
115
+
116
+ Repair is symmetric. Restore the file or the script and the next check clears the flag. A checkout that has moved reports unknown rather than broken, because a memory should not be discredited for describing a project this machine cannot currently see.
117
+
118
+ Memories with no checkable claims are left unlabeled. Silence is not a clean bill of health, and presenting it as one would be the same mistake pointed the other way.
119
+
97
120
  ## What Audrey deliberately does not do
98
121
 
99
122
  Audrey does not upload your memory to a hosted service by default. It does not treat every sentence as permanent truth. It does not promote instructions from arbitrary tool output into trusted policy. It does not claim that a small local benchmark proves state-of-the-art memory quality.
100
123
 
101
- Raw prompt events and tool bodies are not retained by default. Audrey stores hashes, bounded summaries, fingerprints, and redaction metadata. Explicit user-memory language is persisted intentionally; tool failure memories are sanitized first. Admin export/import/forget surfaces are disabled unless `AUDREY_ENABLE_ADMIN_TOOLS=1`.
124
+ Raw prompt events and tool bodies are not retained by default. Audrey stores hashes, bounded summaries, fingerprints, and redaction metadata. Explicit user-memory language is persisted intentionally; tool failure memories are sanitized first. Admin export/import/forget/promote surfaces are disabled unless `AUDREY_ENABLE_ADMIN_TOOLS=1`.
102
125
 
103
126
  At-rest encryption, identity-bound tenant authorization, rate limiting, and regulated retention remain deployment responsibilities today. They are not hidden behind a “production ready” badge.
104
127
 
@@ -122,7 +145,7 @@ The default store is SQLite, FTS5, and `sqlite-vec`. Local embeddings are the de
122
145
 
123
146
  ### A safer shared store
124
147
 
125
- Agent-scoped recall now continues through validation, contradiction detection, interference, affect, failure lookup, capsules, greetings, Guard, and REST request routing. Hidden retrieval candidates do not reinforce themselves; only memories actually surfaced to the caller receive retrieval bookkeeping.
148
+ Agent-scoped recall now continues through validation, contradiction detection, interference, affect, failure lookup, capsules, greetings, Guard, and REST request routing. Hidden retrieval candidates do not reinforce themselves; only memories actually surfaced to the caller receive retrieval bookkeeping (usage count and last-reinforced timestamp for semantic and procedural memories). Explicit validation feedback (`memory_validate` / `/v1/validate`) separately adjusts salience based on how a memory actually performed, not merely on being recalled.
126
149
 
127
150
  Vector candidates are partitioned by agent before nearest-neighbor ranking, so one busy agent cannot crowd another out of a bounded search. For hard tenant boundaries, still use a distinct `AUDREY_DATA_DIR` per tenant or security domain.
128
151
 
@@ -223,10 +246,10 @@ The shared hook adapter normalizes current Codex and Claude Code payloads.
223
246
 
224
247
  - Context injection is bounded by `AUDREY_CONTEXT_BUDGET_CHARS` (default 4000; Autopilot uses a conservative 3200-character packet unless overridden).
225
248
  - Prompt and tool retrieval queries are bounded before embedding. Large edits carry hashes and lengths instead of file bodies; exact Guard identity uses a full redacted digest rather than a truncated prefix.
226
- - Only `Bash`, `Edit`, `Write`, `NotebookEdit`, and `apply_patch` are guarded and observed by the generated default hooks.
249
+ - The generated default hooks guard and observe `Bash`, `Edit`, `MultiEdit`, `Write`, `NotebookEdit`, `apply_patch`, and every `mcp__*` tool from connected MCP servers, excluding Audrey's own memory tools so the Guard never guards itself.
227
250
  - Pre/post correlation uses `session_id + tool_use_id`, so parallel tool calls do not attach to the wrong receipt.
228
251
  - Claude `PostToolUseFailure` and Codex responses that explicitly expose a non-zero exit normalize to the same failure path. Current Codex hooks can omit Bash exit status; Audrey records an opaque result as `unknown`, never as invented success.
229
- - Context and Guard failures emit `{}` and log to stderr unless fail-closed mode is explicitly enabled.
252
+ - On an internal error, every hook logs to stderr and emits `{}` (no opinion, so the tool proceeds). Only `PreToolUse` changes behavior under `AUDREY_HOOK_FAIL_CLOSED=1`, emitting a deny decision instead; context-injection and post-tool hooks have no deny path and always emit `{}`.
230
253
  - Stop hooks always emit valid JSON and never continue or block a completed turn.
231
254
 
232
255
  Codex hook interception is a guardrail, not a complete shell-policy boundary. The current host contract does not intercept every richer `unified_exec` path and may omit the exit status of silent Bash failures. See the [Codex hooks documentation](https://learn.chatgpt.com/docs/hooks). Use the Guard receipt as evidence, and keep sandboxing, approvals, CI, and deployment controls in place.
@@ -285,8 +308,9 @@ Core routes:
285
308
  | Close a Guard receipt | `POST /v1/guard/after` |
286
309
  | Consolidate and decay | `POST /v1/dream` |
287
310
  | Health and index state | `GET /v1/status` |
311
+ | Promote learned procedures to rule files (admin) | `POST /v1/promote` |
288
312
 
289
- Use `AUDREY_API_KEY` for any non-loopback deployment. `X-Audrey-Agent` scopes encode, recall, capsules, preflight, Guard, consolidation, and greetings inside a trusted deployment; it is a routing header, not an authentication boundary. Bind agent/tenant identity at your gateway rather than trusting an arbitrary public header.
313
+ Use `AUDREY_API_KEY` for any non-loopback deployment. `X-Audrey-Agent` scopes encode, recall, capsules, preflight, Guard, consolidation, and greetings inside a trusted deployment; it is a routing header, not an authentication boundary. Bind agent/tenant identity at your gateway rather than trusting an arbitrary public header. Every route also accepts a per-call `agent` field in the JSON body as a fallback for callers (such as the Python client) that cannot set a header per request; the header wins whenever both are present.
290
314
 
291
315
  ### Python client
292
316
 
@@ -311,7 +335,8 @@ episode
311
335
  ├─ transactional SQLite + vector + FTS write
312
336
  ├─ agent-scoped interference / resonance / validation
313
337
  ├─ reinforcement or contradiction evidence
314
- └─ sleep-time consolidation into semantic or procedural memory
338
+ ├─ sleep-time consolidation into semantic or procedural memory
339
+ └─ grounding checks that stored claims still hold in the project
315
340
 
316
341
  query
317
342
  ├─ bounded vector candidates
@@ -325,12 +350,12 @@ Agent-scoped vector search uses a native `sqlite-vec` partition key before neare
325
350
 
326
351
  ### MCP surface
327
352
 
328
- Audrey exposes 22 MCP tools plus status, recent-memory, and principle resources and briefing/recall/reflection prompts. The main groups are:
353
+ Audrey exposes 23 MCP tools plus status, recent-memory, and principle resources and briefing/recall/reflection prompts. The main groups are:
329
354
 
330
355
  - capture: `memory_encode`, `memory_reflect`, `memory_observe_tool`
331
356
  - retrieval: `memory_recall`, `memory_capsule`, `memory_greeting`
332
357
  - action safety: `memory_preflight`, `memory_guard_before`, `memory_guard_after`, `memory_reflexes`
333
- - lifecycle: `memory_consolidate`, `memory_dream`, `memory_decay`, `memory_resolve_truth`
358
+ - lifecycle: `memory_consolidate`, `memory_dream`, `memory_decay`, `memory_resolve_truth`, `memory_ground`
334
359
  - governance: `memory_validate`, `memory_promote`, `memory_forget`, `memory_export`, `memory_import`, `memory_status`, `memory_introspect`
335
360
 
336
361
  The server also sends host instructions explaining the Guard receipt loop when lifecycle hooks are unavailable.
@@ -342,7 +367,7 @@ The server also sends host instructions explaining the Guard receipt loop when l
342
367
  | `AUDREY_DATA_DIR` | `~/.audrey/data` | SQLite store; use a distinct directory per tenant/security boundary |
343
368
  | `AUDREY_AGENT` | host-specific | Logical memory owner used for scoped operations |
344
369
  | `AUDREY_EMBEDDING_PROVIDER` | `local` | `local`, `gemini`, `openai`, or `mock` |
345
- | `AUDREY_LLM_PROVIDER` | auto | `anthropic`, `openai`, or `mock` for reflection/consolidation |
370
+ | `AUDREY_LLM_PROVIDER` | unset | `anthropic`, `openai`, or `mock` for reflection/consolidation; unset (or `auto`) uses local heuristics only, never an ambient `ANTHROPIC_API_KEY`/`OPENAI_API_KEY` |
346
371
  | `AUDREY_LLM_MODEL` | provider default | Explicit LLM model override |
347
372
  | `AUDREY_DEVICE` | `gpu` | Local embedding device; falls back to CPU |
348
373
  | `AUDREY_CONTEXT_BUDGET_CHARS` | `4000` | Maximum default capsule size |
@@ -353,7 +378,7 @@ The server also sends host instructions explaining the Guard receipt loop when l
353
378
  | `AUDREY_API_KEY` | unset | Bearer token for REST access |
354
379
  | `AUDREY_HOST` | `127.0.0.1` | REST bind address |
355
380
  | `AUDREY_PORT` | `7437` | REST port |
356
- | `AUDREY_ENABLE_ADMIN_TOOLS` | `0` | Enable export, import, and forget operations |
381
+ | `AUDREY_ENABLE_ADMIN_TOOLS` | `0` | Enable export, import, forget, and promote operations |
357
382
  | `AUDREY_ENABLE_SHARED_SCOPE` | `0` | Allow explicit cross-agent REST recall; admin tools also enable it |
358
383
  | `AUDREY_PROFILE` | `0` | Include stage timing diagnostics |
359
384
  | `AUDREY_DISABLE_WARMUP` | `0` | Disable MCP embedding warmup |
@@ -374,6 +399,8 @@ Provider secrets are never embedded in generated hook commands. `--include-secre
374
399
  - Keep the hook runtime on a stable installed path.
375
400
  - Load-test concurrent writers for your topology; SQLite WAL is not a distributed coordination layer.
376
401
 
402
+ `npm audit --omit=dev` reports two high-severity advisories against `sharp`, pulled in as a hard dependency of `@huggingface/transformers` for the local embedding runtime. There is no patched release compatible with the version range that package declares. Audrey never imports `sharp` — it is image-preprocessing code that a text-only embedding pipeline does not reach — but the package is installed, so the advisory is genuine and unresolved rather than dismissed. Running with `AUDREY_EMBEDDING_PROVIDER` set to a hosted provider avoids the dependency path entirely.
403
+
377
404
  ### Benchmarks and evidence
378
405
 
379
406
  Run the release gates locally:
@@ -390,7 +417,7 @@ npm run pack:check
390
417
  GuardBench currently contains ten local, deterministic pre-action scenarios covering repeated failures, procedures, scope changes, recovery, redaction, conflicting instructions, and noisy stores. The checked-in v1 methodology uses a mock 64-dimensional embedding provider and exists to catch regressions. A perfect local pass is not a claim about real-provider latency or production false-positive rates.
391
418
 
392
419
  <!-- guardbench-summary:start -->
393
- Latest local result in this checkout: 10/10 scenarios passed, 100% prevention rate, 0% false-block rate, 0 raw secret leaks, 0 published artifact leaks, and 4.607ms / 21.585ms p50/p95 Guard latency under the mock-provider methodology.
420
+ Latest local result in this checkout: 10/10 scenarios passed, 100% prevention rate, 0% false-block rate, 0 raw secret leaks, 0 published artifact leaks, and 3.805ms / 13.445ms p50/p95 Guard latency under the mock-provider methodology.
394
421
  <!-- guardbench-summary:end -->
395
422
 
396
423
  `benchmarks/perf-snapshot.js` measures encode and hybrid-recall p50/p95/p99 at configurable corpus sizes with machine and provider provenance. Run it on the hardware and embedding provider you plan to operate; hosted-provider latency is dominated by its network round trip.
@@ -0,0 +1,22 @@
1
+ export interface CodexReportedHook {
2
+ sourcePath: string;
3
+ enabled: boolean;
4
+ trustStatus: string;
5
+ statusMessage: string;
6
+ command: string;
7
+ }
8
+ export interface CodexHooksProbeResult {
9
+ hooks: CodexReportedHook[];
10
+ warnings: string[];
11
+ errors: string[];
12
+ }
13
+ export interface CodexHooksProbeInvocation {
14
+ command: string;
15
+ argsPrefix: string[];
16
+ cwd: string;
17
+ version: string;
18
+ timeoutMs?: number;
19
+ }
20
+ export declare function parseCodexHooksListResponse(response: unknown): CodexHooksProbeResult;
21
+ export declare function probeCodexHooks(invocation: CodexHooksProbeInvocation): Promise<CodexHooksProbeResult>;
22
+ //# sourceMappingURL=codex-hooks-probe.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-hooks-probe.d.ts","sourceRoot":"","sources":["../../mcp-server/codex-hooks-probe.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAcD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,OAAO,GAAG,qBAAqB,CAoCpF;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,yBAAyB,GACpC,OAAO,CAAC,qBAAqB,CAAC,CAkFhC"}
@@ -0,0 +1,160 @@
1
+ import { spawn } from 'node:child_process';
2
+ import { createInterface } from 'node:readline';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { resolve } from 'node:path';
5
+ function asRecord(value) {
6
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
7
+ ? value
8
+ : null;
9
+ }
10
+ function stringList(value) {
11
+ return Array.isArray(value)
12
+ ? value.filter((item) => typeof item === 'string')
13
+ : [];
14
+ }
15
+ export function parseCodexHooksListResponse(response) {
16
+ const envelope = asRecord(response);
17
+ const responseError = asRecord(envelope?.['error']);
18
+ if (responseError) {
19
+ const message = typeof responseError['message'] === 'string'
20
+ ? responseError['message']
21
+ : 'Codex hooks/list returned an error.';
22
+ throw new Error(message);
23
+ }
24
+ const result = asRecord(envelope?.['result']);
25
+ const data = result?.['data'];
26
+ if (!Array.isArray(data))
27
+ throw new Error('Codex hooks/list response did not contain result.data.');
28
+ const parsed = { hooks: [], warnings: [], errors: [] };
29
+ for (const cwdValue of data) {
30
+ const cwdResult = asRecord(cwdValue);
31
+ if (!cwdResult)
32
+ continue;
33
+ parsed.warnings.push(...stringList(cwdResult['warnings']));
34
+ parsed.errors.push(...stringList(cwdResult['errors']));
35
+ const hooks = cwdResult['hooks'];
36
+ if (!Array.isArray(hooks))
37
+ continue;
38
+ for (const hookValue of hooks) {
39
+ const hook = asRecord(hookValue);
40
+ if (!hook)
41
+ continue;
42
+ parsed.hooks.push({
43
+ sourcePath: typeof hook['sourcePath'] === 'string' ? hook['sourcePath'] : '',
44
+ enabled: hook['enabled'] === true,
45
+ trustStatus: typeof hook['trustStatus'] === 'string' ? hook['trustStatus'] : 'unknown',
46
+ statusMessage: typeof hook['statusMessage'] === 'string' ? hook['statusMessage'] : '',
47
+ command: typeof hook['command'] === 'string' ? hook['command'] : '',
48
+ });
49
+ }
50
+ }
51
+ return parsed;
52
+ }
53
+ export function probeCodexHooks(invocation) {
54
+ return new Promise((resolveProbe, rejectProbe) => {
55
+ const child = spawn(invocation.command, [...invocation.argsPrefix, 'app-server', '--stdio'], {
56
+ cwd: invocation.cwd,
57
+ env: process.env,
58
+ stdio: ['pipe', 'pipe', 'pipe'],
59
+ windowsHide: true,
60
+ });
61
+ const stdout = createInterface({ input: child.stdout });
62
+ let stderr = '';
63
+ let settled = false;
64
+ const settle = (error, result) => {
65
+ if (settled)
66
+ return;
67
+ settled = true;
68
+ clearTimeout(timer);
69
+ stdout.close();
70
+ child.stdin.end();
71
+ child.kill();
72
+ if (error)
73
+ rejectProbe(error);
74
+ else
75
+ resolveProbe(result);
76
+ };
77
+ const timer = setTimeout(() => {
78
+ settle(new Error('Codex app-server hooks/list probe timed out.'));
79
+ }, invocation.timeoutMs ?? 8_000);
80
+ child.stderr.on('data', chunk => {
81
+ if (stderr.length < 4_000)
82
+ stderr += String(chunk).slice(0, 4_000 - stderr.length);
83
+ });
84
+ child.on('error', error => settle(error));
85
+ // Without these, a broken/removed binary or a pipe closed after spawn (EPIPE) raises an
86
+ // unhandled 'error' event on stdin/stdout and crashes the host process instead of
87
+ // rejecting this probe.
88
+ child.stdin.on('error', error => settle(error));
89
+ child.stdout.on('error', error => settle(error));
90
+ child.on('exit', code => {
91
+ if (!settled) {
92
+ const detail = stderr.trim() ? `: ${stderr.trim()}` : '';
93
+ settle(new Error(`Codex app-server exited before hooks/list completed (${code})${detail}`));
94
+ }
95
+ });
96
+ stdout.on('line', line => {
97
+ let message;
98
+ try {
99
+ message = JSON.parse(line);
100
+ }
101
+ catch {
102
+ return;
103
+ }
104
+ const record = asRecord(message);
105
+ if (record?.['id'] === 0) {
106
+ child.stdin.write(`${JSON.stringify({ method: 'initialized', params: {} })}\n`);
107
+ child.stdin.write(`${JSON.stringify({
108
+ method: 'hooks/list',
109
+ id: 1,
110
+ params: { cwds: [invocation.cwd] },
111
+ })}\n`);
112
+ }
113
+ else if (record?.['id'] === 1) {
114
+ try {
115
+ settle(null, parseCodexHooksListResponse(message));
116
+ }
117
+ catch (error) {
118
+ settle(error instanceof Error ? error : new Error(String(error)));
119
+ }
120
+ }
121
+ });
122
+ child.stdin.write(`${JSON.stringify({
123
+ method: 'initialize',
124
+ id: 0,
125
+ params: {
126
+ clientInfo: {
127
+ name: 'audrey_doctor',
128
+ title: 'Audrey Doctor',
129
+ version: invocation.version,
130
+ },
131
+ },
132
+ })}\n`);
133
+ });
134
+ }
135
+ function isMainModule() {
136
+ const invoked = process.argv[1];
137
+ if (!invoked)
138
+ return false;
139
+ const actual = resolve(fileURLToPath(import.meta.url));
140
+ const requested = resolve(invoked);
141
+ return process.platform === 'win32'
142
+ ? actual.toLowerCase() === requested.toLowerCase()
143
+ : actual === requested;
144
+ }
145
+ if (isMainModule()) {
146
+ const encoded = process.argv[2];
147
+ try {
148
+ if (!encoded)
149
+ throw new Error('Codex hooks probe invocation is missing.');
150
+ const invocation = JSON.parse(Buffer.from(encoded, 'base64url').toString('utf8'));
151
+ const result = await probeCodexHooks(invocation);
152
+ process.stdout.write(`${JSON.stringify(result)}\n`);
153
+ }
154
+ catch (error) {
155
+ const message = error instanceof Error ? error.message : String(error);
156
+ process.stderr.write(`${message.replace(/[\r\n]+/g, ' ')}\n`);
157
+ process.exitCode = 1;
158
+ }
159
+ }
160
+ //# sourceMappingURL=codex-hooks-probe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codex-hooks-probe.js","sourceRoot":"","sources":["../../mcp-server/codex-hooks-probe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QAC9D,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { AudreyConfig, EmbeddingConfig, LLMConfig } from '../src/types.js';
2
- export declare const VERSION = "1.1.3";
2
+ export declare const VERSION = "1.2.0";
3
3
  export declare const SERVER_NAME = "audrey-memory";
4
4
  export declare const DEFAULT_AGENT = "local-agent";
5
5
  export declare const DEFAULT_DATA_DIR: string;
@@ -29,13 +29,37 @@ export declare function resolveDataDir(env?: Record<string, string | undefined>)
29
29
  export declare function resolveEmbeddingProvider(env: Record<string, string | undefined>, explicit?: string | undefined): EmbeddingConfig & {
30
30
  dimensions: number;
31
31
  };
32
- export declare function resolveLLMProvider(env: Record<string, string | undefined>, explicit?: string | undefined): (LLMConfig & {
32
+ /**
33
+ * Resolves which LLM provider to use for principle extraction / reflection.
34
+ * Priority: explicit config -> none (local heuristics only).
35
+ * Cloud providers are never auto-selected from ambient API keys: memory
36
+ * content is sent to the provider verbatim (buildPrincipleExtractionPrompt),
37
+ * so leaving AUDREY_LLM_PROVIDER unset (or 'auto') must never cause content
38
+ * to leave the machine just because ANTHROPIC_API_KEY/OPENAI_API_KEY happens
39
+ * to be set for some unrelated tool. Choose a cloud provider explicitly with
40
+ * AUDREY_LLM_PROVIDER=anthropic|openai.
41
+ */
42
+ export declare function resolveLLMProvider(env: Record<string, string | undefined>, explicit?: string | undefined, options?: {
43
+ requireApiKey?: boolean;
44
+ }): (LLMConfig & {
33
45
  apiKey?: string;
34
46
  }) | null;
35
47
  export declare function buildAudreyConfig(): AudreyConfig;
36
48
  export declare function resolveHostAgent(host: string | undefined): string;
37
49
  export declare function buildAudreyMcpEnv(env?: Record<string, string | undefined>, agent?: string, options?: McpEnvOptions): Record<string, string>;
38
50
  export declare function buildAutopilotRuntimeArgs(env?: Record<string, string | undefined>, agent?: string): string[];
51
+ /**
52
+ * The agent name to write into a host's generated configuration.
53
+ *
54
+ * A named host owns its agent name; only the unnamed 'generic' host falls
55
+ * back to the ambient AUDREY_AGENT. Autopilot exports AUDREY_AGENT into
56
+ * every hook process, so `audrey install --host codex` run from inside a
57
+ * hooked Claude Code session used to inherit 'claude-code' and write that
58
+ * into Codex's config — pointing a second host at the first host's memory
59
+ * namespace, silently, in exactly the session where someone is most likely
60
+ * to run the install.
61
+ */
62
+ export declare function resolveConfiguredAgent(env: Record<string, string | undefined>, host: string | undefined): string;
39
63
  export declare function buildStdioMcpServerConfig(env?: Record<string, string | undefined>, host?: string | undefined): {
40
64
  command: string;
41
65
  args: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../mcp-server/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEhF,eAAO,MAAM,OAAO,UAAU,CAAC;AAC/B,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAC3C,eAAO,MAAM,aAAa,gBAAgB,CAAC;AAC3C,eAAO,MAAM,gBAAgB,QAAqC,CAAC;AACnE,eAAO,MAAM,cAAc,QAAwD,CAAC;AAEpF,eAAO,MAAM,gBAAgB;;;;;;;;;CASnB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEvD,UAAU,aAAa;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CACtC;AAyBD,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAE5F;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EACvC,QAAQ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