audrey 1.0.1 → 1.0.3

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 (235) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +13 -3
  3. package/benchmarks/adapter-self-test.mjs +6 -2
  4. package/benchmarks/adapters/example-allow.mjs +5 -2
  5. package/benchmarks/adapters/mem0-platform.mjs +19 -12
  6. package/benchmarks/adapters/zep-cloud.mjs +51 -27
  7. package/benchmarks/baselines.js +11 -6
  8. package/benchmarks/build-leaderboard.mjs +36 -23
  9. package/benchmarks/cases.js +24 -12
  10. package/benchmarks/create-conformance-card.mjs +12 -3
  11. package/benchmarks/create-submission-bundle.mjs +22 -8
  12. package/benchmarks/dry-run-external-adapters.mjs +24 -12
  13. package/benchmarks/guardbench.js +263 -123
  14. package/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +4 -4
  15. package/benchmarks/output/external/guardbench-external-dry-run.json +1 -1
  16. package/benchmarks/output/external/guardbench-external-evidence.json +1 -1
  17. package/benchmarks/output/guardbench-conformance-card.json +12 -12
  18. package/benchmarks/output/guardbench-raw.json +106 -106
  19. package/benchmarks/output/guardbench-summary.json +168 -168
  20. package/benchmarks/output/leaderboard/guardbench-leaderboard.json +5 -5
  21. package/benchmarks/output/leaderboard/guardbench-leaderboard.md +2 -2
  22. package/benchmarks/output/submission-bundle/guardbench-conformance-card.json +12 -12
  23. package/benchmarks/output/submission-bundle/guardbench-raw.json +106 -106
  24. package/benchmarks/output/submission-bundle/guardbench-summary.json +168 -168
  25. package/benchmarks/output/submission-bundle/submission-manifest.json +11 -11
  26. package/benchmarks/output/submission-bundle/validation-report.json +1 -1
  27. package/benchmarks/output/summary.json +58 -58
  28. package/benchmarks/perf-snapshot.js +12 -9
  29. package/benchmarks/perf.bench.js +14 -6
  30. package/benchmarks/public-paths.mjs +11 -5
  31. package/benchmarks/reference-results.js +10 -5
  32. package/benchmarks/report.js +48 -27
  33. package/benchmarks/run-external-guardbench.mjs +47 -25
  34. package/benchmarks/run.js +112 -59
  35. package/benchmarks/validate-adapter-module.mjs +13 -10
  36. package/benchmarks/validate-adapter-registry.mjs +16 -5
  37. package/benchmarks/validate-guardbench-artifacts.mjs +76 -19
  38. package/benchmarks/verify-external-evidence.mjs +86 -31
  39. package/benchmarks/verify-publication-artifacts.mjs +34 -11
  40. package/benchmarks/verify-submission-bundle.mjs +9 -4
  41. package/dist/mcp-server/config.d.ts +1 -1
  42. package/dist/mcp-server/config.d.ts.map +1 -1
  43. package/dist/mcp-server/config.js +5 -3
  44. package/dist/mcp-server/config.js.map +1 -1
  45. package/dist/mcp-server/index.d.ts +7 -347
  46. package/dist/mcp-server/index.d.ts.map +1 -1
  47. package/dist/mcp-server/index.js +289 -256
  48. package/dist/mcp-server/index.js.map +1 -1
  49. package/dist/mcp-server/tool-schemas.d.ts +341 -0
  50. package/dist/mcp-server/tool-schemas.d.ts.map +1 -0
  51. package/dist/mcp-server/tool-schemas.js +248 -0
  52. package/dist/mcp-server/tool-schemas.js.map +1 -0
  53. package/dist/mcp-server/tool-validation.d.ts +17 -0
  54. package/dist/mcp-server/tool-validation.d.ts.map +1 -0
  55. package/dist/mcp-server/tool-validation.js +41 -0
  56. package/dist/mcp-server/tool-validation.js.map +1 -0
  57. package/dist/src/action-key.d.ts.map +1 -1
  58. package/dist/src/action-key.js +6 -2
  59. package/dist/src/action-key.js.map +1 -1
  60. package/dist/src/adaptive.d.ts.map +1 -1
  61. package/dist/src/adaptive.js +4 -2
  62. package/dist/src/adaptive.js.map +1 -1
  63. package/dist/src/affect.d.ts.map +1 -1
  64. package/dist/src/affect.js +8 -5
  65. package/dist/src/affect.js.map +1 -1
  66. package/dist/src/audrey.d.ts +1 -1
  67. package/dist/src/audrey.d.ts.map +1 -1
  68. package/dist/src/audrey.js +93 -49
  69. package/dist/src/audrey.js.map +1 -1
  70. package/dist/src/capsule.d.ts.map +1 -1
  71. package/dist/src/capsule.js +37 -15
  72. package/dist/src/capsule.js.map +1 -1
  73. package/dist/src/causal.d.ts +1 -1
  74. package/dist/src/causal.d.ts.map +1 -1
  75. package/dist/src/causal.js +4 -2
  76. package/dist/src/causal.js.map +1 -1
  77. package/dist/src/confidence.d.ts.map +1 -1
  78. package/dist/src/confidence.js +5 -5
  79. package/dist/src/confidence.js.map +1 -1
  80. package/dist/src/consolidate.d.ts.map +1 -1
  81. package/dist/src/consolidate.js +17 -9
  82. package/dist/src/consolidate.js.map +1 -1
  83. package/dist/src/context.js +1 -1
  84. package/dist/src/context.js.map +1 -1
  85. package/dist/src/controller.d.ts.map +1 -1
  86. package/dist/src/controller.js +24 -13
  87. package/dist/src/controller.js.map +1 -1
  88. package/dist/src/db.d.ts.map +1 -1
  89. package/dist/src/db.js +78 -27
  90. package/dist/src/db.js.map +1 -1
  91. package/dist/src/decay.d.ts +1 -1
  92. package/dist/src/decay.d.ts.map +1 -1
  93. package/dist/src/decay.js +1 -1
  94. package/dist/src/decay.js.map +1 -1
  95. package/dist/src/embedding.d.ts +12 -4
  96. package/dist/src/embedding.d.ts.map +1 -1
  97. package/dist/src/embedding.js +18 -16
  98. package/dist/src/embedding.js.map +1 -1
  99. package/dist/src/encode.d.ts.map +1 -1
  100. package/dist/src/encode.js +5 -4
  101. package/dist/src/encode.js.map +1 -1
  102. package/dist/src/events.d.ts +3 -2
  103. package/dist/src/events.d.ts.map +1 -1
  104. package/dist/src/events.js +7 -3
  105. package/dist/src/events.js.map +1 -1
  106. package/dist/src/export.d.ts.map +1 -1
  107. package/dist/src/export.js +21 -7
  108. package/dist/src/export.js.map +1 -1
  109. package/dist/src/feedback.d.ts.map +1 -1
  110. package/dist/src/feedback.js +1 -1
  111. package/dist/src/feedback.js.map +1 -1
  112. package/dist/src/forget.d.ts.map +1 -1
  113. package/dist/src/forget.js +12 -6
  114. package/dist/src/forget.js.map +1 -1
  115. package/dist/src/fts.d.ts.map +1 -1
  116. package/dist/src/fts.js +20 -8
  117. package/dist/src/fts.js.map +1 -1
  118. package/dist/src/hybrid-recall.d.ts.map +1 -1
  119. package/dist/src/hybrid-recall.js +12 -6
  120. package/dist/src/hybrid-recall.js.map +1 -1
  121. package/dist/src/impact.d.ts.map +1 -1
  122. package/dist/src/impact.js +26 -10
  123. package/dist/src/impact.js.map +1 -1
  124. package/dist/src/import.d.ts.map +1 -1
  125. package/dist/src/import.js +11 -6
  126. package/dist/src/import.js.map +1 -1
  127. package/dist/src/index.d.ts +3 -3
  128. package/dist/src/index.d.ts.map +1 -1
  129. package/dist/src/index.js +3 -3
  130. package/dist/src/index.js.map +1 -1
  131. package/dist/src/interference.d.ts.map +1 -1
  132. package/dist/src/interference.js +10 -5
  133. package/dist/src/interference.js.map +1 -1
  134. package/dist/src/introspect.d.ts.map +1 -1
  135. package/dist/src/introspect.js +12 -6
  136. package/dist/src/introspect.js.map +1 -1
  137. package/dist/src/llm.d.ts +2 -2
  138. package/dist/src/llm.d.ts.map +1 -1
  139. package/dist/src/llm.js +6 -6
  140. package/dist/src/llm.js.map +1 -1
  141. package/dist/src/migrate.d.ts.map +1 -1
  142. package/dist/src/migrate.js +10 -4
  143. package/dist/src/migrate.js.map +1 -1
  144. package/dist/src/preflight.d.ts.map +1 -1
  145. package/dist/src/preflight.js +6 -8
  146. package/dist/src/preflight.js.map +1 -1
  147. package/dist/src/profile.d.ts.map +1 -1
  148. package/dist/src/profile.js.map +1 -1
  149. package/dist/src/promote.d.ts.map +1 -1
  150. package/dist/src/promote.js +16 -7
  151. package/dist/src/promote.js.map +1 -1
  152. package/dist/src/prompts.d.ts.map +1 -1
  153. package/dist/src/prompts.js +1 -2
  154. package/dist/src/prompts.js.map +1 -1
  155. package/dist/src/recall.d.ts.map +1 -1
  156. package/dist/src/recall.js +85 -18
  157. package/dist/src/recall.js.map +1 -1
  158. package/dist/src/redact.d.ts.map +1 -1
  159. package/dist/src/redact.js +9 -4
  160. package/dist/src/redact.js.map +1 -1
  161. package/dist/src/reflexes.d.ts.map +1 -1
  162. package/dist/src/reflexes.js +1 -7
  163. package/dist/src/reflexes.js.map +1 -1
  164. package/dist/src/rollback.d.ts.map +1 -1
  165. package/dist/src/rollback.js +4 -2
  166. package/dist/src/rollback.js.map +1 -1
  167. package/dist/src/routes.d.ts.map +1 -1
  168. package/dist/src/routes.js +33 -13
  169. package/dist/src/routes.js.map +1 -1
  170. package/dist/src/rules-compiler.d.ts.map +1 -1
  171. package/dist/src/rules-compiler.js +24 -2
  172. package/dist/src/rules-compiler.js.map +1 -1
  173. package/dist/src/server.js +2 -2
  174. package/dist/src/server.js.map +1 -1
  175. package/dist/src/tool-trace.d.ts +2 -2
  176. package/dist/src/tool-trace.d.ts.map +1 -1
  177. package/dist/src/tool-trace.js +12 -4
  178. package/dist/src/tool-trace.js.map +1 -1
  179. package/dist/src/types.d.ts.map +1 -1
  180. package/dist/src/ulid.js +1 -1
  181. package/dist/src/ulid.js.map +1 -1
  182. package/dist/src/utils.d.ts.map +1 -1
  183. package/dist/src/utils.js.map +1 -1
  184. package/dist/src/validate.d.ts.map +1 -1
  185. package/dist/src/validate.js +20 -10
  186. package/dist/src/validate.js.map +1 -1
  187. package/docs/paper/07-evaluation.md +5 -5
  188. package/docs/paper/audrey-paper-v1.md +5 -5
  189. package/docs/paper/evidence-ledger.md +1 -1
  190. package/docs/paper/output/arxiv/arxiv-manifest.json +4 -4
  191. package/docs/paper/output/arxiv/main.tex +5 -5
  192. package/docs/paper/output/arxiv-compile-report.json +3 -3
  193. package/docs/paper/output/submission-bundle/README.md +13 -3
  194. package/docs/paper/output/submission-bundle/benchmarks/output/adapter-self-test/guardbench-adapter-self-test.json +4 -4
  195. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-dry-run.json +1 -1
  196. package/docs/paper/output/submission-bundle/benchmarks/output/external/guardbench-external-evidence.json +1 -1
  197. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-conformance-card.json +12 -12
  198. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-raw.json +106 -106
  199. package/docs/paper/output/submission-bundle/benchmarks/output/guardbench-summary.json +168 -168
  200. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.json +5 -5
  201. package/docs/paper/output/submission-bundle/benchmarks/output/leaderboard/guardbench-leaderboard.md +2 -2
  202. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/submission-manifest.json +11 -11
  203. package/docs/paper/output/submission-bundle/benchmarks/output/submission-bundle/validation-report.json +1 -1
  204. package/docs/paper/output/submission-bundle/benchmarks/output/summary.json +64 -64
  205. package/docs/paper/output/submission-bundle/docs/paper/07-evaluation.md +5 -5
  206. package/docs/paper/output/submission-bundle/docs/paper/audrey-paper-v1.md +5 -5
  207. package/docs/paper/output/submission-bundle/docs/paper/evidence-ledger.md +1 -1
  208. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/arxiv-manifest.json +4 -4
  209. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv/main.tex +5 -5
  210. package/docs/paper/output/submission-bundle/docs/paper/output/arxiv-compile-report.json +3 -3
  211. package/docs/paper/output/submission-bundle/package.json +17 -4
  212. package/docs/paper/output/submission-bundle/paper-submission-manifest.json +34 -34
  213. package/examples/fintech-ops-demo.js +12 -5
  214. package/examples/healthcare-ops-demo.js +8 -4
  215. package/examples/ollama-memory-agent.js +41 -13
  216. package/examples/stripe-demo.js +12 -5
  217. package/package.json +17 -4
  218. package/scripts/audit-release-completion.mjs +179 -101
  219. package/scripts/create-arxiv-source.mjs +20 -14
  220. package/scripts/create-paper-submission-bundle.mjs +6 -2
  221. package/scripts/finalize-release.mjs +111 -36
  222. package/scripts/prepare-release-cut.mjs +14 -6
  223. package/scripts/publish-release-bundle.mjs +62 -23
  224. package/scripts/publish-release-github-api.mjs +89 -24
  225. package/scripts/smoke-cli.js +9 -9
  226. package/scripts/sync-paper-artifacts.mjs +5 -1
  227. package/scripts/verify-arxiv-compile.mjs +52 -16
  228. package/scripts/verify-arxiv-source.mjs +45 -15
  229. package/scripts/verify-browser-launch-plan.mjs +28 -11
  230. package/scripts/verify-browser-launch-results.mjs +32 -14
  231. package/scripts/verify-paper-artifacts.mjs +539 -79
  232. package/scripts/verify-paper-claims.mjs +48 -20
  233. package/scripts/verify-paper-submission-bundle.mjs +22 -11
  234. package/scripts/verify-publication-pack.mjs +23 -9
  235. package/scripts/verify-release-readiness.mjs +211 -76
@@ -42,7 +42,8 @@ function parseArgs(argv = process.argv.slice(2)) {
42
42
 
43
43
  for (let i = 0; i < argv.length; i++) {
44
44
  const token = argv[i];
45
- if ((token === '--target-version' || token === '--version') && argv[i + 1]) args.targetVersion = argv[++i];
45
+ if ((token === '--target-version' || token === '--version') && argv[i + 1])
46
+ args.targetVersion = argv[++i];
46
47
  else if (token === '--allow-pending') args.allowPending = true;
47
48
  else if (token === '--skip-pypi-registry') args.checkPypiRegistry = false;
48
49
  else if (token === '--json') args.json = true;
@@ -181,7 +182,10 @@ export function remoteBranchFreshnessStatus({ branch, upstream, upstreamSha }, r
181
182
  const remoteRef = `refs/heads/${branch}`;
182
183
  let result = run(['ls-remote', 'origin', remoteRef]);
183
184
  const fallbackEvidence = [];
184
- if (result.status !== 0 && /schannel|AcquireCredentialsHandle|SEC_E_NO_CREDENTIALS/i.test(commandSummary(result))) {
185
+ if (
186
+ result.status !== 0 &&
187
+ /schannel|AcquireCredentialsHandle|SEC_E_NO_CREDENTIALS/i.test(commandSummary(result))
188
+ ) {
185
189
  const fallback = run(['-c', 'http.sslBackend=openssl', 'ls-remote', 'origin', remoteRef]);
186
190
  if (fallback.status === 0) {
187
191
  result = fallback;
@@ -191,11 +195,16 @@ export function remoteBranchFreshnessStatus({ branch, upstream, upstreamSha }, r
191
195
  if (result.status !== 0) {
192
196
  return {
193
197
  evidence: ['remoteHead=unverified', ...fallbackEvidence],
194
- blockers: [`Verify live remote origin/${branch} before final release (${commandSummary(result)})`],
198
+ blockers: [
199
+ `Verify live remote origin/${branch} before final release (${commandSummary(result)})`,
200
+ ],
195
201
  };
196
202
  }
197
203
 
198
- const remoteLine = result.stdout.trim().split(/\r?\n/).find(line => line.endsWith(remoteRef));
204
+ const remoteLine = result.stdout
205
+ .trim()
206
+ .split(/\r?\n/)
207
+ .find(line => line.endsWith(remoteRef));
199
208
  const remoteSha = remoteLine?.split(/\s+/)[0];
200
209
  if (!remoteSha) {
201
210
  return {
@@ -207,7 +216,9 @@ export function remoteBranchFreshnessStatus({ branch, upstream, upstreamSha }, r
207
216
  const evidence = [...fallbackEvidence, `remoteHead=origin/${branch}:${shortSha(remoteSha)}`];
208
217
  const blockers = [];
209
218
  if (upstream && upstreamSha && upstreamSha !== remoteSha) {
210
- blockers.push(`Fetch/reconcile origin/${branch}: local ${upstream} is ${shortSha(upstreamSha)} but live remote is ${shortSha(remoteSha)}`);
219
+ blockers.push(
220
+ `Fetch/reconcile origin/${branch}: local ${upstream} is ${shortSha(upstreamSha)} but live remote is ${shortSha(remoteSha)}`,
221
+ );
211
222
  }
212
223
 
213
224
  return { evidence, blockers };
@@ -218,8 +229,19 @@ function remoteReleaseRefs(branch, targetVersion, run = runGit) {
218
229
  const tagRef = `refs/tags/v${targetVersion}`;
219
230
  let result = run(['ls-remote', 'origin', branchRef, tagRef, `${tagRef}^{}`]);
220
231
  const evidence = [];
221
- if (result.status !== 0 && /schannel|AcquireCredentialsHandle|SEC_E_NO_CREDENTIALS/i.test(commandSummary(result))) {
222
- const fallback = run(['-c', 'http.sslBackend=openssl', 'ls-remote', 'origin', branchRef, tagRef, `${tagRef}^{}`]);
232
+ if (
233
+ result.status !== 0 &&
234
+ /schannel|AcquireCredentialsHandle|SEC_E_NO_CREDENTIALS/i.test(commandSummary(result))
235
+ ) {
236
+ const fallback = run([
237
+ '-c',
238
+ 'http.sslBackend=openssl',
239
+ 'ls-remote',
240
+ 'origin',
241
+ branchRef,
242
+ tagRef,
243
+ `${tagRef}^{}`,
244
+ ]);
223
245
  if (fallback.status === 0) {
224
246
  result = fallback;
225
247
  evidence.push('releaseRemoteTlsFallback=openssl');
@@ -253,7 +275,10 @@ function currentWorkingReleaseTree() {
253
275
  };
254
276
 
255
277
  try {
256
- for (const args of [['read-tree', 'HEAD'], ['add', '--all']]) {
278
+ for (const args of [
279
+ ['read-tree', 'HEAD'],
280
+ ['add', '--all'],
281
+ ]) {
257
282
  const result = runGit(args, { env, timeout: 120000 });
258
283
  if (result.status !== 0) return { ok: false, error: commandSummary(result) };
259
284
  }
@@ -292,7 +317,9 @@ function releaseSourceHandoffStatus(targetVersion, branch) {
292
317
  } else {
293
318
  evidence.push(`currentReleaseTree=${shortSha(currentTree.tree)}`);
294
319
  if (report.tree && currentTree.tree !== report.tree) {
295
- blockers.push(`Regenerate release artifacts: current release tree ${currentTree.tree} differs from source handoff tree ${report.tree}`);
320
+ blockers.push(
321
+ `Regenerate release artifacts: current release tree ${currentTree.tree} differs from source handoff tree ${report.tree}`,
322
+ );
296
323
  }
297
324
  }
298
325
 
@@ -304,10 +331,14 @@ function releaseSourceHandoffStatus(targetVersion, branch) {
304
331
  evidence.push('sourceBundleVerify=passed');
305
332
  const refs = parseBundleRefs(bundleVerify.stdout, targetVersion);
306
333
  if (refs.branch !== report.commit) {
307
- blockers.push(`Release source bundle master is ${refs.branch ?? 'missing'}, expected ${report.commit}`);
334
+ blockers.push(
335
+ `Release source bundle master is ${refs.branch ?? 'missing'}, expected ${report.commit}`,
336
+ );
308
337
  }
309
338
  if (refs.tag !== report.tag) {
310
- blockers.push(`Release source bundle tag is ${refs.tag ?? 'missing'}, expected ${report.tag}`);
339
+ blockers.push(
340
+ `Release source bundle tag is ${refs.tag ?? 'missing'}, expected ${report.tag}`,
341
+ );
311
342
  }
312
343
  }
313
344
 
@@ -320,13 +351,19 @@ function releaseSourceHandoffStatus(targetVersion, branch) {
320
351
  evidence.push(`releaseRemoteMaster=${shortSha(remoteMaster)}`);
321
352
  evidence.push(`releaseRemoteTag=${shortSha(remoteTagObject)}`);
322
353
  if (report.commit && remoteMaster !== report.commit) {
323
- blockers.push(`Publish source bundle commit ${report.commit} to origin/${branch} (remote is ${remoteMaster ?? 'missing'})`);
354
+ blockers.push(
355
+ `Publish source bundle commit ${report.commit} to origin/${branch} (remote is ${remoteMaster ?? 'missing'})`,
356
+ );
324
357
  }
325
358
  if (report.tag && remoteTagObject !== report.tag) {
326
- blockers.push(`Publish source bundle tag object ${report.tag} to refs/tags/v${targetVersion} (remote is ${remoteTagObject ?? 'missing'})`);
359
+ blockers.push(
360
+ `Publish source bundle tag object ${report.tag} to refs/tags/v${targetVersion} (remote is ${remoteTagObject ?? 'missing'})`,
361
+ );
327
362
  }
328
363
  if (remoteTagCommit && report.commit && remoteTagCommit !== report.commit) {
329
- blockers.push(`Remote v${targetVersion} dereferences to ${remoteTagCommit}, not release commit ${report.commit}`);
364
+ blockers.push(
365
+ `Remote v${targetVersion} dereferences to ${remoteTagCommit}, not release commit ${report.commit}`,
366
+ );
330
367
  }
331
368
 
332
369
  const stalePrefixes = [
@@ -364,18 +401,19 @@ function versionChecks(targetVersion) {
364
401
  const evidence = values.map(([name, value]) => `${name}=${value ?? 'missing'}`);
365
402
 
366
403
  if (values.some(([, value]) => !value)) {
367
- return failed('version-surfaces', 'Version surfaces are present', evidence, ['One or more version surfaces are missing']);
404
+ return failed('version-surfaces', 'Version surfaces are present', evidence, [
405
+ 'One or more version surfaces are missing',
406
+ ]);
368
407
  }
369
408
  if (uniqueVersions.size !== 1) {
370
- return failed('version-surfaces', 'Version surfaces are aligned', evidence, ['package.json, package-lock.json, and Python version are not aligned']);
409
+ return failed('version-surfaces', 'Version surfaces are aligned', evidence, [
410
+ 'package.json, package-lock.json, and Python version are not aligned',
411
+ ]);
371
412
  }
372
413
  if (!uniqueVersions.has(targetVersion)) {
373
- return pending(
374
- 'target-version',
375
- `Target release version is ${targetVersion}`,
376
- evidence,
377
- [`Local version is ${versions.packageJson}; bump all release surfaces to ${targetVersion} only when 1.0 publish is being cut`],
378
- );
414
+ return pending('target-version', `Target release version is ${targetVersion}`, evidence, [
415
+ `Local version is ${versions.packageJson}; bump all release surfaces to ${targetVersion} only when 1.0 publish is being cut`,
416
+ ]);
379
417
  }
380
418
  return ok('target-version', `Target release version is ${targetVersion}`, evidence);
381
419
  }
@@ -383,7 +421,8 @@ function versionChecks(targetVersion) {
383
421
  function sourceControlCheck(targetVersion) {
384
422
  const status = runGit(['status', '--short', '--branch', '--untracked-files=all']);
385
423
  if (status.status !== 0) {
386
- const detail = status.stderr.trim() || status.stdout.trim() || `git status exited ${status.status}`;
424
+ const detail =
425
+ status.stderr.trim() || status.stdout.trim() || `git status exited ${status.status}`;
387
426
  return failed('source-control', 'Source control is ready for release', [], [detail]);
388
427
  }
389
428
 
@@ -397,10 +436,16 @@ function sourceControlCheck(targetVersion) {
397
436
  const originPush = gitOutput(['remote', 'get-url', '--push', 'origin']);
398
437
  const tagName = `v${targetVersion}`;
399
438
  const tagExists = Boolean(gitOutput(['tag', '--list', tagName]));
400
- const tagsAtHead = (gitOutput(['tag', '--points-at', 'HEAD']) ?? '').split(/\r?\n/).filter(Boolean);
439
+ const tagsAtHead = (gitOutput(['tag', '--points-at', 'HEAD']) ?? '')
440
+ .split(/\r?\n/)
441
+ .filter(Boolean);
401
442
  const metadataWritable = gitMetadataWritableCheck();
402
- const remoteFreshness = originPush ? remoteBranchFreshnessStatus({ branch, upstream, upstreamSha }) : { evidence: [], blockers: [] };
403
- const sourceHandoff = originPush ? releaseSourceHandoffStatus(targetVersion, branch) : { usable: false, evidence: [], blockers: [] };
443
+ const remoteFreshness = originPush
444
+ ? remoteBranchFreshnessStatus({ branch, upstream, upstreamSha })
445
+ : { evidence: [], blockers: [] };
446
+ const sourceHandoff = originPush
447
+ ? releaseSourceHandoffStatus(targetVersion, branch)
448
+ : { usable: false, evidence: [], blockers: [] };
404
449
  const evidence = [
405
450
  `branch=${branch}`,
406
451
  `head=${head}`,
@@ -419,7 +464,8 @@ function sourceControlCheck(targetVersion) {
419
464
  blockers.push(...sourceHandoff.blockers);
420
465
  evidence.push('sourceControlLane=external-source-bundle');
421
466
  } else {
422
- if (!metadataWritable.writable && metadataWritable.blocker) blockers.push(metadataWritable.blocker);
467
+ if (!metadataWritable.writable && metadataWritable.blocker)
468
+ blockers.push(metadataWritable.blocker);
423
469
  blockers.push(...remoteFreshness.blockers, ...sourceHandoff.blockers);
424
470
  if (!upstream) blockers.push('Configure an upstream branch before final release');
425
471
  if (upstream) {
@@ -428,18 +474,26 @@ function sourceControlCheck(targetVersion) {
428
474
  const [ahead, behind] = counts.split(/\s+/).map(Number);
429
475
  evidence.push(`ahead=${ahead}`, `behind=${behind}`);
430
476
  if (ahead > 0) blockers.push(`Push ${ahead} release commit(s) to ${upstream}`);
431
- if (behind > 0) blockers.push(`Pull or reconcile ${behind} upstream commit(s) before final release`);
477
+ if (behind > 0)
478
+ blockers.push(`Pull or reconcile ${behind} upstream commit(s) before final release`);
432
479
  }
433
480
  }
434
- if (changedLines.length > 0) blockers.push(`Commit or stash ${changedLines.length} working-tree change(s) before final release`);
481
+ if (changedLines.length > 0)
482
+ blockers.push(
483
+ `Commit or stash ${changedLines.length} working-tree change(s) before final release`,
484
+ );
435
485
  if (!tagExists) blockers.push(`Create release tag ${tagName} on the final release commit`);
436
- if (tagExists && !tagsAtHead.includes(tagName)) blockers.push(`Move or recreate ${tagName} so it points at the final release commit`);
486
+ if (tagExists && !tagsAtHead.includes(tagName))
487
+ blockers.push(`Move or recreate ${tagName} so it points at the final release commit`);
437
488
  }
438
489
 
439
490
  if (blockers.length > 0) {
440
491
  return pending('source-control', 'Source control is ready for release', evidence, blockers);
441
492
  }
442
- return ok('source-control', 'Source control is ready for release', [...evidence, `${tagName} points at HEAD`]);
493
+ return ok('source-control', 'Source control is ready for release', [
494
+ ...evidence,
495
+ `${tagName} points at HEAD`,
496
+ ]);
443
497
  }
444
498
 
445
499
  function escapeRegex(value) {
@@ -456,7 +510,8 @@ export function targetChangelogStatus(changelog, targetVersion) {
456
510
  const section = nextSection === -1 ? rest : rest.slice(0, nextSection);
457
511
  const placeholderMarkers = [];
458
512
  if (/\bTODO\b/i.test(section)) placeholderMarkers.push('TODO marker');
459
- if (/Release Cut Checklist/i.test(section)) placeholderMarkers.push('release-cut checklist scaffold');
513
+ if (/Release Cut Checklist/i.test(section))
514
+ placeholderMarkers.push('release-cut checklist scaffold');
460
515
 
461
516
  return { found: true, placeholderMarkers };
462
517
  }
@@ -465,14 +520,18 @@ function changelogCheck(targetVersion) {
465
520
  const changelog = readText('CHANGELOG.md');
466
521
  const status = targetChangelogStatus(changelog, targetVersion);
467
522
  if (status.found && status.placeholderMarkers.length === 0) {
468
- return ok('changelog-target', `CHANGELOG has a final ${targetVersion} section`, ['CHANGELOG.md']);
523
+ return ok('changelog-target', `CHANGELOG has a final ${targetVersion} section`, [
524
+ 'CHANGELOG.md',
525
+ ]);
469
526
  }
470
527
  if (status.found) {
471
528
  return failed(
472
529
  'changelog-target',
473
530
  `CHANGELOG has a final ${targetVersion} section`,
474
531
  ['CHANGELOG.md'],
475
- [`Replace placeholder ${targetVersion} changelog scaffold before strict readiness: ${status.placeholderMarkers.join(', ')}`],
532
+ [
533
+ `Replace placeholder ${targetVersion} changelog scaffold before strict readiness: ${status.placeholderMarkers.join(', ')}`,
534
+ ],
476
535
  );
477
536
  }
478
537
  return pending(
@@ -487,15 +546,31 @@ function pythonDistCheck(targetVersion) {
487
546
  const wheel = `python/dist/audrey_memory-${targetVersion}-py3-none-any.whl`;
488
547
  const sdist = `python/dist/audrey_memory-${targetVersion}.tar.gz`;
489
548
  if (existsSync(fromRoot(wheel)) && existsSync(fromRoot(sdist))) {
490
- const verification = spawnSync('python', ['scripts/verify-python-package.py', '--version', targetVersion, '--json'], {
491
- cwd: ROOT,
492
- encoding: 'utf-8',
493
- });
549
+ const verification = spawnSync(
550
+ 'python',
551
+ ['scripts/verify-python-package.py', '--version', targetVersion, '--json'],
552
+ {
553
+ cwd: ROOT,
554
+ encoding: 'utf-8',
555
+ },
556
+ );
494
557
  if (verification.status !== 0) {
495
- const detail = verification.stderr.trim() || verification.stdout.trim() || `python verifier exited ${verification.status}`;
496
- return failed('python-dist', `Python ${targetVersion} artifacts verify`, [wheel, sdist], [detail]);
558
+ const detail =
559
+ verification.stderr.trim() ||
560
+ verification.stdout.trim() ||
561
+ `python verifier exited ${verification.status}`;
562
+ return failed(
563
+ 'python-dist',
564
+ `Python ${targetVersion} artifacts verify`,
565
+ [wheel, sdist],
566
+ [detail],
567
+ );
497
568
  }
498
- return ok('python-dist', `Python ${targetVersion} artifacts verify`, [wheel, sdist, 'python package verifier passed']);
569
+ return ok('python-dist', `Python ${targetVersion} artifacts verify`, [
570
+ wheel,
571
+ sdist,
572
+ 'python package verifier passed',
573
+ ]);
499
574
  }
500
575
  return pending(
501
576
  'python-dist',
@@ -507,18 +582,30 @@ function pythonDistCheck(targetVersion) {
507
582
 
508
583
  async function pypiRegistryVersionStatus(packageName, targetVersion, fetchImpl = fetch) {
509
584
  try {
510
- const response = await fetchImpl(`${PYPI_JSON_BASE}/${encodeURIComponent(packageName)}/${encodeURIComponent(targetVersion)}/json`, {
511
- headers: { accept: 'application/json' },
512
- });
585
+ const response = await fetchImpl(
586
+ `${PYPI_JSON_BASE}/${encodeURIComponent(packageName)}/${encodeURIComponent(targetVersion)}/json`,
587
+ {
588
+ headers: { accept: 'application/json' },
589
+ },
590
+ );
513
591
  if (response.ok) return { ok: true, published: true, status: response.status };
514
592
  if (response.status === 404) return { ok: true, published: false, status: response.status };
515
- return { ok: false, published: false, status: response.status, error: `PyPI returned HTTP ${response.status}` };
593
+ return {
594
+ ok: false,
595
+ published: false,
596
+ status: response.status,
597
+ error: `PyPI returned HTTP ${response.status}`,
598
+ };
516
599
  } catch (error) {
517
600
  return { ok: false, published: false, status: 'network-error', error: error.message };
518
601
  }
519
602
  }
520
603
 
521
- export async function pypiPackageTargetStatus({ packageName, version }, targetVersion, options = {}) {
604
+ export async function pypiPackageTargetStatus(
605
+ { packageName, version },
606
+ targetVersion,
607
+ options = {},
608
+ ) {
522
609
  const env = options.env ?? process.env;
523
610
  const evidence = [`python package=${packageName}`, `python version=${version ?? 'missing'}`];
524
611
 
@@ -544,7 +631,9 @@ export async function pypiPackageTargetStatus({ packageName, version }, targetVe
544
631
  'pypi-package-target',
545
632
  `PyPI package is ready to publish as ${targetVersion}`,
546
633
  evidence,
547
- [`Verify PyPI registry availability before publishing (${registry.error ?? `status=${registry.status}`})`],
634
+ [
635
+ `Verify PyPI registry availability before publishing (${registry.error ?? `status=${registry.status}`})`,
636
+ ],
548
637
  );
549
638
  }
550
639
 
@@ -556,21 +645,24 @@ export async function pypiPackageTargetStatus({ packageName, version }, targetVe
556
645
  'pypi-package-target',
557
646
  `PyPI package is ready to publish as ${targetVersion}`,
558
647
  evidence,
559
- [`Provide runtime PyPI publish credentials (${PYPI_CREDENTIAL_ENVS.join(', ')}) or trusted-publisher evidence before publishing`],
648
+ [
649
+ `Provide runtime PyPI publish credentials (${PYPI_CREDENTIAL_ENVS.join(', ')}) or trusted-publisher evidence before publishing`,
650
+ ],
560
651
  );
561
652
  }
562
653
 
563
- return ok('pypi-package-target', `PyPI package is ready to publish as ${targetVersion}`, [...evidence, `credentialEnv=${credentialEnv}`]);
654
+ return ok('pypi-package-target', `PyPI package is ready to publish as ${targetVersion}`, [
655
+ ...evidence,
656
+ `credentialEnv=${credentialEnv}`,
657
+ ]);
564
658
  }
565
659
 
566
660
  async function pypiPublishCheck(targetVersion, options = {}) {
567
661
  const pyproject = readText('python/pyproject.toml');
568
662
  const packageName = pyproject.match(/^name\s*=\s*"([^"]+)"/m)?.[1] ?? 'unknown';
569
- return pypiPackageTargetStatus(
570
- { packageName, version: pythonVersion() },
571
- targetVersion,
572
- { checkRegistry: options.checkPypiRegistry === true },
573
- );
663
+ return pypiPackageTargetStatus({ packageName, version: pythonVersion() }, targetVersion, {
664
+ checkRegistry: options.checkPypiRegistry === true,
665
+ });
574
666
  }
575
667
 
576
668
  async function paperChecks() {
@@ -591,14 +683,19 @@ async function paperChecks() {
591
683
  ];
592
684
 
593
685
  if (failures.length > 0) {
594
- return failed('paper-artifacts', 'Paper artifacts verify locally', [
595
- 'paper:claims',
596
- 'paper:publication-pack',
597
- 'paper:arxiv:verify',
598
- 'paper:launch-plan',
599
- 'paper:launch-results',
600
- 'paper:bundle:verify',
601
- ], failures);
686
+ return failed(
687
+ 'paper-artifacts',
688
+ 'Paper artifacts verify locally',
689
+ [
690
+ 'paper:claims',
691
+ 'paper:publication-pack',
692
+ 'paper:arxiv:verify',
693
+ 'paper:launch-plan',
694
+ 'paper:launch-results',
695
+ 'paper:bundle:verify',
696
+ ],
697
+ failures,
698
+ );
602
699
  }
603
700
  return ok('paper-artifacts', 'Paper artifacts verify locally', [
604
701
  `${claimReport.claims.length} claim(s)`,
@@ -613,17 +710,28 @@ async function paperChecks() {
613
710
  async function browserPublicationCheck() {
614
711
  const report = await verifyBrowserLaunchResults();
615
712
  if (!report.ok) {
616
- return failed('browser-publication', 'Browser publication results are valid', [report.results], report.failures);
713
+ return failed(
714
+ 'browser-publication',
715
+ 'Browser publication results are valid',
716
+ [report.results],
717
+ report.failures,
718
+ );
617
719
  }
618
720
  if (!report.ready) {
619
721
  return pending(
620
722
  'browser-publication',
621
723
  'Paper/browser launch targets are submitted',
622
- [`${report.targets.filter(target => target.status === 'submitted').length}/${report.targets.length} submitted`],
724
+ [
725
+ `${report.targets.filter(target => target.status === 'submitted').length}/${report.targets.length} submitted`,
726
+ ],
623
727
  report.blockers,
624
728
  );
625
729
  }
626
- return ok('browser-publication', 'Paper/browser launch targets are submitted', report.targets.map(target => `${target.id}: ${target.publicUrl}`));
730
+ return ok(
731
+ 'browser-publication',
732
+ 'Paper/browser launch targets are submitted',
733
+ report.targets.map(target => `${target.id}: ${target.publicUrl}`),
734
+ );
627
735
  }
628
736
 
629
737
  function arxivCompileCheck() {
@@ -645,7 +753,12 @@ function arxivCompileCheck() {
645
753
  async function externalEvidenceCheck() {
646
754
  const report = await verifyExternalGuardBenchEvidence({ allowPending: true, write: false });
647
755
  if (!report.ok) {
648
- return failed('external-evidence', 'External GuardBench evidence verifies', [report.outRoot], report.failures);
756
+ return failed(
757
+ 'external-evidence',
758
+ 'External GuardBench evidence verifies',
759
+ [report.outRoot],
760
+ report.failures,
761
+ );
649
762
  }
650
763
  const pendingRows = report.adapters.filter(adapter => adapter.status !== 'verified');
651
764
  if (pendingRows.length > 0) {
@@ -653,10 +766,17 @@ async function externalEvidenceCheck() {
653
766
  'external-evidence',
654
767
  'External Mem0/Zep GuardBench evidence is live-verified',
655
768
  report.adapters.map(adapter => `${adapter.id}: ${adapter.status}/${adapter.evidenceKind}`),
656
- pendingRows.map(adapter => `${adapter.id}: ${adapter.missingEnv?.length ? `missing ${adapter.missingEnv.join(', ')}` : adapter.evidenceKind}`),
769
+ pendingRows.map(
770
+ adapter =>
771
+ `${adapter.id}: ${adapter.missingEnv?.length ? `missing ${adapter.missingEnv.join(', ')}` : adapter.evidenceKind}`,
772
+ ),
657
773
  );
658
774
  }
659
- return ok('external-evidence', 'External Mem0/Zep GuardBench evidence is live-verified', report.adapters.map(adapter => `${adapter.id}: verified`));
775
+ return ok(
776
+ 'external-evidence',
777
+ 'External Mem0/Zep GuardBench evidence is live-verified',
778
+ report.adapters.map(adapter => `${adapter.id}: verified`),
779
+ );
660
780
  }
661
781
 
662
782
  function npmVersionMissing(result) {
@@ -670,7 +790,9 @@ export function npmPackageTargetStatus(pkg, targetVersion, run = runNpm) {
670
790
  'npm-package-target',
671
791
  `npm package is ready to publish as ${targetVersion}`,
672
792
  [`package.json version=${pkg.version}`],
673
- [`Cut the npm package only after version is bumped to ${targetVersion} and npm OTP/auth is available`],
793
+ [
794
+ `Cut the npm package only after version is bumped to ${targetVersion} and npm OTP/auth is available`,
795
+ ],
674
796
  );
675
797
  }
676
798
 
@@ -685,9 +807,14 @@ export function npmPackageTargetStatus(pkg, targetVersion, run = runNpm) {
685
807
  `registry=${packageSpec}`,
686
808
  ]);
687
809
  }
688
- return failed('npm-package-target', `npm package registry state is coherent for ${targetVersion}`, evidence, [
689
- `npm registry returned unexpected version for ${packageSpec}: ${registryVersion || 'empty'}`,
690
- ]);
810
+ return failed(
811
+ 'npm-package-target',
812
+ `npm package registry state is coherent for ${targetVersion}`,
813
+ evidence,
814
+ [
815
+ `npm registry returned unexpected version for ${packageSpec}: ${registryVersion || 'empty'}`,
816
+ ],
817
+ );
691
818
  }
692
819
 
693
820
  if (!npmVersionMissing(registryStatus)) {
@@ -706,7 +833,9 @@ export function npmPackageTargetStatus(pkg, targetVersion, run = runNpm) {
706
833
  'npm-package-target',
707
834
  `npm package is ready to publish as ${targetVersion}`,
708
835
  evidence,
709
- [`Authenticate npm CLI for ${NPM_REGISTRY} before publishing (${commandSummary(authStatus)})`],
836
+ [
837
+ `Authenticate npm CLI for ${NPM_REGISTRY} before publishing (${commandSummary(authStatus)})`,
838
+ ],
710
839
  );
711
840
  }
712
841
 
@@ -737,7 +866,8 @@ export async function verifyReleaseReadiness(options = {}) {
737
866
  const failures = checks.flatMap(row => row.failures.map(failure => `${row.id}: ${failure}`));
738
867
  const blockers = checks.flatMap(row => row.blockers.map(blocker => `${row.id}: ${blocker}`));
739
868
  const ready = failures.length === 0 && blockers.length === 0;
740
- const okStatus = failures.length === 0 && (options.allowPending === true || blockers.length === 0);
869
+ const okStatus =
870
+ failures.length === 0 && (options.allowPending === true || blockers.length === 0);
741
871
 
742
872
  return {
743
873
  schemaVersion: '1.0.0',
@@ -766,7 +896,9 @@ async function main() {
766
896
  } else if (report.ready) {
767
897
  console.log(`Audrey ${report.targetVersion} release readiness passed.`);
768
898
  } else if (report.ok) {
769
- console.log(`Audrey ${report.targetVersion} release readiness has ${report.blockers.length} pending blocker(s).`);
899
+ console.log(
900
+ `Audrey ${report.targetVersion} release readiness has ${report.blockers.length} pending blocker(s).`,
901
+ );
770
902
  for (const blocker of report.blockers) console.log(`- ${blocker}`);
771
903
  } else {
772
904
  console.error(`Audrey ${report.targetVersion} release readiness failed.`);
@@ -777,7 +909,10 @@ async function main() {
777
909
  if (!report.ok) process.exit(1);
778
910
  }
779
911
 
780
- if (process.argv[1] && resolve(process.argv[1]).toLowerCase() === fileURLToPath(import.meta.url).toLowerCase()) {
912
+ if (
913
+ process.argv[1] &&
914
+ resolve(process.argv[1]).toLowerCase() === fileURLToPath(import.meta.url).toLowerCase()
915
+ ) {
781
916
  main().catch(error => {
782
917
  console.error(error.stack ?? error.message);
783
918
  process.exit(1);