@vellumai/assistant 0.10.7-dev.202607100051.bd9658e → 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.
- package/ARCHITECTURE.md +1 -2
- package/docs/architecture/memory.md +1 -3
- package/openapi.yaml +1 -222
- package/package.json +1 -1
- package/scripts/memory-inspect.ts +2 -8
- package/src/__tests__/approval-routes-http.test.ts +0 -8
- package/src/__tests__/background-workers-disk-pressure.test.ts +4 -2
- package/src/__tests__/compaction-events.test.ts +0 -4
- package/src/__tests__/context-search-memory-source.test.ts +0 -1
- package/src/__tests__/conversation-agent-loop-disk-pressure.test.ts +0 -1
- package/src/__tests__/conversation-agent-loop-inference-profile.test.ts +0 -2
- package/src/__tests__/conversation-agent-loop-overflow.test.ts +0 -2
- package/src/__tests__/conversation-agent-loop.test.ts +0 -4
- package/src/__tests__/conversation-app-control-lifecycle.test.ts +0 -4
- package/src/__tests__/conversation-fork-crud.test.ts +18 -5
- package/src/__tests__/conversation-fork-retrospective.test.ts +483 -0
- package/src/__tests__/conversation-routes-disk-view.test.ts +0 -4
- package/src/__tests__/conversation-store.test.ts +0 -10
- package/src/__tests__/conversation-summarize-up-to.test.ts +0 -4
- package/src/__tests__/graph-extraction-event-date.test.ts +0 -9
- package/src/__tests__/injection-block.test.ts +0 -1
- package/src/__tests__/job-handler-registration-guard.test.ts +0 -1
- package/src/__tests__/lexical-index-dual-write.test.ts +2 -2
- package/src/__tests__/llm-resolver.test.ts +0 -1
- package/src/__tests__/messages-after-tiebreaker.test.ts +0 -1
- package/src/__tests__/playbook-execution.test.ts +2 -26
- package/src/__tests__/plugin-import-boundary-guard.test.ts +0 -4
- package/src/__tests__/plugin-import-boundary-reverse-guard.test.ts +0 -2
- package/src/__tests__/proxy-approval-callback.test.ts +0 -1
- package/src/__tests__/rebuild-index-graph-nodes.test.ts +0 -4
- package/src/__tests__/send-endpoint-busy.test.ts +0 -12
- package/src/__tests__/subagent-fork-spawn.test.ts +0 -37
- package/src/__tests__/task-memory-cleanup.test.ts +0 -11
- package/src/__tests__/voice-scoped-grant-consumer.test.ts +0 -1
- package/src/__tests__/voice-session-bridge.test.ts +0 -56
- package/src/__tests__/workspace-migration-009-backfill-conversation-disk-view.test.ts +0 -1
- package/src/__tests__/workspace-migration-013-repair-conversation-disk-view.test.ts +0 -1
- package/src/__tests__/workspace-migration-028-recover-conversations-from-disk-view.test.ts +0 -1
- package/src/__tests__/workspace-migration-129-remove-analyze-conversation-config.test.ts +190 -0
- package/src/cli/commands/db/repair-step-conversation-backfill.ts +0 -1
- package/src/config/bundled-skills/messaging/tools/messaging-analyze-style.ts +0 -6
- package/src/config/bundled-skills/playbooks/tools/playbook-create.ts +0 -3
- package/src/config/bundled-skills/playbooks/tools/playbook-delete.ts +0 -3
- package/src/config/bundled-skills/playbooks/tools/playbook-list.ts +1 -3
- package/src/config/bundled-skills/playbooks/tools/playbook-update.ts +0 -4
- package/src/config/call-site-defaults.ts +0 -1
- package/src/config/feature-flag-registry.json +0 -16
- package/src/config/schema.ts +0 -3
- package/src/config/schemas/call-site-catalog.ts +0 -6
- package/src/config/schemas/llm.ts +0 -1
- package/src/conversations/job-handlers/summarization.ts +0 -2
- package/src/daemon/conversation-agent-loop-handlers.ts +0 -1
- package/src/daemon/conversation-agent-loop.ts +1 -6
- package/src/daemon/conversation-lifecycle.ts +0 -14
- package/src/daemon/conversation-turn-finalize.ts +0 -1
- package/src/daemon/handlers/shared.ts +1 -2
- package/src/export/transcript-formatter.ts +9 -39
- package/src/home/conversation-starter-checkpoints.ts +9 -5
- package/src/home/job-handlers/conversation-starters.ts +24 -54
- package/src/hooks/types.ts +2 -2
- package/src/ipc/routes/__tests__/memory-v2-backfill.test.ts +5 -7
- package/src/persistence/__tests__/bulk-write-gate.test.ts +165 -0
- package/src/persistence/__tests__/immediate-transaction-guard.test.ts +70 -0
- package/src/persistence/auto-analysis-constants.ts +4 -13
- package/src/persistence/bulk-write-gate.ts +82 -0
- package/src/persistence/conversation-bootstrap.ts +3 -3
- package/src/persistence/conversation-crud.ts +158 -80
- package/src/persistence/conversation-key-store.ts +0 -2
- package/src/persistence/conversation-row-batch-delete.ts +16 -1
- package/src/persistence/conversation-types.ts +12 -1
- package/src/persistence/db-async-query.ts +18 -9
- package/src/persistence/db-connection.ts +20 -4
- package/src/persistence/db-maintenance.ts +78 -6
- package/src/persistence/fork-message-copy.ts +18 -4
- package/src/persistence/jobs-store.ts +3 -86
- package/src/persistence/migrations/323-delete-non-default-memory-scopes.test.ts +148 -0
- package/src/persistence/migrations/323-delete-non-default-memory-scopes.ts +35 -0
- package/src/persistence/schema/conversations.ts +0 -1
- package/src/persistence/schema/memory-core.ts +17 -28
- package/src/persistence/schema/memory-graph.ts +0 -4
- package/src/persistence/schema/tasks.ts +0 -1
- package/src/persistence/steps.ts +2 -0
- package/src/playbooks/playbook-compiler.ts +2 -10
- package/src/plugins/defaults/memory/__tests__/db-maintenance.test.ts +105 -11
- package/src/plugins/defaults/memory/__tests__/jobs-store-enqueue-gate.test.ts +7 -62
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-job.test.ts +47 -5
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-skill-card.test.ts +29 -1
- package/src/plugins/defaults/memory/__tests__/memory-retrospective-startup-cleanup.test.ts +133 -70
- package/src/plugins/defaults/memory/activation-session-store.ts +1 -1
- package/src/plugins/defaults/memory/config.ts +1 -1
- package/src/plugins/defaults/memory/context-search/sources/conversations.ts +1 -1
- package/src/plugins/defaults/memory/context-search/sources/memory-v2.ts +1 -1
- package/src/plugins/defaults/memory/context-search/sources/memory.ts +1 -1
- package/src/plugins/defaults/memory/filing-jobs.ts +1 -1
- package/src/plugins/defaults/memory/fork-conversation-memory.ts +8 -4
- package/src/plugins/defaults/memory/frontmatter.ts +1 -1
- package/src/plugins/defaults/memory/graph/bootstrap.ts +12 -18
- package/src/plugins/defaults/memory/graph/capability-seed.ts +4 -18
- package/src/plugins/defaults/memory/graph/consolidation.ts +7 -14
- package/src/plugins/defaults/memory/graph/conversation-graph-memory.ts +1 -3
- package/src/plugins/defaults/memory/graph/decay.ts +5 -10
- package/src/plugins/defaults/memory/graph/extraction-job.ts +2 -3
- package/src/plugins/defaults/memory/graph/extraction.test.ts +1 -9
- package/src/plugins/defaults/memory/graph/extraction.ts +1 -8
- package/src/plugins/defaults/memory/graph/graph-search.ts +1 -1
- package/src/plugins/defaults/memory/graph/injection.test.ts +0 -1
- package/src/plugins/defaults/memory/graph/injection.ts +1 -1
- package/src/plugins/defaults/memory/graph/narrative.ts +1 -3
- package/src/plugins/defaults/memory/graph/pattern-scan.ts +1 -4
- package/src/plugins/defaults/memory/graph/retriever.test.ts +0 -19
- package/src/plugins/defaults/memory/graph/retriever.ts +6 -14
- package/src/plugins/defaults/memory/graph/scoring.test.ts +0 -1
- package/src/plugins/defaults/memory/graph/store.test.ts +6 -58
- package/src/plugins/defaults/memory/graph/store.ts +5 -43
- package/src/plugins/defaults/memory/graph/tool-handlers.ts +1 -5
- package/src/plugins/defaults/memory/graph/types.ts +0 -3
- package/src/plugins/defaults/memory/hooks/init.ts +1 -1
- package/src/plugins/defaults/memory/indexer.ts +2 -45
- package/src/plugins/defaults/memory/injectors.ts +1 -1
- package/src/plugins/defaults/memory/job-handler-registration.ts +0 -4
- package/src/plugins/defaults/memory/job-handlers/backfill.ts +0 -1
- package/src/plugins/defaults/memory/job-handlers/index-maintenance.ts +1 -1
- package/src/plugins/defaults/memory/job-handlers.ts +5 -9
- package/src/plugins/defaults/memory/jobs/embed-concept-page.ts +1 -1
- package/src/plugins/defaults/memory/jobs-worker.ts +21 -9
- package/src/plugins/defaults/memory/logging.ts +17 -0
- package/src/plugins/defaults/memory/memory-retrospective-constants.ts +10 -7
- package/src/plugins/defaults/memory/memory-retrospective-enqueue.ts +5 -6
- package/src/plugins/defaults/memory/memory-retrospective-fork-boundary.ts +57 -20
- package/src/plugins/defaults/memory/memory-retrospective-job.ts +13 -15
- package/src/plugins/defaults/memory/memory-retrospective-skill-card.ts +2 -2
- package/src/plugins/defaults/memory/memory-retrospective-startup-cleanup.ts +52 -39
- package/src/plugins/defaults/memory/memory-retrospective-trigger-check.ts +1 -1
- package/src/plugins/defaults/memory/pkb/pkb-reconcile.ts +1 -1
- package/src/plugins/defaults/memory/pkb/pkb-search.ts +1 -1
- package/src/plugins/defaults/memory/rerank-local.ts +1 -1
- package/src/plugins/defaults/memory/routes/memory-eval-routes.ts +1 -1
- package/src/plugins/defaults/memory/routes/memory-item-routes.test.ts +0 -1
- package/src/plugins/defaults/memory/routes/memory-item-routes.ts +3 -11
- package/src/plugins/defaults/memory/routes/memory-v2-routes.ts +1 -1
- package/src/plugins/defaults/memory/routes/memory-v3-routes.ts +1 -1
- package/src/plugins/defaults/memory/startup.ts +1 -1
- package/src/plugins/defaults/memory/task-memory-cleanup.ts +1 -1
- package/src/plugins/defaults/memory/v2/backfill-jobs.ts +1 -1
- package/src/plugins/defaults/memory/v2/cli-command-store.ts +1 -1
- package/src/plugins/defaults/memory/v2/consolidation-job.ts +1 -1
- package/src/plugins/defaults/memory/v2/frontmatter-sweep.ts +1 -1
- package/src/plugins/defaults/memory/v2/injection-events.ts +1 -1
- package/src/plugins/defaults/memory/v2/injection.ts +1 -1
- package/src/plugins/defaults/memory/v2/memory-v2-startup.ts +1 -1
- package/src/plugins/defaults/memory/v2/migration.ts +1 -1
- package/src/plugins/defaults/memory/v2/page-index.ts +1 -1
- package/src/plugins/defaults/memory/v2/prompts/consolidation.ts +1 -1
- package/src/plugins/defaults/memory/v2/prompts/router.ts +1 -1
- package/src/plugins/defaults/memory/v2/qdrant.ts +1 -1
- package/src/plugins/defaults/memory/v2/reranker.ts +1 -1
- package/src/plugins/defaults/memory/v2/router.ts +1 -1
- package/src/plugins/defaults/memory/v2/skill-store.ts +1 -1
- package/src/plugins/defaults/memory/v2/sweep-job.ts +1 -1
- package/src/plugins/defaults/memory/v3/candidate-match.ts +1 -1
- package/src/plugins/defaults/memory/v3/dense.ts +1 -1
- package/src/plugins/defaults/memory/v3/injector.ts +1 -1
- package/src/plugins/defaults/memory/v3/maintain-job.ts +1 -1
- package/src/plugins/defaults/memory/v3/orchestrate.ts +1 -1
- package/src/plugins/defaults/memory/v3/pool-select.ts +1 -1
- package/src/plugins/defaults/memory/v3/prune.ts +1 -1
- package/src/plugins/defaults/memory/v3/section-dense-store.ts +1 -1
- package/src/plugins/defaults/memory/v3/shadow-plugin.ts +1 -1
- package/src/plugins/defaults/memory/worker.ts +1 -1
- package/src/runtime/capabilities.ts +1 -1
- package/src/runtime/routes/__tests__/bookmark-routes.test.ts +0 -1
- package/src/runtime/routes/__tests__/conversation-management-routes.test.ts +0 -1
- package/src/runtime/routes/__tests__/conversation-query-routes.test.ts +0 -1
- package/src/runtime/routes/conversation-starter-routes.ts +12 -23
- package/src/runtime/routes/index.ts +0 -2
- package/src/runtime/services/__tests__/auto-analysis-guard.test.ts +1 -8
- package/src/runtime/services/__tests__/conversation-serializer.test.ts +0 -1
- package/src/runtime/services/auto-analysis-guard.ts +5 -5
- package/src/runtime/services/conversation-serializer.ts +2 -3
- package/src/tasks/SPEC.md +10 -17
- package/src/tools/tool-types.ts +0 -2
- package/src/workspace/migrations/028-recover-conversations-from-disk-view.ts +0 -1
- package/src/workspace/migrations/129-remove-analyze-conversation-config.ts +59 -0
- package/src/workspace/migrations/registry.ts +2 -0
- package/src/__tests__/auto-analysis-end-to-end.test.ts +0 -621
- package/src/__tests__/auto-analysis-prompt.test.ts +0 -50
- package/src/__tests__/config-analysis.test.ts +0 -83
- package/src/__tests__/conversation-analysis-routes.test.ts +0 -156
- package/src/config/schemas/analysis.ts +0 -32
- package/src/daemon/__tests__/conversation-lifecycle-auto-analyze.test.ts +0 -449
- package/src/plugins/defaults/memory/__tests__/find-analysis-conversation.test.ts +0 -197
- package/src/runtime/routes/conversation-analysis-routes.ts +0 -75
- package/src/runtime/services/__tests__/analyze-conversation.test.ts +0 -477
- package/src/runtime/services/__tests__/auto-analysis-enqueue.test.ts +0 -386
- package/src/runtime/services/__tests__/auto-analysis-prompt.test.ts +0 -53
- package/src/runtime/services/__tests__/conversation-analyze-job.test.ts +0 -213
- package/src/runtime/services/__tests__/manual-analysis-prompt.test.ts +0 -41
- package/src/runtime/services/analyze-conversation.ts +0 -334
- package/src/runtime/services/auto-analysis-enqueue.ts +0 -130
- package/src/runtime/services/auto-analysis-prompt.ts +0 -55
- package/src/runtime/services/conversation-analyze-job.ts +0 -53
package/ARCHITECTURE.md
CHANGED
|
@@ -857,11 +857,10 @@ graph LR
|
|
|
857
857
|
|
|
858
858
|
subgraph "$VELLUM_WORKSPACE_DIR/data/db/assistant.db (SQLite + WAL)"
|
|
859
859
|
direction TB
|
|
860
|
-
CONV["conversations<br/>───────────────<br/>id, title, timestamps<br/>token counts, estimated cost<br/>context_summary (compaction)<br/>conversation_type: 'standard' | 'background' | 'scheduled'
|
|
860
|
+
CONV["conversations<br/>───────────────<br/>id, title, timestamps<br/>token counts, estimated cost<br/>context_summary (compaction)<br/>conversation_type: 'standard' | 'background' | 'scheduled'"]
|
|
861
861
|
MSG["messages<br/>───────────────<br/>id, conversation_id (FK)<br/>role: user | assistant<br/>content: JSON array<br/>created_at"]
|
|
862
862
|
TOOL["tool_invocations<br/>───────────────<br/>tool_name, input, result<br/>decision, risk_level<br/>duration_ms"]
|
|
863
863
|
SEG["memory_segments<br/>───────────────<br/>Text chunks for retrieval<br/>Linked to messages<br/>token_estimate per segment"]
|
|
864
|
-
ITEMS["memory_items<br/>───────────────<br/>Extracted facts/entities<br/>kind, subject, statement<br/>confidence, fingerprint (dedup)<br/>verification_state, scope_id<br/>first/last seen timestamps"]
|
|
865
864
|
SUM["memory_summaries<br/>───────────────<br/>scope: conversation | weekly<br/>Compressed history for context<br/>window management"]
|
|
866
865
|
EMB["memory_embeddings<br/>───────────────<br/>target: segment | item | summary<br/>provider + model metadata<br/>vector_json (float array)<br/>Powers semantic search"]
|
|
867
866
|
JOBS["memory_jobs<br/>───────────────<br/>Async task queue<br/>Types: embed, extract,<br/>summarize, backfill, cleanup<br/>Status: pending → running →<br/>completed | failed"]
|
|
@@ -155,7 +155,6 @@ graph TB
|
|
|
155
155
|
EMBED_Q["Generate dense + sparse<br/>query embeddings"]
|
|
156
156
|
HYBRID["Hybrid Search<br/>dense + sparse RRF on Qdrant"]
|
|
157
157
|
MERGE["Merge + Deduplicate<br/>weighted score combination"]
|
|
158
|
-
SCOPE["Scope Filter<br/>scope_id filtering<br/>(strict | global_fallback)<br/>Subagents: own scope + 'default'"]
|
|
159
158
|
TIER["Tier Classification<br/>score > 0.8 → tier 1<br/>score > 0.6 → tier 2<br/>below → dropped"]
|
|
160
159
|
STALE["Staleness Computation<br/>kind-specific lifetimes<br/>+ reinforcement from<br/>source conversation count"]
|
|
161
160
|
DEMOTE["Stale Demotion<br/>very_stale tier 1 → tier 2"]
|
|
@@ -215,8 +214,7 @@ graph TB
|
|
|
215
214
|
EMBED_Q --> SPARSE_GEN
|
|
216
215
|
EMBED_Q --> HYBRID
|
|
217
216
|
HYBRID --> RRF
|
|
218
|
-
HYBRID -->
|
|
219
|
-
SCOPE --> MERGE
|
|
217
|
+
HYBRID --> MERGE
|
|
220
218
|
MERGE --> TIER
|
|
221
219
|
TIER --> STALE
|
|
222
220
|
STALE --> DEMOTE
|
package/openapi.yaml
CHANGED
|
@@ -6143,12 +6143,6 @@ paths:
|
|
|
6143
6143
|
schema:
|
|
6144
6144
|
type: integer
|
|
6145
6145
|
description: Pagination offset (default 0)
|
|
6146
|
-
- name: scope_id
|
|
6147
|
-
in: query
|
|
6148
|
-
required: false
|
|
6149
|
-
schema:
|
|
6150
|
-
type: string
|
|
6151
|
-
description: Scope ID (default "default")
|
|
6152
6146
|
responses:
|
|
6153
6147
|
"200":
|
|
6154
6148
|
description: Successful response
|
|
@@ -6858,221 +6852,6 @@ paths:
|
|
|
6858
6852
|
required:
|
|
6859
6853
|
- conversation
|
|
6860
6854
|
additionalProperties: false
|
|
6861
|
-
/v1/conversations/{id}/analyze:
|
|
6862
|
-
post:
|
|
6863
|
-
operationId: conversations_by_id_analyze_post
|
|
6864
|
-
summary: Analyze a conversation
|
|
6865
|
-
description: Create a new conversation with a structured self-assessment of an existing conversation.
|
|
6866
|
-
tags:
|
|
6867
|
-
- conversations
|
|
6868
|
-
parameters:
|
|
6869
|
-
- name: id
|
|
6870
|
-
in: path
|
|
6871
|
-
required: true
|
|
6872
|
-
schema:
|
|
6873
|
-
type: string
|
|
6874
|
-
responses:
|
|
6875
|
-
"200":
|
|
6876
|
-
description: Successful response
|
|
6877
|
-
content:
|
|
6878
|
-
application/json:
|
|
6879
|
-
schema:
|
|
6880
|
-
type: object
|
|
6881
|
-
properties:
|
|
6882
|
-
conversation:
|
|
6883
|
-
type: object
|
|
6884
|
-
properties:
|
|
6885
|
-
id:
|
|
6886
|
-
type: string
|
|
6887
|
-
title:
|
|
6888
|
-
type: string
|
|
6889
|
-
createdAt:
|
|
6890
|
-
type: number
|
|
6891
|
-
updatedAt:
|
|
6892
|
-
type: number
|
|
6893
|
-
lastMessageAt:
|
|
6894
|
-
anyOf:
|
|
6895
|
-
- type: number
|
|
6896
|
-
- type: "null"
|
|
6897
|
-
conversationType:
|
|
6898
|
-
type: string
|
|
6899
|
-
enum:
|
|
6900
|
-
- standard
|
|
6901
|
-
- background
|
|
6902
|
-
- scheduled
|
|
6903
|
-
source:
|
|
6904
|
-
type: string
|
|
6905
|
-
scheduleJobId:
|
|
6906
|
-
type: string
|
|
6907
|
-
channelBinding:
|
|
6908
|
-
type: object
|
|
6909
|
-
properties:
|
|
6910
|
-
sourceChannel:
|
|
6911
|
-
type: string
|
|
6912
|
-
externalChatId:
|
|
6913
|
-
type: string
|
|
6914
|
-
externalChatName:
|
|
6915
|
-
type: string
|
|
6916
|
-
externalThreadId:
|
|
6917
|
-
type: string
|
|
6918
|
-
externalUserId:
|
|
6919
|
-
anyOf:
|
|
6920
|
-
- type: string
|
|
6921
|
-
- type: "null"
|
|
6922
|
-
displayName:
|
|
6923
|
-
anyOf:
|
|
6924
|
-
- type: string
|
|
6925
|
-
- type: "null"
|
|
6926
|
-
username:
|
|
6927
|
-
anyOf:
|
|
6928
|
-
- type: string
|
|
6929
|
-
- type: "null"
|
|
6930
|
-
slackThread:
|
|
6931
|
-
type: object
|
|
6932
|
-
properties:
|
|
6933
|
-
channelId:
|
|
6934
|
-
type: string
|
|
6935
|
-
threadTs:
|
|
6936
|
-
type: string
|
|
6937
|
-
link:
|
|
6938
|
-
type: object
|
|
6939
|
-
properties:
|
|
6940
|
-
appUrl:
|
|
6941
|
-
type: string
|
|
6942
|
-
webUrl:
|
|
6943
|
-
type: string
|
|
6944
|
-
additionalProperties: false
|
|
6945
|
-
required:
|
|
6946
|
-
- channelId
|
|
6947
|
-
- threadTs
|
|
6948
|
-
additionalProperties: false
|
|
6949
|
-
slackChannel:
|
|
6950
|
-
type: object
|
|
6951
|
-
properties:
|
|
6952
|
-
channelId:
|
|
6953
|
-
type: string
|
|
6954
|
-
name:
|
|
6955
|
-
type: string
|
|
6956
|
-
link:
|
|
6957
|
-
type: object
|
|
6958
|
-
properties:
|
|
6959
|
-
webUrl:
|
|
6960
|
-
type: string
|
|
6961
|
-
required:
|
|
6962
|
-
- webUrl
|
|
6963
|
-
additionalProperties: false
|
|
6964
|
-
required:
|
|
6965
|
-
- channelId
|
|
6966
|
-
additionalProperties: false
|
|
6967
|
-
sourceLink:
|
|
6968
|
-
type: object
|
|
6969
|
-
properties:
|
|
6970
|
-
appUrl:
|
|
6971
|
-
type: string
|
|
6972
|
-
webUrl:
|
|
6973
|
-
type: string
|
|
6974
|
-
additionalProperties: false
|
|
6975
|
-
required:
|
|
6976
|
-
- sourceChannel
|
|
6977
|
-
- externalChatId
|
|
6978
|
-
- externalUserId
|
|
6979
|
-
- displayName
|
|
6980
|
-
- username
|
|
6981
|
-
additionalProperties: false
|
|
6982
|
-
conversationOriginChannel:
|
|
6983
|
-
anyOf:
|
|
6984
|
-
- type: string
|
|
6985
|
-
enum:
|
|
6986
|
-
- telegram
|
|
6987
|
-
- phone
|
|
6988
|
-
- vellum
|
|
6989
|
-
- whatsapp
|
|
6990
|
-
- slack
|
|
6991
|
-
- email
|
|
6992
|
-
- platform
|
|
6993
|
-
- a2a
|
|
6994
|
-
- type: "null"
|
|
6995
|
-
assistantAttention:
|
|
6996
|
-
type: object
|
|
6997
|
-
properties:
|
|
6998
|
-
hasUnseenLatestAssistantMessage:
|
|
6999
|
-
type: boolean
|
|
7000
|
-
latestAssistantMessageAt:
|
|
7001
|
-
type: number
|
|
7002
|
-
lastSeenAssistantMessageAt:
|
|
7003
|
-
type: number
|
|
7004
|
-
lastSeenConfidence:
|
|
7005
|
-
type: string
|
|
7006
|
-
enum:
|
|
7007
|
-
- explicit
|
|
7008
|
-
- inferred
|
|
7009
|
-
lastSeenSignalType:
|
|
7010
|
-
type: string
|
|
7011
|
-
enum:
|
|
7012
|
-
- macos_notification_view
|
|
7013
|
-
- macos_conversation_opened
|
|
7014
|
-
- ios_conversation_opened
|
|
7015
|
-
- web_bulk_mark_read
|
|
7016
|
-
- telegram_inbound_message
|
|
7017
|
-
- telegram_callback
|
|
7018
|
-
- slack_inbound_message
|
|
7019
|
-
- slack_callback
|
|
7020
|
-
required:
|
|
7021
|
-
- hasUnseenLatestAssistantMessage
|
|
7022
|
-
additionalProperties: false
|
|
7023
|
-
isPinned:
|
|
7024
|
-
type: boolean
|
|
7025
|
-
const: true
|
|
7026
|
-
displayOrder:
|
|
7027
|
-
anyOf:
|
|
7028
|
-
- type: number
|
|
7029
|
-
- type: "null"
|
|
7030
|
-
groupId:
|
|
7031
|
-
anyOf:
|
|
7032
|
-
- type: string
|
|
7033
|
-
- type: "null"
|
|
7034
|
-
forkParent:
|
|
7035
|
-
type: object
|
|
7036
|
-
properties:
|
|
7037
|
-
conversationId:
|
|
7038
|
-
type: string
|
|
7039
|
-
messageId:
|
|
7040
|
-
type: string
|
|
7041
|
-
title:
|
|
7042
|
-
type: string
|
|
7043
|
-
required:
|
|
7044
|
-
- conversationId
|
|
7045
|
-
- messageId
|
|
7046
|
-
- title
|
|
7047
|
-
additionalProperties: false
|
|
7048
|
-
archivedAt:
|
|
7049
|
-
type: number
|
|
7050
|
-
surfacedAt:
|
|
7051
|
-
type: number
|
|
7052
|
-
inferenceProfile:
|
|
7053
|
-
type: string
|
|
7054
|
-
enabledPlugins:
|
|
7055
|
-
anyOf:
|
|
7056
|
-
- type: array
|
|
7057
|
-
items:
|
|
7058
|
-
type: string
|
|
7059
|
-
- type: "null"
|
|
7060
|
-
isProcessing:
|
|
7061
|
-
type: boolean
|
|
7062
|
-
required:
|
|
7063
|
-
- id
|
|
7064
|
-
- title
|
|
7065
|
-
- createdAt
|
|
7066
|
-
- updatedAt
|
|
7067
|
-
- lastMessageAt
|
|
7068
|
-
- conversationType
|
|
7069
|
-
- source
|
|
7070
|
-
- groupId
|
|
7071
|
-
- isProcessing
|
|
7072
|
-
additionalProperties: false
|
|
7073
|
-
required:
|
|
7074
|
-
- conversation
|
|
7075
|
-
additionalProperties: false
|
|
7076
6855
|
/v1/conversations/{id}/archive:
|
|
7077
6856
|
post:
|
|
7078
6857
|
operationId: conversations_by_id_archive_post
|
|
@@ -16511,7 +16290,7 @@ paths:
|
|
|
16511
16290
|
type: object
|
|
16512
16291
|
properties: {}
|
|
16513
16292
|
additionalProperties: {}
|
|
16514
|
-
description: Memory item with
|
|
16293
|
+
description: Memory item with graph metadata
|
|
16515
16294
|
required:
|
|
16516
16295
|
- item
|
|
16517
16296
|
additionalProperties: false
|
package/package.json
CHANGED
|
@@ -112,12 +112,10 @@ Commands:
|
|
|
112
112
|
// ---------------------------------------------------------------------------
|
|
113
113
|
|
|
114
114
|
function showList() {
|
|
115
|
-
const scopeId = "default";
|
|
116
115
|
const typeIdx = args.indexOf("--type");
|
|
117
116
|
const typeFilter = typeIdx >= 0 ? args[typeIdx + 1] : undefined;
|
|
118
117
|
|
|
119
118
|
const allNodes = queryNodes({
|
|
120
|
-
scopeId,
|
|
121
119
|
fidelityNot: ["gone"],
|
|
122
120
|
limit: 100000,
|
|
123
121
|
});
|
|
@@ -155,10 +153,8 @@ function relativeAge(epochMs: number): string {
|
|
|
155
153
|
}
|
|
156
154
|
|
|
157
155
|
async function showStats() {
|
|
158
|
-
const
|
|
159
|
-
const total = countNodes(scopeId);
|
|
156
|
+
const total = countNodes();
|
|
160
157
|
const allNodes = queryNodes({
|
|
161
|
-
scopeId,
|
|
162
158
|
fidelityNot: ["gone"],
|
|
163
159
|
limit: 100000,
|
|
164
160
|
});
|
|
@@ -178,7 +174,7 @@ async function showStats() {
|
|
|
178
174
|
// Edges are counted twice (once per endpoint), so halve
|
|
179
175
|
totalEdges = Math.floor(totalEdges / 2);
|
|
180
176
|
|
|
181
|
-
console.log(`\n Memory Graph Stats
|
|
177
|
+
console.log(`\n Memory Graph Stats`);
|
|
182
178
|
console.log(` ${"─".repeat(40)}`);
|
|
183
179
|
console.log(` Total nodes: ${total}`);
|
|
184
180
|
console.log(` Total edges: ${totalEdges}`);
|
|
@@ -220,7 +216,6 @@ async function showContextLoad() {
|
|
|
220
216
|
console.log("\n Simulating context load (conversation start)...\n");
|
|
221
217
|
|
|
222
218
|
const result = await loadContextMemory({
|
|
223
|
-
scopeId: "default",
|
|
224
219
|
recentSummaries: [], // No recent summaries for standalone test
|
|
225
220
|
config,
|
|
226
221
|
});
|
|
@@ -385,7 +380,6 @@ async function showTurn(userMessage: string) {
|
|
|
385
380
|
const result = await retrieveForTurn({
|
|
386
381
|
assistantLastMessage: "",
|
|
387
382
|
userLastMessage: userMessage,
|
|
388
|
-
scopeId: "default",
|
|
389
383
|
config,
|
|
390
384
|
tracker,
|
|
391
385
|
});
|
|
@@ -162,10 +162,6 @@ function makeIdleSession(opts?: {
|
|
|
162
162
|
processing = true;
|
|
163
163
|
return { id: options.requestId ?? "msg-1", deduplicated: false };
|
|
164
164
|
},
|
|
165
|
-
memoryPolicy: {
|
|
166
|
-
scopeId: "default",
|
|
167
|
-
includeDefaultFallback: false,
|
|
168
|
-
},
|
|
169
165
|
setChannelCapabilities: () => {},
|
|
170
166
|
setAssistantId: () => {},
|
|
171
167
|
setTrustContext: () => {},
|
|
@@ -229,10 +225,6 @@ function makeConfirmationEmittingSession(opts?: {
|
|
|
229
225
|
processing = true;
|
|
230
226
|
return { id: options.requestId ?? "msg-1", deduplicated: false };
|
|
231
227
|
},
|
|
232
|
-
memoryPolicy: {
|
|
233
|
-
scopeId: "default",
|
|
234
|
-
includeDefaultFallback: false,
|
|
235
|
-
},
|
|
236
228
|
setChannelCapabilities: () => {},
|
|
237
229
|
setAssistantId: () => {},
|
|
238
230
|
setTrustContext: () => {},
|
|
@@ -119,7 +119,6 @@ mock.module("../persistence/conversation-crud.js", () => ({
|
|
|
119
119
|
deletedSummaryIds: [],
|
|
120
120
|
})),
|
|
121
121
|
deleteLastExchange: mock(() => 0),
|
|
122
|
-
findAnalysisConversationFor: mock(() => null),
|
|
123
122
|
forkConversation: mock(() => ({ id: "conv-fork" })),
|
|
124
123
|
forkConversationForRetrospective: mock(async () => ({ id: "conv-fork" })),
|
|
125
124
|
getConversationOverrideProfile: () => undefined,
|
|
@@ -194,14 +193,15 @@ mock.module("../persistence/jobs-store.js", () => ({
|
|
|
194
193
|
MESSAGE_LEXICAL_JOB_TYPES: [],
|
|
195
194
|
resetRunningJobsToPending: mock(() => 0),
|
|
196
195
|
SLOW_LLM_JOB_TYPES: [],
|
|
197
|
-
upsertAutoAnalysisJob: mock(() => "job-auto-analysis"),
|
|
198
196
|
upsertDebouncedJob: mock(() => "job-debounced"),
|
|
199
197
|
upsertMemoryRetrospectiveJob: mock(() => "job-memory-retrospective"),
|
|
200
198
|
}));
|
|
201
199
|
|
|
202
200
|
const mockMaybeRunDbMaintenance = mock(() => {});
|
|
201
|
+
const mockMaybeRunPassiveWalCheckpoint = mock(() => {});
|
|
203
202
|
mock.module("../persistence/db-maintenance.js", () => ({
|
|
204
203
|
maybeRunDbMaintenance: mockMaybeRunDbMaintenance,
|
|
204
|
+
maybeRunPassiveWalCheckpoint: mockMaybeRunPassiveWalCheckpoint,
|
|
205
205
|
}));
|
|
206
206
|
|
|
207
207
|
mock.module("../persistence/cleanup-schedule-state.js", () => ({
|
|
@@ -221,6 +221,7 @@ describe("background workers disk pressure gate", () => {
|
|
|
221
221
|
mockFailStalledJobs.mockClear();
|
|
222
222
|
mockClaimMemoryJobs.mockClear();
|
|
223
223
|
mockMaybeRunDbMaintenance.mockClear();
|
|
224
|
+
mockMaybeRunPassiveWalCheckpoint.mockClear();
|
|
224
225
|
});
|
|
225
226
|
|
|
226
227
|
test("memory jobs worker skips before claiming or maintenance writes", async () => {
|
|
@@ -230,6 +231,7 @@ describe("background workers disk pressure gate", () => {
|
|
|
230
231
|
expect(mockFailStalledJobs).not.toHaveBeenCalled();
|
|
231
232
|
expect(mockClaimMemoryJobs).not.toHaveBeenCalled();
|
|
232
233
|
expect(mockMaybeRunDbMaintenance).not.toHaveBeenCalled();
|
|
234
|
+
expect(mockMaybeRunPassiveWalCheckpoint).not.toHaveBeenCalled();
|
|
233
235
|
});
|
|
234
236
|
|
|
235
237
|
test("workspace heartbeat skips auto-commit checks while locked", async () => {
|
|
@@ -239,10 +239,6 @@ mock.module("../persistence/llm-usage-store.js", () => ({
|
|
|
239
239
|
listUsageEvents: () => [],
|
|
240
240
|
}));
|
|
241
241
|
|
|
242
|
-
mock.module("../runtime/services/auto-analysis-enqueue.js", () => ({
|
|
243
|
-
enqueueAutoAnalysisOnCompaction: () => {},
|
|
244
|
-
}));
|
|
245
|
-
|
|
246
242
|
mock.module("../agent/loop.js", () => ({
|
|
247
243
|
AgentLoop: class {
|
|
248
244
|
compactionCircuit = new CompactionCircuit("test-conv");
|
|
@@ -139,7 +139,6 @@ function makeCtx(overrides: Partial<Context> = {}): Conversation {
|
|
|
139
139
|
contextCompactedAt: null,
|
|
140
140
|
conversationType: "background",
|
|
141
141
|
source: "memory",
|
|
142
|
-
memoryPolicy: { scopeId: "default", includeDefaultFallback: true },
|
|
143
142
|
currentActiveSurfaceId: undefined,
|
|
144
143
|
currentPage: undefined,
|
|
145
144
|
surfaceState: new Map(),
|
|
@@ -452,8 +452,6 @@ function makeCtx(
|
|
|
452
452
|
contextCompactedMessageCount: 0,
|
|
453
453
|
contextCompactedAt: null,
|
|
454
454
|
|
|
455
|
-
memoryPolicy: { scopeId: "default", includeDefaultFallback: true },
|
|
456
|
-
|
|
457
455
|
currentActiveSurfaceId: undefined,
|
|
458
456
|
currentPage: undefined,
|
|
459
457
|
surfaceState: new Map(),
|
|
@@ -620,8 +620,6 @@ function makeCtx(
|
|
|
620
620
|
contextCompactedMessageCount: 0,
|
|
621
621
|
contextCompactedAt: null,
|
|
622
622
|
|
|
623
|
-
memoryPolicy: { scopeId: "default", includeDefaultFallback: true },
|
|
624
|
-
|
|
625
623
|
currentActiveSurfaceId: undefined,
|
|
626
624
|
currentPage: undefined,
|
|
627
625
|
surfaceState: new Map(),
|
|
@@ -755,8 +755,6 @@ function makeCtx(
|
|
|
755
755
|
mockConversationRow?.lastNotifiedInferenceProfile ?? null,
|
|
756
756
|
processingStartedAt: mockConversationRow?.processingStartedAt ?? null,
|
|
757
757
|
|
|
758
|
-
memoryPolicy: { scopeId: "default", includeDefaultFallback: true },
|
|
759
|
-
|
|
760
758
|
currentActiveSurfaceId: undefined,
|
|
761
759
|
currentPage: undefined,
|
|
762
760
|
surfaceState: new Map(),
|
|
@@ -2256,7 +2254,6 @@ describe("session-agent-loop", () => {
|
|
|
2256
2254
|
role: string;
|
|
2257
2255
|
content: string;
|
|
2258
2256
|
createdAt: number;
|
|
2259
|
-
scopeId: string;
|
|
2260
2257
|
},
|
|
2261
2258
|
unknown,
|
|
2262
2259
|
];
|
|
@@ -2266,7 +2263,6 @@ describe("session-agent-loop", () => {
|
|
|
2266
2263
|
conversationId: "test-conv",
|
|
2267
2264
|
role: "assistant",
|
|
2268
2265
|
createdAt: 1234567,
|
|
2269
|
-
scopeId: "default",
|
|
2270
2266
|
});
|
|
2271
2267
|
expect(indexCall.content).toContain("indexed reply");
|
|
2272
2268
|
|
|
@@ -107,10 +107,6 @@ mock.module("../persistence/jobs-store.js", () => ({
|
|
|
107
107
|
enqueueMemoryJob: () => {},
|
|
108
108
|
}));
|
|
109
109
|
|
|
110
|
-
mock.module("../runtime/services/auto-analysis-enqueue.js", () => ({
|
|
111
|
-
enqueueAutoAnalysisIfEnabled: () => {},
|
|
112
|
-
}));
|
|
113
|
-
|
|
114
110
|
mock.module("../runtime/services/auto-analysis-guard.js", () => ({
|
|
115
111
|
isAutoAnalysisConversation: () => false,
|
|
116
112
|
}));
|
|
@@ -476,16 +476,29 @@ describe("forkConversation", () => {
|
|
|
476
476
|
"Message 1",
|
|
477
477
|
{ skipIndexing: true },
|
|
478
478
|
);
|
|
479
|
-
await addMessage(source.id, "assistant", "Message 2", {
|
|
479
|
+
const m2 = await addMessage(source.id, "assistant", "Message 2", {
|
|
480
480
|
skipIndexing: true,
|
|
481
481
|
});
|
|
482
|
-
await addMessage(source.id, "user", "Message 3", {
|
|
482
|
+
const m3 = await addMessage(source.id, "user", "Message 3", {
|
|
483
483
|
skipIndexing: true,
|
|
484
484
|
});
|
|
485
485
|
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
486
|
+
// Pin timestamps so the compaction event sits strictly after every
|
|
487
|
+
// message — same-millisecond inserts would otherwise make the event
|
|
488
|
+
// "at-or-before" the branch point and inherit.
|
|
489
|
+
const db = getDb();
|
|
490
|
+
const base = Date.now();
|
|
491
|
+
db.run(
|
|
492
|
+
`UPDATE messages SET created_at = ${base} WHERE id = '${compactedBranchPoint.id}'`,
|
|
493
|
+
);
|
|
494
|
+
db.run(
|
|
495
|
+
`UPDATE messages SET created_at = ${base + 1} WHERE id = '${m2.id}'`,
|
|
496
|
+
);
|
|
497
|
+
db.run(
|
|
498
|
+
`UPDATE messages SET created_at = ${base + 2} WHERE id = '${m3.id}'`,
|
|
499
|
+
);
|
|
500
|
+
const compactedAt = base + 3;
|
|
501
|
+
db.update(conversations)
|
|
489
502
|
.set({
|
|
490
503
|
contextSummary: "Compacted summary",
|
|
491
504
|
contextCompactedMessageCount: 2,
|