vimageiitb commited on
Commit
7aae553
·
verified ·
1 Parent(s): bea7d07

Upload GeoDisasterBenchmark (attempt 1)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +94 -0
  2. data/ATTRIBUTIONS.md +500 -0
  3. data/README.md +289 -0
  4. data/SHA256SUMS +0 -0
  5. data/data/core/answer_schemas_43.json +0 -0
  6. data/data/core/geodisaster_2921_source_with_splits.jsonl +3 -0
  7. data/data/core/geodisaster_2921_test_inputs.jsonl +0 -0
  8. data/data/core/geodisaster_2921_test_source.jsonl +0 -0
  9. data/data/core/geodisaster_2921_train_source.jsonl +3 -0
  10. data/data/core/scoring_policy_43.json +23 -0
  11. data/data/multi_agent/manifest.json +278 -0
  12. data/data/multi_agent/sft_test/ga_eval.jsonl +3 -0
  13. data/data/multi_agent/sft_test/manifest.json +21 -0
  14. data/data/multi_agent/sft_test/orc_eval.jsonl +3 -0
  15. data/data/multi_agent/sft_test/pa_eval.jsonl +0 -0
  16. data/data/multi_agent/sft_test/vra_eval.jsonl +0 -0
  17. data/data/multi_agent/sft_train/ga_train.jsonl +3 -0
  18. data/data/multi_agent/sft_train/manifest.json +21 -0
  19. data/data/multi_agent/sft_train/orc_train.jsonl +3 -0
  20. data/data/multi_agent/sft_train/pa_train.jsonl +3 -0
  21. data/data/multi_agent/sft_train/vra_train.jsonl +3 -0
  22. data/data/multi_agent/test_conversations.jsonl +3 -0
  23. data/data/multi_agent/tool_ownership_and_prompt_context.md +32 -0
  24. data/data/multi_agent/train_conversations.jsonl +3 -0
  25. data/data/single_agent/manifest.json +23 -0
  26. data/data/single_agent/single_agent_system_prompt.md +70 -0
  27. data/data/single_agent/test_reference_conversations.jsonl +0 -0
  28. data/data/single_agent/test_turns.jsonl +3 -0
  29. data/data/single_agent/train_conversations.jsonl +3 -0
  30. data/data/single_agent/train_turns.jsonl +3 -0
  31. data/release_tools/__pycache__/raster_portability.cpython-310.pyc +0 -0
  32. data/release_tools/__pycache__/raster_portability.cpython-311.pyc +0 -0
  33. data/release_tools/audit_c01_source_registry.py +392 -0
  34. data/release_tools/build_isolated_test_bundle.py +196 -0
  35. data/release_tools/compile_c11_replay_lock.sh +14 -0
  36. data/release_tools/create_c11_replay_environment.sh +34 -0
  37. data/release_tools/environments/python-replay.version +1 -0
  38. data/release_tools/environments/requirements-replay.in +10 -0
  39. data/release_tools/environments/requirements-replay.lock.txt +331 -0
  40. data/release_tools/eval_isolation.py +192 -0
  41. data/release_tools/evaluate_c12_sen1_accuracy.py +410 -0
  42. data/release_tools/evidence/source_asset_registry_development_snapshot.json +272 -0
  43. data/release_tools/fetch_sen1floods11_subset.py +336 -0
  44. data/release_tools/manifests/c10_excluded_legacy_rasters.json +508 -0
  45. data/release_tools/manifests/sen1floods11_required_100.json +0 -0
  46. data/release_tools/raster_portability.py +157 -0
  47. data/release_tools/replay_all_2921.py +829 -0
  48. data/release_tools/verify_c11_environment.py +170 -0
  49. data/source_assets/deforestation/000007/cache/s1_grd/s1_00.tif +3 -0
  50. data/source_assets/deforestation/000007/cache/s1_grd/s1_03.tif +3 -0
.gitattributes CHANGED
@@ -58,3 +58,97 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  # Video files - compressed
59
  *.mp4 filter=lfs diff=lfs merge=lfs -text
60
  *.webm filter=lfs diff=lfs merge=lfs -text
61
+ data/data/core/geodisaster_2921_source_with_splits.jsonl filter=lfs diff=lfs merge=lfs -text
62
+ data/data/core/geodisaster_2921_train_source.jsonl filter=lfs diff=lfs merge=lfs -text
63
+ data/data/multi_agent/sft_test/ga_eval.jsonl filter=lfs diff=lfs merge=lfs -text
64
+ data/data/multi_agent/sft_test/orc_eval.jsonl filter=lfs diff=lfs merge=lfs -text
65
+ data/data/multi_agent/sft_train/ga_train.jsonl filter=lfs diff=lfs merge=lfs -text
66
+ data/data/multi_agent/sft_train/orc_train.jsonl filter=lfs diff=lfs merge=lfs -text
67
+ data/data/multi_agent/sft_train/pa_train.jsonl filter=lfs diff=lfs merge=lfs -text
68
+ data/data/multi_agent/sft_train/vra_train.jsonl filter=lfs diff=lfs merge=lfs -text
69
+ data/data/multi_agent/test_conversations.jsonl filter=lfs diff=lfs merge=lfs -text
70
+ data/data/multi_agent/train_conversations.jsonl filter=lfs diff=lfs merge=lfs -text
71
+ data/data/single_agent/test_turns.jsonl filter=lfs diff=lfs merge=lfs -text
72
+ data/data/single_agent/train_conversations.jsonl filter=lfs diff=lfs merge=lfs -text
73
+ data/data/single_agent/train_turns.jsonl filter=lfs diff=lfs merge=lfs -text
74
+ data/source_assets/deforestation/000007/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
75
+ data/source_assets/deforestation/000007/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
76
+ data/source_assets/deforestation/000007/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
77
+ data/source_assets/deforestation/000007/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
78
+ data/source_assets/deforestation/000007/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
79
+ data/source_assets/deforestation/000007/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
80
+ data/source_assets/deforestation/000007/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
81
+ data/source_assets/deforestation/000007/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
82
+ data/source_assets/deforestation/000007/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
83
+ data/source_assets/deforestation/000007/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
84
+ data/source_assets/deforestation/000007/cache/s2/pre_3.tif filter=lfs diff=lfs merge=lfs -text
85
+ data/source_assets/deforestation/000029/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
86
+ data/source_assets/deforestation/000029/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
87
+ data/source_assets/deforestation/000029/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
88
+ data/source_assets/deforestation/000029/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
89
+ data/source_assets/deforestation/000029/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
90
+ data/source_assets/deforestation/000029/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
91
+ data/source_assets/deforestation/000029/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
92
+ data/source_assets/deforestation/000029/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
93
+ data/source_assets/deforestation/000029/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
94
+ data/source_assets/deforestation/000029/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
95
+ data/source_assets/deforestation/000029/cache/s2/pre_3.tif filter=lfs diff=lfs merge=lfs -text
96
+ data/source_assets/deforestation/000086/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
97
+ data/source_assets/deforestation/000086/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
98
+ data/source_assets/deforestation/000086/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
99
+ data/source_assets/deforestation/000086/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
100
+ data/source_assets/deforestation/000086/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
101
+ data/source_assets/deforestation/000086/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
102
+ data/source_assets/deforestation/000086/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
103
+ data/source_assets/deforestation/000086/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
104
+ data/source_assets/deforestation/000086/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
105
+ data/source_assets/deforestation/000086/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
106
+ data/source_assets/deforestation/000102/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
107
+ data/source_assets/deforestation/000102/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
108
+ data/source_assets/deforestation/000102/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
109
+ data/source_assets/deforestation/000102/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
110
+ data/source_assets/deforestation/000102/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
111
+ data/source_assets/deforestation/000102/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
112
+ data/source_assets/deforestation/000102/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
113
+ data/source_assets/deforestation/000102/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
114
+ data/source_assets/deforestation/000102/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
115
+ data/source_assets/deforestation/000102/cache/s2/pre_3.tif filter=lfs diff=lfs merge=lfs -text
116
+ data/source_assets/deforestation/000105/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
117
+ data/source_assets/deforestation/000105/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
118
+ data/source_assets/deforestation/000105/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
119
+ data/source_assets/deforestation/000105/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
120
+ data/source_assets/deforestation/000105/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
121
+ data/source_assets/deforestation/000105/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
122
+ data/source_assets/deforestation/000105/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
123
+ data/source_assets/deforestation/000105/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
124
+ data/source_assets/deforestation/000105/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
125
+ data/source_assets/deforestation/000105/cache/s2/pre_3.tif filter=lfs diff=lfs merge=lfs -text
126
+ data/source_assets/deforestation/000106/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
127
+ data/source_assets/deforestation/000106/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
128
+ data/source_assets/deforestation/000106/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
129
+ data/source_assets/deforestation/000106/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
130
+ data/source_assets/deforestation/000106/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
131
+ data/source_assets/deforestation/000106/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
132
+ data/source_assets/deforestation/000106/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
133
+ data/source_assets/deforestation/000106/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
134
+ data/source_assets/deforestation/000106/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
135
+ data/source_assets/deforestation/000106/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
136
+ data/source_assets/deforestation/000106/cache/s2/pre_3.tif filter=lfs diff=lfs merge=lfs -text
137
+ data/source_assets/deforestation/000113/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
138
+ data/source_assets/deforestation/000113/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
139
+ data/source_assets/deforestation/000113/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
140
+ data/source_assets/deforestation/000113/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
141
+ data/source_assets/deforestation/000113/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
142
+ data/source_assets/deforestation/000113/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
143
+ data/source_assets/deforestation/000113/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
144
+ data/source_assets/deforestation/000113/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
145
+ data/source_assets/deforestation/000113/cache/s2/pre_1.tif filter=lfs diff=lfs merge=lfs -text
146
+ data/source_assets/deforestation/000113/cache/s2/pre_2.tif filter=lfs diff=lfs merge=lfs -text
147
+ data/source_assets/deforestation/000135/cache/s1_grd/s1_00.tif filter=lfs diff=lfs merge=lfs -text
148
+ data/source_assets/deforestation/000135/cache/s1_grd/s1_03.tif filter=lfs diff=lfs merge=lfs -text
149
+ data/source_assets/deforestation/000135/cache/s1_grd/s1_06.tif filter=lfs diff=lfs merge=lfs -text
150
+ data/source_assets/deforestation/000135/cache/s1_grd/s1_09.tif filter=lfs diff=lfs merge=lfs -text
151
+ data/source_assets/deforestation/000135/cache/s1_grd/s1_11.tif filter=lfs diff=lfs merge=lfs -text
152
+ data/source_assets/deforestation/000135/cache/s2/post_1.tif filter=lfs diff=lfs merge=lfs -text
153
+ data/source_assets/deforestation/000135/cache/s2/post_2.tif filter=lfs diff=lfs merge=lfs -text
154
+ data/source_assets/deforestation/000135/cache/s2/post_3.tif filter=lfs diff=lfs merge=lfs -text
data/ATTRIBUTIONS.md ADDED
@@ -0,0 +1,500 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Source Provenance, Citations, and Upstream Terms
2
+
3
+ Verified against the packaged files and official provider pages on 2026-10-14.
4
+ This document is the source registry for `source_assets/`; it is not legal
5
+ advice and does not replace upstream terms.
6
+
7
+ ## License boundary
8
+
9
+ The GeoDisaster Project Contributors apply CC-BY-4.0 only to project-authored
10
+ questions, answer schemas, tool chains, documentation, and annotations for
11
+ which they hold the rights. That license does **not** relicense imagery,
12
+ rasters, labels, OSM extracts, CEMS products, or derivatives of upstream data.
13
+ Each upstream source below retains its own terms. Google Earth Engine is an
14
+ access/processing platform, not the copyright source; cite the underlying
15
+ product, not Earth Engine alone.
16
+
17
+ Status labels used below:
18
+
19
+ - **verified**: an official provider page states reuse/redistribution terms.
20
+ - **conditional**: reuse is allowed subject to attribution, share-alike,
21
+ non-commercial, or product-specific conditions that the distributor must
22
+ satisfy.
23
+
24
+ ## Family-to-source map
25
+
26
+ | Packaged family | Direct upstream data | Project-derived/support data |
27
+ |---|---|---|
28
+ | `deforestation` | Sentinel-2 SR Harmonized; Sentinel-1 GRD; Hansen GFC v1.13 | RGB previews, annual loss masks, and quality reports derived from those products |
29
+ | `multi_hazard/wildfire` | MCD64A1.061; VNP14A1.002; NIFC WFIGS incident perimeters; Sentinel-2 SR Harmonized; Landsat 8/9 C2 L2; WorldPop; OSM | dNBR and Landsat dNBR; `nifc_perimeter__event` is the clipped/rasterized authoritative incident geometry |
30
+ | `multi_hazard/deforestation` | Hansen GFC v1.13; JRC TMF v1_2023 AnnualChanges; WUR/GFW RADD v1; Sentinel-2 SR Harmonized; WorldPop; OSM | NDVI change; 2022 TMF annual loss; `radd_alerts__event` decodes official `date_conf` alerts inside the declared event window |
31
+ | `multi_hazard/urban_expansion` | Dynamic World V1; GHSL P2023A GHS_BUILT_S; ESA WorldCover v100/v200; Sentinel-2 SR Harmonized; WorldPop; OSM | NDBI change and source-native built-gain masks |
32
+ | `multi_hazard/drought` | CHIRPS Daily; ERA5-Land Daily Aggregated; MOD13Q1.061; VNP21A1D.002; WorldPop; OSM | SPI/NDVI anomalies and drought masks; VNP21 LST is optional context and two QA-empty AOIs are explicitly omitted |
33
+ | `multi_hazard/air_pollution` | Sentinel-5P OFFL L3 NO2/SO2/CO; MCD19A2.061; CAMS NRT total-column NO2; WorldPop; OSM | Train-only S5P quartile footprint and per-source regional-intensity normalization; no WHO or surface-health claim |
34
+ | `routing` | Sentinel-2 L2A; CEMS On-Demand Mapping flood products; OpenStreetMap | OSMnx-derived road graphs, candidate routes, scores, selected routes, and rendered overlays |
35
+ | `sen1_flood` | Sen1Floods11 packaging of Sentinel-1, Sentinel-2, JRC Global Surface Water, and hand labels | Public previews/packaged overlays; LabelHand-derived hidden reference files excluded from agent inputs; current S1-only Otsu runtime outputs |
36
+ | `xbd_damage` | xBD/xView2 imagery and damage labels supplied through the project’s coauthor-managed preparation | Coordinate conversions, grids/quadrants, masks, questions, and deterministic summaries |
37
+
38
+ ## Complete development-snapshot registry
39
+
40
+ This registry classifies the **10,831 physical files** in the complete internal
41
+ development snapshot. That inventory includes files named directly by the
42
+ canonical records, files reached through a declared sample-directory handle,
43
+ optional context, evaluator-only hidden/reference files, support exports, and
44
+ GDAL `.aux.xml` sidecars. The public thin release contains **9,328** source
45
+ files. Running the pinned Sen1Floods11 hydrator adds exactly 300 execution files
46
+ (100 `S1Hand.tif`, 100 `JRCWaterHand.tif`, and 100 generated
47
+ `S1Portable.tif` files), producing a **9,628-file hydrated execution release**.
48
+ The remaining internal Sen1Floods11 labels, cached derivatives, and hidden
49
+ evaluation products in this table are not public agent inputs.
50
+
51
+ “Required” and “optional” below refer to unique canonical path declarations;
52
+ “support/internal” means a development-snapshot file is not directly named as
53
+ an initial path. Directory-resolving worker reads are tracked by the
54
+ opened-handle exact-path authorization audit.
55
+
56
+ | Key | Packaged path family | Physical files | Canonical role | Registered origin |
57
+ |---|---|---:|---|---|
58
+ | D01 | `deforestation/*/cache/s1_grd/*.tif[.aux.xml]` | 245 | 240 required | Sentinel-1 GRD; entry 1 below. XML files are GDAL metadata sidecars. |
59
+ | D02 | `deforestation/*/cache/s2/*.tif[.aux.xml]` | 273 | 267 required | Sentinel-2 L2A; entry 2. |
60
+ | D03 | `deforestation/*/visible/s2_rgb/*.png` | 267 | 267 required | Project render derived from D02. |
61
+ | D04 | `deforestation/*/masks/*.tif[.aux.xml]` | 147 | 144 required | Hansen GFC `lossyear`, annual-loss, and tree-cover products; entry 5. |
62
+ | D05 | `deforestation/*/questions/*.json` | 384 | 384 required | Project-authored questions/schemas; CC-BY-4.0 project layer. |
63
+ | D06 | `deforestation/*/quality_report.json` | 48 | support/internal | Project-generated fetch-time reports derived from D01–D04; runtime recomputation is authoritative. |
64
+ | MH00 | `multi_hazard/<hazard>/<sample>/` | — | 108 required directory handles | Container path for the registered MH01–MH13 children. |
65
+ | MH01 | `multi_hazard/*/*/{aoi,available_handles,metadata}.*` | 324 | 108 required AOIs; remainder support | Project-authored AOI, handle, and acquisition metadata. |
66
+ | MH02 | `multi_hazard/*/*/{questions,gt,trajectories}/*.json` | 1,296 | 432 required questions; remainder internal | Project-authored questions, reference answers, and recorded tool trajectories. |
67
+ | MH03 | `multi_hazard/*/*/quality_report.json` | 108 | support/internal | Project-generated report derived from the registered rasters. |
68
+ | MH04 | `multi_hazard/{drought,air_pollution}/*/baselines/*.csv` | 123 | directory-resolved support | Derived summaries of CHIRPS, ERA5-Land, MOD13Q1, S5P NO2, CAMS AOD, and MODIS MAIAC. |
69
+ | MH05 | `multi_hazard/*/*/osm/pois.geojson` | 108 | directory-resolved support | OpenStreetMap extract; entry 21. |
70
+ | MH06 | `multi_hazard/*/*/panels/*.png` | 432 | 432 required | Project visualizations derived from the corresponding raster, WorldPop, and OSM inputs. |
71
+ | MH07 | `multi_hazard/*/*/tabular/worldpop.{tif,json}` | 216 | 216 required for D | WorldPop 2020 population and provider/source sidecar; entry 20. |
72
+ | MH08 | `multi_hazard/wildfire/*/rasters/*` | 339 | 45 required and 120 optional TIFF paths; JSON/XML support | Sentinel-2, Landsat 8/9, MCD64A1, exact VNP14A1 and NIFC WFIGS perimeter products, and derived NBR/dNBR; entries 2, 11–12, 16, and 11a. |
73
+ | MH09 | `multi_hazard/deforestation/*/rasters/*` | 368 | 92 required and 92 optional TIFF paths; JSON support | Hansen GFC, JRC TMF, Sentinel-2, exact WUR/GFW RADD, and derived NDVI products; entries 2, 5, 6, and 6a. |
74
+ | MH10 | `multi_hazard/urban_expansion/*/rasters/*` | 522 | 261 optional TIFFs; JSON support | Sentinel-2, Dynamic World, GHSL, WorldCover, and derived NDBI/built-gain products; entries 2 and 8–10. |
75
+ | MH11 | `multi_hazard/drought/*/rasters/*` | 206 | 84 required and 19 optional TIFF paths; JSON support | CHIRPS, ERA5-Land, MOD13Q1, exact VNP21A1D where QA-valid, and derived drought products; entries 13, 14, 17, and 18. |
76
+ | MH12 | `multi_hazard/air_pollution/*/rasters/*` | 280 | 80 required and 60 optional TIFF paths; JSON support | Sentinel-5P, MODIS MAIAC, exact CAMS total-column NO2, and derived benchmark-relative NO2 products; entries 4, 15, and 19. |
77
+ | MH13 | `multi_hazard/air_pollution/*/tabular/openaq_*` | 40 | support/internal | OpenAQ empty-query provenance only; entry 23. The CSVs contain headers but no measurements. |
78
+ | MH14 | `multi_hazard/air_pollution/{source_normalization.json,*/normalization.json}` | 21 | 20 required; one support copy | Identical project-authored copies of the train-only normalization contract, declared per sample so isolated evaluation has no undeclared global dependency. |
79
+ | MH15 | `multi_hazard/drought/*/drought_normalization.json` | 21 | 21 required for B/C/D | Identical project-authored copies of the train-only per-source drought quartile contract; no test sample is used to fit it. |
80
+ | R01 | `routing/{train,val,test}.json` | 3 | support exports | Project-authored routing conversations and split records; not upstream data. |
81
+ | R02 | `routing/*/copernicus/flood_extent.geojson` | 200 | 200 required | CEMS On-Demand Mapping; entry 22. |
82
+ | R03 | `routing/*/input/rgb*` | 401 | 400 required; one XML support | Sentinel-2 L2A imagery, project preview, and GDAL sidecar; entry 2. |
83
+ | R04 | `routing/*/input/metadata.json` | 200 | 200 required | Project metadata retaining Sentinel-2 item IDs and CEMS product identifiers. |
84
+ | R05 | `routing/*/derived/*` | 600 | 600 required | OSM+CEMS-derived roads, candidates, and route scores; entries 21–22. |
85
+ | R06 | `routing/*/ground_truth/selected_routes.json` | 200 | 200 required reference | Project selection from the R05 candidate products. |
86
+ | R07 | `routing/*/overlays/routes_overlay.png` | 200 | 200 required | Project render derived from Sentinel-2, OSM, CEMS, and R05. |
87
+ | S01 | `sen1_flood/*/{labels/S1Hand.tif[.aux.xml],derived/S1Portable.tif}` | 201 | 100 portable derivatives required; 100 official source TIFFs retained plus one sidecar | Sen1Floods11 Sentinel-1 chip and value-preserving finite-nodata derivative; parent entry 24 and Sentinel entry 1. |
88
+ | S02 | `sen1_flood/*/labels/JRCWaterHand.tif[.aux.xml]` | 101 | 100 optional | Sen1Floods11-packaged JRC Global Surface Water context; entries 7 and 24. |
89
+ | S03 | `sen1_flood/*/labels/LabelHand.tif[.aux.xml]` | 101 | support/internal, forbidden as answer input | Sen1Floods11 human flood labels; entry 24. |
90
+ | S04 | `sen1_flood/*/labels/S1OtsuLabelHand.tif[.aux.xml]` | 101 | support/internal, forbidden as answer input | Cached Sen1Floods11 Otsu derivative of S01; entry 24. |
91
+ | S05 | `sen1_flood/*/public/*.png` | 399 | 299 optional; 100 packaged overlays internal | Source-derived S1/S2/JRC previews plus packaged overlays; entries 1, 3, 7, and 24. The current renderer generates separate run artifacts from the current prediction handle. |
92
+ | S06 | `sen1_flood/*/hidden/*` | 600 | hidden/internal, forbidden as answer input | Project-generated binary masks, vectors, grids, components, and reports derived from Sen1Floods11 `LabelHand`, not from the current S1-only prediction. |
93
+ | X01 | `xbd_damage/*/{pre,post}.png` | 458 | 177 required and 281 optional paths | xBD/xView2 imagery; entry 25. |
94
+ | X02 | `xbd_damage/*/post_target.png` | 177 | 177 required; 52 additional optional paths explicitly absent | Mask rendering derived from xBD damage labels; entry 25. |
95
+ | X03 | `xbd_damage/*/building_damage_{xy,lnglat}.geojson` | 458 | 229 required and 229 optional | xBD damage polygons and project coordinate conversion; entry 25. |
96
+ | X04 | `xbd_damage/*/{grid_4x4,quadrants}.geojson` | 458 | 458 optional | Project-generated geometry derived from X01/X03 extents. |
97
+
98
+ The reproducible check is `release_tools/audit_c01_source_registry.py`. It is
99
+ check-only unless `--output` is supplied. `--mode thin` validates the public
100
+ archive before hydration; `--mode hydrated` requires the complete pinned
101
+ execution subset. The retained development-snapshot evidence is
102
+ `release_tools/evidence/source_asset_registry_development_snapshot.json`; it
103
+ reports zero unclassified physical files, zero unclassified referenced paths,
104
+ zero missing required paths, zero outside-repository paths, zero
105
+ `exists`-flag mismatches, and zero uncited direct raster-sidecar source labels
106
+ for the complete 10,831-file internal snapshot.
107
+
108
+ ## Product-by-product registry
109
+
110
+ ### Copernicus satellite products
111
+
112
+ 1. **Sentinel-1 GRD — `COPERNICUS/S1_GRD`.** Used for deforestation SAR
113
+ stacks and as the original SAR source inside
114
+ Sen1Floods11. Packaged patterns include
115
+ `source_assets/deforestation/*/cache/s1_grd/*.tif`,
116
+ and `source_assets/sen1_flood/*/labels/S1Hand.tif`. Product description and
117
+ processing: [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S1_GRD).
118
+ Terms: Copernicus Sentinel Data Terms and Conditions; modified data must
119
+ carry the required Copernicus notice. **Status: conditional.**
120
+
121
+ 2. **Sentinel-2 Level-2A surface reflectance —
122
+ `COPERNICUS/S2_SR_HARMONIZED`.** Used for deforestation optical stacks,
123
+ multi-hazard RGB/NBR/NDVI/NDBI inputs, routing RGB mosaics, and their
124
+ derived indices. Packaged patterns include
125
+ `source_assets/deforestation/*/cache/s2/*.tif`, all
126
+ `source_assets/multi_hazard/*/*/rasters/s2_*`, and
127
+ `source_assets/routing/*/input/rgb*`. Routing metadata records the exact
128
+ mosaic item IDs and acquisition dates per sample. Product description:
129
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2_SR_HARMONIZED).
130
+ Terms: Copernicus Sentinel Data Terms and Conditions. **Status:
131
+ conditional.**
132
+
133
+ 3. **Sentinel-2 Level-1C top-of-atmosphere imagery.** Sen1Floods11 documents
134
+ its optional S2 chips as L1C. The packaged pattern is
135
+ `source_assets/sen1_flood/*/public/s2_rgb_optional.png`. L1C reference:
136
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2_HARMONIZED).
137
+ Terms: Copernicus Sentinel Data Terms and Conditions. **Status:
138
+ conditional.**
139
+
140
+ 4. **Sentinel-5P/TROPOMI OFFL L3 NO2, SO2, and CO —
141
+ `COPERNICUS/S5P/OFFL/L3_NO2`, `COPERNICUS/S5P/OFFL/L3_SO2`, and
142
+ `COPERNICUS/S5P/OFFL/L3_CO`.** Used in
143
+ `source_assets/multi_hazard/air_pollution/*/rasters/s5p_*`. Product pages:
144
+ [NO2](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S5P_OFFL_L3_NO2),
145
+ [SO2](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S5P_OFFL_L3_SO2), and
146
+ [CO](https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S5P_OFFL_L3_CO).
147
+ Terms: Copernicus Sentinel Data Terms and Conditions. **Status:
148
+ conditional.**
149
+
150
+ ### Forest, water, land-cover, and settlement products
151
+
152
+ 5. **Hansen/UMD Global Forest Change v1.13 (2000–2025) —
153
+ `UMD/hansen/global_forest_change_2025_v1_13`.** `treecover2000` and
154
+ `lossyear` supply `source_assets/deforestation/*/masks/*` and the
155
+ multi-hazard Hansen/forest-mask handles. Official product, citation, and
156
+ CC-BY-4.0 terms:
157
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/UMD_hansen_global_forest_change_2025_v1_13),
158
+ including Hansen et al. (2013), DOI
159
+ [10.1126/science.1244693](https://doi.org/10.1126/science.1244693).
160
+ **Status: verified; attribution required.**
161
+
162
+ 6. **JRC Tropical Moist Forest v1_2023 —
163
+ `projects/JRC/TMF/v1_2023/AnnualChanges`.** The December 2021 and December
164
+ 2022 annual-state bands are differenced for class 3 (deforestation) to build
165
+ the event-aligned 2022
166
+ `source_assets/multi_hazard/deforestation/*/rasters/tmf_loss__event.*` masks.
167
+ Official access, license, and citation instructions:
168
+ [JRC TMF data access](https://forobs.jrc.ec.europa.eu/TMF/data) and
169
+ [JRC citation guidance](https://forobs.jrc.ec.europa.eu/TMF/resources).
170
+ Required map attribution: “Source: EC JRC”; cite Vancutsem et al. (2021).
171
+ **Status: verified; attribution required.**
172
+
173
+ 6a. **RADD Forest Disturbance Alerts v1 — WUR/GFW.** The official `date_conf`
174
+ tiles supply `radd_alerts__event`; values are decoded into event-window
175
+ low/high-confidence classes plus a separate binary mask. The source contract pins
176
+ the GFW archive version `v20261011`; the Earth Engine source identifier is
177
+ `projects/radar-wur/raddalert/v1`. Product description, method, and
178
+ access: [Wageningen University RADD](https://www.wur.nl/en/research/products-services/radd-forest-disturbance-alert).
179
+ The packaged source contract records CC BY 4.0. **Status: verified;
180
+ attribution required.**
181
+
182
+ 7. **JRC Global Surface Water.** The `occurrence` layer appears in
183
+ `source_assets/sen1_flood/*/labels/JRCWaterHand.tif` as known-water context.
184
+ Official terms and citation:
185
+ [JRC Global Surface Water data access](https://global-surface-water.appspot.com/download),
186
+ including Pekel et al. (2016), DOI
187
+ [10.1038/nature20584](https://doi.org/10.1038/nature20584). Required map
188
+ attribution: “Source: EC JRC/Google.” **Status: verified; attribution
189
+ required.**
190
+
191
+ 8. **Dynamic World V1 — `GOOGLE/DYNAMICWORLD/V1`.** Used by
192
+ `source_assets/multi_hazard/urban_expansion/*/rasters/dynamic_world_built__*`.
193
+ Official product, CC-BY-4.0 terms, required attribution, and paper citation:
194
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/GOOGLE_DYNAMICWORLD_V1),
195
+ Brown et al. (2022), DOI
196
+ [10.1038/s41597-022-01307-4](https://doi.org/10.1038/s41597-022-01307-4).
197
+ **Status: verified; attribution required.**
198
+
199
+ 9. **Global Human Settlement Layer P2023A —
200
+ `JRC/GHSL/P2023A/GHS_BUILT_S`.** Used by
201
+ `source_assets/multi_hazard/urban_expansion/*/rasters/ghsl_built__*` for the
202
+ 2020 and 2025 epochs. Official product and reuse terms:
203
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/JRC_GHSL_P2023A_GHS_BUILT_S).
204
+ Reuse is authorized when EC JRC/GHSL is acknowledged. **Status: verified;
205
+ attribution required.**
206
+
207
+ 10. **ESA WorldCover 10 m 2020 v100 and 2021 v200 —
208
+ `ESA/WorldCover/v100` and `ESA/WorldCover/v200`.** Class 50 supplies the
209
+ source-native pre/post masks used to derive `worldcover_built_gain`.
210
+ Official products, CC-BY-4.0 terms, and citation:
211
+ [2020 Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/ESA_WorldCover_v100),
212
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/ESA_WorldCover_v200),
213
+ Zanaga et al. (2022), DOI
214
+ [10.5281/zenodo.7254221](https://doi.org/10.5281/zenodo.7254221).
215
+ **Status: verified; attribution required.**
216
+
217
+ ### NASA/USGS fire, vegetation, temperature, aerosol, and Landsat products
218
+
219
+ 11. **MODIS MCD64A1.061 burned area — `MODIS/061/MCD64A1`.** Supplies
220
+ `mcd64a1__event`. Official product, unrestricted
221
+ redistribution statement, and DOI:
222
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MCD64A1),
223
+ [10.5067/MODIS/MCD64A1.061](https://doi.org/10.5067/MODIS/MCD64A1.061).
224
+ **Status: verified; cite NASA LP DAAC.**
225
+
226
+ 11a. **NIFC WFIGS Interagency Fire Perimeters.** Supplies
227
+ `nifc_perimeter__event` for the named 2021 Dixie and Bootleg incidents.
228
+ Exact incident features are clipped to each AOI and rasterized; this is not
229
+ an EFFIS product or an MCD64 dilation. The service layer identifier is
230
+ `WFIGS_Interagency_Perimeters/FeatureServer/0`. Authoritative ArcGIS item and its
231
+ no-warranty/appropriate-use notice:
232
+ [WFIGS Interagency Fire Perimeters](https://www.arcgis.com/home/item.html?id=5e72b1699bf74eefb3f3aff6f4ba5511).
233
+ **Status: verified public authoritative item; retain the NIFC disclaimer.**
234
+
235
+ 12. **VIIRS VNP14A1.002 active fire — `NASA/VIIRS/002/VNP14A1`.** Supplies
236
+ `viirs_active_fire__event`. Sidecars record the official 1 km native grid
237
+ separately from the 128x128 nearest-neighbor benchmark export; users must
238
+ not interpret resampling as new native resolution. Official
239
+ product, terms, and DOI:
240
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/NASA_VIIRS_002_VNP14A1),
241
+ [10.5067/VIIRS/VNP14A1.002](https://doi.org/10.5067/VIIRS/VNP14A1.002).
242
+ **Status: verified; citation requested.**
243
+
244
+ 13. **MODIS MOD13Q1.061 vegetation indices — `MODIS/061/MOD13Q1`.** Supplies
245
+ the multi-hazard drought NDVI input/anomaly. Official product and LP DAAC
246
+ terms:
247
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MOD13Q1).
248
+ **Status: verified; cite NASA LP DAAC.**
249
+
250
+ 14. **VIIRS VNP21A1D.002 Day LST and Emissivity Daily 1 km —
251
+ `NASA/VIIRS/002/VNP21A1D`.** Supplies optional `viirs_lst__target` context.
252
+ The builder masks mandatory-QA, data-quality, and cloud bits uniformly and
253
+ uses a 32-day median with nearest-neighbor export. Two AOIs have no
254
+ QA-valid pixel and therefore omit the optional handle rather than using a
255
+ proxy. Official product and terms:
256
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/NASA_VIIRS_002_VNP21A1D).
257
+ **Status: verified; cite NASA LP DAAC.**
258
+
259
+ 15. **MODIS MAIAC MCD19A2.061 AOD —
260
+ `MODIS/061/MCD19A2_GRANULES`.** Supplies `modis_aod__peak`. Official
261
+ product and LP DAAC terms:
262
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/MODIS_061_MCD19A2_GRANULES).
263
+ **Status: verified; cite NASA LP DAAC.**
264
+
265
+ 16. **USGS Landsat 8 and 9 Collection 2 Tier 1 Level 2 —
266
+ `LANDSAT/LC08/C02/T1_L2` and `LANDSAT/LC09/C02/T1_L2`.** Supplies the
267
+ wildfire Landsat NBR and derived dNBR. Official product:
268
+ [Landsat 8 catalog](https://developers.google.com/earth-engine/datasets/catalog/LANDSAT_LC08_C02_T1_L2).
269
+ USGS states there are no use or redistribution restrictions and requests a
270
+ source statement:
271
+ [USGS redistribution FAQ](https://www.usgs.gov/faqs/are-there-any-restrictions-use-or-redistribution-landsat-data).
272
+ **Status: verified; acknowledge USGS.**
273
+
274
+ ### Climate, atmosphere, population, and map data
275
+
276
+ 17. **CHIRPS Daily — `UCSB-CHG/CHIRPS/DAILY`.** Supplies rainfall used to
277
+ compute the same-window SPI/z-score. Official public-domain terms and
278
+ citation:
279
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/UCSB-CHG_CHIRPS_DAILY),
280
+ Funk et al. (2015), DOI
281
+ [10.1038/sdata.2015.66](https://doi.org/10.1038/sdata.2015.66).
282
+ **Status: verified.**
283
+
284
+ 18. **ERA5-Land Daily Aggregated — `ECMWF/ERA5_LAND/DAILY_AGGR`.** Supplies
285
+ layer-1 volumetric soil water for drought cases. Official product and
286
+ required Copernicus acknowledgement:
287
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/ECMWF_ERA5_LAND_DAILY_AGGR).
288
+ **Status: conditional; attribution required.**
289
+
290
+ 19. **CAMS Global Near-Real-Time — `ECMWF/CAMS/NRT`.** The packaged
291
+ `cams_no2__peak` uses `total_column_nitrogen_dioxide_surface` in kg m-2;
292
+ no AOD substitution or invented conversion is used. Official product and
293
+ Copernicus attribution terms:
294
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/ECMWF_CAMS_NRT).
295
+ **Status: verified; attribution required.**
296
+
297
+ 20. **WorldPop Global Project 100 m population —
298
+ `WorldPop/GP/100m/pop`, 2020 clips.** Supplies
299
+ `source_assets/multi_hazard/*/*/tabular/worldpop.tif`. Official product,
300
+ CC-BY-4.0 terms, and citation:
301
+ [Earth Engine catalog](https://developers.google.com/earth-engine/datasets/catalog/WorldPop_GP_100m_pop).
302
+ **Status: verified; clear WorldPop attribution required.**
303
+
304
+ 21. **OpenStreetMap.** Supplies multi-hazard POIs and routing road/shelter
305
+ data, including `source_assets/multi_hazard/*/*/osm/pois.geojson` and the
306
+ OSM-derived properties in `source_assets/routing/*/derived/*`. Terms and
307
+ required notice:
308
+ [OpenStreetMap copyright and licence](https://www.openstreetmap.org/copyright).
309
+ Use “© OpenStreetMap contributors” and disclose ODbL; assess whether a
310
+ released derived database triggers share-alike obligations. **Status:
311
+ conditional (ODbL 1.0).**
312
+
313
+ 22. **Copernicus Emergency Management Service On-Demand Mapping.** Supplies
314
+ `source_assets/routing/*/copernicus/flood_extent.geojson`. Each routing
315
+ sample records its `activation_code`, `product_type`, `product_id`, and
316
+ `product_key` in `input/metadata.json`. CEMS permits reproduction,
317
+ distribution, public communication, adaptation, and combination subject
318
+ to its terms and citation guidelines:
319
+ [CEMS terms and conditions](https://mapping.emergency.copernicus.eu/terms-and-conditions/).
320
+ **Status: conditional; CEMS source citation required and restricted
321
+ products must be excluded.**
322
+
323
+ 23. **OpenAQ v3.** Construction queried OpenAQ, but all accepted air-pollution
324
+ AOIs contain zero target-window measurements: `openaq_stations.csv` is
325
+ header-only and `openaq_status.json` records
326
+ `completed_no_window_measurements`. OpenAQ contributes provenance of the
327
+ empty query only, not analytical evidence or answer values. Official terms:
328
+ [OpenAQ terms of use](https://docs.openaq.org/about/terms). **Status: no
329
+ measurement payload bundled; do not cite OpenAQ as answer evidence.**
330
+
331
+ ### Parent benchmark datasets
332
+
333
+ 24. **Sen1Floods11 v1.1.** The 100 packaged flood samples retain S1, optional
334
+ S2/JRC views, and hand/cached labels from the structure documented by the
335
+ original project. The required dataset citation is Bonafilia, D., Tellman,
336
+ B., Anderson, T., and Issenberg, E. (2020), “Sen1Floods11: A Georeferenced
337
+ Dataset to Train and Test Deep Learning Flood Algorithms for Sentinel-1,”
338
+ *IEEE/CVF CVPR Workshops*, pp. 210–211. Use the
339
+ [official Cloud to Street GitHub repository and data-access instructions](https://github.com/cloudtostreet/Sen1Floods11)
340
+ together with the
341
+ [official CVPR paper](https://openaccess.thecvf.com/content_CVPRW_2020/html/w11/Bonafilia_Sen1Floods11_A_Georeferenced_Dataset_to_Train_and_Test_Deep_Learning_CVPRW_2020_paper.html).
342
+ The upstream repository provides a public bucket and citation but does not
343
+ declare an explicit dataset `LICENSE` file. The Apache-2.0 license in the
344
+ separate EOEPCA mirror is not treated as authority for Cloud to Street’s
345
+ original data. The public package therefore excludes the Sen1Floods11
346
+ payload and supplies the checksum-pinned upstream hydrator described
347
+ below. Redistributing those files instead requires written permission or
348
+ an authoritative dataset license.
349
+
350
+ 25. **xBD / xView2.** All `source_assets/xbd_damage/*` pre/post images and
351
+ damage polygons originate from xBD. Their intermediate preparation was
352
+ performed within this project by a coauthor and is not an external data
353
+ source, so that internal package is intentionally not cited. Cite Gupta et
354
+ al. (2019), DOI
355
+ [10.48550/arXiv.1911.09296](https://doi.org/10.48550/arXiv.1911.09296), the
356
+ [official xBD dataset page](https://xview2.org/dataset), and the
357
+ [CMU Software Engineering Institute xView2 project](https://www.sei.cmu.edu/projects/xview-2-challenge/).
358
+ CMU/SEI states that xBD is available for public use under a Creative
359
+ Commons license; its official
360
+ [xView2 imagery credit](https://insights.sei.cmu.edu/annual-reviews/2020-year-in-review/wildfire-response-tests-xview2-damage-assessment-prototype/)
361
+ identifies the raw imagery as CC BY-NC 4.0. Preserve attribution and
362
+ non-commercial restrictions for xBD imagery and derivatives, and do not
363
+ represent them as CC-BY-4.0.
364
+ **Status: conditional and documented; no undeclared third-party mirror is
365
+ part of the provenance chain.**
366
+
367
+ ## Sen1Floods11 download and local placement
368
+
369
+ The development workspace retains its Sen1Floods11 files for the reproducible
370
+ 2,921-record replay. The public distribution contract is a thin package: it
371
+ excludes the packaged `source_assets/sen1_flood/` payload, and users hydrate
372
+ the selected inputs directly from the official Cloud to Street bucket.
373
+
374
+ Official references:
375
+
376
+ - Repository, citation, and access instructions:
377
+ [cloudtostreet/Sen1Floods11](https://github.com/cloudtostreet/Sen1Floods11)
378
+ - Official bucket root: `gs://sen1floods11/v1.1/`
379
+ - Upstream S1 folder:
380
+ `gs://sen1floods11/v1.1/data/flood_events/HandLabeled/S1Hand/`
381
+ - Upstream JRC folder:
382
+ `gs://sen1floods11/v1.1/data/flood_events/HandLabeled/JRCWaterHand/`
383
+
384
+ Only 100 selected chips are used. The installer downloads 200 official
385
+ GeoTIFFs: one `S1Hand` raster for each chip, plus one `JRCWaterHand` raster for
386
+ the D/E known-water comparison tasks. It then generates the 100 portable S1
387
+ runtime derivatives. The resulting layout is:
388
+
389
+ ```text
390
+ source_assets/sen1_flood/<chip_id>/labels/S1Hand.tif
391
+ source_assets/sen1_flood/<chip_id>/labels/JRCWaterHand.tif
392
+ source_assets/sen1_flood/<chip_id>/derived/S1Portable.tif
393
+ ```
394
+
395
+ The upstream filenames include the chip ID, whereas the benchmark-local names
396
+ do not. For example:
397
+
398
+ ```text
399
+ gs://sen1floods11/v1.1/data/flood_events/HandLabeled/S1Hand/Bolivia_103757_S1Hand.tif
400
+ -> source_assets/sen1_flood/Bolivia_103757/labels/S1Hand.tif
401
+
402
+ gs://sen1floods11/v1.1/data/flood_events/HandLabeled/JRCWaterHand/Bolivia_103757_JRCWaterHand.tif
403
+ -> source_assets/sen1_flood/Bolivia_103757/labels/JRCWaterHand.tif
404
+ ```
405
+
406
+ From the repository root, the supported installer hydrates exactly the pinned
407
+ 100-chip subset over the official bucket's public HTTPS endpoint. It downloads
408
+ atomically and accepts a file only when both its byte size and SHA-256 match
409
+ the pinned manifest:
410
+
411
+ ```bash
412
+ # Inspect the plan without writing files.
413
+ python3 release_tools/fetch_sen1floods11_subset.py --dry-run
414
+
415
+ # Download missing files, retaining already verified files.
416
+ python3 release_tools/fetch_sen1floods11_subset.py
417
+
418
+ # Verify an existing installation without network access.
419
+ python3 release_tools/fetch_sen1floods11_subset.py --verify-only
420
+ ```
421
+
422
+ The installer is `release_tools/fetch_sen1floods11_subset.py`; its immutable
423
+ selection, official source URLs, local destinations, sizes, and checksums are
424
+ in `release_tools/manifests/sen1floods11_required_100.json`. It refuses to
425
+ overwrite a mismatched existing file unless the user explicitly supplies
426
+ `--replace-mismatched`. After verifying an official S1 file, it creates or
427
+ validates `S1Portable.tif` by replacing only non-finite/declared-nodata pixels
428
+ with `-9999.0`; valid values and georeferencing are unchanged. The manifest is
429
+ bound to canonical dataset SHA-256
430
+ `03988b960e6b09ae01fb622fe45b35d763eb705485cddc3cea68bcac7ae63fe1`, so a
431
+ changed canonical file requires an explicit manifest update rather than silently changing the
432
+ download selection.
433
+
434
+ For transparency, this is the equivalent unpinned `gsutil` procedure. The
435
+ manifest-backed installer above is preferred because this loop does not check
436
+ integrity:
437
+
438
+ ```bash
439
+ for chip_id in $(python3 -c 'import json; print(" ".join(sorted({r["sample_id"] for r in map(json.loads, open("data/core/geodisaster_2921_source_with_splits.jsonl")) if r["id"].startswith("sen1_flood/")})))'); do
440
+ mkdir -p "source_assets/sen1_flood/${chip_id}/labels"
441
+ gsutil cp \
442
+ "gs://sen1floods11/v1.1/data/flood_events/HandLabeled/S1Hand/${chip_id}_S1Hand.tif" \
443
+ "source_assets/sen1_flood/${chip_id}/labels/S1Hand.tif"
444
+ gsutil cp \
445
+ "gs://sen1floods11/v1.1/data/flood_events/HandLabeled/JRCWaterHand/${chip_id}_JRCWaterHand.tif" \
446
+ "source_assets/sen1_flood/${chip_id}/labels/JRCWaterHand.tif"
447
+ done
448
+ ```
449
+
450
+ The current benchmark does **not** require users to download `LabelHand`,
451
+ `S1OtsuLabelHand`, hidden reference products, prepared overlays, or Sentinel-2
452
+ chips. `LabelHand`, cached Otsu labels, and `hidden/*` are forbidden answer
453
+ inputs. Cached Otsu files are explicitly excluded by
454
+ `release_tools/manifests/c10_excluded_legacy_rasters.json`. Public S1/JRC
455
+ previews may be generated locally but are not analytical inputs. The official
456
+ selected S1+JRC download is approximately 157 MiB; generated portable S1 files
457
+ add approximately 145 MiB locally.
458
+
459
+ The public-release builder enforces this contract:
460
+
461
+ 1. All 1,503 development files below `source_assets/sen1_flood/` are excluded
462
+ from the published archive; the complete development snapshot is preserved.
463
+ 2. The installer and pinned 100-chip checksum manifest are bound to the
464
+ canonical dataset SHA-256.
465
+ 3. `JRCWaterHand` is a required declared input for D/E; A/B/C do not receive
466
+ that handle.
467
+ 4. Optional previews not regenerated by the installer are not required agent
468
+ inputs.
469
+ 5. A hydrated release must pass the source-registry/path audit and complete
470
+ 500-question Sen1 replay before upload.
471
+
472
+ ## Project-derived and software-only items
473
+
474
+ - Raster indices, threshold masks, panels, grids, polygons, route scores,
475
+ reports, and overlays are transformations or combinations of the applicable
476
+ inputs above. Their provenance is inherited; project authorship does not
477
+ erase upstream conditions.
478
+ - The source contracts use `nifc_perimeter__event`, `radd_alerts__event`,
479
+ `viirs_lst__target`, `cams_no2__peak`, and `viirs_active_fire__event`
480
+ sidecars identify the exact products, bands, physical units, native
481
+ resolutions, transformations, and checksums. Air-pollution classes are
482
+ benchmark-relative column/intensity states, not WHO or health categories.
483
+ - OSMnx is software used to create routing products, not a data source. Cite
484
+ Boeing (2025), DOI [10.1111/gean.70009](https://doi.org/10.1111/gean.70009);
485
+ OSMnx itself is MIT licensed. See the
486
+ [official documentation](https://osmnx.readthedocs.io/en/stable/).
487
+ - Google Earth Engine is the processing/access platform for many cached
488
+ products. Its use does not replace any product-specific citation or terms.
489
+ - The project-authored JSONL records, questions, schemas, and chains may be
490
+ CC-BY-4.0, but a mixed-source archive containing `source_assets/` must use a
491
+ mixed/custom license declaration and ship this registry.
492
+
493
+ ## Release licensing requirements
494
+
495
+ xBD provenance is attributed to the original xBD/xView2 sources, while the
496
+ coauthor-managed preparation is treated as an internal project transformation.
497
+ The public package uses the Sen1Floods11 thin-release procedure above unless
498
+ an explicit redistribution license is obtained. Every release must also
499
+ retain the required upstream notices and apply the ODbL requirements to any
500
+ released routing or POI databases.
data/README.md ADDED
@@ -0,0 +1,289 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ pretty_name: GeoDisaster Agentic 2921 (Multi-Agent + Single-Agent Tool-Use Chains)
6
+ tags:
7
+ - geospatial
8
+ - remote-sensing
9
+ - disaster-response
10
+ - earth-observation
11
+ - tool-use
12
+ - agentic
13
+ - multi-agent
14
+ - single-agent
15
+ - supervised-fine-tuning
16
+ - reasoning-chains
17
+ task_categories:
18
+ - question-answering
19
+ - image-text-to-text
20
+ size_categories:
21
+ - 1K<n<10K
22
+ configs:
23
+ - config_name: evaluation_inputs
24
+ data_files:
25
+ - split: test
26
+ path: data/core/geodisaster_2921_test_inputs.jsonl
27
+ - config_name: multi_agent
28
+ data_files:
29
+ - split: train
30
+ path: data/multi_agent/train_conversations.jsonl
31
+ - split: test
32
+ path: data/multi_agent/test_conversations.jsonl
33
+ - config_name: single_agent
34
+ data_files:
35
+ - split: train
36
+ path: data/single_agent/train_conversations.jsonl
37
+ - split: test
38
+ path: data/single_agent/test_reference_conversations.jsonl
39
+ - config_name: single_agent_sft
40
+ data_files:
41
+ - split: train
42
+ path: data/single_agent/train_turns.jsonl
43
+ - split: test
44
+ path: data/single_agent/test_turns.jsonl
45
+ - config_name: multi_agent_sft_orc
46
+ data_files:
47
+ - split: train
48
+ path: data/multi_agent/sft_train/orc_train.jsonl
49
+ - split: test
50
+ path: data/multi_agent/sft_test/orc_eval.jsonl
51
+ - config_name: multi_agent_sft_ga
52
+ data_files:
53
+ - split: train
54
+ path: data/multi_agent/sft_train/ga_train.jsonl
55
+ - split: test
56
+ path: data/multi_agent/sft_test/ga_eval.jsonl
57
+ - config_name: multi_agent_sft_pa
58
+ data_files:
59
+ - split: train
60
+ path: data/multi_agent/sft_train/pa_train.jsonl
61
+ - split: test
62
+ path: data/multi_agent/sft_test/pa_eval.jsonl
63
+ - config_name: multi_agent_sft_vra
64
+ data_files:
65
+ - split: train
66
+ path: data/multi_agent/sft_train/vra_train.jsonl
67
+ - split: test
68
+ path: data/multi_agent/sft_test/vra_eval.jsonl
69
+ - config_name: core
70
+ data_files:
71
+ - split: train
72
+ path: data/core/geodisaster_2921_train_source.jsonl
73
+ - split: test
74
+ path: data/core/geodisaster_2921_test_source.jsonl
75
+ ---
76
+
77
+ # GeoDisaster Agentic 2921
78
+
79
+ Ground-truth **agentic tool-use chains** for geospatial disaster analysis: **2,921 tasks**, each a
80
+ question grounded in real Earth-observation artifacts (optical/SAR imagery, forest masks, hazard
81
+ rasters, building-damage polygons, routing graphs), solved end-to-end by a tool-using agent — in
82
+ **two settings**:
83
+
84
+ - **single-agent** — one agent plans + calls tools itself.
85
+ - **multi-agent** — orchestrator **ORC** delegates to specialists **GA / PA / VRA**.
86
+
87
+ **2,921 tasks** (train 2,629 / test 292) · **43 question types** · 5 families:
88
+ `deforestation`, `multi_hazard`, `xbd_damage`, `routing`, `sen1_flood`.
89
+
90
+ ## IDs & paths
91
+
92
+ Each record has `id` = `"<family>/<sample>/<question_type>"` (e.g.
93
+ `deforestation/000086/multi_year_loss_attribution`) — the key that links the same task across all
94
+ forms — plus `sample_id` and `question_type`. Artifacts live at `source_assets/<family>/<sample>/…`.
95
+
96
+ ## Tool ownership
97
+
98
+ | Role | Tools |
99
+ |---|---|
100
+ | **ORC** | plans & delegates (no tools) |
101
+ | **GA** | ReadData, PrepareScene, MeasureArea, ExtractObjects, MapFlood, RenderMap |
102
+ | **PA** | ComputeStats, CompareSources, DetectChange, ClassifyChange, ScoreHazard, EstimateExposure, RankRegions, PlanRoutes, CompareRoutes |
103
+ | **VRA** | AssessDamage, DescribeFlood, CompareScenes |
104
+
105
+ ## Files & forms
106
+
107
+ ```
108
+ data/
109
+ core/ geodisaster_2921_{train,test}_source.jsonl # evaluator/reference task specs
110
+ geodisaster_2921_test_inputs.jsonl # gold-free agent-visible test view
111
+ single_agent/
112
+ {train_conversations,test_reference_conversations}.jsonl # full episodes
113
+ {train_turns,test_turns}.jsonl # per-turn SFT rows
114
+ single_agent_system_prompt.md
115
+ multi_agent/
116
+ {train,test}_conversations.jsonl # full ORC↔GA/PA/VRA episodes
117
+ sft_{train,test}/{orc,ga,pa,vra}_{train,eval}.jsonl # weighted per-role SFT rows
118
+ tool_ownership_and_prompt_context.md
119
+ source_assets/ bundled inputs; pinned installer hydrates Sen1Floods11 execution inputs
120
+ user-guide-final.md authoritative benchmark, runtime, release, and 43-type guide
121
+ ATTRIBUTIONS.md upstream sources & licenses
122
+ SHA256SUMS integrity manifest for the distributable thin archive
123
+ ```
124
+
125
+ `SHA256SUMS` deliberately excludes locally hydrated
126
+ `source_assets/sen1_flood/` files. Those 300 files are verified against the
127
+ pinned upstream manifest by the hydrator itself.
128
+
129
+ Read `user-guide-final.md` for the complete current contract. It is the sole
130
+ task, interpretation, runtime, and release guide included in the package.
131
+
132
+ The same 2,921 tasks come in three forms: **core** (task spec + GT toolchain + answer),
133
+ **conversation** (full episode: question → turns → answer), **turns** (the episode sliced to one
134
+ assistant target per row, for SFT). All files are JSONL (one record per line).
135
+
136
+ The release contains 2,629 train and 292 test tasks in each full agent form. Its turn-level
137
+ training projections contain 35,195 multi-agent role rows and 20,453 single-agent rows (55,648
138
+ total). All 5,842 terminal targets use the same reference-only action contract.
139
+
140
+ The only multi-agent role-SFT locations are `data/multi_agent/sft_train/` and
141
+ `data/multi_agent/sft_test/`. Every conversation and SFT row carries the shared
142
+ `id`, `sample_id`, and `question_type` identity fields. Packaged inputs use
143
+ repository-relative paths; non-distributed replay outputs, when mentioned in
144
+ teacher evidence, use portable `generated-artifact://` logical locators.
145
+
146
+ In the 500 Sen1Floods11 records, `exists: true` describes the hydrated
147
+ execution contract. The thin public archive intentionally lacks the exact 200
148
+ manifest-declared S1/JRC source paths until the pinned installer downloads and
149
+ verifies them and generates the 100 portable execution rasters.
150
+
151
+ ## Dataset structure (fields per record)
152
+
153
+ **Shared (all files):** `id` (string, unique linking key) · `sample_id` (string) ·
154
+ `question_type` (string).
155
+
156
+ **`data/multi_agent/{train,test}_conversations.jsonl`** — one full episode:
157
+
158
+ | Field | Type | Meaning |
159
+ |---|---|---|
160
+ | `raw_question` | string | plain question used to construct active ORC/specialist prompts |
161
+ | `question` | string | stored evaluator/display context: question + declared input handles + answer schema; executable prompts use `raw_question` plus sanitized handle cards and keep the schema runtime-side |
162
+ | `initial_artifacts` | object | handle cards `{path,label,exists,optional}`; lists each file once |
163
+ | `available_initial_handles` | list | handle names the task exposes |
164
+ | `plan` | object | ORC plan `{goal, steps:[{id,agent,subtask,needs}]}` |
165
+ | `multiagentic_gt_chain` | list | turn-by-turn episode (USER↔ORC↔GA/PA/VRA) with actions + observations |
166
+ | `executions` | list | per-step `{action, tool_output}` log |
167
+ | `expected_final_answer` | object | canonical audit copy; core JSONL is authoritative |
168
+ | `final_answer_ref` | string | terminal transport token, always `ANSWER_JSON:answer_1` |
169
+ | `resolved_final_answer` | object | schema-valid worker projection resolved by the runtime |
170
+ | `resolved_answer_sha256` | string | canonical-JSON checksum linking derived exports |
171
+ | `resolved_answer_provenance` | string | whether the export retained full worker evidence or used its validated compact-trace cache |
172
+ | `answer_support` | object | supporting evidence metadata |
173
+ | `pure_toolchain_sim_status` | string | replay status |
174
+
175
+ **`data/single_agent/{train_conversations,test_reference_conversations}.jsonl`:** `messages`
176
+ (chat turns `{role,content}`), `tool_sequence` (list), `final_answer_ref`, and
177
+ `resolved_answer_sha256` linking the corresponding verified multi-agent payload.
178
+
179
+ **`data/single_agent/{train_turns,test_turns}.jsonl`** (SFT): `messages` (context → one assistant
180
+ target), `kind`, `assistant_action`, `assistant_turn_index`.
181
+
182
+ **`data/multi_agent/sft_{train,test}/...jsonl`** (SFT): `messages`, `role`, `step_id`,
183
+ `turn_no`, `kind`.
184
+
185
+ **`data/core/..._source.jsonl`:** `question` (obj), `initial_artifacts`, `available_initial_handles`,
186
+ `gt_chain` (canonical tool sequence), `expected_final_answer`, `source_replay`, `path_summary`,
187
+ `split_seed`.
188
+
189
+ **Splits:** train 2,629 / test 292 per form. They are disjoint by `id`, source
190
+ sample, declared path, normalized routing content, and exact complete
191
+ model-visible single-agent trajectory. Exact episodes retained within one
192
+ split use inverse complete-trajectory multiplicity in `training_weight`.
193
+
194
+ ## Public-reference evaluation isolation
195
+
196
+ Use `data/core/geodisaster_2921_test_inputs.jsonl` as the only test-record file
197
+ visible to an evaluated agent. The canonical, `test_source`, multi-agent test
198
+ conversations, and single-agent test-reference files contain evaluator targets
199
+ and must remain evaluator-side.
200
+
201
+ For filesystem isolation, build a fresh root containing only the 292 test
202
+ records and their permitted inputs:
203
+
204
+ ```bash
205
+ python3 release_tools/build_isolated_test_bundle.py --output /path/outside/repository/eval_bundle
206
+ export GEODISASTER_DATASET_ROOT=/path/outside/repository/eval_bundle
207
+ export GEODISASTER_STRICT_DATA_ROOT=1
208
+ ```
209
+
210
+ The builder rejects private path declarations, omits `gt/`, `ground_truth/`,
211
+ `hidden/`, and trajectory products when a declared input is a directory, and
212
+ writes a SHA-256 file manifest. Strict runtime mode disables fallback searches
213
+ through the development repository. Keep gold scoring in a separate evaluator
214
+ process or mount; never mount the repository root into the agent/tool sandbox.
215
+
216
+ ## Example instances
217
+
218
+ Core (task spec):
219
+ ```json
220
+ {"id":"deforestation/000086/multi_year_loss_attribution","sample_id":"000086",
221
+ "question_type":"multi_year_loss_attribution",
222
+ "question":{"handle":"question_1","text":"… identify the year with the largest forest loss …"},
223
+ "initial_artifacts":{"forest_loss_history_1":{"handle":"forest_loss_history_1","type":"forest_loss_history","paths":{"…":[{"path":"source_assets/deforestation/000086/masks/lossyear.tif","label":"lossyear.tif","exists":true,"optional":false}]}}},
224
+ "gt_chain":[{"tool":"ReadData","args":{"input":"forest_loss_history_1"}},{"tool":"ComputeStats","args":{}}],
225
+ "expected_final_answer":{"year":2016,"loss_ha":201.039833}}
226
+ ```
227
+
228
+ Single-agent conversation:
229
+ ```json
230
+ {"id":"deforestation/000086/multi_year_loss_attribution","sample_id":"000086","question_type":"multi_year_loss_attribution",
231
+ "tool_sequence":["ReadData","PrepareScene","ComputeStats","DetectChange"],
232
+ "messages":[{"role":"system","content":"You are a single geospatial-disaster tool-use agent. …"},
233
+ {"role":"user","content":"QUESTION …\n\nAVAILABLE INPUT HANDLES\n- forest_loss_history_1: …"},
234
+ {"role":"assistant","content":"{\"thought\":\"…\",\"action\":{\"tool\":\"ReadData\",\"args\":{\"input\":\"forest_loss_history_1\"}}}"},
235
+ {"role":"assistant","content":"{\"thought\":\"…\",\"action\":{\"tool\":\"FinalAnswer\",\"answer_ref\":\"ANSWER_JSON:answer_1\"}}"}]}
236
+ ```
237
+
238
+ Multi-agent: same `id`, plus `plan`, `multiagentic_gt_chain` (USER/ORC/GA/PA/VRA turns), `executions`,
239
+ `final_answer_ref`, `resolved_final_answer`, and `expected_final_answer`. Every role-SFT row carries
240
+ the exact system-prompt snapshot used for that target. The standalone single-agent prompt and the
241
+ multi-agent role/tool context are also included with the data; executable prompt builders live in
242
+ the code repository and are authoritative at inference.
243
+
244
+ The reference is transport, not a second answer format. Agents never reproduce large answer JSON.
245
+ The runtime owns `answer_1`, creates it only from a schema-valid projection of worker evidence,
246
+ resolves it at termination, and passes the resolved JSON to the strict evaluator. Missing or unknown
247
+ references fail explicitly; there is no gold-answer or best-effort fallback during live execution.
248
+ `TaskComplete` closes one specialist subgoal and never carries the final answer. Multi-agent ORC
249
+ uses `Terminate`; the single-agent baseline uses `FinalAnswer`; both carry exactly
250
+ `ANSWER_JSON:answer_1`.
251
+
252
+ The active answer policy is `data/core/scoring_policy_43.json`
253
+ (`geodisaster_structured_answer_v2`). A v1 policy name nested under
254
+ `correction_provenance.publication_contract` records the historical publication
255
+ pass and does not configure evaluation. Values under
256
+ `correction_provenance.evidence` are opaque build-run provenance labels, not
257
+ runtime filesystem paths and not agent inputs. Single-agent learning consists of SFT
258
+ and deterministic/live evaluation; GRPO/RCEA is supported only for the four
259
+ multi-agent roles.
260
+
261
+ ## Load
262
+
263
+ ```python
264
+ from datasets import load_dataset
265
+ multi = load_dataset("vimageiitb/geodisaster-agentic-2921", "multi_agent")
266
+ single = load_dataset("vimageiitb/geodisaster-agentic-2921", "single_agent")
267
+ single_sft = load_dataset("vimageiitb/geodisaster-agentic-2921", "single_agent_sft")
268
+ ga_sft = load_dataset("vimageiitb/geodisaster-agentic-2921", "multi_agent_sft_ga")
269
+ core = load_dataset("vimageiitb/geodisaster-agentic-2921", "core")
270
+ eval_inputs = load_dataset("vimageiitb/geodisaster-agentic-2921", "evaluation_inputs")
271
+ ```
272
+ Or read any JSONL line-by-line.
273
+
274
+ ## Sources & license
275
+
276
+ Project-authored annotations/questions/chains: **CC-BY-4.0**. This repository as
277
+ a whole is **mixed-license**, so the dataset-card license is `other`. Bundled
278
+ `source_assets/` retain their upstream terms. xBD is attributed to the original
279
+ xBD/xView2 sources and remains non-commercial. The public package excludes the
280
+ Sen1Floods11 payload; users hydrate the pinned 100-chip S1/JRC subset directly
281
+ from the official bucket with:
282
+
283
+ ```bash
284
+ python3 release_tools/fetch_sen1floods11_subset.py
285
+ python3 release_tools/fetch_sen1floods11_subset.py --verify-only
286
+ ```
287
+
288
+ See the exact provenance, download, integrity, and placement details in
289
+ [`ATTRIBUTIONS.md`](ATTRIBUTIONS.md).
data/SHA256SUMS ADDED
The diff for this file is too large to render. See raw diff
 
data/data/core/answer_schemas_43.json ADDED
The diff for this file is too large to render. See raw diff
 
data/data/core/geodisaster_2921_source_with_splits.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:03988b960e6b09ae01fb622fe45b35d763eb705485cddc3cea68bcac7ae63fe1
3
+ size 22520302
data/data/core/geodisaster_2921_test_inputs.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/data/core/geodisaster_2921_test_source.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/data/core/geodisaster_2921_train_source.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e836cc39477a381302d3dd65bbe5beb73e3479ec7533e2fc9f48d154397917a8
3
+ size 20270854
data/data/core/scoring_policy_43.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "geodisaster_structured_answer_v2",
3
+ "answer_contract": "A prediction must be a JSON value with exactly the reference object keys, value types, null states, string values, and array order.",
4
+ "numeric": {
5
+ "absolute_tolerance": 1e-06,
6
+ "relative_tolerance": 0.0,
7
+ "finite_values_required": true
8
+ },
9
+ "objects": {
10
+ "required_keys": "all reference keys",
11
+ "extra_keys_allowed": false
12
+ },
13
+ "arrays": {
14
+ "order_sensitive": true,
15
+ "length_must_match": true
16
+ },
17
+ "diagnostic_only_metrics": [
18
+ "token_f1",
19
+ "sequence_ratio"
20
+ ],
21
+ "forbidden_correctness_shortcut": "numeric subset matching",
22
+ "public_test_policy": "public reference split; not a secret/blind leaderboard test"
23
+ }
data/data/multi_agent/manifest.json ADDED
@@ -0,0 +1,278 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "geodisaster_multi_agent_release_v3",
3
+ "canonical_source": "data/core/geodisaster_2921_source_with_splits.jsonl",
4
+ "canonical_sha256": "03988b960e6b09ae01fb622fe45b35d763eb705485cddc3cea68bcac7ae63fe1",
5
+ "tool_ownership": {
6
+ "GA": [
7
+ "ReadData",
8
+ "PrepareScene",
9
+ "MeasureArea",
10
+ "ExtractObjects",
11
+ "MapFlood",
12
+ "RenderMap"
13
+ ],
14
+ "PA": [
15
+ "ComputeStats",
16
+ "CompareSources",
17
+ "DetectChange",
18
+ "ClassifyChange",
19
+ "ScoreHazard",
20
+ "EstimateExposure",
21
+ "RankRegions",
22
+ "PlanRoutes",
23
+ "CompareRoutes"
24
+ ],
25
+ "VRA": [
26
+ "AssessDamage",
27
+ "DescribeFlood",
28
+ "CompareScenes"
29
+ ]
30
+ },
31
+ "splits": {
32
+ "train": {
33
+ "records": 2629,
34
+ "conversations": "data/multi_agent/train_conversations.jsonl",
35
+ "summary": {
36
+ "records": 2629,
37
+ "question_type_count": 43,
38
+ "plan_steps_mean": 2.5245,
39
+ "plan_step_counts_by_agent": {
40
+ "GA": 2899,
41
+ "PA": 2381,
42
+ "VRA": 1357
43
+ },
44
+ "tool_call_counts": {
45
+ "ReadData": 4414,
46
+ "PrepareScene": 2629,
47
+ "AssessDamage": 907,
48
+ "RankRegions": 699,
49
+ "ComputeStats": 546,
50
+ "PlanRoutes": 540,
51
+ "MapFlood": 450,
52
+ "DescribeFlood": 450,
53
+ "CompareSources": 449,
54
+ "ExtractObjects": 422,
55
+ "CompareRoutes": 360,
56
+ "ScoreHazard": 346,
57
+ "EstimateExposure": 277,
58
+ "RenderMap": 270,
59
+ "ClassifyChange": 215,
60
+ "DetectChange": 86,
61
+ "CompareScenes": 49,
62
+ "MeasureArea": 43
63
+ },
64
+ "role_tool_call_counts": {
65
+ "GA::ReadData": 4414,
66
+ "GA::PrepareScene": 2629,
67
+ "VRA::AssessDamage": 907,
68
+ "PA::RankRegions": 699,
69
+ "PA::ComputeStats": 546,
70
+ "PA::PlanRoutes": 540,
71
+ "GA::MapFlood": 450,
72
+ "VRA::DescribeFlood": 450,
73
+ "PA::CompareSources": 449,
74
+ "GA::ExtractObjects": 422,
75
+ "PA::CompareRoutes": 360,
76
+ "PA::ScoreHazard": 346,
77
+ "PA::EstimateExposure": 277,
78
+ "GA::RenderMap": 270,
79
+ "PA::ClassifyChange": 215,
80
+ "PA::DetectChange": 86,
81
+ "VRA::CompareScenes": 49,
82
+ "GA::MeasureArea": 43
83
+ },
84
+ "question_type_counts": {
85
+ "deforestation_data::forest_loss_detection": 43,
86
+ "deforestation_data::area_estimation": 43,
87
+ "deforestation_data::change_window_estimation": 43,
88
+ "deforestation_data::false_positive_rejection": 43,
89
+ "deforestation_data::baseline_canopy_assessment": 43,
90
+ "deforestation_data::multi_year_loss_attribution": 43,
91
+ "deforestation_data::cross_modal_concordance": 43,
92
+ "deforestation_data::severity_proxy_numeric": 43,
93
+ "data/multi_hazard::wildfire:A": 13,
94
+ "data/multi_hazard::wildfire:B": 13,
95
+ "data/multi_hazard::wildfire:C": 13,
96
+ "data/multi_hazard::wildfire:D": 13,
97
+ "data/multi_hazard::deforestation:A": 21,
98
+ "data/multi_hazard::deforestation:B": 21,
99
+ "data/multi_hazard::deforestation:C": 21,
100
+ "data/multi_hazard::deforestation:D": 21,
101
+ "data/multi_hazard::urban_expansion:A": 27,
102
+ "data/multi_hazard::urban_expansion:B": 27,
103
+ "data/multi_hazard::urban_expansion:C": 27,
104
+ "data/multi_hazard::urban_expansion:D": 27,
105
+ "data/multi_hazard::drought:A": 18,
106
+ "data/multi_hazard::drought:B": 18,
107
+ "data/multi_hazard::drought:C": 18,
108
+ "data/multi_hazard::drought:D": 18,
109
+ "data/multi_hazard::air_pollution:A": 18,
110
+ "data/multi_hazard::air_pollution:B": 18,
111
+ "data/multi_hazard::air_pollution:C": 18,
112
+ "data/multi_hazard::air_pollution:D": 18,
113
+ "geodisaster::XBD-Q1": 160,
114
+ "geodisaster::XBD-Q2": 160,
115
+ "geodisaster::XBD-Q3": 160,
116
+ "geodisaster::XBD-Q8": 160,
117
+ "geodisaster::XBD-Q5": 109,
118
+ "geodisaster::XBD-Q7": 109,
119
+ "geodisaster::XBD-Q4": 49,
120
+ "ourdata/final_routing_subset_v1::nearest_shelter": 180,
121
+ "ourdata/final_routing_subset_v1::fastest_safest": 180,
122
+ "ourdata/final_routing_subset_v1::visual_overlay": 180,
123
+ "ourdata/sen1_hand_final_hidden_eval_5q::A": 90,
124
+ "ourdata/sen1_hand_final_hidden_eval_5q::B": 90,
125
+ "ourdata/sen1_hand_final_hidden_eval_5q::C": 90,
126
+ "ourdata/sen1_hand_final_hidden_eval_5q::D": 90,
127
+ "ourdata/sen1_hand_final_hidden_eval_5q::E": 90
128
+ }
129
+ },
130
+ "sft": {
131
+ "records": 2629,
132
+ "roles": {
133
+ "ORC": {
134
+ "path": "data/multi_agent/sft_train/orc_train.jsonl",
135
+ "rows": 11895
136
+ },
137
+ "GA": {
138
+ "path": "data/multi_agent/sft_train/ga_train.jsonl",
139
+ "rows": 11127
140
+ },
141
+ "PA": {
142
+ "path": "data/multi_agent/sft_train/pa_train.jsonl",
143
+ "rows": 5899
144
+ },
145
+ "VRA": {
146
+ "path": "data/multi_agent/sft_train/vra_train.jsonl",
147
+ "rows": 2763
148
+ }
149
+ }
150
+ }
151
+ },
152
+ "test": {
153
+ "records": 292,
154
+ "conversations": "data/multi_agent/test_conversations.jsonl",
155
+ "summary": {
156
+ "records": 292,
157
+ "question_type_count": 43,
158
+ "plan_steps_mean": 2.5137,
159
+ "plan_step_counts_by_agent": {
160
+ "GA": 322,
161
+ "PA": 264,
162
+ "VRA": 148
163
+ },
164
+ "tool_call_counts": {
165
+ "ReadData": 489,
166
+ "PrepareScene": 292,
167
+ "AssessDamage": 98,
168
+ "RankRegions": 76,
169
+ "ComputeStats": 60,
170
+ "PlanRoutes": 60,
171
+ "CompareSources": 51,
172
+ "MapFlood": 50,
173
+ "DescribeFlood": 50,
174
+ "ExtractObjects": 47,
175
+ "CompareRoutes": 40,
176
+ "ScoreHazard": 39,
177
+ "EstimateExposure": 31,
178
+ "RenderMap": 30,
179
+ "ClassifyChange": 25,
180
+ "DetectChange": 10,
181
+ "CompareScenes": 6,
182
+ "MeasureArea": 5
183
+ },
184
+ "role_tool_call_counts": {
185
+ "GA::ReadData": 489,
186
+ "GA::PrepareScene": 292,
187
+ "VRA::AssessDamage": 98,
188
+ "PA::RankRegions": 76,
189
+ "PA::ComputeStats": 60,
190
+ "PA::PlanRoutes": 60,
191
+ "PA::CompareSources": 51,
192
+ "GA::MapFlood": 50,
193
+ "VRA::DescribeFlood": 50,
194
+ "GA::ExtractObjects": 47,
195
+ "PA::CompareRoutes": 40,
196
+ "PA::ScoreHazard": 39,
197
+ "PA::EstimateExposure": 31,
198
+ "GA::RenderMap": 30,
199
+ "PA::ClassifyChange": 25,
200
+ "PA::DetectChange": 10,
201
+ "VRA::CompareScenes": 6,
202
+ "GA::MeasureArea": 5
203
+ },
204
+ "question_type_counts": {
205
+ "deforestation_data::forest_loss_detection": 5,
206
+ "deforestation_data::area_estimation": 5,
207
+ "deforestation_data::change_window_estimation": 5,
208
+ "deforestation_data::false_positive_rejection": 5,
209
+ "deforestation_data::baseline_canopy_assessment": 5,
210
+ "deforestation_data::multi_year_loss_attribution": 5,
211
+ "deforestation_data::cross_modal_concordance": 5,
212
+ "deforestation_data::severity_proxy_numeric": 5,
213
+ "data/multi_hazard::wildfire:A": 2,
214
+ "data/multi_hazard::wildfire:B": 2,
215
+ "data/multi_hazard::wildfire:C": 2,
216
+ "data/multi_hazard::wildfire:D": 2,
217
+ "data/multi_hazard::deforestation:A": 2,
218
+ "data/multi_hazard::deforestation:B": 2,
219
+ "data/multi_hazard::deforestation:C": 2,
220
+ "data/multi_hazard::deforestation:D": 2,
221
+ "data/multi_hazard::urban_expansion:A": 2,
222
+ "data/multi_hazard::urban_expansion:B": 2,
223
+ "data/multi_hazard::urban_expansion:C": 2,
224
+ "data/multi_hazard::urban_expansion:D": 2,
225
+ "data/multi_hazard::drought:A": 3,
226
+ "data/multi_hazard::drought:B": 3,
227
+ "data/multi_hazard::drought:C": 3,
228
+ "data/multi_hazard::drought:D": 3,
229
+ "data/multi_hazard::air_pollution:A": 2,
230
+ "data/multi_hazard::air_pollution:B": 2,
231
+ "data/multi_hazard::air_pollution:C": 2,
232
+ "data/multi_hazard::air_pollution:D": 2,
233
+ "geodisaster::XBD-Q1": 17,
234
+ "geodisaster::XBD-Q2": 17,
235
+ "geodisaster::XBD-Q3": 17,
236
+ "geodisaster::XBD-Q8": 17,
237
+ "geodisaster::XBD-Q5": 12,
238
+ "geodisaster::XBD-Q7": 12,
239
+ "geodisaster::XBD-Q4": 6,
240
+ "ourdata/final_routing_subset_v1::nearest_shelter": 20,
241
+ "ourdata/final_routing_subset_v1::fastest_safest": 20,
242
+ "ourdata/final_routing_subset_v1::visual_overlay": 20,
243
+ "ourdata/sen1_hand_final_hidden_eval_5q::A": 10,
244
+ "ourdata/sen1_hand_final_hidden_eval_5q::B": 10,
245
+ "ourdata/sen1_hand_final_hidden_eval_5q::C": 10,
246
+ "ourdata/sen1_hand_final_hidden_eval_5q::D": 10,
247
+ "ourdata/sen1_hand_final_hidden_eval_5q::E": 10
248
+ }
249
+ },
250
+ "sft": {
251
+ "records": 292,
252
+ "roles": {
253
+ "ORC": {
254
+ "path": "data/multi_agent/sft_test/orc_eval.jsonl",
255
+ "rows": 1318
256
+ },
257
+ "GA": {
258
+ "path": "data/multi_agent/sft_test/ga_eval.jsonl",
259
+ "rows": 1235
260
+ },
261
+ "PA": {
262
+ "path": "data/multi_agent/sft_test/pa_eval.jsonl",
263
+ "rows": 656
264
+ },
265
+ "VRA": {
266
+ "path": "data/multi_agent/sft_test/vra_eval.jsonl",
267
+ "rows": 302
268
+ }
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "terminal_answer_protocol": {
274
+ "action_field": "answer_ref",
275
+ "reference": "ANSWER_JSON:answer_1",
276
+ "resolution": "runtime answer registry populated from schema-valid worker evidence"
277
+ }
278
+ }
data/data/multi_agent/sft_test/ga_eval.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:666f02f3af849452684f79e8ed56c908a2b642a2883f2888e86e8f3c5d1c22ea
3
+ size 13116079
data/data/multi_agent/sft_test/manifest.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "records": 292,
3
+ "roles": {
4
+ "ORC": {
5
+ "path": "orc_eval.jsonl",
6
+ "rows": 1318
7
+ },
8
+ "GA": {
9
+ "path": "ga_eval.jsonl",
10
+ "rows": 1235
11
+ },
12
+ "PA": {
13
+ "path": "pa_eval.jsonl",
14
+ "rows": 656
15
+ },
16
+ "VRA": {
17
+ "path": "vra_eval.jsonl",
18
+ "rows": 302
19
+ }
20
+ }
21
+ }
data/data/multi_agent/sft_test/orc_eval.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0465b39a92581b270d3e2c5220a43b7c0c547879268ea7bfb75b1ec4a2b16000
3
+ size 11244371
data/data/multi_agent/sft_test/pa_eval.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/data/multi_agent/sft_test/vra_eval.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/data/multi_agent/sft_train/ga_train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a79a455544d9fea670a11fa7be2da2bce4a334b35cd1ea5352eb69ff7e44f0fc
3
+ size 118191115
data/data/multi_agent/sft_train/manifest.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "records": 2629,
3
+ "roles": {
4
+ "ORC": {
5
+ "path": "orc_train.jsonl",
6
+ "rows": 11895
7
+ },
8
+ "GA": {
9
+ "path": "ga_train.jsonl",
10
+ "rows": 11127
11
+ },
12
+ "PA": {
13
+ "path": "pa_train.jsonl",
14
+ "rows": 5899
15
+ },
16
+ "VRA": {
17
+ "path": "vra_train.jsonl",
18
+ "rows": 2763
19
+ }
20
+ }
21
+ }
data/data/multi_agent/sft_train/orc_train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e7e0b82f1876e9867a13cfddc158189089fe1b4210e532bb2ce6758f4da323cf
3
+ size 101534711
data/data/multi_agent/sft_train/pa_train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a27600715e40c36e458d9c15d8368cb7c38355b2cb54497afea0ea026a2e4555
3
+ size 55041341
data/data/multi_agent/sft_train/vra_train.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:72667dbaa6ee3df75f960394dddff50845aab46a4c7c9d94497375c69e0bb372
3
+ size 19213124
data/data/multi_agent/test_conversations.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9c8a359d2dce929d9d9ec010cd0b3e1b2a15ec6cb88ea071f60db31160a510ae
3
+ size 24389839
data/data/multi_agent/tool_ownership_and_prompt_context.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # GeoDisaster Dataset Multi-Agent Tool Ownership
2
+
3
+ Enable this benchmark profile with `MAS_AGENT_PROFILE=geodisaster`. The ownership table below is the active GeoDisaster contract.
4
+
5
+ ## Ownership
6
+
7
+ | Agent | Tools | Rationale |
8
+ |---|---|---|
9
+ | `GA` | `ReadData`, `PrepareScene`, `MeasureArea`, `ExtractObjects`, `MapFlood`, `RenderMap` | Spatial/data operations and artifact creation: open handles, prepare scenes, measure areas, extract objects, map flood extent, render overlays. |
10
+ | `PA` | `ComputeStats`, `CompareSources`, `DetectChange`, `ClassifyChange`, `ScoreHazard`, `EstimateExposure`, `RankRegions`, `PlanRoutes`, `CompareRoutes` | Largest set: numeric/statistical reasoning, comparisons, classifications, exposure, ranking, route planning, route tradeoffs. |
11
+ | `VRA` | `AssessDamage`, `DescribeFlood`, `CompareScenes` | Small visual interpretation set: damage/flood/scene semantic summaries after evidence is prepared. |
12
+
13
+ ## Agent-Facing Signatures
14
+
15
+ - `ReadData(question: str, input: str, role?: 'pre_post'|'hansen'|'ndvi_nbr'|'vh'|'wildfire'|'deforestation'|'urban_expansion'|'drought'|'air_pollution'|'hospitals_and_schools'|'highways'|'nearest_highway'|'population_in_footprint'|'schools'|'population'|'post_disaster'|'buildings'|'target_classes'|'scene_a'|'scene_b'|'roads_shelters_flood'|'roads_shelters_flood_rgb'|'primary'|'known_water_reference', time?: 'event'|'event_window'|'pre_post_epochs'|'2001_2023', options?: dict) # Open a named input handle for the current question, validate its local artifact paths, and return a scene handle containing the discovered raster/vector/image/report refs. The evaluator must initialize the session first with code/scripts/initialize_tool_session.py; case contents are not agent-visible tool arguments.`
16
+ - `PrepareScene(question: str, inputs: dict, mode: 'forest'|'hazard'|'xbd_damage'|'sar_flood'|'routing'|'scene_compare'|'forest_change'|'forest_timeseries'|'forest_false_positive'|'baseline_canopy'|'forest_loss_history'|'forest_cross_modal'|'sar_change'|'wildfire_burn'|'forest_loss'|'built_up_gain'|'drought_anomaly'|'pollution_peak'|'multisource_hazard'|'wildfire_burn_exposure'|'forest_loss_exposure'|'built_up_gain_exposure'|'drought_anomaly_exposure'|'pollution_peak_exposure'|'xbd_grid'|'xbd_quadrants'|'xbd_scene_summary'|'flood_safe_routing'|'sar_flood_reference'|'sar_flood_diagnostic', checks?: dict) # Build an aligned work context from one or more opened scene handles. It checks handle types and records the processing mode before downstream analytics.`
17
+ - `ComputeStats(question: str, work: str, metrics: dict, region?: 'aoi'|'scene') # Compute numeric statistics for a work/damage/hazard handle, including area, counts, means, z-scores, class histograms, or footprint summaries.`
18
+ - `MeasureArea(question: str, work: str, target: 'forest_loss', unit: 'hectares') # Measure area for extracted objects or masks in the requested units by reading the underlying raster/vector data referenced by the input handle.`
19
+ - `CompareSources(question: str, work: str, compare: dict) # Compare multiple modalities or source layers, such as optical-vs-SAR, multi-source hazard agreement, or predicted-flood overlap versus pixels outside a known-water reference. Known-water context does not by itself establish temporal novelty.`
20
+ - `DetectChange(question: str, work: str, change: 'largest_loss_year'|'dominant_clearing_interval', window?: '2001_2023'|'pre_post_epochs') # Detect or localize temporal change windows or dominant change events from a work handle.`
21
+ - `ClassifyChange(question: str, work: str, labels: dict, rule: 'forest_loss'|'change_window'|'false_positive_type'|'canopy_density'|'concordance'|'cross_modal_concordance') # Classify a change, canopy state, concordance state, or false-positive category using explicit labels/rules.`
22
+ - `ScoreHazard(question: str, work: str, hazard: 'forest_disturbance'|'wildfire'|'deforestation'|'urban_expansion'|'drought'|'air_pollution'|'building_damage', scale: 'vh_delta_severity'|'question_defined_class'|'benchmark_relative_column_quartile'|'impact_footprint'|'spatial_concentration') # Score hazard class, severity, concentration, or impact footprint from a prepared/analytic handle.`
23
+ - `EstimateExposure(question: str, work: str, exposure: 'blocked_roads'|'high_no2_column_population'|'highway_representatives_within_5km'|'nearest_highway'|'population_in_footprint'|'schools', metrics: dict) # Estimate exposure of people/assets/roads/facilities to a hazard footprint or blocked-road layer.`
24
+ - `AssessDamage(question: str, work: str, aggregation: 'scene'|'grid_4x4'|'quadrant_2x2'|'severe_only'|'pair_compare', severity?: 'severe'|'major_or_destroyed') # Aggregate building-damage polygons into scene, grid, quadrant, severe-only, or pair-comparison summaries.`
25
+ - `RankRegions(question: str, work: str, by: 'severe_footprint_area_m2'|'severe_area_m2'|'severe_damage_count'|'severe_count'|'normalized_damage_severity'|'normalized_severity'|'severity_score'|'severity_score_normalized'|'flood_percentage'|'flood_pixels'|'flood_area', candidates: 'grid_4x4'|'quadrants_2x2', top_k?: int) # Rank regions, components, grid cells, quadrants, or route candidates by the requested score.`
26
+ - `CompareScenes(question: str, work: str, by: 'severe_damage_ratio_and_footprint') # Compare two prepared scene summaries and decide which scene has the larger damage/risk signal.`
27
+ - `ExtractObjects(question: str, work: str, target: 'forest_loss_patches'|'severe_buildings'|'flood_polygons'|'flood_components', filters?: dict) # Extract object sets such as forest-loss patches, severe buildings, flood polygons, or flood components. Sentinel flood polygons and components use 8-neighbour connectivity and produce validated run-scoped GeoJSON or label-raster artifacts.`
28
+ - `MapFlood(question: str, work: str, method: 's1_min_backscatter_otsu_v1') # Produce a run-scoped 0/1/255 candidate-flood mask from a prepared SAR scene. The published Sentinel contract supports the validated s1_min_backscatter_otsu_v1 method.`
29
+ - `DescribeFlood(question: str, work: str, metrics: dict) # Select and summarize requested flood-mask/component/polygon metrics, including exact-grid areas, centroids, 4x4 grids, and known-water overlap statistics from the causal handle.`
30
+ - `PlanRoutes(question: str, work: str, objective: 'nearest_reachable_shelter'|'candidate_routes'|'overlay_routes', avoid: dict) # Recompute route metrics and composite edge costs from declared packaged geometry/road products, then select eligible fastest, safest-weighted, and balanced candidates; this worker does not run a new graph search.`
31
+ - `CompareRoutes(question: str, work: str, prefer: dict) # Compare requested validated fastest, safest-weighted, and balanced candidates and compute the full trade-off when all three are requested, without adding an evacuation recommendation.`
32
+ - `RenderMap(question: str, work: str, layers: dict, style: 'route_overlay'|'flood_diagnostic') # Render a fresh run-scoped map/image artifact and validation manifest from the current analytical handle and exactly the requested declared layers; prepared answer overlays and unrequested context layers are not retrieved.`
data/data/multi_agent/train_conversations.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:02489557dcaa2f5ec9c1b03c754d94d52e220bdadc7ef2639e9fb7c058e131e4
3
+ size 220451396
data/data/single_agent/manifest.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "schema_version": "geodisaster_single_agent_release_v2",
3
+ "canonical_source": "data/core/geodisaster_2921_source_with_splits.jsonl",
4
+ "canonical_sha256": "03988b960e6b09ae01fb622fe45b35d763eb705485cddc3cea68bcac7ae63fe1",
5
+ "files": {
6
+ "train_conversations": "data/single_agent/train_conversations.jsonl",
7
+ "train_turns": "data/single_agent/train_turns.jsonl",
8
+ "test_reference_conversations": "data/single_agent/test_reference_conversations.jsonl",
9
+ "test_turns": "data/single_agent/test_turns.jsonl",
10
+ "system_prompt": "data/single_agent/single_agent_system_prompt.md"
11
+ },
12
+ "counts": {
13
+ "train_cases": 2629,
14
+ "train_sft_turns": 18410,
15
+ "test_cases": 292,
16
+ "test_sft_turns": 2043
17
+ },
18
+ "terminal_answer_protocol": {
19
+ "action_field": "answer_ref",
20
+ "reference": "ANSWER_JSON:answer_1",
21
+ "resolution": "runtime answer registry populated from schema-valid worker evidence"
22
+ }
23
+ }
data/data/single_agent/single_agent_system_prompt.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Single-Agent System Prompt
2
+
3
+ ```text
4
+ You are a single geospatial-disaster tool-use agent.
5
+ You do your own planning and tool execution. There are no specialist agents and
6
+ no orchestrator. You receive one question plus visible handles, then solve it
7
+ by emitting one JSON object per turn.
8
+
9
+ Response schema:
10
+ {
11
+ "thought": "<compact reasoning for the next action>",
12
+ "action": <Plan | ToolCall | FinalAnswer>
13
+ }
14
+
15
+ Actions:
16
+ - Plan = {"tool":"Plan","goal":"...","steps":[{"id":"s1","objective":"...","needs":["..."]}]}
17
+ - ToolCall = {"tool":"<tool name>","args":{...}}
18
+ - FinalAnswer = {"tool":"FinalAnswer","answer_ref":"ANSWER_JSON:answer_1"}
19
+
20
+ Core rules:
21
+ - On the first turn, produce a high-level Plan unless the answer is already
22
+ visible. The plan should explain evidence objectives, not list every tool by
23
+ rote.
24
+ - After a Plan, execute one tool call per turn. Use LAST OBSERVATION and SHARED
25
+ MEMORY to decide the next action.
26
+ - Use exact tool names and exact argument names from ALLOWED TOOLS. Do not
27
+ invent keys or handles.
28
+ - Use visible canonical handles, not raw filesystem paths. For GeoDisaster
29
+ questions, `question` is normally `"question_1"`.
30
+ - Raw GeoDisaster handles such as `optical_stack_1`, `damage_scene_1`,
31
+ `sar_chip_1`, `hazard_stack_1`, and `route_network_1` are opened with
32
+ ReadData. Later GeoDisaster tools consume produced handles such as `scene_N`,
33
+ `work_N`, `stats_N`, `compare_N`, `rank_N`, `route_N`, or `map_N`.
34
+ - When ReadData returns `latest_handle = scene_N`, use that produced scene
35
+ handle in later PrepareScene calls. Do not pass the raw input handle where a
36
+ work/scene handle is required.
37
+ - For PrepareScene, choose semantic slot names from the evidence: forest
38
+ optical/sar/forest/loss_history; hazard hazard/sources/exposure; damage
39
+ image/labels/masks; flood sar/water; routing routing; comparison scene_a and
40
+ scene_b.
41
+ - Stop when the evidence needed for the answer is present. Do not re-run a
42
+ successful tool call with the same arguments.
43
+ - Finish only when AVAILABLE ANSWER REFERENCES publishes
44
+ `ANSWER_JSON:answer_1`, then copy it into `answer_ref`. The runtime resolves
45
+ it only from a schema-validated projection of worker evidence. Inline answer
46
+ JSON, prose, partial fields, worker handles, and invented references are
47
+ rejected.
48
+ - Reply with one JSON object only. No prose, no markdown fences.
49
+
50
+ ALLOWED TOOLS
51
+ - AssessDamage(question: str, work: str, aggregation: 'scene'|'grid_4x4'|'quadrant_2x2'|'severe_only'|'pair_compare', severity?: 'severe'|'major_or_destroyed') # Aggregate building-damage polygons into scene, grid, quadrant, severe-only, or pair-comparison summaries.
52
+ - ClassifyChange(question: str, work: str, labels: dict, rule: 'forest_loss'|'change_window'|'false_positive_type'|'canopy_density'|'concordance'|'cross_modal_concordance') # Classify a change, canopy state, concordance state, or false-positive category using explicit labels/rules.
53
+ - CompareRoutes(question: str, work: str, prefer: dict) # Compare requested validated fastest, safest-weighted, and balanced candidates and compute the full trade-off when all three are requested, without adding an evacuation recommendation.
54
+ - CompareScenes(question: str, work: str, by: 'severe_damage_ratio_and_footprint') # Compare two prepared scene summaries and decide which scene has the larger damage/risk signal.
55
+ - CompareSources(question: str, work: str, compare: dict) # Compare multiple modalities or source layers, such as optical-vs-SAR, multi-source hazard agreement, or predicted-flood overlap versus pixels outside a known-water reference. Known-water context does not by itself establish temporal novelty.
56
+ - ComputeStats(question: str, work: str, metrics: dict, region?: 'aoi'|'scene') # Compute numeric statistics for a work/damage/hazard handle, including area, counts, means, z-scores, class histograms, or footprint summaries.
57
+ - DescribeFlood(question: str, work: str, metrics: dict) # Select and summarize requested flood-mask/component/polygon metrics, including exact-grid areas, centroids, 4x4 grids, and known-water overlap statistics from the causal handle.
58
+ - DetectChange(question: str, work: str, change: 'largest_loss_year'|'dominant_clearing_interval', window?: '2001_2023'|'pre_post_epochs') # Detect or localize temporal change windows or dominant change events from a work handle.
59
+ - EstimateExposure(question: str, work: str, exposure: 'blocked_roads'|'high_no2_column_population'|'highway_representatives_within_5km'|'nearest_highway'|'population_in_footprint'|'schools', metrics: dict) # Estimate exposure of people/assets/roads/facilities to a hazard footprint or blocked-road layer.
60
+ - ExtractObjects(question: str, work: str, target: 'forest_loss_patches'|'severe_buildings'|'flood_polygons'|'flood_components', filters?: dict) # Extract object sets such as forest-loss patches, severe buildings, flood polygons, or flood components. Sentinel flood polygons and components use 8-neighbour connectivity and produce validated run-scoped GeoJSON or label-raster artifacts.
61
+ - MapFlood(question: str, work: str, method: 's1_min_backscatter_otsu_v1') # Produce a run-scoped 0/1/255 candidate-flood mask from a prepared SAR scene. The published Sentinel contract supports the validated s1_min_backscatter_otsu_v1 method.
62
+ - MeasureArea(question: str, work: str, target: 'forest_loss', unit: 'hectares') # Measure area for extracted objects or masks in the requested units by reading the underlying raster/vector data referenced by the input handle.
63
+ - PlanRoutes(question: str, work: str, objective: 'nearest_reachable_shelter'|'candidate_routes'|'overlay_routes', avoid: dict) # Recompute route metrics and composite edge costs from declared packaged geometry/road products, then select eligible fastest, safest-weighted, and balanced candidates; this worker does not run a new graph search.
64
+ - PrepareScene(question: str, inputs: dict, mode: 'forest'|'hazard'|'xbd_damage'|'sar_flood'|'routing'|'scene_compare'|'forest_change'|'forest_timeseries'|'forest_false_positive'|'baseline_canopy'|'forest_loss_history'|'forest_cross_modal'|'sar_change'|'wildfire_burn'|'forest_loss'|'built_up_gain'|'drought_anomaly'|'pollution_peak'|'multisource_hazard'|'wildfire_burn_exposure'|'forest_loss_exposure'|'built_up_gain_exposure'|'drought_anomaly_exposure'|'pollution_peak_exposure'|'xbd_grid'|'xbd_quadrants'|'xbd_scene_summary'|'flood_safe_routing'|'sar_flood_reference'|'sar_flood_diagnostic', checks?: dict) # Build an aligned work context from one or more opened scene handles. It checks handle types and records the processing mode before downstream analytics.
65
+ - RankRegions(question: str, work: str, by: 'severe_footprint_area_m2'|'severe_area_m2'|'severe_damage_count'|'severe_count'|'normalized_damage_severity'|'normalized_severity'|'severity_score'|'severity_score_normalized'|'flood_percentage'|'flood_pixels'|'flood_area', candidates: 'grid_4x4'|'quadrants_2x2', top_k?: int) # Rank regions, components, grid cells, quadrants, or route candidates by the requested score.
66
+ - ReadData(question: str, input: str, role?: 'pre_post'|'hansen'|'ndvi_nbr'|'vh'|'wildfire'|'deforestation'|'urban_expansion'|'drought'|'air_pollution'|'hospitals_and_schools'|'highways'|'nearest_highway'|'population_in_footprint'|'schools'|'population'|'post_disaster'|'buildings'|'target_classes'|'scene_a'|'scene_b'|'roads_shelters_flood'|'roads_shelters_flood_rgb'|'primary'|'known_water_reference', time?: 'event'|'event_window'|'pre_post_epochs'|'2001_2023', options?: dict) # Open a named input handle for the current question, validate its local artifact paths, and return a scene handle containing the discovered raster/vector/image/report refs. The evaluator must initialize the session first with code/scripts/initialize_tool_session.py; case contents are not agent-visible tool arguments.
67
+ - RenderMap(question: str, work: str, layers: dict, style: 'route_overlay'|'flood_diagnostic') # Render a fresh run-scoped map/image artifact and validation manifest from the current analytical handle and exactly the requested declared layers; prepared answer overlays and unrequested context layers are not retrieved.
68
+ - ScoreHazard(question: str, work: str, hazard: 'forest_disturbance'|'wildfire'|'deforestation'|'urban_expansion'|'drought'|'air_pollution'|'building_damage', scale: 'vh_delta_severity'|'question_defined_class'|'benchmark_relative_column_quartile'|'impact_footprint'|'spatial_concentration') # Score hazard class, severity, concentration, or impact footprint from a prepared/analytic handle.
69
+
70
+ ```
data/data/single_agent/test_reference_conversations.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
data/data/single_agent/test_turns.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6f223505c6ff15d68abc71e7ee2cea4db8afe5e5431a2adfedee409fd6555f9d
3
+ size 25512749
data/data/single_agent/train_conversations.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eb4e907bf1cd9b5941a35ccf644e37f593e68a53346b48e600efdd0b4de46c27
3
+ size 83251194
data/data/single_agent/train_turns.jsonl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2fcad00a7ab64afcd25174fca1cdf75bc73e907930057443bcb892f31a229cb
3
+ size 230009040
data/release_tools/__pycache__/raster_portability.cpython-310.pyc ADDED
Binary file (6.19 kB). View file
 
data/release_tools/__pycache__/raster_portability.cpython-311.pyc ADDED
Binary file (13.1 kB). View file
 
data/release_tools/audit_c01_source_registry.py ADDED
@@ -0,0 +1,392 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Audit C01 path completeness and file-family provenance coverage.
3
+
4
+ This audit is intentionally independent of the tool replay. It checks every
5
+ path declaration in the canonical 2,921-record source file, every physical
6
+ file under source_assets/, and every multi-hazard raster-sidecar source label.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import argparse
12
+ import hashlib
13
+ import json
14
+ from collections import Counter, defaultdict
15
+ from pathlib import Path
16
+ from typing import Any
17
+
18
+
19
+ DEFAULT_ROOT = Path(__file__).resolve().parents[1]
20
+
21
+
22
+ CATEGORY_PROVENANCE = {
23
+ "D01": "Sentinel-1 GRD source raster or GDAL sidecar",
24
+ "D02": "Sentinel-2 L2A source raster or GDAL sidecar",
25
+ "D03": "Sentinel-2-derived RGB preview",
26
+ "D04": "Hansen GFC source/derived mask or GDAL sidecar",
27
+ "D05": "project-authored deforestation question",
28
+ "D06": "project-generated deforestation quality report",
29
+ "MH00": "multi-hazard sample-directory container handle",
30
+ "MH01": "project-authored AOI/metadata/handle manifest",
31
+ "MH02": "project-authored question, answer, or trajectory record",
32
+ "MH03": "project-generated quality report",
33
+ "MH04": "source-derived tabular baseline",
34
+ "MH05": "OpenStreetMap POI extract",
35
+ "MH06": "source-derived visualization panel",
36
+ "MH07": "WorldPop population raster and provider sidecar",
37
+ "MH08": "wildfire source/derived raster, sidecar, or GDAL sidecar",
38
+ "MH09": "deforestation source/derived raster or sidecar",
39
+ "MH10": "urban-expansion source/derived raster or sidecar",
40
+ "MH11": "drought source/derived raster or sidecar",
41
+ "MH12": "air-pollution source/derived raster or sidecar",
42
+ "MH13": "OpenAQ empty-query provenance (no measurements)",
43
+ "MH14": "project-authored train-only air-pollution normalization contract",
44
+ "MH15": "project-authored train-only drought normalization contract",
45
+ "R01": "legacy project-authored routing split export",
46
+ "R02": "CEMS flood-extent source vector",
47
+ "R03": "Sentinel-2 L2A raster/preview or GDAL sidecar",
48
+ "R04": "project-authored routing metadata with source identifiers",
49
+ "R05": "OSM+CEMS-derived road/route/score product",
50
+ "R06": "project-selected route answer",
51
+ "R07": "Sentinel-2+OSM+CEMS-derived route overlay",
52
+ "S01": "Sen1Floods11 Sentinel-1 chip or GDAL sidecar",
53
+ "S02": "Sen1Floods11 JRC-water layer or GDAL sidecar",
54
+ "S03": "Sen1Floods11 hand label or GDAL sidecar",
55
+ "S04": "legacy Sen1Floods11 Otsu derivative or GDAL sidecar",
56
+ "S05": "source-derived public preview or packaged overlay",
57
+ "S06": "project-generated hidden derivative of Sen1Floods11 hand labels",
58
+ "X01": "xBD pre/post imagery",
59
+ "X02": "xBD-label-derived target mask",
60
+ "X03": "xBD damage polygons or coordinate conversion",
61
+ "X04": "project-generated grid/quadrant geometry",
62
+ }
63
+
64
+
65
+ SOURCE_MARKERS = {
66
+ "COPERNICUS/S2_SR_HARMONIZED NBR": "COPERNICUS/S2_SR_HARMONIZED",
67
+ "COPERNICUS/S2_SR_HARMONIZED NDBI": "COPERNICUS/S2_SR_HARMONIZED",
68
+ "COPERNICUS/S2_SR_HARMONIZED NDVI": "COPERNICUS/S2_SR_HARMONIZED",
69
+ "COPERNICUS/S2_SR_HARMONIZED RGB": "COPERNICUS/S2_SR_HARMONIZED",
70
+ "COPERNICUS/S5P/OFFL/L3_CO CO": "COPERNICUS/S5P/OFFL/L3_CO",
71
+ "COPERNICUS/S5P/OFFL/L3_NO2 tropospheric NO2 * 1e6": "COPERNICUS/S5P/OFFL/L3_NO2",
72
+ "COPERNICUS/S5P/OFFL/L3_SO2 SO2 * 1e6": "COPERNICUS/S5P/OFFL/L3_SO2",
73
+ "ECMWF Copernicus Atmosphere Monitoring Service — CAMS Global Near-Real-Time": "ECMWF/CAMS/NRT",
74
+ "ECMWF/ERA5_LAND/DAILY_AGGR volumetric_soil_water_layer_1": "ECMWF/ERA5_LAND/DAILY_AGGR",
75
+ "ESA/WorldCover/v200 Map class 50 built-up": "ESA/WorldCover/v200",
76
+ "ESA WorldCover 2020 class 50 built-up": "ESA/WorldCover/v100",
77
+ "GOOGLE/DYNAMICWORLD/V1 built probability": "GOOGLE/DYNAMICWORLD/V1",
78
+ "JRC/GHSL/P2023A/GHS_BUILT_S 2020 built_surface>0": "JRC/GHSL/P2023A/GHS_BUILT_S",
79
+ "JRC/GHSL/P2023A/GHS_BUILT_S 2025 built_surface>0": "JRC/GHSL/P2023A/GHS_BUILT_S",
80
+ "LANDSAT/LC08+LC09/C02/T1_L2 NBR": "LANDSAT/LC08/C02/T1_L2",
81
+ "MODIS/061/MCD19A2_GRANULES Optical_Depth_047 * 0.001": "MODIS/061/MCD19A2_GRANULES",
82
+ "MODIS/061/MCD64A1 BurnDate": "MODIS/061/MCD64A1",
83
+ "MODIS/061/MOD13Q1 NDVI": "MODIS/061/MOD13Q1",
84
+ "NASA LP DAAC — VNP14A1.002 Thermal Anomalies/Fire Daily L3 Global 1 km": "NASA/VIIRS/002/VNP14A1",
85
+ "NASA LP DAAC — VNP21A1D.002 Day LST and Emissivity Daily 1 km": "NASA/VIIRS/002/VNP21A1D",
86
+ "National Interagency Fire Center — WFIGS Interagency Fire Perimeters": "WFIGS_Interagency_Perimeters/FeatureServer/0",
87
+ "Wageningen University & Research / Global Forest Watch — RADD Forest Disturbance Alerts v1": "projects/radar-wur/raddalert/v1",
88
+ "UCSB-CHG/CHIRPS/DAILY same-window z-score": "UCSB-CHG/CHIRPS/DAILY",
89
+ "UMD/hansen/global_forest_change_2025_v1_13 lossyear=2022": "UMD/hansen/global_forest_change_2025_v1_13",
90
+ "UMD/hansen/global_forest_change_2025_v1_13 treecover2000>30": "UMD/hansen/global_forest_change_2025_v1_13",
91
+ "EC JRC TMF v1_2023 AnnualChanges": "projects/JRC/TMF/v1_2023/AnnualChanges",
92
+ }
93
+
94
+
95
+ def sha256(path: Path) -> str:
96
+ digest = hashlib.sha256()
97
+ with path.open("rb") as stream:
98
+ for chunk in iter(lambda: stream.read(1024 * 1024), b""):
99
+ digest.update(chunk)
100
+ return digest.hexdigest()
101
+
102
+
103
+ def classify(relative: str) -> str | None:
104
+ parts = Path(relative).parts
105
+ if len(parts) < 2 or parts[0] != "source_assets":
106
+ return None
107
+ family = parts[1]
108
+ tail = "/".join(parts[2:])
109
+
110
+ if family == "deforestation":
111
+ if "/cache/s1_grd/" in f"/{tail}/":
112
+ return "D01"
113
+ if "/cache/s2/" in f"/{tail}/":
114
+ return "D02"
115
+ if "/visible/s2_rgb/" in f"/{tail}/":
116
+ return "D03"
117
+ if "/masks/" in f"/{tail}/":
118
+ return "D04"
119
+ if "/questions/" in f"/{tail}/":
120
+ return "D05"
121
+ if tail.endswith("/quality_report.json"):
122
+ return "D06"
123
+
124
+ if family == "multi_hazard":
125
+ if tail == "air_pollution/source_normalization.json":
126
+ return "MH14"
127
+ if len(parts) == 4:
128
+ return "MH00"
129
+ if tail.endswith(("/aoi.geojson", "/available_handles.json", "/metadata.json")):
130
+ return "MH01"
131
+ if any(f"/{name}/" in f"/{tail}/" for name in ("questions", "gt", "trajectories")):
132
+ return "MH02"
133
+ if tail.endswith("/quality_report.json"):
134
+ return "MH03"
135
+ if "/baselines/" in f"/{tail}/":
136
+ return "MH04"
137
+ if tail.endswith("/osm/pois.geojson"):
138
+ return "MH05"
139
+ if "/panels/" in f"/{tail}/":
140
+ return "MH06"
141
+ if tail.endswith(("/tabular/worldpop.tif", "/tabular/worldpop.json")):
142
+ return "MH07"
143
+ if tail.endswith("/drought_normalization.json"):
144
+ return "MH15"
145
+ if tail.endswith("/normalization.json"):
146
+ return "MH14"
147
+ if tail.endswith(("/tabular/openaq_stations.csv", "/tabular/openaq_status.json")):
148
+ return "MH13"
149
+ hazard = parts[2] if len(parts) > 2 else ""
150
+ if "/rasters/" in f"/{tail}/":
151
+ return {
152
+ "wildfire": "MH08",
153
+ "deforestation": "MH09",
154
+ "urban_expansion": "MH10",
155
+ "drought": "MH11",
156
+ "air_pollution": "MH12",
157
+ }.get(hazard)
158
+
159
+ if family == "routing":
160
+ if len(parts) == 3 and parts[2] in {"train.json", "val.json", "test.json"}:
161
+ return "R01"
162
+ if "/copernicus/" in f"/{tail}/":
163
+ return "R02"
164
+ if "/input/rgb" in f"/{tail}/":
165
+ return "R03"
166
+ if tail.endswith("/input/metadata.json"):
167
+ return "R04"
168
+ if "/derived/" in f"/{tail}/":
169
+ return "R05"
170
+ if tail.endswith("/ground_truth/selected_routes.json"):
171
+ return "R06"
172
+ if tail.endswith("/overlays/routes_overlay.png"):
173
+ return "R07"
174
+
175
+ if family == "sen1_flood":
176
+ if "/labels/S1Hand.tif" in f"/{tail}" or "/derived/S1Portable.tif" in f"/{tail}":
177
+ return "S01"
178
+ if "/labels/JRCWaterHand.tif" in f"/{tail}":
179
+ return "S02"
180
+ if "/labels/LabelHand.tif" in f"/{tail}":
181
+ return "S03"
182
+ if "/labels/S1OtsuLabelHand.tif" in f"/{tail}":
183
+ return "S04"
184
+ if "/public/" in f"/{tail}/":
185
+ return "S05"
186
+ if "/hidden/" in f"/{tail}/":
187
+ return "S06"
188
+
189
+ if family == "xbd_damage":
190
+ if tail.endswith(("/pre.png", "/post.png")):
191
+ return "X01"
192
+ if tail.endswith("/post_target.png"):
193
+ return "X02"
194
+ if tail.endswith(("/building_damage_xy.geojson", "/building_damage_lnglat.geojson")):
195
+ return "X03"
196
+ if tail.endswith(("/grid_4x4.geojson", "/quadrants.geojson")):
197
+ return "X04"
198
+ return None
199
+
200
+
201
+ def collect_path_cards(value: Any, record_id: str, trail: str = "") -> list[dict[str, Any]]:
202
+ cards: list[dict[str, Any]] = []
203
+ if isinstance(value, dict):
204
+ if isinstance(value.get("path"), str):
205
+ cards.append(
206
+ {
207
+ "record_id": record_id,
208
+ "trail": trail,
209
+ "path": value["path"],
210
+ "optional": bool(value.get("optional", False)),
211
+ "declared_exists": value.get("exists"),
212
+ }
213
+ )
214
+ for key, child in value.items():
215
+ child_trail = f"{trail}.{key}" if trail else key
216
+ cards.extend(collect_path_cards(child, record_id, child_trail))
217
+ elif isinstance(value, list):
218
+ for index, child in enumerate(value):
219
+ cards.extend(collect_path_cards(child, record_id, f"{trail}[{index}]"))
220
+ return cards
221
+
222
+
223
+ def main() -> None:
224
+ parser = argparse.ArgumentParser(description=__doc__)
225
+ parser.add_argument("--root", type=Path, default=DEFAULT_ROOT)
226
+ parser.add_argument(
227
+ "--mode",
228
+ choices=("thin", "hydrated", "development"),
229
+ default="thin",
230
+ help=(
231
+ "thin permits only the documented Sen1Floods11 hydration gap; "
232
+ "hydrated and development require every declared path."
233
+ ),
234
+ )
235
+ parser.add_argument(
236
+ "--output",
237
+ type=Path,
238
+ default=None,
239
+ help="Optional report path. The audit is check-only and never overwrites tracked evidence by default.",
240
+ )
241
+ args = parser.parse_args()
242
+
243
+ root = args.root.expanduser().resolve()
244
+ canonical = root / "data/core/geodisaster_2921_source_with_splits.jsonl"
245
+ attributions = root / "ATTRIBUTIONS.md"
246
+ records = [json.loads(line) for line in canonical.open() if line.strip()]
247
+ declarations: list[dict[str, Any]] = []
248
+ for record in records:
249
+ declarations.extend(collect_path_cards(record, record["id"]))
250
+
251
+ by_path: dict[str, list[dict[str, Any]]] = defaultdict(list)
252
+ for card in declarations:
253
+ by_path[card["path"]].append(card)
254
+
255
+ required = {path for path, cards in by_path.items() if any(not card["optional"] for card in cards)}
256
+ optional_only = set(by_path) - required
257
+ missing_required = sorted(path for path in required if not (root / path).exists())
258
+ missing_optional = sorted(path for path in optional_only if not (root / path).exists())
259
+ permitted_thin_missing = sorted(
260
+ path
261
+ for path in missing_required
262
+ if path.startswith("source_assets/sen1_flood/")
263
+ and path.endswith(("/derived/S1Portable.tif", "/labels/JRCWaterHand.tif"))
264
+ )
265
+ unexpected_missing_required = (
266
+ sorted(set(missing_required) - set(permitted_thin_missing))
267
+ if args.mode == "thin"
268
+ else missing_required
269
+ )
270
+ outside = sorted(path for path in by_path if not path.startswith("source_assets/"))
271
+ flag_mismatches = []
272
+ for path, cards in by_path.items():
273
+ actual_exists = (root / path).exists()
274
+ for card in cards:
275
+ if card["declared_exists"] is not None and bool(card["declared_exists"]) != actual_exists:
276
+ if not (args.mode == "thin" and path in permitted_thin_missing):
277
+ flag_mismatches.append(card | {"actual_exists": actual_exists})
278
+
279
+ physical_files = [path for path in (root / "source_assets").rglob("*") if path.is_file()]
280
+ relative_files = [str(path.relative_to(root)) for path in physical_files]
281
+ unclassified_files = sorted(path for path in relative_files if classify(path) is None)
282
+ unclassified_references = sorted(path for path in by_path if classify(path) is None)
283
+
284
+ category_counts: dict[str, Counter[str]] = defaultdict(Counter)
285
+ for path in relative_files:
286
+ category = classify(path)
287
+ if category:
288
+ category_counts[category]["physical_files"] += 1
289
+ for path in by_path:
290
+ category = classify(path)
291
+ if category:
292
+ status = "required_paths" if path in required else "optional_paths"
293
+ category_counts[category][status] += 1
294
+ if not (root / path).exists():
295
+ category_counts[category]["missing_paths"] += 1
296
+
297
+ source_labels = set()
298
+ for sidecar in (root / "source_assets/multi_hazard").glob("*/*/rasters/*.json"):
299
+ payload = json.loads(sidecar.read_text())
300
+ if isinstance(payload.get("source"), str):
301
+ source_labels.add(payload["source"])
302
+ direct_labels = sorted(label for label in source_labels if not label.startswith("derived "))
303
+ derived_labels = sorted(label for label in source_labels if label.startswith("derived "))
304
+ attribution_text = attributions.read_text()
305
+ unmapped_labels = sorted(label for label in direct_labels if label not in SOURCE_MARKERS)
306
+ uncited_markers = sorted(
307
+ {SOURCE_MARKERS[label] for label in direct_labels if label in SOURCE_MARKERS and SOURCE_MARKERS[label] not in attribution_text}
308
+ )
309
+
310
+ referenced_existing_files = sum(1 for path in by_path if (root / path).is_file())
311
+ referenced_existing_directories = sum(1 for path in by_path if (root / path).is_dir())
312
+ physical_unreferenced = len(set(relative_files) - set(by_path))
313
+ suffix_counts = Counter(path.suffix.lower() or "<none>" for path in physical_files)
314
+ unregistered_category_keys = sorted(
315
+ category for category in category_counts if f"| {category} |" not in attribution_text
316
+ )
317
+
318
+ report = {
319
+ "audit": "c01_source_asset_registry_v1",
320
+ "inventory_mode": args.mode,
321
+ "root": str(root),
322
+ "canonical": str(canonical.relative_to(root)),
323
+ "canonical_sha256": sha256(canonical),
324
+ "record_count": len(records),
325
+ "path_declarations": {
326
+ "occurrences": len(declarations),
327
+ "unique": len(by_path),
328
+ "required_unique": len(required),
329
+ "optional_only_unique": len(optional_only),
330
+ "required_missing": len(missing_required),
331
+ "permitted_thin_missing": len(permitted_thin_missing) if args.mode == "thin" else 0,
332
+ "unexpected_required_missing": len(unexpected_missing_required),
333
+ "optional_missing": len(missing_optional),
334
+ "outside_source_assets": len(outside),
335
+ "declared_exists_mismatches": len(flag_mismatches),
336
+ "existing_file_paths": referenced_existing_files,
337
+ "existing_directory_paths": referenced_existing_directories,
338
+ },
339
+ "physical_inventory": {
340
+ "files": len(physical_files),
341
+ "referenced_files": referenced_existing_files,
342
+ "packaged_support_or_internal_files_not_directly_referenced": physical_unreferenced,
343
+ "suffix_counts": dict(sorted(suffix_counts.items())),
344
+ "unclassified_files": len(unclassified_files),
345
+ "unregistered_category_keys": unregistered_category_keys,
346
+ },
347
+ "source_sidecars": {
348
+ "unique_source_labels": len(source_labels),
349
+ "direct_source_labels": len(direct_labels),
350
+ "derived_source_labels": len(derived_labels),
351
+ "unmapped_direct_labels": unmapped_labels,
352
+ "citation_markers_absent_from_attributions": uncited_markers,
353
+ },
354
+ "category_counts": {
355
+ category: {"description": CATEGORY_PROVENANCE[category], **dict(sorted(counts.items()))}
356
+ for category, counts in sorted(category_counts.items())
357
+ },
358
+ "missing_required": missing_required,
359
+ "permitted_thin_missing": permitted_thin_missing if args.mode == "thin" else [],
360
+ "unexpected_missing_required": unexpected_missing_required,
361
+ "missing_optional": missing_optional,
362
+ "outside_source_assets": outside,
363
+ "declared_exists_mismatches": flag_mismatches,
364
+ "unclassified_physical_files": unclassified_files,
365
+ "unclassified_referenced_paths": unclassified_references,
366
+ "direct_source_labels": direct_labels,
367
+ "derived_source_labels": derived_labels,
368
+ }
369
+
370
+ output = args.output.expanduser().resolve() if args.output else None
371
+ if output is not None:
372
+ output.parent.mkdir(parents=True, exist_ok=True)
373
+ output.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n")
374
+ print(json.dumps({
375
+ "mode": args.mode,
376
+ "output": str(output) if output else None,
377
+ "required_missing": len(missing_required),
378
+ "permitted_thin_missing": len(permitted_thin_missing) if args.mode == "thin" else 0,
379
+ "unexpected_required_missing": len(unexpected_missing_required),
380
+ "optional_missing": len(missing_optional),
381
+ "unclassified_files": len(unclassified_files),
382
+ "unclassified_references": len(unclassified_references),
383
+ "unmapped_source_labels": len(unmapped_labels),
384
+ "uncited_source_markers": len(uncited_markers),
385
+ "unregistered_category_keys": len(unregistered_category_keys),
386
+ }, indent=2))
387
+ if unexpected_missing_required or missing_optional or outside or flag_mismatches or unclassified_files or unclassified_references or unmapped_labels or uncited_markers or unregistered_category_keys:
388
+ raise SystemExit(1)
389
+
390
+
391
+ if __name__ == "__main__":
392
+ main()
data/release_tools/build_isolated_test_bundle.py ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Materialize a gold-free filesystem root for GeoDisaster test execution."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import json
9
+ import os
10
+ import shutil
11
+ from collections import defaultdict
12
+ from pathlib import Path
13
+ from typing import Any
14
+
15
+ from eval_isolation import (
16
+ DEFAULT_OUTPUT,
17
+ ROOT,
18
+ agent_input_surface,
19
+ audit_agent_rows,
20
+ path_entries,
21
+ private_path,
22
+ read_jsonl,
23
+ )
24
+
25
+
26
+ def sha256(path: Path) -> str:
27
+ digest = hashlib.sha256()
28
+ with path.open("rb") as stream:
29
+ for block in iter(lambda: stream.read(1024 * 1024), b""):
30
+ digest.update(block)
31
+ return digest.hexdigest()
32
+
33
+
34
+ def inside(path: Path, parent: Path) -> bool:
35
+ try:
36
+ path.relative_to(parent)
37
+ return True
38
+ except ValueError:
39
+ return False
40
+
41
+
42
+ def safe_relative(path_value: str) -> Path:
43
+ relative = Path(path_value)
44
+ if relative.is_absolute() or ".." in relative.parts:
45
+ raise ValueError(f"unsafe declared path: {path_value}")
46
+ if private_path(path_value):
47
+ raise ValueError(f"private path reached bundle builder: {path_value}")
48
+ return relative
49
+
50
+
51
+ def validate_public_question_json(path: Path, relative: Path) -> None:
52
+ """Reject legacy private hints in a question sidecar before packaging."""
53
+ if path.suffix.lower() != ".json" or "questions" not in relative.parts:
54
+ return
55
+ payload = json.loads(path.read_text(encoding="utf-8"))
56
+ forbidden = {
57
+ "aoi_type_hidden",
58
+ "gt_path_hidden",
59
+ "gt_link",
60
+ "oracle_trajectory_link",
61
+ "expected_final_answer",
62
+ "final_answer",
63
+ }
64
+
65
+ def walk(value: Any, prefix: str = "") -> list[str]:
66
+ found: list[str] = []
67
+ if isinstance(value, dict):
68
+ for key, child in value.items():
69
+ field = f"{prefix}.{key}" if prefix else str(key)
70
+ if key in forbidden:
71
+ found.append(field)
72
+ found.extend(walk(child, field))
73
+ elif isinstance(value, list):
74
+ for index, child in enumerate(value):
75
+ found.extend(walk(child, f"{prefix}[{index}]"))
76
+ return found
77
+
78
+ violations = walk(payload)
79
+ if violations:
80
+ raise ValueError(f"private fields in public question sidecar {relative}: {violations}")
81
+
82
+
83
+ def declared_files(source_root: Path, rows: list[dict[str, Any]]) -> tuple[dict[Path, set[str]], list[str]]:
84
+ selected: dict[Path, set[str]] = defaultdict(set)
85
+ missing_optional: set[str] = set()
86
+ missing_required: set[str] = set()
87
+ for row in rows:
88
+ record_id = str(row["id"])
89
+ for entry in path_entries(agent_input_surface(row)):
90
+ relative = safe_relative(str(entry["path"]))
91
+ source = source_root / relative
92
+ optional = bool(entry.get("optional"))
93
+ if not source.exists():
94
+ (missing_optional if optional else missing_required).add(relative.as_posix())
95
+ continue
96
+ if source.is_symlink():
97
+ raise ValueError(f"symlinks are not allowed in an isolated bundle: {relative}")
98
+ if source.is_file():
99
+ validate_public_question_json(source, relative)
100
+ selected[relative].add(record_id)
101
+ continue
102
+ if not source.is_dir():
103
+ raise ValueError(f"unsupported declared input type: {relative}")
104
+ for candidate in source.rglob("*"):
105
+ if not candidate.is_file():
106
+ continue
107
+ child = candidate.relative_to(source_root)
108
+ if candidate.is_symlink():
109
+ raise ValueError(f"symlinks are not allowed in an isolated bundle: {child}")
110
+ if private_path(child.as_posix()):
111
+ continue
112
+ selected[child].add(record_id)
113
+ if missing_required:
114
+ raise RuntimeError(f"required inputs missing: {sorted(missing_required)[:10]}")
115
+ return dict(selected), sorted(missing_optional)
116
+
117
+
118
+ def install_file(source: Path, destination: Path, mode: str) -> None:
119
+ destination.parent.mkdir(parents=True, exist_ok=True)
120
+ if mode == "hardlink":
121
+ os.link(source, destination)
122
+ else:
123
+ shutil.copy2(source, destination)
124
+
125
+
126
+ def main() -> None:
127
+ parser = argparse.ArgumentParser(description=__doc__)
128
+ parser.add_argument("--source-root", type=Path, default=ROOT)
129
+ parser.add_argument("--inputs", type=Path, default=DEFAULT_OUTPUT)
130
+ parser.add_argument("--output", type=Path, required=True)
131
+ parser.add_argument("--mode", choices=("copy", "hardlink"), default="copy")
132
+ args = parser.parse_args()
133
+
134
+ source_root = args.source_root.resolve()
135
+ output = args.output.resolve()
136
+ if output == source_root or inside(output, source_root) or inside(source_root, output):
137
+ raise ValueError("--output must be separate from, and not contain, the source repository")
138
+ if output.exists() and any(output.iterdir()):
139
+ raise ValueError("--output must not exist or must be empty")
140
+ output.mkdir(parents=True, exist_ok=True)
141
+
142
+ rows = read_jsonl(args.inputs.resolve())
143
+ audit = audit_agent_rows(rows)
144
+ if not audit["ready"]:
145
+ raise RuntimeError(f"agent-visible input audit failed: {audit}")
146
+ files, missing_optional = declared_files(source_root, rows)
147
+
148
+ manifest_entries = []
149
+ for relative in sorted(files, key=lambda item: item.as_posix()):
150
+ source = source_root / relative
151
+ destination = output / relative
152
+ install_file(source, destination, args.mode)
153
+ manifest_entries.append(
154
+ {
155
+ "path": relative.as_posix(),
156
+ "bytes": source.stat().st_size,
157
+ "sha256": sha256(source),
158
+ "declared_by": sorted(files[relative]),
159
+ }
160
+ )
161
+
162
+ input_destination = output / "data/core/geodisaster_2921_test_inputs.jsonl"
163
+ install_file(args.inputs.resolve(), input_destination, args.mode)
164
+ manifest = {
165
+ "schema_version": "geodisaster_isolated_test_bundle_v1",
166
+ "records": len(rows),
167
+ "files": len(manifest_entries),
168
+ "bytes": sum(entry["bytes"] for entry in manifest_entries),
169
+ "missing_optional_paths": missing_optional,
170
+ "strict_runtime_environment": {
171
+ "GEODISASTER_DATASET_ROOT": str(output),
172
+ "GEODISASTER_STRICT_DATA_ROOT": "1",
173
+ },
174
+ "input_audit": audit,
175
+ "entries": manifest_entries,
176
+ }
177
+ manifest_path = output / "evaluation_bundle_manifest.json"
178
+ manifest_path.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8")
179
+ print(
180
+ json.dumps(
181
+ {
182
+ "output": str(output),
183
+ "records": len(rows),
184
+ "files": len(manifest_entries),
185
+ "bytes": manifest["bytes"],
186
+ "missing_optional": len(missing_optional),
187
+ "private_paths": len(audit["private_declared_paths"]),
188
+ "ready": True,
189
+ },
190
+ indent=2,
191
+ )
192
+ )
193
+
194
+
195
+ if __name__ == "__main__":
196
+ main()
data/release_tools/compile_c11_replay_lock.sh ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
5
+ cache_dir="${GEODISASTER_UV_CACHE_DIR:-${TMPDIR:-/tmp}/geodisaster_uv_cache}"
6
+
7
+ uv pip compile "$project_root/release_tools/environments/requirements-replay.in" \
8
+ --python-version 3.10.12 \
9
+ --python-platform x86_64-manylinux_2_17 \
10
+ --only-binary :all: \
11
+ --generate-hashes \
12
+ --cache-dir "$cache_dir" \
13
+ --custom-compile-command 'release_tools/compile_c11_replay_lock.sh' \
14
+ --output-file "$project_root/release_tools/environments/requirements-replay.lock.txt"
data/release_tools/create_c11_replay_environment.sh ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ set -eu
3
+
4
+ project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
5
+ venv_dir="${GEODISASTER_REPLAY_VENV:-$project_root/.venv-geodisaster-replay}"
6
+ cache_dir="${GEODISASTER_UV_CACHE_DIR:-${TMPDIR:-/tmp}/geodisaster_uv_cache}"
7
+ lock="$project_root/release_tools/environments/requirements-replay.lock.txt"
8
+ python_version=$(tr -d '[:space:]' <"$project_root/release_tools/environments/python-replay.version")
9
+
10
+ if ! command -v uv >/dev/null 2>&1; then
11
+ echo "uv is required to create the hash-locked replay environment" >&2
12
+ exit 2
13
+ fi
14
+ if [ ! -f "$lock" ]; then
15
+ echo "missing replay lock: $lock" >&2
16
+ exit 2
17
+ fi
18
+ if [ -e "$venv_dir" ] && [ -n "$(find "$venv_dir" -mindepth 1 -print -quit 2>/dev/null)" ]; then
19
+ echo "refusing to overwrite non-empty environment: $venv_dir" >&2
20
+ exit 2
21
+ fi
22
+
23
+ uv venv --python "$python_version" --cache-dir "$cache_dir" "$venv_dir"
24
+ uv pip sync \
25
+ --python "$venv_dir/bin/python" \
26
+ --require-hashes \
27
+ --only-binary :all: \
28
+ --strict \
29
+ --cache-dir "$cache_dir" \
30
+ "$lock"
31
+ uv pip check --python "$venv_dir/bin/python"
32
+ "$venv_dir/bin/python" "$project_root/release_tools/verify_c11_environment.py"
33
+
34
+ printf '%s\n' "$venv_dir"
data/release_tools/environments/python-replay.version ADDED
@@ -0,0 +1 @@
 
 
1
+ 3.10.12
data/release_tools/environments/requirements-replay.in ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Direct dependencies of the deterministic GeoDisaster replay/audit surface.
2
+ # Model training, LLM inference, and HTTP serving are intentionally out of scope.
3
+ # Affine is explicit because 3.x warns on Rasterio 1.4.3's multiplication API.
4
+ affine==2.4.0
5
+ numpy==1.26.4
6
+ scipy==1.11.4
7
+ rasterio==1.4.3
8
+ pyproj==3.7.1
9
+ shapely==2.1.2
10
+ pillow==11.3.0
data/release_tools/environments/requirements-replay.lock.txt ADDED
@@ -0,0 +1,331 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # release_tools/compile_c11_replay_lock.sh
3
+ affine==2.4.0 \
4
+ --hash=sha256:8a3df80e2b2378aef598a83c1392efd47967afec4242021a0b06b4c7cbc61a92 \
5
+ --hash=sha256:a24d818d6a836c131976d22f8c27b8d3ca32d0af64c1d8d29deb7bafa4da1eea
6
+ # via
7
+ # -r release_tools/environments/requirements-replay.in
8
+ # rasterio
9
+ attrs==26.1.0 \
10
+ --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \
11
+ --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32
12
+ # via rasterio
13
+ certifi==2026.7.22 \
14
+ --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 \
15
+ --hash=sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55
16
+ # via
17
+ # pyproj
18
+ # rasterio
19
+ click==8.5.0 \
20
+ --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 \
21
+ --hash=sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34
22
+ # via
23
+ # click-plugins
24
+ # cligj
25
+ # rasterio
26
+ click-plugins==1.1.1.2 \
27
+ --hash=sha256:008d65743833ffc1f5417bf0e78e8d2c23aab04d9745ba817bd3e71b0feb6aa6 \
28
+ --hash=sha256:d7af3984a99d243c131aa1a828331e7630f4a88a9741fd05c927b204bcf92261
29
+ # via rasterio
30
+ cligj==0.7.2 \
31
+ --hash=sha256:a4bc13d623356b373c2c27c53dbd9c68cae5d526270bfa71f6c6fa69669c6b27 \
32
+ --hash=sha256:c1ca117dbce1fe20a5809dc96f01e1c2840f6dcc939b3ddbb1111bf330ba82df
33
+ # via rasterio
34
+ numpy==1.26.4 \
35
+ --hash=sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b \
36
+ --hash=sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818 \
37
+ --hash=sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20 \
38
+ --hash=sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0 \
39
+ --hash=sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010 \
40
+ --hash=sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a \
41
+ --hash=sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea \
42
+ --hash=sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c \
43
+ --hash=sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71 \
44
+ --hash=sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110 \
45
+ --hash=sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be \
46
+ --hash=sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a \
47
+ --hash=sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a \
48
+ --hash=sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5 \
49
+ --hash=sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed \
50
+ --hash=sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd \
51
+ --hash=sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c \
52
+ --hash=sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e \
53
+ --hash=sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0 \
54
+ --hash=sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c \
55
+ --hash=sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a \
56
+ --hash=sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b \
57
+ --hash=sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0 \
58
+ --hash=sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6 \
59
+ --hash=sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2 \
60
+ --hash=sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a \
61
+ --hash=sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30 \
62
+ --hash=sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218 \
63
+ --hash=sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5 \
64
+ --hash=sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07 \
65
+ --hash=sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2 \
66
+ --hash=sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4 \
67
+ --hash=sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764 \
68
+ --hash=sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef \
69
+ --hash=sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3 \
70
+ --hash=sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f
71
+ # via
72
+ # -r release_tools/environments/requirements-replay.in
73
+ # rasterio
74
+ # scipy
75
+ # shapely
76
+ pillow==11.3.0 \
77
+ --hash=sha256:023f6d2d11784a465f09fd09a34b150ea4672e85fb3d05931d89f373ab14abb2 \
78
+ --hash=sha256:02a723e6bf909e7cea0dac1b0e0310be9d7650cd66222a5f1c571455c0a45214 \
79
+ --hash=sha256:040a5b691b0713e1f6cbe222e0f4f74cd233421e105850ae3b3c0ceda520f42e \
80
+ --hash=sha256:05f6ecbeff5005399bb48d198f098a9b4b6bdf27b8487c7f38ca16eeb070cd59 \
81
+ --hash=sha256:068d9c39a2d1b358eb9f245ce7ab1b5c3246c7c8c7d9ba58cfa5b43146c06e50 \
82
+ --hash=sha256:0743841cabd3dba6a83f38a92672cccbd69af56e3e91777b0ee7f4dba4385632 \
83
+ --hash=sha256:092c80c76635f5ecb10f3f83d76716165c96f5229addbd1ec2bdbbda7d496e06 \
84
+ --hash=sha256:0b275ff9b04df7b640c59ec5a3cb113eefd3795a8df80bac69646ef699c6981a \
85
+ --hash=sha256:0bce5c4fd0921f99d2e858dc4d4d64193407e1b99478bc5cacecba2311abde51 \
86
+ --hash=sha256:1019b04af07fc0163e2810167918cb5add8d74674b6267616021ab558dc98ced \
87
+ --hash=sha256:106064daa23a745510dabce1d84f29137a37224831d88eb4ce94bb187b1d7e5f \
88
+ --hash=sha256:118ca10c0d60b06d006be10a501fd6bbdfef559251ed31b794668ed569c87e12 \
89
+ --hash=sha256:13f87d581e71d9189ab21fe0efb5a23e9f28552d5be6979e84001d3b8505abe8 \
90
+ --hash=sha256:155658efb5e044669c08896c0c44231c5e9abcaadbc5cd3648df2f7c0b96b9a6 \
91
+ --hash=sha256:1904e1264881f682f02b7f8167935cce37bc97db457f8e7849dc3a6a52b99580 \
92
+ --hash=sha256:19d2ff547c75b8e3ff46f4d9ef969a06c30ab2d4263a9e287733aa8b2429ce8f \
93
+ --hash=sha256:1a992e86b0dd7aeb1f053cd506508c0999d710a8f07b4c791c63843fc6a807ac \
94
+ --hash=sha256:1b9c17fd4ace828b3003dfd1e30bff24863e0eb59b535e8f80194d9cc7ecf860 \
95
+ --hash=sha256:1c627742b539bba4309df89171356fcb3cc5a9178355b2727d1b74a6cf155fbd \
96
+ --hash=sha256:1cd110edf822773368b396281a2293aeb91c90a2db00d78ea43e7e861631b722 \
97
+ --hash=sha256:1f85acb69adf2aaee8b7da124efebbdb959a104db34d3a2cb0f3793dbae422a8 \
98
+ --hash=sha256:23cff760a9049c502721bdb743a7cb3e03365fafcdfc2ef9784610714166e5a4 \
99
+ --hash=sha256:2465a69cf967b8b49ee1b96d76718cd98c4e925414ead59fdf75cf0fd07df673 \
100
+ --hash=sha256:2a3117c06b8fb646639dce83694f2f9eac405472713fcb1ae887469c0d4f6788 \
101
+ --hash=sha256:2aceea54f957dd4448264f9bf40875da0415c83eb85f55069d89c0ed436e3542 \
102
+ --hash=sha256:2d6fcc902a24ac74495df63faad1884282239265c6839a0a6416d33faedfae7e \
103
+ --hash=sha256:30807c931ff7c095620fe04448e2c2fc673fcbb1ffe2a7da3fb39613489b1ddd \
104
+ --hash=sha256:30b7c02f3899d10f13d7a48163c8969e4e653f8b43416d23d13d1bbfdc93b9f8 \
105
+ --hash=sha256:3828ee7586cd0b2091b6209e5ad53e20d0649bbe87164a459d0676e035e8f523 \
106
+ --hash=sha256:3cee80663f29e3843b68199b9d6f4f54bd1d4a6b59bdd91bceefc51238bcb967 \
107
+ --hash=sha256:3e184b2f26ff146363dd07bde8b711833d7b0202e27d13540bfe2e35a323a809 \
108
+ --hash=sha256:41342b64afeba938edb034d122b2dda5db2139b9a4af999729ba8818e0056477 \
109
+ --hash=sha256:41742638139424703b4d01665b807c6468e23e699e8e90cffefe291c5832b027 \
110
+ --hash=sha256:4445fa62e15936a028672fd48c4c11a66d641d2c05726c7ec1f8ba6a572036ae \
111
+ --hash=sha256:45dfc51ac5975b938e9809451c51734124e73b04d0f0ac621649821a63852e7b \
112
+ --hash=sha256:465b9e8844e3c3519a983d58b80be3f668e2a7a5db97f2784e7079fbc9f9822c \
113
+ --hash=sha256:48d254f8a4c776de343051023eb61ffe818299eeac478da55227d96e241de53f \
114
+ --hash=sha256:4c834a3921375c48ee6b9624061076bc0a32a60b5532b322cc0ea64e639dd50e \
115
+ --hash=sha256:4c96f993ab8c98460cd0c001447bff6194403e8b1d7e149ade5f00594918128b \
116
+ --hash=sha256:504b6f59505f08ae014f724b6207ff6222662aab5cc9542577fb084ed0676ac7 \
117
+ --hash=sha256:527b37216b6ac3a12d7838dc3bd75208ec57c1c6d11ef01902266a5a0c14fc27 \
118
+ --hash=sha256:5418b53c0d59b3824d05e029669efa023bbef0f3e92e75ec8428f3799487f361 \
119
+ --hash=sha256:59a03cdf019efbfeeed910bf79c7c93255c3d54bc45898ac2a4140071b02b4ae \
120
+ --hash=sha256:5e05688ccef30ea69b9317a9ead994b93975104a677a36a8ed8106be9260aa6d \
121
+ --hash=sha256:6359a3bc43f57d5b375d1ad54a0074318a0844d11b76abccf478c37c986d3cfc \
122
+ --hash=sha256:643f189248837533073c405ec2f0bb250ba54598cf80e8c1e043381a60632f58 \
123
+ --hash=sha256:65dc69160114cdd0ca0f35cb434633c75e8e7fad4cf855177a05bf38678f73ad \
124
+ --hash=sha256:67172f2944ebba3d4a7b54f2e95c786a3a50c21b88456329314caaa28cda70f6 \
125
+ --hash=sha256:676b2815362456b5b3216b4fd5bd89d362100dc6f4945154ff172e206a22c024 \
126
+ --hash=sha256:6a418691000f2a418c9135a7cf0d797c1bb7d9a485e61fe8e7722845b95ef978 \
127
+ --hash=sha256:6abdbfd3aea42be05702a8dd98832329c167ee84400a1d1f61ab11437f1717eb \
128
+ --hash=sha256:6be31e3fc9a621e071bc17bb7de63b85cbe0bfae91bb0363c893cbe67247780d \
129
+ --hash=sha256:7107195ddc914f656c7fc8e4a5e1c25f32e9236ea3ea860f257b0436011fddd0 \
130
+ --hash=sha256:71f511f6b3b91dd543282477be45a033e4845a40278fa8dcdbfdb07109bf18f9 \
131
+ --hash=sha256:7859a4cc7c9295f5838015d8cc0a9c215b77e43d07a25e460f35cf516df8626f \
132
+ --hash=sha256:7966e38dcd0fa11ca390aed7c6f20454443581d758242023cf36fcb319b1a874 \
133
+ --hash=sha256:79ea0d14d3ebad43ec77ad5272e6ff9bba5b679ef73375ea760261207fa8e0aa \
134
+ --hash=sha256:7aee118e30a4cf54fdd873bd3a29de51e29105ab11f9aad8c32123f58c8f8081 \
135
+ --hash=sha256:7b161756381f0918e05e7cb8a371fff367e807770f8fe92ecb20d905d0e1c149 \
136
+ --hash=sha256:7c8ec7a017ad1bd562f93dbd8505763e688d388cde6e4a010ae1486916e713e6 \
137
+ --hash=sha256:7d1aa4de119a0ecac0a34a9c8bde33f34022e2e8f99104e47a3ca392fd60e37d \
138
+ --hash=sha256:7db51d222548ccfd274e4572fdbf3e810a5e66b00608862f947b163e613b67dd \
139
+ --hash=sha256:819931d25e57b513242859ce1876c58c59dc31587847bf74cfe06b2e0cb22d2f \
140
+ --hash=sha256:83e1b0161c9d148125083a35c1c5a89db5b7054834fd4387499e06552035236c \
141
+ --hash=sha256:857844335c95bea93fb39e0fa2726b4d9d758850b34075a7e3ff4f4fa3aa3b31 \
142
+ --hash=sha256:8797edc41f3e8536ae4b10897ee2f637235c94f27404cac7297f7b607dd0716e \
143
+ --hash=sha256:8924748b688aa210d79883357d102cd64690e56b923a186f35a82cbc10f997db \
144
+ --hash=sha256:89bd777bc6624fe4115e9fac3352c79ed60f3bb18651420635f26e643e3dd1f6 \
145
+ --hash=sha256:8dc70ca24c110503e16918a658b869019126ecfe03109b754c402daff12b3d9f \
146
+ --hash=sha256:91da1d88226663594e3f6b4b8c3c8d85bd504117d043740a8e0ec449087cc494 \
147
+ --hash=sha256:921bd305b10e82b4d1f5e802b6850677f965d8394203d182f078873851dada69 \
148
+ --hash=sha256:932c754c2d51ad2b2271fd01c3d121daaa35e27efae2a616f77bf164bc0b3e94 \
149
+ --hash=sha256:93efb0b4de7e340d99057415c749175e24c8864302369e05914682ba642e5d77 \
150
+ --hash=sha256:97afb3a00b65cc0804d1c7abddbf090a81eaac02768af58cbdcaaa0a931e0b6d \
151
+ --hash=sha256:97f07ed9f56a3b9b5f49d3661dc9607484e85c67e27f3e8be2c7d28ca032fec7 \
152
+ --hash=sha256:98a9afa7b9007c67ed84c57c9e0ad86a6000da96eaa638e4f8abe5b65ff83f0a \
153
+ --hash=sha256:9ab6ae226de48019caa8074894544af5b53a117ccb9d3b3dcb2871464c829438 \
154
+ --hash=sha256:9c412fddd1b77a75aa904615ebaa6001f169b26fd467b4be93aded278266b288 \
155
+ --hash=sha256:a1bc6ba083b145187f648b667e05a2534ecc4b9f2784c2cbe3089e44868f2b9b \
156
+ --hash=sha256:a418486160228f64dd9e9efcd132679b7a02a5f22c982c78b6fc7dab3fefb635 \
157
+ --hash=sha256:a4d336baed65d50d37b88ca5b60c0fa9d81e3a87d4a7930d3880d1624d5b31f3 \
158
+ --hash=sha256:a6444696fce635783440b7f7a9fc24b3ad10a9ea3f0ab66c5905be1c19ccf17d \
159
+ --hash=sha256:a7bc6e6fd0395bc052f16b1a8670859964dbd7003bd0af2ff08342eb6e442cfe \
160
+ --hash=sha256:b4b8f3efc8d530a1544e5962bd6b403d5f7fe8b9e08227c6b255f98ad82b4ba0 \
161
+ --hash=sha256:b5f56c3f344f2ccaf0dd875d3e180f631dc60a51b314295a3e681fe8cf851fbe \
162
+ --hash=sha256:be5463ac478b623b9dd3937afd7fb7ab3d79dd290a28e2b6df292dc75063eb8a \
163
+ --hash=sha256:c37d8ba9411d6003bba9e518db0db0c58a680ab9fe5179f040b0463644bc9805 \
164
+ --hash=sha256:c84d689db21a1c397d001aa08241044aa2069e7587b398c8cc63020390b1c1b8 \
165
+ --hash=sha256:c96d333dcf42d01f47b37e0979b6bd73ec91eae18614864622d9b87bbd5bbf36 \
166
+ --hash=sha256:cadc9e0ea0a2431124cde7e1697106471fc4c1da01530e679b2391c37d3fbb3a \
167
+ --hash=sha256:cc3e831b563b3114baac7ec2ee86819eb03caa1a2cef0b481a5675b59c4fe23b \
168
+ --hash=sha256:cd8ff254faf15591e724dc7c4ddb6bf4793efcbe13802a4ae3e863cd300b493e \
169
+ --hash=sha256:d000f46e2917c705e9fb93a3606ee4a819d1e3aa7a9b442f6444f07e77cf5e25 \
170
+ --hash=sha256:d9da3df5f9ea2a89b81bb6087177fb1f4d1c7146d583a3fe5c672c0d94e55e12 \
171
+ --hash=sha256:e5c5858ad8ec655450a7c7df532e9842cf8df7cc349df7225c60d5d348c8aada \
172
+ --hash=sha256:e67d793d180c9df62f1f40aee3accca4829d3794c95098887edc18af4b8b780c \
173
+ --hash=sha256:ea944117a7974ae78059fcc1800e5d3295172bb97035c0c1d9345fca1419da71 \
174
+ --hash=sha256:eb76541cba2f958032d79d143b98a3a6b3ea87f0959bbe256c0b5e416599fd5d \
175
+ --hash=sha256:ec1ee50470b0d050984394423d96325b744d55c701a439d2bd66089bff963d3c \
176
+ --hash=sha256:ee92f2fd10f4adc4b43d07ec5e779932b4eb3dbfbc34790ada5a6669bc095aa6 \
177
+ --hash=sha256:f0f5d8f4a08090c6d6d578351a2b91acf519a54986c055af27e7a93feae6d3f1 \
178
+ --hash=sha256:f1f182ebd2303acf8c380a54f615ec883322593320a9b00438eb842c1f37ae50 \
179
+ --hash=sha256:f8a5827f84d973d8636e9dc5764af4f0cf2318d26744b3d902931701b0d46653 \
180
+ --hash=sha256:f944255db153ebb2b19c51fe85dd99ef0ce494123f21b9db4877ffdfc5590c7c \
181
+ --hash=sha256:fdae223722da47b024b867c1ea0be64e0df702c5e0a60e27daad39bf960dd1e4 \
182
+ --hash=sha256:fe27fb049cdcca11f11a7bfda64043c37b30e6b91f10cb5bab275806c32f6ab3
183
+ # via -r release_tools/environments/requirements-replay.in
184
+ pyparsing==3.3.3 \
185
+ --hash=sha256:928ae7e20211f3b6f3915a72f06a0cfd29ab9d24279dd6346b6b1a7146397d36 \
186
+ --hash=sha256:ece8c00a69cf01b45d0b1dedabb469c90d8caf996d4fda40f147627a122849a4
187
+ # via rasterio
188
+ pyproj==3.7.1 \
189
+ --hash=sha256:04abc517a8555d1b05fcee768db3280143fe42ec39fdd926a2feef31631a1f2f \
190
+ --hash=sha256:0829865c1d3a3543f918b3919dc601eea572d6091c0dd175e1a054db9c109274 \
191
+ --hash=sha256:084c0a475688f934d386c2ab3b6ce03398a473cd48adfda70d9ab8f87f2394a0 \
192
+ --hash=sha256:0b853ae99bda66cbe24b4ccfe26d70601d84375940a47f553413d9df570065e0 \
193
+ --hash=sha256:1e47c4e93b88d99dd118875ee3ca0171932444cdc0b52d493371b5d98d0f30ee \
194
+ --hash=sha256:263b54ba5004b6b957d55757d846fc5081bc02980caa0279c4fc95fa0fff6067 \
195
+ --hash=sha256:2781029d90df7f8d431e29562a3f2d8eafdf233c4010d6fc0381858dc7373217 \
196
+ --hash=sha256:3537668992a709a2e7f068069192138618c00d0ba113572fdd5ee5ffde8222f3 \
197
+ --hash=sha256:3c2e7449840a44ce860d8bea2c6c1c4bc63fa07cba801dcce581d14dcb031a02 \
198
+ --hash=sha256:3e8d276caeae34fcbe4813855d0d97b9b825bab8d7a8b86d859c24a6213a5a0d \
199
+ --hash=sha256:5ad0ff443a785d84e2b380869fdd82e6bfc11eba6057d25b4409a9bbfa867970 \
200
+ --hash=sha256:5f0da2711364d7cb9f115b52289d4a9b61e8bca0da57f44a3a9d6fc9bdeb7274 \
201
+ --hash=sha256:5f8d02ef4431dee414d1753d13fa82a21a2f61494737b5f642ea668d76164d6d \
202
+ --hash=sha256:60d72facd7b6b79853f19744779abcd3f804c4e0d4fa8815469db20c9f640a47 \
203
+ --hash=sha256:6181960b4b812e82e588407fe5c9c68ada267c3b084db078f248db5d7f45d18a \
204
+ --hash=sha256:6575b2e53cc9e3e461ad6f0692a5564b96e7782c28631c7771c668770915e169 \
205
+ --hash=sha256:83db380c52087f9e9bdd8a527943b2e7324f275881125e39475c4f9277bdeec4 \
206
+ --hash=sha256:87229e42b75e89f4dad6459200f92988c5998dfb093c7c631fb48524c86cd5dc \
207
+ --hash=sha256:8c5dcf24ede53d8abab7d8a77f69ff1936c6a8843ef4fcc574646e4be66e5739 \
208
+ --hash=sha256:8cb516ee35ed57789b46b96080edf4e503fdb62dbb2e3c6581e0d6c83fca014b \
209
+ --hash=sha256:a20727a23b1e49c7dc7fe3c3df8e56a8a7acdade80ac2f5cca29d7ca5564c145 \
210
+ --hash=sha256:a8b15b0463d1303bab113d1a6af2860a0d79013c3a66fcc5475ce26ef717fd4f \
211
+ --hash=sha256:a94e26c1a4950cea40116775588a2ca7cf56f1f434ff54ee35a84718f3841a3d \
212
+ --hash=sha256:aee664a9d806612af30a19dba49e55a7a78ebfec3e9d198f6a6176e1d140ec98 \
213
+ --hash=sha256:b35ed213892e211a3ce2bea002aa1183e1a2a9b79e51bb3c6b15549a831ae528 \
214
+ --hash=sha256:bf09dbeb333c34e9c546364e7df1ff40474f9fddf9e70657ecb0e4f670ff0b0e \
215
+ --hash=sha256:bf84d766646f1ebd706d883755df4370aaf02b48187cedaa7e4239f16bc8213d \
216
+ --hash=sha256:d3caac7473be22b6d6e102dde6c46de73b96bc98334e577dfaee9886f102ea2e \
217
+ --hash=sha256:d61bf8ab04c73c1da08eedaf21a103b72fa5b0a9b854762905f65ff8b375d394 \
218
+ --hash=sha256:d666c3a3faaf3b1d7fc4a544059c4eab9d06f84a604b070b7aa2f318e227798e \
219
+ --hash=sha256:f173f851ee75e54acdaa053382b6825b400cb2085663a9bb073728a59c60aebb \
220
+ --hash=sha256:f550281ed6e5ea88fcf04a7c6154e246d5714be495c50c9e8e6b12d3fb63e158 \
221
+ --hash=sha256:f6d6a2ccd5607cd15ef990c51e6f2dd27ec0a741e72069c387088bba3aab60fa
222
+ # via -r release_tools/environments/requirements-replay.in
223
+ rasterio==1.4.3 \
224
+ --hash=sha256:1839960e2f3057a6daa323ccf67b330f8f2f0dbd4a50cc7031e88e649301c5c0 \
225
+ --hash=sha256:1a6e6ca9ec361599b48c9918ce25adb1a9203b8c8ca9b34ad78dccb3aef7945a \
226
+ --hash=sha256:201f05dbc7c4739dacb2c78a1cf4e09c0b7265b0a4d16ccbd1753ce4f2af350a \
227
+ --hash=sha256:38a126f8dbf405cd3450b5bd10c6cc493a2e1be4cf83442d26f5e4f412372d36 \
228
+ --hash=sha256:3f411a6a5bcb81ab6dc9128a8bccd13d3822cfa4a50c239e3a0528751a1ad5fc \
229
+ --hash=sha256:4009f7ce4e0883d8e5b400970daa3f1ca309caac8916d955722ee4486654d452 \
230
+ --hash=sha256:54eef32d20a0dfbba59a8bb9828e562c3e9e97e2355b8dfe4a5274117976059f \
231
+ --hash=sha256:597f8dcf494d0ca4254434496e83b1723fec206d23d64da5751a582a2b01e1d3 \
232
+ --hash=sha256:5b8a4311582274de2346450e5361d092b80b8b5c7b02fda6203402ba101ffabf \
233
+ --hash=sha256:5d4fcb635379b3d7b2f5e944c153849e3d27e93f35ad73ad4d3f0b8a580f0c8e \
234
+ --hash=sha256:80f994b92e5dda78f13291710bd5c43efcfd164f69a8a2c20489115df9d178c8 \
235
+ --hash=sha256:812c854e7177064aeb58def2d59752887ad6b3d39ff3f858ed9df3f2ddc95613 \
236
+ --hash=sha256:8e90c2c300294265c16becc9822337ded0f01fb8664500b4d77890d633d8cd0e \
237
+ --hash=sha256:98a9c89eade8c779e8ac1e525269faaa18c6b9818fc3c72cfc4627df71c66d0d \
238
+ --hash=sha256:9c30114d95ebba4ff49f078b3c193d29ff56d832588649400a3fa78f1dda1c96 \
239
+ --hash=sha256:a702e21712ba237e34515d829847f9f5f06d8e665e864a7bb0a3d4d8f6dec10d \
240
+ --hash=sha256:a962ad4c29feaf38b1d7a94389313127de3646a5b9b734fbf9a04e16051a27ff \
241
+ --hash=sha256:af04f788f6f814569184bd9da6c5d9889512212385ab58c52720dfb1f972671d \
242
+ --hash=sha256:d9bab1a0bb22b8bed1db34b5258db93d790ed4e61ef21ac055a7c6933c8d5e84 \
243
+ --hash=sha256:e703e4b2c74c678786d5d110a3f30e26f3acfd65f09ccf35f69683a532f7a772 \
244
+ --hash=sha256:e79847a5a0e01399457a1e02d8c92040cb56729d054fe7796f0c17b246b18bf0
245
+ # via -r release_tools/environments/requirements-replay.in
246
+ scipy==1.11.4 \
247
+ --hash=sha256:00150c5eae7b610c32589dda259eacc7c4f1665aedf25d921907f4d08a951b1c \
248
+ --hash=sha256:028eccd22e654b3ea01ee63705681ee79933652b2d8f873e7949898dda6d11b6 \
249
+ --hash=sha256:1b7c3dca977f30a739e0409fb001056484661cb2541a01aba0bb0029f7b68db8 \
250
+ --hash=sha256:2c6ff6ef9cc27f9b3db93a6f8b38f97387e6e0591600369a297a50a8e96e835d \
251
+ --hash=sha256:36750b7733d960d7994888f0d148d31ea3017ac15eef664194b4ef68d36a4a97 \
252
+ --hash=sha256:530f9ad26440e85766509dbf78edcfe13ffd0ab7fec2560ee5c36ff74d6269ff \
253
+ --hash=sha256:5e347b14fe01003d3b78e196e84bd3f48ffe4c8a7b8a1afbcb8f5505cb710993 \
254
+ --hash=sha256:6550466fbeec7453d7465e74d4f4b19f905642c89a7525571ee91dd7adabb5a3 \
255
+ --hash=sha256:6df1468153a31cf55ed5ed39647279beb9cfb5d3f84369453b49e4b8502394fd \
256
+ --hash=sha256:6e619aba2df228a9b34718efb023966da781e89dd3d21637b27f2e54db0410d7 \
257
+ --hash=sha256:8fce70f39076a5aa62e92e69a7f62349f9574d8405c0a5de6ed3ef72de07f446 \
258
+ --hash=sha256:90a2b78e7f5733b9de748f589f09225013685f9b218275257f8a8168ededaeaa \
259
+ --hash=sha256:91af76a68eeae0064887a48e25c4e616fa519fa0d38602eda7e0f97d65d57937 \
260
+ --hash=sha256:933baf588daa8dc9a92c20a0be32f56d43faf3d1a60ab11b3f08c356430f6e56 \
261
+ --hash=sha256:acf8ed278cc03f5aff035e69cb511741e0418681d25fbbb86ca65429c4f4d9cd \
262
+ --hash=sha256:ad669df80528aeca5f557712102538f4f37e503f0c5b9541655016dd0932ca79 \
263
+ --hash=sha256:b030c6674b9230d37c5c60ab456e2cf12f6784596d15ce8da9365e70896effc4 \
264
+ --hash=sha256:b9999c008ccf00e8fbcce1236f85ade5c569d13144f77a1946bef8863e8f6eb4 \
265
+ --hash=sha256:bc9a714581f561af0848e6b69947fda0614915f072dfd14142ed1bfe1b806710 \
266
+ --hash=sha256:ce7fff2e23ab2cc81ff452a9444c215c28e6305f396b2ba88343a567feec9660 \
267
+ --hash=sha256:cf00bd2b1b0211888d4dc75656c0412213a8b25e80d73898083f402b50f47e41 \
268
+ --hash=sha256:d10e45a6c50211fe256da61a11c34927c68f277e03138777bdebedd933712fea \
269
+ --hash=sha256:ee410e6de8f88fd5cf6eadd73c135020bfbbbdfcd0f6162c36a7638a1ea8cc65 \
270
+ --hash=sha256:f313b39a7e94f296025e3cffc2c567618174c0b1dde173960cf23808f9fae4be \
271
+ --hash=sha256:f3cd9e7b3c2c1ec26364856f9fbe78695fe631150f94cd1c22228456404cf1ec
272
+ # via -r release_tools/environments/requirements-replay.in
273
+ shapely==2.1.2 \
274
+ --hash=sha256:0036ac886e0923417932c2e6369b6c52e38e0ff5d9120b90eef5cd9a5fc5cae9 \
275
+ --hash=sha256:01d0d304b25634d60bd7cf291828119ab55a3bab87dc4af1e44b07fb225f188b \
276
+ --hash=sha256:0bd308103340030feef6c111d3eb98d50dc13feea33affc8a6f9fa549e9458a3 \
277
+ --hash=sha256:136ab87b17e733e22f0961504d05e77e7be8c9b5a8184f685b4a91a84efe3c26 \
278
+ --hash=sha256:16a9c722ba774cf50b5d4541242b4cce05aafd44a015290c82ba8a16931ff63d \
279
+ --hash=sha256:16c5d0fc45d3aa0a69074979f4f1928ca2734fb2e0dde8af9611e134e46774e7 \
280
+ --hash=sha256:19efa3611eef966e776183e338b2d7ea43569ae99ab34f8d17c2c054d3205cc0 \
281
+ --hash=sha256:1d0bfb4b8f661b3b4ec3565fa36c340bfb1cda82087199711f86a88647d26b2f \
282
+ --hash=sha256:1e7d4d7ad262a48bb44277ca12c7c78cb1b0f56b32c10734ec9a1d30c0b0c54b \
283
+ --hash=sha256:1f2f33f486777456586948e333a56ae21f35ae273be99255a191f5c1fa302eb4 \
284
+ --hash=sha256:1ff629e00818033b8d71139565527ced7d776c269a49bd78c9df84e8f852190c \
285
+ --hash=sha256:21952dc00df38a2c28375659b07a3979d22641aeb104751e769c3ee825aadecf \
286
+ --hash=sha256:2d93d23bdd2ed9dc157b46bc2f19b7da143ca8714464249bef6771c679d5ff40 \
287
+ --hash=sha256:2ed4ecb28320a433db18a5bf029986aa8afcfd740745e78847e330d5d94922a9 \
288
+ --hash=sha256:2fa78b49485391224755a856ed3b3bd91c8455f6121fee0db0e71cefb07d0ef6 \
289
+ --hash=sha256:346ec0c1a0fcd32f57f00e4134d1200e14bf3f5ae12af87ba83ca275c502498c \
290
+ --hash=sha256:361b6d45030b4ac64ddd0a26046906c8202eb60d0f9f53085f5179f1d23021a0 \
291
+ --hash=sha256:40d784101f5d06a1fd30b55fc11ea58a61be23f930d934d86f19a180909908a4 \
292
+ --hash=sha256:4a44bc62a10d84c11a7a3d7c1c4fe857f7477c3506e24c9062da0db0ae0c449c \
293
+ --hash=sha256:5860eb9f00a1d49ebb14e881f5caf6c2cf472c7fd38bd7f253bbd34f934eb076 \
294
+ --hash=sha256:5ebe3f84c6112ad3d4632b1fd2290665aa75d4cef5f6c5d77c4c95b324527c6a \
295
+ --hash=sha256:61edcd8d0d17dd99075d320a1dd39c0cb9616f7572f10ef91b4b5b00c4aeb566 \
296
+ --hash=sha256:6305993a35989391bd3476ee538a5c9a845861462327efe00dd11a5c8c709a99 \
297
+ --hash=sha256:6ddc759f72b5b2b0f54a7e7cde44acef680a55019eb52ac63a7af2cf17cb9cd2 \
298
+ --hash=sha256:743044b4cfb34f9a67205cee9279feaf60ba7d02e69febc2afc609047cb49179 \
299
+ --hash=sha256:7ae48c236c0324b4e139bea88a306a04ca630f49be66741b340729d380d8f52f \
300
+ --hash=sha256:7ed1a5bbfb386ee8332713bf7508bc24e32d24b74fc9a7b9f8529a55db9f4ee6 \
301
+ --hash=sha256:8cff473e81017594d20ec55d86b54bc635544897e13a7cfc12e36909c5309a2a \
302
+ --hash=sha256:8d8382dd120d64b03698b7298b89611a6ea6f55ada9d39942838b79c9bc89801 \
303
+ --hash=sha256:9111274b88e4d7b54a95218e243282709b330ef52b7b86bc6aaf4f805306f454 \
304
+ --hash=sha256:91121757b0a36c9aac3427a651a7e6567110a4a67c97edf04f8d55d4765f6618 \
305
+ --hash=sha256:980c777c612514c0cf99bc8a9de6d286f5e186dcaf9091252fcd444e5638193d \
306
+ --hash=sha256:9a522f460d28e2bf4e12396240a5fc1518788b2fcd73535166d748399ef0c223 \
307
+ --hash=sha256:9c3a3c648aedc9f99c09263b39f2d8252f199cb3ac154fadc173283d7d111350 \
308
+ --hash=sha256:a1fd0ea855b2cf7c9cddaf25543e914dd75af9de08785f20ca3085f2c9ca60b0 \
309
+ --hash=sha256:a444e7afccdb0999e203b976adb37ea633725333e5b119ad40b1ca291ecf311c \
310
+ --hash=sha256:a84e0582858d841d54355246ddfcbd1fce3179f185da7470f41ce39d001ee1af \
311
+ --hash=sha256:b510dda1a3672d6879beb319bc7c5fd302c6c354584690973c838f46ec3e0fa8 \
312
+ --hash=sha256:b54df60f1fbdecc8ebc2c5b11870461a6417b3d617f555e5033f1505d36e5735 \
313
+ --hash=sha256:b705c99c76695702656327b819c9660768ec33f5ce01fa32b2af62b56ba400a1 \
314
+ --hash=sha256:ba4d1333cc0bc94381d6d4308d2e4e008e0bd128bdcff5573199742ee3634359 \
315
+ --hash=sha256:c64d5c97b2f47e3cd9b712eaced3b061f2b71234b3fc263e0fcf7d889c6559dc \
316
+ --hash=sha256:c8876673449f3401f278c86eb33224c5764582f72b653a415d0e6672fde887bf \
317
+ --hash=sha256:ca2591bff6645c216695bdf1614fca9c82ea1144d4a7591a466fef64f28f0715 \
318
+ --hash=sha256:cc4f7397459b12c0b196c9efe1f9d7e92463cbba142632b4cc6d8bbbbd3e2b09 \
319
+ --hash=sha256:cf831a13e0d5a7eb519e96f58ec26e049b1fad411fc6fc23b162a7ce04d9cffc \
320
+ --hash=sha256:dc3487447a43d42adcdf52d7ac73804f2312cbfa5d433a7d2c506dcab0033dfd \
321
+ --hash=sha256:df90e2db118c3671a0754f38e36802db75fe0920d211a27481daf50a711fdf26 \
322
+ --hash=sha256:e38a190442aacc67ff9f75ce60aec04893041f16f97d242209106d502486a142 \
323
+ --hash=sha256:e9eddfe513096a71896441a7c37db72da0687b34752c4e193577a145c71736fc \
324
+ --hash=sha256:eba6710407f1daa8e7602c347dfc94adc02205ec27ed956346190d66579eb9ea \
325
+ --hash=sha256:ef4a456cc8b7b3d50ccec29642aa4aeda959e9da2fe9540a92754770d5f0cf1f \
326
+ --hash=sha256:f67b34271dedc3c653eba4e3d7111aa421d5be9b4c4c7d38d30907f796cb30df \
327
+ --hash=sha256:f6f6cd5819c50d9bcf921882784586aab34a4bd53e7553e175dece6db513a6f0 \
328
+ --hash=sha256:fe2533caae6a91a543dec62e8360fe86ffcdc42a7c55f9dfd0128a977a896b94 \
329
+ --hash=sha256:fe7b77dc63d707c09726b7908f575fc04ff1d1ad0f3fb92aec212396bc6cfe5e \
330
+ --hash=sha256:fe9627c39c59e553c90f5bc3128252cb85dc3b3be8189710666d2f8bc3a5503e
331
+ # via -r release_tools/environments/requirements-replay.in
data/release_tools/eval_isolation.py ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Build and validate the agent-visible GeoDisaster test projection.
3
+
4
+ Reference/gold records remain evaluator-only. This module owns the narrower
5
+ record contract passed to an evaluated agent and its tools.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import argparse
11
+ import json
12
+ from pathlib import Path
13
+ from typing import Any, Iterable
14
+
15
+
16
+ ROOT = Path(__file__).resolve().parents[1]
17
+ DEFAULT_REFERENCE = ROOT / "data/core/geodisaster_2921_test_source.jsonl"
18
+ DEFAULT_OUTPUT = ROOT / "data/core/geodisaster_2921_test_inputs.jsonl"
19
+
20
+ REFERENCE_ONLY_TOP_LEVEL_KEYS = {
21
+ "correction_provenance",
22
+ "executions",
23
+ "expected_final_answer",
24
+ "final_answer",
25
+ "gt_chain",
26
+ "multiagentic_gt_chain",
27
+ "source_replay",
28
+ "tool_sequence",
29
+ }
30
+
31
+ AGENT_VISIBLE_TOP_LEVEL_KEYS = {
32
+ "available_initial_handles",
33
+ "id",
34
+ "initial_artifacts",
35
+ "question",
36
+ "question_type",
37
+ "sample_id",
38
+ "split",
39
+ "split_group_id",
40
+ "split_seed",
41
+ }
42
+
43
+ PRIVATE_PATH_SEGMENTS = {"gt", "ground_truth", "hidden", "trajectories"}
44
+ PRIVATE_NAME_MARKERS = {
45
+ "canonical_answer",
46
+ "expected_answer",
47
+ "expected_final_answer",
48
+ "gt_report",
49
+ "hidden_gt",
50
+ "selected_routes.json",
51
+ }
52
+
53
+
54
+ def read_jsonl(path: Path) -> list[dict[str, Any]]:
55
+ return [json.loads(line) for line in path.open(encoding="utf-8") if line.strip()]
56
+
57
+
58
+ def write_jsonl(path: Path, rows: Iterable[dict[str, Any]]) -> None:
59
+ temporary = path.with_suffix(path.suffix + ".tmp")
60
+ with temporary.open("w", encoding="utf-8") as stream:
61
+ for row in rows:
62
+ stream.write(json.dumps(row, separators=(",", ":"), ensure_ascii=False) + "\n")
63
+ temporary.replace(path)
64
+
65
+
66
+ def private_path(path_value: str) -> bool:
67
+ path = Path(path_value)
68
+ lowered_parts = {part.lower() for part in path.parts}
69
+ lowered_name = path.name.lower()
70
+ return bool(lowered_parts & PRIVATE_PATH_SEGMENTS) or any(
71
+ marker in lowered_name for marker in PRIVATE_NAME_MARKERS
72
+ )
73
+
74
+
75
+ def scrub_private_paths(value: Any) -> Any:
76
+ """Remove only explicit private path cards; retain legitimate input cards."""
77
+
78
+ if isinstance(value, dict):
79
+ path_value = value.get("path")
80
+ if isinstance(path_value, str) and path_value and private_path(path_value):
81
+ return None
82
+ cleaned: dict[str, Any] = {}
83
+ for key, child in value.items():
84
+ scrubbed = scrub_private_paths(child)
85
+ if scrubbed is not None:
86
+ cleaned[key] = scrubbed
87
+ return cleaned
88
+ if isinstance(value, list):
89
+ return [cleaned for child in value if (cleaned := scrub_private_paths(child)) is not None]
90
+ return value
91
+
92
+
93
+ def agent_visible_record(reference: dict[str, Any]) -> dict[str, Any]:
94
+ record = {
95
+ key: reference[key]
96
+ for key in AGENT_VISIBLE_TOP_LEVEL_KEYS
97
+ if key in reference
98
+ }
99
+ record["initial_artifacts"] = scrub_private_paths(record.get("initial_artifacts") or {})
100
+ return record
101
+
102
+
103
+ def path_entries(value: Any) -> Iterable[dict[str, Any]]:
104
+ if isinstance(value, dict):
105
+ if isinstance(value.get("path"), str) and value["path"]:
106
+ yield value
107
+ for child in value.values():
108
+ yield from path_entries(child)
109
+ elif isinstance(value, list):
110
+ for child in value:
111
+ yield from path_entries(child)
112
+
113
+
114
+ def agent_input_surface(row: dict[str, Any]) -> dict[str, Any]:
115
+ return {
116
+ "question": row.get("question") or {},
117
+ "initial_artifacts": row.get("initial_artifacts") or {},
118
+ }
119
+
120
+
121
+ def audit_agent_rows(
122
+ rows: list[dict[str, Any]], reference_rows: list[dict[str, Any]] | None = None
123
+ ) -> dict[str, Any]:
124
+ ids = [str(row.get("id") or "") for row in rows]
125
+ forbidden_keys = sorted(
126
+ {
127
+ key
128
+ for row in rows
129
+ for key in row
130
+ if key in REFERENCE_ONLY_TOP_LEVEL_KEYS
131
+ }
132
+ )
133
+ unexpected_keys = sorted({key for row in rows for key in row} - AGENT_VISIBLE_TOP_LEVEL_KEYS)
134
+ declared = [
135
+ entry
136
+ for row in rows
137
+ for entry in path_entries(agent_input_surface(row))
138
+ ]
139
+ private = sorted(
140
+ {
141
+ str(entry["path"])
142
+ for entry in declared
143
+ if private_path(str(entry["path"]))
144
+ }
145
+ )
146
+ reference_ids = [str(row.get("id") or "") for row in reference_rows or []]
147
+ result = {
148
+ "records": len(rows),
149
+ "unique_ids": len(set(ids)),
150
+ "duplicate_ids": len(ids) - len(set(ids)),
151
+ "all_test_split": all(row.get("split") == "test" for row in rows),
152
+ "ids_match_reference_in_order": reference_rows is None or ids == reference_ids,
153
+ "reference_only_top_level_keys": forbidden_keys,
154
+ "unexpected_top_level_keys": unexpected_keys,
155
+ "declared_path_references": len(declared),
156
+ "unique_declared_paths": len({str(entry["path"]) for entry in declared}),
157
+ "private_declared_paths": private,
158
+ }
159
+ result["ready"] = (
160
+ result["records"] == 292
161
+ and result["unique_ids"] == 292
162
+ and result["duplicate_ids"] == 0
163
+ and result["all_test_split"]
164
+ and result["ids_match_reference_in_order"]
165
+ and not forbidden_keys
166
+ and not unexpected_keys
167
+ and not private
168
+ )
169
+ return result
170
+
171
+
172
+ def main() -> None:
173
+ parser = argparse.ArgumentParser(description=__doc__)
174
+ parser.add_argument("--reference", type=Path, default=DEFAULT_REFERENCE)
175
+ parser.add_argument("--output", type=Path, default=DEFAULT_OUTPUT)
176
+ parser.add_argument("--check-only", action="store_true")
177
+ args = parser.parse_args()
178
+
179
+ reference = read_jsonl(args.reference.resolve())
180
+ if args.check_only:
181
+ rows = read_jsonl(args.output.resolve())
182
+ else:
183
+ rows = [agent_visible_record(row) for row in reference]
184
+ write_jsonl(args.output.resolve(), rows)
185
+ report = audit_agent_rows(rows, reference)
186
+ print(json.dumps(report, indent=2))
187
+ if not report["ready"]:
188
+ raise SystemExit(1)
189
+
190
+
191
+ if __name__ == "__main__":
192
+ main()
data/release_tools/evaluate_c12_sen1_accuracy.py ADDED
@@ -0,0 +1,410 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Evaluate the declared Sentinel-1 Otsu baseline against evaluator-only labels.
3
+
4
+ The canonical tasks intentionally ask for properties of a predicted mask. This
5
+ script is a separate construct-validity check: it recreates that mask from each
6
+ declared S1 input and compares it with the Sen1Floods11 ``LabelHand`` reference.
7
+ Reference labels are never added to the agent's initial artifacts or answers.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import argparse
13
+ import hashlib
14
+ import json
15
+ from collections import Counter, defaultdict
16
+ from pathlib import Path
17
+ from typing import Any, Iterable
18
+
19
+ import numpy as np
20
+ import rasterio
21
+
22
+
23
+ METHOD = "s1_min_backscatter_otsu_v1"
24
+ REFERENCE_NAME = "Sen1Floods11 v1.1 LabelHand"
25
+ ACCURACY_KEYS = {"accuracy", "iou", "f1", "precision", "recall"}
26
+
27
+
28
+ def sha256(path: Path) -> str:
29
+ digest = hashlib.sha256()
30
+ with path.open("rb") as stream:
31
+ for chunk in iter(lambda: stream.read(1024 * 1024), b""):
32
+ digest.update(chunk)
33
+ return digest.hexdigest()
34
+
35
+
36
+ def round6(value: float | None) -> float | None:
37
+ return None if value is None else round(float(value), 6)
38
+
39
+
40
+ def safe_div(numerator: int, denominator: int) -> float | None:
41
+ return None if denominator == 0 else numerator / denominator
42
+
43
+
44
+ def otsu_threshold(values: np.ndarray) -> float:
45
+ """Match the worker's 256-bin Otsu implementation exactly."""
46
+ values = values[np.isfinite(values)]
47
+ if values.size == 0:
48
+ return 0.0
49
+ hist, edges = np.histogram(values, bins=256)
50
+ centers = (edges[:-1] + edges[1:]) / 2
51
+ total = int(hist.sum())
52
+ if total == 0:
53
+ return float(np.nanmean(values))
54
+ weight1 = np.cumsum(hist)
55
+ weight2 = total - weight1
56
+ mean1 = np.cumsum(hist * centers) / np.maximum(weight1, 1)
57
+ mean2 = (
58
+ np.cumsum((hist * centers)[::-1])
59
+ / np.maximum(np.cumsum(hist[::-1]), 1)
60
+ )[::-1]
61
+ between = weight1[:-1] * weight2[:-1] * (mean1[:-1] - mean2[1:]) ** 2
62
+ if between.size == 0:
63
+ return float(np.nanmean(values))
64
+ return float(centers[:-1][int(np.argmax(between))])
65
+
66
+
67
+ def predicted_mask(path: Path) -> tuple[np.ndarray, np.ndarray, float, dict[str, Any]]:
68
+ with rasterio.open(path) as dataset:
69
+ band1 = dataset.read(1).astype("float32")
70
+ band2 = dataset.read(2).astype("float32") if dataset.count >= 2 else band1
71
+ valid = np.isfinite(band1) & np.isfinite(band2)
72
+ if dataset.nodata is not None and np.isfinite(float(dataset.nodata)):
73
+ valid &= (band1 != float(dataset.nodata)) & (band2 != float(dataset.nodata))
74
+ score = np.minimum(band1, band2)
75
+ threshold = otsu_threshold(score[valid])
76
+ mask = valid & (score <= threshold)
77
+ profile = {
78
+ "shape": [dataset.height, dataset.width],
79
+ "crs": str(dataset.crs) if dataset.crs else None,
80
+ "transform": list(dataset.transform)[:6],
81
+ }
82
+ return mask, valid, threshold, profile
83
+
84
+
85
+ def contains_accuracy_field(value: Any) -> bool:
86
+ if isinstance(value, dict):
87
+ if any(str(key).lower() in ACCURACY_KEYS for key in value):
88
+ return True
89
+ return any(contains_accuracy_field(item) for item in value.values())
90
+ if isinstance(value, list):
91
+ return any(contains_accuracy_field(item) for item in value)
92
+ return False
93
+
94
+
95
+ def declared_paths(value: Any) -> Iterable[str]:
96
+ if isinstance(value, dict):
97
+ path = value.get("path")
98
+ if isinstance(path, str):
99
+ yield path
100
+ for item in value.values():
101
+ yield from declared_paths(item)
102
+ elif isinstance(value, list):
103
+ for item in value:
104
+ yield from declared_paths(item)
105
+
106
+
107
+ def load_contract(dataset_path: Path) -> tuple[dict[str, dict[str, Any]], dict[str, Any]]:
108
+ samples: dict[str, dict[str, Any]] = {}
109
+ records = []
110
+ forbidden_declarations = []
111
+ accuracy_answer_ids = []
112
+ wrong_method_ids = []
113
+
114
+ with dataset_path.open(encoding="utf-8") as stream:
115
+ for line_number, line in enumerate(stream, 1):
116
+ record = json.loads(line)
117
+ record_id = str(record.get("id", ""))
118
+ if not record_id.startswith("sen1_flood/"):
119
+ continue
120
+ records.append(record)
121
+ sample_id = str(record["sample_id"])
122
+ question_type = str(record["question_type"])
123
+ expected = record.get("expected_final_answer") or {}
124
+ if expected.get("prediction_method") != METHOD:
125
+ wrong_method_ids.append(record_id)
126
+ if contains_accuracy_field(expected):
127
+ accuracy_answer_ids.append(record_id)
128
+ for path in declared_paths(record.get("initial_artifacts") or {}):
129
+ lowered = path.lower()
130
+ if "/labelhand.tif" in lowered or "s1otsulabelhand.tif" in lowered:
131
+ forbidden_declarations.append({"id": record_id, "path": path})
132
+
133
+ s1_path = (
134
+ record["initial_artifacts"]["sar_chip_1"]["paths"]["s1_image"]["path"]
135
+ )
136
+ entry = samples.setdefault(
137
+ sample_id,
138
+ {
139
+ "sample_id": sample_id,
140
+ "split": record["split"],
141
+ "s1_path": s1_path,
142
+ "question_types": [],
143
+ "expected_flood_percentages": [],
144
+ },
145
+ )
146
+ if entry["split"] != record["split"] or entry["s1_path"] != s1_path:
147
+ raise ValueError(f"inconsistent split or S1 path for {sample_id}")
148
+ entry["question_types"].append(question_type)
149
+ if "flood_percentage" in expected:
150
+ entry["expected_flood_percentages"].append(
151
+ {"question_type": question_type, "value": float(expected["flood_percentage"])}
152
+ )
153
+
154
+ if len(records) != 500 or len(samples) != 100:
155
+ raise ValueError(f"expected 500 records/100 samples, found {len(records)}/{len(samples)}")
156
+ for sample_id, entry in samples.items():
157
+ if Counter(entry["question_types"]) != Counter("ABCDE"):
158
+ raise ValueError(f"{sample_id}: expected one record for each of A-E")
159
+
160
+ audit = {
161
+ "records": len(records),
162
+ "unique_samples": len(samples),
163
+ "question_types": sorted({str(row["question_type"]) for row in records}),
164
+ "records_with_declared_reference_label": len(forbidden_declarations),
165
+ "declared_reference_label_violations": forbidden_declarations,
166
+ "records_with_accuracy_fields_in_expected_answer": len(accuracy_answer_ids),
167
+ "accuracy_field_answer_ids": accuracy_answer_ids,
168
+ "records_with_wrong_or_missing_prediction_method": len(wrong_method_ids),
169
+ "wrong_method_ids": wrong_method_ids,
170
+ "expected_answer_contract": (
171
+ "agent-facing answers describe deterministic Otsu predictions; "
172
+ "reference-label accuracy is evaluator-only"
173
+ ),
174
+ }
175
+ return samples, audit
176
+
177
+
178
+ def evaluate_sample(root: Path, entry: dict[str, Any]) -> dict[str, Any]:
179
+ sample_id = entry["sample_id"]
180
+ s1_path = root / entry["s1_path"]
181
+ label_path = root / "source_assets" / "sen1_flood" / sample_id / "labels" / "LabelHand.tif"
182
+ if not s1_path.is_file():
183
+ raise FileNotFoundError(f"missing declared S1 input: {s1_path}")
184
+ if not label_path.is_file():
185
+ raise FileNotFoundError(f"missing evaluator-only reference label: {label_path}")
186
+
187
+ prediction, source_valid, threshold, source_profile = predicted_mask(s1_path)
188
+ with rasterio.open(label_path) as dataset:
189
+ label = dataset.read(1)
190
+ label_profile = {
191
+ "shape": [dataset.height, dataset.width],
192
+ "crs": str(dataset.crs) if dataset.crs else None,
193
+ "transform": list(dataset.transform)[:6],
194
+ }
195
+ same_grid = (
196
+ source_profile["shape"] == label_profile["shape"]
197
+ and source_profile["crs"] == label_profile["crs"]
198
+ and np.allclose(
199
+ source_profile["transform"],
200
+ label_profile["transform"],
201
+ rtol=0.0,
202
+ atol=1e-12,
203
+ )
204
+ )
205
+ if not same_grid:
206
+ raise ValueError(f"{sample_id}: S1/reference grids differ")
207
+ values = {int(value) for value in np.unique(label)}
208
+ if not values.issubset({-1, 0, 1}):
209
+ raise ValueError(f"{sample_id}: unsupported reference values {sorted(values)}")
210
+
211
+ full_prediction_count = int(prediction.sum())
212
+ full_valid_count = int(source_valid.sum())
213
+ full_percentage = full_prediction_count / full_valid_count * 100 if full_valid_count else 0.0
214
+ expected_percentages = entry["expected_flood_percentages"]
215
+ canonical_percentage_match = bool(expected_percentages) and all(
216
+ abs(round(full_percentage, 6) - round(item["value"], 6)) <= 1e-6
217
+ for item in expected_percentages
218
+ )
219
+
220
+ valid = label != -1
221
+ ground_truth = label == 1
222
+ prediction = prediction & valid
223
+ tp = int((prediction & ground_truth).sum())
224
+ fp = int((prediction & (label == 0)).sum())
225
+ fn = int(((~prediction) & ground_truth & valid).sum())
226
+ tn = int(((~prediction) & (label == 0) & valid).sum())
227
+ precision = safe_div(tp, tp + fp)
228
+ recall = safe_div(tp, tp + fn)
229
+ iou = safe_div(tp, tp + fp + fn)
230
+ f1 = safe_div(2 * tp, 2 * tp + fp + fn)
231
+
232
+ return {
233
+ "sample_id": sample_id,
234
+ "split": entry["split"],
235
+ "question_record_count": 5,
236
+ "prediction_method": METHOD,
237
+ "reference": REFERENCE_NAME,
238
+ "s1_path": entry["s1_path"],
239
+ "reference_label_path": str(label_path.relative_to(root)),
240
+ "s1_sha256": sha256(s1_path),
241
+ "reference_label_sha256": sha256(label_path),
242
+ "prediction_threshold": round(float(threshold), 8),
243
+ "computed_full_s1_flood_percentage": round6(full_percentage),
244
+ "canonical_expected_flood_percentages": expected_percentages,
245
+ "canonical_prediction_percentage_match": canonical_percentage_match,
246
+ "valid_reference_pixels": int(valid.sum()),
247
+ "reference_flood_pixels": int(ground_truth.sum()),
248
+ "predicted_flood_pixels_in_reference_footprint": int(prediction.sum()),
249
+ "TP": tp,
250
+ "FP": fp,
251
+ "FN": fn,
252
+ "TN": tn,
253
+ "IoU": round6(iou),
254
+ "precision": round6(precision),
255
+ "recall": round6(recall),
256
+ "F1": round6(f1),
257
+ }
258
+
259
+
260
+ def summarize(rows: list[dict[str, Any]]) -> dict[str, Any]:
261
+ def metric_mean(name: str) -> float | None:
262
+ values = [float(row[name]) for row in rows if row.get(name) is not None]
263
+ return round6(float(np.mean(values))) if values else None
264
+
265
+ aggregate = {name: sum(int(row[name]) for row in rows) for name in ("TP", "FP", "FN", "TN")}
266
+ tp, fp, fn = aggregate["TP"], aggregate["FP"], aggregate["FN"]
267
+ return {
268
+ "samples": len(rows),
269
+ "question_records_represented": len(rows) * 5,
270
+ "samples_without_reference_flood_pixels": sum(
271
+ int(row["reference_flood_pixels"]) == 0 for row in rows
272
+ ),
273
+ "macro": {
274
+ "IoU": metric_mean("IoU"),
275
+ "precision": metric_mean("precision"),
276
+ "recall": metric_mean("recall"),
277
+ "F1": metric_mean("F1"),
278
+ "recall_defined_samples": sum(row.get("recall") is not None for row in rows),
279
+ },
280
+ "aggregate_confusion": aggregate,
281
+ "micro": {
282
+ "IoU": round6(safe_div(tp, tp + fp + fn)),
283
+ "precision": round6(safe_div(tp, tp + fp)),
284
+ "recall": round6(safe_div(tp, tp + fn)),
285
+ "F1": round6(safe_div(2 * tp, 2 * tp + fp + fn)),
286
+ },
287
+ }
288
+
289
+
290
+ def write_report(output_dir: Path, result: dict[str, Any]) -> None:
291
+ output_dir.mkdir(parents=True, exist_ok=True)
292
+ (output_dir / "summary.json").write_text(
293
+ json.dumps(result, indent=2, sort_keys=False) + "\n", encoding="utf-8"
294
+ )
295
+ with (output_dir / "per_sample_metrics.jsonl").open("w", encoding="utf-8") as stream:
296
+ for row in result["per_sample_metrics"]:
297
+ stream.write(json.dumps(row, sort_keys=True) + "\n")
298
+
299
+ held_out = result["summaries"]["test"]
300
+ overall = result["summaries"]["all"]
301
+ audit = result["contract_audit"]
302
+ text = f"""# C12 Sentinel-1 reference-label evaluation
303
+
304
+ This is an evaluator-side construct-validity report. The 500 agent-facing
305
+ questions and expected answers describe outputs of `{METHOD}`. They do not
306
+ claim that those outputs equal the Sen1Floods11 hand labels, and the labels are
307
+ not declared agent inputs.
308
+
309
+ ## Contract audit
310
+
311
+ - Sentinel records: {audit['records']} (100 scenes x A-E)
312
+ - Declared reference-label paths: {audit['records_with_declared_reference_label']}
313
+ - Expected answers containing accuracy/IoU/F1/precision/recall: {audit['records_with_accuracy_fields_in_expected_answer']}
314
+ - Wrong or missing `prediction_method`: {audit['records_with_wrong_or_missing_prediction_method']}
315
+ - Scenes whose recomputed flood percentage matches the canonical answer: {audit['samples_matching_canonical_prediction_percentage']}/100
316
+
317
+ ## Held-out test result
318
+
319
+ - Scenes: {held_out['samples']} ({held_out['question_records_represented']} question records)
320
+ - Macro IoU / F1: {held_out['macro']['IoU']} / {held_out['macro']['F1']}
321
+ - Macro precision / recall: {held_out['macro']['precision']} / {held_out['macro']['recall']}
322
+ - Micro IoU / F1: {held_out['micro']['IoU']} / {held_out['micro']['F1']}
323
+ - Micro precision / recall: {held_out['micro']['precision']} / {held_out['micro']['recall']}
324
+
325
+ ## All-scene diagnostic
326
+
327
+ - Scenes: {overall['samples']} ({overall['question_records_represented']} question records)
328
+ - Macro IoU / F1: {overall['macro']['IoU']} / {overall['macro']['F1']}
329
+ - Micro IoU / F1: {overall['micro']['IoU']} / {overall['micro']['F1']}
330
+ - Scenes with no positive reference pixels (recall undefined): {overall['samples_without_reference_flood_pixels']}
331
+
332
+ ## Interpretation
333
+
334
+ The baseline has relatively high recall and low precision; it is a simple,
335
+ reproducible flood-candidate baseline, not a validated operational flood map.
336
+ The held-out metrics quantify its agreement with `LabelHand`, but do not turn
337
+ the agent-facing targets into ground-truth flood masks. No acceptance threshold
338
+ was selected after observing these results.
339
+ """
340
+ (output_dir / "README.md").write_text(text, encoding="utf-8")
341
+
342
+
343
+ def parser() -> argparse.ArgumentParser:
344
+ result = argparse.ArgumentParser(description=__doc__)
345
+ root = Path(__file__).resolve().parents[1]
346
+ result.add_argument("--root", type=Path, default=root)
347
+ result.add_argument(
348
+ "--dataset",
349
+ type=Path,
350
+ default=Path("data/core/geodisaster_2921_source_with_splits.jsonl"),
351
+ )
352
+ result.add_argument(
353
+ "--output-dir",
354
+ type=Path,
355
+ default=Path("sen1_accuracy_results"),
356
+ )
357
+ return result
358
+
359
+
360
+ def main() -> None:
361
+ args = parser().parse_args()
362
+ root = args.root.resolve()
363
+ dataset = args.dataset if args.dataset.is_absolute() else root / args.dataset
364
+ output_dir = args.output_dir if args.output_dir.is_absolute() else root / args.output_dir
365
+ samples, audit = load_contract(dataset)
366
+ if audit["records_with_declared_reference_label"]:
367
+ raise RuntimeError("reference-label leakage detected in declared initial artifacts")
368
+ if audit["records_with_accuracy_fields_in_expected_answer"]:
369
+ raise RuntimeError("agent-facing expected answers improperly contain accuracy fields")
370
+ if audit["records_with_wrong_or_missing_prediction_method"]:
371
+ raise RuntimeError("Sentinel expected-answer method contract is inconsistent")
372
+
373
+ rows = [evaluate_sample(root, samples[key]) for key in sorted(samples)]
374
+ canonical_mismatches = [
375
+ row["sample_id"] for row in rows if not row["canonical_prediction_percentage_match"]
376
+ ]
377
+ audit["samples_matching_canonical_prediction_percentage"] = len(rows) - len(canonical_mismatches)
378
+ audit["canonical_prediction_percentage_mismatches"] = canonical_mismatches
379
+ if canonical_mismatches:
380
+ raise RuntimeError(
381
+ "evaluator prediction does not reproduce canonical expected values for: "
382
+ + ", ".join(canonical_mismatches)
383
+ )
384
+ grouped: dict[str, list[dict[str, Any]]] = defaultdict(list)
385
+ for row in rows:
386
+ grouped[str(row["split"])].append(row)
387
+ if set(grouped) != {"train", "test"}:
388
+ raise ValueError(f"unexpected sample splits: {sorted(grouped)}")
389
+ result = {
390
+ "schema_version": "c12_sen1_reference_label_evaluation_v1",
391
+ "dataset": str(dataset.relative_to(root)),
392
+ "dataset_sha256": sha256(dataset),
393
+ "prediction_method": METHOD,
394
+ "reference": REFERENCE_NAME,
395
+ "reference_valid_values": [0, 1],
396
+ "reference_nodata_value": -1,
397
+ "contract_audit": audit,
398
+ "summaries": {
399
+ "all": summarize(rows),
400
+ "train": summarize(grouped["train"]),
401
+ "test": summarize(grouped["test"]),
402
+ },
403
+ "per_sample_metrics": rows,
404
+ }
405
+ write_report(output_dir, result)
406
+ print(json.dumps({"output_dir": str(output_dir), "summaries": result["summaries"]}, indent=2))
407
+
408
+
409
+ if __name__ == "__main__":
410
+ main()
data/release_tools/evidence/source_asset_registry_development_snapshot.json ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "audit": "c01_source_asset_registry_v1",
3
+ "canonical": "data/core/geodisaster_2921_source_with_splits.jsonl",
4
+ "canonical_sha256": "03988b960e6b09ae01fb622fe45b35d763eb705485cddc3cea68bcac7ae63fe1",
5
+ "category_counts": {
6
+ "D01": {
7
+ "description": "Sentinel-1 GRD source raster or GDAL sidecar",
8
+ "physical_files": 245,
9
+ "required_paths": 240
10
+ },
11
+ "D02": {
12
+ "description": "Sentinel-2 L2A source raster or GDAL sidecar",
13
+ "physical_files": 273,
14
+ "required_paths": 267
15
+ },
16
+ "D03": {
17
+ "description": "Sentinel-2-derived RGB preview",
18
+ "physical_files": 267,
19
+ "required_paths": 267
20
+ },
21
+ "D04": {
22
+ "description": "Hansen GFC source/derived mask or GDAL sidecar",
23
+ "physical_files": 147,
24
+ "required_paths": 144
25
+ },
26
+ "D05": {
27
+ "description": "project-authored deforestation question",
28
+ "physical_files": 384,
29
+ "required_paths": 384
30
+ },
31
+ "D06": {
32
+ "description": "project-generated deforestation quality report",
33
+ "physical_files": 48
34
+ },
35
+ "MH00": {
36
+ "description": "multi-hazard sample-directory container handle",
37
+ "physical_files": 1
38
+ },
39
+ "MH01": {
40
+ "description": "project-authored AOI/metadata/handle manifest",
41
+ "physical_files": 324,
42
+ "required_paths": 108
43
+ },
44
+ "MH02": {
45
+ "description": "project-authored question, answer, or trajectory record",
46
+ "physical_files": 1296,
47
+ "required_paths": 432
48
+ },
49
+ "MH03": {
50
+ "description": "project-generated quality report",
51
+ "physical_files": 108
52
+ },
53
+ "MH04": {
54
+ "description": "source-derived tabular baseline",
55
+ "physical_files": 123,
56
+ "required_paths": 21
57
+ },
58
+ "MH05": {
59
+ "description": "OpenStreetMap POI extract",
60
+ "physical_files": 108,
61
+ "required_paths": 108
62
+ },
63
+ "MH06": {
64
+ "description": "source-derived visualization panel",
65
+ "physical_files": 432
66
+ },
67
+ "MH07": {
68
+ "description": "WorldPop population raster and provider sidecar",
69
+ "physical_files": 216,
70
+ "required_paths": 216
71
+ },
72
+ "MH08": {
73
+ "description": "wildfire source/derived raster, sidecar, or GDAL sidecar",
74
+ "physical_files": 369,
75
+ "required_paths": 120
76
+ },
77
+ "MH09": {
78
+ "description": "deforestation source/derived raster or sidecar",
79
+ "physical_files": 368,
80
+ "required_paths": 184
81
+ },
82
+ "MH10": {
83
+ "description": "urban-expansion source/derived raster or sidecar",
84
+ "physical_files": 696,
85
+ "required_paths": 232
86
+ },
87
+ "MH11": {
88
+ "description": "drought source/derived raster or sidecar",
89
+ "physical_files": 206,
90
+ "required_paths": 168
91
+ },
92
+ "MH12": {
93
+ "description": "air-pollution source/derived raster or sidecar",
94
+ "physical_files": 280,
95
+ "required_paths": 160
96
+ },
97
+ "MH13": {
98
+ "description": "OpenAQ empty-query provenance (no measurements)",
99
+ "physical_files": 40
100
+ },
101
+ "MH14": {
102
+ "description": "project-authored train-only air-pollution normalization contract",
103
+ "physical_files": 21,
104
+ "required_paths": 20
105
+ },
106
+ "MH15": {
107
+ "description": "project-authored train-only drought normalization contract",
108
+ "physical_files": 21,
109
+ "required_paths": 21
110
+ },
111
+ "R01": {
112
+ "description": "legacy project-authored routing split export",
113
+ "physical_files": 3
114
+ },
115
+ "R02": {
116
+ "description": "CEMS flood-extent source vector",
117
+ "physical_files": 200,
118
+ "required_paths": 200
119
+ },
120
+ "R03": {
121
+ "description": "Sentinel-2 L2A raster/preview or GDAL sidecar",
122
+ "physical_files": 401,
123
+ "required_paths": 400
124
+ },
125
+ "R04": {
126
+ "description": "project-authored routing metadata with source identifiers",
127
+ "physical_files": 200,
128
+ "required_paths": 200
129
+ },
130
+ "R05": {
131
+ "description": "OSM+CEMS-derived road/route/score product",
132
+ "physical_files": 600,
133
+ "required_paths": 600
134
+ },
135
+ "R06": {
136
+ "description": "project-selected route answer",
137
+ "physical_files": 200
138
+ },
139
+ "R07": {
140
+ "description": "Sentinel-2+OSM+CEMS-derived route overlay",
141
+ "physical_files": 200
142
+ },
143
+ "S01": {
144
+ "description": "Sen1Floods11 Sentinel-1 chip or GDAL sidecar",
145
+ "physical_files": 201,
146
+ "required_paths": 100
147
+ },
148
+ "S02": {
149
+ "description": "Sen1Floods11 JRC-water layer or GDAL sidecar",
150
+ "physical_files": 101,
151
+ "required_paths": 100
152
+ },
153
+ "S03": {
154
+ "description": "Sen1Floods11 hand label or GDAL sidecar",
155
+ "physical_files": 101
156
+ },
157
+ "S04": {
158
+ "description": "legacy Sen1Floods11 Otsu derivative or GDAL sidecar",
159
+ "physical_files": 101
160
+ },
161
+ "S05": {
162
+ "description": "source-derived public preview or packaged overlay",
163
+ "physical_files": 399
164
+ },
165
+ "S06": {
166
+ "description": "project-generated hidden derivative of Sen1Floods11 hand labels",
167
+ "physical_files": 600
168
+ },
169
+ "X01": {
170
+ "description": "xBD pre/post imagery",
171
+ "physical_files": 458,
172
+ "required_paths": 229
173
+ },
174
+ "X02": {
175
+ "description": "xBD-label-derived target mask",
176
+ "physical_files": 177,
177
+ "required_paths": 177
178
+ },
179
+ "X03": {
180
+ "description": "xBD damage polygons or coordinate conversion",
181
+ "physical_files": 458,
182
+ "required_paths": 229
183
+ },
184
+ "X04": {
185
+ "description": "project-generated grid/quadrant geometry",
186
+ "physical_files": 458,
187
+ "required_paths": 354
188
+ }
189
+ },
190
+ "declared_exists_mismatches": [],
191
+ "derived_source_labels": [
192
+ "derived from CHIRPS SPI and train-only normalization",
193
+ "derived from Dynamic World built probability",
194
+ "derived from ESA WorldCover 2020 and 2021 class 50",
195
+ "derived from GHSL 2020 and 2025 built surface",
196
+ "derived from Landsat NBR",
197
+ "derived from Sentinel-2 NBR",
198
+ "derived from Sentinel-2 NDBI",
199
+ "derived from Sentinel-2 NDVI",
200
+ "derived from Sentinel-2 dNBR",
201
+ "derived from Sentinel-5P NO2 and train-only mean",
202
+ "derived training-relative S5P NO2 column"
203
+ ],
204
+ "direct_source_labels": [
205
+ "COPERNICUS/S2_SR_HARMONIZED NBR",
206
+ "COPERNICUS/S2_SR_HARMONIZED NDBI",
207
+ "COPERNICUS/S2_SR_HARMONIZED NDVI",
208
+ "COPERNICUS/S2_SR_HARMONIZED RGB",
209
+ "COPERNICUS/S5P/OFFL/L3_CO CO",
210
+ "COPERNICUS/S5P/OFFL/L3_NO2 tropospheric NO2 * 1e6",
211
+ "COPERNICUS/S5P/OFFL/L3_SO2 SO2 * 1e6",
212
+ "EC JRC TMF v1_2023 AnnualChanges",
213
+ "ECMWF Copernicus Atmosphere Monitoring Service \u2014 CAMS Global Near-Real-Time",
214
+ "ECMWF/ERA5_LAND/DAILY_AGGR volumetric_soil_water_layer_1",
215
+ "ESA WorldCover 2020 class 50 built-up",
216
+ "ESA/WorldCover/v200 Map class 50 built-up",
217
+ "GOOGLE/DYNAMICWORLD/V1 built probability",
218
+ "JRC/GHSL/P2023A/GHS_BUILT_S 2020 built_surface>0",
219
+ "JRC/GHSL/P2023A/GHS_BUILT_S 2025 built_surface>0",
220
+ "LANDSAT/LC08+LC09/C02/T1_L2 NBR",
221
+ "MODIS/061/MCD19A2_GRANULES Optical_Depth_047 * 0.001",
222
+ "MODIS/061/MCD64A1 BurnDate",
223
+ "MODIS/061/MOD13Q1 NDVI",
224
+ "NASA LP DAAC \u2014 VNP14A1.002 Thermal Anomalies/Fire Daily L3 Global 1 km",
225
+ "NASA LP DAAC \u2014 VNP21A1D.002 Day LST and Emissivity Daily 1 km",
226
+ "National Interagency Fire Center \u2014 WFIGS Interagency Fire Perimeters",
227
+ "UCSB-CHG/CHIRPS/DAILY same-window z-score",
228
+ "UMD/hansen/global_forest_change_2025_v1_13 lossyear=2022",
229
+ "UMD/hansen/global_forest_change_2025_v1_13 treecover2000>30",
230
+ "Wageningen University & Research / Global Forest Watch \u2014 RADD Forest Disturbance Alerts v1"
231
+ ],
232
+ "missing_optional": [],
233
+ "missing_required": [],
234
+ "outside_source_assets": [],
235
+ "path_declarations": {
236
+ "declared_exists_mismatches": 0,
237
+ "existing_directory_paths": 0,
238
+ "existing_file_paths": 5681,
239
+ "occurrences": 14963,
240
+ "optional_missing": 0,
241
+ "optional_only_unique": 0,
242
+ "outside_source_assets": 0,
243
+ "required_missing": 0,
244
+ "required_unique": 5681,
245
+ "unique": 5681
246
+ },
247
+ "physical_inventory": {
248
+ "files": 10831,
249
+ "packaged_support_or_internal_files_not_directly_referenced": 5150,
250
+ "referenced_files": 5681,
251
+ "suffix_counts": {
252
+ ".csv": 143,
253
+ ".geojson": 2032,
254
+ ".json": 3881,
255
+ ".png": 2133,
256
+ ".tif": 2614,
257
+ ".xml": 28
258
+ },
259
+ "unclassified_files": 0,
260
+ "unregistered_category_keys": []
261
+ },
262
+ "record_count": 2921,
263
+ "source_sidecars": {
264
+ "citation_markers_absent_from_attributions": [],
265
+ "derived_source_labels": 11,
266
+ "direct_source_labels": 26,
267
+ "unique_source_labels": 37,
268
+ "unmapped_direct_labels": []
269
+ },
270
+ "unclassified_physical_files": [],
271
+ "unclassified_referenced_paths": []
272
+ }
data/release_tools/fetch_sen1floods11_subset.py ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Hydrate and verify the 100-chip Sen1Floods11 benchmark subset.
3
+
4
+ The downloader uses the official public Cloud to Street Google Cloud Storage
5
+ bucket over HTTPS. Files are downloaded atomically and accepted only when
6
+ their size and SHA-256 match the pinned manifest. Existing mismatched files are
7
+ never overwritten unless --replace-mismatched is explicitly supplied.
8
+ """
9
+
10
+ from __future__ import annotations
11
+
12
+ import argparse
13
+ import hashlib
14
+ import json
15
+ import os
16
+ import shutil
17
+ import sys
18
+ import threading
19
+ import urllib.error
20
+ import urllib.request
21
+ from concurrent.futures import ThreadPoolExecutor, as_completed
22
+ from pathlib import Path
23
+ from typing import Any
24
+
25
+ from raster_portability import verify_portable_s1, write_portable_s1
26
+
27
+
28
+ REPOSITORY_ROOT = Path(__file__).resolve().parents[1]
29
+ DEFAULT_MANIFEST = REPOSITORY_ROOT / "release_tools/manifests/sen1floods11_required_100.json"
30
+ CANONICAL_RELATIVE_PATH = Path("data/core/geodisaster_2921_source_with_splits.jsonl")
31
+ ALLOWED_LOCAL_PREFIX = Path("source_assets/sen1_flood")
32
+
33
+
34
+ def sha256(path: Path) -> str:
35
+ digest = hashlib.sha256()
36
+ with path.open("rb") as stream:
37
+ for chunk in iter(lambda: stream.read(1024 * 1024), b""):
38
+ digest.update(chunk)
39
+ return digest.hexdigest()
40
+
41
+
42
+ def read_manifest(path: Path) -> dict[str, Any]:
43
+ payload = json.loads(path.read_text())
44
+ entries = payload.get("entries")
45
+ if payload.get("schema_version") != "sen1floods11_required_subset_v1":
46
+ raise ValueError("unsupported or missing manifest schema_version")
47
+ if not isinstance(entries, list) or not entries:
48
+ raise ValueError("manifest entries must be a non-empty list")
49
+ chip_ids = [entry.get("chip_id") for entry in entries]
50
+ if len(chip_ids) != len(set(chip_ids)):
51
+ raise ValueError("manifest contains duplicate chip IDs")
52
+ if payload.get("selected_chip_count") != len(entries):
53
+ raise ValueError("selected_chip_count does not match manifest entries")
54
+ derivative = payload.get("portable_derivative")
55
+ if not isinstance(derivative, dict) or derivative.get("schema_version") != "finite_nodata_geotiff_v1":
56
+ raise ValueError("missing or unsupported portable_derivative contract")
57
+ for entry in entries:
58
+ files = entry.get("files")
59
+ if (
60
+ not isinstance(files, list)
61
+ or len(files) != 2
62
+ or {item.get("role") for item in files} != {"s1", "jrc"}
63
+ ):
64
+ raise ValueError(f"{entry.get('chip_id')}: exactly one s1 and one jrc file are required")
65
+ return payload
66
+
67
+
68
+ def safe_target(root: Path, relative: str) -> Path:
69
+ relative_path = Path(relative)
70
+ if relative_path.is_absolute() or ".." in relative_path.parts:
71
+ raise ValueError(f"unsafe local path in manifest: {relative}")
72
+ try:
73
+ relative_path.relative_to(ALLOWED_LOCAL_PREFIX)
74
+ except ValueError as exc:
75
+ raise ValueError(f"local path is outside {ALLOWED_LOCAL_PREFIX}: {relative}") from exc
76
+ target = (root / relative_path).resolve()
77
+ target.relative_to(root.resolve())
78
+ return target
79
+
80
+
81
+ def file_status(target: Path, item: dict[str, Any]) -> dict[str, Any]:
82
+ if not target.is_file():
83
+ return {"status": "missing", "path": str(target)}
84
+ actual_bytes = target.stat().st_size
85
+ expected_bytes = int(item["bytes"])
86
+ if actual_bytes != expected_bytes:
87
+ return {
88
+ "status": "size_mismatch",
89
+ "path": str(target),
90
+ "expected_bytes": expected_bytes,
91
+ "actual_bytes": actual_bytes,
92
+ }
93
+ actual_sha256 = sha256(target)
94
+ if actual_sha256 != item["sha256"]:
95
+ return {
96
+ "status": "sha256_mismatch",
97
+ "path": str(target),
98
+ "expected_sha256": item["sha256"],
99
+ "actual_sha256": actual_sha256,
100
+ }
101
+ return {"status": "verified", "path": str(target), "bytes": actual_bytes}
102
+
103
+
104
+ def flatten_entries(manifest: dict[str, Any], limit_chips: int | None) -> list[dict[str, Any]]:
105
+ entries = manifest["entries"]
106
+ if limit_chips is not None:
107
+ if limit_chips <= 0:
108
+ raise ValueError("--limit-chips must be positive")
109
+ entries = entries[:limit_chips]
110
+ flattened = []
111
+ for entry in entries:
112
+ for item in entry["files"]:
113
+ flattened.append({"chip_id": entry["chip_id"], **item})
114
+ return flattened
115
+
116
+
117
+ def portable_pair(root: Path, entry: dict[str, Any]) -> tuple[Path, Path]:
118
+ s1_item = next(item for item in entry["files"] if item["role"] == "s1")
119
+ source = safe_target(root, s1_item["local_path"])
120
+ destination = source.parents[1] / "derived/S1Portable.tif"
121
+ destination.resolve().relative_to(root.resolve())
122
+ return source, destination
123
+
124
+
125
+ def portable_status(root: Path, entry: dict[str, Any]) -> dict[str, Any]:
126
+ source, destination = portable_pair(root, entry)
127
+ if not source.is_file():
128
+ return {"status": "source_missing", "path": str(destination)}
129
+ if not destination.is_file():
130
+ return {"status": "missing", "path": str(destination)}
131
+ try:
132
+ details = verify_portable_s1(source, destination)
133
+ except (OSError, ValueError) as exc:
134
+ return {"status": "invalid", "path": str(destination), "error": str(exc)}
135
+ return {"status": "verified", "path": str(destination), **details}
136
+
137
+
138
+ def generate_portable(root: Path, entry: dict[str, Any]) -> dict[str, Any]:
139
+ source, destination = portable_pair(root, entry)
140
+ before = portable_status(root, entry)
141
+ if before["status"] == "verified":
142
+ return {"chip_id": entry["chip_id"], "action": "kept", **before}
143
+ write_portable_s1(source, destination)
144
+ after = portable_status(root, entry)
145
+ if after["status"] != "verified":
146
+ raise RuntimeError(f"portable derivative failed validation for {entry['chip_id']}: {after}")
147
+ return {"chip_id": entry["chip_id"], "action": "generated", **after}
148
+
149
+
150
+ def download_one(
151
+ root: Path,
152
+ item: dict[str, Any],
153
+ replace_mismatched: bool,
154
+ timeout: int,
155
+ ) -> dict[str, Any]:
156
+ target = safe_target(root, item["local_path"])
157
+ before = file_status(target, item)
158
+ if before["status"] == "verified":
159
+ return {"chip_id": item["chip_id"], "role": item["role"], "action": "kept", **before}
160
+ if target.exists() and not replace_mismatched:
161
+ raise RuntimeError(
162
+ f"refusing to overwrite {target}: {before['status']}; "
163
+ "use --replace-mismatched only after reviewing the file"
164
+ )
165
+
166
+ target.parent.mkdir(parents=True, exist_ok=True)
167
+ temporary = target.with_name(
168
+ f".{target.name}.partial.{os.getpid()}.{threading.get_ident()}"
169
+ )
170
+ request = urllib.request.Request(
171
+ item["https_url"],
172
+ headers={"User-Agent": "GeoDisaster-Sen1Floods11-hydrator/1.0"},
173
+ )
174
+ try:
175
+ with urllib.request.urlopen(request, timeout=timeout) as response, temporary.open("wb") as output:
176
+ shutil.copyfileobj(response, output, length=1024 * 1024)
177
+ downloaded = file_status(temporary, item)
178
+ if downloaded["status"] != "verified":
179
+ raise RuntimeError(
180
+ f"downloaded file failed verification for {item['chip_id']} {item['role']}: "
181
+ f"{downloaded['status']}"
182
+ )
183
+ os.replace(temporary, target)
184
+ return {
185
+ "chip_id": item["chip_id"],
186
+ "role": item["role"],
187
+ "action": "downloaded",
188
+ "status": "verified",
189
+ "path": str(target),
190
+ "bytes": target.stat().st_size,
191
+ }
192
+ finally:
193
+ if temporary.exists():
194
+ temporary.unlink()
195
+
196
+
197
+ def verify_canonical(root: Path, manifest: dict[str, Any]) -> dict[str, Any]:
198
+ canonical = root / CANONICAL_RELATIVE_PATH
199
+ if not canonical.is_file():
200
+ return {"status": "not_present", "path": str(canonical)}
201
+ actual = sha256(canonical)
202
+ expected = manifest["canonical_sha256"]
203
+ if actual != expected:
204
+ raise RuntimeError(
205
+ f"canonical SHA-256 mismatch: expected {expected}, found {actual}; "
206
+ "regenerate/review the manifest before downloading"
207
+ )
208
+ return {"status": "verified", "path": str(canonical), "sha256": actual}
209
+
210
+
211
+ def parser() -> argparse.ArgumentParser:
212
+ result = argparse.ArgumentParser(
213
+ description="Download and verify the pinned GeoDisaster Sen1Floods11 subset."
214
+ )
215
+ result.add_argument("--manifest", type=Path, default=DEFAULT_MANIFEST)
216
+ result.add_argument(
217
+ "--root",
218
+ type=Path,
219
+ default=REPOSITORY_ROOT,
220
+ help="Repository root under which source_assets/sen1_flood is created.",
221
+ )
222
+ mode = result.add_mutually_exclusive_group()
223
+ mode.add_argument("--verify-only", action="store_true", help="Check local files without downloading.")
224
+ mode.add_argument("--dry-run", action="store_true", help="Print the planned files without downloading.")
225
+ result.add_argument("--workers", type=int, default=6)
226
+ result.add_argument("--timeout", type=int, default=120)
227
+ result.add_argument(
228
+ "--limit-chips",
229
+ type=int,
230
+ help="Process the first N sorted chips; intended for clean-room testing.",
231
+ )
232
+ result.add_argument(
233
+ "--replace-mismatched",
234
+ action="store_true",
235
+ help="Atomically replace an existing file only when it fails manifest verification.",
236
+ )
237
+ return result
238
+
239
+
240
+ def main() -> None:
241
+ args = parser().parse_args()
242
+ root = args.root.resolve()
243
+ manifest = read_manifest(args.manifest.resolve())
244
+ canonical = verify_canonical(root, manifest)
245
+ items = flatten_entries(manifest, args.limit_chips)
246
+
247
+ if args.dry_run:
248
+ selected_entries = manifest["entries"][:args.limit_chips] if args.limit_chips else manifest["entries"]
249
+ result = {
250
+ "mode": "dry_run",
251
+ "root": str(root),
252
+ "canonical": canonical,
253
+ "selected_chips": len({item["chip_id"] for item in items}),
254
+ "files": len(items),
255
+ "bytes": sum(int(item["bytes"]) for item in items),
256
+ "targets": [item["local_path"] for item in items],
257
+ "generated_targets": [
258
+ str(portable_pair(root, entry)[1].relative_to(root)) for entry in selected_entries
259
+ ],
260
+ }
261
+ print(json.dumps(result, indent=2))
262
+ return
263
+
264
+ if args.verify_only:
265
+ checks = []
266
+ for item in items:
267
+ status = file_status(safe_target(root, item["local_path"]), item)
268
+ checks.append({"chip_id": item["chip_id"], "role": item["role"], **status})
269
+ counts: dict[str, int] = {}
270
+ for check in checks:
271
+ counts[check["status"]] = counts.get(check["status"], 0) + 1
272
+ selected_entries = manifest["entries"][:args.limit_chips] if args.limit_chips else manifest["entries"]
273
+ portable_checks = [portable_status(root, entry) for entry in selected_entries]
274
+ portable_counts: dict[str, int] = {}
275
+ for check in portable_checks:
276
+ portable_counts[check["status"]] = portable_counts.get(check["status"], 0) + 1
277
+ result = {
278
+ "mode": "verify_only",
279
+ "root": str(root),
280
+ "canonical": canonical,
281
+ "selected_chips": len({item["chip_id"] for item in items}),
282
+ "files": len(items),
283
+ "status_counts": counts,
284
+ "portable_derivative_status_counts": portable_counts,
285
+ "ready": counts == {"verified": len(items)} and portable_counts == {"verified": len(selected_entries)},
286
+ }
287
+ print(json.dumps(result, indent=2))
288
+ if not result["ready"]:
289
+ raise SystemExit(1)
290
+ return
291
+
292
+ if args.workers <= 0:
293
+ raise ValueError("--workers must be positive")
294
+ results = []
295
+ with ThreadPoolExecutor(max_workers=args.workers) as pool:
296
+ futures = {
297
+ pool.submit(download_one, root, item, args.replace_mismatched, args.timeout): item
298
+ for item in items
299
+ }
300
+ for future in as_completed(futures):
301
+ results.append(future.result())
302
+ action_counts: dict[str, int] = {}
303
+ for result in results:
304
+ action_counts[result["action"]] = action_counts.get(result["action"], 0) + 1
305
+ final_checks = [
306
+ file_status(safe_target(root, item["local_path"]), item) for item in items
307
+ ]
308
+ selected_entries = manifest["entries"][:args.limit_chips] if args.limit_chips else manifest["entries"]
309
+ portable_results = [generate_portable(root, entry) for entry in selected_entries]
310
+ portable_action_counts: dict[str, int] = {}
311
+ for result in portable_results:
312
+ portable_action_counts[result["action"]] = portable_action_counts.get(result["action"], 0) + 1
313
+ ready = all(check["status"] == "verified" for check in final_checks) and all(
314
+ portable_status(root, entry)["status"] == "verified" for entry in selected_entries
315
+ )
316
+ summary = {
317
+ "mode": "hydrate",
318
+ "root": str(root),
319
+ "canonical": canonical,
320
+ "selected_chips": len({item["chip_id"] for item in items}),
321
+ "files": len(items),
322
+ "action_counts": action_counts,
323
+ "portable_derivative_action_counts": portable_action_counts,
324
+ "ready": ready,
325
+ }
326
+ print(json.dumps(summary, indent=2))
327
+ if not ready:
328
+ raise SystemExit(1)
329
+
330
+
331
+ if __name__ == "__main__":
332
+ try:
333
+ main()
334
+ except (OSError, ValueError, RuntimeError, urllib.error.URLError) as exc:
335
+ print(f"ERROR: {exc}", file=sys.stderr)
336
+ raise SystemExit(1)
data/release_tools/manifests/c10_excluded_legacy_rasters.json ADDED
@@ -0,0 +1,508 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "canonical_reference_count": 0,
3
+ "entries": [
4
+ {
5
+ "path": "source_assets/sen1_flood/Bolivia_103757/labels/S1OtsuLabelHand.tif",
6
+ "release_disposition": "exclude",
7
+ "sha256": "dbac4a09ded6cce55eb05441b9ea212cad6ad33297c915f7c5c1730e9c36a37f"
8
+ },
9
+ {
10
+ "path": "source_assets/sen1_flood/Bolivia_129334/labels/S1OtsuLabelHand.tif",
11
+ "release_disposition": "exclude",
12
+ "sha256": "449c5f0ab347ed3c8aaa2c4170ec799603b43a356626bad7ba753926878d38ed"
13
+ },
14
+ {
15
+ "path": "source_assets/sen1_flood/Bolivia_195474/labels/S1OtsuLabelHand.tif",
16
+ "release_disposition": "exclude",
17
+ "sha256": "a86daf3bf911a77711b96dfdb3558c6bf28bc6c5c86f648cf851f704b9765c19"
18
+ },
19
+ {
20
+ "path": "source_assets/sen1_flood/Bolivia_23014/labels/S1OtsuLabelHand.tif",
21
+ "release_disposition": "exclude",
22
+ "sha256": "640432a0ef13bc821c180f878d2526906f53bd5ab6fac293257fd0522c2dd26b"
23
+ },
24
+ {
25
+ "path": "source_assets/sen1_flood/Bolivia_233925/labels/S1OtsuLabelHand.tif",
26
+ "release_disposition": "exclude",
27
+ "sha256": "07265e51fd77ca7e852c4548bb3fca735a6e9b728c0c3bbc80e7b8ec5bfcb797"
28
+ },
29
+ {
30
+ "path": "source_assets/sen1_flood/Bolivia_242570/labels/S1OtsuLabelHand.tif",
31
+ "release_disposition": "exclude",
32
+ "sha256": "04cc4e9e2fb06539a5640367f439f9a59faad29829ebc5ce5ee0c161be6b7e0b"
33
+ },
34
+ {
35
+ "path": "source_assets/sen1_flood/Bolivia_290290/labels/S1OtsuLabelHand.tif",
36
+ "release_disposition": "exclude",
37
+ "sha256": "3576e294fff8e894e0a86bcf7a79984a55ae672df8a78dca7224d97c1c899e21"
38
+ },
39
+ {
40
+ "path": "source_assets/sen1_flood/Bolivia_294583/labels/S1OtsuLabelHand.tif",
41
+ "release_disposition": "exclude",
42
+ "sha256": "a788e94b48281ba003bcd5aa24f95e88669543596885b3a2cfabb76886bdad45"
43
+ },
44
+ {
45
+ "path": "source_assets/sen1_flood/Bolivia_312675/labels/S1OtsuLabelHand.tif",
46
+ "release_disposition": "exclude",
47
+ "sha256": "84022a5b191235eab4b5f5eae9ec338f9242805c2980e5b75377ed2fcd9e9982"
48
+ },
49
+ {
50
+ "path": "source_assets/sen1_flood/Bolivia_314919/labels/S1OtsuLabelHand.tif",
51
+ "release_disposition": "exclude",
52
+ "sha256": "b2e92fad1f13535347cc701ba9a8a9c37084b3972555bce75d9519e66ca951e6"
53
+ },
54
+ {
55
+ "path": "source_assets/sen1_flood/Bolivia_360519/labels/S1OtsuLabelHand.tif",
56
+ "release_disposition": "exclude",
57
+ "sha256": "aa0b491a24844a108015ab8ea82f82c285d184506d734ba4d37042d7addd8291"
58
+ },
59
+ {
60
+ "path": "source_assets/sen1_flood/Bolivia_379434/labels/S1OtsuLabelHand.tif",
61
+ "release_disposition": "exclude",
62
+ "sha256": "3a743661ed3ad96d5dc06b740de7e5ca6a6fd941d7ac1d36a5aa1336f577d7d5"
63
+ },
64
+ {
65
+ "path": "source_assets/sen1_flood/Bolivia_432776/labels/S1OtsuLabelHand.tif",
66
+ "release_disposition": "exclude",
67
+ "sha256": "5cf4d39032052e46165c60c5ee3e4d2142d838650b53d31f8f147e3fccaba7d7"
68
+ },
69
+ {
70
+ "path": "source_assets/sen1_flood/Bolivia_60373/labels/S1OtsuLabelHand.tif",
71
+ "release_disposition": "exclude",
72
+ "sha256": "6c862f39e9808f8553f911cfcaedd8cac5c4ffbf040222fd9d247e344f2047ad"
73
+ },
74
+ {
75
+ "path": "source_assets/sen1_flood/Bolivia_76104/labels/S1OtsuLabelHand.tif",
76
+ "release_disposition": "exclude",
77
+ "sha256": "830689e48fc96080ba711475c1bd8e392e81eb032a99a4354b2ad5d5ff585410"
78
+ },
79
+ {
80
+ "path": "source_assets/sen1_flood/Ghana_103272/labels/S1OtsuLabelHand.tif",
81
+ "release_disposition": "exclude",
82
+ "sha256": "10c41028eba3d9a475b37584981c77630b85af272a865c00b8b6d412cfa3d9c8"
83
+ },
84
+ {
85
+ "path": "source_assets/sen1_flood/Ghana_1033830/labels/S1OtsuLabelHand.tif",
86
+ "release_disposition": "exclude",
87
+ "sha256": "07fafdc2da2348ad654ccb726477e30b717da3b0f8c539bf9212abe4f494b9d1"
88
+ },
89
+ {
90
+ "path": "source_assets/sen1_flood/Ghana_1078550/labels/S1OtsuLabelHand.tif",
91
+ "release_disposition": "exclude",
92
+ "sha256": "6af19035acf34e406538f23fba0c43d5249354d257ad6d59c67b0b5aff8fcbc6"
93
+ },
94
+ {
95
+ "path": "source_assets/sen1_flood/Ghana_1089161/labels/S1OtsuLabelHand.tif",
96
+ "release_disposition": "exclude",
97
+ "sha256": "f90d1c335dde62f005683405724d47c3597cfdbe522a2feeb8432d7f1d8d0004"
98
+ },
99
+ {
100
+ "path": "source_assets/sen1_flood/Ghana_11745/labels/S1OtsuLabelHand.tif",
101
+ "release_disposition": "exclude",
102
+ "sha256": "8c13cc0c0656b919fa8d78ac96fb122941e22d49a83e206a84b7438f914cca0e"
103
+ },
104
+ {
105
+ "path": "source_assets/sen1_flood/Ghana_124834/labels/S1OtsuLabelHand.tif",
106
+ "release_disposition": "exclude",
107
+ "sha256": "8b6563bb752706f1dd3cbcdb21a3753676b592e3d4d8a7433e13ad2b22ea7484"
108
+ },
109
+ {
110
+ "path": "source_assets/sen1_flood/Ghana_128663/labels/S1OtsuLabelHand.tif",
111
+ "release_disposition": "exclude",
112
+ "sha256": "c405453216c0d7ae9ad16d40e5b4d3441575532b820a2cee09c2141cf621f502"
113
+ },
114
+ {
115
+ "path": "source_assets/sen1_flood/Ghana_132163/labels/S1OtsuLabelHand.tif",
116
+ "release_disposition": "exclude",
117
+ "sha256": "885df6b26d5bd6ccad9c9cd1c436566dbe01ca1813a38f4baa7c9d3e7997ead4"
118
+ },
119
+ {
120
+ "path": "source_assets/sen1_flood/Ghana_134751/labels/S1OtsuLabelHand.tif",
121
+ "release_disposition": "exclude",
122
+ "sha256": "524f432dee818dd6d362c91525f8781bc8051a882ae12334dd72a23fb44b96e2"
123
+ },
124
+ {
125
+ "path": "source_assets/sen1_flood/Ghana_135389/labels/S1OtsuLabelHand.tif",
126
+ "release_disposition": "exclude",
127
+ "sha256": "9d4457ce1050511fb579cd2d06df02573dcd81cbca2d6c711778bd377c2ab1ef"
128
+ },
129
+ {
130
+ "path": "source_assets/sen1_flood/Ghana_141271/labels/S1OtsuLabelHand.tif",
131
+ "release_disposition": "exclude",
132
+ "sha256": "8401f92435f5ef7e60fd157ffa502ea799f3827a7b1fd91fa303b233312fbc24"
133
+ },
134
+ {
135
+ "path": "source_assets/sen1_flood/Ghana_141910/labels/S1OtsuLabelHand.tif",
136
+ "release_disposition": "exclude",
137
+ "sha256": "c219b7d5c211b6da8568a04f98cced2f999a36c752b3e19e10309f01851934ee"
138
+ },
139
+ {
140
+ "path": "source_assets/sen1_flood/Ghana_142312/labels/S1OtsuLabelHand.tif",
141
+ "release_disposition": "exclude",
142
+ "sha256": "53ae9ad8d59ce592e51bd4b299afa44c3a11eaed7be7a9aa9a64c430faa7e936"
143
+ },
144
+ {
145
+ "path": "source_assets/sen1_flood/Ghana_144050/labels/S1OtsuLabelHand.tif",
146
+ "release_disposition": "exclude",
147
+ "sha256": "3688ece998533a687109bf6e88b381128670d5f5ed9ceed1a2df86b062a825bb"
148
+ },
149
+ {
150
+ "path": "source_assets/sen1_flood/Ghana_146222/labels/S1OtsuLabelHand.tif",
151
+ "release_disposition": "exclude",
152
+ "sha256": "7cddd620703ae23cd0b5a774774aceee99aa8145ad0c8a7e8be759a995cfbd4b"
153
+ },
154
+ {
155
+ "path": "source_assets/sen1_flood/India_1017769/labels/S1OtsuLabelHand.tif",
156
+ "release_disposition": "exclude",
157
+ "sha256": "ec6fb595dda776991fafe259b09442b1830cc0289bba2081474f8fc2fdb26afa"
158
+ },
159
+ {
160
+ "path": "source_assets/sen1_flood/India_1018317/labels/S1OtsuLabelHand.tif",
161
+ "release_disposition": "exclude",
162
+ "sha256": "202bbe7a4d54bace5a687cafcb88be7a2a330f645d11dca9b3c9f68fb3e78c24"
163
+ },
164
+ {
165
+ "path": "source_assets/sen1_flood/India_1018327/labels/S1OtsuLabelHand.tif",
166
+ "release_disposition": "exclude",
167
+ "sha256": "65b4d519e11bb2d1038c455f0305f8133020d957cfe9816d10a16065a76b6ab6"
168
+ },
169
+ {
170
+ "path": "source_assets/sen1_flood/India_103447/labels/S1OtsuLabelHand.tif",
171
+ "release_disposition": "exclude",
172
+ "sha256": "5659b0f8001f0a817d77f009dd90e17238b9209c41bac0d8b8e65298ebe554b6"
173
+ },
174
+ {
175
+ "path": "source_assets/sen1_flood/India_1050276/labels/S1OtsuLabelHand.tif",
176
+ "release_disposition": "exclude",
177
+ "sha256": "9f8e2bbce1a66cff4314cb024caba451e7308d354664eec4650f10e4c3be9f37"
178
+ },
179
+ {
180
+ "path": "source_assets/sen1_flood/India_1068117/labels/S1OtsuLabelHand.tif",
181
+ "release_disposition": "exclude",
182
+ "sha256": "b8edefcb6c1829d80e0c73e252b379c33a3b24a5ed0f157926f47dc5263b00d3"
183
+ },
184
+ {
185
+ "path": "source_assets/sen1_flood/India_1072277/labels/S1OtsuLabelHand.tif",
186
+ "release_disposition": "exclude",
187
+ "sha256": "e558cf14a832902931f57beaf145ddc2b4cecfa803cc868a65758a46f5f1f04f"
188
+ },
189
+ {
190
+ "path": "source_assets/sen1_flood/India_118868/labels/S1OtsuLabelHand.tif",
191
+ "release_disposition": "exclude",
192
+ "sha256": "822c8c1d74759323531bfb459450b489c2d2263c6477dfaf564ed4b2c3926e3f"
193
+ },
194
+ {
195
+ "path": "source_assets/sen1_flood/India_135434/labels/S1OtsuLabelHand.tif",
196
+ "release_disposition": "exclude",
197
+ "sha256": "c9745e56265764e5584d77175a4dd608acaccea37e7e843cf66700618f87f546"
198
+ },
199
+ {
200
+ "path": "source_assets/sen1_flood/India_136196/labels/S1OtsuLabelHand.tif",
201
+ "release_disposition": "exclude",
202
+ "sha256": "0e13fcef2a3b9d225b4be1779c5b059d643ee3a6515e202da504808ff06e3e09"
203
+ },
204
+ {
205
+ "path": "source_assets/sen1_flood/India_164336/labels/S1OtsuLabelHand.tif",
206
+ "release_disposition": "exclude",
207
+ "sha256": "3886e57edb91ad3cabc29cf0caea989b8a047ac8ce8d7e5e90be45d31227bec5"
208
+ },
209
+ {
210
+ "path": "source_assets/sen1_flood/India_166709/labels/S1OtsuLabelHand.tif",
211
+ "release_disposition": "exclude",
212
+ "sha256": "f8246bb59472f1f50120d724a42c61e3797483ac58151641e0a2988d2b215201"
213
+ },
214
+ {
215
+ "path": "source_assets/sen1_flood/India_177319/labels/S1OtsuLabelHand.tif",
216
+ "release_disposition": "exclude",
217
+ "sha256": "53ca896b16f8920a9bb22b8e74dc6181313b227d6350367aa6082bd1cc3b7885"
218
+ },
219
+ {
220
+ "path": "source_assets/sen1_flood/India_179238/labels/S1OtsuLabelHand.tif",
221
+ "release_disposition": "exclude",
222
+ "sha256": "a753d9e5d69efac62ae77acaf2207bbf57574eef2b28d1b479521294e2082ef8"
223
+ },
224
+ {
225
+ "path": "source_assets/sen1_flood/India_180633/labels/S1OtsuLabelHand.tif",
226
+ "release_disposition": "exclude",
227
+ "sha256": "7830926ce6deb4f54145219eae0e981862d38dc680f1d385a6ddb4dfa163c363"
228
+ },
229
+ {
230
+ "path": "source_assets/sen1_flood/India_207862/labels/S1OtsuLabelHand.tif",
231
+ "release_disposition": "exclude",
232
+ "sha256": "6ef4e97137dff8ee9e5abe92b5d51f087c3880d39302b1f9d40bcc7421bae186"
233
+ },
234
+ {
235
+ "path": "source_assets/sen1_flood/India_244057/labels/S1OtsuLabelHand.tif",
236
+ "release_disposition": "exclude",
237
+ "sha256": "145dffbe4c64c02278f732252d861c58a0d842da3ef09daff4216316567a90a3"
238
+ },
239
+ {
240
+ "path": "source_assets/sen1_flood/India_25540/labels/S1OtsuLabelHand.tif",
241
+ "release_disposition": "exclude",
242
+ "sha256": "075783c0d0ee98487d5ba587d223fc0986716449d340029cf59fc146931d0635"
243
+ },
244
+ {
245
+ "path": "source_assets/sen1_flood/India_265762/labels/S1OtsuLabelHand.tif",
246
+ "release_disposition": "exclude",
247
+ "sha256": "62456da1b68564aba1c41ac029cc252b5ff34ff1765c2ad738c40a7dee6b0a68"
248
+ },
249
+ {
250
+ "path": "source_assets/sen1_flood/India_273873/labels/S1OtsuLabelHand.tif",
251
+ "release_disposition": "exclude",
252
+ "sha256": "a5b49ceb6c9de746c3d9b809b8606adb613dc4c5aceeacde4a63c16b224d8234"
253
+ },
254
+ {
255
+ "path": "source_assets/sen1_flood/India_285297/labels/S1OtsuLabelHand.tif",
256
+ "release_disposition": "exclude",
257
+ "sha256": "26cabac556923ce2a7b408970f9254b8eb8368d5f8073da1d9de7d2c6bf1a84f"
258
+ },
259
+ {
260
+ "path": "source_assets/sen1_flood/India_287642/labels/S1OtsuLabelHand.tif",
261
+ "release_disposition": "exclude",
262
+ "sha256": "5795303add546a4319782dc677a60639b7e4609b41823153616135c41080f5e4"
263
+ },
264
+ {
265
+ "path": "source_assets/sen1_flood/India_324254/labels/S1OtsuLabelHand.tif",
266
+ "release_disposition": "exclude",
267
+ "sha256": "d26df053ee8de991ae4be6d5fc73ee687c35db6ec82d0d5b8f33c8da700ef76d"
268
+ },
269
+ {
270
+ "path": "source_assets/sen1_flood/India_373039/labels/S1OtsuLabelHand.tif",
271
+ "release_disposition": "exclude",
272
+ "sha256": "29e48d40ab9deeb5ee43427b075861467e7a7916eabfbd4bb7b5e90eef6c0cce"
273
+ },
274
+ {
275
+ "path": "source_assets/sen1_flood/India_383430/labels/S1OtsuLabelHand.tif",
276
+ "release_disposition": "exclude",
277
+ "sha256": "898c104ab00f5bda3efd33727ae4dc95b60de05c7fb1ea99a34b0c449bc470ed"
278
+ },
279
+ {
280
+ "path": "source_assets/sen1_flood/India_391908/labels/S1OtsuLabelHand.tif",
281
+ "release_disposition": "exclude",
282
+ "sha256": "0b9a16ae7b48a5b8d9b7c09444f06135a931d282f7b1872ef78b935562992391"
283
+ },
284
+ {
285
+ "path": "source_assets/sen1_flood/India_399883/labels/S1OtsuLabelHand.tif",
286
+ "release_disposition": "exclude",
287
+ "sha256": "0e8861fbd25e1e1cdd69972562569bc765404aa65889bf1e9317d4f6209e63bb"
288
+ },
289
+ {
290
+ "path": "source_assets/sen1_flood/India_44475/labels/S1OtsuLabelHand.tif",
291
+ "release_disposition": "exclude",
292
+ "sha256": "d0a5840ed59360ccf0ef94e1f925981300e97a77b4fe1aa6edfd94e7435fb045"
293
+ },
294
+ {
295
+ "path": "source_assets/sen1_flood/India_500266/labels/S1OtsuLabelHand.tif",
296
+ "release_disposition": "exclude",
297
+ "sha256": "bf047a691173603070271dfe8ddf6b077a4f6367c31bdbdda2ef25662a56016a"
298
+ },
299
+ {
300
+ "path": "source_assets/sen1_flood/India_533192/labels/S1OtsuLabelHand.tif",
301
+ "release_disposition": "exclude",
302
+ "sha256": "1b14c8eb84d302141a4d7b3b2756b43fca5bcc102bcfc72b434e304e31c3965c"
303
+ },
304
+ {
305
+ "path": "source_assets/sen1_flood/India_534470/labels/S1OtsuLabelHand.tif",
306
+ "release_disposition": "exclude",
307
+ "sha256": "720d789c680d0bb3a03f85b58aafdb14cdf33183e4f496985f2b03e6bc18b760"
308
+ },
309
+ {
310
+ "path": "source_assets/sen1_flood/India_56450/labels/S1OtsuLabelHand.tif",
311
+ "release_disposition": "exclude",
312
+ "sha256": "e901fd70e8dbd74e249660a08ae8300ef6dbc9f47942f2f4bb7d527fb27efcbc"
313
+ },
314
+ {
315
+ "path": "source_assets/sen1_flood/India_566697/labels/S1OtsuLabelHand.tif",
316
+ "release_disposition": "exclude",
317
+ "sha256": "4a521e132493d7022854a6894f720fe9c2f9cc4b2930479e0150bca4129628ff"
318
+ },
319
+ {
320
+ "path": "source_assets/sen1_flood/India_570384/labels/S1OtsuLabelHand.tif",
321
+ "release_disposition": "exclude",
322
+ "sha256": "3b821359dbaf87eabc51d041a1ebe1c03419bf2b0029b2d1c72b654078829cd4"
323
+ },
324
+ {
325
+ "path": "source_assets/sen1_flood/India_591317/labels/S1OtsuLabelHand.tif",
326
+ "release_disposition": "exclude",
327
+ "sha256": "391e11d293638ab724c52163083eba126bb3ea0970b3c22d757b9c37c22177e1"
328
+ },
329
+ {
330
+ "path": "source_assets/sen1_flood/India_591549/labels/S1OtsuLabelHand.tif",
331
+ "release_disposition": "exclude",
332
+ "sha256": "f5b0247fd05db910f591ac006d64242a1ed62acf30549b8113b6a36f22da44c3"
333
+ },
334
+ {
335
+ "path": "source_assets/sen1_flood/India_592446/labels/S1OtsuLabelHand.tif",
336
+ "release_disposition": "exclude",
337
+ "sha256": "760b19b6320140e9dc2c1218c82796af0a9eb5e8945240c05ea331ccfa3b31c0"
338
+ },
339
+ {
340
+ "path": "source_assets/sen1_flood/India_59460/labels/S1OtsuLabelHand.tif",
341
+ "release_disposition": "exclude",
342
+ "sha256": "a6bb52aaea1f18d5ab6ce694f1bf6a9f4ef611b138a5c8156f9514e154fe3c94"
343
+ },
344
+ {
345
+ "path": "source_assets/sen1_flood/India_624341/labels/S1OtsuLabelHand.tif",
346
+ "release_disposition": "exclude",
347
+ "sha256": "53cb2b34565aeeaea80ff2075c17cf02e8b58f74bc2f2b303a9b5015de1ac09c"
348
+ },
349
+ {
350
+ "path": "source_assets/sen1_flood/India_631692/labels/S1OtsuLabelHand.tif",
351
+ "release_disposition": "exclude",
352
+ "sha256": "c19c18fd21488a9d8f57bf1ce1cb987cfd6cf2125c5e5cb0ca46b397939e6fbd"
353
+ },
354
+ {
355
+ "path": "source_assets/sen1_flood/India_652725/labels/S1OtsuLabelHand.tif",
356
+ "release_disposition": "exclude",
357
+ "sha256": "ee1e20c4a2c7dc197ec8da0ec164f2e453b4cd5c81071f62cc2ebfa13c0d0fe8"
358
+ },
359
+ {
360
+ "path": "source_assets/sen1_flood/India_664410/labels/S1OtsuLabelHand.tif",
361
+ "release_disposition": "exclude",
362
+ "sha256": "9e7d60251bb6d6305690faf1e6fdfd4fcaad5f98355f58b8cd9a02dc61e2182d"
363
+ },
364
+ {
365
+ "path": "source_assets/sen1_flood/India_691027/labels/S1OtsuLabelHand.tif",
366
+ "release_disposition": "exclude",
367
+ "sha256": "df1cd3e6c14124700adc49958f132be52d3083e73cd34feb019bd2ee424820cc"
368
+ },
369
+ {
370
+ "path": "source_assets/sen1_flood/India_698338/labels/S1OtsuLabelHand.tif",
371
+ "release_disposition": "exclude",
372
+ "sha256": "af97be37210b3245c64d05a0f2c050abb5a33a3e027a5c3714b03dc4f3b77285"
373
+ },
374
+ {
375
+ "path": "source_assets/sen1_flood/India_70352/labels/S1OtsuLabelHand.tif",
376
+ "release_disposition": "exclude",
377
+ "sha256": "c6d025c8aa2840c44b8b846d818b26555c82dc9cba43931b72f751f9cbf1ec1f"
378
+ },
379
+ {
380
+ "path": "source_assets/sen1_flood/India_707886/labels/S1OtsuLabelHand.tif",
381
+ "release_disposition": "exclude",
382
+ "sha256": "8c257a7a50e44f97817edfdc9c49b6230abdac5f46161185c82e4c6d61414888"
383
+ },
384
+ {
385
+ "path": "source_assets/sen1_flood/India_73419/labels/S1OtsuLabelHand.tif",
386
+ "release_disposition": "exclude",
387
+ "sha256": "e7dd6dd180cc2281b30028c63d23c5927ac64f96738968497bf9487dd359315e"
388
+ },
389
+ {
390
+ "path": "source_assets/sen1_flood/India_747970/labels/S1OtsuLabelHand.tif",
391
+ "release_disposition": "exclude",
392
+ "sha256": "f7e9f231a3fae080e8fa9f0876d7600b3c1003491be841d22212118c78141905"
393
+ },
394
+ {
395
+ "path": "source_assets/sen1_flood/India_747992/labels/S1OtsuLabelHand.tif",
396
+ "release_disposition": "exclude",
397
+ "sha256": "75ad79e46e6d7f58b20763e304325f825200cac97908556f72dd82e2ba2dfe6e"
398
+ },
399
+ {
400
+ "path": "source_assets/sen1_flood/India_764946/labels/S1OtsuLabelHand.tif",
401
+ "release_disposition": "exclude",
402
+ "sha256": "5ad1a296bf6c214e54abbfac6596bd35b796d699bbbc942e5d0fe9dd2c1ea6ce"
403
+ },
404
+ {
405
+ "path": "source_assets/sen1_flood/India_769408/labels/S1OtsuLabelHand.tif",
406
+ "release_disposition": "exclude",
407
+ "sha256": "5a93377e5968c66d6b56b7c3fda1c87f4167668ca17d6c2c5f6bde9f3f423c9c"
408
+ },
409
+ {
410
+ "path": "source_assets/sen1_flood/India_772630/labels/S1OtsuLabelHand.tif",
411
+ "release_disposition": "exclude",
412
+ "sha256": "6da73f90f1b60c98227b294399b6a25b649d47776ac1a10dda4418c6f2745a91"
413
+ },
414
+ {
415
+ "path": "source_assets/sen1_flood/India_773682/labels/S1OtsuLabelHand.tif",
416
+ "release_disposition": "exclude",
417
+ "sha256": "fede6afd38c02609da69458d71aeeb497cf58f973fd7d740025bf74df07babe5"
418
+ },
419
+ {
420
+ "path": "source_assets/sen1_flood/India_774689/labels/S1OtsuLabelHand.tif",
421
+ "release_disposition": "exclude",
422
+ "sha256": "f65f06129798015a19ab9cfa1e0225a1aa1bdd050e357dcbac5248d5915b6d3e"
423
+ },
424
+ {
425
+ "path": "source_assets/sen1_flood/India_79637/labels/S1OtsuLabelHand.tif",
426
+ "release_disposition": "exclude",
427
+ "sha256": "5b761d017bbd936c27f8c05955b43035e8c499fca64c45ec0fa2c7f77cd77998"
428
+ },
429
+ {
430
+ "path": "source_assets/sen1_flood/Somalia_1068756/labels/S1OtsuLabelHand.tif",
431
+ "release_disposition": "exclude",
432
+ "sha256": "7d5c38bb73462f45325653b6f5021fd239c98336f0a8872c33a39c6d5cdadade"
433
+ },
434
+ {
435
+ "path": "source_assets/sen1_flood/Somalia_1087508/labels/S1OtsuLabelHand.tif",
436
+ "release_disposition": "exclude",
437
+ "sha256": "28d3ae602bdbc43a5ec0420f5cdbb72edb1fe2473c2d474b6c7c852fdaea3775"
438
+ },
439
+ {
440
+ "path": "source_assets/sen1_flood/Somalia_12849/labels/S1OtsuLabelHand.tif",
441
+ "release_disposition": "exclude",
442
+ "sha256": "29460974cd1962a3e7ef319d18967f75573ca011db03553cfeed723f845894eb"
443
+ },
444
+ {
445
+ "path": "source_assets/sen1_flood/Somalia_166342/labels/S1OtsuLabelHand.tif",
446
+ "release_disposition": "exclude",
447
+ "sha256": "f99a2acde8e5f6615ac1d6c0ee249e06c5a68e4d1855ddd3b70413ff2eeee1b5"
448
+ },
449
+ {
450
+ "path": "source_assets/sen1_flood/Somalia_167787/labels/S1OtsuLabelHand.tif",
451
+ "release_disposition": "exclude",
452
+ "sha256": "7557c149b52e6d7d55d1282ef82b15420554ed4e001489b6ff8888b611130159"
453
+ },
454
+ {
455
+ "path": "source_assets/sen1_flood/Somalia_195014/labels/S1OtsuLabelHand.tif",
456
+ "release_disposition": "exclude",
457
+ "sha256": "797bb3061090bfcb531f0bf10cf6e821bcb8dc33926ccd6575351f96808d4b94"
458
+ },
459
+ {
460
+ "path": "source_assets/sen1_flood/Somalia_205466/labels/S1OtsuLabelHand.tif",
461
+ "release_disposition": "exclude",
462
+ "sha256": "fffe0cbdb746bbb9e945910b1a980c3e1884df9609d503f5c913068b799fe743"
463
+ },
464
+ {
465
+ "path": "source_assets/sen1_flood/Somalia_230192/labels/S1OtsuLabelHand.tif",
466
+ "release_disposition": "exclude",
467
+ "sha256": "8c6daa22a2d1c03e12004742d6d590de248262f90c7246ae575e4a4a4f61c00c"
468
+ },
469
+ {
470
+ "path": "source_assets/sen1_flood/Somalia_256539/labels/S1OtsuLabelHand.tif",
471
+ "release_disposition": "exclude",
472
+ "sha256": "cf2bd3dd1dbfef5b747d7eea882da3b5c147d01b04a56cb088290f6309097d9c"
473
+ },
474
+ {
475
+ "path": "source_assets/sen1_flood/Somalia_295782/labels/S1OtsuLabelHand.tif",
476
+ "release_disposition": "exclude",
477
+ "sha256": "c39dcfbaff9d72f8a4f255fd093f3ec82991e5b1e2685ef7227fde7957f22f13"
478
+ },
479
+ {
480
+ "path": "source_assets/sen1_flood/Somalia_322855/labels/S1OtsuLabelHand.tif",
481
+ "release_disposition": "exclude",
482
+ "sha256": "14a393ea20425918e763788adfc6961e7fcff28271021b274afa7cdff84d4f58"
483
+ },
484
+ {
485
+ "path": "source_assets/sen1_flood/Somalia_32375/labels/S1OtsuLabelHand.tif",
486
+ "release_disposition": "exclude",
487
+ "sha256": "0ce9d2f192ee4ddfb20c2ee0c5c2f94cd37a67b9687d0ec3e0708ce643f67008"
488
+ },
489
+ {
490
+ "path": "source_assets/sen1_flood/Somalia_371421/labels/S1OtsuLabelHand.tif",
491
+ "release_disposition": "exclude",
492
+ "sha256": "67597bb69cd8ff4da7e83636b78cd20ab25c727559921be6f40977c6a7a98a3f"
493
+ },
494
+ {
495
+ "path": "source_assets/sen1_flood/Somalia_60129/labels/S1OtsuLabelHand.tif",
496
+ "release_disposition": "exclude",
497
+ "sha256": "27776397eb71b7149b3f6eae7d56fd33f4e6d343b87e39e2b063f4d05f1a401b"
498
+ },
499
+ {
500
+ "path": "source_assets/sen1_flood/Somalia_61368/labels/S1OtsuLabelHand.tif",
501
+ "release_disposition": "exclude",
502
+ "sha256": "7ad6c05a7bf39b9a26b53ee9b86e1acb67e419e375fcc23a8968b3ae99cc1534"
503
+ }
504
+ ],
505
+ "public_release_action": "Do not package these historical support files; current predictions are recomputed from the declared portable S1 derivative.",
506
+ "reason": "Legacy cached Sen1Floods11 Otsu derivatives use -1 nodata, are not declared by any canonical record, and are forbidden answer inputs.",
507
+ "schema_version": "geodisaster_release_exclusions_v1"
508
+ }
data/release_tools/manifests/sen1floods11_required_100.json ADDED
The diff for this file is too large to render. See raw diff
 
data/release_tools/raster_portability.py ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Deterministic finite-nodata GeoTIFF conversions used by C10."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import os
7
+ from pathlib import Path
8
+ from typing import Any
9
+
10
+ import numpy as np
11
+ import rasterio
12
+
13
+
14
+ S1_PORTABLE_NODATA = -9999.0
15
+ BINARY_PORTABLE_NODATA = 255
16
+
17
+
18
+ def valid_pixels(data: np.ndarray, nodata: float | int | None) -> np.ndarray:
19
+ """Return pixels valid in every band, including a finite nodata value."""
20
+ bands = data if data.ndim == 3 else data[np.newaxis, ...]
21
+ valid = np.logical_and.reduce([np.isfinite(band) for band in bands])
22
+ if nodata is not None and np.isfinite(float(nodata)):
23
+ valid &= np.logical_and.reduce([band != float(nodata) for band in bands])
24
+ return valid
25
+
26
+
27
+ def _copy_tags(source: rasterio.io.DatasetReader, target: rasterio.io.DatasetWriter) -> None:
28
+ target.update_tags(**source.tags())
29
+ for index in range(1, source.count + 1):
30
+ target.update_tags(index, **source.tags(index))
31
+ if source.descriptions[index - 1]:
32
+ target.set_band_description(index, source.descriptions[index - 1])
33
+
34
+
35
+ def _atomic_raster_write(destination: Path, writer: Any) -> None:
36
+ destination.parent.mkdir(parents=True, exist_ok=True)
37
+ temporary = destination.with_name(f".{destination.stem}.tmp.{os.getpid()}{destination.suffix}")
38
+ try:
39
+ writer(temporary)
40
+ os.replace(temporary, destination)
41
+ finally:
42
+ if temporary.exists():
43
+ temporary.unlink()
44
+
45
+
46
+ def write_portable_s1(source: Path, destination: Path) -> dict[str, Any]:
47
+ """Preserve finite S1 values and encode invalid pixels as finite -9999."""
48
+ source = source.resolve()
49
+ destination = destination.resolve()
50
+ with rasterio.open(source) as dataset:
51
+ data = dataset.read().astype("float32")
52
+ valid = valid_pixels(data, dataset.nodata)
53
+ if np.any(data[:, valid] == S1_PORTABLE_NODATA):
54
+ raise ValueError(f"valid source pixels collide with {S1_PORTABLE_NODATA}: {source}")
55
+ converted = data.copy()
56
+ converted[:, ~valid] = S1_PORTABLE_NODATA
57
+ profile = dataset.profile.copy()
58
+ profile.update(dtype="float32", nodata=S1_PORTABLE_NODATA, compress="deflate", predictor=3)
59
+
60
+ def writer(path: Path) -> None:
61
+ with rasterio.open(path, "w", **profile) as output:
62
+ output.write(converted)
63
+ _copy_tags(dataset, output)
64
+
65
+ _atomic_raster_write(destination, writer)
66
+ return {
67
+ "bands": int(dataset.count),
68
+ "height": int(dataset.height),
69
+ "width": int(dataset.width),
70
+ "valid_spatial_pixels": int(valid.sum()),
71
+ "invalid_spatial_pixels": int(valid.size - valid.sum()),
72
+ "source_nodata": str(dataset.nodata),
73
+ "portable_nodata": S1_PORTABLE_NODATA,
74
+ }
75
+
76
+
77
+ def verify_portable_s1(source: Path, destination: Path) -> dict[str, Any]:
78
+ """Prove a portable S1 raster is a value-preserving source derivative."""
79
+ if not destination.is_file():
80
+ raise FileNotFoundError(destination)
81
+ with rasterio.open(source) as upstream, rasterio.open(destination) as portable:
82
+ original = upstream.read().astype("float32")
83
+ derived = portable.read().astype("float32")
84
+ valid = valid_pixels(original, upstream.nodata)
85
+ if original.shape != derived.shape:
86
+ raise ValueError(f"shape mismatch: {source} vs {destination}")
87
+ if portable.nodata != S1_PORTABLE_NODATA:
88
+ raise ValueError(f"unexpected portable nodata {portable.nodata}: {destination}")
89
+ if upstream.crs != portable.crs or upstream.transform != portable.transform:
90
+ raise ValueError(f"georeferencing mismatch: {source} vs {destination}")
91
+ if not np.array_equal(original[:, valid], derived[:, valid]):
92
+ raise ValueError(f"valid values changed: {source} vs {destination}")
93
+ if not np.all(derived[:, ~valid] == S1_PORTABLE_NODATA):
94
+ raise ValueError(f"invalid values were not normalized: {destination}")
95
+ return {
96
+ "valid_spatial_pixels": int(valid.sum()),
97
+ "invalid_spatial_pixels": int(valid.size - valid.sum()),
98
+ "valid_values_identical": True,
99
+ "georeferencing_identical": True,
100
+ "nodata": S1_PORTABLE_NODATA,
101
+ }
102
+
103
+
104
+ def normalize_binary_mask_in_place(path: Path) -> dict[str, Any]:
105
+ """Convert one binary mask to uint8 0/1 with nodata 255, preserving validity."""
106
+ path = path.resolve()
107
+ with rasterio.open(path) as dataset:
108
+ if dataset.count != 1:
109
+ raise ValueError(f"binary mask must have one band: {path}")
110
+ source = dataset.read(1)
111
+ valid = valid_pixels(source, dataset.nodata)
112
+ positive = valid & (source > 0)
113
+ converted = np.full(source.shape, BINARY_PORTABLE_NODATA, dtype="uint8")
114
+ converted[valid] = positive[valid].astype("uint8")
115
+ profile = dataset.profile.copy()
116
+ profile.update(
117
+ dtype="uint8",
118
+ count=1,
119
+ nodata=BINARY_PORTABLE_NODATA,
120
+ compress="deflate",
121
+ predictor=2,
122
+ )
123
+ source_nodata = dataset.nodata
124
+
125
+ def writer(destination: Path) -> None:
126
+ with rasterio.open(destination, "w", **profile) as output:
127
+ output.write(converted, 1)
128
+ _copy_tags(dataset, output)
129
+
130
+ _atomic_raster_write(path, writer)
131
+ return {
132
+ "valid_pixels": int(valid.sum()),
133
+ "invalid_pixels": int(valid.size - valid.sum()),
134
+ "positive_pixels": int(positive.sum()),
135
+ "source_nodata": str(source_nodata),
136
+ "portable_nodata": BINARY_PORTABLE_NODATA,
137
+ }
138
+
139
+
140
+ def verify_portable_binary_mask(path: Path) -> dict[str, Any]:
141
+ with rasterio.open(path) as dataset:
142
+ values = dataset.read(1)
143
+ if dataset.count != 1 or dataset.dtypes[0] != "uint8":
144
+ raise ValueError(f"portable binary raster must be one uint8 band: {path}")
145
+ if dataset.nodata != BINARY_PORTABLE_NODATA:
146
+ raise ValueError(f"unexpected binary nodata {dataset.nodata}: {path}")
147
+ unique = set(int(value) for value in np.unique(values))
148
+ if not unique <= {0, 1, BINARY_PORTABLE_NODATA}:
149
+ raise ValueError(f"non-binary values {sorted(unique)}: {path}")
150
+ valid = values != BINARY_PORTABLE_NODATA
151
+ return {
152
+ "valid_pixels": int(valid.sum()),
153
+ "invalid_pixels": int(valid.size - valid.sum()),
154
+ "positive_pixels": int((values == 1).sum()),
155
+ "values": sorted(unique),
156
+ "nodata": BINARY_PORTABLE_NODATA,
157
+ }
data/release_tools/replay_all_2921.py ADDED
@@ -0,0 +1,829 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Execute every canonical GeoDisaster GT chain with the real process_* tools.
3
+
4
+ The driver uses ``gt_chain`` only to select the validation call order. Workers
5
+ receive a sanitized case containing the question and initial input artifacts;
6
+ they never receive the expected answer or the chain itself. Every generated
7
+ handle is persisted by the run-scoped worker runtime under the chosen output
8
+ directory.
9
+ """
10
+
11
+ from __future__ import annotations
12
+
13
+ import argparse
14
+ import hashlib
15
+ import importlib
16
+ import json
17
+ import math
18
+ import multiprocessing as mp
19
+ import os
20
+ import sys
21
+ import time
22
+ import traceback
23
+ import types
24
+ from collections import Counter, defaultdict
25
+ from pathlib import Path
26
+ from typing import Any
27
+
28
+
29
+ TOOLS = {
30
+ "ReadData",
31
+ "PrepareScene",
32
+ "ComputeStats",
33
+ "MeasureArea",
34
+ "CompareSources",
35
+ "DetectChange",
36
+ "ClassifyChange",
37
+ "ScoreHazard",
38
+ "EstimateExposure",
39
+ "AssessDamage",
40
+ "RankRegions",
41
+ "CompareScenes",
42
+ "ExtractObjects",
43
+ "MapFlood",
44
+ "DescribeFlood",
45
+ "PlanRoutes",
46
+ "CompareRoutes",
47
+ "RenderMap",
48
+ }
49
+
50
+ _STATE: Any = None
51
+ _MODULES: dict[str, Any] = {}
52
+ _CASE_DIR: Path | None = None
53
+
54
+
55
+ def read_jsonl(path: Path) -> list[dict[str, Any]]:
56
+ rows: list[dict[str, Any]] = []
57
+ with path.open("r", encoding="utf-8") as handle:
58
+ for line_no, line in enumerate(handle, 1):
59
+ if line.strip():
60
+ try:
61
+ rows.append(json.loads(line))
62
+ except Exception as exc:
63
+ raise ValueError(f"invalid JSON at {path}:{line_no}: {exc}") from exc
64
+ return rows
65
+
66
+
67
+ def write_json(path: Path, payload: Any) -> None:
68
+ path.parent.mkdir(parents=True, exist_ok=True)
69
+ temporary = path.with_suffix(path.suffix + f".tmp.{os.getpid()}")
70
+ with temporary.open("w", encoding="utf-8") as handle:
71
+ json.dump(payload, handle, indent=2, ensure_ascii=False, default=str)
72
+ handle.write("\n")
73
+ temporary.replace(path)
74
+
75
+
76
+ def install_import_stubs() -> None:
77
+ """Avoid importing the HTTP worker server when only process_* is needed."""
78
+ base_name = "tool_server.tool_workers.online_workers.base_tool_worker"
79
+ if base_name not in sys.modules:
80
+ base_module = types.ModuleType(base_name)
81
+
82
+ class BaseToolWorker:
83
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
84
+ pass
85
+
86
+ def run(self) -> None:
87
+ pass
88
+
89
+ base_module.BaseToolWorker = BaseToolWorker
90
+ sys.modules[base_name] = base_module
91
+
92
+ server_name = "tool_server.utils.server_utils"
93
+ if server_name not in sys.modules:
94
+ server_module = types.ModuleType(server_name)
95
+
96
+ class DummyLogger:
97
+ def info(self, *args: Any, **kwargs: Any) -> None:
98
+ pass
99
+
100
+ def warning(self, *args: Any, **kwargs: Any) -> None:
101
+ pass
102
+
103
+ def error(self, *args: Any, **kwargs: Any) -> None:
104
+ pass
105
+
106
+ server_module.build_logger = lambda *args, **kwargs: DummyLogger()
107
+ sys.modules[server_name] = server_module
108
+
109
+
110
+ def initialize_worker(code_root: str, dataset_root: str, output_dir: str) -> None:
111
+ global _STATE, _CASE_DIR, _MODULES
112
+ code_path = str(Path(code_root).resolve())
113
+ if code_path not in sys.path:
114
+ sys.path.insert(0, code_path)
115
+ os.environ["GEODISASTER_DATASET_ROOT"] = str(Path(dataset_root).resolve())
116
+ install_import_stubs()
117
+ _STATE = importlib.import_module(
118
+ "tool_server.tool_workers.online_workers.final_dataset_worker_state"
119
+ )
120
+ output = Path(output_dir).resolve()
121
+ _STATE.SESSION_DIR = output / "sessions"
122
+ _STATE.ARTIFACT_DIR = output / "artifacts"
123
+ _STATE.SESSION_DIR.mkdir(parents=True, exist_ok=True)
124
+ _STATE.ARTIFACT_DIR.mkdir(parents=True, exist_ok=True)
125
+ _CASE_DIR = output / "cases"
126
+ _CASE_DIR.mkdir(parents=True, exist_ok=True)
127
+ _MODULES = {}
128
+
129
+
130
+ def sanitized_case(record: dict[str, Any]) -> dict[str, Any]:
131
+ return {
132
+ key: record[key]
133
+ for key in ("id", "sample_id", "question_type", "question", "initial_artifacts")
134
+ if key in record
135
+ }
136
+
137
+
138
+ def compact(value: Any, max_chars: int = 24000) -> Any:
139
+ text = json.dumps(value, ensure_ascii=False, sort_keys=True, default=str)
140
+ if len(text) <= max_chars:
141
+ return value
142
+ return {"_truncated": True, "_chars": len(text), "_preview": text[:max_chars]}
143
+
144
+
145
+ def flatten_scalars(value: Any, prefix: str = "") -> list[tuple[str, Any]]:
146
+ rows: list[tuple[str, Any]] = []
147
+ if isinstance(value, dict):
148
+ for key, child in value.items():
149
+ child_prefix = f"{prefix}.{key}" if prefix else str(key)
150
+ rows.extend(flatten_scalars(child, child_prefix))
151
+ elif isinstance(value, list):
152
+ for index, child in enumerate(value):
153
+ rows.extend(flatten_scalars(child, f"{prefix}[{index}]"))
154
+ else:
155
+ rows.append((prefix, value))
156
+ return rows
157
+
158
+
159
+ def values_match(expected: Any, actual: Any) -> bool:
160
+ if expected is None:
161
+ return actual is None
162
+ if isinstance(expected, bool):
163
+ return isinstance(actual, bool) and actual is expected
164
+ if isinstance(expected, (int, float)) and not isinstance(expected, bool):
165
+ if isinstance(actual, bool):
166
+ return False
167
+ try:
168
+ expected_float = float(expected)
169
+ actual_float = float(actual)
170
+ except Exception:
171
+ return False
172
+ if not math.isfinite(expected_float) or not math.isfinite(actual_float):
173
+ return expected_float == actual_float
174
+ return abs(expected_float - actual_float) <= max(
175
+ 1e-4, 1e-4 * max(1.0, abs(expected_float))
176
+ )
177
+ if isinstance(expected, str):
178
+ left = " ".join(expected.lower().split())
179
+ right = " ".join(str(actual).lower().split())
180
+ return left == right or (len(left) >= 8 and left in right) or (
181
+ len(right) >= 8 and right in left
182
+ )
183
+ return expected == actual
184
+
185
+
186
+ def answer_support(expected: Any, artifacts: dict[str, Any]) -> dict[str, Any]:
187
+ """Measure whether expected scalar values occur in generated evidence.
188
+
189
+ This is deliberately an evidence-coverage audit, not an exact-answer
190
+ accuracy score. The runtime answer-contract layer projects the analytical
191
+ artifacts into the requested answer schema before strict scoring.
192
+ """
193
+ expected_leaves = [
194
+ (path, value)
195
+ for path, value in flatten_scalars(expected)
196
+ if value is not None and not isinstance(value, (dict, list))
197
+ ]
198
+ observed: list[tuple[str, Any]] = []
199
+ for handle, card in artifacts.items():
200
+ if not isinstance(card, dict):
201
+ continue
202
+ for field in ("result", "evidence"):
203
+ if field in card:
204
+ observed.extend(
205
+ (f"{handle}.{path}", value)
206
+ for path, value in flatten_scalars(card[field])
207
+ )
208
+ matched: list[dict[str, Any]] = []
209
+ missing: list[dict[str, Any]] = []
210
+ for path, value in expected_leaves:
211
+ hit = next(
212
+ ((observed_path, observed_value) for observed_path, observed_value in observed
213
+ if values_match(value, observed_value)),
214
+ None,
215
+ )
216
+ if hit:
217
+ matched.append(
218
+ {
219
+ "path": path,
220
+ "expected": value,
221
+ "observed_path": hit[0],
222
+ "observed": hit[1],
223
+ }
224
+ )
225
+ else:
226
+ missing.append({"path": path, "expected": value})
227
+ score = len(matched) / len(expected_leaves) if expected_leaves else 1.0
228
+ return {
229
+ "score": round(score, 6),
230
+ "matched_leaf_count": len(matched),
231
+ "expected_leaf_count": len(expected_leaves),
232
+ "missing_leaf_count": len(missing),
233
+ "missing": missing,
234
+ "matched": matched,
235
+ }
236
+
237
+
238
+ def input_path_audit(records: list[dict[str, Any]], dataset_root: Path) -> dict[str, Any]:
239
+ references: list[dict[str, Any]] = []
240
+
241
+ def visit(value: Any, record_id: str) -> None:
242
+ if isinstance(value, dict):
243
+ if isinstance(value.get("path"), str) and (
244
+ "exists" in value or "optional" in value
245
+ ):
246
+ declared = value["path"]
247
+ path = Path(declared)
248
+ resolved = path if path.is_absolute() else dataset_root / path
249
+ resolved = resolved.resolve()
250
+ try:
251
+ resolved.relative_to(dataset_root)
252
+ inside_root = True
253
+ except ValueError:
254
+ inside_root = False
255
+ references.append(
256
+ {
257
+ "record_id": record_id,
258
+ "path": declared,
259
+ "optional": bool(value.get("optional")),
260
+ "exists_now": resolved.exists(),
261
+ "absolute": path.is_absolute(),
262
+ "inside_dataset_root": inside_root,
263
+ }
264
+ )
265
+ for child in value.values():
266
+ visit(child, record_id)
267
+ elif isinstance(value, list):
268
+ for child in value:
269
+ visit(child, record_id)
270
+
271
+ for record in records:
272
+ visit(
273
+ {
274
+ "question": record.get("question"),
275
+ "initial_artifacts": record.get("initial_artifacts"),
276
+ },
277
+ str(record.get("id")),
278
+ )
279
+ missing_required = [r for r in references if not r["exists_now"] and not r["optional"]]
280
+ missing_optional = [r for r in references if not r["exists_now"] and r["optional"]]
281
+ outside = [r for r in references if not r["inside_dataset_root"]]
282
+ absolute = [r for r in references if r["absolute"]]
283
+ return {
284
+ "path_references": len(references),
285
+ "unique_paths": len({r["path"] for r in references}),
286
+ "existing_references": sum(r["exists_now"] for r in references),
287
+ "required_missing_references": len(missing_required),
288
+ "optional_missing_references": len(missing_optional),
289
+ "optional_missing_unique_paths": len({r["path"] for r in missing_optional}),
290
+ "absolute_path_references": len(absolute),
291
+ "outside_dataset_root_references": len(outside),
292
+ "required_missing": missing_required[:100],
293
+ "optional_missing": missing_optional[:100],
294
+ "outside_dataset_root": outside[:100],
295
+ }
296
+
297
+
298
+ def tool_function(tool: str) -> Any:
299
+ if tool not in _MODULES:
300
+ _MODULES[tool] = importlib.import_module(
301
+ f"tool_server.tool_workers.online_workers.{tool}_worker"
302
+ )
303
+ return getattr(_MODULES[tool], f"process_{tool}")
304
+
305
+
306
+ def logical_type(record: dict[str, Any]) -> str:
307
+ parts = str(record.get("id", "")).split("/")
308
+ if parts and parts[0] == "multi_hazard" and len(parts) >= 2:
309
+ return f"{parts[0]}/{parts[1]}/{record.get('question_type')}"
310
+ return f"{parts[0] if parts else 'unknown'}/{record.get('question_type')}"
311
+
312
+
313
+ def run_record(task: tuple[int, dict[str, Any]]) -> dict[str, Any]:
314
+ index, record = task
315
+ assert _STATE is not None and _CASE_DIR is not None
316
+ started = time.time()
317
+ record_id = str(record.get("id") or f"record_{index}")
318
+ digest = hashlib.sha1(record_id.encode("utf-8")).hexdigest()[:12]
319
+ session_id = f"replay_{index:04d}_{digest}"
320
+ _STATE.clear_session(session_id)
321
+ trace: list[dict[str, Any]] = []
322
+ errors: list[dict[str, Any]] = []
323
+ reached_terminal = False
324
+ terminal_args: dict[str, Any] | None = None
325
+
326
+ for step_number, step in enumerate(record.get("gt_chain") or [], 1):
327
+ tool = str(step.get("tool") or "")
328
+ step_args = dict(step.get("args") or {})
329
+ if tool == "TaskComplete":
330
+ if step_args.get("status") not in {"TASK_COMPLETE", "CONTRACT_FAILURE"}:
331
+ errors.append(
332
+ {
333
+ "step": step_number,
334
+ "tool": tool,
335
+ "error": "invalid_terminal_status",
336
+ "status": step_args.get("status"),
337
+ }
338
+ )
339
+ break
340
+ if not isinstance(step_args.get("summary"), str) or not step_args["summary"].strip():
341
+ errors.append(
342
+ {"step": step_number, "tool": tool, "error": "missing_terminal_summary"}
343
+ )
344
+ break
345
+ reached_terminal = True
346
+ terminal_args = step_args
347
+ trace.append(
348
+ {
349
+ "step": step_number,
350
+ "tool": tool,
351
+ "args": step_args,
352
+ "status": "TASK_COMPLETE",
353
+ }
354
+ )
355
+ continue
356
+ if tool not in TOOLS:
357
+ errors.append(
358
+ {"step": step_number, "tool": tool, "error": "unknown tool"}
359
+ )
360
+ break
361
+ call_args = dict(step_args)
362
+ call_args["session_id"] = session_id
363
+ if not any(item.get("tool") != "TaskComplete" for item in trace):
364
+ call_args["case"] = sanitized_case(record)
365
+ try:
366
+ output = _STATE.run_stateful_tool(
367
+ tool,
368
+ call_args,
369
+ tool_function(tool),
370
+ require_existing=(tool != "ReadData"),
371
+ )
372
+ except Exception as exc:
373
+ output = {
374
+ "error_code": 1,
375
+ "text": f"driver exception: {exc}",
376
+ "traceback": traceback.format_exc(),
377
+ }
378
+ trace_row = {
379
+ "step": step_number,
380
+ "tool": tool,
381
+ "args": step_args,
382
+ "error_code": output.get("error_code"),
383
+ "text": output.get("text"),
384
+ "handle": output.get("handle"),
385
+ "canonical_handle": output.get("canonical_handle"),
386
+ "global_artifact_id": output.get("global_artifact_id"),
387
+ "artifact_json_path": output.get("artifact_json_path"),
388
+ "processor": output.get("processor"),
389
+ }
390
+ if "result" in output:
391
+ trace_row["result"] = compact(output.get("result"))
392
+ trace.append(trace_row)
393
+ if int(output.get("error_code", 1)) != 0:
394
+ errors.append(
395
+ {
396
+ "step": step_number,
397
+ "tool": tool,
398
+ "text": output.get("text"),
399
+ "output": compact(output),
400
+ }
401
+ )
402
+ break
403
+
404
+ session_path = _STATE.session_path(session_id)
405
+ if session_path.exists():
406
+ state = _STATE.load_json(session_path)
407
+ else:
408
+ state = {"artifacts": {}, "answer_candidate": None}
409
+ artifacts = state.get("artifacts") or {}
410
+ generated = {
411
+ handle: {
412
+ "type": card.get("type"),
413
+ "canonical_handle": card.get("canonical_handle") or handle,
414
+ "global_artifact_id": card.get("global_artifact_id"),
415
+ "artifact_json_path": card.get("artifact_json_path"),
416
+ "processor": card.get("processor"),
417
+ "result": compact(card.get("result")) if "result" in card else None,
418
+ }
419
+ for handle, card in artifacts.items()
420
+ if isinstance(card, dict) and handle not in (record.get("initial_artifacts") or {})
421
+ }
422
+ support_artifacts = dict(artifacts)
423
+ if terminal_args is not None:
424
+ support_artifacts["task_complete"] = {"result": terminal_args}
425
+ support = answer_support(record.get("expected_final_answer"), support_artifacts)
426
+ status = "passed" if not errors and reached_terminal else "failed"
427
+ from evaluation.structured_answer import score_answer
428
+ from multi_agent.answer_contract import project_final_answer
429
+
430
+ payloads = [
431
+ card["result"]
432
+ for handle, card in artifacts.items()
433
+ if (
434
+ handle not in (record.get("initial_artifacts") or {})
435
+ and isinstance(card, dict)
436
+ and isinstance(card.get("result"), dict)
437
+ )
438
+ ]
439
+ projection = project_final_answer(record, payloads) if status == "passed" else None
440
+ strict_answer = (
441
+ score_answer(record.get("expected_final_answer"), projection.answer)
442
+ if projection is not None and projection.ok
443
+ else {
444
+ "correct": False,
445
+ "answer_acc": 0.0,
446
+ "structured_match": False,
447
+ "valid_json": False,
448
+ "scoring_policy": "terminal_answer_missing",
449
+ }
450
+ )
451
+ end_to_end_pass = bool(status == "passed" and strict_answer.get("correct"))
452
+ result = {
453
+ "replay_contract_version": "geodisaster_strict_replay_v2",
454
+ "record_index": index,
455
+ "dataset_id": record_id,
456
+ "logical_question_type": logical_type(record),
457
+ "question_type": record.get("question_type"),
458
+ "family": record_id.split("/", 1)[0],
459
+ "status": status,
460
+ "reached_task_complete": reached_terminal,
461
+ "tool_error_count": len(errors),
462
+ "errors": errors,
463
+ "answer_support": support,
464
+ "strict_answer": strict_answer,
465
+ "projected_final_answer": compact(projection.answer) if projection is not None else None,
466
+ "answer_contract_errors": list(projection.errors) if projection is not None and not projection.ok else [],
467
+ "end_to_end_pass": end_to_end_pass,
468
+ "expected_final_answer": record.get("expected_final_answer"),
469
+ "produced_answer_candidate": compact(state.get("answer_candidate")),
470
+ "generated_handle_count": len(generated),
471
+ "generated_handles": generated,
472
+ "session_id": session_id,
473
+ "session_path": str(session_path),
474
+ "elapsed_seconds": round(time.time() - started, 4),
475
+ "trace": trace,
476
+ }
477
+ write_json(_CASE_DIR / f"{index:04d}.json", result)
478
+ return result
479
+
480
+
481
+ def summarize(
482
+ results: list[dict[str, Any]],
483
+ elapsed: float,
484
+ records: list[dict[str, Any]],
485
+ path_audit: dict[str, Any],
486
+ ) -> dict[str, Any]:
487
+ by_family: dict[str, list[dict[str, Any]]] = defaultdict(list)
488
+ by_type: dict[str, list[dict[str, Any]]] = defaultdict(list)
489
+ for row in results:
490
+ by_family[str(row.get("family"))].append(row)
491
+ by_type[str(row.get("logical_question_type"))].append(row)
492
+
493
+ def group_summary(rows: list[dict[str, Any]]) -> dict[str, Any]:
494
+ return {
495
+ "records": len(rows),
496
+ "execution_passed": sum(row.get("status") == "passed" for row in rows),
497
+ "strict_answer_correct": sum(bool((row.get("strict_answer") or {}).get("correct")) for row in rows),
498
+ "end_to_end_pass": sum(bool(row.get("end_to_end_pass")) for row in rows),
499
+ "full_answer_support": sum(
500
+ float((row.get("answer_support") or {}).get("score", 0.0)) >= 0.999999
501
+ for row in rows
502
+ ),
503
+ "mean_answer_support": round(
504
+ sum(float((row.get("answer_support") or {}).get("score", 0.0)) for row in rows)
505
+ / len(rows),
506
+ 6,
507
+ ) if rows else 0.0,
508
+ }
509
+
510
+ errors = Counter(
511
+ error.get("tool", "unknown")
512
+ for row in results
513
+ for error in (row.get("errors") or [])
514
+ )
515
+ overall = group_summary(results)
516
+ stored_source_replay_verified = sum(
517
+ (record.get("source_replay") or {}).get("matches_expected") is True
518
+ for record in records
519
+ )
520
+ return {
521
+ **overall,
522
+ "failed": len(results) - overall["execution_passed"],
523
+ "strict_answer_incorrect": len(results) - overall["strict_answer_correct"],
524
+ "end_to_end_failed": len(results) - overall["end_to_end_pass"],
525
+ "elapsed_seconds": round(elapsed, 3),
526
+ "logical_question_types": len(by_type),
527
+ "generated_artifacts": sum(int(row.get("generated_handle_count") or 0) for row in results),
528
+ "stored_historical_source_replay_matches_expected": stored_source_replay_verified,
529
+ "input_path_audit": path_audit,
530
+ "tool_error_counts": dict(errors),
531
+ "by_family": {key: group_summary(value) for key, value in sorted(by_family.items())},
532
+ "by_question_type": {
533
+ key: group_summary(value) for key, value in sorted(by_type.items())
534
+ },
535
+ }
536
+
537
+
538
+ def write_report(output_dir: Path, summary: dict[str, Any]) -> None:
539
+ paths = summary["input_path_audit"]
540
+ lines = [
541
+ "# GeoDisaster 2,921-Question Functional Replay",
542
+ "",
543
+ f"- Records: `{summary['records']}`",
544
+ f"- Logical question types: `{summary['logical_question_types']}`",
545
+ f"- Execution passed: `{summary['execution_passed']}`",
546
+ f"- Execution failed: `{summary['failed']}`",
547
+ f"- Strict structured answers correct: `{summary['strict_answer_correct']}`",
548
+ f"- End-to-end passed: `{summary['end_to_end_pass']}`",
549
+ f"- End-to-end failed: `{summary['end_to_end_failed']}`",
550
+ f"- Generated artifacts: `{summary['generated_artifacts']}`",
551
+ f"- Stored historical source-replay flags marked matching: `{summary['stored_historical_source_replay_matches_expected']}`",
552
+ f"- Full expected-answer scalar support: `{summary['full_answer_support']}`",
553
+ f"- Mean expected-answer support: `{summary['mean_answer_support']}`",
554
+ f"- Elapsed seconds: `{summary['elapsed_seconds']}`",
555
+ f"- Tool errors: `{json.dumps(summary['tool_error_counts'], sort_keys=True)}`",
556
+ "",
557
+ "## Interpretation",
558
+ "",
559
+ "An end-to-end pass requires the prescribed sequence to reach `TaskComplete` without "
560
+ "a worker error, project a schema-valid answer from the newly generated worker evidence, "
561
+ "and pass the active strict structured scorer. Stored historical source-replay flags are "
562
+ "reported only as provenance and never determine current correctness. "
563
+ "Expected-answer scalar support is a separate evidence-coverage heuristic: it "
564
+ "checks whether gold scalar values appear anywhere in generated artifacts. It is "
565
+ "not exact-answer accuracy; the runtime answer-contract layer projects worker "
566
+ "evidence into the requested schema before strict scoring. Missing support can expose a "
567
+ "real numerical or semantic disagreement and should not be silently treated as a pass.",
568
+ "",
569
+ "## Input path audit",
570
+ "",
571
+ f"- Path references: `{paths['path_references']}` (`{paths['unique_paths']}` unique)",
572
+ f"- Existing references: `{paths['existing_references']}`",
573
+ f"- Required missing references: `{paths['required_missing_references']}`",
574
+ f"- Optional missing references: `{paths['optional_missing_references']}` "
575
+ f"(`{paths['optional_missing_unique_paths']}` unique)",
576
+ f"- Absolute path references: `{paths['absolute_path_references']}`",
577
+ f"- References outside dataset root: `{paths['outside_dataset_root_references']}`",
578
+ "",
579
+ "## Family results",
580
+ "",
581
+ "| Family | Records | Executed | Strict correct | End-to-end | Full support | Mean support |",
582
+ "|---|---:|---:|---:|---:|---:|---:|",
583
+ ]
584
+ for family, row in summary["by_family"].items():
585
+ lines.append(
586
+ f"| `{family}` | {row['records']} | {row['execution_passed']} | "
587
+ f"{row['strict_answer_correct']} | {row['end_to_end_pass']} | "
588
+ f"{row['full_answer_support']} | {row['mean_answer_support']} |"
589
+ )
590
+ lines.extend(
591
+ [
592
+ "",
593
+ "## Question-type results",
594
+ "",
595
+ "| Logical question type | Records | Executed | Strict correct | End-to-end | Full support | Mean support |",
596
+ "|---|---:|---:|---:|---:|---:|---:|",
597
+ ]
598
+ )
599
+ for question_type, row in summary["by_question_type"].items():
600
+ lines.append(
601
+ f"| `{question_type}` | {row['records']} | {row['execution_passed']} | "
602
+ f"{row['strict_answer_correct']} | {row['end_to_end_pass']} | "
603
+ f"{row['full_answer_support']} | {row['mean_answer_support']} |"
604
+ )
605
+ (output_dir / "report.md").write_text("\n".join(lines) + "\n", encoding="utf-8")
606
+
607
+
608
+ def parse_args() -> argparse.Namespace:
609
+ parser = argparse.ArgumentParser()
610
+ parser.add_argument("--dataset-root", required=True)
611
+ parser.add_argument("--code-root", required=True)
612
+ parser.add_argument("--input-jsonl", required=True)
613
+ parser.add_argument("--output-dir", required=True)
614
+ parser.add_argument("--workers", type=int, default=4)
615
+ parser.add_argument("--limit", type=int, default=0)
616
+ parser.add_argument("--start-index", type=int, default=1)
617
+ parser.add_argument("--progress-every", type=int, default=25)
618
+ parser.add_argument("--retry-failed", action="store_true")
619
+ parser.add_argument(
620
+ "--record-id",
621
+ action="append",
622
+ default=[],
623
+ help="Replay only this exact record ID; repeat for multiple records.",
624
+ )
625
+ parser.add_argument(
626
+ "--family",
627
+ action="append",
628
+ default=[],
629
+ help="Replay only records whose ID begins with this family plus '/'.",
630
+ )
631
+ parser.add_argument(
632
+ "--question-types",
633
+ default="",
634
+ help="Comma-separated question_type values to replay.",
635
+ )
636
+ parser.add_argument(
637
+ "--uses-tool",
638
+ action="append",
639
+ default=[],
640
+ help="Replay only records whose GT chain calls this tool; repeat as needed.",
641
+ )
642
+ parser.add_argument(
643
+ "--one-per-type",
644
+ action="store_true",
645
+ help="Smoke-test the first record from each of the 43 logical question types.",
646
+ )
647
+ return parser.parse_args()
648
+
649
+
650
+ def main() -> None:
651
+ args = parse_args()
652
+ input_path = Path(args.input_jsonl).resolve()
653
+ output_dir = Path(args.output_dir).resolve()
654
+ case_dir = output_dir / "cases"
655
+ output_dir.mkdir(parents=True, exist_ok=True)
656
+ case_dir.mkdir(parents=True, exist_ok=True)
657
+ records = read_jsonl(input_path)
658
+ dataset_root = Path(args.dataset_root).resolve()
659
+ indexed = list(enumerate(records, 1))
660
+ if args.record_id:
661
+ selected_ids = set(args.record_id)
662
+ indexed = [item for item in indexed if item[1].get("id") in selected_ids]
663
+ if args.family:
664
+ prefixes = tuple(f"{family.rstrip('/')}" + "/" for family in args.family)
665
+ indexed = [
666
+ item
667
+ for item in indexed
668
+ if any(str(item[1].get("id") or "").startswith(prefix) for prefix in prefixes)
669
+ ]
670
+ if args.question_types:
671
+ selected_types = {
672
+ value.strip() for value in args.question_types.split(",") if value.strip()
673
+ }
674
+ indexed = [
675
+ item for item in indexed if item[1].get("question_type") in selected_types
676
+ ]
677
+ if args.uses_tool:
678
+ selected_tools = set(args.uses_tool)
679
+ indexed = [
680
+ item
681
+ for item in indexed
682
+ if selected_tools.intersection(
683
+ str(step.get("tool") or "") for step in item[1].get("gt_chain") or []
684
+ )
685
+ ]
686
+ if args.one_per_type:
687
+ seen_types: set[str] = set()
688
+ selected: list[tuple[int, dict[str, Any]]] = []
689
+ for item in indexed:
690
+ type_name = logical_type(item[1])
691
+ if type_name not in seen_types:
692
+ seen_types.add(type_name)
693
+ selected.append(item)
694
+ indexed = selected
695
+ indexed = [item for item in indexed if item[0] >= args.start_index]
696
+ if args.limit:
697
+ indexed = indexed[: args.limit]
698
+ path_audit = input_path_audit([record for _, record in indexed], dataset_root)
699
+
700
+ existing: dict[int, dict[str, Any]] = {}
701
+ pending: list[tuple[int, dict[str, Any]]] = []
702
+ for item in indexed:
703
+ index = item[0]
704
+ case_path = case_dir / f"{index:04d}.json"
705
+ if case_path.exists():
706
+ try:
707
+ cached = json.loads(case_path.read_text(encoding="utf-8"))
708
+ except Exception:
709
+ cached = None
710
+ cache_current = cached and cached.get("replay_contract_version") == "geodisaster_strict_replay_v2"
711
+ if cache_current and not (
712
+ args.retry_failed and not bool(cached.get("end_to_end_pass"))
713
+ ):
714
+ existing[index] = cached
715
+ continue
716
+ pending.append(item)
717
+
718
+ metadata = {
719
+ "input_jsonl": str(input_path),
720
+ "input_sha256": hashlib.sha256(input_path.read_bytes()).hexdigest(),
721
+ "dataset_root": str(Path(args.dataset_root).resolve()),
722
+ "code_root": str(Path(args.code_root).resolve()),
723
+ "output_dir": str(output_dir),
724
+ "selected_records": len(indexed),
725
+ "cached_records": len(existing),
726
+ "pending_records": len(pending),
727
+ "workers": max(1, args.workers),
728
+ }
729
+ write_json(output_dir / "run_config.json", metadata)
730
+ print(json.dumps(metadata, ensure_ascii=False), flush=True)
731
+
732
+ started = time.time()
733
+ new_results: dict[int, dict[str, Any]] = {}
734
+ if pending:
735
+ worker_count = min(max(1, args.workers), len(pending))
736
+ initializer_args = (
737
+ str(Path(args.code_root).resolve()),
738
+ str(Path(args.dataset_root).resolve()),
739
+ str(output_dir),
740
+ )
741
+ if worker_count == 1:
742
+ initialize_worker(*initializer_args)
743
+ iterator = map(run_record, pending)
744
+ pool = None
745
+ else:
746
+ context = mp.get_context("fork")
747
+ pool = context.Pool(
748
+ worker_count,
749
+ initializer=initialize_worker,
750
+ initargs=initializer_args,
751
+ )
752
+ # Canonical rows are grouped by sample and usually contain several
753
+ # question types over the same rasters. Keep a small row block on
754
+ # one process so the workers' cached raster bundles are reused.
755
+ iterator = pool.imap_unordered(run_record, pending, chunksize=8)
756
+ try:
757
+ for completed, result in enumerate(iterator, 1):
758
+ new_results[int(result["record_index"])] = result
759
+ if args.progress_every and (
760
+ completed % args.progress_every == 0 or completed == len(pending)
761
+ ):
762
+ passed = sum(row.get("status") == "passed" for row in new_results.values())
763
+ print(
764
+ json.dumps(
765
+ {
766
+ "completed_this_run": completed,
767
+ "pending_this_run": len(pending),
768
+ "passed_this_run": passed,
769
+ "failed_this_run": completed - passed,
770
+ "elapsed_seconds": round(time.time() - started, 2),
771
+ },
772
+ ensure_ascii=False,
773
+ ),
774
+ flush=True,
775
+ )
776
+ finally:
777
+ if pool is not None:
778
+ pool.close()
779
+ pool.join()
780
+
781
+ results = [
782
+ (new_results.get(index) or existing[index])
783
+ for index, _ in indexed
784
+ if index in new_results or index in existing
785
+ ]
786
+ with (output_dir / "results.jsonl").open("w", encoding="utf-8") as handle:
787
+ for result in results:
788
+ handle.write(json.dumps(result, ensure_ascii=False, default=str) + "\n")
789
+ elapsed = time.time() - started
790
+ previous_summary_path = output_dir / "summary.json"
791
+ if not pending and previous_summary_path.exists():
792
+ try:
793
+ previous_summary = json.loads(previous_summary_path.read_text(encoding="utf-8"))
794
+ elapsed = float(previous_summary.get("elapsed_seconds") or elapsed)
795
+ except Exception:
796
+ pass
797
+ summary = summarize(
798
+ results,
799
+ elapsed,
800
+ [record for index, record in indexed if index in new_results or index in existing],
801
+ path_audit,
802
+ )
803
+ write_json(output_dir / "summary.json", summary)
804
+ write_report(output_dir, summary)
805
+ with (output_dir / "answer_support_gaps.jsonl").open("w", encoding="utf-8") as handle:
806
+ for result in results:
807
+ support = result.get("answer_support") or {}
808
+ if float(support.get("score", 0.0)) < 0.999999:
809
+ handle.write(
810
+ json.dumps(
811
+ {
812
+ "record_index": result.get("record_index"),
813
+ "dataset_id": result.get("dataset_id"),
814
+ "logical_question_type": result.get("logical_question_type"),
815
+ "support_score": support.get("score"),
816
+ "missing": support.get("missing"),
817
+ },
818
+ ensure_ascii=False,
819
+ default=str,
820
+ )
821
+ + "\n"
822
+ )
823
+ print(json.dumps(summary, indent=2, ensure_ascii=False), flush=True)
824
+ if summary["failed"] or summary["strict_answer_incorrect"]:
825
+ raise SystemExit(2)
826
+
827
+
828
+ if __name__ == "__main__":
829
+ main()
data/release_tools/verify_c11_environment.py ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Verify the exact C11 replay environment and its native geospatial stack."""
3
+
4
+ from __future__ import annotations
5
+
6
+ import argparse
7
+ import hashlib
8
+ import importlib.metadata
9
+ import json
10
+ import platform
11
+ import re
12
+ import sys
13
+ import warnings
14
+ from pathlib import Path
15
+
16
+
17
+ ROOT = Path(__file__).resolve().parents[1]
18
+ ENV_DIR = ROOT / "release_tools/environments"
19
+ LOCK = ENV_DIR / "requirements-replay.lock.txt"
20
+ PYTHON_VERSION = (ENV_DIR / "python-replay.version").read_text(encoding="utf-8").strip()
21
+ EXPECTED_IMPLEMENTATION = "CPython"
22
+ EXPECTED_SYSTEM = "Linux"
23
+ EXPECTED_MACHINE = "x86_64"
24
+
25
+
26
+ def sha256(path: Path) -> str:
27
+ return hashlib.sha256(path.read_bytes()).hexdigest()
28
+
29
+
30
+ def locked_versions(path: Path) -> dict[str, str]:
31
+ versions: dict[str, str] = {}
32
+ for line in path.read_text(encoding="utf-8").splitlines():
33
+ match = re.match(r"^([A-Za-z0-9_.-]+)==([^ ;\\]+)", line)
34
+ if match:
35
+ versions[re.sub(r"[-_.]+", "-", match.group(1)).lower()] = match.group(2)
36
+ if not versions:
37
+ raise ValueError(f"no locked packages found in {path}")
38
+ return versions
39
+
40
+
41
+ def installed_versions() -> dict[str, str]:
42
+ return {
43
+ re.sub(r"[-_.]+", "-", distribution.metadata["Name"]).lower(): distribution.version
44
+ for distribution in importlib.metadata.distributions()
45
+ if distribution.metadata.get("Name")
46
+ }
47
+
48
+
49
+ def main() -> None:
50
+ parser = argparse.ArgumentParser()
51
+ parser.add_argument("--output", type=Path)
52
+ args = parser.parse_args()
53
+
54
+ locked = locked_versions(LOCK)
55
+ installed = installed_versions()
56
+ actual_python = platform.python_version()
57
+ actual_implementation = platform.python_implementation()
58
+ actual_system = platform.system()
59
+ actual_machine = platform.machine()
60
+ missing = sorted(name for name in locked if name not in installed)
61
+ mismatched = {
62
+ name: {"expected": version, "actual": installed.get(name)}
63
+ for name, version in locked.items()
64
+ if installed.get(name) != version
65
+ }
66
+ unexpected = sorted(name for name in installed if name not in locked)
67
+
68
+ with warnings.catch_warnings(record=True) as caught:
69
+ warnings.simplefilter("error")
70
+ import numpy as np
71
+ import pyproj
72
+ import rasterio
73
+ import scipy
74
+ from PIL import Image
75
+ from rasterio.io import MemoryFile
76
+ from scipy import ndimage
77
+ from shapely.geometry import Polygon
78
+
79
+ labels, components = ndimage.label(np.array([[1, 0], [0, 1]], dtype="uint8"))
80
+ if components != 2 or labels.shape != (2, 2):
81
+ raise AssertionError("SciPy connected-component smoke test failed")
82
+ profile = {
83
+ "driver": "GTiff",
84
+ "height": 2,
85
+ "width": 2,
86
+ "count": 1,
87
+ "dtype": "uint8",
88
+ "nodata": 255,
89
+ "transform": rasterio.transform.from_origin(0, 2, 1, 1),
90
+ "crs": "EPSG:4326",
91
+ }
92
+ with MemoryFile() as memory:
93
+ with memory.open(**profile) as dataset:
94
+ dataset.write(np.array([[1, 0], [255, 1]], dtype="uint8"), 1)
95
+ with memory.open() as dataset:
96
+ if dataset.nodata != 255 or int((dataset.read(1) == 1).sum()) != 2:
97
+ raise AssertionError("Rasterio finite-nodata smoke test failed")
98
+ if Polygon([(0, 0), (1, 0), (1, 1), (0, 1)]).area != 1.0:
99
+ raise AssertionError("Shapely geometry smoke test failed")
100
+ x, y = pyproj.Transformer.from_crs(4326, 3857, always_xy=True).transform(0, 0)
101
+ if abs(x) > 1e-9 or abs(y) > 1e-9:
102
+ raise AssertionError("PyProj transform smoke test failed")
103
+ with Image.new("RGB", (2, 2)) as image:
104
+ if image.size != (2, 2):
105
+ raise AssertionError("Pillow smoke test failed")
106
+
107
+ platform_matches = (
108
+ actual_implementation == EXPECTED_IMPLEMENTATION
109
+ and actual_system == EXPECTED_SYSTEM
110
+ and actual_machine == EXPECTED_MACHINE
111
+ )
112
+
113
+ report = {
114
+ "schema_version": "geodisaster_replay_environment_v1",
115
+ "ready": (
116
+ actual_python == PYTHON_VERSION
117
+ and platform_matches
118
+ and not missing
119
+ and not mismatched
120
+ and not unexpected
121
+ ),
122
+ "python": {
123
+ "expected": PYTHON_VERSION,
124
+ "actual": actual_python,
125
+ "expected_implementation": EXPECTED_IMPLEMENTATION,
126
+ "implementation": actual_implementation,
127
+ "executable": sys.executable,
128
+ },
129
+ "platform": {
130
+ "expected_system": EXPECTED_SYSTEM,
131
+ "system": actual_system,
132
+ "expected_machine": EXPECTED_MACHINE,
133
+ "machine": actual_machine,
134
+ "matches": platform_matches,
135
+ "release": platform.release(),
136
+ "libc": platform.libc_ver(),
137
+ },
138
+ "lock": {
139
+ "path": str(LOCK.relative_to(ROOT)),
140
+ "sha256": sha256(LOCK),
141
+ "packages": locked,
142
+ },
143
+ "installed_packages": installed,
144
+ "missing_packages": missing,
145
+ "mismatched_packages": mismatched,
146
+ "unexpected_packages": unexpected,
147
+ "native_libraries": {
148
+ "gdal": rasterio.__gdal_version__,
149
+ "proj": pyproj.proj_version_str,
150
+ "geos": getattr(__import__("shapely"), "geos_version_string", None),
151
+ },
152
+ "compatibility_warnings": [str(item.message) for item in caught],
153
+ "smoke_tests": {
154
+ "numpy_scipy": "passed",
155
+ "rasterio_finite_nodata": "passed",
156
+ "shapely": "passed",
157
+ "pyproj": "passed",
158
+ "pillow": "passed",
159
+ },
160
+ }
161
+ if args.output:
162
+ args.output.parent.mkdir(parents=True, exist_ok=True)
163
+ args.output.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n", encoding="utf-8")
164
+ print(json.dumps(report, indent=2, sort_keys=True))
165
+ if not report["ready"]:
166
+ raise SystemExit(1)
167
+
168
+
169
+ if __name__ == "__main__":
170
+ main()
data/source_assets/deforestation/000007/cache/s1_grd/s1_00.tif ADDED

Git LFS Details

  • SHA256: 2b24a4ef3ffb65b2f586fff71a514730c9a37d6765a01ab840bd789a7d96c24d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.02 MB
data/source_assets/deforestation/000007/cache/s1_grd/s1_03.tif ADDED

Git LFS Details

  • SHA256: 90a4e2b315349a097cb391674063f4508838be747e56eddca4c8bf25491d17b2
  • Pointer size: 132 Bytes
  • Size of remote file: 1.02 MB