Repository navigation
Description
Roadmap: firms-client to the level of dpc-radar (tracking)
firms-client 0.5.0 reads FIRMS well: country archives and the area API, hotspots, events, digests, season anomaly, the static-source mask, land cover (classify_burning), grounded bulletins, MCP, llms.txt. It does not yet say how much to trust a detection in a place, it has no benchmark of known cases, and a Comune cannot install it. This issue tracks the work, one PR per phase. The standard is agent-engineering-studio/agent-engineering-studio.github.io#11; the model is dpc-radar, the latest example is egms-client#22.
Part of agent-engineering-studio/limen#714 (the wildfire epic).
Limen follows every phase. A phase that changes what Limen can use (a new function, a fix, a contract) ends with a release of firms-client (after Giuseppe's go-ahead) and a Limen PR «Parte di #714» that raises the pin, adopts the feature and updates the book (docs/book/02-le-librerie.md, appendice-c-librerie.md, and the chapter that uses it). Phases 0–2 change only the repository and the measures: their Limen side is the book, if anything changes there. Phase 3 is the first that needs a release (0.6.0, the transport); phase 4 the second.
Rules: firms-client imports no other Limen library. The UI is not an alternative to Limen. Not measured is not zero. A hotspot is not an alert. Whole archives stay out of the repo; only small crops of the cases go in, with their source.
Where Limen stands (read 25/11/2026)
- Limen pins
firms-client~=0.5.0but uses only the pure parts:parse_csv,select,area_url, the archive URLs andStaticMask. Transport (fetch_with_retry), cache and degradation are Limen's own (integrations/firms/). classify_burningis not used: it is not validated (Validate the crop-burning heuristic against ground truth #17).- limen#714: Italy 2024–2026 at «high», 72 h, catches 62–68 % of burnt cells against a base rate of 11–14 %. The North is behind: at «moderate», Lombardia 20 %, Veneto 14 %, Piemonte 48 %, Emilia-Romagna 38 %, and the FWI scale does not recover it. The epic asks for «a signal beyond the FWI (fuel, season, agricultural use of fire)»: this is what firms-client can measure.
- EFFIS perimeters (the backtest truth) miss small fires; FIRMS sees some of them, at 375 m.
Phase 0 · Repository like the others (S)
- Full Makefile:
check,format,build,docs,notebooks,bench,up,down,logs,clean,help. - A test that no
srcfile importslimen,dpc_radar,egms_client,effis_client,fwi_chainand the others. - CI also on the core without extras (CI: also test the core without extras #23).
publiccode.ymlvalidated in CI (publiccode-parser-action), firstdocs/riuso.md.- Generated API reference on Pages, linked from the home and
llms.txt(Site: generated API reference on GitHub Pages #22).
Check: make help lists every target; CI is green with the import ban, the core-only job and publiccode.
Phase 1 · A benchmark of known cases (M)
benchmarks/cases.toml and benchmarks/run.py --check in CI, offline on small committed crops of the country archives.
- Fires: large wildfires with a known date and place (e.g. Montiferru, Sardinia, July 2021; Sicily, July 2023).
- Static sources: the Taranto steelworks, which must come out masked.
- False fires: the Etna lava flow of February 2025,
type0 (Lava flows and volcano flanks: teach the mask and the land cover about volcanoes #15). - Crop burning: stubble fires in the Po plain or the Tavoliere.
- Blind: fires below the 375 m detection limit, or under cloud, where the answer must be «not measured», not 0.
- Methods scored:
select,StaticMask.verdict,cluster,classify_burning,season_anomaly.
Check: N of N cases, recorded in results.json.
Phase 2 · How much to trust it, per place (M)
firms_client.reliability, declared as an estimate made from outside (FIRMS publishes no per-place trust map):
- useful overpasses per day at that latitude, by sensor;
- distance from a known static source (the mask);
- pixel confidence and scan/track size;
- land cover under the detection (WorldCover);
score= the minimum of the known parts, withreliableand the reason.
#17: validate classify_burning here, in the benchmark. The independence rule is about code: src/ imports no other library, but the benchmark can carry crops of another open source as truth, fetched with plain httpx (as egms-client does with INGV bulletins). The truth is the EFFIS burnt-area database (modis.ba.poly on /effis, not the NRT layer effis-client reads): every perimeter carries its CORINE land-cover shares (AGRIAREAS, BROADLEA, SCLEROPH, …), e.g. Sindia, 12/07/2021, 914 ha, 95 % agricultural. It says what land burnt (≥ ~30 ha), not why: small stubble fires stay below it, written in «What is not there». Licence checked before committing the crops. What stays in Limen is only what Limen alone can do: the measure over all Italy and years against the risk engine (AUC of crop burning in the North, backtests). #16: masks for one more country as a control, not more.
What is not there (written down, not hidden): clouds and thick smoke; small or short fires between two overpasses; burnt area (that is EFFIS); the type field in the area API.
Check: on the cases of phase 1, blind places come out unreliable.
Phase 3 · Freshness and the service's contract (S)
- Every answer carries product, version (
2.0NRT, SP), latency and window. The current year is not in the country archives; NOAA-20/21 have no country archive. - The country names FIRMS accepts, listed and validated (List and validate the country names FIRMS accepts #20).
- The area API live with a MAP_KEY (Verify the area API live with a MAP_KEY (on_date, no type, mask, ranges, retries) #14), in a weekly live workflow, beside recorded responses. Needs a
FIRMS_MAP_KEYrepository secret. - An injectable transport (
send=orretries=0), as in egms-client, so Limen can drop its duplicate CSV handling inintegrations/firms/client.py.
Check: the live test passes; Limen gives the same output after the switch.
Phase 4 · Per-cell features, for Limen (M)
firms_client.cells: hotspots → statistics on any grid, NaN kept as NaN: fire-days per km², share of crop burning, distance from a static source, with the reliability of phase 2. A parity test against Limen's fire_density.
For Limen (each becomes a box in limen#714):
limen misura --pericolo wildfire --feature crop_burning_shareon the North, region by region, before touchingwildfire.yaml;- FIRMS as truth for the small fires EFFIS misses: hit rate and base rate beside the perimeters;
- «not measured» for cells with no useful overpass.
Check: parity on one region; the AUC measured in Limen comes back as a small file with its source.
Phase 5 · The AI layer (M)
firms_client.facts: answers as data, each with source, date, licence (NASA FIRMS acknowledgement) and the notes «not measured» and «not an alert».- MCP tools on top of
facts, including land cover and bulletin facts (MCP: expose land cover and bulletin facts as tools #19). check_text, andbenchmarks/faithful.jsonscored offline in CI: invented, swapped and badly rounded numbers.- Verify ClaudeWriter live and build an eval set for bulletins #24 (
ClaudeWriterlive and its eval set): only after Giuseppe's yes, because the API is paid. llms-full.txtand a skill with the traps.
Check: faithful score --check in CI; every faulty answer is caught.
Phase 6 · Docker, the UI for a Comune, notebooks (M)
compose.yaml,name: firms-client; containersfirms-client-api,firms-client-ui(127.0.0.1:3005),firms-client-notebook(127.0.0.1:8890),firms-client-mcp(127.0.0.1:8769). Ports and volumes from.env, complete.env.example. The MAP_KEY only from.envor a mounted secret, never in the image or the logs (a test checks the logs).- The UI, on the dpc-radar/egms-client model: Bootstrap Italia from npm (no CDN), Italian and English, configured per Comune from env vars and the URL, embeddable with an iframe. Narrow: the fires seen in the Comune in the last days and in the season, how much to trust them, «non è un'allerta» in view. Without a MAP_KEY it shows only the archives, and says so.
- Notebooks (Notebooks: a national fire history and a season comparison #21): a national fire history, a season comparison,
how_much_to_trust,cells_for_a_model.make notebooks. docs/riuso.mdcomplete.
Check: docker compose up on a clean machine; a CI job starts it and answers /api/health and /.
Phase 7 · Release, the fifth episode, LinkedIn
- The release that closes the roadmap on PyPI after Giuseppe's go-ahead; Limen's pin and the book updated.
- The fifth episode of the Open Data series, Italian and English, in the site repository (
draft: true, PR, the merge is Giuseppe's). It opens the wildfire chapter. - The LinkedIn post in Giuseppe's local folder, not published.
- firms-client ticked in the «Avanzamento» section of 🗺️ [Open Data] Rubrica: le librerie di Limen, una per pericolo — dati aperti misurati, pronti per la PA e per l'AI agent-engineering-studio.github.io#11.
Parked
- Training sets for fire-risk models (build_training_set) #12 (training sets) and ML classifier for new static sources (extra [ml]) #13 (ML classifier): models are trained and measured in Limen, not here.
- WorldCover: bulk work and async (tile download, to_thread helper) #18 (WorldCover bulk and async): only if phase 2 needs it.
🤖 Generated with Claude Code
Activity
gzileni commentedon Nov 25, 2026
Phase 0 is on branch
chore/phase-0(0af53ee), waiting for a push:make checkgreen (107 tests, 100 %), core alone 88 passed / 3 skipped,publiccode.ymlvalid for the official parser,make docsbuilds the site with the API reference. Closes #22 and #23.gzileni commentedon Nov 25, 2026
Phase 0 done: #27 merged (closes #22, #23), #28 fixed the Pages deploy (
upload-pages-artifact/deploy-pagesv5). Site live with the API reference at https://agentengineering.it/firms-client/api/firms_client.html. No API change: no release, nothing to update in Limen or its book. Next: phase 1, the benchmark of known cases.gzileni commentedon Nov 25, 2026
Phase 1 done (#29): 13 checks on known cases, 11 of 13 pass, scored offline in CI (
make bench). The two failures are the Etna lava flow of February 2025 (#15): 44 % typed as vegetation fire by FIRMS, 15 % still kept with the static mask. Not there: crop burning (#17, in Limen), missed fires (phase 2), MODIS and the area API (phase 3). Next: phase 2, how much to trust it per place.gzileni commentedon Nov 25, 2026
Phase 1 completed by #31: crop burning measured against EFFIS burnt areas (the independence rule is about code, not about the truth a benchmark carries; corrected in phase 2 above). 17 of 23 pass: wildfires 5/5; fires on cropland 1/4 (three
mixed, grassland 29-37 %, #17); Etna lava 0/2 (#15); Polizzi Generosa 2022, 876 ha, no VIIRS detection — the first datum for phase 2.gzileni commentedon Nov 25, 2026
Phase 2 done (#32).
seen(area_ha): VIIRS S-NPP saw 19 % of the fires under 30 ha and 82 % of 300-1,000 ha in 2022-2025 (10,290 EFFIS burnt areas of Italy; lower than 2016-2021 at every size).trust(lat, lon): static + land parts, nothing known = not measured; 8 of 8 benchmark checks (25 of 31 in all).firms sync: the init for servers and offline use, idempotent. This phase adds API: a release (0.6.0) and a Limen PR come after the go-ahead.feat(service): phase 3, what FIRMS has and lacks, one data directory …
gzileni commentedon Nov 25, 2026
Phase 3 done (#33) and 0.6.0 released on PyPI (#35, tag v0.6.0): phases 0-3.
missing_days(): the service's own table of days with no data. VIIRS S-NPP has none from 27 July to 10 August 2022 and on stretches of 2024 and 2026.seen()now leaves those fires out (401 of 10,290): 2022-2025 at 30-100 ha 58 %, 100-300 76 %, 300-1,000 87 %.latest_archive(),check_columns(),map_key_status(),data_availability(),firms status; weekly live CI (Verify the area API live with a MAP_KEY (on_date, no type, mask, ranges, retries) #14 runs once theFIRMS_MAP_KEYsecret exists).FIRMS_DATA_DIR/FIRMS_MAP_KEYfrom the environment or.env;.env.example.area_url(base=): Limen drops its URL rewrite.Limen side (pin, WorldCover in the init, book): PR in progress.
gzileni commentedon Nov 25, 2026
Phase 4 done (#36):
cell_stats(hotspots, grid, cells=, mask=, land=)per cell (fire-days, fire-days/km², WorldCover cropland and natural share under the fire-days, distance from static sources, trust at the centre; None = not measured),LaeaGrid(EPSG:3035 with no pyproj, default origin = EEA 1 km grid; with an AOI's bounds = Limen's grid),firms cells. Benchmark: cropland under the fire-days 0.58-0.86 on the agricultural EFFIS fires FIRMS saw, 0-0.004 on the wildfires; 34 of 41. #37 addsinit()and the sharedDATA_ROOT. Limen side (parity withfire_density,limen misura --featureon the cropland share in the North) after the release.