Skip to content

feat(rag): language-aware EUR-Lex source links on regulation citations (#424 phase 1)#429

Merged
AndreLiar merged 1 commit into
devfrom
feat/kb-source-urls-lang
Jun 14, 2026
Merged

feat(rag): language-aware EUR-Lex source links on regulation citations (#424 phase 1)#429
AndreLiar merged 1 commit into
devfrom
feat/kb-source-urls-lang

Conversation

@AndreLiar

Copy link
Copy Markdown
Owner

Phase 1 de #424. Résout « sources listées » + le FR pragmatique, sans traduire le règlement nous-mêmes.

Ce qui change

Les citations réglementaires portent maintenant l'URL source officielle EUR-Lex, dans la langue de l'utilisateur :
https://eur-lex.europa.eu/legal-content/{FR|EN}/TXT/?uri=CELEX:32022R2554
→ un utilisateur FR a une réponse en français (déjà le cas) + un lien vers le DORA officiel en français.

Implémentation

  • complianceKbRetriever : construit l'URL EUR-Lex par régulation, langue-aware. DORA → CELEX 32022R2554 ; DORA-RTS → pas de lien (plusieurs actes délégués, pas de CELEX unique fiable — mieux que de mentir).
  • Threading de la locale : /rag/stream body → controller → executor → service → retriever. Le front envoie i18n.language.
  • Frontend : SourceCitations affiche déjà source.url en lien externe → rien à changer côté affichage.
  • Tests unitaires du builder d'URL + assertions mises à jour.

Validation

  • ✅ Backend 1445 tests · Frontend 521 tests · next build ✓ · lint clean.

Reste — Phase 2 (#424)

Le vrai KB français (texte verbatim → extraits de sources en français + récupération same-language) nécessite le contenu officiel EUR-Lex FR — que tu fourniras. L'infra (threading locale, lien langue-aware) est posée ici.

#424 p1)

dora regulation citations now carry the official EUR-Lex source URL, in the
user's language (the regulation is published verbatim in all EU languages), so a
french user gets a french answer plus a link to the official french dora text —
without us translating the regulation ourselves.

- complianceKbRetriever: build the eur-lex CELEX url per regulation, language-aware
  (DORA -> 32022R2554; DORA-RTS spans several acts -> no link, better than a wrong one)
- thread the UI locale through the rag request (controller -> executor -> service
  -> retriever); frontend sends i18n.language on /rag/stream
- the frontend SourceCitations already renders source.url as an external link
- unit tests for the url builder + updated the call-args assertion

phase 2 (full french KB text for same-language snippets) needs the official
EUR-Lex french content (data task, to be provided).
@codecov-commenter

codecov-commenter commented Jun 14, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
backend/controllers/ragController.js 50.00% 1 Missing ⚠️
backend/services/ragExecutor.js 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@AndreLiar AndreLiar merged commit d4312c6 into dev Jun 14, 2026
7 checks passed
@AndreLiar AndreLiar deleted the feat/kb-source-urls-lang branch June 14, 2026 13:47
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.

2 participants