You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3cd4b1a
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/levelcode-sessions-memory.md
+39-8Lines changed: 39 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,10 +204,14 @@ kind of memory, a correction ("no, use pnpm") or a confirmed approach, is usuall
204
204
(with an absolute date), or says where something lives. Each note has a `kind` (`preference`, `project`,
205
205
`reference`), the note `text`, and `said`: the person's own words, copied from their message.
206
206
-**A note is credited to the person by code, not by the model** (`sessionMemory.groundNote`):
207
-
1.`said` must appear in what the person typed *this run*: their goal (handed over by the host as typed)
208
-
and their ask_user choices and notes. Nothing the agent read counts.
209
-
2. The note must say no more than those words: at least two thirds of its content words must come from
210
-
them (exact, a shared start of four letters or more, or a five-letter stem).
207
+
1.`said` must appear in what the person typed *this run*: their goal, only when they typed it (not a
208
+
diagram Retry, Continue or a resumed goal), and their ask_user choices and notes. Nothing the agent read
209
+
counts.
210
+
2. The note must say what those words say and no more: every content word of the note comes from them
211
+
(exact, a shared start of four letters or more, or a five-letter stem), except a word naming where it
212
+
applies ("repo", "project"); in their order; and each negated as it is in the quote (a not/never counts
213
+
for the next content word in its clause, two cancel, "stop" and "avoid" count as one). Word overlap is
214
+
not enough: "Use npm, never pnpm" has every word of "use pnpm, never npm".
211
215
212
216
A credited note is active at once, even phrased as an order, because the person said it. Any other note is
213
217
still kept and listed, as *unconfirmed*: one Confirm click in the Memory tab makes it active. That is the
@@ -219,14 +223,24 @@ kind of memory, a correction ("no, use pnpm") or a confirmed approach, is usuall
219
223
(`supersedableFacts`). Only the person changes it: `remember` again, `forget`, or the panel.
220
224
-**`MEMORY.md`** gets a "From you" section, each line with the person's words beside it. Every line older
221
225
than a day says how old it is ("9 days old"). The always-on file is capped at 25 notes and 15 facts; the
222
-
rest are named as "…and N more; recall_sessions finds them".
223
-
-**`forget`** removes the best match for a query, only when the request is in the person's own words, and
224
-
tells the agent what it removed so it can say so.
226
+
rest are named as "…and N more; recall_sessions finds them". A note the person confirmed in the Memory tab
227
+
is listed there too, marked "you confirmed it": its quote was never matched to what they typed, so it is not
228
+
shown as theirs (the Memory tab calls such a quote "the agent quoted").
229
+
-**A credited note keeps the words it was credited on.** A later `remember` of the same note that cannot be
230
+
credited does not change its text, its quote or its date.
231
+
-**`forget`** removes the best match for a query only when the person's words (`said`, typed this run) ask for
232
+
something to be forgotten ("forget", not "don't forget"; "remove" or "delete" only beside memory, note,
233
+
rule or preference; "no longer true", "outdated") and name that memory: a word of its text, or of a
234
+
credited note's quote, other than words every memory shares (`sessionMemory.asksToForget`). Otherwise it
235
+
removes nothing and says which memory came closest; the Memory tab's Forget is the way out. It tells the
236
+
agent what it removed, and says so when the store refused the write.
225
237
-**Search Sessions…** (Command Palette, and a search icon in the Sessions panel's title bar): every session
226
238
not in the trash, archived ones included, matched on its title and its whole conversation (all words must
227
239
match), newest first, each with the line it matched. A quick pick, not a field in History: History stays
228
240
the short list of recent work it was cut down to on 2026-08-02 (77d4f13), and this reaches what that list no
229
-
longer shows. Transcripts are read at most 150 at a time and cached by file size and modification time.
241
+
longer shows. Titles come from the index, so every session's is checked at once; conversations are read 50
242
+
at a time (`searchStep`) while the list fills in, matched whole, and cached by file size and modification
243
+
time up to 20 million characters in all. Title matches are ranked first before the list is cut to 40.
230
244
231
245
### Where the shape came from: Claude's desktop app
232
246
@@ -276,6 +290,23 @@ goal is stored, titled, compacted and replayed, and is a separate change.
276
290
277
291
Not run: a real model deciding when to call `remember` (only a scripted one has), the browser edition, Linux.
278
292
293
+
### After review (2026-10-20, macOS, Node 24)
294
+
295
+
The PR review found ten problems, all real. Each fix is its own commit: credit rule (order and negation, every
296
+
word from the quote), a credited note's words kept together, confirmed notes under "From you", the chip only
297
+
when saved, `forget` tied to a request that names the memory, a failed removal reported, typed goals only,
298
+
and Search Sessions over every session and whole conversations, ranked before the cut.
299
+
300
+
-`memoryNotes.test.js` now has 32 cases and `memoryNotesHost.test.js` 14; `scripts/test-extensions.sh`: 133
301
+
files pass after merging develop (#112, #113).
302
+
- 21 single-defect mutations of the fixes, run on a copy with the network refused: all 21 caught (two needed a
303
+
test added).
304
+
-`memory-editor-check.js`: 11 of 11 on a second run. On the first, "History lists the first conversation
305
+
after New Session" timed out (its 15-second wait for the rebuilt panel); nothing in these fixes touches
306
+
History.
307
+
- Still not run: a real model, the browser edition, Linux. The stem rule (a shared five-letter start) can still
308
+
pair two different words ("transaction" and "translate"); order and negation narrow what that can change.
309
+
279
310
---
280
311
281
312
*Store it (spine) · browse it (experience) · **remember it (this doc).** Together: a sessions feature where the project accumulates its own experience — small in every prompt, deep on request, legible and yours, and safe against the repo that would lie to it.*
0 commit comments