@vellumai/assistant 0.10.7-dev.202607092332.9deedf4 → 0.10.7-dev.202607100313.fffdfea

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 (249) hide show
  1. package/ARCHITECTURE.md +1 -2
  2. package/docs/architecture/memory.md +1 -3
  3. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/package.json +0 -2
  4. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/contracts.test.ts +0 -2
  5. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/credential-rpc.ts +3 -5
  6. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/index.ts +2 -4
  7. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/rpc.ts +4 -447
  8. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/package.json +0 -2
  9. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/contracts.test.ts +0 -2
  10. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/credential-rpc.ts +3 -5
  11. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/index.ts +2 -4
  12. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/rpc.ts +4 -447
  13. package/node_modules/@vellumai/service-contracts/package.json +0 -2
  14. package/node_modules/@vellumai/service-contracts/src/__tests__/contracts.test.ts +0 -2
  15. package/node_modules/@vellumai/service-contracts/src/credential-rpc.ts +3 -5
  16. package/node_modules/@vellumai/service-contracts/src/index.ts +2 -4
  17. package/node_modules/@vellumai/service-contracts/src/rpc.ts +4 -447
  18. package/openapi.yaml +1 -222
  19. package/package.json +1 -1
  20. package/scripts/memory-inspect.ts +2 -8
  21. package/src/__tests__/approval-routes-http.test.ts +0 -8
  22. package/src/__tests__/background-workers-disk-pressure.test.ts +4 -2
  23. package/src/__tests__/compaction-events.test.ts +0 -4
  24. package/src/__tests__/context-search-memory-source.test.ts +0 -1
  25. package/src/__tests__/conversation-agent-loop-disk-pressure.test.ts +0 -1
  26. package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +0 -2
  27. package/src/__tests__/conversation-agent-loop-overflow.test.ts +0 -2
  28. package/src/__tests__/conversation-agent-loop.test.ts +0 -4
  29. package/src/__tests__/conversation-app-control-lifecycle.test.ts +0 -4
  30. package/src/__tests__/conversation-fork-crud.test.ts +18 -5
  31. package/src/__tests__/conversation-fork-retrospective.test.ts +483 -0
  32. package/src/__tests__/conversation-routes-disk-view.test.ts +0 -4
  33. package/src/__tests__/conversation-store.test.ts +0 -10
  34. package/src/__tests__/conversation-summarize-up-to.test.ts +0 -4
  35. package/src/__tests__/credential-execution-api-key-propagation.test.ts +0 -40
  36. package/src/__tests__/credential-execution-client.test.ts +3 -3
  37. package/src/__tests__/credential-execution-managed-contract.test.ts +8 -104
  38. package/src/__tests__/file-write-tool.test.ts +9 -13
  39. package/src/__tests__/graph-extraction-event-date.test.ts +0 -9
  40. package/src/__tests__/injection-block.test.ts +0 -1
  41. package/src/__tests__/job-handler-registration-guard.test.ts +0 -1
  42. package/src/__tests__/lexical-index-dual-write.test.ts +2 -2
  43. package/src/__tests__/llm-resolver.test.ts +0 -1
  44. package/src/__tests__/messages-after-tiebreaker.test.ts +0 -1
  45. package/src/__tests__/playbook-execution.test.ts +2 -26
  46. package/src/__tests__/plugin-import-boundary-guard.test.ts +0 -4
  47. package/src/__tests__/plugin-import-boundary-reverse-guard.test.ts +318 -0
  48. package/src/__tests__/proxy-approval-callback.test.ts +0 -1
  49. package/src/__tests__/rebuild-index-graph-nodes.test.ts +0 -4
  50. package/src/__tests__/send-endpoint-busy.test.ts +0 -12
  51. package/src/__tests__/service-contracts-import-guard.test.ts +4 -9
  52. package/src/__tests__/subagent-fork-spawn.test.ts +0 -37
  53. package/src/__tests__/task-memory-cleanup.test.ts +0 -11
  54. package/src/__tests__/voice-scoped-grant-consumer.test.ts +0 -1
  55. package/src/__tests__/voice-session-bridge.test.ts +0 -56
  56. package/src/__tests__/workspace-migration-009-backfill-conversation-disk-view.test.ts +0 -1
  57. package/src/__tests__/workspace-migration-013-repair-conversation-disk-view.test.ts +0 -1
  58. package/src/__tests__/workspace-migration-028-recover-conversations-from-disk-view.test.ts +0 -1
  59. package/src/__tests__/workspace-migration-129-remove-analyze-conversation-config.test.ts +190 -0
  60. package/src/cli/commands/db/repair-step-conversation-backfill.ts +0 -1
  61. package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +0 -6
  62. package/src/config/bundled-skills/playbooks/tools/playbook-create.ts +0 -3
  63. package/src/config/bundled-skills/playbooks/tools/playbook-delete.ts +0 -3
  64. package/src/config/bundled-skills/playbooks/tools/playbook-list.ts +1 -3
  65. package/src/config/bundled-skills/playbooks/tools/playbook-update.ts +0 -4
  66. package/src/config/call-site-defaults.ts +0 -1
  67. package/src/config/feature-flag-registry.json +0 -16
  68. package/src/config/schema.ts +0 -3
  69. package/src/config/schemas/call-site-catalog.ts +0 -6
  70. package/src/config/schemas/llm.ts +0 -1
  71. package/src/conversations/job-handlers/summarization.ts +0 -2
  72. package/src/daemon/conversation-agent-loop-handlers.ts +0 -1
  73. package/src/daemon/conversation-agent-loop.ts +1 -6
  74. package/src/daemon/conversation-lifecycle.ts +0 -14
  75. package/src/daemon/conversation-turn-finalize.ts +0 -1
  76. package/src/daemon/handlers/shared.ts +1 -2
  77. package/src/export/transcript-formatter.ts +9 -39
  78. package/src/home/conversation-starter-checkpoints.ts +9 -5
  79. package/src/home/job-handlers/conversation-starters.ts +24 -54
  80. package/src/hooks/types.ts +2 -2
  81. package/src/ipc/routes/__tests__/memory-v2-backfill.test.ts +5 -7
  82. package/src/persistence/__tests__/bulk-write-gate.test.ts +165 -0
  83. package/src/persistence/__tests__/immediate-transaction-guard.test.ts +70 -0
  84. package/src/persistence/auto-analysis-constants.ts +4 -13
  85. package/src/persistence/bulk-write-gate.ts +82 -0
  86. package/src/persistence/conversation-bootstrap.ts +3 -3
  87. package/src/persistence/conversation-crud.ts +158 -80
  88. package/src/persistence/conversation-key-store.ts +0 -2
  89. package/src/persistence/conversation-row-batch-delete.ts +16 -1
  90. package/src/persistence/conversation-types.ts +12 -1
  91. package/src/persistence/db-async-query.ts +18 -9
  92. package/src/persistence/db-connection.ts +20 -4
  93. package/src/persistence/db-maintenance.ts +78 -6
  94. package/src/persistence/embeddings/qdrant-client.ts +2 -18
  95. package/src/persistence/fork-message-copy.ts +18 -4
  96. package/src/persistence/jobs-store.ts +3 -86
  97. package/src/persistence/migrations/323-delete-non-default-memory-scopes.test.ts +148 -0
  98. package/src/persistence/migrations/323-delete-non-default-memory-scopes.ts +35 -0
  99. package/src/persistence/schema/conversations.ts +0 -1
  100. package/src/persistence/schema/memory-core.ts +17 -28
  101. package/src/persistence/schema/memory-graph.ts +0 -4
  102. package/src/persistence/schema/tasks.ts +0 -1
  103. package/src/persistence/steps.ts +2 -0
  104. package/src/playbooks/playbook-compiler.ts +2 -10
  105. package/src/plugins/defaults/memory/__tests__/db-maintenance.test.ts +105 -11
  106. package/src/plugins/defaults/memory/__tests__/jobs-store-enqueue-gate.test.ts +7 -62
  107. package/src/plugins/defaults/memory/__tests__/memory-retrospective-job.test.ts +47 -5
  108. package/src/plugins/defaults/memory/__tests__/memory-retrospective-skill-card.test.ts +29 -1
  109. package/src/plugins/defaults/memory/__tests__/memory-retrospective-startup-cleanup.test.ts +133 -70
  110. package/src/plugins/defaults/memory/activation-session-store.ts +1 -1
  111. package/src/plugins/defaults/memory/config.ts +1 -1
  112. package/src/plugins/defaults/memory/context-search/sources/conversations.ts +1 -1
  113. package/src/plugins/defaults/memory/context-search/sources/memory-v2.ts +1 -1
  114. package/src/plugins/defaults/memory/context-search/sources/memory.ts +1 -1
  115. package/src/plugins/defaults/memory/filing-jobs.ts +1 -1
  116. package/src/plugins/defaults/memory/fork-conversation-memory.ts +8 -4
  117. package/src/plugins/defaults/memory/frontmatter.ts +1 -1
  118. package/src/plugins/defaults/memory/graph/__tests__/handle-remember-v2.test.ts +4 -25
  119. package/src/plugins/defaults/memory/graph/bootstrap.ts +12 -18
  120. package/src/plugins/defaults/memory/graph/capability-seed.ts +4 -18
  121. package/src/plugins/defaults/memory/graph/consolidation.ts +7 -14
  122. package/src/plugins/defaults/memory/graph/conversation-graph-memory.ts +1 -3
  123. package/src/plugins/defaults/memory/graph/decay.ts +5 -10
  124. package/src/plugins/defaults/memory/graph/extraction-job.ts +2 -3
  125. package/src/plugins/defaults/memory/graph/extraction.test.ts +1 -9
  126. package/src/plugins/defaults/memory/graph/extraction.ts +1 -8
  127. package/src/plugins/defaults/memory/graph/graph-search.ts +1 -2
  128. package/src/plugins/defaults/memory/graph/injection.test.ts +0 -1
  129. package/src/plugins/defaults/memory/graph/injection.ts +1 -1
  130. package/src/plugins/defaults/memory/graph/narrative.ts +1 -3
  131. package/src/plugins/defaults/memory/graph/pattern-scan.ts +1 -4
  132. package/src/plugins/defaults/memory/graph/retriever.test.ts +0 -19
  133. package/src/plugins/defaults/memory/graph/retriever.ts +6 -14
  134. package/src/plugins/defaults/memory/graph/scoring.test.ts +0 -1
  135. package/src/plugins/defaults/memory/graph/store.test.ts +6 -58
  136. package/src/plugins/defaults/memory/graph/store.ts +5 -43
  137. package/src/plugins/defaults/memory/graph/tool-handlers.test.ts +0 -4
  138. package/src/plugins/defaults/memory/graph/tool-handlers.ts +1 -11
  139. package/src/plugins/defaults/memory/graph/types.ts +0 -3
  140. package/src/plugins/defaults/memory/hooks/init.ts +1 -1
  141. package/src/plugins/defaults/memory/indexer.ts +2 -45
  142. package/src/plugins/defaults/memory/injectors.ts +2 -3
  143. package/src/plugins/defaults/memory/job-handler-registration.ts +0 -4
  144. package/src/plugins/defaults/memory/job-handlers/backfill.ts +0 -1
  145. package/src/plugins/defaults/memory/job-handlers/embedding.test.ts +0 -1
  146. package/src/plugins/defaults/memory/job-handlers/embedding.ts +0 -4
  147. package/src/plugins/defaults/memory/job-handlers/index-maintenance.ts +1 -1
  148. package/src/plugins/defaults/memory/job-handlers.ts +5 -9
  149. package/src/plugins/defaults/memory/jobs/embed-concept-page.ts +1 -1
  150. package/src/plugins/defaults/memory/jobs/embed-pkb-file.test.ts +41 -21
  151. package/src/plugins/defaults/memory/jobs/embed-pkb-file.ts +10 -5
  152. package/src/plugins/defaults/memory/jobs-worker.ts +21 -9
  153. package/src/plugins/defaults/memory/logging.ts +17 -0
  154. package/src/plugins/defaults/memory/memory-retrospective-constants.ts +10 -7
  155. package/src/plugins/defaults/memory/memory-retrospective-enqueue.ts +5 -6
  156. package/src/plugins/defaults/memory/memory-retrospective-fork-boundary.ts +57 -20
  157. package/src/plugins/defaults/memory/memory-retrospective-job.ts +13 -15
  158. package/src/plugins/defaults/memory/memory-retrospective-skill-card.ts +2 -2
  159. package/src/plugins/defaults/memory/memory-retrospective-startup-cleanup.ts +52 -39
  160. package/src/plugins/defaults/memory/memory-retrospective-trigger-check.ts +1 -1
  161. package/src/plugins/defaults/memory/pkb/pkb-index.test.ts +25 -38
  162. package/src/plugins/defaults/memory/pkb/pkb-index.ts +7 -19
  163. package/src/plugins/defaults/memory/pkb/pkb-reconcile.test.ts +46 -28
  164. package/src/plugins/defaults/memory/pkb/pkb-reconcile.ts +4 -9
  165. package/src/plugins/defaults/memory/pkb/pkb-search.test.ts +3 -9
  166. package/src/plugins/defaults/memory/pkb/pkb-search.ts +2 -9
  167. package/src/plugins/defaults/memory/pkb/types.ts +0 -11
  168. package/src/plugins/defaults/memory/rerank-local.ts +1 -1
  169. package/src/plugins/defaults/memory/routes/memory-eval-routes.ts +1 -1
  170. package/src/plugins/defaults/memory/routes/memory-item-routes.test.ts +0 -1
  171. package/src/plugins/defaults/memory/routes/memory-item-routes.ts +3 -11
  172. package/src/plugins/defaults/memory/routes/memory-v2-routes.ts +1 -1
  173. package/src/plugins/defaults/memory/routes/memory-v3-routes.ts +1 -1
  174. package/src/plugins/defaults/memory/startup.ts +2 -3
  175. package/src/plugins/defaults/memory/task-memory-cleanup.ts +1 -1
  176. package/src/plugins/defaults/memory/tools.test.ts +1 -9
  177. package/src/plugins/defaults/memory/tools.ts +0 -1
  178. package/src/plugins/defaults/memory/v2/backfill-jobs.ts +1 -1
  179. package/src/plugins/defaults/memory/v2/cli-command-store.ts +1 -1
  180. package/src/plugins/defaults/memory/v2/consolidation-job.ts +1 -1
  181. package/src/plugins/defaults/memory/v2/frontmatter-sweep.ts +1 -1
  182. package/src/plugins/defaults/memory/v2/injection-events.ts +1 -1
  183. package/src/plugins/defaults/memory/v2/injection.ts +1 -1
  184. package/src/plugins/defaults/memory/v2/memory-v2-startup.ts +1 -1
  185. package/src/plugins/defaults/memory/v2/migration.ts +1 -1
  186. package/src/plugins/defaults/memory/v2/page-index.ts +1 -1
  187. package/src/plugins/defaults/memory/v2/prompts/consolidation.ts +1 -1
  188. package/src/plugins/defaults/memory/v2/prompts/router.ts +1 -1
  189. package/src/plugins/defaults/memory/v2/qdrant.ts +1 -1
  190. package/src/plugins/defaults/memory/v2/reranker.ts +1 -1
  191. package/src/plugins/defaults/memory/v2/router.ts +1 -1
  192. package/src/plugins/defaults/memory/v2/skill-store.ts +1 -1
  193. package/src/plugins/defaults/memory/v2/sweep-job.ts +1 -1
  194. package/src/plugins/defaults/memory/v3/candidate-match.ts +1 -1
  195. package/src/plugins/defaults/memory/v3/dense.ts +1 -1
  196. package/src/plugins/defaults/memory/v3/injector.ts +1 -1
  197. package/src/plugins/defaults/memory/v3/maintain-job.ts +1 -1
  198. package/src/plugins/defaults/memory/v3/orchestrate.ts +1 -1
  199. package/src/plugins/defaults/memory/v3/pool-select.ts +1 -1
  200. package/src/plugins/defaults/memory/v3/prune.ts +1 -1
  201. package/src/plugins/defaults/memory/v3/section-dense-store.ts +1 -1
  202. package/src/plugins/defaults/memory/v3/shadow-plugin.ts +1 -1
  203. package/src/plugins/defaults/memory/worker.ts +1 -1
  204. package/src/runtime/capabilities.ts +1 -1
  205. package/src/runtime/routes/__tests__/bookmark-routes.test.ts +0 -1
  206. package/src/runtime/routes/__tests__/conversation-management-routes.test.ts +0 -1
  207. package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +0 -1
  208. package/src/runtime/routes/conversation-starter-routes.ts +12 -23
  209. package/src/runtime/routes/index.ts +0 -2
  210. package/src/runtime/services/__tests__/auto-analysis-guard.test.ts +1 -8
  211. package/src/runtime/services/__tests__/conversation-serializer.test.ts +0 -1
  212. package/src/runtime/services/auto-analysis-guard.ts +5 -5
  213. package/src/runtime/services/conversation-serializer.ts +2 -3
  214. package/src/tasks/SPEC.md +10 -17
  215. package/src/tools/executor.ts +1 -102
  216. package/src/tools/filesystem/write.ts +0 -2
  217. package/src/tools/tool-types.ts +0 -15
  218. package/src/tools/types.ts +0 -10
  219. package/src/workspace/migrations/028-recover-conversations-from-disk-view.ts +0 -1
  220. package/src/workspace/migrations/129-remove-analyze-conversation-config.ts +59 -0
  221. package/src/workspace/migrations/registry.ts +2 -0
  222. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/__tests__/grants.test.ts +0 -686
  223. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/grants.ts +0 -184
  224. package/node_modules/@vellumai/ces-client/node_modules/@vellumai/service-contracts/src/rendering.ts +0 -135
  225. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/__tests__/grants.test.ts +0 -686
  226. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/grants.ts +0 -184
  227. package/node_modules/@vellumai/gateway-client/node_modules/@vellumai/service-contracts/src/rendering.ts +0 -135
  228. package/node_modules/@vellumai/service-contracts/src/__tests__/grants.test.ts +0 -686
  229. package/node_modules/@vellumai/service-contracts/src/grants.ts +0 -184
  230. package/node_modules/@vellumai/service-contracts/src/rendering.ts +0 -135
  231. package/src/__tests__/auto-analysis-end-to-end.test.ts +0 -621
  232. package/src/__tests__/auto-analysis-prompt.test.ts +0 -50
  233. package/src/__tests__/config-analysis.test.ts +0 -83
  234. package/src/__tests__/conversation-analysis-routes.test.ts +0 -156
  235. package/src/__tests__/credential-execution-approval-bridge.test.ts +0 -297
  236. package/src/config/schemas/analysis.ts +0 -32
  237. package/src/credential-execution/approval-bridge.ts +0 -320
  238. package/src/daemon/__tests__/conversation-lifecycle-auto-analyze.test.ts +0 -449
  239. package/src/plugins/defaults/memory/__tests__/find-analysis-conversation.test.ts +0 -197
  240. package/src/runtime/routes/conversation-analysis-routes.ts +0 -75
  241. package/src/runtime/services/__tests__/analyze-conversation.test.ts +0 -477
  242. package/src/runtime/services/__tests__/auto-analysis-enqueue.test.ts +0 -386
  243. package/src/runtime/services/__tests__/auto-analysis-prompt.test.ts +0 -53
  244. package/src/runtime/services/__tests__/conversation-analyze-job.test.ts +0 -213
  245. package/src/runtime/services/__tests__/manual-analysis-prompt.test.ts +0 -41
  246. package/src/runtime/services/analyze-conversation.ts +0 -334
  247. package/src/runtime/services/auto-analysis-enqueue.ts +0 -130
  248. package/src/runtime/services/auto-analysis-prompt.ts +0 -55
  249. package/src/runtime/services/conversation-analyze-job.ts +0 -53
@@ -78,18 +78,14 @@ describe("three-container pod contract", () => {
78
78
  // Verify actual string values, not just that they exist. These are
79
79
  // the method names on the wire — changing them is a breaking change
80
80
  // that would break the assistant-to-CES sidecar RPC contract.
81
- expect(CesRpcMethod.MakeAuthenticatedRequest).toBe(
82
- "make_authenticated_request",
83
- );
84
- expect(CesRpcMethod.RunAuthenticatedCommand).toBe(
85
- "run_authenticated_command",
86
- );
87
- expect(CesRpcMethod.ManageSecureCommandTool).toBe(
88
- "manage_secure_command_tool",
89
- );
90
81
  expect(CesRpcMethod.UpdateManagedCredential).toBe(
91
82
  "update_managed_credential",
92
83
  );
84
+ expect(CesRpcMethod.GetCredential).toBe("get_credential");
85
+ expect(CesRpcMethod.SetCredential).toBe("set_credential");
86
+ expect(CesRpcMethod.DeleteCredential).toBe("delete_credential");
87
+ expect(CesRpcMethod.ListCredentials).toBe("list_credentials");
88
+ expect(CesRpcMethod.BulkSetCredentials).toBe("bulk_set_credentials");
93
89
  });
94
90
 
95
91
  test("all declared RPC methods have matching schemas in CesRpcSchemas", () => {
@@ -97,7 +93,7 @@ describe("three-container pod contract", () => {
97
93
  // both request and response. A missing entry means the RPC dispatch
98
94
  // layer can't validate payloads for that method.
99
95
  const allMethods = Object.values(CesRpcMethod);
100
- expect(allMethods.length).toBeGreaterThanOrEqual(9);
96
+ expect(allMethods.length).toBeGreaterThanOrEqual(6);
101
97
  for (const method of allMethods) {
102
98
  const schema = CesRpcSchemas[method as keyof typeof CesRpcSchemas];
103
99
  expect(schema).toBeDefined();
@@ -149,7 +145,7 @@ describe("local_static handle rejection in managed mode", () => {
149
145
  });
150
146
 
151
147
  test("production rejection error mentions platform_oauth as the alternative", () => {
152
- // Assert against the actual production constant from managed-errors.ts,
148
+ // Assert against the actual shared constant from service-contracts,
153
149
  // not a test-local copy.
154
150
  expect(MANAGED_LOCAL_STATIC_REJECTION_ERROR).toContain("platform_oauth");
155
151
  });
@@ -301,102 +297,10 @@ describe("managed CES bootstrap handshake contract", () => {
301
297
  });
302
298
 
303
299
  // ---------------------------------------------------------------------------
304
- // Secure HTTP execution through sidecar path
305
- // ---------------------------------------------------------------------------
306
-
307
- describe("secure HTTP execution through managed sidecar", () => {
308
- test("make_authenticated_request schema validates a well-formed request", () => {
309
- const schema = CesRpcSchemas[CesRpcMethod.MakeAuthenticatedRequest];
310
- const result = schema.request.safeParse({
311
- credentialHandle: platformOAuthHandle("conn_123"),
312
- method: "GET",
313
- url: "https://api.example.com/resource",
314
- purpose: "Fetch user data",
315
- });
316
- expect(result.success).toBe(true);
317
- });
318
-
319
- test("make_authenticated_request schema rejects request missing credentialHandle", () => {
320
- const schema = CesRpcSchemas[CesRpcMethod.MakeAuthenticatedRequest];
321
- const result = schema.request.safeParse({
322
- method: "GET",
323
- url: "https://api.example.com/resource",
324
- purpose: "Fetch user data",
325
- });
326
- expect(result.success).toBe(false);
327
- });
328
-
329
- test("make_authenticated_request response schema validates success and error shapes", () => {
330
- const schema = CesRpcSchemas[CesRpcMethod.MakeAuthenticatedRequest];
331
-
332
- const successResult = schema.response.safeParse({
333
- success: true,
334
- statusCode: 200,
335
- responseBody: '{"data": "ok"}',
336
- });
337
- expect(successResult.success).toBe(true);
338
-
339
- const errorResult = schema.response.safeParse({
340
- success: false,
341
- error: { code: "UNAUTHORIZED", message: "Invalid token" },
342
- });
343
- expect(errorResult.success).toBe(true);
344
- });
345
- });
346
-
347
- // ---------------------------------------------------------------------------
348
- // Secure command execution through sidecar path
349
- // ---------------------------------------------------------------------------
350
-
351
- describe("secure command execution through managed sidecar", () => {
352
- test("run_authenticated_command schema validates a well-formed request", () => {
353
- const schema = CesRpcSchemas[CesRpcMethod.RunAuthenticatedCommand];
354
- const result = schema.request.safeParse({
355
- credentialHandle: platformOAuthHandle("conn_456"),
356
- command: "sha256abc123/default git status",
357
- purpose: "Check repo status",
358
- });
359
- expect(result.success).toBe(true);
360
- });
361
-
362
- test("run_authenticated_command schema rejects request missing command", () => {
363
- const schema = CesRpcSchemas[CesRpcMethod.RunAuthenticatedCommand];
364
- const result = schema.request.safeParse({
365
- credentialHandle: platformOAuthHandle("conn_456"),
366
- purpose: "Check repo status",
367
- });
368
- expect(result.success).toBe(false);
369
- });
370
-
371
- test("run_authenticated_command response includes exitCode, stdout, stderr", () => {
372
- const schema = CesRpcSchemas[CesRpcMethod.RunAuthenticatedCommand];
373
- const result = schema.response.safeParse({
374
- success: true,
375
- exitCode: 0,
376
- stdout: "On branch main\n",
377
- stderr: "",
378
- });
379
- expect(result.success).toBe(true);
380
- });
381
- });
382
-
383
- // ---------------------------------------------------------------------------
384
- // Managed OAuth materialization through CES
300
+ // Managed OAuth handle parsing
385
301
  // ---------------------------------------------------------------------------
386
302
 
387
303
  describe("managed OAuth materialization through CES sidecar", () => {
388
- test("credentialHandle field accepts platform_oauth handles", () => {
389
- const schema = CesRpcSchemas[CesRpcMethod.MakeAuthenticatedRequest];
390
- const handle = platformOAuthHandle("conn_abc123");
391
- const result = schema.request.safeParse({
392
- credentialHandle: handle,
393
- method: "POST",
394
- url: "https://api.example.com/token",
395
- purpose: "Materialize OAuth token",
396
- });
397
- expect(result.success).toBe(true);
398
- });
399
-
400
304
  test("platform_oauth handle roundtrips through parse correctly", () => {
401
305
  const handle = platformOAuthHandle("conn_abc123");
402
306
  expect(handle).toBe("platform_oauth:conn_abc123");
@@ -24,16 +24,11 @@ import {
24
24
  const enqueueCalls: Array<{
25
25
  pkbRoot: string;
26
26
  absPath: string;
27
- memoryScopeId: string;
28
27
  }> = [];
29
28
  let enqueueThrows = false;
30
29
 
31
30
  mock.module("../plugins/defaults/memory/jobs/embed-pkb-file.js", () => ({
32
- enqueuePkbIndexJob: (input: {
33
- pkbRoot: string;
34
- absPath: string;
35
- memoryScopeId: string;
36
- }) => {
31
+ enqueuePkbIndexJob: (input: { pkbRoot: string; absPath: string }) => {
37
32
  if (enqueueThrows) {
38
33
  throw new Error("simulated enqueue failure");
39
34
  }
@@ -49,7 +44,6 @@ function setWorkspaceDir(dir: string): void {
49
44
  process.env.VELLUM_WORKSPACE_DIR = dir;
50
45
  }
51
46
 
52
- import { PKB_WORKSPACE_SCOPE } from "../plugins/defaults/memory/pkb/types.js";
53
47
  import { finalizeTool } from "../tools/tool-defaults.js";
54
48
  import type { Tool, ToolContext } from "../tools/types.js";
55
49
 
@@ -194,25 +188,27 @@ describe("file_write tool PKB re-index hook", () => {
194
188
  expect(enqueueCalls[0]).toEqual({
195
189
  pkbRoot: join(workingDir, "pkb"),
196
190
  absPath: join(workingDir, "pkb", "note.md"),
197
- memoryScopeId: PKB_WORKSPACE_SCOPE,
198
191
  });
199
192
  });
200
193
 
201
- test("always uses PKB_WORKSPACE_SCOPE", async () => {
194
+ test("payload identifies the file alone — the PKB index is workspace-shared", async () => {
202
195
  const workingDir = makeTempDir();
203
196
  setWorkspaceDir(workingDir);
204
197
  mkdirSync(join(workingDir, "pkb"), { recursive: true });
205
198
 
206
199
  const result = await fileWriteTool.execute(
207
200
  { path: "pkb/private.md", content: "secret\n" },
208
- makeContext(workingDir),
201
+ { ...makeContext(workingDir), conversationId: "another-conversation" },
209
202
  );
210
203
 
211
204
  expect(result.isError).toBe(false);
212
205
  expect(enqueueCalls).toHaveLength(1);
213
- // PKB files are workspace-level — points are keyed by PKB_WORKSPACE_SCOPE
214
- // so all conversations share one PKB index.
215
- expect(enqueueCalls[0]?.memoryScopeId).toBe(PKB_WORKSPACE_SCOPE);
206
+ // All conversations share one PKB index — the job payload carries no
207
+ // conversation or scope discriminator.
208
+ expect(Object.keys(enqueueCalls[0]!).sort()).toEqual([
209
+ "absPath",
210
+ "pkbRoot",
211
+ ]);
216
212
  });
217
213
 
218
214
  test("does NOT enqueue when writing outside pkb/", async () => {
@@ -80,7 +80,6 @@ describe("event_date prompt grounding", () => {
80
80
  describe("parseExtractionResponse event_date coercion", () => {
81
81
  const candidateNodeIds = new Set<string>();
82
82
  const conversationId = "test-convo";
83
- const scopeId = "default";
84
83
  const now = Date.now();
85
84
 
86
85
  function makeInput(overrides: Record<string, unknown> = {}) {
@@ -110,7 +109,6 @@ describe("parseExtractionResponse event_date coercion", () => {
110
109
  const { diff } = parseExtractionResponse(
111
110
  input,
112
111
  conversationId,
113
- scopeId,
114
112
  candidateNodeIds,
115
113
  now,
116
114
  );
@@ -122,7 +120,6 @@ describe("parseExtractionResponse event_date coercion", () => {
122
120
  const { diff } = parseExtractionResponse(
123
121
  input,
124
122
  conversationId,
125
- scopeId,
126
123
  candidateNodeIds,
127
124
  now,
128
125
  );
@@ -134,7 +131,6 @@ describe("parseExtractionResponse event_date coercion", () => {
134
131
  const { diff } = parseExtractionResponse(
135
132
  input,
136
133
  conversationId,
137
- scopeId,
138
134
  candidateNodeIds,
139
135
  now,
140
136
  );
@@ -156,7 +152,6 @@ describe("parseExtractionResponse event_date coercion", () => {
156
152
  const { deferredTriggers } = parseExtractionResponse(
157
153
  input,
158
154
  conversationId,
159
- scopeId,
160
155
  candidateNodeIds,
161
156
  now,
162
157
  );
@@ -184,7 +179,6 @@ describe("parseExtractionResponse event_date coercion", () => {
184
179
  const { diff } = parseExtractionResponse(
185
180
  input,
186
181
  conversationId,
187
- scopeId,
188
182
  candidates,
189
183
  now,
190
184
  );
@@ -198,7 +192,6 @@ describe("parseExtractionResponse event_date coercion", () => {
198
192
  const { deferredTriggers } = parseExtractionResponse(
199
193
  input,
200
194
  conversationId,
201
- scopeId,
202
195
  candidateNodeIds,
203
196
  conversationTs,
204
197
  );
@@ -216,7 +209,6 @@ describe("parseExtractionResponse event_date coercion", () => {
216
209
  const { deferredTriggers } = parseExtractionResponse(
217
210
  input,
218
211
  conversationId,
219
- scopeId,
220
212
  candidateNodeIds,
221
213
  conversationTs,
222
214
  );
@@ -241,7 +233,6 @@ describe("parseExtractionResponse event_date coercion", () => {
241
233
  const { diff } = parseExtractionResponse(
242
234
  input,
243
235
  conversationId,
244
- scopeId,
245
236
  candidates,
246
237
  now,
247
238
  );
@@ -39,7 +39,6 @@ function makeScoredNode(
39
39
  narrativeRole: overrides.narrativeRole ?? null,
40
40
  partOfStory: overrides.partOfStory ?? null,
41
41
  imageRefs: overrides.imageRefs ?? null,
42
- scopeId: overrides.scopeId ?? "default",
43
42
  },
44
43
  score: 0.8,
45
44
  scoreBreakdown: {
@@ -53,7 +53,6 @@ const NON_PLUGIN_JOB_TYPES = [
53
53
  "backfill_lexical_index",
54
54
  "build_conversation_summary",
55
55
  "media_processing",
56
- "conversation_analyze",
57
56
  "generate_conversation_starters",
58
57
  ].sort();
59
58
 
@@ -251,7 +251,7 @@ describe("messages lexical-index dual-write", () => {
251
251
  // One memory-plugin job type, one host-owned job type — both keyed by the
252
252
  // conversation id.
253
253
  enqueueMemoryJob("graph_extract", { conversationId: conv.id });
254
- enqueueMemoryJob("conversation_analyze", { conversationId: conv.id });
254
+ enqueueMemoryJob("media_processing", { conversationId: conv.id });
255
255
 
256
256
  deleteConversation(conv.id);
257
257
 
@@ -281,7 +281,7 @@ describe("messages lexical-index dual-write", () => {
281
281
  // The sweep is scoped to the plugin's own job types: host-owned jobs —
282
282
  // including the purge the delete primitive itself enqueued — stay
283
283
  // runnable.
284
- expect(jobStatus("conversation_analyze")).toBe("pending");
284
+ expect(jobStatus("media_processing")).toBe("pending");
285
285
  expect(jobStatus("purge_conversation_lexical")).toBe("pending");
286
286
  });
287
287
 
@@ -928,7 +928,6 @@ describe("resolveCallSiteConfig", () => {
928
928
  "heartbeatAgent",
929
929
  "filingAgent",
930
930
  "compactionAgent",
931
- "analyzeConversation",
932
931
  "callAgent",
933
932
  "memoryExtraction",
934
933
  "memoryConsolidation",
@@ -35,7 +35,6 @@ function seedConversation(): void {
35
35
  updatedAt: now,
36
36
  source: "test",
37
37
  conversationType: "default",
38
- memoryScopeId: "default",
39
38
  })
40
39
  .run();
41
40
  }
@@ -70,7 +70,6 @@ function insertPlaybookGraphNode(
70
70
  priority: number;
71
71
  fidelity: string;
72
72
  significance: number;
73
- scopeId: string;
74
73
  statement: string;
75
74
  }> = {},
76
75
  ): string {
@@ -83,7 +82,6 @@ function insertPlaybookGraphNode(
83
82
  const priority = overrides.priority ?? 0;
84
83
  const fidelity = overrides.fidelity ?? "vivid";
85
84
  const significance = overrides.significance ?? 0.8;
86
- const scopeId = overrides.scopeId ?? "default";
87
85
 
88
86
  const statement =
89
87
  overrides.statement ??
@@ -112,8 +110,8 @@ function insertPlaybookGraphNode(
112
110
  id, content, type, created, last_accessed, last_consolidated,
113
111
  emotional_charge, fidelity, confidence, significance,
114
112
  stability, reinforcement_count, last_reinforced,
115
- source_conversations, source_type, scope_id
116
- ) VALUES (?, ?, 'semantic', ?, ?, ?, ?, ?, 0.95, ?, 14, 0, ?, ?, 'direct', ?)`,
113
+ source_conversations, source_type
114
+ ) VALUES (?, ?, 'semantic', ?, ?, ?, ?, ?, 0.95, ?, 14, 0, ?, ?, 'direct')`,
117
115
  [
118
116
  id,
119
117
  content,
@@ -125,7 +123,6 @@ function insertPlaybookGraphNode(
125
123
  significance,
126
124
  now,
127
125
  sourceConversations,
128
- scopeId,
129
126
  ],
130
127
  );
131
128
 
@@ -325,27 +322,6 @@ describe("compilePlaybooks", () => {
325
322
  expect(result.text).not.toContain("deleted");
326
323
  });
327
324
 
328
- test("scopes playbooks by scopeId", () => {
329
- insertPlaybookGraphNode({
330
- trigger: "default scope",
331
- action: "yes",
332
- scopeId: "default",
333
- });
334
- insertPlaybookGraphNode({
335
- trigger: "other scope",
336
- action: "no",
337
- scopeId: "workspace-2",
338
- });
339
-
340
- const defaultResult = compilePlaybooks();
341
- expect(defaultResult.includedCount).toBe(1);
342
- expect(defaultResult.text).toContain("default scope");
343
-
344
- const otherResult = compilePlaybooks({ scopeId: "workspace-2" });
345
- expect(otherResult.includedCount).toBe(1);
346
- expect(otherResult.text).toContain("other scope");
347
- });
348
-
349
325
  test("skips rows with unparseable statements", () => {
350
326
  insertPlaybookGraphNode({ trigger: "good", action: "ok" });
351
327
  // Insert a row with corrupted statement
@@ -88,7 +88,6 @@ const BASELINE: Record<string, readonly string[]> = {
88
88
  "../../../../../persistence/raw-query.js",
89
89
  "../../../../../persistence/schema/index.js",
90
90
  "../../../../../security/untrusted-content.js",
91
- "../../../../../util/logger.js",
92
91
  "../../../../../util/platform.js",
93
92
  "../../../../agent/image-optimize.js",
94
93
  "../../../../api/responses/memory-v3-selection-log.js",
@@ -141,7 +140,6 @@ const BASELINE: Record<string, readonly string[]> = {
141
140
  "../../../../util/abort-reasons.js",
142
141
  "../../../../util/errors.js",
143
142
  "../../../../util/log-redact.js",
144
- "../../../../util/logger.js",
145
143
  "../../../../util/platform.js",
146
144
  "../../../../util/process-liveness.js",
147
145
  "../../../../util/retry.js",
@@ -200,9 +198,7 @@ const BASELINE: Record<string, readonly string[]> = {
200
198
  "../../../runtime/agent-wake.js",
201
199
  "../../../runtime/background-job-runner.js",
202
200
  "../../../runtime/capabilities.js",
203
- "../../../runtime/services/auto-analysis-enqueue.js",
204
201
  "../../../runtime/services/auto-analysis-guard.js",
205
- "../../../runtime/services/conversation-analyze-job.js",
206
202
  "../../../runtime/sync/resource-sync-events.js",
207
203
  "../../../tools/registry.js",
208
204
  "../../../tools/types.js",