Skip to content

feat(leitner): return confirmed_chunk + source_sentence on review items for L3+ fill-in #86exnxph5 - #64

Merged
navidshad merged 1 commit into
mainfrom
CU-86exnxph5_Deliver-confirmed_chunk-source_sentence-to-main_Navid-Shad
Aug 31, 2026
Merged

feat(leitner): return confirmed_chunk + source_sentence on review items for L3+ fill-in #86exnxph5#64
navidshad merged 1 commit into
mainfrom
CU-86exnxph5_Deliver-confirmed_chunk-source_sentence-to-main_Navid-Shad

Conversation

@navidshad

Copy link
Copy Markdown
Contributor

What & why

Delivers the Leitner slice of task #86exnxph5 directly to main, since dev is currently tied up with the theme redesign and we don't want to drag that along.

Both review RPCs — get-review-session (getDueItems) and get-custom-review-session (getCustomReviewItems) — now return two flat fields per item, so the L3+ flashcard can render a fill-in-the-blank:

Field Value
confirmed_chunk text of the primary chunk = highest confidence, tie-break earliest; null when the phrase has no chunks → recognition-card fallback
source_sentence the phrase's context, kept whole; null when absent

Read-path only — no schema change (phrase.chunks / context already exist on main).

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 — new ReviewItem type.
  • Tests: utils/__tests__/chunk.test.ts + leitner_box/__tests__/review_bundle.test.ts.

Scope note

The Pool half of this feature (already on dev via PRs #53/#59) is intentionally excluded — the Pool module doesn't exist on main. This PR is Leitner-only and carries none of the dev redesign work.

Testing

  • yarn build (tsc) clean.
  • New suites pass (chunk.test.ts + review_bundle.test.ts, 10 tests). Behavior identical to what was already E2E-verified on dev.

🤖 Generated with Claude Code

…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>
@navidshad

Copy link
Copy Markdown
Contributor Author

@navidshad
navidshad merged commit 40f2b88 into main Aug 31, 2026
6 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