@vellumai/assistant 0.11.3-dev.202608102016.71d1d5b → 0.11.3-dev.202608102118.f05b131
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/package.json +1 -1
- package/src/plugins/defaults/memory/buffer-format.ts +5 -4
- package/src/plugins/defaults/memory/graph/image-ref-utils.ts +3 -0
- package/src/plugins/defaults/memory/indexer.ts +3 -1
- package/src/plugins/defaults/memory/v1/graph/extraction.ts +3 -1
- package/src/plugins/defaults/memory/v3/prune.ts +2 -0
- package/src/plugins/defaults/memory/v3/selection-log-store.ts +2 -0
package/package.json
CHANGED
|
@@ -37,10 +37,11 @@ export interface BufferEntryStart {
|
|
|
37
37
|
* Anchored at column 0, requiring a space after the dash, and spelling the
|
|
38
38
|
* timestamp with the single spaces {@link formatBufferTimestamp} emits.
|
|
39
39
|
* Everything else in the file is a continuation line belonging to the entry
|
|
40
|
-
* above it, which is how a multiline fact keeps its body: `remember()`
|
|
41
|
-
* the
|
|
42
|
-
* a bullet carrying other bracketed text (a `- [ ]` checklist
|
|
43
|
-
* `- [[wikilink]]` bullet) read as continuation rather than as a new
|
|
40
|
+
* above it, which is how a multiline fact keeps its body: `remember()` writes
|
|
41
|
+
* only the opening line at column 0 and nests the body beneath it. That rule
|
|
42
|
+
* is what makes a bullet carrying other bracketed text (a `- [ ]` checklist
|
|
43
|
+
* item, a `- [[wikilink]]` bullet) read as continuation rather than as a new
|
|
44
|
+
* fact, and it is why a body line can never imitate an opening.
|
|
44
45
|
*
|
|
45
46
|
* Matching the writer's exact shape is the conservative choice in both
|
|
46
47
|
* directions: a line the writer could not have produced stays body text, so an
|
|
@@ -17,6 +17,9 @@ export async function loadImageRefData(
|
|
|
17
17
|
const msg = db
|
|
18
18
|
.select({ content: messages.content })
|
|
19
19
|
.from(messages)
|
|
20
|
+
// No completeness predicate: refs come from the extracted memory graph,
|
|
21
|
+
// and extraction reads finalized rows only, so an unfinalized id cannot
|
|
22
|
+
// reach here. Do not copy this shape for ids with other provenance.
|
|
20
23
|
.where(eq(messages.id, ref.messageId))
|
|
21
24
|
.get();
|
|
22
25
|
if (!msg) {
|
|
@@ -123,7 +123,9 @@ export async function indexMessageNow(
|
|
|
123
123
|
// memory_segments has no cross-file FK to messages, so this call must not
|
|
124
124
|
// leave pieces for a message with no row. Skip early when the source
|
|
125
125
|
// row is already gone, the common case of a backfill job running after the
|
|
126
|
-
// message was deleted.
|
|
126
|
+
// message was deleted. Any-state existence check, deliberately: a
|
|
127
|
+
// streaming row exists, and orphan prevention is about deletion, not
|
|
128
|
+
// completeness. A post-write re-check below closes the narrower window
|
|
127
129
|
// where the delete lands mid-transaction.
|
|
128
130
|
const sourceMessage = getDb()
|
|
129
131
|
.select({ id: messages.id })
|
|
@@ -1365,7 +1365,9 @@ function resolveConversationTimestamp(conversationId: string): number | null {
|
|
|
1365
1365
|
const db = getDb();
|
|
1366
1366
|
// Use the last message timestamp, not the conversation creation time.
|
|
1367
1367
|
// A conversation can span hours/days — memories should be timestamped
|
|
1368
|
-
// to when the relevant content was actually discussed.
|
|
1368
|
+
// to when the relevant content was actually discussed. Any-state read,
|
|
1369
|
+
// deliberately: only `createdAt` is consumed, and a streaming last row
|
|
1370
|
+
// still marks when discussion happened.
|
|
1369
1371
|
const lastMsg = db
|
|
1370
1372
|
.select({ createdAt: messages.createdAt })
|
|
1371
1373
|
.from(messages)
|
|
@@ -293,6 +293,8 @@ export function collectPersistedV3Cards(conversationId: string): Set<string> {
|
|
|
293
293
|
const rows = getSqliteFrom(getDb())
|
|
294
294
|
.query(
|
|
295
295
|
/*sql*/ `
|
|
296
|
+
-- Any-state scan: only metadata markers are read, and the marker is
|
|
297
|
+
-- written by the injection path on rows it owns regardless of state.
|
|
296
298
|
SELECT metadata FROM messages
|
|
297
299
|
WHERE conversation_id = ? AND metadata LIKE '%' || ? || '%'
|
|
298
300
|
`,
|
|
@@ -97,6 +97,8 @@ function forkSourceIdsOf(messageIds: string[]): string[] {
|
|
|
97
97
|
.query(
|
|
98
98
|
/*sql*/ `
|
|
99
99
|
SELECT json_extract(metadata, '$.forkSourceMessageId') AS src
|
|
100
|
+
-- No completeness predicate: ids come from this store's own selection
|
|
101
|
+
-- log, written for rows the injection pipeline already processed.
|
|
100
102
|
FROM messages
|
|
101
103
|
WHERE id IN (${placeholders})
|
|
102
104
|
`,
|