feat(leitner): return confirmed_chunk + source_sentence on review items for L3+ fill-in #86exnxph5 - #64
Merged
navidshad merged 1 commit intoAug 31, 2026
Conversation
…ms for L3+ fill-in #86exnxph5 Delivers the Leitner slice of #86exnxph5 straight to main (dev is tied up with the theme redesign). Both review RPCs — get-review-session and get-custom-review-session — now return, per item: - confirmed_chunk: text of the phrase's primary chunk (highest confidence, tie-break earliest via server/src/utils/chunk.ts::pickPrimaryChunkText), or null when the phrase has no chunks so the renderer falls back to the recognition card. - source_sentence: the phrase's context, kept whole, or null. Read-path only; no schema change (phrase.chunks/context already exist on main). The Pool half of this work stays on dev — the Pool module does not exist on main. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
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 & why
Delivers the Leitner slice of task #86exnxph5 directly to
main, sincedevis currently tied up with the theme redesign and we don't want to drag that along.Both review RPCs —
get-review-session(getDueItems) andget-custom-review-session(getCustomReviewItems) — now return two flat fields per item, so the L3+ flashcard can render a fill-in-the-blank:confirmed_chunkconfidence, tie-break earliest;nullwhen the phrase has no chunks → recognition-card fallbacksource_sentencecontext, kept whole;nullwhen absentRead-path only — no schema change (
phrase.chunks/contextalready exist onmain).Changes
server/src/utils/chunk.ts(new) —pickPrimaryChunkText, the single source of truth for the Council-005 rule.leitner_box/service.ts— both join sites emit the two fields via the util.leitner_box/db.ts— newReviewItemtype.utils/__tests__/chunk.test.ts+leitner_box/__tests__/review_bundle.test.ts.Scope note
The Pool half of this feature (already on
devvia PRs #53/#59) is intentionally excluded — the Pool module doesn't exist onmain. This PR is Leitner-only and carries none of thedevredesign work.Testing
yarn build(tsc) clean.chunk.test.ts+review_bundle.test.ts, 10 tests). Behavior identical to what was already E2E-verified ondev.🤖 Generated with Claude Code