Skip to content

fix(lore-memory): match prompt notes on topic words, not lesson boilerplate - #420

Merged
hsusul merged 1 commit into
mainfrom
fix/prompt-recall-lesson-words
Nov 9, 2026
Merged

hsusul merged 1 commit into
mainfrom
fix/prompt-recall-lesson-words

Conversation

@hsusul

@hsusul hsusul commented Nov 9, 2026

Copy link
Copy Markdown
Owner

What

Index::search_active_related (the prompt hook's recall::related, and the report's repeat candidates):

  • reads the text's words through a new topic_words: related_words without 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);
  • matches each word pair in {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 prompt against 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) and related_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.
  • Updated the fts_related query-shape assertions.
  • cargo test --no-fail-fast -p lore-memory -p lorectl passes; clippy clean.

…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.
@hsusul
hsusul merged commit a71d8ee into main Nov 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant