Skip to content

refactor(scoring): i motori di punteggio vengono da limen-core - #754

Merged
gzileni merged 2 commits into
mainfrom
refactor/engines-from-limen-core
Nov 28, 2026
Merged

gzileni merged 2 commits into
mainfrom
refactor/engines-from-limen-core

Conversation

@gzileni

@gzileni gzileni commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary

I motori di punteggio escono da Limen ed entrano in limen-core 0.2.0, la libreria che unisce le librerie di fonte. È il primo passo per fare di Limen un'applicazione sottile.

  • core/models, core/scoring (tranne tre file) e core/cascades: 24 moduli, circa 4.900 righe, sono ora in limen-core con lo stesso codice. Qui ogni modulo resta come nome: limen.core.scoring.engine è lo stesso oggetto di limen_core.scoring.engine, non una copia. Per questo nessun import cambia nei 162 moduli e nei 126 file di test che li usano, e un test che sostituisce una funzione sostituisce quella vera.
  • Restano in Limen scoring/registry.py, scoring/resolver.py e scoring/ml_engine.py: leggono le impostazioni, il registro dei modelli e il codice di addestramento.
  • La taratura resta qui, in limen.config: limen-core non porta soglie né pesi. limen/__init__.py gli dice una volta dov'è la cartella.
  • Nuova dipendenza: limen-core, dal tag v0.2.0 del repository, perché non è ancora su PyPI. Diventerà un vincolo ~= come le altre al primo rilascio.

I test che esercitano solo questi moduli (187) sono anche in limen-core; qui restano e passano attraverso i nomi, quindi provano il collegamento. Si potranno togliere in un secondo momento.

Epic

Part of #618 (platform: hosting, accounts and contributions, operations, community)

Type of change

  • Scoring / thresholds
  • Backend/API

Verification

make check su una copia separata del repository: ruff e formato puliti, mypy senza errori su 474 file, 2607 test passati, copertura 80,67%. Fallisce solo tests/unit/test_geoserver_dati_base.py::test_il_raster_corine_dallo_shapefile, che su questa macchina fallisce anche su main.

Controllato a mano: limen.core.scoring.engine is limen_core.scoring.engine, lo stesso per flood.engine, e RiskLevel è la stessa classe; le soglie vengono lette da src/limen/config/hazards/landslide.yaml.

Risk/scoring impact

Nessuno atteso: è lo stesso codice, eseguito da un altro pacchetto, con la stessa taratura. I 187 test dei motori danno gli stessi risultati qui e in limen-core.

Una cosa cambia nel modo di installare: l'immagine Docker deve poter scaricare limen-core da GitHub finché non è su PyPI.

Public-data grounding

Invariato.

Checklist

  • I kept the change focused.
  • I updated docs/examples where needed.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T15:45:00.323784Z 4fd74a2 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: 4fd74a2cd4

ℹ️ 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".

Comment thread pyproject.toml
"dpc-radar[bulletins,nowcast,storms]~=0.6.0",
"glofas-ewds~=0.3.0",
# I motori di punteggio e le unioni fra fonti. Non è ancora su PyPI: dal tag.
"limen-core @ git+https://github.com/agent-engineering-studio/limen-core@v0.2.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Install Git in the API image builder for the new dependency

On a clean API/worker image build, this Git dependency cannot be installed: infra/docker/Dockerfile.api uses python:3.12-slim-bookworm, its builder package list (lines 21–30) does not install Git, and its first uv sync --frozen (lines 50–51) now needs to fetch this repository. I confirmed the prerequisite locally with an offline Git-dependency resolution and Git absent from PATH: uv reports Git executable not found. Ensure that Git is installed and available. Install Git in the builder stage or use a dependency artifact that does not require it; otherwise the production image build stops before application installation.

Useful? React with 👍 / 👎.

gzileni and others added 2 commits November 28, 2026 16:59
I moduli di core/models, core/scoring e core/cascades sono ora in limen-core
0.2.0, con lo stesso codice e gli stessi test. Qui ogni modulo resta come
nome: è lo stesso modulo di limen-core, non una copia. Restano in Limen la
scelta del motore (registry, resolver) e il motore ML. La taratura resta in
limen.config: limen/__init__.py dice a limen-core dov'è.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@gzileni
gzileni force-pushed the refactor/engines-from-limen-core branch from ec1e3ed to 851c46a Compare November 28, 2026 16:00
@gzileni
gzileni merged commit ac650ae into main Nov 28, 2026
7 checks passed
@gzileni
gzileni deleted the refactor/engines-from-limen-core branch November 28, 2026 16:06
@gzileni gzileni mentioned this pull request Nov 28, 2026
2 tasks done
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