Repository navigation
fix(lore-memory): rotate session-start notes that do not all fit - #418
Merged
Merged
Conversation
With more notes in scope than the 10 slots, recall's order picked the same notes every session and the rest never reached an agent: in the owner's BeeClean repo 11 of 22 notes were never shown at session start in a week. Notes fewer recent sessions were shown now take the slots first.
A changed or gone note is rarely shown, so ordering by times shown alone moved it ahead of fresh notes. Say in the README that notes rotate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When more distinct notes apply than
NOTE_CAP(10),session_startorders them by how many of the hooks'.lore/shownrecords (kept 7 days) already hold them, fewest first, before the global/repo share is applied. Recall's order breaks ties, so with room for every note nothing changes. The global share (≥4 slots) and the cap are unchanged.Why
Measured on the owner's Mac: in BeeClean (12 repo notes, 10 global in scope) session start showed the same 6 repo notes and 4 globals every session; 11 of 22 notes never appeared, two reached one session all week only via prompt recall. Unanchored notes with equal sources sort newest-first in recall (
recall.rs:149-154), so the oldest were always cut.Test
New
session_start_rotates_notes_that_do_not_all_fit(lorectl hook test): 12 repo + 10 global notes, three session-start runs with different session ids; every run shows 10 notes with ≥4 global, and together they show all 22. On main they show only 10.cargo test --no-fail-fast -p lore-memory -p lorectl -p lore-apppasses; clippy clean.