Skip to content

fix: filter Lesson Recall before cutting candidates - #492

Closed
possiblyneal wants to merge 1 commit into
mainfrom
fix/438-scoped-lesson-candidates
Closed

possiblyneal wants to merge 1 commit into
mainfrom
fix/438-scoped-lesson-candidates

Conversation

@possiblyneal

Copy link
Copy Markdown
Owner

Intent

Closes #438

Higher-scoring hits from other projects no longer crowd eligible Lessons out of the candidate window. Global Lessons remain eligible.

Read first

  • src/functions/lessons.ts:58 — prompt-submit Lesson selection filters before cutting the list.
  • src/functions/lessons.ts:237 — Lesson Recall applies the same ordering of filtering and cutting.
  • docs/benchmarks/2026-11-20-scoped-lesson-candidates.md — measured results and limitations.

Decisions

  • Rank the full Lesson index before filtering. This removes the fixed-window starvation case at the cost of ranking more hits.

Out of scope

  • Changing BM25 scoring, the reranker gate, or Lesson retention.

Verified

  • npm run build && npm run typecheck && npm test → 3,195 passed, one skipped.
  • npm run eval:gate && npm run eval:gate:rules → both passed.

Not verified

  • End-to-end reranked Lesson Injection quality; the local gates run without the Lesson reranker.

Merge danger

Door: A revert restores the old candidate cut; the change does not modify stored records.

Blast radius: Lesson Recall and the Lesson candidate offered to prompt-submit Injection.

Generated-By: claude-sonnet-5-5
@possiblyneal

Copy link
Copy Markdown
Owner Author

Shelving this implementation without merging. Ranking all matching Lessons can take quadratic work on the daemon event loop, and the benchmark does not establish a reranked Injection gain. Keep #438 open for bounded candidate selection and representative quality and latency measurements.

@possiblyneal
possiblyneal deleted the fix/438-scoped-lesson-candidates branch November 21, 2026 20:21
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.

Lesson recall cuts candidates before the project filter, starving this project's Lessons

1 participant