@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
@@ -134,7 +134,6 @@ function seedConversationAndMessage(args: {
134
134
  updatedAt: now,
135
135
  source: args.source,
136
136
  conversationType: args.conversationType,
137
- memoryScopeId: "default",
138
137
  ...(args.totalEstimatedCost != null
139
138
  ? { totalEstimatedCost: args.totalEstimatedCost }
140
139
  : {}),
@@ -5,7 +5,7 @@
5
5
  * DELETE /v1/conversation-starters/:id — remove a conversation starter chip
6
6
  */
7
7
 
8
- import { and, desc, eq, inArray, sql } from "drizzle-orm";
8
+ import { and, desc, eq, inArray } from "drizzle-orm";
9
9
  import { z } from "zod";
10
10
 
11
11
  import {
@@ -55,7 +55,7 @@ export const CONVERSATION_STARTERS_STALE_TTL_MS = 4 * 60 * 60 * 1000;
55
55
  * when generation repeatedly fails or produces 0 valid starters). */
56
56
  const REFRESH_COOLDOWN_MS = 5 * 60 * 1000;
57
57
 
58
- function hasActiveConversationStarterJob(scopeId: string): boolean {
58
+ function hasActiveConversationStarterJob(): boolean {
59
59
  const memoryDb = getMemoryDb();
60
60
  if (!memoryDb) return false;
61
61
  return (
@@ -66,7 +66,6 @@ function hasActiveConversationStarterJob(scopeId: string): boolean {
66
66
  and(
67
67
  eq(memoryJobs.type, "generate_conversation_starters"),
68
68
  inArray(memoryJobs.status, ["pending", "running"]),
69
- sql`json_extract(${memoryJobs.payload}, '$.scopeId') = ${scopeId}`,
70
69
  ),
71
70
  )
72
71
  .get() != null
@@ -161,7 +160,6 @@ function handleListConversationStarters({
161
160
  }: RouteHandlerArgs) {
162
161
  const limitParam = Math.min(Math.max(1, Number(queryParams.limit ?? 4)), 20);
163
162
  const offsetParam = Math.max(0, Number(queryParams.offset ?? 0));
164
- const scopeId = queryParams.scope_id ?? "default";
165
163
 
166
164
  const db = getDb();
167
165
 
@@ -174,12 +172,7 @@ function handleListConversationStarters({
174
172
  batch: conversationStarters.generationBatch,
175
173
  })
176
174
  .from(conversationStarters)
177
- .where(
178
- and(
179
- eq(conversationStarters.scopeId, scopeId),
180
- eq(conversationStarters.cardType, "chip"),
181
- ),
182
- )
175
+ .where(eq(conversationStarters.cardType, "chip"))
183
176
  .orderBy(
184
177
  desc(conversationStarters.generationBatch),
185
178
  desc(conversationStarters.createdAt),
@@ -194,20 +187,20 @@ function handleListConversationStarters({
194
187
  const total = validItems.length;
195
188
 
196
189
  if (allItems.length > 0) {
197
- const totalActive = countActiveMemoryNodes(scopeId);
190
+ const totalActive = countActiveMemoryNodes();
198
191
  const lastCount = parseCheckpointInt(
199
- getCheckpointValue(checkpointKey(CK_ITEM_COUNT, scopeId)),
192
+ getCheckpointValue(checkpointKey(CK_ITEM_COUNT)),
200
193
  );
201
194
  const lastGenAt = parseCheckpointInt(
202
- getCheckpointValue(checkpointKey(CK_LAST_GEN_AT, scopeId)),
195
+ getCheckpointValue(checkpointKey(CK_LAST_GEN_AT)),
203
196
  );
204
197
  const staleByAge =
205
198
  lastGenAt == null ||
206
199
  Date.now() - lastGenAt >= CONVERSATION_STARTERS_STALE_TTL_MS;
207
200
  const checkpointAhead = lastCount != null && totalActive < lastCount;
208
- let hasActiveJob = hasActiveConversationStarterJob(scopeId);
201
+ let hasActiveJob = hasActiveConversationStarterJob();
209
202
  const lastAttemptAt = parseCheckpointInt(
210
- getCheckpointValue(checkpointKey(CK_LAST_ATTEMPT_AT, scopeId)),
203
+ getCheckpointValue(checkpointKey(CK_LAST_ATTEMPT_AT)),
211
204
  );
212
205
  const withinCooldown =
213
206
  lastAttemptAt != null && Date.now() - lastAttemptAt < REFRESH_COOLDOWN_MS;
@@ -218,7 +211,7 @@ function handleListConversationStarters({
218
211
  (invalidItemCount > 0 && totalActive > 0));
219
212
 
220
213
  if (shouldRefresh && !hasActiveJob && isMemoryEnabled()) {
221
- enqueueMemoryJob("generate_conversation_starters", { scopeId });
214
+ enqueueMemoryJob("generate_conversation_starters", {});
222
215
  hasActiveJob = true;
223
216
  }
224
217
 
@@ -231,16 +224,16 @@ function handleListConversationStarters({
231
224
  };
232
225
  }
233
226
 
234
- const memoryCount = countActiveMemoryNodes(scopeId);
227
+ const memoryCount = countActiveMemoryNodes();
235
228
 
236
229
  if (memoryCount === 0) {
237
230
  return { starters: [], total: 0, status: "empty" };
238
231
  }
239
232
 
240
- const existing = hasActiveConversationStarterJob(scopeId);
233
+ const existing = hasActiveConversationStarterJob();
241
234
 
242
235
  if (!existing && isMemoryEnabled()) {
243
- enqueueMemoryJob("generate_conversation_starters", { scopeId });
236
+ enqueueMemoryJob("generate_conversation_starters", {});
244
237
  }
245
238
 
246
239
  return { starters: [], total: 0, status: "generating" };
@@ -307,10 +300,6 @@ export const ROUTES: RouteDefinition[] = [
307
300
  type: "integer",
308
301
  description: "Pagination offset (default 0)",
309
302
  },
310
- {
311
- name: "scope_id",
312
- description: 'Scope ID (default "default")',
313
- },
314
303
  ],
315
304
  responseBody: z.object({
316
305
  starters: z
@@ -42,7 +42,6 @@ import { ROUTES as CONSOLIDATION_ROUTES } from "./consolidation-routes.js";
42
42
  import { CONTACT_PROMPT_ROUTES } from "./contact-prompt-routes.js";
43
43
  import { ROUTES as CONTACT_ROUTES } from "./contact-routes.js";
44
44
  import { ROUTES as CONTENT_SOURCE_ROUTES } from "./content-source-routes.js";
45
- import { ROUTES as CONVERSATION_ANALYSIS_ROUTES } from "./conversation-analysis-routes.js";
46
45
  import { ROUTES as CONVERSATION_ATTENTION_ROUTES } from "./conversation-attention-routes.js";
47
46
  import { ROUTES as CONVERSATION_CLI_ROUTES } from "./conversation-cli-routes.js";
48
47
  import { ROUTES as CONVERSATION_COMPACTION_ROUTES } from "./conversation-compaction-routes.js";
@@ -182,7 +181,6 @@ export const ROUTES: RouteDefinition[] = [
182
181
  ...CONTENT_SOURCE_ROUTES,
183
182
  ...CONTACT_PROMPT_ROUTES,
184
183
  ...CONTACT_ROUTES,
185
- ...CONVERSATION_ANALYSIS_ROUTES,
186
184
  ...CONVERSATION_ATTENTION_ROUTES,
187
185
  ...CONVERSATION_CLI_ROUTES,
188
186
  ...CONVERSATION_LIST_ROUTES,
@@ -7,10 +7,7 @@ mock.module("../../../util/logger.js", () => ({
7
7
  }),
8
8
  }));
9
9
 
10
- import {
11
- AUTO_ANALYSIS_GROUP_ID,
12
- AUTO_ANALYSIS_SOURCE,
13
- } from "../../../persistence/auto-analysis-constants.js";
10
+ import { AUTO_ANALYSIS_SOURCE } from "../../../persistence/auto-analysis-constants.js";
14
11
  import { createConversation } from "../../../persistence/conversation-crud.js";
15
12
  import { getDb } from "../../../persistence/db-connection.js";
16
13
  import { initializeDb } from "../../../persistence/db-init.js";
@@ -27,10 +24,6 @@ describe("auto-analysis constants", () => {
27
24
  test("AUTO_ANALYSIS_SOURCE is the canonical 'auto-analysis' string", () => {
28
25
  expect(AUTO_ANALYSIS_SOURCE).toBe("auto-analysis");
29
26
  });
30
-
31
- test("AUTO_ANALYSIS_GROUP_ID is 'system:background' so reflections render as a background sub-group", () => {
32
- expect(AUTO_ANALYSIS_GROUP_ID).toBe("system:background");
33
- });
34
27
  });
35
28
 
36
29
  describe("isAutoAnalysisConversation", () => {
@@ -34,7 +34,6 @@ function makeConversationRow(
34
34
  slackContextCompactionWatermarkAt: null,
35
35
  conversationType: "background",
36
36
  source: "task",
37
- memoryScopeId: "default",
38
37
  originChannel: null,
39
38
  originInterface: null,
40
39
  forkParentConversationId: null,
@@ -2,11 +2,11 @@ import { AUTO_ANALYSIS_SOURCE } from "../../persistence/auto-analysis-constants.
2
2
  import { getConversationSource } from "../../persistence/conversation-crud.js";
3
3
 
4
4
  /**
5
- * Returns true if the conversation's `source` column is `"auto-analysis"`,
6
- * meaning it was produced by the auto-analysis loop. Callers use this to
7
- * skip both `graph_extract` and `conversation_analyze` enqueues so we
8
- * never (a) analyze our own analysis output or (b) extract memory from
9
- * reflective musings (the analysis agent writes memory directly via tools).
5
+ * Returns true if the conversation's `source` column is `"auto-analysis"`.
6
+ * The retired auto-analysis feature produced such conversations; rows
7
+ * persist on existing installs. Callers skip memory/graph extraction for
8
+ * them — the analysis agent wrote memory directly via tools, so extracting
9
+ * from its reflective musings would double-count.
10
10
  */
11
11
  export function isAutoAnalysisConversation(conversationId: string): boolean {
12
12
  return getConversationSource(conversationId) === AUTO_ANALYSIS_SOURCE;
@@ -2,9 +2,8 @@
2
2
  * Standalone helpers for serializing conversation summaries and detail
3
3
  * responses.
4
4
  *
5
- * Extracted from RuntimeHttpServer so that route handlers (e.g.
6
- * conversation-analysis-routes) can build detail responses without
7
- * depending on the server class.
5
+ * Extracted from RuntimeHttpServer so that route handlers can build
6
+ * detail responses without depending on the server class.
8
7
  */
9
8
 
10
9
  import { parseChannelId } from "../../channels/types.js";
package/src/tasks/SPEC.md CHANGED
@@ -57,27 +57,20 @@ room to extend later (e.g., multi-step chains, tool-enabled tasks).
57
57
 
58
58
  ---
59
59
 
60
- ## 2. Memory Isolation Policy
60
+ ## 2. Memory Policy
61
61
 
62
- Each task's memory is scoped by its task ID:
63
-
64
- ```
65
- scope_id = "task:{task_id}"
66
- ```
62
+ Task runs share the single workspace memory pool — the same memory the user's
63
+ main conversations read and write. There is no per-task memory isolation.
67
64
 
68
65
  This means:
69
66
 
70
- - **Cross-run learning**: All runs of the same task share the same memory
71
- scope. The LLM can accumulate knowledge about the task across invocations
72
- (e.g., learning the user's preferred summary style over time).
73
- - **Isolation from default scope**: Task memory is completely separate from the
74
- user's main conversation memory (`scope_id = "default"`). A task cannot read
75
- or pollute the user's chat history, and vice versa.
76
- - **Per-task boundaries**: Different tasks have different scopes and cannot see
77
- each other's memory.
78
-
79
- This follows the same explicit `scope_id` isolation model used by workspace
80
- memory (`default`, `_pkb_workspace`) and subagent memory (`subagent:{id}`).
67
+ - **Cross-run learning**: All runs of a task draw from and contribute to the
68
+ shared workspace memory, so the assistant can accumulate knowledge relevant
69
+ to a task across invocations (e.g., learning the user's preferred summary
70
+ style over time).
71
+ - **Shared context**: A run can use what the assistant already knows from the
72
+ user's chat history, and what a run records is available to later
73
+ conversations and other tasks.
81
74
 
82
75
  ---
83
76
 
@@ -1,20 +1,17 @@
1
1
  import { readFileSync } from "node:fs";
2
2
 
3
3
  import { getConfig } from "../config/loader.js";
4
- import { bridgeCesApproval } from "../credential-execution/approval-bridge.js";
5
4
  import { PermissionPrompter } from "../permissions/prompter.js";
6
5
  import { RiskLevel } from "../permissions/types.js";
7
- import { getCesClient } from "../security/secure-keys.js";
8
6
  import { TokenExpiredError } from "../security/token-manager.js";
9
7
  import {
10
- recordToolDenied,
11
8
  recordToolError,
12
9
  recordToolExecuted,
13
10
  } from "../telemetry/tool-audit.js";
14
11
  import { type AbortReason, isAbortReason } from "../util/abort-reasons.js";
15
12
  import { PermissionDeniedError, ToolError } from "../util/errors.js";
16
13
  import { pathExists, safeStatSync } from "../util/fs.js";
17
- import { getLogger, truncateForLog } from "../util/logger.js";
14
+ import { truncateForLog } from "../util/logger.js";
18
15
  import {
19
16
  callerOwnsWorkflowRun,
20
17
  manifestGrantsSideEffects,
@@ -31,8 +28,6 @@ import { resolveToolInvocationAlias } from "./tool-name-aliases.js";
31
28
  import { recordToolCompletion } from "./tool-profiler.js";
32
29
  import { type ToolContext, type ToolExecutionResult } from "./types.js";
33
30
 
34
- const log = getLogger("tool-executor");
35
-
36
31
  export class ToolExecutor {
37
32
  private prompter: PermissionPrompter;
38
33
  private permissionChecker: PermissionChecker;
@@ -234,102 +229,6 @@ export class ToolExecutor {
234
229
  name,
235
230
  );
236
231
 
237
- // CES approval bridge: if the tool returned an approval_required
238
- // indicator, present the proposal to the guardian via the existing
239
- // confirmation transport, commit the decision to CES, and retry
240
- // the original tool invocation with the granted grantId.
241
- const cesClient = getCesClient();
242
- if (execResult.cesApprovalRequired && !cesClient) {
243
- const msg = `CES approval required for "${name}" but no CES client is available. Ensure the Credential Execution Service is running.`;
244
- const durationMs = Date.now() - startTime;
245
- recordToolError({
246
- conversationId: context.conversationId,
247
- requestId: context.requestId,
248
- toolName: name,
249
- input,
250
- errorMessage: msg,
251
- isExpected: true,
252
- riskLevel,
253
- matchedTrustRuleId: permMatchedTrustRuleId,
254
- durationMs,
255
- attribution: context.attribution ?? null,
256
- });
257
- recordToolCompletion(context.conversationId, name, durationMs, true);
258
- return { content: msg, isError: true };
259
- }
260
- if (execResult.cesApprovalRequired && cesClient) {
261
- const bridgeResult = await bridgeCesApproval(
262
- execResult.cesApprovalRequired,
263
- this.prompter,
264
- cesClient,
265
- {
266
- isInteractive: context.isInteractive,
267
- conversationId: context.conversationId,
268
- signal: context.signal,
269
- },
270
- );
271
-
272
- if (bridgeResult.outcome === "approved") {
273
- // Retry the original tool invocation with the grantId attached.
274
- // The CES tool implementations accept grantId in the input to
275
- // bypass the approval check on the retry.
276
- const retryInput = { ...input, grantId: bridgeResult.grantId };
277
-
278
- log.info(
279
- {
280
- toolName: name,
281
- grantId: bridgeResult.grantId,
282
- conversationId: context.conversationId,
283
- },
284
- "CES approval granted - retrying tool invocation with grantId",
285
- );
286
-
287
- execResult = await executeWithTimeout(
288
- tool.execute(retryInput, execContext),
289
- toolTimeoutMs,
290
- name,
291
- );
292
- } else if (
293
- bridgeResult.outcome === "denied" ||
294
- bridgeResult.outcome === "timeout"
295
- ) {
296
- const denialReason =
297
- bridgeResult.outcome === "timeout"
298
- ? `CES approval timed out for "${name}". The tool was not executed.`
299
- : `CES approval denied for "${name}". The tool was not executed.`;
300
- const durationMs = Date.now() - startTime;
301
- recordToolDenied({
302
- conversationId: context.conversationId,
303
- toolName: name,
304
- input,
305
- reason: denialReason,
306
- riskLevel,
307
- matchedTrustRuleId: permMatchedTrustRuleId,
308
- durationMs,
309
- wasPrompted: false,
310
- });
311
- return { content: denialReason, isError: true };
312
- } else {
313
- // bridgeResult.outcome === "error"
314
- const errorMsg = `CES approval bridge error for "${name}": ${bridgeResult.message}`;
315
- const durationMs = Date.now() - startTime;
316
- recordToolError({
317
- conversationId: context.conversationId,
318
- requestId: context.requestId,
319
- toolName: name,
320
- input,
321
- errorMessage: errorMsg,
322
- isExpected: true,
323
- riskLevel,
324
- matchedTrustRuleId: permMatchedTrustRuleId,
325
- durationMs,
326
- attribution: context.attribution ?? null,
327
- });
328
- recordToolCompletion(context.conversationId, name, durationMs, true);
329
- return { content: errorMsg, isError: true };
330
- }
331
- }
332
-
333
232
  // Sized from the RAW pre-sanitization result — sensitive-output
334
233
  // extraction below strips directives and swaps raw values for
335
234
  // placeholders, which changes the content length, and telemetry must
@@ -3,7 +3,6 @@ import { join, resolve, sep } from "node:path";
3
3
  import { getAppsDir } from "../../apps/app-store.js";
4
4
  import { RiskLevel } from "../../permissions/types.js";
5
5
  import { enqueuePkbIndexJob } from "../../plugins/defaults/memory/jobs/embed-pkb-file.js";
6
- import { PKB_WORKSPACE_SCOPE } from "../../plugins/defaults/memory/pkb/types.js";
7
6
  import { getLogger } from "../../util/logger.js";
8
7
  import { getWorkspaceDir } from "../../util/platform.js";
9
8
  import { FileSystemOps } from "../shared/filesystem/file-ops-service.js";
@@ -160,7 +159,6 @@ export const fileWriteTool = {
160
159
  enqueuePkbIndexJob({
161
160
  pkbRoot,
162
161
  absPath: filePath,
163
- memoryScopeId: PKB_WORKSPACE_SCOPE,
164
162
  });
165
163
  }
166
164
  } catch (err) {
@@ -163,19 +163,6 @@ export interface ToolExecutionResult {
163
163
  isContainerized?: boolean;
164
164
  /** Scope options ladder for the rule editor (narrowest to broadest). */
165
165
  riskScopeOptions?: Array<{ pattern: string; label: string }>;
166
- /**
167
- * When present, indicates that a CES tool returned an `approval_required`
168
- * response. The executor uses the approval bridge to prompt the guardian,
169
- * commit the grant decision to CES, and retry the original tool invocation
170
- * with the granted grantId. CES tools populate this field rather than
171
- * returning a textual error so the executor can intercept and handle the
172
- * approval flow transparently.
173
- *
174
- * Declared as `unknown` here to keep this package free of CES runtime
175
- * imports; the assistant narrows it back to the concrete `ApprovalRequired`
176
- * shape via intersection.
177
- */
178
- cesApprovalRequired?: unknown;
179
166
  }
180
167
 
181
168
  export type ProxyToolResolver = (
@@ -245,8 +232,6 @@ export interface ToolContext {
245
232
  sendToClient?: (msg: { type: string; [key: string]: unknown }) => void;
246
233
  /** True when an interactive client is connected (not just a no-op callback). */
247
234
  isInteractive?: boolean;
248
- /** Memory scope ID from the conversation's memory policy, so memory tools can target the correct scope. */
249
- memoryScopeId?: string;
250
235
  /** When true, tools with side effects should always prompt for confirmation. */
251
236
  forcePromptSideEffects?: boolean;
252
237
  /**
@@ -1,4 +1,3 @@
1
- import type { ApprovalRequired } from "@vellumai/service-contracts/credential-rpc";
2
1
  import { z } from "zod";
3
2
 
4
3
  import type { InterfaceId } from "../channels/types.js";
@@ -112,15 +111,6 @@ export interface ToolExecutionResult {
112
111
  }>;
113
112
  /** Directory scope ladder for the rule editor (narrowest to broadest). */
114
113
  riskDirectoryScopeOptions?: Array<{ scope: string; label: string }>;
115
- /**
116
- * When present, indicates that a CES tool returned an `approval_required`
117
- * response. The executor uses the approval bridge to prompt the guardian,
118
- * commit the grant decision to CES, and retry the original tool invocation
119
- * with the granted grantId. CES tools populate this field rather than
120
- * returning a textual error so the executor can intercept and handle the
121
- * approval flow transparently.
122
- */
123
- cesApprovalRequired?: ApprovalRequired;
124
114
  /** Structured activity metadata for client rendering (web search, web fetch, etc).
125
115
  * Populated by daemon-internal tools; plugins must not set this. */
126
116
  activityMetadata?: ToolActivityMetadata;
@@ -207,7 +207,6 @@ export const recoverConversationsFromDiskViewMigration: WorkspaceMigration = {
207
207
  conversationType: meta.type ?? "standard",
208
208
  originChannel: meta.channel ?? null,
209
209
  source: "user",
210
- memoryScopeId: "default",
211
210
  isAutoTitle: 1,
212
211
  totalInputTokens: 0,
213
212
  totalOutputTokens: 0,
@@ -0,0 +1,59 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
2
+ import { join } from "node:path";
3
+
4
+ import type { WorkspaceMigration } from "./types.js";
5
+
6
+ /**
7
+ * Remove `analyzeConversation` from `llm.callSites` and the top-level
8
+ * `analysis` block from existing config files. The analyze-conversation
9
+ * feature has been removed, so `analyzeConversation` is no longer a valid
10
+ * member of the `LLMCallSiteEnum` and would trigger repeated validation
11
+ * warnings if left on disk; the `analysis` block is unknown to the config
12
+ * schema and would linger as dead cruft.
13
+ */
14
+ export const removeAnalyzeConversationConfigMigration: WorkspaceMigration = {
15
+ id: "129-remove-analyze-conversation-config",
16
+ description:
17
+ "Remove llm.callSites.analyzeConversation and the analysis config block (analyze-conversation feature removed)",
18
+ run(workspaceDir: string): void {
19
+ const configPath = join(workspaceDir, "config.json");
20
+ if (!existsSync(configPath)) return;
21
+
22
+ let config: Record<string, unknown>;
23
+ try {
24
+ const raw = JSON.parse(readFileSync(configPath, "utf-8"));
25
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) return;
26
+ config = raw as Record<string, unknown>;
27
+ } catch {
28
+ return;
29
+ }
30
+
31
+ let mutated = false;
32
+
33
+ if ("analysis" in config) {
34
+ delete config.analysis;
35
+ mutated = true;
36
+ }
37
+
38
+ const llm = config.llm;
39
+ if (llm && typeof llm === "object" && !Array.isArray(llm)) {
40
+ const callSites = (llm as Record<string, unknown>).callSites;
41
+ if (
42
+ callSites &&
43
+ typeof callSites === "object" &&
44
+ !Array.isArray(callSites) &&
45
+ "analyzeConversation" in callSites
46
+ ) {
47
+ delete (callSites as Record<string, unknown>).analyzeConversation;
48
+ mutated = true;
49
+ }
50
+ }
51
+
52
+ if (!mutated) return;
53
+
54
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n");
55
+ },
56
+ down(_workspaceDir: string): void {
57
+ // no-op — keys are obsolete
58
+ },
59
+ };
@@ -126,6 +126,7 @@ import { repointManagedConnectionsToVellumMigration } from "./125-repoint-manage
126
126
  import { stripManagedProfileBodiesMigration } from "./126-strip-managed-profile-bodies.js";
127
127
  import { backfillDefaultProviderMigration } from "./127-backfill-default-provider.js";
128
128
  import { repairStaleOpenrouterGrokModelIdsMigration } from "./128-repair-stale-openrouter-grok-model-ids.js";
129
+ import { removeAnalyzeConversationConfigMigration } from "./129-remove-analyze-conversation-config.js";
129
130
  import { migrateToWorkspaceVolumeMigration } from "./migrate-to-workspace-volume.js";
130
131
  import type { WorkspaceMigration } from "./types.js";
131
132
 
@@ -263,4 +264,5 @@ export const WORKSPACE_MIGRATIONS: WorkspaceMigration[] = [
263
264
  stripManagedProfileBodiesMigration,
264
265
  backfillDefaultProviderMigration,
265
266
  repairStaleOpenrouterGrokModelIdsMigration,
267
+ removeAnalyzeConversationConfigMigration,
266
268
  ];