opencode-self-improvement 0.28.0 → 0.28.1
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/recall/dedupe.ts +10 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-self-improvement",
|
|
3
|
-
"version": "0.28.
|
|
3
|
+
"version": "0.28.1",
|
|
4
4
|
"description": "Durable memory for opencode: remember facts, decisions, and commands across sessions, plus a one-command per-repo setup (/repo-init).",
|
|
5
5
|
"main": "index.ts",
|
|
6
6
|
"exports": {
|
package/src/recall/dedupe.ts
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
// compared as a sorted multiset of literals and a pair that disagrees on
|
|
47
47
|
// them is never a copy.
|
|
48
48
|
import type { Memory } from "../store/model/memory.ts";
|
|
49
|
-
import {
|
|
49
|
+
import { words } from "./score.ts";
|
|
50
50
|
|
|
51
51
|
export const DEDUPE_ENV = "OPENCODE_MEMORY_DEDUP";
|
|
52
52
|
|
|
@@ -121,15 +121,17 @@ function sameDroppedChunks(a: Memory, b: Memory): boolean {
|
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
/**
|
|
124
|
-
* A row's own tokens:
|
|
125
|
-
*
|
|
126
|
-
*
|
|
124
|
+
* A row's own tokens: built DIRECTLY from the content and keyword fields.
|
|
125
|
+
* Never from `haystack()` — the identifier tokenizer (#417) splits a
|
|
126
|
+
* snake_case scope like `auth_token_refresh_policy` into auth/token/refresh/
|
|
127
|
+
* policy, and deleting only the whole scope/type strings left those words
|
|
128
|
+
* standing in for content: two unrelated non-Latin rows in one scope shared
|
|
129
|
+
* a Jaccard-1 metadata vocabulary, cleared MIN_CONTENT on scope tokens alone,
|
|
130
|
+
* and dedup hid one (#421, post-merge report on #417).
|
|
127
131
|
*/
|
|
128
132
|
export function contentTokens(m: Memory): Set<string> {
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
out.delete(m.scope.toLowerCase());
|
|
132
|
-
return out;
|
|
133
|
+
const text = m.content + (m.kw?.length ? ` ${m.kw.join(" ")}` : "");
|
|
134
|
+
return new Set(words(text));
|
|
133
135
|
}
|
|
134
136
|
|
|
135
137
|
function hasPolarity(tokens: Set<string>): boolean {
|