Add Légifrance API integration for live legal text injection
Implements a two-layer approach to ensure legal texts are accurate and current: Option A — runtime injection (legifrance_client.py): - LegifranceClient: OAuth2 via PISTE (oauth.piste.gouv.fr), fetches consolidated article text via api.piste.gouv.fr/dila/legifrance/lf-engine-app - Redis cache with 24h TTL (in-memory fallback if no Redis) - build_filter_prompt() injects live texts into the prompt with explicit priority over static descriptions — model uses official Légifrance text, not training memory - Graceful fallback to static prompt if API is unavailable — filtering never blocks Option B — weekly sync script (scripts/check_legal_refs.py): - Reads legal_refs.yaml (11 tracked articles, priority critical/high/medium) - Fetches current text from Légifrance, diffs against stored baseline - --init: resolves LEGIARTI IDs on first run - --check: report only; --update: saves new texts to YAML - Exit code 2 when changes detected (CI/n8n-compatible) Supporting changes: - legal_refs.yaml: tracked articles with code LEGITEXT IDs, priorities, rationale - requirements.txt: add pyyaml>=6.0.2 and requests>=2.32.0 - .env.example: document PISTE_CLIENT_ID, PISTE_CLIENT_SECRET, LEGIFRANCE_CACHE_TTL - transparence.tsx: document the Légifrance injection for public transparency - Fixed portal URL: piste.gouv.fr (not piste.api.gouv.fr — verified June 2026) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
# Références légales surveillées via API Légifrance (PISTE)
|
||||
# Ce fichier est la source de vérité pour le suivi des articles.
|
||||
#
|
||||
# Mise à jour :
|
||||
# python scripts/check_legal_refs.py --init # peuple les legiarti_id
|
||||
# python scripts/check_legal_refs.py --check # rapport des changements
|
||||
# python scripts/check_legal_refs.py --update # met à jour last_text
|
||||
#
|
||||
# Inscription PISTE (gratuite) : https://piste.gouv.fr
|
||||
|
||||
meta:
|
||||
description: "Articles critiques — filtrage éthique La Voix du Peuple"
|
||||
last_sync: null
|
||||
source: "https://www.legifrance.gouv.fr"
|
||||
piste_docs: "https://piste.gouv.fr/documentation"
|
||||
|
||||
# LEGITEXT IDs stables des codes sources
|
||||
codes:
|
||||
code_penal: LEGITEXT000006070719
|
||||
loi_1881: LEGITEXT000006070722
|
||||
lcen_2004: LEGITEXT000005789847
|
||||
code_civil: LEGITEXT000006070721
|
||||
code_sante_pub: LEGITEXT000006072665
|
||||
|
||||
articles:
|
||||
|
||||
# ── PRIORITÉ CRITIQUE — amendés fréquemment ────────────────────────────────
|
||||
|
||||
- key: CP-225-1
|
||||
ref: "Code pénal, Art. 225-1"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "225-1"
|
||||
legiarti_id: null # peuplé par --init
|
||||
priority: critical
|
||||
reason: >
|
||||
Liste des critères de discrimination — fréquemment élargie.
|
||||
Dernière modification significative connue : 2021 (ajout activités syndicales).
|
||||
Surveiller ajouts éventuels liés à SREN 2024 ou lois ultérieures.
|
||||
last_text: null # peuplé par --update
|
||||
verified_at: null
|
||||
|
||||
- key: L1881-24
|
||||
ref: "Loi du 29 juillet 1881, Art. 24"
|
||||
code: LEGITEXT000006070722
|
||||
article_num: "24"
|
||||
legiarti_id: null
|
||||
priority: critical
|
||||
reason: >
|
||||
Provocation à la discrimination et à la haine — fréquemment amendé.
|
||||
L'apologie du terrorisme en a été retirée en 2014 (transférée CP Art. 421-2-5).
|
||||
Vérifier toute évolution du périmètre des motifs protégés.
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
# ── PRIORITÉ HAUTE ─────────────────────────────────────────────────────────
|
||||
|
||||
- key: CP-222-33
|
||||
ref: "Code pénal, Art. 222-33"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "222-33"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: >
|
||||
Harcèlement sexuel — amendé en 2018 (loi n° 2018-703, Schiappa).
|
||||
Définition élargie, possibles évolutions.
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: CP-222-33-2-2
|
||||
ref: "Code pénal, Art. 222-33-2-2"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "222-33-2-2"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: >
|
||||
Cyberharcèlement en meute — introduit par loi n° 2018-703 du 3 août 2018.
|
||||
Surveiller évolutions liées à SREN 2024 (art. 19 et ss).
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: CP-421-2-5
|
||||
ref: "Code pénal, Art. 421-2-5"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "421-2-5"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: >
|
||||
Apologie du terrorisme — introduit par loi n° 2014-1353 du 13 novembre 2014
|
||||
(anciennement Loi 1881 Art. 24 al. 6). Stable depuis, mais à vérifier.
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: CP-211-1
|
||||
ref: "Code pénal, Art. 211-1"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "211-1"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: "Génocide — texte fondateur, stable depuis l'entrée en vigueur du code (1994)."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: L1881-24bis
|
||||
ref: "Loi du 29 juillet 1881, Art. 24 bis"
|
||||
code: LEGITEXT000006070722
|
||||
article_num: "24 bis"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: "Négationnisme — loi Gayssot du 13 juillet 1990, stable."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: CP-226-4-1
|
||||
ref: "Code pénal, Art. 226-4-1"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "226-4-1"
|
||||
legiarti_id: null
|
||||
priority: high
|
||||
reason: "Usurpation d'identité numérique — LOPPSI 2 (2011). Surveiller extensions."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
# ── PRIORITÉ MOYENNE ───────────────────────────────────────────────────────
|
||||
|
||||
- key: CP-212-1
|
||||
ref: "Code pénal, Art. 212-1"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "212-1"
|
||||
legiarti_id: null
|
||||
priority: medium
|
||||
reason: "Crimes contre l'humanité — stable."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: CP-223-13
|
||||
ref: "Code pénal, Art. 223-13"
|
||||
code: LEGITEXT000006070719
|
||||
article_num: "223-13"
|
||||
legiarti_id: null
|
||||
priority: medium
|
||||
reason: "Provocation au suicide — surveiller évolutions liées aux réseaux sociaux."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
|
||||
- key: L1881-29
|
||||
ref: "Loi du 29 juillet 1881, Art. 29"
|
||||
code: LEGITEXT000006070722
|
||||
article_num: "29"
|
||||
legiarti_id: null
|
||||
priority: medium
|
||||
reason: "Définition de la diffamation — stable."
|
||||
last_text: null
|
||||
verified_at: null
|
||||
Reference in New Issue
Block a user