Skip to content

dev → main : refactoring, configuration simplifiée et 21 issues (lots 0, A, B, C, D) - #55

Open
BenjaminNavet wants to merge 332 commits into
mainfrom
dev
Open

BenjaminNavet wants to merge 332 commits into
mainfrom
dev

Conversation

@BenjaminNavet

@BenjaminNavet BenjaminNavet commented Mar 23, 2026 •

Copy link
Copy Markdown
Collaborator

Résumé

Cette PR amène dans main tout ce qui a été fait sur dev depuis mars :

  1. Refactoring en 3 couches et interface web. C'était le contenu initial de cette PR, voir plus bas.
  2. Refonte de la configuration (ADR 0003) :
    • un seul scilex.yml par revue, plus un keys.yml partagé ;
    • les commandes scilex init et scilex config show|check|migrate ;
    • les anciens fichiers sont encore lus, avec un avertissement.
  3. Traitement des 21 issues ouvertes, en 5 lots (plan dans docs/decisions/0002-plan-lots-issues-ouvertes.md). Toutes les nouvelles fonctions qui appellent le réseau sont désactivées par défaut. Leurs tests utilisent des appels HTTP simulés.

Issues traitées

Lot 0 : fusion de feat/bibtex2rdf

Lot A : qualité des données

Lot B : pipeline et ergonomie

Lot C : IA et recherche

Lot D : nouvelles API

  • Closes add Chemistry APIs #16 : collecteur bioRxiv. La chimie est couverte par OpenAlex et PubMed, et ChemRxiv n'a pas d'API utilisable.
  • Closes KG-API to check if possible #30 : note de faisabilité dans docs/developer-guides/kg-apis-feasibility.md (AIDA, OpenCitations Index ; ORKG et OpenAIRE sont déjà couverts)

Limites connues

Contenu initial de la PR (refactoring en 3 couches)

  • scilex/config.py et scilex/pipeline/ : aggregate_collect.py est découpé en modules, et le hack sys.argv disparaît.
  • Interface web : logs en temps réel, étapes du pipeline, fiches d'articles, suppression de collections, infobulles.

Plan de test

  • uv run python -m pytest tests/ : 1845 réussis, 1 ignoré
  • uvx ruff check . ne signale rien
  • Lancer le pipeline de bout en bout sur une petite collection réelle
  • Essayer scilex-collect --since, scilex-seed et scilex-export-turtle --citation-graph sur de vraies données

🤖 Generated with Claude Code

…fter, guard rate-limit headers; simplify retry loop; shared sanitize_secrets
…, state fixes), endpoint/auth hooks, Springer on generic loop, dead code removal
…erter helpers

Port of feature/biorxiv (written against the pre-refactor layout): yearly cache
+ client-side keyword filter, _state/_complete markers, atomic cache pages,
fetch failures leave the query resumable, per-year fetch lock. Converter uses
converter_utils; registered in collector_collection, collectors/__init__,
DEFAULT_RATE_LIMITS, web UI list; golden converter fixture added.
#50)

Apporte l'export RDF/Turtle, l'enrichissement par citations/références,
l'analyse de graphes (co-citation, couplage, Louvain), le snowball
sampling, le résumé de clusters et la suggestion de mots-clés.

Réconciliation avec le refactor de dev :
- conflits de style (docstrings) : version de dev conservée
- export_to_bibtex : champs HF dédiés (task, ptm, hfdataset…), hfurl,
  relevancescore, citationcount, references/cited_by portés dans la
  table _ENTRY_FIELDS ; DOI via constants.normalize_doi ; séparateur
  d'auteurs inchangé (« ; » seul)
- load_aggregated_data importé depuis scilex.io_utils
- paper/ : version de dev (plus récente)
- dépendances : rdflib, networkx, bibtexparser>=2, extra « graph »
…), clés hors défauts legacy (#3)

- core_conferences.csv : export CORE2023 complet (759 conférences)
- sjr_journals.csv : en-tête seul ; SCImago bloque le téléchargement
  automatique (Cloudflare) -> option --sjr-file pour un export manuel
- tests venue_ranking sur des tables de fixture
- nouvelles clés du lot A retirées de get_default_quality_filters et du
  schéma pour préserver l'invariant legacy <-> scilex/settings
…h a key

Fetch references and citers for 100 papers per request with POST /paper/batch
instead of one request per paper (1500 papers: ~15 requests instead of 1500).
Papers from a failed chunk fall back to the per-paper chain.

SemanticScholar keys default to 1 req/s: the per-paper helpers sent 10 req/s
with a key and hit 429. Backoff on 429 is now longer (5 attempts, up to 60 s).
…t open

Windows builds have no console, so a failing WebView2 window left the server
running with nothing on screen. The startup check now also runs on Windows
(pythonnet, .NET 4.6.2+, WebView2), the browser opens if the window has not
loaded after 45 s, and fatal startup errors show a dialog. CI runs the check
in the Windows bundle.
The folder hint contained the Windows home path (C:\Users\...). NiceGUI
parses props strings as Python literals, where \U is an invalid escape, so
the dialog raised a SyntaxError. Set the hint (and the Configure placeholder)
as values instead of props strings.
The batch endpoint silently empties some papers' nested citation lists when
a response holds many links (a paper with 9177 citers came back with []),
so those papers were recorded as having no citers. Request citationCount /
referenceCount and send papers whose list is shorter than 90% of the count
to the per-paper request.
New PWCClient (paperswithcode.co/api/v1, anonymous, SQLite cache of reduced
records, Retry-After on 429/503). Lookup by arXiv ID first, then title search
with fuzzy matching. Tags from tasks, methods, evaluated benchmarks,
frameworks and official repository stars; writes the pwc_url column.
Drops the huggingface-hub dependency (ADR 0006).
The enabled flag defaults to false and is meant for the command line; in
the GUI, clicking the button is the request to enrich, so it always failed
with 'enrichment is disabled' on a default review.
… calls when throttled

A 429 on one batch sent its 100 papers to one-by-one requests, each spending
~30 s of retries while SemanticScholar kept throttling. Failed batches are now
retried once after the others; after 3 consecutive transient SS failures the
remaining papers go straight to CrossRef/OpenCitations. Progress logged every
10 papers. export_to_turtle unpacks a list of SS keys with first_key.
…eparate file

Zotero push, BibTeX/Turtle exports, the GUI and the web API all read
aggregated_results.csv, so papers written to aggregated_results_snowball.csv
never reached the collection. The original file is backed up once as
aggregated_results_pre_snowball.csv, and snowball_depth from earlier runs
is kept.
The Graph tab only listed the clusters CSV (first 12 columns, so cluster_id
and pagerank were hidden) and the name of the GEXF file. It now shows the
linked papers as an ECharts force graph coloured by community and sized by
PageRank, with a community filter, paper details on click, a table of
communities (size, years, most central papers) and the linked papers.
…separate file

A new 'Add to the collection' checkbox (ticked by default) in the GUI and a
--separate-file flag on scilex-snowball. Unticked, the merged corpus goes to
aggregated_results_snowball.csv and aggregated_results.csv is left untouched.
The OpenCitations fallback downloaded the full lists of citing and cited DOIs
just to count them, through a v1 URL that redirects twice, at 1 req/s shared
by all workers (2 s per paper at best). It now calls the v2 citation-count and
reference-count operations and allows the documented 180 req/min. Reference
and citer fetching keep the v1 lists but hit api.opencitations.net directly.
… hint

The Graph tab showed a co-citation graph built before the last aggregation
and snowball, with no sign it no longer matched the corpus. Previous results
of Charts, Graph, Keywords and Summaries now carry a warning naming the input
files changed since. The few-links hint no longer claims bibliographic
coupling usually links more papers.
… range

Closing a one-shot dialog deleted it at once, so the navigation that followed
in the same click handler was lost. Deletion now waits a second.
The blank skeleton wrote years: [2024, 2026], which collects 2024 and 2026 only.
…og, Screen layout, help texts)

- Last results warns when the collection is partial
- The log box appears once a job exists
- Screen: grid height follows the window, Score header readable, shortcut help
  says I/E/M jump to the next undecided paper
- Help of max_articles_per_query and name, clearer cancel message
A refused key or a cut network ended "Completed" with an empty review.
The pipeline now stops before aggregation and names the cause per API
(key refused, rate limited, unreachable, or no result), with a button to
API keys when a key is involved. The Queries column counts only the
queries that finished, and the State column gives the same cause.
…-1900 years; accessibility basics

- Configure flags the blank template's example keywords, a max per query of
  0 or less, and years before 1900
- Visible keyboard focus ring, darker primary and warning colours (WCAG AA),
  <html lang>, a tab title per screen
- A damaged aggregated_results.csv or screening.csv names the file and the fix,
  without a diagnostic report; long paths wrap in error dialogs
- Configure with a broken scilex.yml shows the problem once, no self-link
- Screen: warns when a note would be lost (no decision), shows how many
  papers the filters keep, gives the keys back to the shortcuts after the
  Decision filter
- A failed job's progress bar turns red
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment