Skip to content

fix(elos): better grounded answers on real course slides; faster MCP sources - #24

Merged
eulogep merged 1 commit into
mainfrom
feat/mcp-sources-cache
Oct 23, 2026
Merged

eulogep merged 1 commit into
mainfrom
feat/mcp-sources-cache

Conversation

@eulogep

@eulogep eulogep commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Tuning from a real 226-file course library (slides, TPs, transcripts):

  • Answer reranking: duplicates removed, slide titles and quiz questions penalised, definition passages favoured, oral transcripts after written material; duplicate sentences removed.
  • LaTeX spacing accents recomposed at import.
  • MCP: per-file extraction cache (size+mtime), 1,000-file cap, subject = first folder (first load ~10 s / ~4,000 pages, then ~7 ms).

Real-library probe: 7/8 course questions answered with relevant cited passages, off-topic question refused.

Test plan

  • New unit tests (reranking on slide-like sources, accent recomposition); npm test 647/647, typecheck, eslint ., build
  • Browser regression: Studio 27/27, OCR 10/10

🤖 Generated with Claude Code

…sources

Found by running the tutor on a real 226-file course library:
- answers now rerank BM25 hits: duplicates removed, slide titles and quiz
  questions penalised, explanatory/definition passages favoured, oral
  transcripts ranked after written material; quoted sentences deduplicated
- LaTeX-made PDFs: spacing accents recomposed ("exprim ́ ee" → "exprimée")
- MCP server: extraction cached per file (size + mtime), 1,000-file cap,
  first folder = subject, second = origin (first load ~10 s for ~4,000
  pages, then ~7 ms)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
daily-english-mission Ready Ready Preview Oct 23, 2026 5:54am UTC

@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 95c39e8b-4631-4909-818c-8365e4c3a1b6
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T05:56:20.724740Z bc3a7f1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc3a7f156d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

export function cleanExtractedText(text: string): string {
return text
// LaTeX-made PDFs extract accents as separate marks before the letter ("exprim ́ ee" → "exprimée").
.replace(/ ?([\u00B4\u0060\u02C6\u00A8\u0300-\u0302\u0308]) ?([aeiouAEIOU])/g, (_match, mark: string, letter: string) => (letter + SPACING_ACCENTS[mark]).normalize("NFC"))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve ASCII backticks in imported course text

When Markdown or text contains code whose opening backtick precedes a vowel, such as `echo`, `awk`, or `uname`, this replacement treats U+0060 as a grave accent and also consumes the preceding space, producing corrupted strings such as ècho, àwk, and ùname merged into surrounding text. Because cleanExtractedText processes Markdown and plain-text sources as well as PDF extraction, this damages common commands, citations, and retrieval terms; restrict the repair to extraction-specific accent contexts rather than treating every ASCII backtick as an accent.

Useful? React with 👍 / 👎.

return splitSentences(hit.passage.text)
.map((sentence, index) => ({ sentence, index, overlap: tokenize(sentence).filter((token) => terms.has(token)).length }))
.filter((item) => item.overlap > 0)
.filter((item) => item.overlap > 0 && !isQuestionLike(item.sentence) && item.sentence.split(/\s+/).length >= 4)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow concise declarative source answers

When the only relevant source sentence has fewer than four whitespace-separated words, such as TCP est fiable., the passage passes retrieval and answerability but this filter removes its sole sentence, causing answerFromSources to report that the information is absent. The previous implementation returned such exact source answers, so title suppression should not use an unconditional four-word minimum for otherwise declarative, relevant sentences.

Useful? React with 👍 / 👎.

@eulogep
eulogep merged commit 8deb69d into main Oct 23, 2026
4 of 5 checks passed
@eulogep
eulogep deleted the feat/mcp-sources-cache branch October 23, 2026 05:57

This branch was successfully deployed

1 active deployment
Preview — bc3a7f15 Deployed Oct 23, 2026 by vercel[bot]
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