Repository navigation
fix(lore-memory): match prompt notes on topic words, not lesson boilerplate - #420
Merged
Merged
Conversation
…rplate The prompt hook added a note for a prompt when any two of its words met anywhere in the note: the timeline's "claude-code", the "agent ... person wanted" every lesson statement uses, "each" and "make". Pairs now match in the title, body, or lesson only, those words are left out, and one form of each word counts once.
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
Index::search_active_related(the prompt hook'srecall::related, and the report's repeat candidates):topic_words:related_wordswithout the words every lesson statement uses (agent, person, want…) or that say how a rule applies (each, every, make, own), with one form per stem ("lines" and "line" are one);{title body lesson}only, so the timeline ("accepted from claude-code:…") no longer supplies words.Why
Measured on the owner's last 60 real prompts by running
lorectl hook promptagainst a copy of the vault (harness kept privately): the installed build added 23 notes to 14 prompts, about 10 relevant. False ones included "in each pr make sure to add images" → "Give each change its own PR" and "Commit and push every small step", and a resume-formatting prompt → "Never list the agent as a contributor".After: 20 notes to 13 prompts, the same 10 relevant; three false ones gone, none relevant lost. Restricting pairs to title+lesson (dropping receipts) cut to 14 but lost two relevant notes, so receipts stay. The report's repeats on the same archive are unchanged (the "permissions" repeat is still found).
Test
topic_words_drop_lesson_boilerplate_and_fold_word_forms(unit) andrelated_ignores_the_words_every_lesson_statement_uses(recall integration: a prompt sharing only agent/person with a note gets nothing, one sharing its topic still matches). The integration test fails on main.fts_relatedquery-shape assertions.cargo test --no-fail-fast -p lore-memory -p lorectlpasses; clippy clean.