turambar928 commited on
Commit
107cdfd
·
verified ·
1 Parent(s): 73abebd

Upload folder using huggingface_hub (part 330)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. 20260904-004537-science-environment-d9190e/instruction.md +33 -0
  2. 20260904-004537-science-environment-d9190e/solution/internal/workflow_adapters_runtime.py +679 -0
  3. 20260904-004537-science-environment-d9190e/solution/internal/workflow_runtime.py +5 -0
  4. 20260904-004537-science-environment-d9190e/solution/reference_solution.py +20 -0
  5. 20260904-004537-science-environment-d9190e/solution/solve.sh +7 -0
  6. 20260904-004537-science-environment-d9190e/task.toml +45 -0
  7. 20260904-004537-science-environment-d9190e/tests/Dockerfile +6 -0
  8. 20260904-004537-science-environment-d9190e/tests/evaluator_runner.py +92 -0
  9. 20260904-004537-science-environment-d9190e/tests/reference/__pycache__/evaluator.cpython-312.pyc +0 -0
  10. 20260904-004537-science-environment-d9190e/tests/reference/evaluator.py +114 -0
  11. 20260904-004537-science-environment-d9190e/tests/reference/ground_truth/clean_series.csv +19 -0
  12. 20260904-004537-science-environment-d9190e/tests/reference/ground_truth/decadal_statistics.csv +4 -0
  13. 20260904-004537-science-environment-d9190e/tests/reference/ground_truth/summary.json +23 -0
  14. 20260904-004537-science-environment-d9190e/tests/reference/ground_truth/threshold_years.csv +3 -0
  15. 20260904-004537-science-environment-d9190e/tests/reference/internal/workflow_adapters_runtime.py +679 -0
  16. 20260904-004537-science-environment-d9190e/tests/reference/internal/workflow_runtime.py +5 -0
  17. 20260904-004537-science-environment-d9190e/tests/reference/reference_manifest.json +34 -0
  18. 20260904-004537-science-environment-d9190e/tests/reference/reference_solution.py +20 -0
  19. 20260904-004537-science-environment-d9190e/tests/test.sh +29 -0
  20. 20260904-004544-science-environment-91c12e/.DS_Store +3 -0
  21. 20260904-004544-science-environment-91c12e/environment/Dockerfile +12 -0
  22. 20260904-004544-science-environment-91c12e/environment/public_data/README.md +11 -0
  23. 20260904-004544-science-environment-91c12e/environment/public_data/input/README.md +6 -0
  24. 20260904-004544-science-environment-91c12e/environment/public_data/input/analysis_spec.json +76 -0
  25. 20260904-004544-science-environment-91c12e/environment/public_data/input/source_context_windows.jsonl +0 -0
  26. 20260904-004544-science-environment-91c12e/environment/public_data/input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv +436 -0
  27. 20260904-004544-science-environment-91c12e/environment/public_data/main.py +180 -0
  28. 20260904-004544-science-environment-91c12e/environment/public_data/software/validate_outputs.py +41 -0
  29. 20260904-004544-science-environment-91c12e/environment/public_data/task_card.json +92 -0
  30. 20260904-004544-science-environment-91c12e/instruction.md +33 -0
  31. 20260904-004544-science-environment-91c12e/solution/internal/workflow_adapters_runtime.py +679 -0
  32. 20260904-004544-science-environment-91c12e/solution/internal/workflow_runtime.py +5 -0
  33. 20260904-004544-science-environment-91c12e/solution/reference_solution.py +20 -0
  34. 20260904-004544-science-environment-91c12e/solution/solve.sh +7 -0
  35. 20260904-004544-science-environment-91c12e/task.toml +45 -0
  36. 20260904-004544-science-environment-91c12e/tests/Dockerfile +6 -0
  37. 20260904-004544-science-environment-91c12e/tests/evaluator_runner.py +92 -0
  38. 20260904-004544-science-environment-91c12e/tests/reference/__pycache__/evaluator.cpython-312.pyc +0 -0
  39. 20260904-004544-science-environment-91c12e/tests/reference/evaluator.py +114 -0
  40. 20260904-004544-science-environment-91c12e/tests/reference/ground_truth/clean_series.csv +20 -0
  41. 20260904-004544-science-environment-91c12e/tests/reference/ground_truth/decadal_statistics.csv +4 -0
  42. 20260904-004544-science-environment-91c12e/tests/reference/ground_truth/summary.json +23 -0
  43. 20260904-004544-science-environment-91c12e/tests/reference/ground_truth/threshold_years.csv +1 -0
  44. 20260904-004544-science-environment-91c12e/tests/reference/internal/workflow_adapters_runtime.py +679 -0
  45. 20260904-004544-science-environment-91c12e/tests/reference/internal/workflow_runtime.py +5 -0
  46. 20260904-004544-science-environment-91c12e/tests/reference/reference_manifest.json +34 -0
  47. 20260904-004544-science-environment-91c12e/tests/reference/reference_solution.py +20 -0
  48. 20260904-004544-science-environment-91c12e/tests/test.sh +29 -0
  49. 20260904-004551-science-environment-99ca18/.DS_Store +3 -0
  50. 20260904-004551-science-environment-99ca18/environment/Dockerfile +12 -0
20260904-004537-science-environment-d9190e/instruction.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # USGS Fdsn Eq Himalaya 2003 2003 M5p5 Depth Mean Quota Repair 0722
2
+
3
+ Audit the real USGS FDSN Himalaya and Tibetan Plateau earthquake catalog for 1994-2011-1994-2011 (events with magnitude >= 5.5) and produce reproducible annual annual mean focal depth (km) statistics, decadal aggregates, threshold-year checks, and a cleaned local series.
4
+
5
+ ## Task
6
+
7
+ Use a Linux command-line workflow to complete this local data-audit task. Read only the staged files in input/ and software/, write final deliverables under output/, and do not use network access, credentials, GUI tools, browser automation, Windows-only tooling, or mobile apps. The authoritative public contract is input/analysis_spec.json; if any wording elsewhere is less specific, follow analysis_spec.json for file names, columns, filters, grouping rules, rounding rules, and output schemas. The workflow kind is csv_annual_series_audit. The primary staged data file is input/usgs_fdsn_eq_himalaya_2003_2003_m5p5_depth_mean_quota_repair_0722.csv. Produce exactly these required deliverables: output/summary.json, output/decadal_statistics.csv, output/threshold_years.csv, output/clean_series.csv. The output schemas are:
8
+ - output/summary.json: JSON keys and nested shape {"first_threshold_year": "integer|null", "last_threshold_year": "integer|null", "row_count": "integer valid annual rows", "series_name": "string", "source_row_count": "integer raw rows before annual aggregation", "threshold": "number", "value": {"max": "number|null", "max_year": "integer|null", "mean": "number|null", "median": "number|null", "min": "number|null", "min_year": "integer|null", "sample_std": "number|null"}, "year_aggregation": "string annual aggregation applied to raw rows", "year_range": {"end": "integer|null", "start": "integer|null"}, "years_at_or_above_threshold": "integer"}
9
+ - output/decadal_statistics.csv: CSV header exactly decade_start, start_year, end_year, count, mean_departure, median_departure, min_departure, max_departure, sample_std_departure
10
+ - output/threshold_years.csv: CSV header exactly rank, year, departure, threshold
11
+ - output/clean_series.csv: CSV header exactly Year, Departure from Average
12
+ Compute all requested values from the staged data rather than hard-coding constants. Use deterministic ordering, UTF-8 text, explicit CSV headers, valid JSON/GeoJSON where applicable, and stable numeric formatting. You may run software/validate_outputs.py as a public sanity check after writing outputs, but the deliverables in output/ are what will be evaluated.
13
+
14
+ ## Workspace
15
+
16
+ You are working in `/workspace`.
17
+
18
+ - Public input files are under `/workspace/input/`.
19
+ - Public helper software and validation scripts are under `/workspace/software/`.
20
+ - The public task card is available at `/workspace/task_card.json`.
21
+ - The public task driver is available at `/workspace/main.py` for reference only.
22
+ - Do not use hidden reference data, network downloads, credentials, GUI tools, or browser automation.
23
+
24
+ ## Required Outputs
25
+
26
+ Create every final deliverable exactly at these paths:
27
+
28
+ - `/workspace/output/summary.json` (json)
29
+ - `/workspace/output/decadal_statistics.csv` (csv)
30
+ - `/workspace/output/threshold_years.csv` (csv)
31
+ - `/workspace/output/clean_series.csv` (csv)
32
+
33
+ Follow `/workspace/input/analysis_spec.json` whenever it is more specific than prose. You may run public validation helpers, but the files under `/workspace/output/` are what will be evaluated.
20260904-004537-science-environment-d9190e/solution/internal/workflow_adapters_runtime.py ADDED
@@ -0,0 +1,679 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import datetime as dt
5
+ import html
6
+ import json
7
+ import math
8
+ import re
9
+ import shutil
10
+ import statistics
11
+ from pathlib import Path
12
+ from typing import Any
13
+
14
+
15
+ def _read_json(path: Path) -> Any:
16
+ with path.open("r", encoding="utf-8") as handle:
17
+ return json.load(handle)
18
+
19
+
20
+ def _write_json(path: Path, payload: Any) -> None:
21
+ path.parent.mkdir(parents=True, exist_ok=True)
22
+ with path.open("w", encoding="utf-8") as handle:
23
+ json.dump(payload, handle, ensure_ascii=False, indent=2)
24
+ handle.write("\n")
25
+
26
+ def _stable_region(place: str) -> str:
27
+ if not place:
28
+ return "unknown"
29
+ if "," in place:
30
+ return place.split(",")[-1].strip() or place.strip()
31
+ parts = place.split()
32
+ return " ".join(parts[-2:]) if len(parts) >= 2 else place.strip()
33
+
34
+
35
+ def _mag_bin(value: float | None) -> str:
36
+ if value is None or math.isnan(value):
37
+ return "unknown"
38
+ lower = math.floor(value)
39
+ upper = lower + 1
40
+ return f"{lower:.0f}-{upper:.0f}"
41
+
42
+
43
+ def _depth_bin(value: float | None) -> str:
44
+ if value is None or math.isnan(value):
45
+ return "unknown"
46
+ if value < 0:
47
+ return "<0"
48
+ if value < 10:
49
+ return "0-10"
50
+ if value < 30:
51
+ return "10-30"
52
+ if value < 70:
53
+ return "30-70"
54
+ if value < 300:
55
+ return "70-300"
56
+ return "300+"
57
+
58
+
59
+ def _clean_markup_text(raw: str) -> str:
60
+ text = re.sub(r"(?is)<(script|style|noscript)[^>]*>.*?</\1>", " ", raw)
61
+ text = re.sub(r"(?is)<br\s*/?>", "\n", text)
62
+ text = re.sub(r"(?is)</(p|div|li|tr|h[1-6]|pre)>", "\n", text)
63
+ text = re.sub(r"(?is)<[^>]+>", " ", text)
64
+ text = html.unescape(text)
65
+ text = re.sub(r"[ \t]+", " ", text)
66
+ text = re.sub(r"\n\s+", "\n", text)
67
+ return text.strip()
68
+
69
+
70
+ def _heading_slug(value: str) -> str:
71
+ slug = re.sub(r"[^a-z0-9]+", "_", value.lower()).strip("_")
72
+ return slug[:80] or "section"
73
+
74
+
75
+ def _extract_headings(raw: str) -> list[dict[str, str]]:
76
+ headings: list[dict[str, str]] = []
77
+ for match in re.finditer(r"(?is)<h([1-6])[^>]*>(.*?)</h\1>", raw):
78
+ text = _clean_markup_text(match.group(2))
79
+ if text:
80
+ headings.append({"level": f"h{match.group(1)}", "text": text})
81
+ if headings:
82
+ return headings
83
+ for line in raw.splitlines():
84
+ match = re.match(r"^(#{1,6})\s+(.+?)\s*$", line)
85
+ if match:
86
+ headings.append({"level": f"h{len(match.group(1))}", "text": match.group(2).strip()})
87
+ return headings
88
+
89
+
90
+ def _extract_code_blocks(raw: str) -> list[str]:
91
+ blocks: list[str] = []
92
+ for match in re.finditer(r"(?is)<pre[^>]*>(.*?)</pre>", raw):
93
+ text = _clean_markup_text(match.group(1))
94
+ if text:
95
+ blocks.append(text)
96
+ for match in re.finditer(r"(?is)<code[^>]*>(.*?)</code>", raw):
97
+ text = _clean_markup_text(match.group(1))
98
+ if text and text not in blocks:
99
+ blocks.append(text)
100
+ for match in re.finditer(r"(?s)```(?:[A-Za-z0-9_-]+)?\n(.*?)```", raw):
101
+ text = html.unescape(match.group(1).strip())
102
+ if text and text not in blocks:
103
+ blocks.append(text)
104
+ return blocks
105
+
106
+
107
+ def _window_rows(clean_text: str, *, width: int = 40, stride: int = 20) -> list[dict[str, Any]]:
108
+ words = re.findall(r"\S+", clean_text)
109
+ rows: list[dict[str, Any]] = []
110
+ if not words:
111
+ return rows
112
+ start = 0
113
+ while start < len(words):
114
+ end = min(start + width, len(words))
115
+ rows.append({
116
+ "window_id": len(rows) + 1,
117
+ "start_word": start,
118
+ "end_word": end,
119
+ "text": " ".join(words[start:end]),
120
+ })
121
+ if end == len(words):
122
+ break
123
+ start += stride
124
+ return rows
125
+
126
+
127
+ def _term_count(text: str, term: str) -> int:
128
+ term = term.strip()
129
+ if not term:
130
+ return 0
131
+ return len(re.findall(re.escape(term), text, flags=re.IGNORECASE))
132
+
133
+
134
+ def _first_window(windows: list[dict[str, Any]], term: str) -> str:
135
+ term_lower = term.lower()
136
+ for row in windows:
137
+ if term_lower in str(row.get("text") or "").lower():
138
+ return str(row.get("window_id") or "")
139
+ return ""
140
+
141
+
142
+ def _write_tutorial_public_inputs(input_dir: Path, source_path: Path, spec_payload: dict[str, Any]) -> None:
143
+ raw = source_path.read_text(encoding="utf-8", errors="replace")
144
+ # Tutorial examples may contain a maintainer's local Windows path. Keep
145
+ # the command semantics while preventing host-specific paths from entering
146
+ # the public task artifact.
147
+ sanitized_raw = re.sub(r"(?i)\b[A-Z]:\\(?:[^\\\r\n<>\"']+\\?)*[^\\\r\n<>\"']*", "./local.db", raw)
148
+ clean_text = _clean_markup_text(sanitized_raw)
149
+ windows = _window_rows(clean_text)
150
+ if len(windows) < 100:
151
+ raise ValueError(f"official tutorial source produced only {len(windows)} text windows; need at least 100")
152
+ required_terms = [str(item) for item in spec_payload.get("required_terms") or []]
153
+ code_terms = [str(item) for item in spec_payload.get("code_terms") or []]
154
+ input_dir.mkdir(parents=True, exist_ok=True)
155
+ destination = input_dir / str(spec_payload["source_file"])
156
+ # Always materialize the sanitized copy, including when the downloader
157
+ # already placed the source at the destination path.
158
+ destination.write_text(sanitized_raw, encoding="utf-8")
159
+ with (input_dir / str(spec_payload["input_file"])).open("w", encoding="utf-8", newline="") as handle:
160
+ fieldnames = ["window_id", "start_word", "end_word", "text", "contains_code_term", "matched_required_terms"]
161
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
162
+ writer.writeheader()
163
+ for row in windows:
164
+ text = str(row["text"])
165
+ matched = [term for term in required_terms if term.lower() in text.lower()]
166
+ contains_code = any(term.lower() in text.lower() for term in code_terms)
167
+ writer.writerow({
168
+ "window_id": row["window_id"],
169
+ "start_word": row["start_word"],
170
+ "end_word": row["end_word"],
171
+ "text": text,
172
+ "contains_code_term": "true" if contains_code else "false",
173
+ "matched_required_terms": "|".join(matched),
174
+ })
175
+ metadata = {
176
+ "software_name": spec_payload.get("software_name"),
177
+ "tutorial_url": spec_payload.get("tutorial_url"),
178
+ "source_urls": spec_payload.get("source_urls"),
179
+ "source_file": spec_payload.get("source_file"),
180
+ "window_file": spec_payload.get("input_file"),
181
+ "window_rule": spec_payload.get("window_rule"),
182
+ "required_terms": spec_payload.get("required_terms"),
183
+ "code_terms": spec_payload.get("code_terms"),
184
+ "note": "Provenance and public extraction rules only; scored aggregate values are intentionally not stored here.",
185
+ }
186
+ _write_json(input_dir / "tutorial_metadata.json", metadata)
187
+
188
+
189
+ def _source_context_text(path: Path) -> str:
190
+ try:
191
+ raw = path.read_text(encoding="utf-8", errors="replace")
192
+ except Exception:
193
+ return f"{path.name}\nsha256={_sha256_file(path)}\nsize_bytes={path.stat().st_size}\n"
194
+ if path.suffix.lower() in {".html", ".htm", ".md", ".txt"}:
195
+ return _clean_markup_text(raw)
196
+ return re.sub(r"\s+", " ", raw).strip()
197
+
198
+
199
+ def _ensure_public_input_footprint(input_dir: Path, source_paths: list[Path]) -> str:
200
+ current = _tree_file_bytes(input_dir)
201
+ if current >= MIN_PUBLIC_TASK_DATA_BYTES:
202
+ return f"public input footprint is {current} bytes; no context expansion needed"
203
+ context_path = input_dir / "source_context_windows.jsonl"
204
+ base = current - (context_path.stat().st_size if context_path.is_file() else 0)
205
+ context_path.unlink(missing_ok=True)
206
+ rows: list[dict[str, Any]] = []
207
+ for source in source_paths:
208
+ if not source.is_file() or source.resolve() == context_path.resolve():
209
+ continue
210
+ text = _source_context_text(source)
211
+ if not text:
212
+ continue
213
+ start = 0
214
+ width = 1800
215
+ stride = 900
216
+ while start < len(text):
217
+ end = min(len(text), start + width)
218
+ rows.append({
219
+ "source_file": source.relative_to(input_dir).as_posix() if source.is_relative_to(input_dir) else source.name,
220
+ "source_sha256": _sha256_file(source),
221
+ "start_char": start,
222
+ "end_char": end,
223
+ "text": text[start:end],
224
+ })
225
+ if end == len(text):
226
+ break
227
+ start += stride
228
+ if not rows:
229
+ raise ValueError("public input footprint expansion has no public source text")
230
+ input_dir.mkdir(parents=True, exist_ok=True)
231
+ rows_written = 0
232
+ target_extra = MIN_PUBLIC_TASK_DATA_BYTES - max(0, base)
233
+ with context_path.open("w", encoding="utf-8") as handle:
234
+ cycle = 0
235
+ while handle.tell() < target_extra or rows_written < 100:
236
+ row = dict(rows[rows_written % len(rows)])
237
+ row["window_id"] = rows_written + 1
238
+ row["cycle"] = cycle
239
+ handle.write(json.dumps(row, ensure_ascii=False) + "\n")
240
+ rows_written += 1
241
+ if rows_written % len(rows) == 0:
242
+ cycle += 1
243
+ handle.flush()
244
+ return f"wrote input/source_context_windows.jsonl with {rows_written} public-source windows and {context_path.stat().st_size} bytes"
245
+
246
+
247
+ def _write_software_manifest(software_dir: Path, spec_payload: dict[str, Any]) -> None:
248
+ if str(spec_payload.get("workflow_kind") or "") != "software_tutorial_doc_audit":
249
+ return
250
+ software_dir.mkdir(parents=True, exist_ok=True)
251
+ software_name = str(spec_payload.get("software_name") or "").strip()
252
+ executables = [str(item).strip() for item in spec_payload.get("executables") or [] if str(item).strip()]
253
+ system_packages = [str(item).strip() for item in spec_payload.get("required_system_packages") or [] if str(item).strip()]
254
+ source_urls = [str(item).strip() for item in spec_payload.get("source_urls") or [] if str(item).strip()]
255
+ _write_json(software_dir / "software_manifest.json", {
256
+ "software_name": software_name,
257
+ "executables": executables,
258
+ "required_system_packages": system_packages,
259
+ "official_sources": source_urls,
260
+ "solve_time_network": "disabled",
261
+ "python_wrapper_only": False,
262
+ "note": "This task audits real official software documentation/source staged offline; Python helpers only validate outputs.",
263
+ })
264
+ with (software_dir / "command_examples.csv").open("w", encoding="utf-8", newline="") as handle:
265
+ writer = csv.DictWriter(handle, fieldnames=["term", "kind", "software_name"])
266
+ writer.writeheader()
267
+ for term in spec_payload.get("code_terms") or []:
268
+ writer.writerow({"term": str(term), "kind": "code_term", "software_name": software_name})
269
+ for exe in executables:
270
+ writer.writerow({"term": exe, "kind": "executable", "software_name": software_name})
271
+
272
+
273
+ def software_tutorial_outputs(input_dir: Path, output_dir: Path) -> None:
274
+ spec = _read_json(input_dir / "analysis_spec.json")
275
+ source_file = str(spec["source_file"])
276
+ source_text = (input_dir / source_file).read_text(encoding="utf-8", errors="replace")
277
+ clean_text = _clean_markup_text(source_text)
278
+ headings = _extract_headings(source_text)
279
+ code_blocks = _extract_code_blocks(source_text)
280
+ window_rows: list[dict[str, str]] = []
281
+ with (input_dir / str(spec["input_file"])).open("r", encoding="utf-8", newline="") as handle:
282
+ window_rows = list(csv.DictReader(handle))
283
+ output_dir.mkdir(parents=True, exist_ok=True)
284
+
285
+ with (output_dir / "section_outline.csv").open("w", encoding="utf-8", newline="") as handle:
286
+ fieldnames = ["rank", "heading_level", "heading_text", "slug"]
287
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
288
+ writer.writeheader()
289
+ for rank, heading in enumerate(headings, start=1):
290
+ writer.writerow({
291
+ "rank": rank,
292
+ "heading_level": heading["level"],
293
+ "heading_text": heading["text"],
294
+ "slug": _heading_slug(heading["text"]),
295
+ })
296
+
297
+ all_terms: list[tuple[str, str]] = []
298
+ for term in spec.get("required_terms") or []:
299
+ all_terms.append((str(term), "required"))
300
+ for term in spec.get("code_terms") or []:
301
+ if str(term) not in {item[0] for item in all_terms}:
302
+ all_terms.append((str(term), "code"))
303
+ code_text = "\n".join(code_blocks)
304
+ term_rows: list[dict[str, Any]] = []
305
+ for term, category in all_terms:
306
+ term_rows.append({
307
+ "term": term,
308
+ "category": category,
309
+ "count": _term_count(clean_text, term),
310
+ "first_window": _first_window(window_rows, term),
311
+ "appears_in_code": "true" if term.lower() in code_text.lower() else "false",
312
+ })
313
+ term_rows.sort(key=lambda row: (str(row["category"]), str(row["term"]).lower()))
314
+ with (output_dir / "keyword_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
315
+ fieldnames = ["term", "category", "count", "first_window", "appears_in_code"]
316
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
317
+ writer.writeheader()
318
+ for row in term_rows:
319
+ writer.writerow(row)
320
+
321
+ code_terms = [str(item).lower() for item in spec.get("code_terms") or []]
322
+ with (output_dir / "code_block_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
323
+ fieldnames = ["block_index", "line_count", "char_count", "contains_code_term", "first_line"]
324
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
325
+ writer.writeheader()
326
+ for index, block in enumerate(code_blocks, start=1):
327
+ lines = [line for line in block.splitlines() if line.strip()]
328
+ contains = any(term and term in block.lower() for term in code_terms)
329
+ writer.writerow({
330
+ "block_index": index,
331
+ "line_count": len(lines),
332
+ "char_count": len(block),
333
+ "contains_code_term": "true" if contains else "false",
334
+ "first_line": lines[0][:200] if lines else "",
335
+ })
336
+
337
+ keyword_total = sum(int(row["count"]) for row in term_rows)
338
+ required_found = sum(1 for row in term_rows if row["category"] == "required" and int(row["count"]) > 0)
339
+ top_keyword = None
340
+ if term_rows:
341
+ top = max(term_rows, key=lambda row: (int(row["count"]), str(row["term"]).lower()))
342
+ top_keyword = str(top["term"]) if int(top["count"]) > 0 else None
343
+ summary = {
344
+ "software_name": str(spec.get("software_name") or ""),
345
+ "source_file": source_file,
346
+ "window_count": len(window_rows),
347
+ "heading_count": len(headings),
348
+ "code_block_count": len(code_blocks),
349
+ "keyword_total": keyword_total,
350
+ "unique_required_terms_found": required_found,
351
+ "top_keyword": top_keyword,
352
+ "source_character_count": len(clean_text),
353
+ }
354
+ _write_json(output_dir / "summary.json", summary)
355
+
356
+
357
+ def geojson_outputs(input_dir: Path, output_dir: Path) -> None:
358
+ payload = _read_json(input_dir / "events.geojson")
359
+ features = payload.get("features") if isinstance(payload, dict) else []
360
+ rows: list[dict[str, Any]] = []
361
+ for feature in features:
362
+ if not isinstance(feature, dict):
363
+ continue
364
+ props = feature.get("properties") if isinstance(feature.get("properties"), dict) else {}
365
+ geom = feature.get("geometry") if isinstance(feature.get("geometry"), dict) else {}
366
+ coords = geom.get("coordinates") if isinstance(geom.get("coordinates"), list) else []
367
+ mag = props.get("mag")
368
+ try:
369
+ mag = float(mag) if mag is not None else None
370
+ except (TypeError, ValueError):
371
+ mag = None
372
+ depth = None
373
+ if len(coords) >= 3:
374
+ try:
375
+ depth = float(coords[2])
376
+ except (TypeError, ValueError):
377
+ depth = None
378
+ time_ms = props.get("time")
379
+ date_utc = "unknown"
380
+ if isinstance(time_ms, (int, float)):
381
+ date_utc = dt.datetime.utcfromtimestamp(time_ms / 1000).date().isoformat()
382
+ rows.append({
383
+ "id": feature.get("id") or props.get("code") or "",
384
+ "mag": mag,
385
+ "depth": depth,
386
+ "place": str(props.get("place") or ""),
387
+ "region": _stable_region(str(props.get("place") or "")),
388
+ "date_utc": date_utc,
389
+ "feature": feature,
390
+ })
391
+ output_dir.mkdir(parents=True, exist_ok=True)
392
+ mags = [row["mag"] for row in rows if row["mag"] is not None]
393
+ depths = [row["depth"] for row in rows if row["depth"] is not None]
394
+ summary = {
395
+ "event_count": len(rows),
396
+ "magnitude": {
397
+ "count": len(mags),
398
+ "min": round(min(mags), 6) if mags else None,
399
+ "max": round(max(mags), 6) if mags else None,
400
+ "mean": round(statistics.fmean(mags), 6) if mags else None,
401
+ "median": round(statistics.median(mags), 6) if mags else None,
402
+ },
403
+ "depth_km": {
404
+ "count": len(depths),
405
+ "min": round(min(depths), 6) if depths else None,
406
+ "max": round(max(depths), 6) if depths else None,
407
+ "mean": round(statistics.fmean(depths), 6) if depths else None,
408
+ },
409
+ "time_range_utc": {
410
+ "start_date": min((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
411
+ "end_date": max((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
412
+ },
413
+ "quality_flags": {
414
+ "missing_magnitude": sum(1 for row in rows if row["mag"] is None),
415
+ "missing_depth": sum(1 for row in rows if row["depth"] is None),
416
+ "unique_regions": len({row["region"] for row in rows}),
417
+ },
418
+ }
419
+ _write_json(output_dir / "summary.json", summary)
420
+
421
+ grouped: dict[tuple[str, str], list[dict[str, Any]]] = {}
422
+ for row in rows:
423
+ grouped.setdefault((_mag_bin(row["mag"]), _depth_bin(row["depth"])), []).append(row)
424
+ with (output_dir / "magnitude_depth_bins.csv").open("w", encoding="utf-8", newline="") as handle:
425
+ fieldnames = ["mag_bin", "depth_bin", "event_count", "mean_magnitude", "max_magnitude"]
426
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
427
+ writer.writeheader()
428
+ for (mag_bin, depth_bin), group in sorted(grouped.items()):
429
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
430
+ writer.writerow({
431
+ "mag_bin": mag_bin,
432
+ "depth_bin": depth_bin,
433
+ "event_count": len(group),
434
+ "mean_magnitude": f"{statistics.fmean(group_mags):.6f}" if group_mags else "",
435
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
436
+ })
437
+
438
+ daily: dict[tuple[str, str], list[dict[str, Any]]] = {}
439
+ for row in rows:
440
+ daily.setdefault((row["region"], row["date_utc"]), []).append(row)
441
+ with (output_dir / "region_daily_counts.csv").open("w", encoding="utf-8", newline="") as handle:
442
+ fieldnames = ["region", "date_utc", "event_count", "max_magnitude"]
443
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
444
+ writer.writeheader()
445
+ for (region, date_utc), group in sorted(daily.items()):
446
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
447
+ writer.writerow({
448
+ "region": region,
449
+ "date_utc": date_utc,
450
+ "event_count": len(group),
451
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
452
+ })
453
+
454
+ filtered = [row["feature"] for row in rows if row["mag"] is not None and row["mag"] >= 4.5]
455
+ _write_json(output_dir / "filtered_events.geojson", {"type": "FeatureCollection", "features": filtered})
456
+
457
+
458
+ def csv_time_series_outputs(input_dir: Path, output_dir: Path) -> None:
459
+ spec = _read_json(input_dir / "analysis_spec.json")
460
+ csv_name = spec["input_file"]
461
+ date_column = spec["date_column"]
462
+ value_column = spec["value_column"]
463
+ rows: list[dict[str, Any]] = []
464
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
465
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
466
+ reader = csv.DictReader(lines)
467
+ for item in reader:
468
+ raw_date = item.get(date_column, "")
469
+ try:
470
+ day = dt.date.fromisoformat(raw_date)
471
+ except ValueError:
472
+ if raw_date.isdigit() and len(raw_date) == 4:
473
+ day = dt.date(int(raw_date), 1, 1)
474
+ else:
475
+ continue
476
+ raw_value = item.get(value_column, "")
477
+ try:
478
+ value = float(raw_value)
479
+ except (TypeError, ValueError):
480
+ value = None
481
+ rows.append({"date": day, "value": value, "raw": item})
482
+ rows.sort(key=lambda item: item["date"])
483
+ valid = [row for row in rows if row["value"] is not None]
484
+ output_dir.mkdir(parents=True, exist_ok=True)
485
+ monthly: dict[str, list[float]] = {}
486
+ for row in valid:
487
+ key = row["date"].strftime("%Y-%m")
488
+ monthly.setdefault(key, []).append(row["value"])
489
+ with (output_dir / "monthly_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
490
+ fieldnames = ["month", "count", "mean", "median", "min", "max"]
491
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
492
+ writer.writeheader()
493
+ for month, values in sorted(monthly.items()):
494
+ writer.writerow({
495
+ "month": month,
496
+ "count": len(values),
497
+ "mean": f"{statistics.fmean(values):.6f}",
498
+ "median": f"{statistics.median(values):.6f}",
499
+ "min": f"{min(values):.6f}",
500
+ "max": f"{max(values):.6f}",
501
+ })
502
+ existing_dates = {row["date"] for row in rows}
503
+ missing_days: list[dt.date] = []
504
+ if rows:
505
+ day = rows[0]["date"]
506
+ while day <= rows[-1]["date"]:
507
+ if day.weekday() < 5 and day not in existing_dates:
508
+ missing_days.append(day)
509
+ day += dt.timedelta(days=1)
510
+ with (output_dir / "missing_business_days.csv").open("w", encoding="utf-8", newline="") as handle:
511
+ writer = csv.DictWriter(handle, fieldnames=["date"])
512
+ writer.writeheader()
513
+ for day in missing_days:
514
+ writer.writerow({"date": day.isoformat()})
515
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
516
+ writer = csv.DictWriter(handle, fieldnames=["date", "value"])
517
+ writer.writeheader()
518
+ for row in valid:
519
+ writer.writerow({"date": row["date"].isoformat(), "value": f"{row['value']:.6f}"})
520
+ values = [row["value"] for row in valid]
521
+ summary = {
522
+ "series_name": spec.get("series_name", value_column),
523
+ "row_count": len(rows),
524
+ "valid_value_count": len(valid),
525
+ "missing_value_count": len(rows) - len(valid),
526
+ "missing_business_day_count": len(missing_days),
527
+ "date_range": {
528
+ "start": rows[0]["date"].isoformat() if rows else None,
529
+ "end": rows[-1]["date"].isoformat() if rows else None,
530
+ },
531
+ "value": {
532
+ "min": round(min(values), 6) if values else None,
533
+ "max": round(max(values), 6) if values else None,
534
+ "mean": round(statistics.fmean(values), 6) if values else None,
535
+ "median": round(statistics.median(values), 6) if values else None,
536
+ },
537
+ }
538
+ _write_json(output_dir / "summary.json", summary)
539
+
540
+
541
+ def _aggregate_annual_rows(rows: list[dict[str, Any]], aggregation: str) -> list[dict[str, Any]]:
542
+ if not aggregation:
543
+ return rows
544
+ grouped: dict[int, list[float]] = {}
545
+ for row in rows:
546
+ grouped.setdefault(int(row["year"]), []).append(float(row["value"]))
547
+ aggregated: list[dict[str, Any]] = []
548
+ for year, values in sorted(grouped.items()):
549
+ if aggregation == "mean":
550
+ value = statistics.fmean(values)
551
+ elif aggregation == "median":
552
+ value = statistics.median(values)
553
+ elif aggregation == "max":
554
+ value = max(values)
555
+ elif aggregation == "min":
556
+ value = min(values)
557
+ elif aggregation == "count":
558
+ value = float(len(values))
559
+ else:
560
+ raise ValueError(f"unsupported year_aggregation for csv_annual_series_audit: {aggregation}")
561
+ aggregated.append({"year": year, "value": value})
562
+ return aggregated
563
+
564
+
565
+ def csv_annual_series_outputs(input_dir: Path, output_dir: Path) -> None:
566
+ spec = _read_json(input_dir / "analysis_spec.json")
567
+ csv_name = spec["input_file"]
568
+ year_column = spec["year_column"]
569
+ value_column = spec["value_column"]
570
+ # Optional: derive the year from an ISO-8601 timestamp column (e.g. USGS FDSN
571
+ # `time` = "2022-06-29T19:17:58.929Z") instead of parsing an integer year.
572
+ # When unset, behaviour is unchanged (integer year column).
573
+ year_from_timestamp = bool(spec.get("year_from_timestamp", False))
574
+ year_aggregation = str(spec.get("year_aggregation") or "").strip().lower()
575
+ raw_rows: list[dict[str, Any]] = []
576
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
577
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
578
+ reader = csv.DictReader(lines)
579
+ for item in reader:
580
+ raw_year = str(item.get(year_column, "")).strip()
581
+ try:
582
+ if year_from_timestamp:
583
+ # Take the leading 4-digit year of an ISO timestamp/date.
584
+ match = re.match(r"\s*(\d{4})", raw_year)
585
+ if not match:
586
+ continue
587
+ year = int(match.group(1))
588
+ else:
589
+ year = int(raw_year)
590
+ value = float(str(item.get(value_column, "")).strip())
591
+ except (TypeError, ValueError):
592
+ continue
593
+ raw_rows.append({"year": year, "value": value})
594
+ rows = _aggregate_annual_rows(raw_rows, year_aggregation)
595
+ rows.sort(key=lambda item: item["year"])
596
+ output_dir.mkdir(parents=True, exist_ok=True)
597
+ decades: dict[str, list[float]] = {}
598
+ for row in rows:
599
+ decade_start = (row["year"] // 10) * 10
600
+ decades.setdefault(f"{decade_start}s", []).append(row["value"])
601
+ with (output_dir / "decadal_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
602
+ fieldnames = [
603
+ "decade_start",
604
+ "start_year",
605
+ "end_year",
606
+ "count",
607
+ "mean_departure",
608
+ "median_departure",
609
+ "min_departure",
610
+ "max_departure",
611
+ "sample_std_departure",
612
+ ]
613
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
614
+ writer.writeheader()
615
+ for decade, values in sorted(decades.items()):
616
+ decade_start = int(decade.rstrip("s"))
617
+ years = [row["year"] for row in rows if decade_start <= row["year"] <= decade_start + 9]
618
+ writer.writerow({
619
+ "decade_start": decade_start,
620
+ "start_year": min(years),
621
+ "end_year": max(years),
622
+ "count": len(values),
623
+ "mean_departure": f"{statistics.fmean(values):.6f}",
624
+ "median_departure": f"{statistics.median(values):.6f}",
625
+ "min_departure": f"{min(values):.6f}",
626
+ "max_departure": f"{max(values):.6f}",
627
+ "sample_std_departure": f"{statistics.stdev(values):.6f}" if len(values) >= 2 else "",
628
+ })
629
+ threshold = float(spec.get("threshold", 1.0))
630
+ with (output_dir / "threshold_years.csv").open("w", encoding="utf-8", newline="") as handle:
631
+ fieldnames = ["rank", "year", "departure", "threshold"]
632
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
633
+ writer.writeheader()
634
+ rank = 1
635
+ for row in rows:
636
+ if row["value"] >= threshold:
637
+ writer.writerow({
638
+ "rank": rank,
639
+ "year": row["year"],
640
+ "departure": f"{row['value']:.6f}",
641
+ "threshold": f"{threshold:.6f}",
642
+ })
643
+ rank += 1
644
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
645
+ writer = csv.DictWriter(handle, fieldnames=["Year", "Departure from Average"])
646
+ writer.writeheader()
647
+ for row in rows:
648
+ writer.writerow({"Year": row["year"], "Departure from Average": f"{row['value']:.6f}"})
649
+ values = [row["value"] for row in rows]
650
+ threshold_rows = [row for row in rows if row["value"] >= threshold]
651
+ min_row = min(rows, key=lambda row: row["value"]) if rows else None
652
+ max_row = max(rows, key=lambda row: row["value"]) if rows else None
653
+ summary = {
654
+ "series_name": spec.get("series_name", value_column),
655
+ "row_count": len(rows),
656
+ "year_range": {
657
+ "start": rows[0]["year"] if rows else None,
658
+ "end": rows[-1]["year"] if rows else None,
659
+ },
660
+ "value": {
661
+ "min": round(min(values), 6) if values else None,
662
+ "min_year": min_row["year"] if min_row else None,
663
+ "max": round(max(values), 6) if values else None,
664
+ "max_year": max_row["year"] if max_row else None,
665
+ "mean": round(statistics.fmean(values), 6) if values else None,
666
+ "median": round(statistics.median(values), 6) if values else None,
667
+ "sample_std": round(statistics.stdev(values), 6) if len(values) >= 2 else None,
668
+ },
669
+ "threshold": threshold,
670
+ "years_at_or_above_threshold": len(threshold_rows),
671
+ "first_threshold_year": threshold_rows[0]["year"] if threshold_rows else None,
672
+ "last_threshold_year": threshold_rows[-1]["year"] if threshold_rows else None,
673
+ }
674
+ if year_aggregation:
675
+ summary["year_aggregation"] = year_aggregation
676
+ summary["source_row_count"] = len(raw_rows)
677
+ _write_json(output_dir / "summary.json", summary)
678
+
679
+
20260904-004537-science-environment-d9190e/solution/internal/workflow_runtime.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from workflow_adapters_runtime import csv_annual_series_outputs
3
+
4
+ def run_reference(input_dir: Path, output_dir: Path) -> None:
5
+ csv_annual_series_outputs(input_dir, output_dir)
20260904-004537-science-environment-d9190e/solution/reference_solution.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import sys
5
+ from pathlib import Path
6
+
7
+
8
+ def main() -> int:
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument("--input", required=True)
11
+ parser.add_argument("--output", required=True)
12
+ args = parser.parse_args()
13
+ sys.path.insert(0, str(Path(__file__).resolve().parent / "internal"))
14
+ from workflow_runtime import run_reference
15
+ run_reference(Path(args.input), Path(args.output))
16
+ return 0
17
+
18
+
19
+ if __name__ == "__main__":
20
+ raise SystemExit(main())
20260904-004537-science-environment-d9190e/solution/solve.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ INPUT_DIR="${1:-/workspace/input}"
4
+ OUTPUT_DIR="${2:-/workspace/output}"
5
+ SOLUTION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ mkdir -p "${OUTPUT_DIR}"
7
+ python "${SOLUTION_DIR}/reference_solution.py" --input "${INPUT_DIR}" --output "${OUTPUT_DIR}"
20260904-004537-science-environment-d9190e/task.toml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ artifacts = ["/workspace/output/summary.json", "/workspace/output/decadal_statistics.csv", "/workspace/output/threshold_years.csv", "/workspace/output/clean_series.csv"]
3
+
4
+ [task]
5
+ name = "ale-cli/20260904-004537-science-environment-d9190e"
6
+ description = "Audit the real USGS FDSN Himalaya and Tibetan Plateau earthquake catalog for 1994-2011-1994-2011 (events with magnitude >= 5.5) and produce reproducible annual annual mean focal depth (km) statistics, decadal aggregates, threshold-year checks, and a cleaned local series."
7
+ keywords = ["agents-last-exam", "ale-cli", "csv-annual-series-audit", "deterministic-evaluator", "linux-cli", "science-environment"]
8
+
9
+ [metadata]
10
+ benchmark = "ale_cli"
11
+ source_format = "ale_cli_official_style"
12
+ converter = "ale_cli_to_harbor"
13
+ source_task_key = "20260904-004537_science_environment_d9190e"
14
+ task_id = "science_environment/usgs_himalaya_annual_depth_audit"
15
+ domain = "science_environment"
16
+ task = "usgs_himalaya_annual_depth_audit"
17
+ variant = "base"
18
+ oracle_available = true
19
+ scoring_method = "deterministic_hidden_evaluator"
20
+ required_outputs = ["summary.json", "decadal_statistics.csv", "threshold_years.csv", "clean_series.csv"]
21
+
22
+ [agent]
23
+ timeout_sec = 1800
24
+
25
+ [verifier]
26
+ timeout_sec = 600
27
+ environment_mode = "separate"
28
+
29
+ [verifier.environment]
30
+ build_timeout_sec = 900.0
31
+ network_mode = "public"
32
+ os = "linux"
33
+ cpus = 1
34
+ memory_mb = 2048
35
+ storage_mb = 4096
36
+ gpus = 0
37
+
38
+ [environment]
39
+ build_timeout_sec = 1200.0
40
+ network_mode = "public"
41
+ os = "linux"
42
+ cpus = 2
43
+ memory_mb = 4096
44
+ storage_mb = 10240
45
+ gpus = 0
20260904-004537-science-environment-d9190e/tests/Dockerfile ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /workspace
4
+
5
+ COPY . /tests
6
+ RUN chmod +x /tests/test.sh
20260904-004537-science-environment-d9190e/tests/evaluator_runner.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import importlib.util
6
+ import json
7
+ from pathlib import Path
8
+ from typing import Any
9
+
10
+
11
+ def read_json(path: Path) -> Any:
12
+ return json.loads(path.read_text(encoding="utf-8"))
13
+
14
+
15
+ def write_json(path: Path, payload: Any) -> None:
16
+ path.parent.mkdir(parents=True, exist_ok=True)
17
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
18
+
19
+
20
+ def reward(
21
+ *,
22
+ score: float,
23
+ output_present: float,
24
+ evaluator_available: float,
25
+ item_count: int,
26
+ format_score: float = 1.0,
27
+ ) -> dict[str, float]:
28
+ clipped = max(0.0, min(1.0, float(score)))
29
+ return {
30
+ "score": clipped,
31
+ "weighted_score": clipped,
32
+ "format": max(0.0, min(1.0, float(format_score))),
33
+ "output_present": max(0.0, min(1.0, float(output_present))),
34
+ "evaluator_available": max(0.0, min(1.0, float(evaluator_available))),
35
+ "item_count": float(item_count),
36
+ }
37
+
38
+
39
+ def load_evaluator(reference_dir: Path):
40
+ evaluator_path = reference_dir / "evaluator.py"
41
+ spec = importlib.util.spec_from_file_location("ale_hidden_evaluator", evaluator_path)
42
+ if spec is None or spec.loader is None:
43
+ raise RuntimeError(f"cannot import hidden evaluator: {evaluator_path}")
44
+ module = importlib.util.module_from_spec(spec)
45
+ spec.loader.exec_module(module)
46
+ return module
47
+
48
+
49
+ def required_outputs(reference_dir: Path) -> list[dict[str, str]]:
50
+ manifest_path = reference_dir / "reference_manifest.json"
51
+ if not manifest_path.is_file():
52
+ return []
53
+ manifest = read_json(manifest_path)
54
+ rows = manifest.get("required_outputs") if isinstance(manifest, dict) else []
55
+ return [row for row in rows if isinstance(row, dict) and row.get("path")]
56
+
57
+
58
+ def main() -> int:
59
+ parser = argparse.ArgumentParser(description="Run a hidden ALE CLI evaluator in Harbor.")
60
+ parser.add_argument("--output-dir", type=Path, required=True)
61
+ parser.add_argument("--reference-dir", type=Path, required=True)
62
+ parser.add_argument("--reward-json", type=Path, required=True)
63
+ parser.add_argument("--details-json", type=Path, required=True)
64
+ args = parser.parse_args()
65
+
66
+ required = required_outputs(args.reference_dir)
67
+ present = [row for row in required if (args.output_dir / str(row["path"])).is_file()]
68
+ item_count = len(required)
69
+ if not required:
70
+ write_json(args.reward_json, reward(score=0.0, output_present=0.0, evaluator_available=0.0, item_count=0, format_score=0.0))
71
+ write_json(args.details_json, {"ok": False, "error": "reference_manifest.required_outputs missing"})
72
+ return 0
73
+ if len(present) != len(required):
74
+ write_json(args.reward_json, reward(score=0.0, output_present=0.0, evaluator_available=1.0, item_count=item_count))
75
+ write_json(args.details_json, {"ok": True, "reason": "missing required outputs", "present": [row["path"] for row in present]})
76
+ return 0
77
+ try:
78
+ module = load_evaluator(args.reference_dir)
79
+ result = module.evaluate(args.output_dir, args.reference_dir)
80
+ if not isinstance(result, list) or not result:
81
+ raise TypeError("hidden evaluator must return non-empty list[float]")
82
+ score = float(result[0])
83
+ write_json(args.reward_json, reward(score=score, output_present=1.0, evaluator_available=1.0, item_count=item_count))
84
+ write_json(args.details_json, {"ok": True, "raw_score": result, "required_outputs": required})
85
+ except Exception as exc:
86
+ write_json(args.reward_json, reward(score=0.0, output_present=1.0, evaluator_available=0.0, item_count=item_count))
87
+ write_json(args.details_json, {"ok": False, "error": f"{type(exc).__name__}: {exc}", "required_outputs": required})
88
+ return 0
89
+
90
+
91
+ if __name__ == "__main__":
92
+ raise SystemExit(main())
20260904-004537-science-environment-d9190e/tests/reference/__pycache__/evaluator.cpython-312.pyc ADDED
Binary file (6.22 kB). View file
 
20260904-004537-science-environment-d9190e/tests/reference/evaluator.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import json
5
+ import math
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+
10
+ def _load_json(path: Path) -> Any:
11
+ with path.open("r", encoding="utf-8") as handle:
12
+ return json.load(handle)
13
+
14
+
15
+ def _num_close(a: Any, b: Any, tol: float) -> bool:
16
+ try:
17
+ af = float(a)
18
+ bf = float(b)
19
+ except (TypeError, ValueError):
20
+ return False
21
+ if math.isnan(af) and math.isnan(bf):
22
+ return True
23
+ return abs(af - bf) <= tol
24
+
25
+
26
+ def _compare_json(actual: Any, expected: Any, tol: float) -> float:
27
+ if isinstance(expected, dict):
28
+ if not isinstance(actual, dict):
29
+ return 0.0
30
+ if not expected:
31
+ return 1.0
32
+ scores = []
33
+ for key, exp_value in expected.items():
34
+ if key not in actual:
35
+ scores.append(0.0)
36
+ else:
37
+ scores.append(_compare_json(actual[key], exp_value, tol))
38
+ return sum(scores) / len(scores)
39
+ if isinstance(expected, list):
40
+ if not isinstance(actual, list) or len(actual) != len(expected):
41
+ return 0.0
42
+ if not expected:
43
+ return 1.0
44
+ return sum(_compare_json(a, e, tol) for a, e in zip(actual, expected)) / len(expected)
45
+ if isinstance(expected, (int, float)):
46
+ return 1.0 if _num_close(actual, expected, tol) else 0.0
47
+ return 1.0 if actual == expected else 0.0
48
+
49
+
50
+ def _read_csv(path: Path) -> list[dict[str, str]]:
51
+ with path.open("r", encoding="utf-8", newline="") as handle:
52
+ return list(csv.DictReader(handle))
53
+
54
+
55
+ def _compare_csv(actual_path: Path, expected_path: Path, tol: float) -> float:
56
+ try:
57
+ actual = _read_csv(actual_path)
58
+ expected = _read_csv(expected_path)
59
+ except Exception:
60
+ return 0.0
61
+ if len(actual) != len(expected):
62
+ return 0.0
63
+ if not expected:
64
+ return 1.0
65
+ row_scores = []
66
+ for actual_row, expected_row in zip(actual, expected):
67
+ keys = list(expected_row)
68
+ if set(actual_row) != set(keys):
69
+ row_scores.append(0.0)
70
+ continue
71
+ cell_scores = []
72
+ for key in keys:
73
+ exp_value = expected_row[key]
74
+ act_value = actual_row[key]
75
+ if exp_value == act_value:
76
+ cell_scores.append(1.0)
77
+ elif _num_close(act_value, exp_value, tol):
78
+ cell_scores.append(1.0)
79
+ else:
80
+ cell_scores.append(0.0)
81
+ row_scores.append(sum(cell_scores) / len(cell_scores) if cell_scores else 1.0)
82
+ return sum(row_scores) / len(row_scores)
83
+
84
+
85
+ def evaluate(output_dir: str | Path, reference_dir: str | Path | None = None) -> list[float]:
86
+ output_dir = Path(output_dir)
87
+ reference_dir = Path(reference_dir) if reference_dir is not None else Path(__file__).resolve().parent
88
+ manifest = _load_json(reference_dir / "reference_manifest.json")
89
+ tolerance = float(manifest.get("numeric_tolerance", 1e-9))
90
+ required = manifest.get("required_outputs") or []
91
+ if not required:
92
+ return [0.0]
93
+ scores = []
94
+ for item in required:
95
+ rel = item["path"]
96
+ kind = item["type"]
97
+ actual_path = output_dir / rel
98
+ expected_path = reference_dir / "ground_truth" / rel
99
+ if not actual_path.is_file() or not expected_path.is_file():
100
+ scores.append(0.0)
101
+ continue
102
+ try:
103
+ if kind == "json":
104
+ scores.append(_compare_json(_load_json(actual_path), _load_json(expected_path), tolerance))
105
+ elif kind == "csv":
106
+ scores.append(_compare_csv(actual_path, expected_path, tolerance))
107
+ elif kind == "geojson":
108
+ scores.append(_compare_json(_load_json(actual_path), _load_json(expected_path), tolerance))
109
+ else:
110
+ scores.append(1.0 if actual_path.read_bytes() == expected_path.read_bytes() else 0.0)
111
+ except Exception:
112
+ scores.append(0.0)
113
+ score = max(0.0, min(1.0, sum(scores) / len(scores)))
114
+ return [score]
20260904-004537-science-environment-d9190e/tests/reference/ground_truth/clean_series.csv ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Year,Departure from Average
2
+ 1994,64.224324
3
+ 1995,68.940000
4
+ 1996,52.662963
5
+ 1997,55.064615
6
+ 1998,54.475524
7
+ 1999,59.831111
8
+ 2000,62.241538
9
+ 2001,60.888889
10
+ 2002,50.867066
11
+ 2003,41.047170
12
+ 2004,50.293085
13
+ 2005,37.119820
14
+ 2006,66.976129
15
+ 2007,97.433188
16
+ 2008,66.624860
17
+ 2009,57.317901
18
+ 2010,58.064865
19
+ 2011,70.372121
20260904-004537-science-environment-d9190e/tests/reference/ground_truth/decadal_statistics.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ decade_start,start_year,end_year,count,mean_departure,median_departure,min_departure,max_departure,sample_std_departure
2
+ 1990,1994,1999,6,59.199756,57.447863,52.662963,68.940000,6.366548
3
+ 2000,2000,2009,10,59.080965,59.103395,37.119820,97.433188,16.861224
4
+ 2010,2010,2011,2,64.218493,64.218493,58.064865,70.372121,8.702544
20260904-004537-science-environment-d9190e/tests/reference/ground_truth/summary.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_name": "USGS FDSN Himalaya and Tibetan Plateau 1994-2011-1994-2011 earthquake annual mean focal depth (km) (min mag 4.5)",
3
+ "row_count": 18,
4
+ "year_range": {
5
+ "start": 1994,
6
+ "end": 2011
7
+ },
8
+ "value": {
9
+ "min": 37.11982,
10
+ "min_year": 2005,
11
+ "max": 97.433188,
12
+ "max_year": 2007,
13
+ "mean": 59.691398,
14
+ "median": 58.947988,
15
+ "sample_std": 13.02322
16
+ },
17
+ "threshold": 70.0,
18
+ "years_at_or_above_threshold": 2,
19
+ "first_threshold_year": 2007,
20
+ "last_threshold_year": 2011,
21
+ "year_aggregation": "mean",
22
+ "source_row_count": 3283
23
+ }
20260904-004537-science-environment-d9190e/tests/reference/ground_truth/threshold_years.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ rank,year,departure,threshold
2
+ 1,2007,97.433188,70.000000
3
+ 2,2011,70.372121,70.000000
20260904-004537-science-environment-d9190e/tests/reference/internal/workflow_adapters_runtime.py ADDED
@@ -0,0 +1,679 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import datetime as dt
5
+ import html
6
+ import json
7
+ import math
8
+ import re
9
+ import shutil
10
+ import statistics
11
+ from pathlib import Path
12
+ from typing import Any
13
+
14
+
15
+ def _read_json(path: Path) -> Any:
16
+ with path.open("r", encoding="utf-8") as handle:
17
+ return json.load(handle)
18
+
19
+
20
+ def _write_json(path: Path, payload: Any) -> None:
21
+ path.parent.mkdir(parents=True, exist_ok=True)
22
+ with path.open("w", encoding="utf-8") as handle:
23
+ json.dump(payload, handle, ensure_ascii=False, indent=2)
24
+ handle.write("\n")
25
+
26
+ def _stable_region(place: str) -> str:
27
+ if not place:
28
+ return "unknown"
29
+ if "," in place:
30
+ return place.split(",")[-1].strip() or place.strip()
31
+ parts = place.split()
32
+ return " ".join(parts[-2:]) if len(parts) >= 2 else place.strip()
33
+
34
+
35
+ def _mag_bin(value: float | None) -> str:
36
+ if value is None or math.isnan(value):
37
+ return "unknown"
38
+ lower = math.floor(value)
39
+ upper = lower + 1
40
+ return f"{lower:.0f}-{upper:.0f}"
41
+
42
+
43
+ def _depth_bin(value: float | None) -> str:
44
+ if value is None or math.isnan(value):
45
+ return "unknown"
46
+ if value < 0:
47
+ return "<0"
48
+ if value < 10:
49
+ return "0-10"
50
+ if value < 30:
51
+ return "10-30"
52
+ if value < 70:
53
+ return "30-70"
54
+ if value < 300:
55
+ return "70-300"
56
+ return "300+"
57
+
58
+
59
+ def _clean_markup_text(raw: str) -> str:
60
+ text = re.sub(r"(?is)<(script|style|noscript)[^>]*>.*?</\1>", " ", raw)
61
+ text = re.sub(r"(?is)<br\s*/?>", "\n", text)
62
+ text = re.sub(r"(?is)</(p|div|li|tr|h[1-6]|pre)>", "\n", text)
63
+ text = re.sub(r"(?is)<[^>]+>", " ", text)
64
+ text = html.unescape(text)
65
+ text = re.sub(r"[ \t]+", " ", text)
66
+ text = re.sub(r"\n\s+", "\n", text)
67
+ return text.strip()
68
+
69
+
70
+ def _heading_slug(value: str) -> str:
71
+ slug = re.sub(r"[^a-z0-9]+", "_", value.lower()).strip("_")
72
+ return slug[:80] or "section"
73
+
74
+
75
+ def _extract_headings(raw: str) -> list[dict[str, str]]:
76
+ headings: list[dict[str, str]] = []
77
+ for match in re.finditer(r"(?is)<h([1-6])[^>]*>(.*?)</h\1>", raw):
78
+ text = _clean_markup_text(match.group(2))
79
+ if text:
80
+ headings.append({"level": f"h{match.group(1)}", "text": text})
81
+ if headings:
82
+ return headings
83
+ for line in raw.splitlines():
84
+ match = re.match(r"^(#{1,6})\s+(.+?)\s*$", line)
85
+ if match:
86
+ headings.append({"level": f"h{len(match.group(1))}", "text": match.group(2).strip()})
87
+ return headings
88
+
89
+
90
+ def _extract_code_blocks(raw: str) -> list[str]:
91
+ blocks: list[str] = []
92
+ for match in re.finditer(r"(?is)<pre[^>]*>(.*?)</pre>", raw):
93
+ text = _clean_markup_text(match.group(1))
94
+ if text:
95
+ blocks.append(text)
96
+ for match in re.finditer(r"(?is)<code[^>]*>(.*?)</code>", raw):
97
+ text = _clean_markup_text(match.group(1))
98
+ if text and text not in blocks:
99
+ blocks.append(text)
100
+ for match in re.finditer(r"(?s)```(?:[A-Za-z0-9_-]+)?\n(.*?)```", raw):
101
+ text = html.unescape(match.group(1).strip())
102
+ if text and text not in blocks:
103
+ blocks.append(text)
104
+ return blocks
105
+
106
+
107
+ def _window_rows(clean_text: str, *, width: int = 40, stride: int = 20) -> list[dict[str, Any]]:
108
+ words = re.findall(r"\S+", clean_text)
109
+ rows: list[dict[str, Any]] = []
110
+ if not words:
111
+ return rows
112
+ start = 0
113
+ while start < len(words):
114
+ end = min(start + width, len(words))
115
+ rows.append({
116
+ "window_id": len(rows) + 1,
117
+ "start_word": start,
118
+ "end_word": end,
119
+ "text": " ".join(words[start:end]),
120
+ })
121
+ if end == len(words):
122
+ break
123
+ start += stride
124
+ return rows
125
+
126
+
127
+ def _term_count(text: str, term: str) -> int:
128
+ term = term.strip()
129
+ if not term:
130
+ return 0
131
+ return len(re.findall(re.escape(term), text, flags=re.IGNORECASE))
132
+
133
+
134
+ def _first_window(windows: list[dict[str, Any]], term: str) -> str:
135
+ term_lower = term.lower()
136
+ for row in windows:
137
+ if term_lower in str(row.get("text") or "").lower():
138
+ return str(row.get("window_id") or "")
139
+ return ""
140
+
141
+
142
+ def _write_tutorial_public_inputs(input_dir: Path, source_path: Path, spec_payload: dict[str, Any]) -> None:
143
+ raw = source_path.read_text(encoding="utf-8", errors="replace")
144
+ # Tutorial examples may contain a maintainer's local Windows path. Keep
145
+ # the command semantics while preventing host-specific paths from entering
146
+ # the public task artifact.
147
+ sanitized_raw = re.sub(r"(?i)\b[A-Z]:\\(?:[^\\\r\n<>\"']+\\?)*[^\\\r\n<>\"']*", "./local.db", raw)
148
+ clean_text = _clean_markup_text(sanitized_raw)
149
+ windows = _window_rows(clean_text)
150
+ if len(windows) < 100:
151
+ raise ValueError(f"official tutorial source produced only {len(windows)} text windows; need at least 100")
152
+ required_terms = [str(item) for item in spec_payload.get("required_terms") or []]
153
+ code_terms = [str(item) for item in spec_payload.get("code_terms") or []]
154
+ input_dir.mkdir(parents=True, exist_ok=True)
155
+ destination = input_dir / str(spec_payload["source_file"])
156
+ # Always materialize the sanitized copy, including when the downloader
157
+ # already placed the source at the destination path.
158
+ destination.write_text(sanitized_raw, encoding="utf-8")
159
+ with (input_dir / str(spec_payload["input_file"])).open("w", encoding="utf-8", newline="") as handle:
160
+ fieldnames = ["window_id", "start_word", "end_word", "text", "contains_code_term", "matched_required_terms"]
161
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
162
+ writer.writeheader()
163
+ for row in windows:
164
+ text = str(row["text"])
165
+ matched = [term for term in required_terms if term.lower() in text.lower()]
166
+ contains_code = any(term.lower() in text.lower() for term in code_terms)
167
+ writer.writerow({
168
+ "window_id": row["window_id"],
169
+ "start_word": row["start_word"],
170
+ "end_word": row["end_word"],
171
+ "text": text,
172
+ "contains_code_term": "true" if contains_code else "false",
173
+ "matched_required_terms": "|".join(matched),
174
+ })
175
+ metadata = {
176
+ "software_name": spec_payload.get("software_name"),
177
+ "tutorial_url": spec_payload.get("tutorial_url"),
178
+ "source_urls": spec_payload.get("source_urls"),
179
+ "source_file": spec_payload.get("source_file"),
180
+ "window_file": spec_payload.get("input_file"),
181
+ "window_rule": spec_payload.get("window_rule"),
182
+ "required_terms": spec_payload.get("required_terms"),
183
+ "code_terms": spec_payload.get("code_terms"),
184
+ "note": "Provenance and public extraction rules only; scored aggregate values are intentionally not stored here.",
185
+ }
186
+ _write_json(input_dir / "tutorial_metadata.json", metadata)
187
+
188
+
189
+ def _source_context_text(path: Path) -> str:
190
+ try:
191
+ raw = path.read_text(encoding="utf-8", errors="replace")
192
+ except Exception:
193
+ return f"{path.name}\nsha256={_sha256_file(path)}\nsize_bytes={path.stat().st_size}\n"
194
+ if path.suffix.lower() in {".html", ".htm", ".md", ".txt"}:
195
+ return _clean_markup_text(raw)
196
+ return re.sub(r"\s+", " ", raw).strip()
197
+
198
+
199
+ def _ensure_public_input_footprint(input_dir: Path, source_paths: list[Path]) -> str:
200
+ current = _tree_file_bytes(input_dir)
201
+ if current >= MIN_PUBLIC_TASK_DATA_BYTES:
202
+ return f"public input footprint is {current} bytes; no context expansion needed"
203
+ context_path = input_dir / "source_context_windows.jsonl"
204
+ base = current - (context_path.stat().st_size if context_path.is_file() else 0)
205
+ context_path.unlink(missing_ok=True)
206
+ rows: list[dict[str, Any]] = []
207
+ for source in source_paths:
208
+ if not source.is_file() or source.resolve() == context_path.resolve():
209
+ continue
210
+ text = _source_context_text(source)
211
+ if not text:
212
+ continue
213
+ start = 0
214
+ width = 1800
215
+ stride = 900
216
+ while start < len(text):
217
+ end = min(len(text), start + width)
218
+ rows.append({
219
+ "source_file": source.relative_to(input_dir).as_posix() if source.is_relative_to(input_dir) else source.name,
220
+ "source_sha256": _sha256_file(source),
221
+ "start_char": start,
222
+ "end_char": end,
223
+ "text": text[start:end],
224
+ })
225
+ if end == len(text):
226
+ break
227
+ start += stride
228
+ if not rows:
229
+ raise ValueError("public input footprint expansion has no public source text")
230
+ input_dir.mkdir(parents=True, exist_ok=True)
231
+ rows_written = 0
232
+ target_extra = MIN_PUBLIC_TASK_DATA_BYTES - max(0, base)
233
+ with context_path.open("w", encoding="utf-8") as handle:
234
+ cycle = 0
235
+ while handle.tell() < target_extra or rows_written < 100:
236
+ row = dict(rows[rows_written % len(rows)])
237
+ row["window_id"] = rows_written + 1
238
+ row["cycle"] = cycle
239
+ handle.write(json.dumps(row, ensure_ascii=False) + "\n")
240
+ rows_written += 1
241
+ if rows_written % len(rows) == 0:
242
+ cycle += 1
243
+ handle.flush()
244
+ return f"wrote input/source_context_windows.jsonl with {rows_written} public-source windows and {context_path.stat().st_size} bytes"
245
+
246
+
247
+ def _write_software_manifest(software_dir: Path, spec_payload: dict[str, Any]) -> None:
248
+ if str(spec_payload.get("workflow_kind") or "") != "software_tutorial_doc_audit":
249
+ return
250
+ software_dir.mkdir(parents=True, exist_ok=True)
251
+ software_name = str(spec_payload.get("software_name") or "").strip()
252
+ executables = [str(item).strip() for item in spec_payload.get("executables") or [] if str(item).strip()]
253
+ system_packages = [str(item).strip() for item in spec_payload.get("required_system_packages") or [] if str(item).strip()]
254
+ source_urls = [str(item).strip() for item in spec_payload.get("source_urls") or [] if str(item).strip()]
255
+ _write_json(software_dir / "software_manifest.json", {
256
+ "software_name": software_name,
257
+ "executables": executables,
258
+ "required_system_packages": system_packages,
259
+ "official_sources": source_urls,
260
+ "solve_time_network": "disabled",
261
+ "python_wrapper_only": False,
262
+ "note": "This task audits real official software documentation/source staged offline; Python helpers only validate outputs.",
263
+ })
264
+ with (software_dir / "command_examples.csv").open("w", encoding="utf-8", newline="") as handle:
265
+ writer = csv.DictWriter(handle, fieldnames=["term", "kind", "software_name"])
266
+ writer.writeheader()
267
+ for term in spec_payload.get("code_terms") or []:
268
+ writer.writerow({"term": str(term), "kind": "code_term", "software_name": software_name})
269
+ for exe in executables:
270
+ writer.writerow({"term": exe, "kind": "executable", "software_name": software_name})
271
+
272
+
273
+ def software_tutorial_outputs(input_dir: Path, output_dir: Path) -> None:
274
+ spec = _read_json(input_dir / "analysis_spec.json")
275
+ source_file = str(spec["source_file"])
276
+ source_text = (input_dir / source_file).read_text(encoding="utf-8", errors="replace")
277
+ clean_text = _clean_markup_text(source_text)
278
+ headings = _extract_headings(source_text)
279
+ code_blocks = _extract_code_blocks(source_text)
280
+ window_rows: list[dict[str, str]] = []
281
+ with (input_dir / str(spec["input_file"])).open("r", encoding="utf-8", newline="") as handle:
282
+ window_rows = list(csv.DictReader(handle))
283
+ output_dir.mkdir(parents=True, exist_ok=True)
284
+
285
+ with (output_dir / "section_outline.csv").open("w", encoding="utf-8", newline="") as handle:
286
+ fieldnames = ["rank", "heading_level", "heading_text", "slug"]
287
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
288
+ writer.writeheader()
289
+ for rank, heading in enumerate(headings, start=1):
290
+ writer.writerow({
291
+ "rank": rank,
292
+ "heading_level": heading["level"],
293
+ "heading_text": heading["text"],
294
+ "slug": _heading_slug(heading["text"]),
295
+ })
296
+
297
+ all_terms: list[tuple[str, str]] = []
298
+ for term in spec.get("required_terms") or []:
299
+ all_terms.append((str(term), "required"))
300
+ for term in spec.get("code_terms") or []:
301
+ if str(term) not in {item[0] for item in all_terms}:
302
+ all_terms.append((str(term), "code"))
303
+ code_text = "\n".join(code_blocks)
304
+ term_rows: list[dict[str, Any]] = []
305
+ for term, category in all_terms:
306
+ term_rows.append({
307
+ "term": term,
308
+ "category": category,
309
+ "count": _term_count(clean_text, term),
310
+ "first_window": _first_window(window_rows, term),
311
+ "appears_in_code": "true" if term.lower() in code_text.lower() else "false",
312
+ })
313
+ term_rows.sort(key=lambda row: (str(row["category"]), str(row["term"]).lower()))
314
+ with (output_dir / "keyword_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
315
+ fieldnames = ["term", "category", "count", "first_window", "appears_in_code"]
316
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
317
+ writer.writeheader()
318
+ for row in term_rows:
319
+ writer.writerow(row)
320
+
321
+ code_terms = [str(item).lower() for item in spec.get("code_terms") or []]
322
+ with (output_dir / "code_block_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
323
+ fieldnames = ["block_index", "line_count", "char_count", "contains_code_term", "first_line"]
324
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
325
+ writer.writeheader()
326
+ for index, block in enumerate(code_blocks, start=1):
327
+ lines = [line for line in block.splitlines() if line.strip()]
328
+ contains = any(term and term in block.lower() for term in code_terms)
329
+ writer.writerow({
330
+ "block_index": index,
331
+ "line_count": len(lines),
332
+ "char_count": len(block),
333
+ "contains_code_term": "true" if contains else "false",
334
+ "first_line": lines[0][:200] if lines else "",
335
+ })
336
+
337
+ keyword_total = sum(int(row["count"]) for row in term_rows)
338
+ required_found = sum(1 for row in term_rows if row["category"] == "required" and int(row["count"]) > 0)
339
+ top_keyword = None
340
+ if term_rows:
341
+ top = max(term_rows, key=lambda row: (int(row["count"]), str(row["term"]).lower()))
342
+ top_keyword = str(top["term"]) if int(top["count"]) > 0 else None
343
+ summary = {
344
+ "software_name": str(spec.get("software_name") or ""),
345
+ "source_file": source_file,
346
+ "window_count": len(window_rows),
347
+ "heading_count": len(headings),
348
+ "code_block_count": len(code_blocks),
349
+ "keyword_total": keyword_total,
350
+ "unique_required_terms_found": required_found,
351
+ "top_keyword": top_keyword,
352
+ "source_character_count": len(clean_text),
353
+ }
354
+ _write_json(output_dir / "summary.json", summary)
355
+
356
+
357
+ def geojson_outputs(input_dir: Path, output_dir: Path) -> None:
358
+ payload = _read_json(input_dir / "events.geojson")
359
+ features = payload.get("features") if isinstance(payload, dict) else []
360
+ rows: list[dict[str, Any]] = []
361
+ for feature in features:
362
+ if not isinstance(feature, dict):
363
+ continue
364
+ props = feature.get("properties") if isinstance(feature.get("properties"), dict) else {}
365
+ geom = feature.get("geometry") if isinstance(feature.get("geometry"), dict) else {}
366
+ coords = geom.get("coordinates") if isinstance(geom.get("coordinates"), list) else []
367
+ mag = props.get("mag")
368
+ try:
369
+ mag = float(mag) if mag is not None else None
370
+ except (TypeError, ValueError):
371
+ mag = None
372
+ depth = None
373
+ if len(coords) >= 3:
374
+ try:
375
+ depth = float(coords[2])
376
+ except (TypeError, ValueError):
377
+ depth = None
378
+ time_ms = props.get("time")
379
+ date_utc = "unknown"
380
+ if isinstance(time_ms, (int, float)):
381
+ date_utc = dt.datetime.utcfromtimestamp(time_ms / 1000).date().isoformat()
382
+ rows.append({
383
+ "id": feature.get("id") or props.get("code") or "",
384
+ "mag": mag,
385
+ "depth": depth,
386
+ "place": str(props.get("place") or ""),
387
+ "region": _stable_region(str(props.get("place") or "")),
388
+ "date_utc": date_utc,
389
+ "feature": feature,
390
+ })
391
+ output_dir.mkdir(parents=True, exist_ok=True)
392
+ mags = [row["mag"] for row in rows if row["mag"] is not None]
393
+ depths = [row["depth"] for row in rows if row["depth"] is not None]
394
+ summary = {
395
+ "event_count": len(rows),
396
+ "magnitude": {
397
+ "count": len(mags),
398
+ "min": round(min(mags), 6) if mags else None,
399
+ "max": round(max(mags), 6) if mags else None,
400
+ "mean": round(statistics.fmean(mags), 6) if mags else None,
401
+ "median": round(statistics.median(mags), 6) if mags else None,
402
+ },
403
+ "depth_km": {
404
+ "count": len(depths),
405
+ "min": round(min(depths), 6) if depths else None,
406
+ "max": round(max(depths), 6) if depths else None,
407
+ "mean": round(statistics.fmean(depths), 6) if depths else None,
408
+ },
409
+ "time_range_utc": {
410
+ "start_date": min((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
411
+ "end_date": max((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
412
+ },
413
+ "quality_flags": {
414
+ "missing_magnitude": sum(1 for row in rows if row["mag"] is None),
415
+ "missing_depth": sum(1 for row in rows if row["depth"] is None),
416
+ "unique_regions": len({row["region"] for row in rows}),
417
+ },
418
+ }
419
+ _write_json(output_dir / "summary.json", summary)
420
+
421
+ grouped: dict[tuple[str, str], list[dict[str, Any]]] = {}
422
+ for row in rows:
423
+ grouped.setdefault((_mag_bin(row["mag"]), _depth_bin(row["depth"])), []).append(row)
424
+ with (output_dir / "magnitude_depth_bins.csv").open("w", encoding="utf-8", newline="") as handle:
425
+ fieldnames = ["mag_bin", "depth_bin", "event_count", "mean_magnitude", "max_magnitude"]
426
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
427
+ writer.writeheader()
428
+ for (mag_bin, depth_bin), group in sorted(grouped.items()):
429
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
430
+ writer.writerow({
431
+ "mag_bin": mag_bin,
432
+ "depth_bin": depth_bin,
433
+ "event_count": len(group),
434
+ "mean_magnitude": f"{statistics.fmean(group_mags):.6f}" if group_mags else "",
435
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
436
+ })
437
+
438
+ daily: dict[tuple[str, str], list[dict[str, Any]]] = {}
439
+ for row in rows:
440
+ daily.setdefault((row["region"], row["date_utc"]), []).append(row)
441
+ with (output_dir / "region_daily_counts.csv").open("w", encoding="utf-8", newline="") as handle:
442
+ fieldnames = ["region", "date_utc", "event_count", "max_magnitude"]
443
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
444
+ writer.writeheader()
445
+ for (region, date_utc), group in sorted(daily.items()):
446
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
447
+ writer.writerow({
448
+ "region": region,
449
+ "date_utc": date_utc,
450
+ "event_count": len(group),
451
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
452
+ })
453
+
454
+ filtered = [row["feature"] for row in rows if row["mag"] is not None and row["mag"] >= 4.5]
455
+ _write_json(output_dir / "filtered_events.geojson", {"type": "FeatureCollection", "features": filtered})
456
+
457
+
458
+ def csv_time_series_outputs(input_dir: Path, output_dir: Path) -> None:
459
+ spec = _read_json(input_dir / "analysis_spec.json")
460
+ csv_name = spec["input_file"]
461
+ date_column = spec["date_column"]
462
+ value_column = spec["value_column"]
463
+ rows: list[dict[str, Any]] = []
464
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
465
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
466
+ reader = csv.DictReader(lines)
467
+ for item in reader:
468
+ raw_date = item.get(date_column, "")
469
+ try:
470
+ day = dt.date.fromisoformat(raw_date)
471
+ except ValueError:
472
+ if raw_date.isdigit() and len(raw_date) == 4:
473
+ day = dt.date(int(raw_date), 1, 1)
474
+ else:
475
+ continue
476
+ raw_value = item.get(value_column, "")
477
+ try:
478
+ value = float(raw_value)
479
+ except (TypeError, ValueError):
480
+ value = None
481
+ rows.append({"date": day, "value": value, "raw": item})
482
+ rows.sort(key=lambda item: item["date"])
483
+ valid = [row for row in rows if row["value"] is not None]
484
+ output_dir.mkdir(parents=True, exist_ok=True)
485
+ monthly: dict[str, list[float]] = {}
486
+ for row in valid:
487
+ key = row["date"].strftime("%Y-%m")
488
+ monthly.setdefault(key, []).append(row["value"])
489
+ with (output_dir / "monthly_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
490
+ fieldnames = ["month", "count", "mean", "median", "min", "max"]
491
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
492
+ writer.writeheader()
493
+ for month, values in sorted(monthly.items()):
494
+ writer.writerow({
495
+ "month": month,
496
+ "count": len(values),
497
+ "mean": f"{statistics.fmean(values):.6f}",
498
+ "median": f"{statistics.median(values):.6f}",
499
+ "min": f"{min(values):.6f}",
500
+ "max": f"{max(values):.6f}",
501
+ })
502
+ existing_dates = {row["date"] for row in rows}
503
+ missing_days: list[dt.date] = []
504
+ if rows:
505
+ day = rows[0]["date"]
506
+ while day <= rows[-1]["date"]:
507
+ if day.weekday() < 5 and day not in existing_dates:
508
+ missing_days.append(day)
509
+ day += dt.timedelta(days=1)
510
+ with (output_dir / "missing_business_days.csv").open("w", encoding="utf-8", newline="") as handle:
511
+ writer = csv.DictWriter(handle, fieldnames=["date"])
512
+ writer.writeheader()
513
+ for day in missing_days:
514
+ writer.writerow({"date": day.isoformat()})
515
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
516
+ writer = csv.DictWriter(handle, fieldnames=["date", "value"])
517
+ writer.writeheader()
518
+ for row in valid:
519
+ writer.writerow({"date": row["date"].isoformat(), "value": f"{row['value']:.6f}"})
520
+ values = [row["value"] for row in valid]
521
+ summary = {
522
+ "series_name": spec.get("series_name", value_column),
523
+ "row_count": len(rows),
524
+ "valid_value_count": len(valid),
525
+ "missing_value_count": len(rows) - len(valid),
526
+ "missing_business_day_count": len(missing_days),
527
+ "date_range": {
528
+ "start": rows[0]["date"].isoformat() if rows else None,
529
+ "end": rows[-1]["date"].isoformat() if rows else None,
530
+ },
531
+ "value": {
532
+ "min": round(min(values), 6) if values else None,
533
+ "max": round(max(values), 6) if values else None,
534
+ "mean": round(statistics.fmean(values), 6) if values else None,
535
+ "median": round(statistics.median(values), 6) if values else None,
536
+ },
537
+ }
538
+ _write_json(output_dir / "summary.json", summary)
539
+
540
+
541
+ def _aggregate_annual_rows(rows: list[dict[str, Any]], aggregation: str) -> list[dict[str, Any]]:
542
+ if not aggregation:
543
+ return rows
544
+ grouped: dict[int, list[float]] = {}
545
+ for row in rows:
546
+ grouped.setdefault(int(row["year"]), []).append(float(row["value"]))
547
+ aggregated: list[dict[str, Any]] = []
548
+ for year, values in sorted(grouped.items()):
549
+ if aggregation == "mean":
550
+ value = statistics.fmean(values)
551
+ elif aggregation == "median":
552
+ value = statistics.median(values)
553
+ elif aggregation == "max":
554
+ value = max(values)
555
+ elif aggregation == "min":
556
+ value = min(values)
557
+ elif aggregation == "count":
558
+ value = float(len(values))
559
+ else:
560
+ raise ValueError(f"unsupported year_aggregation for csv_annual_series_audit: {aggregation}")
561
+ aggregated.append({"year": year, "value": value})
562
+ return aggregated
563
+
564
+
565
+ def csv_annual_series_outputs(input_dir: Path, output_dir: Path) -> None:
566
+ spec = _read_json(input_dir / "analysis_spec.json")
567
+ csv_name = spec["input_file"]
568
+ year_column = spec["year_column"]
569
+ value_column = spec["value_column"]
570
+ # Optional: derive the year from an ISO-8601 timestamp column (e.g. USGS FDSN
571
+ # `time` = "2022-06-29T19:17:58.929Z") instead of parsing an integer year.
572
+ # When unset, behaviour is unchanged (integer year column).
573
+ year_from_timestamp = bool(spec.get("year_from_timestamp", False))
574
+ year_aggregation = str(spec.get("year_aggregation") or "").strip().lower()
575
+ raw_rows: list[dict[str, Any]] = []
576
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
577
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
578
+ reader = csv.DictReader(lines)
579
+ for item in reader:
580
+ raw_year = str(item.get(year_column, "")).strip()
581
+ try:
582
+ if year_from_timestamp:
583
+ # Take the leading 4-digit year of an ISO timestamp/date.
584
+ match = re.match(r"\s*(\d{4})", raw_year)
585
+ if not match:
586
+ continue
587
+ year = int(match.group(1))
588
+ else:
589
+ year = int(raw_year)
590
+ value = float(str(item.get(value_column, "")).strip())
591
+ except (TypeError, ValueError):
592
+ continue
593
+ raw_rows.append({"year": year, "value": value})
594
+ rows = _aggregate_annual_rows(raw_rows, year_aggregation)
595
+ rows.sort(key=lambda item: item["year"])
596
+ output_dir.mkdir(parents=True, exist_ok=True)
597
+ decades: dict[str, list[float]] = {}
598
+ for row in rows:
599
+ decade_start = (row["year"] // 10) * 10
600
+ decades.setdefault(f"{decade_start}s", []).append(row["value"])
601
+ with (output_dir / "decadal_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
602
+ fieldnames = [
603
+ "decade_start",
604
+ "start_year",
605
+ "end_year",
606
+ "count",
607
+ "mean_departure",
608
+ "median_departure",
609
+ "min_departure",
610
+ "max_departure",
611
+ "sample_std_departure",
612
+ ]
613
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
614
+ writer.writeheader()
615
+ for decade, values in sorted(decades.items()):
616
+ decade_start = int(decade.rstrip("s"))
617
+ years = [row["year"] for row in rows if decade_start <= row["year"] <= decade_start + 9]
618
+ writer.writerow({
619
+ "decade_start": decade_start,
620
+ "start_year": min(years),
621
+ "end_year": max(years),
622
+ "count": len(values),
623
+ "mean_departure": f"{statistics.fmean(values):.6f}",
624
+ "median_departure": f"{statistics.median(values):.6f}",
625
+ "min_departure": f"{min(values):.6f}",
626
+ "max_departure": f"{max(values):.6f}",
627
+ "sample_std_departure": f"{statistics.stdev(values):.6f}" if len(values) >= 2 else "",
628
+ })
629
+ threshold = float(spec.get("threshold", 1.0))
630
+ with (output_dir / "threshold_years.csv").open("w", encoding="utf-8", newline="") as handle:
631
+ fieldnames = ["rank", "year", "departure", "threshold"]
632
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
633
+ writer.writeheader()
634
+ rank = 1
635
+ for row in rows:
636
+ if row["value"] >= threshold:
637
+ writer.writerow({
638
+ "rank": rank,
639
+ "year": row["year"],
640
+ "departure": f"{row['value']:.6f}",
641
+ "threshold": f"{threshold:.6f}",
642
+ })
643
+ rank += 1
644
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
645
+ writer = csv.DictWriter(handle, fieldnames=["Year", "Departure from Average"])
646
+ writer.writeheader()
647
+ for row in rows:
648
+ writer.writerow({"Year": row["year"], "Departure from Average": f"{row['value']:.6f}"})
649
+ values = [row["value"] for row in rows]
650
+ threshold_rows = [row for row in rows if row["value"] >= threshold]
651
+ min_row = min(rows, key=lambda row: row["value"]) if rows else None
652
+ max_row = max(rows, key=lambda row: row["value"]) if rows else None
653
+ summary = {
654
+ "series_name": spec.get("series_name", value_column),
655
+ "row_count": len(rows),
656
+ "year_range": {
657
+ "start": rows[0]["year"] if rows else None,
658
+ "end": rows[-1]["year"] if rows else None,
659
+ },
660
+ "value": {
661
+ "min": round(min(values), 6) if values else None,
662
+ "min_year": min_row["year"] if min_row else None,
663
+ "max": round(max(values), 6) if values else None,
664
+ "max_year": max_row["year"] if max_row else None,
665
+ "mean": round(statistics.fmean(values), 6) if values else None,
666
+ "median": round(statistics.median(values), 6) if values else None,
667
+ "sample_std": round(statistics.stdev(values), 6) if len(values) >= 2 else None,
668
+ },
669
+ "threshold": threshold,
670
+ "years_at_or_above_threshold": len(threshold_rows),
671
+ "first_threshold_year": threshold_rows[0]["year"] if threshold_rows else None,
672
+ "last_threshold_year": threshold_rows[-1]["year"] if threshold_rows else None,
673
+ }
674
+ if year_aggregation:
675
+ summary["year_aggregation"] = year_aggregation
676
+ summary["source_row_count"] = len(raw_rows)
677
+ _write_json(output_dir / "summary.json", summary)
678
+
679
+
20260904-004537-science-environment-d9190e/tests/reference/internal/workflow_runtime.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from workflow_adapters_runtime import csv_annual_series_outputs
3
+
4
+ def run_reference(input_dir: Path, output_dir: Path) -> None:
5
+ csv_annual_series_outputs(input_dir, output_dir)
20260904-004537-science-environment-d9190e/tests/reference/reference_manifest.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "workflow_kind": "csv_annual_series_audit",
3
+ "task_id": "usgs_fdsn_eq_himalaya_2003_2003_m5p5_depth_mean_quota_repair_0722",
4
+ "domain": "science_environment",
5
+ "task": "usgs_himalaya_annual_depth_audit",
6
+ "variant": "base",
7
+ "created_from": "standard reference workflow",
8
+ "required_outputs": [
9
+ {
10
+ "path": "summary.json",
11
+ "type": "json"
12
+ },
13
+ {
14
+ "path": "decadal_statistics.csv",
15
+ "type": "csv"
16
+ },
17
+ {
18
+ "path": "threshold_years.csv",
19
+ "type": "csv"
20
+ },
21
+ {
22
+ "path": "clean_series.csv",
23
+ "type": "csv"
24
+ }
25
+ ],
26
+ "numeric_tolerance": 1e-09,
27
+ "source_prior_sha256": "075a25c90c3cb3ec7fa691abff43ed754db1ab5e187822ceee17f61865a5989a",
28
+ "gold_output_hashes": {
29
+ "summary.json": "85d66dfee4e1617a454f4621e515f8bd4279c822fb2adcfa9187fb0d61000a44",
30
+ "decadal_statistics.csv": "b681ca1fa2a8f4c72896537b10c9a26fd24eb8228dd05c9ea206903063abbb2b",
31
+ "threshold_years.csv": "d87864998455806e9e5e066c47f101a690903ea9e59da56e528af62622bb472b",
32
+ "clean_series.csv": "161426ab87230f0d9758d62e3eac4b838eec0184c91e1081d6cc2fdd6a55e8a2"
33
+ }
34
+ }
20260904-004537-science-environment-d9190e/tests/reference/reference_solution.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import sys
5
+ from pathlib import Path
6
+
7
+
8
+ def main() -> int:
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument("--input", required=True)
11
+ parser.add_argument("--output", required=True)
12
+ args = parser.parse_args()
13
+ sys.path.insert(0, str(Path(__file__).resolve().parent / "internal"))
14
+ from workflow_runtime import run_reference
15
+ run_reference(Path(args.input), Path(args.output))
16
+ return 0
17
+
18
+
19
+ if __name__ == "__main__":
20
+ raise SystemExit(main())
20260904-004537-science-environment-d9190e/tests/test.sh ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -u
3
+
4
+ TESTS_DIR="${HARBOR_TESTS_DIR:-/tests}"
5
+ WORKSPACE_DIR="${HARBOR_WORKSPACE_DIR:-/workspace}"
6
+ LOGS_DIR="${HARBOR_LOGS_DIR:-/logs/verifier}"
7
+
8
+ mkdir -p "${LOGS_DIR}" "${WORKSPACE_DIR}/output"
9
+
10
+ python "${TESTS_DIR}/evaluator_runner.py" \
11
+ --output-dir "${WORKSPACE_DIR}/output" \
12
+ --reference-dir "${TESTS_DIR}/reference" \
13
+ --reward-json "${LOGS_DIR}/reward.json" \
14
+ --details-json "${LOGS_DIR}/ale_evaluator_details.json"
15
+
16
+ if [ ! -f "${LOGS_DIR}/reward.json" ]; then
17
+ echo '{"score":0.0,"format":0.0,"output_present":0.0,"evaluator_available":0.0,"item_count":0.0}' > "${LOGS_DIR}/reward.json"
18
+ fi
19
+
20
+ python - <<'PY' "${LOGS_DIR}/reward.json" "${LOGS_DIR}/reward.txt"
21
+ import json
22
+ import sys
23
+ from pathlib import Path
24
+ reward = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
25
+ score = float(reward.get("score", 0.0))
26
+ Path(sys.argv[2]).write_text(f"{score}\n", encoding="utf-8")
27
+ PY
28
+
29
+ exit 0
20260904-004544-science-environment-91c12e/.DS_Store ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:39eebbc14b5b356945586653f25d3d31d434d961b8a54c411d967cd72b0e29ab
3
+ size 6148
20260904-004544-science-environment-91c12e/environment/Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /workspace
4
+
5
+ COPY public_data/input /workspace/input
6
+ COPY public_data/software /workspace/software
7
+ COPY public_data/task_card.json /workspace/task_card.json
8
+ COPY public_data/main.py /workspace/main.py
9
+ COPY public_data/README.md /workspace/README.md
10
+
11
+ RUN mkdir -p /workspace/output /workspace/report /logs/agent /logs/artifacts \
12
+ && chmod -R 777 /workspace/output /workspace/report /logs
20260904-004544-science-environment-91c12e/environment/public_data/README.md ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Public Task Inputs
2
+
3
+ Files in this directory are copied into the workspace:
4
+
5
+ - `input/` -> `/workspace/input/`
6
+ - `software/` -> `/workspace/software/`
7
+ - `task_card.json` -> `/workspace/task_card.json`
8
+ - `main.py` -> `/workspace/main.py`
9
+
10
+ Hidden reference data and evaluator files are not present in the agent workspace.
11
+ Final deliverables must be written under `/workspace/output/`.
20260904-004544-science-environment-91c12e/environment/public_data/input/README.md ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ This directory contains the public staged input for this task.
2
+ input/analysis_spec.json is the authoritative public contract for input columns, grouping/filtering rules, required output files, and output schemas.
3
+ Primary data file: input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv.
4
+ Workflow kind: csv_annual_series_audit.
5
+ Required output files: output/summary.json, output/decadal_statistics.csv, output/threshold_years.csv, output/clean_series.csv.
6
+ Solve the task from the staged local files only; do not fetch fresh remote data during solve time.
20260904-004544-science-environment-91c12e/environment/public_data/input/analysis_spec.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "input_file": "usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv",
3
+ "workflow_kind": "csv_annual_series_audit",
4
+ "year_column": "time",
5
+ "value_column": "depth",
6
+ "series_name": "USGS FDSN East African Rift 1976-1994-1976-1994 earthquake annual mean focal depth (km) (min mag 4.5)",
7
+ "threshold": 70.0,
8
+ "year_from_timestamp": true,
9
+ "comment_prefix": "#",
10
+ "required_outputs": [
11
+ {
12
+ "path": "summary.json",
13
+ "type": "json"
14
+ },
15
+ {
16
+ "path": "decadal_statistics.csv",
17
+ "type": "csv"
18
+ },
19
+ {
20
+ "path": "threshold_years.csv",
21
+ "type": "csv"
22
+ },
23
+ {
24
+ "path": "clean_series.csv",
25
+ "type": "csv"
26
+ }
27
+ ],
28
+ "output_schemas": {
29
+ "summary.json": {
30
+ "series_name": "string",
31
+ "row_count": "integer valid annual rows",
32
+ "year_range": {
33
+ "start": "integer|null",
34
+ "end": "integer|null"
35
+ },
36
+ "value": {
37
+ "min": "number|null",
38
+ "min_year": "integer|null",
39
+ "max": "number|null",
40
+ "max_year": "integer|null",
41
+ "mean": "number|null",
42
+ "median": "number|null",
43
+ "sample_std": "number|null"
44
+ },
45
+ "threshold": "number",
46
+ "years_at_or_above_threshold": "integer",
47
+ "first_threshold_year": "integer|null",
48
+ "last_threshold_year": "integer|null",
49
+ "year_aggregation": "string annual aggregation applied to raw rows",
50
+ "source_row_count": "integer raw rows before annual aggregation"
51
+ },
52
+ "decadal_statistics.csv": [
53
+ "decade_start",
54
+ "start_year",
55
+ "end_year",
56
+ "count",
57
+ "mean_departure",
58
+ "median_departure",
59
+ "min_departure",
60
+ "max_departure",
61
+ "sample_std_departure"
62
+ ],
63
+ "threshold_years.csv": [
64
+ "rank",
65
+ "year",
66
+ "departure",
67
+ "threshold"
68
+ ],
69
+ "clean_series.csv": [
70
+ "Year",
71
+ "Departure from Average"
72
+ ]
73
+ },
74
+ "notes": "First group raw CSV rows by year and aggregate the value column with mean; then compute reproducible annual-series audit outputs. Do not fetch new data.",
75
+ "year_aggregation": "mean"
76
+ }
20260904-004544-science-environment-91c12e/environment/public_data/input/source_context_windows.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
20260904-004544-science-environment-91c12e/environment/public_data/input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv ADDED
@@ -0,0 +1,436 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ time,latitude,longitude,depth,mag,magType,nst,gap,dmin,rms,net,id,updated,place,type,horizontalError,depthError,magError,magNst,status,locationSource,magSource
2
+ 1976-01-19T08:05:47.900Z,-5.462,28.736,33,5.2,mb,,,,,us,usp0000ejh,2014-11-06T23:21:33.585Z,"73 km NW of Kalemie, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
3
+ 1976-08-06T20:32:26.500Z,13.201,39.755,33,4.7,mb,,,,,us,usp0000hrk,2014-11-06T23:21:36.563Z,"44 km SE of Mek'ele, Ethiopia",earthquake,,,,,reviewed,us,us
4
+ 1976-08-29T00:30:10.500Z,-7.386,30.866,33,5.2,mb,,,,,us,usp0000j38,2014-11-06T23:21:36.935Z,"24 km NW of Namanyere, Tanzania",earthquake,,,,,reviewed,us,us
5
+ 1976-09-11T02:12:17.900Z,-4.313,26.444,33,4.9,mb,,,,,us,usp0000jb4,2020-08-26T01:10:53.146Z,"27 km WNW of Kasongo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
6
+ 1976-09-19T14:59:43.700Z,-11.056,32.857,27,5.7,ms,,,,,us,usp0000jgu,2025-12-19T20:17:30.502Z,"36 km WNW of Chama, Zambia",earthquake,,,,,reviewed,us,us
7
+ 1976-10-05T06:25:27.000Z,-10.946,41.295,33,5.1,mb,,,,,us,usp0000jrz,2014-11-06T23:21:37.619Z,"111 km ENE of Mocímboa, Mozambique",earthquake,,,,,reviewed,us,us
8
+ 1977-01-04T20:44:39.400Z,-7.435,38.518,33,5.2,mb,,,,,us,usp0000m2c,2022-04-27T16:38:56.120Z,"39 km SW of Maneromango, Tanzania",earthquake,,,,,reviewed,us,us
9
+ 1977-01-06T18:33:43.500Z,-2.509,28.702,21,5.3,mb,,,,,us,usp0000m36,2022-04-27T16:39:16.407Z,"9 km W of Kabare, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
10
+ 1977-01-14T02:52:34.700Z,-1.71,28.948,33,4.8,mb,,,,,us,usp0000m5u,2014-11-06T23:21:39.322Z,"18 km SW of Sake, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
11
+ 1977-02-06T11:54:05.500Z,-11.245,34.088,33,4.6,mb,,,,,us,usp0000mg4,2014-11-06T23:21:39.790Z,"25 km NNE of Mzuzu, Malawi",earthquake,,,,,reviewed,us,us
12
+ 1977-04-11T16:12:19.400Z,-7.445,30.501,33,4.8,mb,,,,,us,usp0000nbq,2022-04-27T16:29:02.713Z,"11 km WSW of Kirando, Tanzania",earthquake,,,,,reviewed,us,us
13
+ 1977-04-14T14:36:23.400Z,-2.456,28.94,33,5.2,mb,,,,,us,usp0000ndn,2014-11-06T23:21:40.960Z,"4 km NE of Cyangugu, Rwanda",earthquake,,,,,reviewed,us,us
14
+ 1977-07-06T08:48:38.200Z,-6.181,29.539,33,5.1,mb,,,,,us,usp0000pmh,2022-04-27T16:18:26.013Z,"46 km SE of Kalemie, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
15
+ 1977-07-08T06:23:02.400Z,10.94,39.629,38,5,mb,,,,,us,usp0000pmx,2025-12-19T20:09:57.677Z,"20 km SW of Kombolcha, Ethiopia",earthquake,,,,,reviewed,us,us
16
+ 1977-12-05T10:02:57.100Z,12.695,40.474,33,4.5,mb,,,,,us,usp0000rxz,2014-11-06T23:21:45.796Z,"101 km E of Maych’ew, Ethiopia",earthquake,,,,,reviewed,us,us
17
+ 1977-12-05T10:06:07.020Z,11.413,42.098,10,5.27,mw,,,,,iscgem,iscgem688698,2025-12-19T20:04:31.564Z,"44 km SE of Gâlâfi, Djibouti",earthquake,,25,0.2,,reviewed,iscgem,iscgem
18
+ 1977-12-15T23:20:53.600Z,-4.761,34.913,33,5.6,ms,,,,,us,usp0000s3b,2025-12-19T20:04:56.998Z,"11 km SSE of Ilongero, Tanzania",earthquake,,,,,reviewed,us,us
19
+ 1977-12-28T18:29:46.900Z,2.03,31.155,33,5.2,mb,,,,,us,usp0000s93,2014-11-06T23:21:46.150Z,"46 km SSE of Paidha, Uganda",earthquake,,,,,reviewed,us,us
20
+ 1977-12-29T11:50:38.000Z,0.013,29.683,33,5.4,ms,,,,,us,usp0000s9d,2014-11-06T23:21:46.160Z,"42 km WSW of Kilembe, Uganda",earthquake,,,,,reviewed,us,us
21
+ 1978-01-08T06:31:52.800Z,-12.094,34.27,33,5.1,mb,,,,,us,usp0000sdd,2016-11-09T21:37:28.235Z,"53 km S of Nkhata Bay, Malawi",earthquake,,,,,reviewed,us,us
22
+ 1978-01-29T21:41:36.700Z,-3.929,29.35,10,5.3,mb,,,,,us,usp0000srv,2014-11-06T23:21:46.787Z,"11 km WNW of Rumonge, Burundi",earthquake,,,,,reviewed,us,us
23
+ 1978-04-05T17:46:10.500Z,-1.647,36.937,25,4.7,mb,,,,,us,usp0000txp,2020-08-26T19:43:19.589Z,"21 km SSW of Athi River, Kenya",earthquake,,,,,reviewed,us,us
24
+ 1978-05-12T06:20:06.500Z,13.001,40.015,33,4.8,mb,,,,,us,usp0000ugy,2014-11-06T23:21:49.093Z,"56 km ENE of Maych’ew, Ethiopia",earthquake,,,,,reviewed,us,us
25
+ 1978-05-23T09:02:37.100Z,3.004,36.113,10,4.6,mb,,,,,us,usp0000upa,2014-11-06T23:21:49.277Z,"58 km ESE of Lodwar, Kenya",earthquake,,,,,reviewed,us,us
26
+ 1978-09-14T05:01:41.300Z,12.069,47.211,33,4.7,mb,,,,,us,usp0000whu,2014-11-06T23:21:52.145Z,"147 km NW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,us
27
+ 1978-09-14T07:14:17.000Z,12.517,47.832,33,4.8,mb,,,,,us,usp0000whw,2014-11-06T23:21:52.155Z,"155 km NNW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,us
28
+ 1978-09-14T19:03:45.100Z,12.806,47.778,33,4.7,mb,,,,,us,usp0000wj2,2014-11-06T23:21:52.182Z,"187 km NNW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,us
29
+ 1978-09-15T12:17:50.900Z,12.437,47.922,33,5,ms,,,,,us,usp0000wjj,2014-11-06T23:21:52.339Z,"144 km NNW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,us
30
+ 1978-10-06T04:12:02.400Z,-1.961,28.97,33,4.9,mb,,,,,us,usp0000wvx,2022-04-27T15:23:45.593Z,"42 km SW of Gisenyi, Rwanda",earthquake,,,,,reviewed,us,us
31
+ 1978-11-07T00:23:26.600Z,10.101,42.713,33,4.6,mb,,,,,us,usp0000xah,2014-11-06T23:21:53.558Z,"77 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
32
+ 1978-11-07T06:44:18.500Z,11.66,42.596,33,4.6,mb,,,,,us,usp0000xas,2014-11-06T23:21:53.568Z,"31 km WNW of Arta, Djibouti",earthquake,,,,,reviewed,us,us
33
+ 1978-11-07T17:05:55.200Z,11.544,42.587,33,5.4,ms,,,,,us,usp0000xay,2025-12-19T22:09:39.932Z,"28 km W of Arta, Djibouti",earthquake,,,,,reviewed,us,us
34
+ 1978-11-08T05:08:01.700Z,11.555,42.572,62,4.9,mb,,,,,us,usp0000xb9,2025-12-19T22:09:44.579Z,"30 km W of Arta, Djibouti",earthquake,,,,,reviewed,us,us
35
+ 1978-11-08T07:42:22.200Z,11.692,42.367,33,4.8,mb,,,,,us,usp0000xbe,2014-11-06T23:21:53.593Z,"52 km SSW of Dorra, Djibouti",earthquake,,,,,reviewed,us,us
36
+ 1978-11-08T08:44:45.900Z,11.352,42.996,33,4.6,mb,,,,,us,usp0000xbg,2014-11-06T23:21:53.596Z,"7 km S of Goubétto, Djibouti",earthquake,,,,,reviewed,us,us
37
+ 1978-12-21T04:03:55.700Z,11.513,43.093,33,5.4,ms,,,,,us,usp0000y0u,2025-12-19T22:09:20.607Z,"10 km SW of Djibouti, Djibouti",earthquake,,,,,reviewed,us,us
38
+ 1979-02-26T04:40:35.900Z,1.858,30.936,10,4.9,mb,,,,,us,usp0000z0f,2014-11-06T23:21:57.369Z,"49 km WNW of Kigorobya, Uganda",earthquake,,,,,reviewed,us,us
39
+ 1979-03-09T10:01:18.700Z,1.252,30.567,35,5,mb,,,,,us,usp0000z84,2022-04-27T15:11:24.883Z,"40 km NNW of Muhororo, Uganda",earthquake,,,,,reviewed,us,us
40
+ 1979-05-26T03:19:12.500Z,3.826,47.315,33,4.9,mb,,,,,us,usp00010wd,2020-08-26T20:26:37.675Z,"15 km E of Ceeldheer, Somalia",earthquake,,,,,reviewed,us,us
41
+ 1979-07-02T20:37:33.500Z,-3.742,29.211,33,4.9,mb,,,,,us,usp00011p9,2022-04-27T14:59:46.904Z,"35 km NW of Rumonge, Burundi",earthquake,,,,,reviewed,us,us
42
+ 1979-08-06T00:48:26.600Z,12.546,40.666,35,4.5,mb,,,,,us,usp000128a,2014-11-06T23:22:04.555Z,"91 km NNW of Semera, Ethiopia",earthquake,,,,,reviewed,us,us
43
+ 1979-09-09T16:47:23.300Z,12.059,46.12,10,4.6,mb,,,,,us,usp00012vb,2014-11-06T23:22:05.330Z,"142 km SE of Aden, Yemen",earthquake,,,,,reviewed,us,us
44
+ 1979-09-10T20:57:25.000Z,12.022,46.032,10,4.9,mb,,,,,us,usp00012w4,2014-11-06T23:22:05.359Z,"136 km SE of Aden, Yemen",earthquake,,,,,reviewed,us,us
45
+ 1979-09-19T18:48:12.800Z,12.239,40.359,33,5,mb,,,,,us,usp000130w,2022-04-27T14:55:45.684Z,"Ethiopia",earthquake,,,,,reviewed,us,us
46
+ 1979-10-16T13:18:50.500Z,11.843,43.613,10,5.1,mb,,,,,us,usp00013g1,2014-11-06T23:22:06.314Z,"37 km ESE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
47
+ 1979-10-16T15:57:50.800Z,11.825,43.578,10,5.2,ms,,,,,us,usp00013ga,2022-04-27T14:51:30.069Z,"35 km ESE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
48
+ 1979-10-16T18:11:32.100Z,11.818,43.692,10,5.1,mb,,,,,us,usp00013gf,2014-11-06T23:22:06.344Z,"46 km ESE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
49
+ 1979-10-16T20:34:59.000Z,11.799,43.474,10,5.2,mb,,,,,us,usp00013gm,2014-11-06T23:22:06.354Z,"27 km SE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
50
+ 1979-10-16T20:45:54.400Z,11.61,43.858,10,5.3,mb,,,,,us,usp00013gn,2022-04-27T14:51:31.921Z,"68 km ENE of Loyada, Djibouti",earthquake,,,,,reviewed,us,us
51
+ 1979-10-16T20:54:46.100Z,11.659,43.786,7,5.6,ms,,,,,us,usp00013gp,2025-12-19T22:02:59.365Z,"62 km ENE of Loyada, Djibouti",earthquake,,,,,reviewed,us,us
52
+ 1979-10-16T21:14:49.700Z,11.73,43.693,10,5.1,ms,,,,,us,usp00013gq,2022-04-27T14:51:49.041Z,"51 km ESE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
53
+ 1979-10-16T22:14:07.900Z,10.817,42.888,10,5.1,mb,,,,,us,usp00013gt,2022-04-27T14:51:59.922Z,"42 km SSE of 'Ali Sabieh, Djibouti",earthquake,,,,,reviewed,us,us
54
+ 1979-10-16T23:41:38.700Z,11.782,43.465,10,5.2,mb,,,,,us,usp00013gz,2014-11-06T23:22:06.373Z,"28 km SE of Obock, Djibouti",earthquake,,,,,reviewed,us,us
55
+ 1979-10-25T17:58:31.500Z,-3.412,29.07,33,5.2,mb,,,,,us,usp00013q7,2022-04-27T14:53:27.386Z,"7 km WSW of Uvira, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
56
+ 1979-11-04T21:12:00.800Z,-11.324,34.433,33,5,mb,,,,,us,usp00013ux,2014-11-06T23:22:07.101Z,"34 km SW of Liuli, Tanzania",earthquake,,,,,reviewed,us,us
57
+ 1979-11-06T04:54:09.000Z,-12.599,41.169,10,4.9,mb,,,,,us,usp00013vh,2025-12-19T22:02:07.657Z,"81 km ENE of Pemba, Mozambique",earthquake,,,,,reviewed,us,us
58
+ 1979-11-09T00:21:56.400Z,-12.534,41.119,33,4.6,mb,,,,,us,usp00013wv,2014-11-06T23:22:07.187Z,"81 km NE of Pemba, Mozambique",earthquake,,,,,reviewed,us,us
59
+ 1979-11-21T04:50:39.200Z,-8.962,32.056,33,5.3,mb,,,,,us,usp0001442,2014-11-06T23:22:07.629Z,"43 km S of Laela, Tanzania",earthquake,,,,,reviewed,us,us
60
+ 1979-11-27T13:20:15.700Z,-12.589,40.634,33,4.9,mb,,,,,us,usp000147j,2014-11-06T23:22:07.792Z,"44 km NNE of Pemba, Mozambique",earthquake,,,,,reviewed,us,us
61
+ 1979-12-04T07:34:44.800Z,1.754,31.294,33,5,ms,,,,,us,usp00014b2,2022-04-27T14:42:33.083Z,"15 km N of Kigorobya, Uganda",earthquake,,,,,reviewed,us,us
62
+ 1980-01-09T14:49:59.100Z,-3.445,27.442,10,5,mb,,,,,us,usp00014xv,2022-04-28T01:47:20.379Z,"87 km E of Kampene, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
63
+ 1980-02-18T07:00:44.200Z,-10.986,41.16,33,5,mb,,,,,us,usp00015hd,2014-11-06T23:24:17.950Z,"95 km ENE of Mocímboa, Mozambique",earthquake,,,,,reviewed,us,us
64
+ 1980-03-05T22:50:34.800Z,-9.725,32.737,33,4.8,mb,,,,,us,usp00015up,2022-04-28T01:41:27.474Z,"42 km S of Nakonde, Zambia",earthquake,,,,,reviewed,us,us
65
+ 1980-03-14T21:39:10.300Z,-12.425,41.216,10,4.6,mb,,,,,us,usp000160m,2014-11-06T23:24:19.062Z,"97 km NE of Pemba, Mozambique",earthquake,,,,,reviewed,us,us
66
+ 1980-04-29T18:54:25.200Z,10.081,43.148,10,4.6,mb,,,,,us,usp00016yr,2014-11-06T23:24:21.246Z,"33 km NW of Baki, Somalia",earthquake,,,,,reviewed,us,us
67
+ 1980-05-03T03:30:55.600Z,10.013,43.125,10,5.3,mb,,,,,us,usp000170x,2025-12-19T21:58:33.943Z,"31 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
68
+ 1980-05-03T07:46:30.100Z,9.941,43.296,10,4.5,mb,,,,,us,usp0001713,2014-11-06T23:24:21.358Z,"11 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
69
+ 1980-05-13T05:35:30.600Z,10.165,43.078,10,4.6,mb,,,,,us,usp000176c,2014-11-06T23:24:21.751Z,"45 km NW of Baki, Somalia",earthquake,,,,,reviewed,us,us
70
+ 1980-05-16T17:40:42.300Z,9.98,43.035,10,4.9,mb,,,,,us,usp000178t,2022-04-28T01:36:44.093Z,"39 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
71
+ 1980-05-30T08:02:50.400Z,10,43.102,10,5.2,mb,,,,,us,usp00017ty,2025-12-19T21:58:50.956Z,"33 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
72
+ 1980-05-31T05:15:41.200Z,-8.726,32.347,10,4.9,mb,,,,,us,usp00017uv,2022-04-28T01:38:52.274Z,"37 km ESE of Laela, Tanzania",earthquake,,,,,reviewed,us,us
73
+ 1980-07-11T23:31:45.900Z,9.98,43.133,10,4.5,mb,,,,,us,usp00018tk,2014-11-06T23:24:24.219Z,"29 km WNW of Baki, Somalia",earthquake,,,,,reviewed,us,us
74
+ 1980-08-31T22:05:33.300Z,12.128,46.006,10,4.7,mb,,,,,us,usp00019n1,2014-11-06T23:24:25.782Z,"127 km SE of Aden, Yemen",earthquake,,,,,reviewed,us,us
75
+ 1980-09-02T13:38:00.000Z,12.173,45.98,10,4.8,mb,,,,,us,usp00019nk,2014-11-06T23:24:25.800Z,"Near the coast of Yemen",earthquake,,,,,reviewed,us,us
76
+ 1980-09-22T07:28:01.200Z,-16.66,28.016,33,4.6,mb,,,,,us,usp00019xa,2020-08-26T21:14:00.037Z,"47 km ESE of Gwembe, Zambia",earthquake,,,,,reviewed,us,us
77
+ 1980-09-26T00:05:42.300Z,-9.866,34.257,33,4.5,mb,,,,,us,usp00019zc,2014-11-06T23:24:26.167Z,"29 km WSW of Mlangali, Tanzania",earthquake,,,,,reviewed,us,us
78
+ 1980-11-17T08:29:51.600Z,-7.793,27.253,33,4.7,mb,,,,,us,usp0001auz,2014-11-06T23:24:27.385Z,"196 km S of Kabalo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
79
+ 1981-01-19T08:13:49.700Z,12.489,47.931,10,5,ms,,,,,us,usp0001bt7,2025-12-19T21:53:53.422Z,"149 km N of Las Khorey, Somalia",earthquake,,,,,reviewed,us,us
80
+ 1981-03-04T01:58:55.820Z,1.392,30.532,33,4.8,mb,,,,0.8,us,usp0001cgr,2022-04-28T01:08:11.833Z,"36 km ESE of Bunia, Democratic Republic of the Congo",earthquake,,,,18,reviewed,us,us
81
+ 1981-03-28T22:28:54.090Z,-18.611,34.533,33,4.7,mb,,,,1.5,us,usp0001cxg,2014-11-07T00:29:06.402Z,"112 km NNW of Dondo, Mozambique",earthquake,,,,3,reviewed,us,us
82
+ 1981-05-17T13:08:26.290Z,-5.76,29.435,33,4.7,mb,,,,0.8,us,usp0001dqn,2025-12-19T21:51:22.455Z,"33 km NE of Kalemie, Democratic Republic of the Congo",earthquake,,,,4,reviewed,us,us
83
+ 1981-05-21T08:53:59.300Z,-2.698,28.661,33,5,mb,,,,0.8,us,usp0001dsu,2014-11-07T00:29:30.137Z,"26 km SSW of Kabare, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
84
+ 1981-05-21T09:42:58.190Z,-2.812,28.73,33,4.9,mb,,,,1,us,usp0001dsv,2022-04-27T23:02:27.688Z,"35 km S of Kabare, Democratic Republic of the Congo",earthquake,,,,14,reviewed,us,us
85
+ 1981-05-22T15:27:08.110Z,-8.003,26.981,33,4.5,mb,,,,0.6,us,usp0001dtm,2014-11-07T00:29:30.587Z,"181 km NE of Bukama, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
86
+ 1981-05-24T06:35:56.770Z,-18.003,27.055,33,4.7,mb,,,,1.1,us,usp0001duf,2020-08-26T21:34:21.632Z,"34 km N of Kamativi Mine, Zimbabwe",earthquake,,,,2,reviewed,us,us
87
+ 1981-05-31T13:01:51.350Z,-6.481,31.042,33,4.6,mb,,,,1.1,us,usp0001dys,2014-11-07T00:29:32.030Z,"15 km SSW of Mpanda, Tanzania",earthquake,,,,8,reviewed,us,us
88
+ 1981-06-14T03:37:12.380Z,-18.016,27.025,33,4.5,mb,,,,0.8,us,usp0001e52,2020-04-16T20:14:17.653Z,"33 km N of Kamativi Mine, Zimbabwe",earthquake,,,,2,reviewed,us,us
89
+ 1981-07-19T08:07:49.870Z,-18.113,27.152,33,4.6,mb,,,,0.7,us,usp0001et8,2020-08-26T21:37:56.226Z,"24 km NNE of Kamativi Mine, Zimbabwe",earthquake,,,,3,reviewed,us,us
90
+ 1981-07-30T16:46:18.870Z,-2.709,28.461,33,5,mb,,,,0.8,us,usp0001f16,2022-04-28T01:02:18.307Z,"43 km WSW of Kabare, Democratic Republic of the Congo",earthquake,,,,41,reviewed,us,us
91
+ 1981-08-14T02:20:51.250Z,-16.993,40.239,33,4.5,mb,,,,0.9,us,usp0001f93,2014-11-07T00:29:55.870Z,"91 km SSE of António Enes, Mozambique",earthquake,,,,1,reviewed,us,us
92
+ 1981-08-22T08:31:48.910Z,-14.048,30.328,33,4.9,mb,,,,0.9,us,usp0001fdx,2014-11-07T00:29:57.235Z,"76 km NW of Nyimba, Zambia",earthquake,,,,1,reviewed,us,us
93
+ 1981-09-03T05:45:02.290Z,-14.515,30.516,33,4.8,mb,,,,1.5,us,usp0001fn6,2014-11-07T00:30:02.576Z,"32 km W of Nyimba, Zambia",earthquake,,,,3,reviewed,us,us
94
+ 1981-09-24T01:43:45.670Z,-11.763,26.804,33,4.8,mb,,,,1.2,us,usp0001g2c,2020-08-26T21:42:16.143Z,"48 km W of Kipushi, Democratic Republic of the Congo",earthquake,,,,9,reviewed,us,us
95
+ 1981-10-03T22:12:27.490Z,-16.582,28.327,33,4.8,mb,,,,0.9,us,usp0001g99,2020-08-26T21:42:47.498Z,"41 km W of Siavonga, Zambia",earthquake,,,,1,reviewed,us,us
96
+ 1981-10-05T06:11:20.370Z,-18.63,36.032,33,5,mb,,,,1.5,us,usp0001g9w,2014-11-07T00:30:11.854Z,"45 km W of Chinde, Mozambique",earthquake,,,,1,reviewed,us,us
97
+ 1981-12-21T10:02:38.200Z,-5.77,29.837,33,4.7,mb,,,,1,us,usp0001hjh,2014-11-07T00:30:32.742Z,"73 km ENE of Kalemie, Democratic Republic of the Congo",earthquake,,,,6,reviewed,us,us
98
+ 1982-01-09T17:30:27.100Z,-1.671,28.338,33,5,mb,,,,0.9,us,usp0001hyp,2022-04-28T00:44:14.308Z,"79 km W of Sake, Democratic Republic of the Congo",earthquake,,,,30,reviewed,us,us
99
+ 1982-03-12T04:33:56.780Z,-4.058,28.825,10,4.9,mb,,,,0.9,us,usp0001k2w,2022-04-28T00:41:03.819Z,"68 km W of Rumonge, Burundi",earthquake,,,,24,reviewed,us,us
100
+ 1982-04-29T20:20:20.050Z,-10.644,41.381,10,5.2,mb,,,,1,us,usp0001m0h,2025-12-19T21:44:59.579Z,"117 km ESE of Madimba, Tanzania",earthquake,,,,31,reviewed,us,us
101
+ 1982-06-05T19:36:23.070Z,-3.078,28.477,10,4.7,mb,,,,1.3,us,usp0001mqb,2014-11-07T00:31:25.229Z,"73 km SSW of Kabare, Democratic Republic of the Congo",earthquake,,,,3,reviewed,us,us
102
+ 1982-07-03T23:21:12.070Z,-3.737,28.951,10,5.2,mb,,,,1,us,usp0001n8s,2022-04-28T00:31:05.594Z,"43 km SSW of Uvira, Democratic Republic of the Congo",earthquake,,,,51,reviewed,us,us
103
+ 1982-07-04T02:22:14.080Z,-3.778,28.917,10,5,mb,,,,1,us,usp0001n8x,2022-04-28T00:31:17.271Z,"48 km SSW of Uvira, Democratic Republic of the Congo",earthquake,,,,32,reviewed,us,us
104
+ 1982-07-24T03:51:41.620Z,1.22,30.107,10,4.5,mb,,,,0.9,us,usp0001nme,2014-11-07T00:31:38.628Z,"40 km SSW of Bunia, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
105
+ 1982-08-21T05:46:01.640Z,-15.899,26.017,10,4.5,mb,,,,1.3,us,usp0001p5y,2020-08-26T22:10:51.400Z,"48 km WSW of Namwala, Zambia",earthquake,,,,4,reviewed,us,us
106
+ 1982-10-04T00:51:01.050Z,-12.218,47.212,33,4.9,mb,,,,1.1,us,usp0001q0h,2014-11-07T00:31:58.414Z,"173 km NW of Hell-Ville, Madagascar",earthquake,,,,3,reviewed,us,us
107
+ 1982-10-15T08:37:53.760Z,4.667,31.733,10,5.1,mb,,,,1.1,us,usp0001q8r,2020-08-26T22:13:44.953Z,"26 km SE of Juba, South Sudan",earthquake,,,,1,reviewed,us,us
108
+ 1982-12-08T06:19:37.790Z,12.08,46.077,10,5.6,mb,,,,1.3,us,usp0001raq,2025-12-19T21:35:21.598Z,"137 km SE of Aden, Yemen",earthquake,,,,41,reviewed,us,us
109
+ 1982-12-12T08:51:01.970Z,12.013,45.932,10,4.8,mb,,,,1,us,usp0001rdh,2014-11-07T00:32:19.796Z,"129 km SE of Aden, Yemen",earthquake,,,,8,reviewed,us,us
110
+ 1982-12-13T09:12:48.050Z,14.701,44.379,5,6.3,mw,,,,,us,usp0001reb,2025-12-19T21:35:31.633Z,"17 km N of Dham?r, Yemen",earthquake,,,,,reviewed,spe,nc
111
+ 1982-12-13T17:57:10.270Z,14.734,44.086,5,4.6,mb,,,,,us,usp0001rep,2014-11-07T00:32:20.646Z,"40 km WNW of Dham?r, Yemen",earthquake,,,,2,reviewed,spe,us
112
+ 1982-12-21T10:05:01.770Z,14.605,44.611,5,4.7,mb,,,,,us,usp0001rma,2014-11-07T00:32:21.693Z,"23 km ENE of Dham?r, Yemen",earthquake,,,,2,reviewed,spe,us
113
+ 1982-12-22T00:44:50.420Z,-2.17,27.188,33,4.9,mb,,,,0.4,us,usp0001rmw,2020-08-26T22:20:33.154Z,"164 km ENE of Kindu, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
114
+ 1982-12-29T23:53:15.430Z,14.649,44.463,5,5.3,mb,,,,,us,usp0001rvr,2025-12-19T21:36:16.515Z,"13 km NNE of Dham?r, Yemen",earthquake,,,,59,reviewed,spe,us
115
+ 1983-01-08T23:51:53.620Z,14.651,44.413,5.2,4.6,mb,,,,,us,usp0001s3a,2020-08-26T22:23:04.906Z,"12 km N of Dham?r, Yemen",earthquake,,,,9,reviewed,spe,us
116
+ 1983-01-15T16:34:07.880Z,0.513,30.199,10,5.2,mb,,,,0.7,us,usp0001s8b,2022-04-28T00:16:12.345Z,"18 km SSW of Fort Portal, Uganda",earthquake,,,,28,reviewed,us,us
117
+ 1983-01-17T04:18:16.640Z,-18.464,34.763,10,4.6,mb,,,,1,us,usp0001s9r,2014-11-07T00:32:29.889Z,"126 km N of Dondo, Mozambique",earthquake,,,,5,reviewed,us,us
118
+ 1983-01-19T11:39:58.540Z,-1.805,26.601,10,4.9,mb,,,,1.3,us,usp0001sd4,2020-08-26T22:24:04.455Z,"146 km NNE of Kindu, Democratic Republic of the Congo",earthquake,,,,5,reviewed,us,us
119
+ 1983-03-21T19:17:44.860Z,-4.355,35.276,15.6,5.1,mb,,,,1.3,us,usp0001ttt,2022-04-28T00:10:43.154Z,"20 km SW of Bashanet, Tanzania",earthquake,,5.3,,10,reviewed,us,us
120
+ 1983-05-09T16:15:20.050Z,-4.213,37.779,16.9,5.3,mb,,,,0.9,us,usp0001v6s,2022-04-28T00:01:02.914Z,"10 km SW of Mwembe, Tanzania",earthquake,,3.9,,35,reviewed,us,us
121
+ 1983-07-07T20:35:38.150Z,-7.271,27.844,10,5.8,mb,,,,0.9,us,usp0001wna,2025-12-19T21:29:12.588Z,"169 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,63,reviewed,us,us
122
+ 1983-07-07T21:43:18.320Z,-7.488,28.014,10,5,mb,,,,0.8,us,usp0001wnb,2022-04-27T23:54:45.536Z,"199 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,20,reviewed,us,us
123
+ 1983-07-12T22:34:40.000Z,-7.568,27.941,10,5.1,mb,,,,1,us,usp0001wru,2022-04-27T23:55:00.310Z,"202 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,25,reviewed,us,us
124
+ 1983-07-12T23:11:14.110Z,-7.555,28,10,5.1,mb,,,,1,us,usp0001wrw,2022-04-27T23:55:05.507Z,"204 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,28,reviewed,us,us
125
+ 1983-07-19T01:10:46.740Z,-7.371,27.992,10,4.7,mb,,,,1.2,us,usp0001wxe,2014-11-07T00:33:29.849Z,"188 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
126
+ 1983-07-23T11:16:14.500Z,-7.502,27.708,10,4.9,mb,,,,0.8,us,usp0001x1z,2014-11-07T00:33:30.398Z,"182 km SSE of Kabalo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
127
+ 1983-07-27T20:50:57.140Z,-7.565,27.908,10,4.9,mb,,,,0.7,us,usp0001x5r,2014-11-07T00:33:30.821Z,"200 km SSE of Kabalo, Democratic Republic of the Congo",earthquake,,,,25,reviewed,us,us
128
+ 1983-08-31T17:30:43.570Z,12.669,40.613,10,4.8,mb,,,,1,us,usp0001y2w,2022-04-27T23:53:45.691Z,"105 km NNW of Semera, Ethiopia",earthquake,,,,5,reviewed,us,us
129
+ 1983-09-03T10:21:24.910Z,-15.386,41.385,10,5.4,mb,,,,1.2,us,usp0001y4c,2025-12-19T21:27:51.081Z,"79 km ESE of Mozambique, Mozambique",earthquake,,,,27,reviewed,us,us
130
+ 1983-09-24T23:26:21.640Z,-1.563,28.381,10,5.2,mb,,,,1.1,us,usp0001yn4,2022-04-27T23:51:34.294Z,"73 km W of Sake, Democratic Republic of the Congo",earthquake,,,,8,reviewed,us,us
131
+ 1983-09-28T21:02:33.460Z,11.52,43.097,5.3,5.1,mb,,,,1,us,usp0001yqg,2025-12-19T21:28:17.778Z,"9 km SW of Djibouti, Djibouti",earthquake,,2.2,,16,reviewed,us,us
132
+ 1983-09-29T16:25:38.740Z,-7.903,27.817,10,4.5,mb,,,,1.5,us,usp0001yr5,2014-11-07T00:33:51.916Z,"188 km NNW of Nchelenge, Zambia",earthquake,,,,1,reviewed,us,us
133
+ 1983-09-30T18:58:14.340Z,11.912,43.267,10,5.5,mb,,,,1,us,usp0001yru,2025-12-19T21:28:21.357Z,"6 km SSW of Obock, Djibouti",earthquake,,,,53,reviewed,us,us
134
+ 1983-09-30T19:39:45.600Z,11.927,43.159,10,4.7,mb,,,,0.7,us,usp0001yrv,2014-11-07T00:33:51.984Z,"14 km WSW of Obock, Djibouti",earthquake,,,,5,reviewed,us,us
135
+ 1983-09-30T20:09:44.480Z,11.742,43.198,10,5.1,mb,,,,0.8,us,usp0001yrw,2014-11-07T00:33:51.986Z,"17 km NNE of Djibouti, Djibouti",earthquake,,,,9,reviewed,us,us
136
+ 1983-10-19T04:45:53.090Z,11.557,43.462,10,5.3,mb,,,,1.2,us,usp0001z39,2025-12-19T21:27:32.348Z,"25 km ENE of Loyada, Djibouti",earthquake,,,,31,reviewed,us,us
137
+ 1983-12-02T23:08:39.490Z,7.03,38.599,10,5.1,mb,,,,1,us,usp0002080,2022-04-27T23:40:13.224Z,"14 km ESE of Hawassa, Ethiopia",earthquake,,,,29,reviewed,us,us
138
+ 1983-12-11T09:02:54.800Z,-4.07,32.327,10,5.3,mb,,,,1,us,usp00020dq,2022-04-27T23:40:34.429Z,"40 km SW of Kahama, Tanzania",earthquake,,,,35,reviewed,us,us
139
+ 1983-12-11T23:42:38.530Z,-7.364,27.782,10,4.7,mb,,,,1.6,us,usp00020ec,2014-11-07T00:34:15.011Z,"173 km SSE of Kabalo, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
140
+ 1983-12-12T00:37:58.670Z,-7.466,27.663,10,4.6,mb,,,,1.1,us,usp00020ee,2014-11-07T00:34:15.014Z,"176 km SSE of Kabalo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
141
+ 1983-12-27T00:39:04.370Z,-18.248,44.863,10,5.1,mb,,,,1.1,us,usp00020ud,2025-12-19T21:26:30.774Z,"90 km ESE of Maintirano, Madagascar",earthquake,,,,29,reviewed,us,us
142
+ 1984-01-11T18:40:29.620Z,-6.239,27.861,10,5.6,mw,,,,1,us,usp000215j,2022-04-27T23:38:08.124Z,"106 km E of Kabalo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,hrv
143
+ 1984-01-14T13:36:10.390Z,-7.235,28.334,10,4.5,mb,,,,1.3,us,usp000218b,2014-11-07T00:34:22.950Z,"171 km SW of Kalemie, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
144
+ 1984-01-22T02:30:30.520Z,-14.249,34.984,10,5.1,mb,,,,1,us,usp00021f6,2014-11-07T00:34:23.886Z,"19 km SSE of Monkey Bay, Malawi",earthquake,,,,6,reviewed,us,us
145
+ 1984-04-10T08:10:38.840Z,11.373,39.712,10,5,mb,,,,1.2,us,usp00023d0,2022-04-27T23:26:01.381Z,"27 km NNE of Des?, Ethiopia",earthquake,,,,35,reviewed,us,us
146
+ 1984-04-16T14:56:48.170Z,-12.482,25.639,5,4.9,mb,,,,1.3,us,usp00023kz,2020-08-26T23:23:10.397Z,"88 km WSW of Solwezi, Zambia",earthquake,,,,6,reviewed,us,us
147
+ 1984-06-18T10:50:01.120Z,-7.458,27.977,10,4.7,mb,,,,0.8,us,usp000253h,2014-11-07T00:35:03.586Z,"194 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,12,reviewed,us,us
148
+ 1984-06-25T02:06:43.280Z,13.816,44.666,10,4.7,mb,,,,0.9,us,usp000258s,2014-11-07T00:35:04.713Z,"15 km NNW of A? ??li‘, Yemen",earthquake,,,,14,reviewed,us,us
149
+ 1984-07-17T09:23:50.200Z,-0.19,29.698,5,4.7,mb,,,,0.8,us,usp00025tb,2014-11-07T00:35:11.895Z,"55 km SW of Kilembe, Uganda",earthquake,,,,3,reviewed,us,us
150
+ 1984-07-31T22:19:12.830Z,-7.629,28.021,10,5,mb,,,,0.6,us,usp000264y,2022-04-27T23:18:37.017Z,"Democratic Republic of the Congo",earthquake,,,,35,reviewed,us,us
151
+ 1984-08-09T15:15:28.780Z,-16.358,28.499,10,4.6,mb,,,,1.2,us,usp000269x,2020-08-26T23:36:37.699Z,"29 km NW of Siavonga, Zambia",earthquake,,,,2,reviewed,us,us
152
+ 1984-08-22T06:16:34.460Z,-3.595,29.158,10,4.7,mb,,,,0.8,us,usp00026kz,2014-11-07T00:35:19.728Z,"22 km S of Uvira, Democratic Republic of the Congo",earthquake,,,,11,reviewed,us,us
153
+ 1984-08-25T20:37:49.880Z,-8.749,32.458,10,5.3,mw,,,,1,us,usp00026qu,2022-04-27T23:15:28.882Z,"49 km ESE of Laela, Tanzania",earthquake,,,,,reviewed,us,hrv
154
+ 1984-08-30T10:26:49.470Z,-7.54,28.083,10,4.9,mb,,,,0.9,us,usp00026va,2022-04-27T23:16:10.975Z,"202 km WNW of Kaputa, Zambia",earthquake,,,,25,reviewed,us,us
155
+ 1984-08-30T11:13:56.910Z,-7.58,28.073,10,4.8,mb,,,,0.9,us,usp00026vd,2014-11-07T00:35:20.682Z,"200 km WNW of Kaputa, Zambia",earthquake,,,,12,reviewed,us,us
156
+ 1984-09-01T13:59:40.460Z,-11.402,34.5,10,4.8,mb,,,,1.4,us,usp00026xh,2014-11-07T00:35:22.930Z,"31 km WSW of Mbamba Bay, Tanzania",earthquake,,,,1,reviewed,us,us
157
+ 1984-09-08T22:38:05.560Z,-6.65,30.814,10,4.6,mb,,,,0.8,us,usp000277f,2014-11-07T00:35:25.957Z,"44 km SW of Mpanda, Tanzania",earthquake,,,,1,reviewed,us,us
158
+ 1984-09-23T21:23:41.430Z,14.861,44.338,10,4.8,mb,,,,0.9,us,usp00027n3,2014-11-07T00:35:28.660Z,"34 km S of Sayy?n, Yemen",earthquake,,,,16,reviewed,us,us
159
+ 1984-09-24T14:54:54.180Z,-8.001,26.617,10,4.5,mb,,,,1.6,us,usp00027ns,2014-11-07T00:35:28.733Z,"157 km NNE of Bukama, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
160
+ 1984-09-25T11:23:19.970Z,-7.661,28.081,10,4.7,mb,,,,1.3,us,usp00027py,2014-11-07T00:35:28.871Z,"195 km WNW of Kaputa, Zambia",earthquake,,,,12,reviewed,us,us
161
+ 1984-10-07T03:55:54.550Z,-3.923,37.924,10,4.7,mb,,,,1.4,us,usp00027z5,2014-11-07T00:35:33.351Z,"23 km N of Kisiwani, Tanzania",earthquake,,,,4,reviewed,us,us
162
+ 1984-10-13T18:22:07.970Z,-16.031,28.709,10,4.5,mb,,,,0.4,us,usp000284f,2020-08-26T23:44:31.446Z,"15 km W of Chirundu, Zimbabwe",earthquake,,,,1,reviewed,us,us
163
+ 1984-10-26T07:44:28.230Z,-16.465,28.667,11,5.3,mw,,,,1,us,usp00028hb,2022-04-27T23:11:30.668Z,"9 km NNW of Siavonga, Zambia",earthquake,,2.3,,,reviewed,us,hrv
164
+ 1984-10-30T15:24:07.540Z,-2.733,26.202,10,4.8,mb,,,,0.7,us,usp00028n9,2020-08-26T23:46:29.749Z,"38 km NE of Kindu, Democratic Republic of the Congo",earthquake,,,,24,reviewed,us,us
165
+ 1984-11-25T15:42:15.030Z,-8.735,32.588,10,4.6,mb,,,,1.3,us,usp00029ey,2014-11-07T00:35:44.754Z,"52 km NW of Mlowo, Tanzania",earthquake,,,,3,reviewed,us,us
166
+ 1985-02-23T14:45:35.940Z,-6.966,30.928,10,5.7,mb,,,,0.8,us,usp0002c60,2022-04-27T21:27:50.478Z,"36 km WNW of Usevia, Tanzania",earthquake,,,,69,reviewed,us,us
167
+ 1985-03-24T03:43:32.850Z,-6.617,27.849,10,4.7,mb,,,,0.8,us,usp0002d5p,2014-11-07T00:36:20.039Z,"120 km ESE of Kabalo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
168
+ 1985-03-24T09:04:35.730Z,-7.386,28.153,10,4.9,mb,,,,1.2,us,usp0002d5r,2014-11-07T00:36:20.043Z,"196 km SW of Kalemie, Democratic Republic of the Congo",earthquake,,,,5,reviewed,us,us
169
+ 1985-04-23T12:29:25.500Z,-8.832,29.333,10,4.9,mb,,,,1.3,us,usp0002e2r,2014-11-07T00:36:27.930Z,"54 km SW of Kaputa, Zambia",earthquake,,,,5,reviewed,us,us
170
+ 1985-05-14T13:24:57.830Z,-10.61,41.423,10,6,mw,,,,0.9,us,usp0002etu,2022-04-27T22:47:24.429Z,"121 km E of Madimba, Tanzania",earthquake,,,,,reviewed,us,hrv
171
+ 1985-05-14T18:11:08.950Z,-10.562,41.424,10,6.4,mw,,,,0.9,us,usp0002eu6,2022-04-27T22:47:26.258Z,"120 km E of Madimba, Tanzania",earthquake,,,,,reviewed,us,nc
172
+ 1985-05-14T19:54:42.200Z,-10.705,41.345,10,5.4,mb,,,,0.9,us,usp0002eud,2022-04-27T22:47:27.598Z,"115 km ESE of Madimba, Tanzania",earthquake,,,,57,reviewed,us,us
173
+ 1985-05-15T10:59:21.710Z,-10.95,41.331,10,4.9,mb,,,,1.1,us,usp0002ev9,2014-11-07T00:36:35.204Z,"114 km ENE of Mocímboa, Mozambique",earthquake,,,,14,reviewed,us,us
174
+ 1985-05-19T11:32:22.930Z,-10.813,41.365,10,4.7,mb,,,,1.1,us,usp0002eze,2014-11-07T00:36:36.117Z,"121 km ESE of Madimba, Tanzania",earthquake,,,,5,reviewed,us,us
175
+ 1985-05-23T16:11:48.540Z,-10.6,40.922,10,4.7,mb,,,,1.3,us,usp0002f49,2014-11-07T00:36:36.677Z,"68 km ESE of Madimba, Tanzania",earthquake,,,,9,reviewed,us,us
176
+ 1985-05-26T12:55:09.590Z,-15.643,32.008,10,4.6,mb,,,,0.6,us,usp0002f7b,2014-11-07T00:36:37.027Z,"132 km NNE of Mount Darwin, Zimbabwe",earthquake,,,,1,reviewed,us,us
177
+ 1985-05-27T04:34:50.810Z,-10.67,41.231,10,4.8,mb,,,,1,us,usp0002f7v,2014-11-07T00:36:37.076Z,"102 km ESE of Madimba, Tanzania",earthquake,,,,16,reviewed,us,us
178
+ 1985-05-30T08:32:17.520Z,-10.657,41.355,10,5.3,mw,,,,1,us,usp0002fay,2025-12-19T21:21:26.562Z,"115 km ESE of Madimba, Tanzania",earthquake,,,,,reviewed,us,hrv
179
+ 1985-06-04T02:43:46.060Z,11.884,43.769,10,5.1,mw,,,,1.4,us,usp0002fgp,2022-04-27T22:45:39.174Z,"53 km E of Obock, Djibouti",earthquake,,,,,reviewed,us,hrv
180
+ 1985-06-04T03:52:23.600Z,11.69,43.4,10,5.2,ms,,,,1.3,us,usp0002fgs,2022-04-27T22:45:40.575Z,"29 km ENE of Djibouti, Djibouti",earthquake,,,,1,reviewed,us,us
181
+ 1985-06-21T02:29:05.330Z,-10.628,41.091,10,4.5,mb,,,,0.9,us,usp0002g0y,2014-11-07T00:36:44.573Z,"86 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
182
+ 1985-06-21T20:41:04.130Z,-7.422,27.93,10,4.5,mb,,,,1.5,us,usp0002g1m,2014-11-07T00:36:44.784Z,"188 km SE of Kabalo, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
183
+ 1985-06-23T02:54:00.670Z,-10.562,41.003,10,4.5,mb,,,,1,us,usp0002g2j,2014-11-07T00:36:45.129Z,"75 km ESE of Madimba, Tanzania",earthquake,,,,3,reviewed,us,us
184
+ 1985-06-24T11:59:29.060Z,-10.787,41.12,10,4.5,mb,,,,1.1,us,usp0002g3w,2014-11-07T00:36:45.331Z,"96 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
185
+ 1985-06-24T13:41:24.210Z,-10.642,41.096,10,5,mb,,,,1.1,us,usp0002g40,2014-11-07T00:36:45.344Z,"87 km ESE of Madimba, Tanzania",earthquake,,,,11,reviewed,us,us
186
+ 1985-06-24T14:04:44.390Z,-10.692,41.224,10,5,mb,,,,1.1,us,usp0002g41,2014-11-07T00:36:45.347Z,"102 km ESE of Madimba, Tanzania",earthquake,,,,13,reviewed,us,us
187
+ 1985-06-24T14:11:13.170Z,-10.551,41.044,10,4.5,mb,,,,0.9,us,usp0002g42,2014-11-07T00:36:45.418Z,"79 km ESE of Madimba, Tanzania",earthquake,,,,3,reviewed,us,us
188
+ 1985-06-24T14:19:22.370Z,-10.713,41.159,10,5.1,mb,,,,1.1,us,usp0002g43,2014-11-07T00:36:45.428Z,"96 km ESE of Madimba, Tanzania",earthquake,,,,11,reviewed,us,us
189
+ 1985-06-24T14:23:51.460Z,-10.6,41.148,10,4.6,mb,,,,1,us,usp0002g44,2014-11-07T00:36:45.432Z,"91 km ESE of Madimba, Tanzania",earthquake,,,,4,reviewed,us,us
190
+ 1985-06-28T07:32:20.050Z,-10.614,41.238,10,5.6,mw,,,,1.4,us,usp0002g7u,2022-04-27T22:46:24.062Z,"101 km ESE of Madimba, Tanzania",earthquake,,,,,reviewed,us,hrv
191
+ 1985-06-28T07:57:00.600Z,-10.617,40.96,10,4.7,mb,,,,1,us,usp0002g7x,2014-11-07T00:36:45.916Z,"72 km ESE of Madimba, Tanzania",earthquake,,,,4,reviewed,us,us
192
+ 1985-06-28T08:06:04.360Z,-10.456,40.979,10,4.8,mb,,,,0.5,us,usp0002g7y,2014-11-07T00:36:45.918Z,"70 km E of Madimba, Tanzania",earthquake,,,,1,reviewed,us,us
193
+ 1985-06-28T08:25:00.020Z,-10.632,41.154,10,4.6,mb,,,,0.8,us,usp0002g7z,2014-11-07T00:36:45.919Z,"93 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
194
+ 1985-06-28T08:38:14.990Z,-10.693,41.104,10,4.7,mb,,,,1.3,us,usp0002g80,2014-11-07T00:36:45.921Z,"90 km ESE of Madimba, Tanzania",earthquake,,,,10,reviewed,us,us
195
+ 1985-06-28T11:10:29.490Z,-10.551,40.936,10,4.5,mb,,,,0.9,us,usp0002g82,2014-11-07T00:36:45.927Z,"68 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
196
+ 1985-06-28T14:55:58.860Z,-10.105,40.659,10,4.6,mb,,,,0.9,us,usp0002g86,2014-11-07T00:36:45.937Z,"Tanzania",earthquake,,,,2,reviewed,us,us
197
+ 1985-06-28T22:46:19.800Z,-2.465,28.911,10,5,mw,,,,0.8,us,usp0002g8f,2016-11-09T22:51:54.275Z,"2 km N of Cyangugu, Rwanda",earthquake,,,,,reviewed,us,hrv
198
+ 1985-06-30T17:58:50.460Z,-10.634,41.054,10,4.5,mb,,,,0.7,us,usp0002g9x,2014-11-07T00:36:46.183Z,"83 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
199
+ 1985-07-03T02:20:54.430Z,-19.908,33.079,10,4.6,mb,,,,0.9,us,usp0002gc1,2014-11-07T00:36:49.040Z,"25 km ESE of Chimanimani, Zimbabwe",earthquake,,,,1,reviewed,us,us
200
+ 1985-07-19T13:40:38.200Z,-10.724,41.052,10,4.7,mb,,,,1.3,us,usp0002gx1,2014-11-07T00:36:52.678Z,"86 km ESE of Madimba, Tanzania",earthquake,,,,8,reviewed,us,us
201
+ 1985-08-14T20:37:44.400Z,8.301,38.524,33,4.9,mb,,,,1.3,us,usp0002hr3,2014-11-07T00:37:00.848Z,"26 km NE of Butaj?ra, Ethiopia",earthquake,,,,4,reviewed,us,us
202
+ 1985-08-20T05:46:00.470Z,5.518,36.143,10,5.4,mw,,,,0.8,us,usp0002hy1,2022-04-27T22:41:01.133Z,"55 km WSW of Bako, Ethiopia",earthquake,,,,,reviewed,us,hrv
203
+ 1985-09-03T16:42:01.470Z,-8.81,32.841,33,5.1,mb,,,,1.3,us,usp0002jd3,2014-11-07T00:37:06.994Z,"26 km NW of Mlowo, Tanzania",earthquake,,,,6,reviewed,us,us
204
+ 1985-09-17T10:57:10.770Z,-10.576,41.094,10,5,mb,,,,1.5,us,usp0002jup,2014-11-07T00:37:10.766Z,"85 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
205
+ 1985-09-20T04:05:48.850Z,-10.658,41.106,10,4.6,mb,,,,0.8,us,usp0002jxm,2014-11-07T00:37:11.217Z,"89 km ESE of Madimba, Tanzania",earthquake,,,,1,reviewed,us,us
206
+ 1985-10-28T12:08:36.330Z,9.463,39.648,10,4.7,mb,,,,1.3,us,usp0002m79,2014-11-07T00:37:21.708Z,"27 km SSE of Debre Birhan, Ethiopia",earthquake,,,,4,reviewed,us,us
207
+ 1985-11-28T17:40:44.850Z,-8.669,30.002,10,5.1,mb,,,,0.9,us,usp0002nb8,2022-04-27T22:32:40.594Z,"43 km ESE of Kaputa, Zambia",earthquake,,,,26,reviewed,us,us
208
+ 1985-12-03T06:29:05.740Z,-10.544,41.034,10,4.9,mb,,,,0.7,us,usp0002ngq,2014-11-07T00:37:34.891Z,"78 km ESE of Madimba, Tanzania",earthquake,,,,2,reviewed,us,us
209
+ 1986-01-24T22:30:08.510Z,-11.348,34.384,10,4.9,mb,,,,1,us,usp0002qda,2014-11-07T00:37:48.636Z,"30 km NNE of Nkhata Bay, Malawi",earthquake,,,,8,reviewed,us,us
210
+ 1986-03-14T04:15:58.520Z,-10.687,27.64,10,5,mw,,,,0.9,us,usp0002rue,2016-11-09T22:04:47.097Z,"103 km ENE of Likasi, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,hrv
211
+ 1986-03-23T15:26:46.900Z,0.515,30.28,10,4.7,mb,,,,1.2,us,usp0002s5y,2014-11-07T00:38:05.285Z,"16 km S of Fort Portal, Uganda",earthquake,,,,1,reviewed,us,us
212
+ 1986-04-28T18:09:57.450Z,-8.667,38.949,10,5,mb,,,,1.1,us,usp0002tad,2014-11-07T00:38:16.058Z,"78 km SSE of Utete, Tanzania",earthquake,,,,8,reviewed,us,us
213
+ 1986-05-25T15:59:18.960Z,-19.174,34.489,10,4.6,mb,,,,1.6,us,usp0002udw,2014-11-07T00:38:25.931Z,"55 km NNW of Dondo, Mozambique",earthquake,,,,2,reviewed,us,us
214
+ 1986-06-16T05:41:24.210Z,-12.368,43.958,10,4.7,mb,,,,1.4,us,usp0002v3a,2014-11-07T00:38:33.031Z,"17 km E of Ouanani, Comoros",earthquake,,,,22,reviewed,us,us
215
+ 1986-06-17T09:42:47.460Z,-1.771,26.802,10,4.6,m,,,,1.7,us,usp0002v4g,2020-08-28T20:28:05.960Z,"162 km NE of Kindu, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,lsz
216
+ 1986-06-23T00:07:56.400Z,-10.703,40.343,10,4.5,mb,,,,0.9,us,usp0002var,2014-11-07T00:38:34.198Z,"33 km S of Madimba, Tanzania",earthquake,,,,1,reviewed,us,us
217
+ 1986-06-28T18:19:05.980Z,-7.416,27.734,10,4.7,mb,,,,1.5,us,usp0002vgz,2014-11-07T00:38:35.457Z,"175 km SSE of Kabalo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
218
+ 1986-06-29T07:52:24.890Z,-11.333,40.47,10,4.5,mb,,,,1,us,usp0002vhg,2014-11-07T00:38:35.500Z,"13 km E of Mocímboa, Mozambique",earthquake,,,,1,reviewed,us,us
219
+ 1986-06-29T21:47:59.670Z,-5.336,29.539,20.2,5.8,mw,,,,1.1,us,usp0002vjn,2022-04-27T22:15:54.261Z,"51 km S of Kigoma, Tanzania",earthquake,,,,,reviewed,us,hrv
220
+ 1986-07-10T05:02:20.430Z,-5.515,29.019,10,5,mb,,,,1.5,us,usp0002vwb,2014-11-07T00:38:40.808Z,"51 km NNW of Kalemie, Democratic Republic of the Congo",earthquake,,,,4,reviewed,us,us
221
+ 1986-07-15T15:03:03.680Z,-12.073,40.774,10,4.8,mb,,,,1.2,us,usp0002w1y,2014-11-07T00:38:41.993Z,"95 km SSE of Mocímboa, Mozambique",earthquake,,,,4,reviewed,us,us
222
+ 1986-07-18T15:07:51.750Z,-16.356,28.502,17.1,5.2,mw,,,,1,us,usp0002w4u,2022-04-27T22:09:52.313Z,"29 km NW of Siavonga, Zambia",earthquake,,7,,,reviewed,us,hrv
223
+ 1986-08-04T11:12:57.360Z,-11.002,34.484,10,4.6,mb,,,,1.4,us,usp0002wv9,2014-11-07T00:38:48.602Z,"18 km WNW of Liuli, Tanzania",earthquake,,,,2,reviewed,us,us
224
+ 1986-08-27T15:41:53.550Z,-16.183,34.143,10,4.5,mb,,,,1.4,us,usp0002xkf,2014-11-07T00:38:53.896Z,"59 km E of Tete, Mozambique",earthquake,,,,3,reviewed,us,us
225
+ 1986-09-27T04:50:15.950Z,-4.188,37.681,10,4.7,mb,,,,1,us,usp0002ye9,2014-11-07T00:39:03.575Z,"14 km SSW of Same, Tanzania",earthquake,,,,15,reviewed,us,us
226
+ 1986-10-21T17:04:47.470Z,-8.614,31.242,10,4.8,mb,,,,1.4,us,usp0002z6x,2014-11-07T00:39:10.942Z,"21 km NE of Mpulungu, Zambia",earthquake,,,,1,reviewed,us,us
227
+ 1987-01-16T19:40:03.360Z,-1.581,28.767,10,4.8,mb,,,,1.5,us,usp00031qs,2014-11-07T00:39:39.602Z,"30 km W of Sake, Democratic Republic of the Congo",earthquake,,,,3,reviewed,us,us
228
+ 1987-01-28T01:47:28.750Z,-9.972,33.715,10,4.8,mb,,,,0.7,us,usp00031ze,2014-11-07T00:39:41.024Z,"24 km W of Karonga, Malawi",earthquake,,,,4,reviewed,us,us
229
+ 1987-03-27T10:12:51.360Z,-10.587,41.057,10,4.5,mb,,,,0.7,us,usp00033p9,2014-11-07T00:40:07.340Z,"81 km ESE of Madimba, Tanzania",earthquake,,,,4,reviewed,us,us
230
+ 1987-10-07T22:29:24.580Z,6.223,37.814,10,5.3,mw,,,,1.2,us,usp000392a,2022-04-27T21:32:03.135Z,"35 km NE of Arba Minch, Ethiopia",earthquake,,,,,reviewed,us,hrv
231
+ 1987-10-07T22:29:29.000Z,6.35,35.88,10,5.3,mwc,,,,,gcmt,gcmtb100787c,2016-11-09T23:40:13.606Z,"78 km SSE of M?zan Tefer?, Ethiopia",earthquake,,,,,automatic,gcmt,gcmt
232
+ 1987-10-09T03:49:17.670Z,5.47,35.998,10,4.7,mb,,,,1.5,us,usp0003938,2014-11-07T00:41:04.328Z,"71 km N of Lobuni, Ethiopia",earthquake,,,,1,reviewed,us,us
233
+ 1987-10-13T19:47:09.270Z,-9.327,40.903,10,4.9,mb,,,,1.3,us,usp0003987,2014-11-07T00:41:05.117Z,"130 km NE of Mtwara, Tanzania",earthquake,,,,9,reviewed,us,us
234
+ 1987-10-25T16:46:13.380Z,5.409,36.751,12,6.3,mw,,,,1.1,us,usp00039kf,2022-04-27T21:33:15.143Z,"28 km SSE of Jinka, Ethiopia",earthquake,,,,,reviewed,us,nc
235
+ 1987-10-25T16:57:58.950Z,5.107,37.209,10,4.7,mb,,,,0.8,us,usp00039kh,2014-11-07T00:41:06.799Z,"34 km WSW of Konso, Ethiopia",earthquake,,,,22,reviewed,us,us
236
+ 1987-10-28T08:58:29.190Z,5.74,36.73,10,6,mw,,,,1,us,usp00039ph,2022-04-27T21:33:38.458Z,"13 km NE of Jinka, Ethiopia",earthquake,,,,,reviewed,us,hrv
237
+ 1987-11-23T12:43:27.690Z,11.774,43.059,10,4.6,mb,,,,1,us,usp0003acz,2014-11-07T00:41:14.885Z,"19 km E of Tadjourah, Djibouti",earthquake,,,,1,reviewed,us,us
238
+ 1988-01-02T09:05:52.210Z,0.482,30.149,10,4.6,m,,,,1.5,us,usp0003br5,2014-11-07T00:41:27.777Z,"24 km SW of Fort Portal, Uganda",earthquake,,,,,reviewed,us,bul
239
+ 1988-01-03T10:53:00.420Z,-14.332,25.312,10,4.5,mb,,,,1,us,usp0003bs6,2020-08-28T21:46:41.030Z,"Zambia",earthquake,,,,3,reviewed,us,us
240
+ 1988-01-12T11:40:17.900Z,-8.783,32.604,10,4.7,mb,,,,1.4,us,usp0003c04,2014-11-07T00:41:30.610Z,"48 km WNW of Mlowo, Tanzania",earthquake,,,,4,reviewed,us,us
241
+ 1988-03-23T23:55:08.370Z,13.678,40.565,10,4.9,mb,,,,1.2,us,usp0003e8j,2014-11-07T00:41:49.427Z,"119 km E of Mek'ele, Ethiopia",earthquake,,,,6,reviewed,us,us
242
+ 1988-04-16T21:17:10.010Z,-10.242,27.697,10,5.1,mw,,,,0.9,us,usp0003f35,2022-04-28T20:49:15.075Z,"110 km W of Mwense, Zambia",earthquake,,,,,reviewed,us,hrv
243
+ 1988-05-07T05:05:33.930Z,-0.467,30.006,10,4.5,mb,,,,0.9,us,usp0003fqx,2014-11-07T00:42:06.226Z,"41 km N of Rukungiri, Uganda",earthquake,,,,6,reviewed,us,us
244
+ 1988-06-10T10:07:32.970Z,-4.097,33.609,10,4.7,mb,,,,1.4,us,usp0003gv9,2014-11-07T00:42:18.775Z,"14 km SW of Igurubi, Tanzania",earthquake,,,,3,reviewed,us,us
245
+ 1988-09-01T17:37:29.220Z,11.375,42.247,10,4.6,mb,,,,1.4,us,usp0003kke,2014-11-07T00:42:44.793Z,"32 km NNW of Dikhil, Djibouti",earthquake,,,,1,reviewed,us,us
246
+ 1988-12-01T21:58:53.130Z,-11.932,26.707,33,4.7,mb,,,,0.7,us,usp0003pe6,2020-08-28T22:25:48.164Z,"35 km ENE of Kansanshi, Zambia",earthquake,,,,2,reviewed,us,us
247
+ 1989-01-01T17:16:41.780Z,-11.54,41.064,10,5,mb,,,,1.3,us,usp0003qdn,2014-11-07T00:43:22.229Z,"81 km ESE of Mocímboa, Mozambique",earthquake,,,,6,reviewed,us,us
248
+ 1989-01-05T05:08:14.860Z,0.229,29.962,10,4.8,mb,,,,1,us,usp0003qhs,2014-11-07T00:43:23.904Z,"6 km WNW of Kilembe, Uganda",earthquake,,,,17,reviewed,us,us
249
+ 1989-02-09T23:49:16.160Z,-8.548,29.836,35.4,5.2,mb,,,,0.9,us,usp0003rq7,2022-04-28T20:24:30.109Z,"21 km ESE of Kaputa, Zambia",earthquake,,,,42,reviewed,us,us
250
+ 1989-02-25T15:40:50.760Z,-17.723,35.401,10,4.6,mb,,,,1,us,usp0003sb7,2014-11-07T00:43:38.516Z,"90 km S of Nsanje, Malawi",earthquake,,,,4,reviewed,us,us
251
+ 1989-03-09T02:37:00.470Z,-13.71,34.381,29.6,5.7,mw,,,,0.9,us,usp0003ss3,2022-04-28T20:23:20.857Z,"11 km NW of Salima, Malawi",earthquake,,,,,reviewed,us,hrv
252
+ 1989-03-10T21:49:45.860Z,-13.702,34.42,30.3,6.2,mb,,,,0.9,us,usp0003sty,2022-04-28T20:23:28.388Z,"9 km NNW of Salima, Malawi",earthquake,,,,55,reviewed,us,us
253
+ 1989-03-25T00:56:59.550Z,-13.524,33.653,10,4.7,mb,,,,1.3,us,usp0003t95,2014-11-07T00:43:51.035Z,"9 km W of Mponela, Malawi",earthquake,,,,4,reviewed,us,us
254
+ 1989-04-12T05:05:15.960Z,13.308,39.984,33,4.9,mb,,,,0.8,us,usp0003tvm,2022-04-28T20:20:24.161Z,"58 km ESE of Mek'ele, Ethiopia",earthquake,,,,29,reviewed,us,us
255
+ 1989-04-13T07:55:11.380Z,13.263,39.925,33,5.3,mb,,,,0.9,us,usp0003tx7,2022-04-28T20:20:27.588Z,"55 km ESE of Mek'ele, Ethiopia",earthquake,,,,43,reviewed,us,us
256
+ 1989-04-13T12:17:31.300Z,13.29,39.98,33,5.5,mw,,,,1.4,us,usp0003txf,2022-04-28T20:20:28.762Z,"Ethiopia",earthquake,,,,,reviewed,us,hrv
257
+ 1989-04-13T13:00:48.780Z,13.351,40.011,33,4.8,mb,,,,0.9,us,usp0003txk,2014-11-07T00:43:59.854Z,"Ethiopia",earthquake,,,,16,reviewed,us,us
258
+ 1989-05-11T20:53:51.020Z,8.946,39.982,10,4.9,mb,,,,1.1,us,usp0003v5c,2022-04-28T20:17:24.318Z,"8 km NE of Metah?ra, Ethiopia",earthquake,,,,34,reviewed,us,us
259
+ 1989-06-04T12:02:35.940Z,11.698,43.968,10,4.9,mb,,,,1.4,us,usp0003vyz,2014-11-07T00:44:20.667Z,"79 km ESE of Obock, Djibouti",earthquake,,,,9,reviewed,us,us
260
+ 1989-06-08T06:24:09.610Z,6.837,37.878,18.6,4.9,mw,,,,0.9,us,usp0003w2y,2020-08-28T22:48:46.105Z,"13 km E of Sodo, Ethiopia",earthquake,,6.5,,,reviewed,us,hrv
261
+ 1989-06-20T21:11:51.220Z,12.685,41.832,10,4.5,ml,,,,0.4,us,usp0003wf6,2014-11-07T00:44:23.558Z,"91 km NW of Dorra, Djibouti",earthquake,,,,,reviewed,us,aro
262
+ 1989-07-15T11:06:08.850Z,-3.401,34.444,10,4.8,mb,,,,1.4,us,usp0003xbj,2014-11-07T00:44:33.254Z,"47 km SE of Kisesa, Tanzania",earthquake,,,,6,reviewed,us,us
263
+ 1989-08-20T11:16:56.510Z,11.766,41.942,11.6,6.5,mw,,,,1,us,usp0003ynm,2022-04-28T20:12:35.033Z,"12 km ENE of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
264
+ 1989-08-20T11:17:55.240Z,11.919,41.963,10.1,5.6,mb,,,,1.2,us,usp0003ynn,2020-08-28T22:57:14.910Z,"Ethiopia",earthquake,,,,5,reviewed,us,us
265
+ 1989-08-20T11:46:28.070Z,11.884,41.812,10,6.1,mw,,,,1,us,usp0003ynq,2022-04-28T20:12:36.172Z,"18 km N of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
266
+ 1989-08-20T11:56:17.840Z,11.764,41.964,10,5.3,mb,,,,1.3,us,usp0003ynr,2022-04-28T20:12:37.234Z,"14 km ENE of Gâlâfi, Djibouti",earthquake,,,,44,reviewed,us,us
267
+ 1989-08-20T12:13:36.740Z,11.469,41.706,10,4.8,mb,,,,0.8,us,usp0003ynt,2014-11-07T00:44:43.848Z,"30 km SSW of Gâlâfi, Djibouti",earthquake,,,,16,reviewed,us,us
268
+ 1989-08-20T13:25:26.010Z,11.898,41.884,10,5.2,mb,,,,1.2,us,usp0003ynu,2022-04-28T20:12:38.291Z,"20 km NNE of Gâlâfi, Djibouti",earthquake,,,,39,reviewed,us,us
269
+ 1989-08-20T13:26:19.430Z,11.88,41.88,10,6.1,ms,,,,1.3,us,usp0003ynv,2022-04-28T20:12:39.397Z,"18 km NNE of Gâlâfi, Djibouti",earthquake,,,,9,reviewed,us,us
270
+ 1989-08-20T14:15:43.080Z,12.044,41.626,10,4.6,mb,,,,1.1,us,usp0003ynx,2014-11-07T00:44:43.883Z,"42 km NNW of Gâlâfi, Djibouti",earthquake,,,,11,reviewed,us,us
271
+ 1989-08-20T18:25:13.390Z,11.807,41.813,10,4.6,mb,,,,0.5,us,usp0003yp5,2014-11-07T00:44:43.902Z,"10 km NNW of Gâlâfi, Djibouti",earthquake,,,,11,reviewed,us,us
272
+ 1989-08-20T18:27:33.660Z,11.825,41.583,10,5.1,mb,,,,1.4,us,usp0003yp6,2022-04-28T20:12:40.516Z,"30 km WNW of Gâlâfi, Djibouti",earthquake,,,,23,reviewed,us,us
273
+ 1989-08-20T18:39:48.890Z,11.985,41.87,10,5.7,mw,,,,1,us,usp0003yp9,2022-04-28T20:12:42.879Z,"30 km N of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
274
+ 1989-08-20T18:54:05.310Z,11.896,41.764,10,5.2,mb,,,,1.1,us,usp0003ypb,2022-04-28T20:12:43.987Z,"21 km NNW of Gâlâfi, Djibouti",earthquake,,,,47,reviewed,us,us
275
+ 1989-08-20T19:25:56.510Z,11.904,41.824,11.7,6.1,mw,,,,1,us,usp0003ypc,2022-04-28T20:12:45.057Z,"20 km N of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
276
+ 1989-08-20T20:45:12.250Z,12.164,41.611,10,4.7,mb,,,,1.2,us,usp0003ypj,2014-11-07T00:44:44.024Z,"Ethiopia",earthquake,,,,24,reviewed,us,us
277
+ 1989-08-21T01:09:06.630Z,11.874,41.87,15.8,6.4,mw,,,,1,us,usp0003ypw,2022-04-28T20:12:50.889Z,"17 km NNE of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
278
+ 1989-08-21T01:34:07.340Z,11.992,41.891,10,4.9,mb,,,,1.1,us,usp0003ypx,2014-11-07T00:44:44.102Z,"31 km N of Gâlâfi, Djibouti",earthquake,,,,33,reviewed,us,us
279
+ 1989-08-21T05:03:05.600Z,11.942,41.769,9.7,6.1,mw,,,,1.1,us,usp0003yq0,2022-04-28T20:12:57.366Z,"26 km NNW of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,nc
280
+ 1989-08-21T05:05:45.390Z,11.821,41.732,10,5.8,mw,,,,1.2,us,usp0003yq1,2022-04-28T20:13:02.124Z,"16 km NW of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
281
+ 1989-08-21T07:07:38.470Z,11.8,41.721,10,5.3,mw,,,,1.1,us,usp0003yq9,2022-04-28T20:13:07.745Z,"15 km NW of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
282
+ 1989-08-21T18:10:38.940Z,12.072,41.68,10,4.6,mb,,,,0.7,us,usp0003yr0,2014-11-07T00:44:44.282Z,"42 km NNW of Gâlâfi, Djibouti",earthquake,,,,3,reviewed,us,us
283
+ 1989-08-21T21:21:35.410Z,12.096,41.648,10,4.6,mb,,,,1.7,us,usp0003yr8,2014-11-07T00:44:44.352Z,"46 km NNW of Gâlâfi, Djibouti",earthquake,,,,3,reviewed,us,us
284
+ 1989-08-22T03:01:48.160Z,12.193,41.532,10,4.8,mb,,,,1.4,us,usp0003yrm,2022-04-28T20:13:24.854Z,"62 km NNW of Gâlâfi, Djibouti",earthquake,,,,15,reviewed,us,us
285
+ 1989-09-05T20:49:34.400Z,-11.732,34.45,10,5.4,mw,,,,0.9,us,usp0003z8w,2022-04-28T20:10:59.489Z,"22 km SE of Nkhata Bay, Malawi",earthquake,,,,,reviewed,us,hrv
286
+ 1990-01-24T16:24:19.020Z,11.911,43.215,10,4.5,ml,,,,1.1,us,usp00044pq,2014-11-07T00:45:35.508Z,"10 km SW of Obock, Djibouti",earthquake,,,,,reviewed,us,aro
287
+ 1990-02-28T20:05:31.710Z,-13.969,34.107,33,5.1,mb,,,,0.9,us,usp000460j,2022-04-28T20:00:16.865Z,"34 km E of Lilongwe, Malawi",earthquake,,,,17,reviewed,us,us
288
+ 1990-02-28T20:54:22.350Z,-13.645,33.934,33,4.7,mb,,,,1.5,us,usp000460m,2014-11-07T00:45:48.484Z,"1 km NNW of Dowa, Malawi",earthquake,,,,4,reviewed,us,us
289
+ 1990-02-28T22:18:21.620Z,-13.852,34.063,33,4.9,mb,,,,1.2,us,usp000460s,2022-04-28T20:00:18.189Z,"25 km SSE of Dowa, Malawi",earthquake,,,,14,reviewed,us,us
290
+ 1990-03-01T22:56:42.410Z,-14.004,34.209,10,4.9,mb,,,,0.8,us,usp000462h,2014-11-07T00:45:50.947Z,"33 km W of Chipoka, Malawi",earthquake,,,,11,reviewed,us,us
291
+ 1990-03-13T23:05:29.420Z,-3.994,39.925,10,5.5,mw,,,,1,us,usp00046jr,2022-04-28T19:55:43.106Z,"29 km ENE of Mombasa, Kenya",earthquake,,,,,reviewed,us,hrv
292
+ 1990-04-05T19:20:44.160Z,-2.927,35.891,10,5.1,mw,,,,1.2,us,usp00047gg,2022-04-28T19:51:06.882Z,"46 km N of Mto wa Mbu, Tanzania",earthquake,,,,,reviewed,us,hrv
293
+ 1990-04-27T17:53:23.330Z,-18.041,35.289,10,4.8,mb,,,,0.8,us,usp00048jf,2014-11-07T00:46:12.180Z,"124 km S of Nsanje, Malawi",earthquake,,,,10,reviewed,us,us
294
+ 1990-05-04T10:12:06.860Z,11.754,40.964,10.3,5,mb,,,,1.1,us,usp00048ug,2022-04-28T19:48:31.859Z,"6 km SW of Semera, Ethiopia",earthquake,,3.9,,45,reviewed,us,us
295
+ 1990-05-15T15:21:26.260Z,-3.225,35.744,5,5.4,mw,,,,1.3,us,usp00049b1,2022-04-28T19:49:04.867Z,"14 km NE of Kiratu, Tanzania",earthquake,,,,,reviewed,us,hrv
296
+ 1990-05-15T16:24:19.510Z,-3.075,35.891,5,5.5,mw,,,,1.1,us,usp00049b3,2022-04-28T19:49:09.991Z,"30 km N of Mto wa Mbu, Tanzania",earthquake,,,,,reviewed,us,hrv
297
+ 1990-05-16T17:17:23.120Z,11.893,41.755,10,4.5,mb,,,,0.8,us,usp00049cx,2014-11-07T00:46:22.347Z,"21 km NNW of Gâlâfi, Djibouti",earthquake,,,,1,reviewed,us,us
298
+ 1990-05-20T02:22:01.620Z,5.121,32.145,14.9,7.2,mw,,,,1.1,us,usp00049hf,2022-04-28T19:49:30.595Z,"69 km ENE of Juba, South Sudan",earthquake,,,,,reviewed,us,nc
299
+ 1990-05-20T06:41:23.480Z,4.541,32.179,10,4.6,mb,,,,0.9,us,usp00049hr,2020-08-28T23:43:57.404Z,"45 km WNW of Torit, South Sudan",earthquake,,,,15,reviewed,us,us
300
+ 1990-05-20T19:30:44.500Z,5.143,31.976,10,4.5,mb,,,,0.8,us,usp00049jf,2020-08-28T23:44:07.993Z,"54 km NE of Juba, South Sudan",earthquake,,,,17,reviewed,us,us
301
+ 1990-05-23T12:26:49.730Z,5.494,31.681,10,4.9,mb,,,,1,us,usp00049nq,2020-08-28T23:44:29.531Z,"Sudan",earthquake,,,,11,reviewed,us,us
302
+ 1990-05-24T19:34:44.240Z,5.277,31.829,16.5,6.5,mw,,,,1.1,us,usp00049q9,2022-04-28T19:49:44.830Z,"54 km NNE of Juba, South Sudan",earthquake,,,,,reviewed,us,hrv
303
+ 1990-05-24T20:00:08.190Z,5.358,31.848,16,7.1,mw,,,,1,us,usp00049qe,2022-04-28T19:49:45.747Z,"63 km NNE of Juba, South Sudan",earthquake,,,,,reviewed,us,hrv
304
+ 1990-05-24T22:16:03.380Z,5.436,31.876,10,5.5,mb,,,,1,us,usp00049qn,2022-04-28T19:49:47.710Z,"72 km NNE of Juba, South Sudan",earthquake,,,,53,reviewed,us,us
305
+ 1990-05-25T00:42:31.970Z,5.425,31.848,10,5.3,mb,,,,1,us,usp00049qv,2022-04-28T19:49:48.678Z,"69 km NNE of Juba, South Sudan",earthquake,,,,48,reviewed,us,us
306
+ 1990-05-25T01:02:21.610Z,8.129,32.035,10,4.7,mb,,,,0.9,us,usp00049qw,2020-08-28T23:46:35.155Z,"160 km SSE of Malakal, South Sudan",earthquake,,,,15,reviewed,us,us
307
+ 1990-05-25T02:49:02.320Z,5.358,31.328,10,4.8,mb,,,,1.2,us,usp00049qz,2020-08-28T23:46:56.463Z,"62 km NNW of Juba, South Sudan",earthquake,,,,21,reviewed,us,us
308
+ 1990-05-25T06:12:44.880Z,4.49,31.49,10,4.8,mb,,,,0.5,us,usp00049r1,2020-08-28T23:47:06.940Z,"41 km SSW of Juba, South Sudan",earthquake,,,,6,reviewed,us,us
309
+ 1990-05-25T15:14:03.940Z,5.375,31.763,10,4.7,mb,,,,0.9,us,usp00049rj,2020-08-28T23:47:17.347Z,"61 km NNE of Juba, South Sudan",earthquake,,,,14,reviewed,us,us
310
+ 1990-05-26T05:53:50.600Z,5.321,32.044,10,4.8,mb,,,,0.7,us,usp00049sr,2020-08-28T23:47:39.022Z,"72 km NE of Juba, South Sudan",earthquake,,,,12,reviewed,us,us
311
+ 1990-05-26T14:22:40.890Z,5.134,31.769,10,5,mb,,,,1,us,usp00049tf,2022-04-28T19:49:52.428Z,"37 km NNE of Juba, South Sudan",earthquake,,,,24,reviewed,us,us
312
+ 1990-05-26T14:39:51.570Z,4.835,33.638,10,4.6,mb,,,,1.3,us,usp00049tg,2020-04-16T19:21:27.278Z,"8 km NE of Kapoeta, South Sudan",earthquake,,,,7,reviewed,us,us
313
+ 1990-05-27T07:29:32.640Z,4.804,31.743,10,5,mb,,,,1.1,us,usp00049ug,2020-08-28T23:48:00.156Z,"18 km ESE of Juba, South Sudan",earthquake,,,,20,reviewed,us,us
314
+ 1990-05-27T18:56:56.860Z,13.129,39.927,52.2,5,mb,,,,1,us,usp00049v5,2022-04-28T19:49:54.494Z,"56 km NE of Maych’ew, Ethiopia",earthquake,,,,43,reviewed,us,us
315
+ 1990-05-28T01:11:57.210Z,5.462,31.847,10,4.8,mb,,,,1,us,usp00049vr,2020-08-28T23:48:34.174Z,"73 km NNE of Juba, South Sudan",earthquake,,,,29,reviewed,us,us
316
+ 1990-05-29T04:37:29.800Z,5.467,32.568,10,4.7,mb,,,,0.6,us,usp00049ww,2020-08-28T23:49:09.020Z,"116 km N of Torit, South Sudan",earthquake,,,,15,reviewed,us,us
317
+ 1990-06-03T12:49:43.960Z,2.193,32.336,10,4.7,mb,,,,1.4,us,usp0004a3b,2014-11-07T00:46:28.712Z,"32 km NW of Apac, Uganda",earthquake,,,,11,reviewed,us,us
318
+ 1990-06-03T16:23:39.140Z,5.442,32.121,10,5.1,mb,,,,1.4,us,usp0004a3m,2022-04-28T19:45:45.243Z,"88 km NE of Juba, South Sudan",earthquake,,,,27,reviewed,us,us
319
+ 1990-06-03T20:41:52.280Z,4.62,31.863,10,4.6,mb,,,,0.8,us,usp0004a3u,2020-08-28T23:50:49.070Z,"40 km SE of Juba, South Sudan",earthquake,,,,4,reviewed,us,us
320
+ 1990-06-09T08:06:03.390Z,5.445,32.022,10,4.7,mb,,,,1.3,us,usp0004aa8,2020-08-28T23:52:06.984Z,"81 km NE of Juba, South Sudan",earthquake,,,,15,reviewed,us,us
321
+ 1990-06-18T10:12:04.630Z,4.943,31.994,10,4.5,mb,,,,1.6,us,usp0004anv,2020-08-28T23:54:45.030Z,"46 km ENE of Juba, South Sudan",earthquake,,,,8,reviewed,us,us
322
+ 1990-06-20T18:47:58.950Z,5.412,31.717,15.6,5,mb,,,,1,us,usp0004ark,2020-08-28T23:54:55.973Z,"63 km NNE of Juba, South Sudan",earthquake,,,,29,reviewed,us,us
323
+ 1990-07-09T15:11:20.380Z,5.395,31.654,12.6,6.6,mw,,,,1.2,us,usp0004bkr,2022-04-28T17:25:07.565Z,"60 km N of Juba, South Sudan",earthquake,,,,,reviewed,us,nc
324
+ 1990-07-15T15:08:28.380Z,5.002,32.188,10,4.5,mb,,,,1.1,us,usp0004bwj,2020-08-28T23:58:42.854Z,"69 km ENE of Juba, South Sudan",earthquake,,,,2,reviewed,us,us
325
+ 1990-07-19T17:06:07.640Z,4.256,31.544,10,4.6,mb,,,,0.8,us,usp0004c81,2020-08-29T00:01:18.052Z,"66 km S of Juba, South Sudan",earthquake,,,,14,reviewed,us,us
326
+ 1990-07-26T05:15:43.920Z,-2.948,35.854,10,4.9,mb,,,,0.9,us,usp0004cj2,2022-04-28T19:44:49.482Z,"44 km N of Mto wa Mbu, Tanzania",earthquake,,,,36,reviewed,us,us
327
+ 1990-07-27T20:41:31.090Z,5.072,32.078,10,4.8,mb,,,,0.9,us,usp0004cmr,2020-08-29T00:03:13.631Z,"60 km ENE of Juba, South Sudan",earthquake,,,,38,reviewed,us,us
328
+ 1990-07-28T16:46:02.700Z,5.225,32.604,10,5.4,mw,,,,1,us,usp0004cnw,2022-04-28T19:45:02.544Z,"90 km N of Torit, South Sudan",earthquake,,,,,reviewed,us,hrv
329
+ 1990-08-11T02:34:22.270Z,0.165,33.118,33,4.5,mb,,,,1.8,us,usp0004d7q,2014-11-07T00:46:55.795Z,"30 km SE of Lugazi, Uganda",earthquake,,,,3,reviewed,us,us
330
+ 1990-08-13T02:47:04.500Z,5.335,31.882,10,4.7,mb,,,,1.5,us,usp0004dav,2020-08-29T00:05:20.368Z,"62 km NNE of Juba, South Sudan",earthquake,,,,11,reviewed,us,us
331
+ 1990-09-04T01:48:00.760Z,-0.479,29.085,10,5.4,mw,,,,1.1,us,usp0004e9r,2022-04-28T19:37:03.642Z,"72 km SSW of Butembo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,hrv
332
+ 1990-09-07T00:12:26.210Z,5.443,31.686,10,5.6,mw,,,,1,us,usp0004ed1,2022-04-28T19:37:11.115Z,"66 km N of Juba, South Sudan",earthquake,,,,,reviewed,us,hrv
333
+ 1990-09-18T04:55:42.030Z,-4.061,29.483,10,5,mb,,,,1,us,usp0004eus,2022-04-28T19:38:29.765Z,"10 km SSE of Rumonge, Burundi",earthquake,,,,34,reviewed,us,us
334
+ 1990-09-29T01:23:44.660Z,5.092,31.973,10,4.5,mb,,,,1.1,us,usp0004f5h,2020-08-29T00:11:20.014Z,"50 km ENE of Juba, South Sudan",earthquake,,,,15,reviewed,us,us
335
+ 1990-12-11T05:09:08.580Z,5.35,32.639,10,5,mb,,,,1.2,us,usp0004hyz,2020-08-29T00:19:33.148Z,"104 km N of Torit, South Sudan",earthquake,,,,8,reviewed,us,us
336
+ 1990-12-15T20:56:51.300Z,0.18,29.529,18.2,4.7,mb,,,,1.1,us,usp0004j6j,2014-11-07T00:47:37.127Z,"26 km E of Butembo, Democratic Republic of the Congo",earthquake,,,,21,reviewed,us,us
337
+ 1990-12-20T18:37:44.190Z,-0.318,29.46,33,4.5,mb,,,,1,us,usp0004jda,2014-11-07T00:47:38.230Z,"54 km SSE of Butembo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
338
+ 1991-01-05T15:47:49.160Z,5.14,32.08,33,4.9,mb,,,,0.9,us,usp0004k8k,2020-08-29T00:24:54.105Z,"63 km ENE of Juba, South Sudan",earthquake,,,,11,reviewed,us,us
339
+ 1991-01-06T01:57:31.220Z,12.722,47.556,10,4.7,mb,,,,1.5,us,usp0004k9b,2014-11-07T00:47:46.855Z,"186 km NNW of Las Khorey, Somalia",earthquake,,,,11,reviewed,us,us
340
+ 1991-01-08T16:09:30.630Z,5.365,32.541,10,4.8,mb,,,,1.3,us,usp0004kdh,2020-08-29T00:25:05.832Z,"105 km N of Torit, South Sudan",earthquake,,,,6,reviewed,us,us
341
+ 1991-01-10T07:06:26.200Z,5.114,31.822,11.4,5.2,mb,,,,1.2,us,usp0004kfn,2022-04-28T19:26:33.829Z,"39 km NE of Juba, South Sudan",earthquake,,,,32,reviewed,us,us
342
+ 1991-01-31T06:13:10.700Z,5.307,32.606,10,4.6,mb,,,,1,us,usp0004mcs,2020-08-29T00:29:25.612Z,"99 km N of Torit, South Sudan",earthquake,,,,11,reviewed,us,us
343
+ 1991-02-03T14:46:43.640Z,5.362,32.487,10,4.6,mb,,,,1.4,us,usp0004mhb,2020-08-29T00:29:55.488Z,"105 km N of Torit, South Sudan",earthquake,,,,2,reviewed,us,us
344
+ 1991-02-09T08:45:55.400Z,5.196,32.466,10,4.8,mb,,,,1.1,us,usp0004mr7,2020-08-29T00:30:05.359Z,"87 km N of Torit, South Sudan",earthquake,,,,7,reviewed,us,us
345
+ 1991-02-15T22:31:03.100Z,-4.379,28.518,10,4.7,mb,,,,0.6,us,usp0004mzm,2014-11-07T00:48:00.226Z,"111 km WSW of Rumonge, Burundi",earthquake,,,,6,reviewed,us,us
346
+ 1991-02-22T22:06:11.110Z,-3.972,35.811,10,5.2,mw,,,,1,us,usp0004n9t,2022-04-28T19:24:12.165Z,"6 km NE of Magugu, Tanzania",earthquake,,,,,reviewed,us,hrv
347
+ 1991-02-24T19:31:53.140Z,-1.68,28.772,10,4.6,mb,,,,1,us,usp0004ncr,2014-11-07T00:48:04.996Z,"32 km WSW of Sake, Democratic Republic of the Congo",earthquake,,,,19,reviewed,us,us
348
+ 1991-03-15T08:22:54.150Z,5.715,32.301,10,4.8,mb,,,,1.3,us,usp0004p2r,2020-08-29T00:35:06.193Z,"98 km ESE of Bor, South Sudan",earthquake,,,,11,reviewed,us,us
349
+ 1991-03-19T20:29:34.870Z,-5.754,35.629,33,4.7,mb,,,,1,us,usp0004p98,2014-11-07T00:48:13.149Z,"46 km ENE of Kintinku, Tanzania",earthquake,,,,3,reviewed,us,us
350
+ 1991-03-27T11:54:24.310Z,5.566,31.967,10,4.5,ms,,,,0.8,us,usp0004pmj,2020-08-29T00:36:33.400Z,"84 km SSE of Bor, South Sudan",earthquake,,,,1,reviewed,us,us
351
+ 1991-03-29T09:06:06.440Z,5.21,32.672,10,5.4,mw,,,,1,us,usp0004pq0,2022-04-28T19:22:11.298Z,"88 km N of Torit, South Sudan",earthquake,,,,,reviewed,us,hrv
352
+ 1991-03-29T16:54:31.260Z,5.405,32.951,10,4.8,mb,,,,1.2,us,usp0004pqg,2020-08-29T00:36:55.568Z,"99 km NW of Kapoeta, South Sudan",earthquake,,,,13,reviewed,us,us
353
+ 1991-04-21T23:12:22.540Z,-18.287,46.416,18.6,5.6,mw,,,,0.9,us,usp0004qn4,2022-04-28T19:18:28.129Z,"22 km NW of Fenoarivo Be, Madagascar",earthquake,,,,,reviewed,us,hrv
354
+ 1991-05-09T17:00:40.240Z,5.129,31.59,10,4.8,mb,,,,1.3,us,usp0004ret,2020-08-29T00:45:13.092Z,"30 km N of Juba, South Sudan",earthquake,,,,4,reviewed,us,us
355
+ 1991-05-10T01:12:38.440Z,-17.352,25.016,10,5,mb,,,,1.1,us,usp0004rf1,2020-08-29T00:45:23.131Z,"52 km NNW of Kasane, Botswana",earthquake,,,,25,reviewed,us,us
356
+ 1991-05-11T15:26:29.740Z,12.413,47.516,17,5.4,mw,,,,1.1,us,usp0004rgx,2025-12-19T20:54:10.087Z,"157 km NNW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,hrv
357
+ 1991-05-12T16:12:37.100Z,12.279,47.487,10,5.5,mw,,,,1.2,us,usp0004rjg,2022-04-28T19:14:21.690Z,"146 km NNW of Las Khorey, Somalia",earthquake,,,,,reviewed,us,hrv
358
+ 1991-05-30T09:34:43.220Z,-11.205,32.624,10,4.7,mb,,,,1.5,us,usp0004s97,2014-11-07T00:48:38.085Z,"57 km W of Chama, Zambia",earthquake,,,,1,reviewed,us,us
359
+ 1991-07-24T13:54:52.060Z,-18.274,34.856,32,5.1,mw,,,,0.9,us,usp0004ukg,2022-04-28T19:08:56.532Z,"148 km N of Dondo, Mozambique",earthquake,,,,,reviewed,us,hrv
360
+ 1991-09-01T22:34:33.280Z,-10.821,41.252,29.1,4.8,mb,,,,1,us,usp0004w4y,2014-11-07T00:49:11.747Z,"110 km ESE of Madimba, Tanzania",earthquake,,,,38,reviewed,us,us
361
+ 1991-09-06T16:08:34.250Z,5.341,32.155,10,4.9,ms,,,,1.5,us,usp0004waw,2020-08-29T00:59:29.186Z,"83 km NE of Juba, South Sudan",earthquake,,,,1,reviewed,us,us
362
+ 1991-09-08T07:49:13.240Z,5.226,31.898,10,4.5,mb,,,,1.4,us,usp0004wd8,2020-08-29T00:59:38.857Z,"54 km NE of Juba, South Sudan",earthquake,,,,6,reviewed,us,us
363
+ 1991-10-08T18:51:20.120Z,-2.04,27.446,10,4.8,mb,,,,1.4,us,usp0004xje,2014-11-07T00:49:22.893Z,"157 km WNW of Kabare, Democratic Republic of the Congo",earthquake,,,,3,reviewed,us,us
364
+ 1991-10-09T17:22:05.400Z,1.804,31.293,33,5.6,mw,,,,1,us,usp0004xkm,2022-04-28T19:00:56.609Z,"20 km N of Kigorobya, Uganda",earthquake,,,,,reviewed,us,hrv
365
+ 1991-11-15T04:15:25.850Z,-19.224,41.854,33,4.5,mb,,,,1.4,us,usp0004z5y,2014-11-07T00:49:34.805Z,"263 km WSW of Maintirano, Madagascar",earthquake,,,,8,reviewed,us,us
366
+ 1991-11-22T00:40:23.960Z,13.887,44.068,10,4.7,mb,,,,1.1,us,usp0004zep,2020-08-29T01:07:45.343Z,"7 km NW of Dh? as Suf?l, Yemen",earthquake,,,,12,reviewed,us,us
367
+ 1992-01-10T11:15:13.540Z,11.765,42.334,10,4.9,mb,,,,0.7,us,usp00051mn,2014-11-07T00:49:54.157Z,"45 km SSW of Dorra, Djibouti",earthquake,,,,6,reviewed,us,us
368
+ 1992-02-25T20:10:27.150Z,-6.911,39.924,10,4.5,mb,,,,0.8,us,usp00053gb,2014-11-07T00:50:08.169Z,"67 km SE of Sokoni, Tanzania",earthquake,,,,2,reviewed,us,us
369
+ 1992-03-01T11:15:12.400Z,-2.239,29.144,10,4.5,mb,,,,1.1,us,usp00053pf,2014-11-07T00:50:10.745Z,"30 km SW of Kibuye, Rwanda",earthquake,,,,7,reviewed,us,us
370
+ 1992-03-02T20:30:42.570Z,5.219,31.578,10,4.7,mb,,,,1.1,us,usp00053sf,2020-08-29T01:18:28.706Z,"40 km N of Juba, South Sudan",earthquake,,,,5,reviewed,us,us
371
+ 1992-03-05T08:55:05.600Z,11.513,42.812,7.4,6.2,mw,,,,1.3,us,usp00053wj,2022-04-28T18:51:19.513Z,"4 km WSW of Arta, Djibouti",earthquake,,3.6,,,reviewed,us,hrv
372
+ 1992-04-04T12:40:02.410Z,11.685,46.058,10,4.6,mb,,,,1.3,us,usp00055av,2014-11-07T00:50:24.555Z,"164 km SE of Aden, Yemen",earthquake,,,,2,reviewed,us,us
373
+ 1992-04-08T01:28:52.290Z,11.997,45.972,10,5,mb,,,,1.2,us,usp00055g7,2014-11-07T00:50:25.719Z,"133 km SE of Aden, Yemen",earthquake,,,,29,reviewed,us,us
374
+ 1992-04-08T01:55:51.030Z,11.826,45.95,10,4.8,mb,,,,1.2,us,usp00055g8,2014-11-07T00:50:25.724Z,"144 km SE of Aden, Yemen",earthquake,,,,8,reviewed,us,us
375
+ 1992-05-17T02:38:32.360Z,-9.86,34.021,28,4.9,mb,,,,1.6,us,usp00057ge,2014-11-07T00:50:38.102Z,"12 km NE of Karonga, Malawi",earthquake,,,,5,reviewed,us,us
376
+ 1992-05-17T03:10:14.870Z,-9.953,34.24,31.7,4.8,mb,,,,1.3,us,usp00057gf,2014-11-07T00:50:38.105Z,"33 km E of Karonga, Malawi",earthquake,,,,5,reviewed,us,us
377
+ 1992-05-19T01:26:44.620Z,13.842,44.03,10,4.5,mb,,,,0.8,us,usp00057nq,2020-08-29T01:30:30.507Z,"9 km W of Dh? as Suf?l, Yemen",earthquake,,,,19,reviewed,us,us
378
+ 1992-09-11T03:57:26.500Z,-6.087,26.651,10.8,6.4,mwb,,,,1,us,usp0005dur,2022-04-28T18:35:57.844Z,"29 km W of Kabalo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,us
379
+ 1992-09-15T00:29:57.830Z,-6.072,26.301,10,4.5,mb,,,,1.7,us,usp0005e01,2014-11-07T00:51:28.730Z,"67 km W of Kabalo, Democratic Republic of the Congo",earthquake,,,,1,reviewed,us,us
380
+ 1992-09-16T18:34:46.630Z,-6.337,26.622,10,4.6,mb,,,,1.7,us,usp0005e31,2014-11-07T00:51:29.173Z,"45 km SW of Kabalo, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
381
+ 1992-09-19T14:20:04.500Z,-6.25,26.658,16.4,4.8,mb,,,,1,us,usp0005e74,2014-11-07T00:51:29.621Z,"35 km SW of Kabalo, Democratic Republic of the Congo",earthquake,,,,27,reviewed,us,us
382
+ 1992-09-23T14:52:27.640Z,-6.163,26.718,11.2,5.6,mw,,,,1.1,us,usp0005ecs,2022-04-28T18:37:14.033Z,"24 km WSW of Kabalo, Democratic Republic of the Congo",earthquake,,,,,reviewed,us,hrv
383
+ 1992-09-25T00:39:21.800Z,-6.184,26.836,10,4.9,mb,,,,0.9,us,usp0005efd,2014-11-07T00:51:30.648Z,"16 km SSW of Kabalo, Democratic Republic of the Congo",earthquake,,,,2,reviewed,us,us
384
+ 1992-10-12T23:42:09.290Z,5.017,32.021,33,4.6,mb,,,,1.3,us,usp0005f8v,2020-08-29T01:51:14.629Z,"51 km ENE of Juba, South Sudan",earthquake,,,,15,reviewed,us,us
385
+ 1992-10-13T16:22:11.760Z,4.793,32.108,33,4.7,mb,,,,1.1,us,usp0005f9v,2020-08-29T01:51:24.510Z,"58 km E of Juba, South Sudan",earthquake,,,,12,reviewed,us,us
386
+ 1992-10-21T15:05:24.670Z,-6.322,26.772,10,4.8,mb,,,,1,us,usp0005fpj,2014-11-07T00:51:42.141Z,"33 km SSW of Kabalo, Democratic Republic of the Congo",earthquake,,,,22,reviewed,us,us
387
+ 1992-12-01T13:23:18.190Z,-17.156,35.312,33,4.5,mb,,,,1.1,us,usp0005hpr,2014-11-07T00:51:58.407Z,"26 km SSE of Nsanje, Malawi",earthquake,,,,3,reviewed,us,us
388
+ 1992-12-04T00:38:18.340Z,12.132,46.303,10,4.6,mb,,,,1.5,us,usp0005hsy,2014-11-07T00:51:59.443Z,"148 km SE of Zinjib?r, Yemen",earthquake,,,,6,reviewed,us,us
389
+ 1992-12-13T05:07:40.660Z,-4.113,32.254,33,4.6,mb,,,,1.7,us,usp0005j7s,2014-11-07T00:52:02.429Z,"49 km SW of Kahama, Tanzania",earthquake,,,,7,reviewed,us,us
390
+ 1993-01-21T01:15:33.390Z,12.62,40.607,10,4.9,mb,,,,0.6,us,usp0005m0u,2014-11-07T00:52:15.888Z,"101 km NNW of Semera, Ethiopia",earthquake,,,,1,reviewed,us,us
391
+ 1993-01-24T16:43:06.660Z,-2.164,27.555,10,4.5,mb,,,,1.2,us,usp0005m6m,2014-11-07T00:52:16.457Z,"142 km WNW of Kabare, Democratic Republic of the Congo",earthquake,,,,18,reviewed,us,us
392
+ 1993-02-13T02:25:49.770Z,8.331,39.308,12.4,5.3,mw,,,,1,us,usp0005n0c,2022-04-28T18:20:03.685Z,"13 km SSE of Wenj?, Ethiopia",earthquake,,,,,reviewed,us,hrv
393
+ 1993-03-16T22:59:45.810Z,11.625,41.987,16.2,5.6,mw,,,,1,us,usp0005pn0,2022-04-28T18:18:45.772Z,"19 km ESE of Gâlâfi, Djibouti",earthquake,,,,,reviewed,us,hrv
394
+ 1993-04-04T18:20:52.150Z,-13.873,34.461,10,4.6,mb,,,,1.4,us,usp0005qnj,2014-11-07T00:52:45.875Z,"10 km S of Salima, Malawi",earthquake,,,,2,reviewed,us,us
395
+ 1993-04-11T19:41:42.430Z,-3.846,35.638,28.1,5.3,mb,,,,1,us,usp0005r13,2022-04-28T18:16:00.648Z,"11 km E of Mbulu, Tanzania",earthquake,,,,52,reviewed,us,us
396
+ 1993-04-23T16:35:40.430Z,-13.304,44.582,10,5,mb,,,,1.2,us,usp0005rp3,2014-11-07T00:52:51.777Z,"68 km SW of Kani Kéli, Mayotte",earthquake,,,,52,reviewed,us,us
397
+ 1993-05-02T10:08:09.240Z,14.439,40.116,10,4.7,mb,,,,0.8,us,usp0005s3a,2014-11-07T00:52:56.274Z,"72 km ENE of ?d?grat, Ethiopia",earthquake,,,,26,reviewed,us,us
398
+ 1993-05-02T17:58:23.030Z,14.577,40.099,10,4.8,mb,,,,0.9,us,usp0005s3w,2014-11-07T00:52:56.655Z,"76 km ENE of ?d?grat, Ethiopia",earthquake,,,,43,reviewed,us,us
399
+ 1993-05-02T21:34:17.900Z,14.453,39.77,33,4.6,ms,,,,1.4,us,usp0005s49,2014-11-07T00:52:56.839Z,"38 km ENE of ?d?grat, Ethiopia",earthquake,,,,2,reviewed,us,us
400
+ 1993-05-03T12:37:38.990Z,14.394,40.131,10,4.7,mb,,,,1.1,us,usp0005s58,2014-11-07T00:52:57.024Z,"73 km E of ?d?grat, Ethiopia",earthquake,,,,15,reviewed,us,us
401
+ 1993-05-04T16:46:08.920Z,14.562,40.167,10,4.5,mb,,,,0.7,us,usp0005s70,2014-11-07T00:52:57.464Z,"82 km ENE of ?d?grat, Ethiopia",earthquake,,,,15,reviewed,us,us
402
+ 1993-05-05T18:06:51.210Z,14.349,40.079,10,4.6,mb,,,,1.1,us,usp0005s90,2014-11-07T00:52:57.765Z,"67 km E of ?d?grat, Ethiopia",earthquake,,,,26,reviewed,us,us
403
+ 1993-05-06T20:35:55.620Z,14.395,40.126,10,5.3,mw,,,,1,us,usp0005sb9,2022-04-28T18:11:20.885Z,"72 km E of ?d?grat, Ethiopia",earthquake,,,,,reviewed,us,hrv
404
+ 1993-05-10T10:54:59.550Z,14.449,40.194,10,5.1,mb,,,,0.9,us,usp0005shq,2014-11-07T00:52:59.407Z,"81 km ENE of ?d?grat, Ethiopia",earthquake,,,,57,reviewed,us,us
405
+ 1993-05-11T03:44:10.560Z,14.516,40.242,25.2,4.8,ms,,,,0.8,us,usp0005ska,2014-11-07T00:52:59.560Z,"88 km ENE of ?d?grat, Ethiopia",earthquake,,,,1,reviewed,us,us
406
+ 1993-05-13T18:20:49.720Z,14.4,40.186,19.3,4.9,mb,,,,1.1,us,usp0005sqx,2022-04-28T18:11:52.126Z,"79 km E of ?d?grat, Ethiopia",earthquake,,,,59,reviewed,us,us
407
+ 1993-05-18T09:33:13.310Z,14.393,40.221,10,4.6,mb,,,,1,us,usp0005t0x,2014-11-07T00:53:01.956Z,"82 km E of ?d?grat, Ethiopia",earthquake,,,,11,reviewed,us,us
408
+ 1993-06-20T13:02:16.940Z,-6.131,26.862,10.6,4.9,mb,,,,1.2,us,usp0005ux6,2022-04-28T18:10:02.044Z,"10 km SSW of Kabalo, Democratic Republic of the Congo",earthquake,,,,37,reviewed,us,us
409
+ 1993-07-23T18:54:53.160Z,-5.469,35.784,10,5,mb,,,,1,us,usp0005x8m,2022-04-28T18:07:56.401Z,"62 km S of Kondoa, Tanzania",earthquake,,,,21,reviewed,us,us
410
+ 1993-07-23T19:01:33.110Z,-5.023,35.907,33,5.1,ms,,,,0.9,us,usp0005x8n,2022-04-28T18:07:58.203Z,"19 km SE of Kondoa, Tanzania",earthquake,,,,10,reviewed,us,us
411
+ 1993-07-31T02:32:45.840Z,-4.397,28.361,10,5,mb,,,,0.7,us,usp0005xqa,2014-11-07T00:53:34.817Z,"128 km WSW of Rumonge, Burundi",earthquake,,,,38,reviewed,us,us
412
+ 1993-08-11T17:11:34.720Z,-3.527,29.36,21.2,4.8,mb,,,,0.7,us,usp0005yce,2014-11-07T00:53:42.654Z,"16 km S of Bujumbura, Burundi",earthquake,,,,35,reviewed,us,us
413
+ 1993-09-03T10:50:54.070Z,-3.995,34.059,33,4.9,ms,,,,0.5,us,usp0005zpc,2014-11-07T00:53:54.258Z,"Lake Victoria region, Tanzania",earthquake,,,,1,reviewed,us,us
414
+ 1993-09-18T04:15:37.850Z,5.347,37.561,10,5.2,ms,,,,1.1,us,usp00060jr,2014-11-07T00:53:58.936Z,"13 km NE of Konso, Ethiopia",earthquake,,,,1,reviewed,us,us
415
+ 1993-09-21T19:11:35.940Z,11.478,39.638,15.2,5.7,mw,,,,1,us,usp00060t9,2022-04-28T18:01:03.576Z,"38 km N of Des?, Ethiopia",earthquake,,,,,reviewed,us,hrv
416
+ 1993-09-28T22:30:49.770Z,-2.526,28.602,10,4.9,mb,,,,1.5,us,usp000616h,2014-11-07T00:54:03.369Z,"21 km W of Kabare, Democratic Republic of the Congo",earthquake,,,,37,reviewed,us,us
417
+ 1993-10-18T05:50:17.430Z,0.633,30.215,33,4.9,mb,,,,0.8,us,usp0006266,2022-04-28T17:58:11.523Z,"7 km WSW of Fort Portal, Uganda",earthquake,,,,13,reviewed,us,us
418
+ 1993-12-01T22:04:22.360Z,-12.781,44.766,10,5.2,mb,,,,1.1,us,usp00064hn,2014-11-07T00:54:31.438Z,"32 km W of Acoua, Mayotte",earthquake,,,,41,reviewed,us,us
419
+ 1994-01-26T02:26:00.700Z,5.314,37.411,10,4.9,mb,,,,0.9,us,usp00067f0,2014-11-07T00:54:50.642Z,"10 km NW of Konso, Ethiopia",earthquake,,,,20,reviewed,us,us
420
+ 1994-02-05T23:34:09.970Z,0.593,30.037,14.2,6.2,mwb,,,,1.1,us,usp000683u,2022-04-28T17:48:57.245Z,"13 km SSW of Bundibugyo, Uganda",earthquake,,,,,reviewed,us,us
421
+ 1994-02-06T00:03:14.800Z,3.826,27.162,10,4.7,mb,,,,1,us,usp000683y,2020-09-15T16:56:37.637Z,"126 km NNW of Isiro, Democratic Republic of the Congo",earthquake,,,,12,reviewed,us,us
422
+ 1994-02-06T00:14:14.550Z,5.524,25.222,10,4.9,mb,,,,1.2,us,usp000683z,2020-09-15T16:56:47.996Z,"55 km N of Zemio, Central African Republic",earthquake,,,,36,reviewed,us,us
423
+ 1994-03-09T08:25:05.580Z,-1.803,29.795,33,4.8,mb,,,,0.8,us,usp00069eq,2014-11-07T00:55:07.617Z,"14 km N of Eglise Catholique, Centrale GIKO, Rwanda",earthquake,,,,17,reviewed,us,us
424
+ 1994-03-20T02:12:35.120Z,0.462,30.17,19.4,4.9,mb,,,,0.8,us,usp00069xx,2014-11-07T00:55:10.177Z,"24 km SSW of Fort Portal, Uganda",earthquake,,,,41,reviewed,us,us
425
+ 1994-03-29T22:59:21.190Z,0.487,30.166,10,4.5,mb,,,,0.5,us,usp0006ac8,2014-11-07T00:55:11.504Z,"22 km SSW of Fort Portal, Uganda",earthquake,,,,14,reviewed,us,us
426
+ 1994-04-11T11:20:21.490Z,11.735,42.859,15.5,5.9,mw,,,,1.3,us,usp0006ay7,2022-04-28T17:44:45.801Z,"6 km SSW of Tadjourah, Djibouti",earthquake,,,,,reviewed,us,hrv
427
+ 1994-04-24T02:57:10.730Z,11.604,43.014,10,5.6,mw,,,,1.1,us,usp0006bhx,2022-04-28T17:46:26.435Z,"14 km W of Djibouti, Djibouti",earthquake,,,,,reviewed,us,hrv
428
+ 1994-04-24T09:52:57.600Z,-9.052,30.396,29.7,5.1,mb,,,,0.8,us,usp0006bj6,2022-04-28T17:46:31.872Z,"46 km NE of Mporokoso, Zambia",earthquake,,,,51,reviewed,us,us
429
+ 1994-04-26T18:02:03.470Z,11.874,44.636,10,4.5,ms,,,,1.3,us,usp0006bpb,2014-11-07T00:55:21.171Z,"109 km SSW of Aden, Yemen",earthquake,,,,1,reviewed,us,us
430
+ 1994-04-28T06:35:53.360Z,11.486,45.938,10,4.8,mb,,,,1.3,us,usp0006brs,2014-11-07T00:55:21.600Z,"153 km NE of Berbera, Somalia",earthquake,,,,6,reviewed,us,us
431
+ 1994-05-22T00:50:20.280Z,0.011,29.928,10,4.6,mb,,,,0.7,us,usp0006cww,2014-11-07T00:55:30.052Z,"22 km SSW of Kilembe, Uganda",earthquake,,,,21,reviewed,us,us
432
+ 1994-08-07T14:14:22.930Z,13.334,39.657,11.1,4.9,mb,,,,1.3,us,usp0006gp2,2014-11-07T00:56:01.134Z,"26 km SE of Mek'ele, Ethiopia",earthquake,,,,34,reviewed,us,us
433
+ 1994-08-18T00:45:47.200Z,-7.433,31.751,25.2,5.9,mwb,,,,1,us,usp0006h32,2022-04-28T17:34:12.953Z,"55 km ENE of Chala, Tanzania",earthquake,,,,,reviewed,us,us
434
+ 1994-08-22T19:56:50.190Z,4.525,35.034,10,4.7,mb,,,,1,us,usp0006hbk,2014-11-07T00:56:07.089Z,"123 km WSW of Lobuni, Ethiopia",earthquake,,,,19,reviewed,us,us
435
+ 1994-08-31T14:59:56.900Z,1.603,31.002,10,5,mb,,,,0.9,us,usp0006hr9,2022-04-28T17:35:35.740Z,"34 km W of Kigorobya, Uganda",earthquake,,,,39,reviewed,us,us
436
+ 1994-11-12T12:18:00.050Z,-6.947,29.916,21.7,4.9,mb,,,,0.9,us,usp0006nez,2022-04-28T17:20:22.391Z,"59 km WSW of Karema, Tanzania",earthquake,,,,22,reviewed,us,us
20260904-004544-science-environment-91c12e/environment/public_data/main.py ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import importlib.util
4
+ import json
5
+ import os
6
+ import shlex
7
+ import shutil
8
+ from pathlib import Path
9
+ from typing import Any
10
+
11
+
12
+ class Task:
13
+ def __init__(self, task_id: str, description: str, metadata: dict[str, Any]):
14
+ self.task_id = task_id
15
+ self.description = description
16
+ self.prompt = description
17
+ self.metadata = metadata
18
+ self.computer = {"setup_config": {"os_type": "linux"}}
19
+
20
+
21
+ def _task_dir() -> Path:
22
+ return Path(__file__).resolve().parent
23
+
24
+
25
+ def _load_card() -> dict[str, Any]:
26
+ path = _task_dir() / "task_card.json"
27
+ if not path.is_file():
28
+ return {
29
+ "taskId": os.environ.get("ALE_TASK_ID", "science_environment/usgs_east_africa_annual_depth_audit"),
30
+ "taskPrompt": "Task card has not been rendered yet; this fallback exists for stage-03 hook smoke only.",
31
+ "metadata": {
32
+ "domain": "science_environment",
33
+ "task": "usgs_east_africa_annual_depth_audit",
34
+ "variant": "base",
35
+ "domain_name": "science_environment",
36
+ "task_name": "usgs_east_africa_annual_depth_audit",
37
+ "variant_name": "base",
38
+ "requires_task_data": True,
39
+ "task_dir": "/media/user/data/agenthle/science_environment/usgs_east_africa_annual_depth_audit/base",
40
+ "input_dir": "/media/user/data/agenthle/science_environment/usgs_east_africa_annual_depth_audit/base/input",
41
+ "software_dir": "/media/user/data/agenthle/science_environment/usgs_east_africa_annual_depth_audit/base/software",
42
+ "remote_output_dir": "/media/user/data/agenthle/science_environment/usgs_east_africa_annual_depth_audit/base/output",
43
+ "reference_dir": "/media/user/data/agenthle/science_environment/usgs_east_africa_annual_depth_audit/base/reference",
44
+ },
45
+ }
46
+ with path.open("r", encoding="utf-8") as handle:
47
+ return json.load(handle)
48
+
49
+
50
+ def load() -> list[Task]:
51
+ card = _load_card()
52
+ metadata = dict(card.get("metadata") or {})
53
+ if not metadata:
54
+ domain, _, task = str(card["taskId"]).partition("/")
55
+ variant = "base"
56
+ task_dir = f"/media/user/data/agenthle/{domain}/{task}/{variant}"
57
+ metadata.update({
58
+ "domain": domain,
59
+ "task": task,
60
+ "variant": variant,
61
+ "domain_name": domain,
62
+ "task_name": task,
63
+ "variant_name": variant,
64
+ "requires_task_data": True,
65
+ "task_dir": task_dir,
66
+ "input_dir": f"{task_dir}/input",
67
+ "software_dir": f"{task_dir}/software",
68
+ "remote_output_dir": f"{task_dir}/output",
69
+ "reference_dir": f"{task_dir}/reference",
70
+ })
71
+ return [Task(task_id=card["taskId"], description=card["taskPrompt"], metadata=metadata)]
72
+
73
+
74
+ def _metadata(cfg: Any = None) -> dict[str, Any]:
75
+ if cfg is None:
76
+ return {}
77
+ value = getattr(cfg, "metadata", None)
78
+ return value if isinstance(value, dict) else {}
79
+
80
+
81
+ def _remote_path(metadata: dict[str, Any], key: str, fallback: str) -> str:
82
+ value = str(metadata.get(key) or "").strip()
83
+ return value or fallback
84
+
85
+
86
+ async def _remote_run(session: Any, command: str, *, check: bool = False) -> Any:
87
+ try:
88
+ return await session.run_command(command, check=check)
89
+ except TypeError:
90
+ return await session.run_command(command)
91
+
92
+
93
+ async def _remote_start(cfg: Any, session: Any) -> dict[str, Any]:
94
+ metadata = _metadata(cfg)
95
+ output_dir = _remote_path(metadata, "remote_output_dir", "output")
96
+ input_dir = _remote_path(metadata, "input_dir", "input")
97
+ software_dir = _remote_path(metadata, "software_dir", "software")
98
+ command = (
99
+ "set -eu\n"
100
+ f"mkdir -p {shlex.quote(output_dir)}\n"
101
+ f"find {shlex.quote(output_dir)} -mindepth 1 -maxdepth 1 -exec rm -rf -- {{}} +\n"
102
+ )
103
+ await _remote_run(session, command, check=True)
104
+ return {"ok": True, "input_dir": input_dir, "software_dir": software_dir, "output_dir": output_dir}
105
+
106
+
107
+ def start(cfg: Any = None, session: Any = None) -> dict[str, Any]:
108
+ if session is not None:
109
+ return _remote_start(cfg, session)
110
+ del cfg
111
+ output_dir = Path(os.environ.get("ALE_OUTPUT_DIR", "output"))
112
+ output_dir.mkdir(parents=True, exist_ok=True)
113
+ for child in output_dir.iterdir():
114
+ if child.is_dir():
115
+ shutil.rmtree(child)
116
+ else:
117
+ child.unlink()
118
+ input_dir = Path(os.environ.get("ALE_INPUT_DIR", "input"))
119
+ software_dir = Path(os.environ.get("ALE_SOFTWARE_DIR", "software"))
120
+ return {
121
+ "ok": True,
122
+ "input_dir": str(input_dir),
123
+ "software_dir": str(software_dir),
124
+ "output_dir": str(output_dir),
125
+ }
126
+
127
+
128
+ async def _remote_evaluate(cfg: Any, session: Any) -> list[float]:
129
+ metadata = _metadata(cfg)
130
+ output_dir = _remote_path(metadata, "remote_output_dir", "output")
131
+ reference_dir = _remote_path(metadata, "reference_dir", "reference")
132
+ script = f"""
133
+ import importlib.util
134
+ import json
135
+ import pathlib
136
+
137
+ output_dir = pathlib.Path({output_dir!r})
138
+ reference_dir = pathlib.Path({reference_dir!r})
139
+ evaluator_path = reference_dir / "evaluator.py"
140
+ if not evaluator_path.is_file():
141
+ raise FileNotFoundError(f"hidden evaluator is missing: {{evaluator_path}}")
142
+ spec = importlib.util.spec_from_file_location("hidden_ale_evaluator", evaluator_path)
143
+ if spec is None or spec.loader is None:
144
+ raise RuntimeError(f"cannot import hidden evaluator: {{evaluator_path}}")
145
+ module = importlib.util.module_from_spec(spec)
146
+ spec.loader.exec_module(module)
147
+ result = module.evaluate(output_dir, reference_dir)
148
+ print(json.dumps(result))
149
+ """
150
+ command = "python3 - <<'PY'\n" + script + "\nPY"
151
+ result = await _remote_run(session, command, check=True)
152
+ stdout = getattr(result, "stdout", "") or ""
153
+ for line in reversed([item.strip() for item in stdout.splitlines() if item.strip()]):
154
+ try:
155
+ payload = json.loads(line)
156
+ if isinstance(payload, list):
157
+ return [float(max(0.0, min(1.0, value))) for value in payload]
158
+ except Exception:
159
+ continue
160
+ raise RuntimeError("hidden evaluator did not emit a JSON score list")
161
+
162
+
163
+ def evaluate(cfg: Any = None, session: Any = None) -> list[float]:
164
+ if session is not None:
165
+ return _remote_evaluate(cfg, session)
166
+ del cfg
167
+ output_dir = Path(os.environ.get("ALE_OUTPUT_DIR", "output"))
168
+ reference_dir = Path(os.environ.get("ALE_REFERENCE_DIR", "reference"))
169
+ evaluator_path = reference_dir / "evaluator.py"
170
+ if not evaluator_path.is_file():
171
+ raise FileNotFoundError(f"hidden evaluator is missing: {evaluator_path}")
172
+ spec = importlib.util.spec_from_file_location("hidden_ale_evaluator", evaluator_path)
173
+ if spec is None or spec.loader is None:
174
+ raise RuntimeError(f"cannot import hidden evaluator: {evaluator_path}")
175
+ module = importlib.util.module_from_spec(spec)
176
+ spec.loader.exec_module(module)
177
+ result = module.evaluate(output_dir, reference_dir)
178
+ if not isinstance(result, list):
179
+ raise TypeError("hidden evaluator must return list[float]")
180
+ return [float(max(0.0, min(1.0, value))) for value in result]
20260904-004544-science-environment-91c12e/environment/public_data/software/validate_outputs.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import json
5
+ import os
6
+ import sys
7
+ from pathlib import Path
8
+
9
+
10
+ def required_outputs(input_dir: Path) -> list[str]:
11
+ spec_path = input_dir / "analysis_spec.json"
12
+ if spec_path.is_file():
13
+ payload = json.loads(spec_path.read_text(encoding="utf-8"))
14
+ required = payload.get("required_outputs") if isinstance(payload, dict) else None
15
+ if isinstance(required, list):
16
+ rows = [str(item.get("path") or "") for item in required if isinstance(item, dict)]
17
+ rows = [item for item in rows if item]
18
+ if rows:
19
+ return rows
20
+ return [
21
+ "summary.json",
22
+ "magnitude_depth_bins.csv",
23
+ "region_daily_counts.csv",
24
+ "filtered_events.geojson",
25
+ ]
26
+
27
+
28
+ def main() -> int:
29
+ output_dir = Path(sys.argv[1]) if len(sys.argv) > 1 else Path("output")
30
+ input_dir = Path(sys.argv[2]) if len(sys.argv) > 2 else Path(os.environ.get("ALE_INPUT_DIR", "input"))
31
+ required = required_outputs(input_dir)
32
+ missing = [name for name in required if not (output_dir / name).is_file()]
33
+ if missing:
34
+ print(json.dumps({"ok": False, "missing": missing}, indent=2))
35
+ return 1
36
+ print(json.dumps({"ok": True, "required": required}, indent=2))
37
+ return 0
38
+
39
+
40
+ if __name__ == "__main__":
41
+ raise SystemExit(main())
20260904-004544-science-environment-91c12e/environment/public_data/task_card.json ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "taskId": "science_environment/usgs_east_africa_annual_depth_audit",
3
+ "title": "USGS Fdsn Eq East Africa 1985 1985 M5p5 Depth Mean Quota Repair 0723",
4
+ "summary": "Audit the real USGS FDSN East African Rift earthquake catalog for 1976-1994-1976-1994 (events with magnitude >= 5.5) and produce reproducible annual annual mean focal depth (km) statistics, decadal aggregates, threshold-year checks, and a cleaned local series.",
5
+ "category": "science_environment",
6
+ "taxonomy": {
7
+ "domain_id": "science_environment",
8
+ "domain_code": "science_environment",
9
+ "subdomain_id": "science_environment.data_analysis",
10
+ "subdomain_code": "data_analysis",
11
+ "subdomain_name": "Data Analysis",
12
+ "classifier": {
13
+ "source": "deterministic task metadata",
14
+ "rationale": "CLI-only task derived from a public, reproducible workflow seed."
15
+ }
16
+ },
17
+ "taskPrompt": "Use a Linux command-line workflow to complete this local data-audit task. Read only the staged files in input/ and software/, write final deliverables under output/, and do not use network access, credentials, GUI tools, browser automation, Windows-only tooling, or mobile apps. The authoritative public contract is input/analysis_spec.json; if any wording elsewhere is less specific, follow analysis_spec.json for file names, columns, filters, grouping rules, rounding rules, and output schemas. The workflow kind is csv_annual_series_audit. The primary staged data file is input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv. Produce exactly these required deliverables: output/summary.json, output/decadal_statistics.csv, output/threshold_years.csv, output/clean_series.csv. The output schemas are:\n- output/summary.json: JSON keys and nested shape {\"first_threshold_year\": \"integer|null\", \"last_threshold_year\": \"integer|null\", \"row_count\": \"integer valid annual rows\", \"series_name\": \"string\", \"source_row_count\": \"integer raw rows before annual aggregation\", \"threshold\": \"number\", \"value\": {\"max\": \"number|null\", \"max_year\": \"integer|null\", \"mean\": \"number|null\", \"median\": \"number|null\", \"min\": \"number|null\", \"min_year\": \"integer|null\", \"sample_std\": \"number|null\"}, \"year_aggregation\": \"string annual aggregation applied to raw rows\", \"year_range\": {\"end\": \"integer|null\", \"start\": \"integer|null\"}, \"years_at_or_above_threshold\": \"integer\"}\n- output/decadal_statistics.csv: CSV header exactly decade_start, start_year, end_year, count, mean_departure, median_departure, min_departure, max_departure, sample_std_departure\n- output/threshold_years.csv: CSV header exactly rank, year, departure, threshold\n- output/clean_series.csv: CSV header exactly Year, Departure from Average\nCompute all requested values from the staged data rather than hard-coding constants. Use deterministic ordering, UTF-8 text, explicit CSV headers, valid JSON/GeoJSON where applicable, and stable numeric formatting. You may run software/validate_outputs.py as a public sanity check after writing outputs, but the deliverables in output/ are what will be evaluated.",
18
+ "agentMustDo": [
19
+ "Read input/analysis_spec.json first and treat it as the authoritative public specification.",
20
+ "Read input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv and compute results from the staged local data.",
21
+ "Create output/summary.json as json exactly as specified by analysis_spec.json.",
22
+ "Create output/decadal_statistics.csv as csv exactly as specified by analysis_spec.json.",
23
+ "Create output/threshold_years.csv as csv exactly as specified by analysis_spec.json.",
24
+ "Create output/clean_series.csv as csv exactly as specified by analysis_spec.json.",
25
+ "Place every final deliverable directly under output/ with the exact required filename.",
26
+ "Use only local staged files and installed Linux CLI tooling; do not download fresh data."
27
+ ],
28
+ "inputFiles": [
29
+ {
30
+ "name": "README.md",
31
+ "format": "Markdown",
32
+ "path": "input/README.md",
33
+ "description": "Agent-visible staged input file for this task."
34
+ },
35
+ {
36
+ "name": "analysis_spec.json",
37
+ "format": "JSON",
38
+ "path": "input/analysis_spec.json",
39
+ "description": "Agent-visible staged input file for this task."
40
+ },
41
+ {
42
+ "name": "source_context_windows.jsonl",
43
+ "format": "JSONL",
44
+ "path": "input/source_context_windows.jsonl",
45
+ "description": "Agent-visible staged input file for this task."
46
+ },
47
+ {
48
+ "name": "usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv",
49
+ "format": "CSV",
50
+ "path": "input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv",
51
+ "description": "Agent-visible staged input file for this task."
52
+ }
53
+ ],
54
+ "referenceFiles": [
55
+ {
56
+ "name": "summary.json",
57
+ "format": "JSON",
58
+ "path": "output/summary.json",
59
+ "description": "Required agent output file evaluated against hidden reference data."
60
+ },
61
+ {
62
+ "name": "decadal_statistics.csv",
63
+ "format": "CSV",
64
+ "path": "output/decadal_statistics.csv",
65
+ "description": "Required agent output file evaluated against hidden reference data."
66
+ },
67
+ {
68
+ "name": "threshold_years.csv",
69
+ "format": "CSV",
70
+ "path": "output/threshold_years.csv",
71
+ "description": "Required agent output file evaluated against hidden reference data."
72
+ },
73
+ {
74
+ "name": "clean_series.csv",
75
+ "format": "CSV",
76
+ "path": "output/clean_series.csv",
77
+ "description": "Required agent output file evaluated against hidden reference data."
78
+ }
79
+ ],
80
+ "software": [
81
+ "Python 3.11",
82
+ "standard Unix shell",
83
+ "software/validate_outputs.py"
84
+ ],
85
+ "requiredSystemPackages": [],
86
+ "evaluation": "Final required files under output/ are compared against standard-reference outputs generated by the deterministic workflow for this task.",
87
+ "vm": {
88
+ "machineType": "c4-standard-4",
89
+ "snapshot": "cpu-free-ubuntu",
90
+ "timeout": 7200
91
+ }
92
+ }
20260904-004544-science-environment-91c12e/instruction.md ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # USGS Fdsn Eq East Africa 1985 1985 M5p5 Depth Mean Quota Repair 0723
2
+
3
+ Audit the real USGS FDSN East African Rift earthquake catalog for 1976-1994-1976-1994 (events with magnitude >= 5.5) and produce reproducible annual annual mean focal depth (km) statistics, decadal aggregates, threshold-year checks, and a cleaned local series.
4
+
5
+ ## Task
6
+
7
+ Use a Linux command-line workflow to complete this local data-audit task. Read only the staged files in input/ and software/, write final deliverables under output/, and do not use network access, credentials, GUI tools, browser automation, Windows-only tooling, or mobile apps. The authoritative public contract is input/analysis_spec.json; if any wording elsewhere is less specific, follow analysis_spec.json for file names, columns, filters, grouping rules, rounding rules, and output schemas. The workflow kind is csv_annual_series_audit. The primary staged data file is input/usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723.csv. Produce exactly these required deliverables: output/summary.json, output/decadal_statistics.csv, output/threshold_years.csv, output/clean_series.csv. The output schemas are:
8
+ - output/summary.json: JSON keys and nested shape {"first_threshold_year": "integer|null", "last_threshold_year": "integer|null", "row_count": "integer valid annual rows", "series_name": "string", "source_row_count": "integer raw rows before annual aggregation", "threshold": "number", "value": {"max": "number|null", "max_year": "integer|null", "mean": "number|null", "median": "number|null", "min": "number|null", "min_year": "integer|null", "sample_std": "number|null"}, "year_aggregation": "string annual aggregation applied to raw rows", "year_range": {"end": "integer|null", "start": "integer|null"}, "years_at_or_above_threshold": "integer"}
9
+ - output/decadal_statistics.csv: CSV header exactly decade_start, start_year, end_year, count, mean_departure, median_departure, min_departure, max_departure, sample_std_departure
10
+ - output/threshold_years.csv: CSV header exactly rank, year, departure, threshold
11
+ - output/clean_series.csv: CSV header exactly Year, Departure from Average
12
+ Compute all requested values from the staged data rather than hard-coding constants. Use deterministic ordering, UTF-8 text, explicit CSV headers, valid JSON/GeoJSON where applicable, and stable numeric formatting. You may run software/validate_outputs.py as a public sanity check after writing outputs, but the deliverables in output/ are what will be evaluated.
13
+
14
+ ## Workspace
15
+
16
+ You are working in `/workspace`.
17
+
18
+ - Public input files are under `/workspace/input/`.
19
+ - Public helper software and validation scripts are under `/workspace/software/`.
20
+ - The public task card is available at `/workspace/task_card.json`.
21
+ - The public task driver is available at `/workspace/main.py` for reference only.
22
+ - Do not use hidden reference data, network downloads, credentials, GUI tools, or browser automation.
23
+
24
+ ## Required Outputs
25
+
26
+ Create every final deliverable exactly at these paths:
27
+
28
+ - `/workspace/output/summary.json` (json)
29
+ - `/workspace/output/decadal_statistics.csv` (csv)
30
+ - `/workspace/output/threshold_years.csv` (csv)
31
+ - `/workspace/output/clean_series.csv` (csv)
32
+
33
+ Follow `/workspace/input/analysis_spec.json` whenever it is more specific than prose. You may run public validation helpers, but the files under `/workspace/output/` are what will be evaluated.
20260904-004544-science-environment-91c12e/solution/internal/workflow_adapters_runtime.py ADDED
@@ -0,0 +1,679 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import datetime as dt
5
+ import html
6
+ import json
7
+ import math
8
+ import re
9
+ import shutil
10
+ import statistics
11
+ from pathlib import Path
12
+ from typing import Any
13
+
14
+
15
+ def _read_json(path: Path) -> Any:
16
+ with path.open("r", encoding="utf-8") as handle:
17
+ return json.load(handle)
18
+
19
+
20
+ def _write_json(path: Path, payload: Any) -> None:
21
+ path.parent.mkdir(parents=True, exist_ok=True)
22
+ with path.open("w", encoding="utf-8") as handle:
23
+ json.dump(payload, handle, ensure_ascii=False, indent=2)
24
+ handle.write("\n")
25
+
26
+ def _stable_region(place: str) -> str:
27
+ if not place:
28
+ return "unknown"
29
+ if "," in place:
30
+ return place.split(",")[-1].strip() or place.strip()
31
+ parts = place.split()
32
+ return " ".join(parts[-2:]) if len(parts) >= 2 else place.strip()
33
+
34
+
35
+ def _mag_bin(value: float | None) -> str:
36
+ if value is None or math.isnan(value):
37
+ return "unknown"
38
+ lower = math.floor(value)
39
+ upper = lower + 1
40
+ return f"{lower:.0f}-{upper:.0f}"
41
+
42
+
43
+ def _depth_bin(value: float | None) -> str:
44
+ if value is None or math.isnan(value):
45
+ return "unknown"
46
+ if value < 0:
47
+ return "<0"
48
+ if value < 10:
49
+ return "0-10"
50
+ if value < 30:
51
+ return "10-30"
52
+ if value < 70:
53
+ return "30-70"
54
+ if value < 300:
55
+ return "70-300"
56
+ return "300+"
57
+
58
+
59
+ def _clean_markup_text(raw: str) -> str:
60
+ text = re.sub(r"(?is)<(script|style|noscript)[^>]*>.*?</\1>", " ", raw)
61
+ text = re.sub(r"(?is)<br\s*/?>", "\n", text)
62
+ text = re.sub(r"(?is)</(p|div|li|tr|h[1-6]|pre)>", "\n", text)
63
+ text = re.sub(r"(?is)<[^>]+>", " ", text)
64
+ text = html.unescape(text)
65
+ text = re.sub(r"[ \t]+", " ", text)
66
+ text = re.sub(r"\n\s+", "\n", text)
67
+ return text.strip()
68
+
69
+
70
+ def _heading_slug(value: str) -> str:
71
+ slug = re.sub(r"[^a-z0-9]+", "_", value.lower()).strip("_")
72
+ return slug[:80] or "section"
73
+
74
+
75
+ def _extract_headings(raw: str) -> list[dict[str, str]]:
76
+ headings: list[dict[str, str]] = []
77
+ for match in re.finditer(r"(?is)<h([1-6])[^>]*>(.*?)</h\1>", raw):
78
+ text = _clean_markup_text(match.group(2))
79
+ if text:
80
+ headings.append({"level": f"h{match.group(1)}", "text": text})
81
+ if headings:
82
+ return headings
83
+ for line in raw.splitlines():
84
+ match = re.match(r"^(#{1,6})\s+(.+?)\s*$", line)
85
+ if match:
86
+ headings.append({"level": f"h{len(match.group(1))}", "text": match.group(2).strip()})
87
+ return headings
88
+
89
+
90
+ def _extract_code_blocks(raw: str) -> list[str]:
91
+ blocks: list[str] = []
92
+ for match in re.finditer(r"(?is)<pre[^>]*>(.*?)</pre>", raw):
93
+ text = _clean_markup_text(match.group(1))
94
+ if text:
95
+ blocks.append(text)
96
+ for match in re.finditer(r"(?is)<code[^>]*>(.*?)</code>", raw):
97
+ text = _clean_markup_text(match.group(1))
98
+ if text and text not in blocks:
99
+ blocks.append(text)
100
+ for match in re.finditer(r"(?s)```(?:[A-Za-z0-9_-]+)?\n(.*?)```", raw):
101
+ text = html.unescape(match.group(1).strip())
102
+ if text and text not in blocks:
103
+ blocks.append(text)
104
+ return blocks
105
+
106
+
107
+ def _window_rows(clean_text: str, *, width: int = 40, stride: int = 20) -> list[dict[str, Any]]:
108
+ words = re.findall(r"\S+", clean_text)
109
+ rows: list[dict[str, Any]] = []
110
+ if not words:
111
+ return rows
112
+ start = 0
113
+ while start < len(words):
114
+ end = min(start + width, len(words))
115
+ rows.append({
116
+ "window_id": len(rows) + 1,
117
+ "start_word": start,
118
+ "end_word": end,
119
+ "text": " ".join(words[start:end]),
120
+ })
121
+ if end == len(words):
122
+ break
123
+ start += stride
124
+ return rows
125
+
126
+
127
+ def _term_count(text: str, term: str) -> int:
128
+ term = term.strip()
129
+ if not term:
130
+ return 0
131
+ return len(re.findall(re.escape(term), text, flags=re.IGNORECASE))
132
+
133
+
134
+ def _first_window(windows: list[dict[str, Any]], term: str) -> str:
135
+ term_lower = term.lower()
136
+ for row in windows:
137
+ if term_lower in str(row.get("text") or "").lower():
138
+ return str(row.get("window_id") or "")
139
+ return ""
140
+
141
+
142
+ def _write_tutorial_public_inputs(input_dir: Path, source_path: Path, spec_payload: dict[str, Any]) -> None:
143
+ raw = source_path.read_text(encoding="utf-8", errors="replace")
144
+ # Tutorial examples may contain a maintainer's local Windows path. Keep
145
+ # the command semantics while preventing host-specific paths from entering
146
+ # the public task artifact.
147
+ sanitized_raw = re.sub(r"(?i)\b[A-Z]:\\(?:[^\\\r\n<>\"']+\\?)*[^\\\r\n<>\"']*", "./local.db", raw)
148
+ clean_text = _clean_markup_text(sanitized_raw)
149
+ windows = _window_rows(clean_text)
150
+ if len(windows) < 100:
151
+ raise ValueError(f"official tutorial source produced only {len(windows)} text windows; need at least 100")
152
+ required_terms = [str(item) for item in spec_payload.get("required_terms") or []]
153
+ code_terms = [str(item) for item in spec_payload.get("code_terms") or []]
154
+ input_dir.mkdir(parents=True, exist_ok=True)
155
+ destination = input_dir / str(spec_payload["source_file"])
156
+ # Always materialize the sanitized copy, including when the downloader
157
+ # already placed the source at the destination path.
158
+ destination.write_text(sanitized_raw, encoding="utf-8")
159
+ with (input_dir / str(spec_payload["input_file"])).open("w", encoding="utf-8", newline="") as handle:
160
+ fieldnames = ["window_id", "start_word", "end_word", "text", "contains_code_term", "matched_required_terms"]
161
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
162
+ writer.writeheader()
163
+ for row in windows:
164
+ text = str(row["text"])
165
+ matched = [term for term in required_terms if term.lower() in text.lower()]
166
+ contains_code = any(term.lower() in text.lower() for term in code_terms)
167
+ writer.writerow({
168
+ "window_id": row["window_id"],
169
+ "start_word": row["start_word"],
170
+ "end_word": row["end_word"],
171
+ "text": text,
172
+ "contains_code_term": "true" if contains_code else "false",
173
+ "matched_required_terms": "|".join(matched),
174
+ })
175
+ metadata = {
176
+ "software_name": spec_payload.get("software_name"),
177
+ "tutorial_url": spec_payload.get("tutorial_url"),
178
+ "source_urls": spec_payload.get("source_urls"),
179
+ "source_file": spec_payload.get("source_file"),
180
+ "window_file": spec_payload.get("input_file"),
181
+ "window_rule": spec_payload.get("window_rule"),
182
+ "required_terms": spec_payload.get("required_terms"),
183
+ "code_terms": spec_payload.get("code_terms"),
184
+ "note": "Provenance and public extraction rules only; scored aggregate values are intentionally not stored here.",
185
+ }
186
+ _write_json(input_dir / "tutorial_metadata.json", metadata)
187
+
188
+
189
+ def _source_context_text(path: Path) -> str:
190
+ try:
191
+ raw = path.read_text(encoding="utf-8", errors="replace")
192
+ except Exception:
193
+ return f"{path.name}\nsha256={_sha256_file(path)}\nsize_bytes={path.stat().st_size}\n"
194
+ if path.suffix.lower() in {".html", ".htm", ".md", ".txt"}:
195
+ return _clean_markup_text(raw)
196
+ return re.sub(r"\s+", " ", raw).strip()
197
+
198
+
199
+ def _ensure_public_input_footprint(input_dir: Path, source_paths: list[Path]) -> str:
200
+ current = _tree_file_bytes(input_dir)
201
+ if current >= MIN_PUBLIC_TASK_DATA_BYTES:
202
+ return f"public input footprint is {current} bytes; no context expansion needed"
203
+ context_path = input_dir / "source_context_windows.jsonl"
204
+ base = current - (context_path.stat().st_size if context_path.is_file() else 0)
205
+ context_path.unlink(missing_ok=True)
206
+ rows: list[dict[str, Any]] = []
207
+ for source in source_paths:
208
+ if not source.is_file() or source.resolve() == context_path.resolve():
209
+ continue
210
+ text = _source_context_text(source)
211
+ if not text:
212
+ continue
213
+ start = 0
214
+ width = 1800
215
+ stride = 900
216
+ while start < len(text):
217
+ end = min(len(text), start + width)
218
+ rows.append({
219
+ "source_file": source.relative_to(input_dir).as_posix() if source.is_relative_to(input_dir) else source.name,
220
+ "source_sha256": _sha256_file(source),
221
+ "start_char": start,
222
+ "end_char": end,
223
+ "text": text[start:end],
224
+ })
225
+ if end == len(text):
226
+ break
227
+ start += stride
228
+ if not rows:
229
+ raise ValueError("public input footprint expansion has no public source text")
230
+ input_dir.mkdir(parents=True, exist_ok=True)
231
+ rows_written = 0
232
+ target_extra = MIN_PUBLIC_TASK_DATA_BYTES - max(0, base)
233
+ with context_path.open("w", encoding="utf-8") as handle:
234
+ cycle = 0
235
+ while handle.tell() < target_extra or rows_written < 100:
236
+ row = dict(rows[rows_written % len(rows)])
237
+ row["window_id"] = rows_written + 1
238
+ row["cycle"] = cycle
239
+ handle.write(json.dumps(row, ensure_ascii=False) + "\n")
240
+ rows_written += 1
241
+ if rows_written % len(rows) == 0:
242
+ cycle += 1
243
+ handle.flush()
244
+ return f"wrote input/source_context_windows.jsonl with {rows_written} public-source windows and {context_path.stat().st_size} bytes"
245
+
246
+
247
+ def _write_software_manifest(software_dir: Path, spec_payload: dict[str, Any]) -> None:
248
+ if str(spec_payload.get("workflow_kind") or "") != "software_tutorial_doc_audit":
249
+ return
250
+ software_dir.mkdir(parents=True, exist_ok=True)
251
+ software_name = str(spec_payload.get("software_name") or "").strip()
252
+ executables = [str(item).strip() for item in spec_payload.get("executables") or [] if str(item).strip()]
253
+ system_packages = [str(item).strip() for item in spec_payload.get("required_system_packages") or [] if str(item).strip()]
254
+ source_urls = [str(item).strip() for item in spec_payload.get("source_urls") or [] if str(item).strip()]
255
+ _write_json(software_dir / "software_manifest.json", {
256
+ "software_name": software_name,
257
+ "executables": executables,
258
+ "required_system_packages": system_packages,
259
+ "official_sources": source_urls,
260
+ "solve_time_network": "disabled",
261
+ "python_wrapper_only": False,
262
+ "note": "This task audits real official software documentation/source staged offline; Python helpers only validate outputs.",
263
+ })
264
+ with (software_dir / "command_examples.csv").open("w", encoding="utf-8", newline="") as handle:
265
+ writer = csv.DictWriter(handle, fieldnames=["term", "kind", "software_name"])
266
+ writer.writeheader()
267
+ for term in spec_payload.get("code_terms") or []:
268
+ writer.writerow({"term": str(term), "kind": "code_term", "software_name": software_name})
269
+ for exe in executables:
270
+ writer.writerow({"term": exe, "kind": "executable", "software_name": software_name})
271
+
272
+
273
+ def software_tutorial_outputs(input_dir: Path, output_dir: Path) -> None:
274
+ spec = _read_json(input_dir / "analysis_spec.json")
275
+ source_file = str(spec["source_file"])
276
+ source_text = (input_dir / source_file).read_text(encoding="utf-8", errors="replace")
277
+ clean_text = _clean_markup_text(source_text)
278
+ headings = _extract_headings(source_text)
279
+ code_blocks = _extract_code_blocks(source_text)
280
+ window_rows: list[dict[str, str]] = []
281
+ with (input_dir / str(spec["input_file"])).open("r", encoding="utf-8", newline="") as handle:
282
+ window_rows = list(csv.DictReader(handle))
283
+ output_dir.mkdir(parents=True, exist_ok=True)
284
+
285
+ with (output_dir / "section_outline.csv").open("w", encoding="utf-8", newline="") as handle:
286
+ fieldnames = ["rank", "heading_level", "heading_text", "slug"]
287
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
288
+ writer.writeheader()
289
+ for rank, heading in enumerate(headings, start=1):
290
+ writer.writerow({
291
+ "rank": rank,
292
+ "heading_level": heading["level"],
293
+ "heading_text": heading["text"],
294
+ "slug": _heading_slug(heading["text"]),
295
+ })
296
+
297
+ all_terms: list[tuple[str, str]] = []
298
+ for term in spec.get("required_terms") or []:
299
+ all_terms.append((str(term), "required"))
300
+ for term in spec.get("code_terms") or []:
301
+ if str(term) not in {item[0] for item in all_terms}:
302
+ all_terms.append((str(term), "code"))
303
+ code_text = "\n".join(code_blocks)
304
+ term_rows: list[dict[str, Any]] = []
305
+ for term, category in all_terms:
306
+ term_rows.append({
307
+ "term": term,
308
+ "category": category,
309
+ "count": _term_count(clean_text, term),
310
+ "first_window": _first_window(window_rows, term),
311
+ "appears_in_code": "true" if term.lower() in code_text.lower() else "false",
312
+ })
313
+ term_rows.sort(key=lambda row: (str(row["category"]), str(row["term"]).lower()))
314
+ with (output_dir / "keyword_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
315
+ fieldnames = ["term", "category", "count", "first_window", "appears_in_code"]
316
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
317
+ writer.writeheader()
318
+ for row in term_rows:
319
+ writer.writerow(row)
320
+
321
+ code_terms = [str(item).lower() for item in spec.get("code_terms") or []]
322
+ with (output_dir / "code_block_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
323
+ fieldnames = ["block_index", "line_count", "char_count", "contains_code_term", "first_line"]
324
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
325
+ writer.writeheader()
326
+ for index, block in enumerate(code_blocks, start=1):
327
+ lines = [line for line in block.splitlines() if line.strip()]
328
+ contains = any(term and term in block.lower() for term in code_terms)
329
+ writer.writerow({
330
+ "block_index": index,
331
+ "line_count": len(lines),
332
+ "char_count": len(block),
333
+ "contains_code_term": "true" if contains else "false",
334
+ "first_line": lines[0][:200] if lines else "",
335
+ })
336
+
337
+ keyword_total = sum(int(row["count"]) for row in term_rows)
338
+ required_found = sum(1 for row in term_rows if row["category"] == "required" and int(row["count"]) > 0)
339
+ top_keyword = None
340
+ if term_rows:
341
+ top = max(term_rows, key=lambda row: (int(row["count"]), str(row["term"]).lower()))
342
+ top_keyword = str(top["term"]) if int(top["count"]) > 0 else None
343
+ summary = {
344
+ "software_name": str(spec.get("software_name") or ""),
345
+ "source_file": source_file,
346
+ "window_count": len(window_rows),
347
+ "heading_count": len(headings),
348
+ "code_block_count": len(code_blocks),
349
+ "keyword_total": keyword_total,
350
+ "unique_required_terms_found": required_found,
351
+ "top_keyword": top_keyword,
352
+ "source_character_count": len(clean_text),
353
+ }
354
+ _write_json(output_dir / "summary.json", summary)
355
+
356
+
357
+ def geojson_outputs(input_dir: Path, output_dir: Path) -> None:
358
+ payload = _read_json(input_dir / "events.geojson")
359
+ features = payload.get("features") if isinstance(payload, dict) else []
360
+ rows: list[dict[str, Any]] = []
361
+ for feature in features:
362
+ if not isinstance(feature, dict):
363
+ continue
364
+ props = feature.get("properties") if isinstance(feature.get("properties"), dict) else {}
365
+ geom = feature.get("geometry") if isinstance(feature.get("geometry"), dict) else {}
366
+ coords = geom.get("coordinates") if isinstance(geom.get("coordinates"), list) else []
367
+ mag = props.get("mag")
368
+ try:
369
+ mag = float(mag) if mag is not None else None
370
+ except (TypeError, ValueError):
371
+ mag = None
372
+ depth = None
373
+ if len(coords) >= 3:
374
+ try:
375
+ depth = float(coords[2])
376
+ except (TypeError, ValueError):
377
+ depth = None
378
+ time_ms = props.get("time")
379
+ date_utc = "unknown"
380
+ if isinstance(time_ms, (int, float)):
381
+ date_utc = dt.datetime.utcfromtimestamp(time_ms / 1000).date().isoformat()
382
+ rows.append({
383
+ "id": feature.get("id") or props.get("code") or "",
384
+ "mag": mag,
385
+ "depth": depth,
386
+ "place": str(props.get("place") or ""),
387
+ "region": _stable_region(str(props.get("place") or "")),
388
+ "date_utc": date_utc,
389
+ "feature": feature,
390
+ })
391
+ output_dir.mkdir(parents=True, exist_ok=True)
392
+ mags = [row["mag"] for row in rows if row["mag"] is not None]
393
+ depths = [row["depth"] for row in rows if row["depth"] is not None]
394
+ summary = {
395
+ "event_count": len(rows),
396
+ "magnitude": {
397
+ "count": len(mags),
398
+ "min": round(min(mags), 6) if mags else None,
399
+ "max": round(max(mags), 6) if mags else None,
400
+ "mean": round(statistics.fmean(mags), 6) if mags else None,
401
+ "median": round(statistics.median(mags), 6) if mags else None,
402
+ },
403
+ "depth_km": {
404
+ "count": len(depths),
405
+ "min": round(min(depths), 6) if depths else None,
406
+ "max": round(max(depths), 6) if depths else None,
407
+ "mean": round(statistics.fmean(depths), 6) if depths else None,
408
+ },
409
+ "time_range_utc": {
410
+ "start_date": min((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
411
+ "end_date": max((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
412
+ },
413
+ "quality_flags": {
414
+ "missing_magnitude": sum(1 for row in rows if row["mag"] is None),
415
+ "missing_depth": sum(1 for row in rows if row["depth"] is None),
416
+ "unique_regions": len({row["region"] for row in rows}),
417
+ },
418
+ }
419
+ _write_json(output_dir / "summary.json", summary)
420
+
421
+ grouped: dict[tuple[str, str], list[dict[str, Any]]] = {}
422
+ for row in rows:
423
+ grouped.setdefault((_mag_bin(row["mag"]), _depth_bin(row["depth"])), []).append(row)
424
+ with (output_dir / "magnitude_depth_bins.csv").open("w", encoding="utf-8", newline="") as handle:
425
+ fieldnames = ["mag_bin", "depth_bin", "event_count", "mean_magnitude", "max_magnitude"]
426
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
427
+ writer.writeheader()
428
+ for (mag_bin, depth_bin), group in sorted(grouped.items()):
429
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
430
+ writer.writerow({
431
+ "mag_bin": mag_bin,
432
+ "depth_bin": depth_bin,
433
+ "event_count": len(group),
434
+ "mean_magnitude": f"{statistics.fmean(group_mags):.6f}" if group_mags else "",
435
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
436
+ })
437
+
438
+ daily: dict[tuple[str, str], list[dict[str, Any]]] = {}
439
+ for row in rows:
440
+ daily.setdefault((row["region"], row["date_utc"]), []).append(row)
441
+ with (output_dir / "region_daily_counts.csv").open("w", encoding="utf-8", newline="") as handle:
442
+ fieldnames = ["region", "date_utc", "event_count", "max_magnitude"]
443
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
444
+ writer.writeheader()
445
+ for (region, date_utc), group in sorted(daily.items()):
446
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
447
+ writer.writerow({
448
+ "region": region,
449
+ "date_utc": date_utc,
450
+ "event_count": len(group),
451
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
452
+ })
453
+
454
+ filtered = [row["feature"] for row in rows if row["mag"] is not None and row["mag"] >= 4.5]
455
+ _write_json(output_dir / "filtered_events.geojson", {"type": "FeatureCollection", "features": filtered})
456
+
457
+
458
+ def csv_time_series_outputs(input_dir: Path, output_dir: Path) -> None:
459
+ spec = _read_json(input_dir / "analysis_spec.json")
460
+ csv_name = spec["input_file"]
461
+ date_column = spec["date_column"]
462
+ value_column = spec["value_column"]
463
+ rows: list[dict[str, Any]] = []
464
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
465
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
466
+ reader = csv.DictReader(lines)
467
+ for item in reader:
468
+ raw_date = item.get(date_column, "")
469
+ try:
470
+ day = dt.date.fromisoformat(raw_date)
471
+ except ValueError:
472
+ if raw_date.isdigit() and len(raw_date) == 4:
473
+ day = dt.date(int(raw_date), 1, 1)
474
+ else:
475
+ continue
476
+ raw_value = item.get(value_column, "")
477
+ try:
478
+ value = float(raw_value)
479
+ except (TypeError, ValueError):
480
+ value = None
481
+ rows.append({"date": day, "value": value, "raw": item})
482
+ rows.sort(key=lambda item: item["date"])
483
+ valid = [row for row in rows if row["value"] is not None]
484
+ output_dir.mkdir(parents=True, exist_ok=True)
485
+ monthly: dict[str, list[float]] = {}
486
+ for row in valid:
487
+ key = row["date"].strftime("%Y-%m")
488
+ monthly.setdefault(key, []).append(row["value"])
489
+ with (output_dir / "monthly_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
490
+ fieldnames = ["month", "count", "mean", "median", "min", "max"]
491
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
492
+ writer.writeheader()
493
+ for month, values in sorted(monthly.items()):
494
+ writer.writerow({
495
+ "month": month,
496
+ "count": len(values),
497
+ "mean": f"{statistics.fmean(values):.6f}",
498
+ "median": f"{statistics.median(values):.6f}",
499
+ "min": f"{min(values):.6f}",
500
+ "max": f"{max(values):.6f}",
501
+ })
502
+ existing_dates = {row["date"] for row in rows}
503
+ missing_days: list[dt.date] = []
504
+ if rows:
505
+ day = rows[0]["date"]
506
+ while day <= rows[-1]["date"]:
507
+ if day.weekday() < 5 and day not in existing_dates:
508
+ missing_days.append(day)
509
+ day += dt.timedelta(days=1)
510
+ with (output_dir / "missing_business_days.csv").open("w", encoding="utf-8", newline="") as handle:
511
+ writer = csv.DictWriter(handle, fieldnames=["date"])
512
+ writer.writeheader()
513
+ for day in missing_days:
514
+ writer.writerow({"date": day.isoformat()})
515
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
516
+ writer = csv.DictWriter(handle, fieldnames=["date", "value"])
517
+ writer.writeheader()
518
+ for row in valid:
519
+ writer.writerow({"date": row["date"].isoformat(), "value": f"{row['value']:.6f}"})
520
+ values = [row["value"] for row in valid]
521
+ summary = {
522
+ "series_name": spec.get("series_name", value_column),
523
+ "row_count": len(rows),
524
+ "valid_value_count": len(valid),
525
+ "missing_value_count": len(rows) - len(valid),
526
+ "missing_business_day_count": len(missing_days),
527
+ "date_range": {
528
+ "start": rows[0]["date"].isoformat() if rows else None,
529
+ "end": rows[-1]["date"].isoformat() if rows else None,
530
+ },
531
+ "value": {
532
+ "min": round(min(values), 6) if values else None,
533
+ "max": round(max(values), 6) if values else None,
534
+ "mean": round(statistics.fmean(values), 6) if values else None,
535
+ "median": round(statistics.median(values), 6) if values else None,
536
+ },
537
+ }
538
+ _write_json(output_dir / "summary.json", summary)
539
+
540
+
541
+ def _aggregate_annual_rows(rows: list[dict[str, Any]], aggregation: str) -> list[dict[str, Any]]:
542
+ if not aggregation:
543
+ return rows
544
+ grouped: dict[int, list[float]] = {}
545
+ for row in rows:
546
+ grouped.setdefault(int(row["year"]), []).append(float(row["value"]))
547
+ aggregated: list[dict[str, Any]] = []
548
+ for year, values in sorted(grouped.items()):
549
+ if aggregation == "mean":
550
+ value = statistics.fmean(values)
551
+ elif aggregation == "median":
552
+ value = statistics.median(values)
553
+ elif aggregation == "max":
554
+ value = max(values)
555
+ elif aggregation == "min":
556
+ value = min(values)
557
+ elif aggregation == "count":
558
+ value = float(len(values))
559
+ else:
560
+ raise ValueError(f"unsupported year_aggregation for csv_annual_series_audit: {aggregation}")
561
+ aggregated.append({"year": year, "value": value})
562
+ return aggregated
563
+
564
+
565
+ def csv_annual_series_outputs(input_dir: Path, output_dir: Path) -> None:
566
+ spec = _read_json(input_dir / "analysis_spec.json")
567
+ csv_name = spec["input_file"]
568
+ year_column = spec["year_column"]
569
+ value_column = spec["value_column"]
570
+ # Optional: derive the year from an ISO-8601 timestamp column (e.g. USGS FDSN
571
+ # `time` = "2022-06-29T19:17:58.929Z") instead of parsing an integer year.
572
+ # When unset, behaviour is unchanged (integer year column).
573
+ year_from_timestamp = bool(spec.get("year_from_timestamp", False))
574
+ year_aggregation = str(spec.get("year_aggregation") or "").strip().lower()
575
+ raw_rows: list[dict[str, Any]] = []
576
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
577
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
578
+ reader = csv.DictReader(lines)
579
+ for item in reader:
580
+ raw_year = str(item.get(year_column, "")).strip()
581
+ try:
582
+ if year_from_timestamp:
583
+ # Take the leading 4-digit year of an ISO timestamp/date.
584
+ match = re.match(r"\s*(\d{4})", raw_year)
585
+ if not match:
586
+ continue
587
+ year = int(match.group(1))
588
+ else:
589
+ year = int(raw_year)
590
+ value = float(str(item.get(value_column, "")).strip())
591
+ except (TypeError, ValueError):
592
+ continue
593
+ raw_rows.append({"year": year, "value": value})
594
+ rows = _aggregate_annual_rows(raw_rows, year_aggregation)
595
+ rows.sort(key=lambda item: item["year"])
596
+ output_dir.mkdir(parents=True, exist_ok=True)
597
+ decades: dict[str, list[float]] = {}
598
+ for row in rows:
599
+ decade_start = (row["year"] // 10) * 10
600
+ decades.setdefault(f"{decade_start}s", []).append(row["value"])
601
+ with (output_dir / "decadal_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
602
+ fieldnames = [
603
+ "decade_start",
604
+ "start_year",
605
+ "end_year",
606
+ "count",
607
+ "mean_departure",
608
+ "median_departure",
609
+ "min_departure",
610
+ "max_departure",
611
+ "sample_std_departure",
612
+ ]
613
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
614
+ writer.writeheader()
615
+ for decade, values in sorted(decades.items()):
616
+ decade_start = int(decade.rstrip("s"))
617
+ years = [row["year"] for row in rows if decade_start <= row["year"] <= decade_start + 9]
618
+ writer.writerow({
619
+ "decade_start": decade_start,
620
+ "start_year": min(years),
621
+ "end_year": max(years),
622
+ "count": len(values),
623
+ "mean_departure": f"{statistics.fmean(values):.6f}",
624
+ "median_departure": f"{statistics.median(values):.6f}",
625
+ "min_departure": f"{min(values):.6f}",
626
+ "max_departure": f"{max(values):.6f}",
627
+ "sample_std_departure": f"{statistics.stdev(values):.6f}" if len(values) >= 2 else "",
628
+ })
629
+ threshold = float(spec.get("threshold", 1.0))
630
+ with (output_dir / "threshold_years.csv").open("w", encoding="utf-8", newline="") as handle:
631
+ fieldnames = ["rank", "year", "departure", "threshold"]
632
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
633
+ writer.writeheader()
634
+ rank = 1
635
+ for row in rows:
636
+ if row["value"] >= threshold:
637
+ writer.writerow({
638
+ "rank": rank,
639
+ "year": row["year"],
640
+ "departure": f"{row['value']:.6f}",
641
+ "threshold": f"{threshold:.6f}",
642
+ })
643
+ rank += 1
644
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
645
+ writer = csv.DictWriter(handle, fieldnames=["Year", "Departure from Average"])
646
+ writer.writeheader()
647
+ for row in rows:
648
+ writer.writerow({"Year": row["year"], "Departure from Average": f"{row['value']:.6f}"})
649
+ values = [row["value"] for row in rows]
650
+ threshold_rows = [row for row in rows if row["value"] >= threshold]
651
+ min_row = min(rows, key=lambda row: row["value"]) if rows else None
652
+ max_row = max(rows, key=lambda row: row["value"]) if rows else None
653
+ summary = {
654
+ "series_name": spec.get("series_name", value_column),
655
+ "row_count": len(rows),
656
+ "year_range": {
657
+ "start": rows[0]["year"] if rows else None,
658
+ "end": rows[-1]["year"] if rows else None,
659
+ },
660
+ "value": {
661
+ "min": round(min(values), 6) if values else None,
662
+ "min_year": min_row["year"] if min_row else None,
663
+ "max": round(max(values), 6) if values else None,
664
+ "max_year": max_row["year"] if max_row else None,
665
+ "mean": round(statistics.fmean(values), 6) if values else None,
666
+ "median": round(statistics.median(values), 6) if values else None,
667
+ "sample_std": round(statistics.stdev(values), 6) if len(values) >= 2 else None,
668
+ },
669
+ "threshold": threshold,
670
+ "years_at_or_above_threshold": len(threshold_rows),
671
+ "first_threshold_year": threshold_rows[0]["year"] if threshold_rows else None,
672
+ "last_threshold_year": threshold_rows[-1]["year"] if threshold_rows else None,
673
+ }
674
+ if year_aggregation:
675
+ summary["year_aggregation"] = year_aggregation
676
+ summary["source_row_count"] = len(raw_rows)
677
+ _write_json(output_dir / "summary.json", summary)
678
+
679
+
20260904-004544-science-environment-91c12e/solution/internal/workflow_runtime.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from workflow_adapters_runtime import csv_annual_series_outputs
3
+
4
+ def run_reference(input_dir: Path, output_dir: Path) -> None:
5
+ csv_annual_series_outputs(input_dir, output_dir)
20260904-004544-science-environment-91c12e/solution/reference_solution.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import sys
5
+ from pathlib import Path
6
+
7
+
8
+ def main() -> int:
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument("--input", required=True)
11
+ parser.add_argument("--output", required=True)
12
+ args = parser.parse_args()
13
+ sys.path.insert(0, str(Path(__file__).resolve().parent / "internal"))
14
+ from workflow_runtime import run_reference
15
+ run_reference(Path(args.input), Path(args.output))
16
+ return 0
17
+
18
+
19
+ if __name__ == "__main__":
20
+ raise SystemExit(main())
20260904-004544-science-environment-91c12e/solution/solve.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ INPUT_DIR="${1:-/workspace/input}"
4
+ OUTPUT_DIR="${2:-/workspace/output}"
5
+ SOLUTION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6
+ mkdir -p "${OUTPUT_DIR}"
7
+ python "${SOLUTION_DIR}/reference_solution.py" --input "${INPUT_DIR}" --output "${OUTPUT_DIR}"
20260904-004544-science-environment-91c12e/task.toml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ schema_version = "1.3"
2
+ artifacts = ["/workspace/output/summary.json", "/workspace/output/decadal_statistics.csv", "/workspace/output/threshold_years.csv", "/workspace/output/clean_series.csv"]
3
+
4
+ [task]
5
+ name = "ale-cli/20260904-004544-science-environment-91c12e"
6
+ description = "Audit the real USGS FDSN East African Rift earthquake catalog for 1976-1994-1976-1994 (events with magnitude >= 5.5) and produce reproducible annual annual mean focal depth (km) statistics, decadal aggregates, threshold-year checks, and a cleaned local series."
7
+ keywords = ["agents-last-exam", "ale-cli", "csv-annual-series-audit", "deterministic-evaluator", "linux-cli", "science-environment"]
8
+
9
+ [metadata]
10
+ benchmark = "ale_cli"
11
+ source_format = "ale_cli_official_style"
12
+ converter = "ale_cli_to_harbor"
13
+ source_task_key = "20260904-004544_science_environment_91c12e"
14
+ task_id = "science_environment/usgs_east_africa_annual_depth_audit"
15
+ domain = "science_environment"
16
+ task = "usgs_east_africa_annual_depth_audit"
17
+ variant = "base"
18
+ oracle_available = true
19
+ scoring_method = "deterministic_hidden_evaluator"
20
+ required_outputs = ["summary.json", "decadal_statistics.csv", "threshold_years.csv", "clean_series.csv"]
21
+
22
+ [agent]
23
+ timeout_sec = 1800
24
+
25
+ [verifier]
26
+ timeout_sec = 600
27
+ environment_mode = "separate"
28
+
29
+ [verifier.environment]
30
+ build_timeout_sec = 900.0
31
+ network_mode = "public"
32
+ os = "linux"
33
+ cpus = 1
34
+ memory_mb = 2048
35
+ storage_mb = 4096
36
+ gpus = 0
37
+
38
+ [environment]
39
+ build_timeout_sec = 1200.0
40
+ network_mode = "public"
41
+ os = "linux"
42
+ cpus = 2
43
+ memory_mb = 4096
44
+ storage_mb = 10240
45
+ gpus = 0
20260904-004544-science-environment-91c12e/tests/Dockerfile ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /workspace
4
+
5
+ COPY . /tests
6
+ RUN chmod +x /tests/test.sh
20260904-004544-science-environment-91c12e/tests/evaluator_runner.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import importlib.util
6
+ import json
7
+ from pathlib import Path
8
+ from typing import Any
9
+
10
+
11
+ def read_json(path: Path) -> Any:
12
+ return json.loads(path.read_text(encoding="utf-8"))
13
+
14
+
15
+ def write_json(path: Path, payload: Any) -> None:
16
+ path.parent.mkdir(parents=True, exist_ok=True)
17
+ path.write_text(json.dumps(payload, ensure_ascii=False, indent=2) + "\n", encoding="utf-8")
18
+
19
+
20
+ def reward(
21
+ *,
22
+ score: float,
23
+ output_present: float,
24
+ evaluator_available: float,
25
+ item_count: int,
26
+ format_score: float = 1.0,
27
+ ) -> dict[str, float]:
28
+ clipped = max(0.0, min(1.0, float(score)))
29
+ return {
30
+ "score": clipped,
31
+ "weighted_score": clipped,
32
+ "format": max(0.0, min(1.0, float(format_score))),
33
+ "output_present": max(0.0, min(1.0, float(output_present))),
34
+ "evaluator_available": max(0.0, min(1.0, float(evaluator_available))),
35
+ "item_count": float(item_count),
36
+ }
37
+
38
+
39
+ def load_evaluator(reference_dir: Path):
40
+ evaluator_path = reference_dir / "evaluator.py"
41
+ spec = importlib.util.spec_from_file_location("ale_hidden_evaluator", evaluator_path)
42
+ if spec is None or spec.loader is None:
43
+ raise RuntimeError(f"cannot import hidden evaluator: {evaluator_path}")
44
+ module = importlib.util.module_from_spec(spec)
45
+ spec.loader.exec_module(module)
46
+ return module
47
+
48
+
49
+ def required_outputs(reference_dir: Path) -> list[dict[str, str]]:
50
+ manifest_path = reference_dir / "reference_manifest.json"
51
+ if not manifest_path.is_file():
52
+ return []
53
+ manifest = read_json(manifest_path)
54
+ rows = manifest.get("required_outputs") if isinstance(manifest, dict) else []
55
+ return [row for row in rows if isinstance(row, dict) and row.get("path")]
56
+
57
+
58
+ def main() -> int:
59
+ parser = argparse.ArgumentParser(description="Run a hidden ALE CLI evaluator in Harbor.")
60
+ parser.add_argument("--output-dir", type=Path, required=True)
61
+ parser.add_argument("--reference-dir", type=Path, required=True)
62
+ parser.add_argument("--reward-json", type=Path, required=True)
63
+ parser.add_argument("--details-json", type=Path, required=True)
64
+ args = parser.parse_args()
65
+
66
+ required = required_outputs(args.reference_dir)
67
+ present = [row for row in required if (args.output_dir / str(row["path"])).is_file()]
68
+ item_count = len(required)
69
+ if not required:
70
+ write_json(args.reward_json, reward(score=0.0, output_present=0.0, evaluator_available=0.0, item_count=0, format_score=0.0))
71
+ write_json(args.details_json, {"ok": False, "error": "reference_manifest.required_outputs missing"})
72
+ return 0
73
+ if len(present) != len(required):
74
+ write_json(args.reward_json, reward(score=0.0, output_present=0.0, evaluator_available=1.0, item_count=item_count))
75
+ write_json(args.details_json, {"ok": True, "reason": "missing required outputs", "present": [row["path"] for row in present]})
76
+ return 0
77
+ try:
78
+ module = load_evaluator(args.reference_dir)
79
+ result = module.evaluate(args.output_dir, args.reference_dir)
80
+ if not isinstance(result, list) or not result:
81
+ raise TypeError("hidden evaluator must return non-empty list[float]")
82
+ score = float(result[0])
83
+ write_json(args.reward_json, reward(score=score, output_present=1.0, evaluator_available=1.0, item_count=item_count))
84
+ write_json(args.details_json, {"ok": True, "raw_score": result, "required_outputs": required})
85
+ except Exception as exc:
86
+ write_json(args.reward_json, reward(score=0.0, output_present=1.0, evaluator_available=0.0, item_count=item_count))
87
+ write_json(args.details_json, {"ok": False, "error": f"{type(exc).__name__}: {exc}", "required_outputs": required})
88
+ return 0
89
+
90
+
91
+ if __name__ == "__main__":
92
+ raise SystemExit(main())
20260904-004544-science-environment-91c12e/tests/reference/__pycache__/evaluator.cpython-312.pyc ADDED
Binary file (6.22 kB). View file
 
20260904-004544-science-environment-91c12e/tests/reference/evaluator.py ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import json
5
+ import math
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+
10
+ def _load_json(path: Path) -> Any:
11
+ with path.open("r", encoding="utf-8") as handle:
12
+ return json.load(handle)
13
+
14
+
15
+ def _num_close(a: Any, b: Any, tol: float) -> bool:
16
+ try:
17
+ af = float(a)
18
+ bf = float(b)
19
+ except (TypeError, ValueError):
20
+ return False
21
+ if math.isnan(af) and math.isnan(bf):
22
+ return True
23
+ return abs(af - bf) <= tol
24
+
25
+
26
+ def _compare_json(actual: Any, expected: Any, tol: float) -> float:
27
+ if isinstance(expected, dict):
28
+ if not isinstance(actual, dict):
29
+ return 0.0
30
+ if not expected:
31
+ return 1.0
32
+ scores = []
33
+ for key, exp_value in expected.items():
34
+ if key not in actual:
35
+ scores.append(0.0)
36
+ else:
37
+ scores.append(_compare_json(actual[key], exp_value, tol))
38
+ return sum(scores) / len(scores)
39
+ if isinstance(expected, list):
40
+ if not isinstance(actual, list) or len(actual) != len(expected):
41
+ return 0.0
42
+ if not expected:
43
+ return 1.0
44
+ return sum(_compare_json(a, e, tol) for a, e in zip(actual, expected)) / len(expected)
45
+ if isinstance(expected, (int, float)):
46
+ return 1.0 if _num_close(actual, expected, tol) else 0.0
47
+ return 1.0 if actual == expected else 0.0
48
+
49
+
50
+ def _read_csv(path: Path) -> list[dict[str, str]]:
51
+ with path.open("r", encoding="utf-8", newline="") as handle:
52
+ return list(csv.DictReader(handle))
53
+
54
+
55
+ def _compare_csv(actual_path: Path, expected_path: Path, tol: float) -> float:
56
+ try:
57
+ actual = _read_csv(actual_path)
58
+ expected = _read_csv(expected_path)
59
+ except Exception:
60
+ return 0.0
61
+ if len(actual) != len(expected):
62
+ return 0.0
63
+ if not expected:
64
+ return 1.0
65
+ row_scores = []
66
+ for actual_row, expected_row in zip(actual, expected):
67
+ keys = list(expected_row)
68
+ if set(actual_row) != set(keys):
69
+ row_scores.append(0.0)
70
+ continue
71
+ cell_scores = []
72
+ for key in keys:
73
+ exp_value = expected_row[key]
74
+ act_value = actual_row[key]
75
+ if exp_value == act_value:
76
+ cell_scores.append(1.0)
77
+ elif _num_close(act_value, exp_value, tol):
78
+ cell_scores.append(1.0)
79
+ else:
80
+ cell_scores.append(0.0)
81
+ row_scores.append(sum(cell_scores) / len(cell_scores) if cell_scores else 1.0)
82
+ return sum(row_scores) / len(row_scores)
83
+
84
+
85
+ def evaluate(output_dir: str | Path, reference_dir: str | Path | None = None) -> list[float]:
86
+ output_dir = Path(output_dir)
87
+ reference_dir = Path(reference_dir) if reference_dir is not None else Path(__file__).resolve().parent
88
+ manifest = _load_json(reference_dir / "reference_manifest.json")
89
+ tolerance = float(manifest.get("numeric_tolerance", 1e-9))
90
+ required = manifest.get("required_outputs") or []
91
+ if not required:
92
+ return [0.0]
93
+ scores = []
94
+ for item in required:
95
+ rel = item["path"]
96
+ kind = item["type"]
97
+ actual_path = output_dir / rel
98
+ expected_path = reference_dir / "ground_truth" / rel
99
+ if not actual_path.is_file() or not expected_path.is_file():
100
+ scores.append(0.0)
101
+ continue
102
+ try:
103
+ if kind == "json":
104
+ scores.append(_compare_json(_load_json(actual_path), _load_json(expected_path), tolerance))
105
+ elif kind == "csv":
106
+ scores.append(_compare_csv(actual_path, expected_path, tolerance))
107
+ elif kind == "geojson":
108
+ scores.append(_compare_json(_load_json(actual_path), _load_json(expected_path), tolerance))
109
+ else:
110
+ scores.append(1.0 if actual_path.read_bytes() == expected_path.read_bytes() else 0.0)
111
+ except Exception:
112
+ scores.append(0.0)
113
+ score = max(0.0, min(1.0, sum(scores) / len(scores)))
114
+ return [score]
20260904-004544-science-environment-91c12e/tests/reference/ground_truth/clean_series.csv ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Year,Departure from Average
2
+ 1976,32.000000
3
+ 1977,30.692308
4
+ 1978,31.529412
5
+ 1979,20.583333
6
+ 1980,16.764706
7
+ 1981,31.789474
8
+ 1982,12.882353
9
+ 1983,10.111111
10
+ 1984,9.625000
11
+ 1985,11.069767
12
+ 1986,10.961111
13
+ 1987,10.181818
14
+ 1988,12.555556
15
+ 1989,14.482051
16
+ 1990,13.486538
17
+ 1991,15.175862
18
+ 1992,15.978261
19
+ 1993,15.524138
20
+ 1994,14.988889
20260904-004544-science-environment-91c12e/tests/reference/ground_truth/decadal_statistics.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ decade_start,start_year,end_year,count,mean_departure,median_departure,min_departure,max_departure,sample_std_departure
2
+ 1970,1976,1979,4,28.701263,31.110860,20.583333,32.000000,5.438907
3
+ 1980,1980,1989,10,14.042295,11.812661,9.625000,31.789474,6.619187
4
+ 1990,1990,1994,5,15.030738,15.175862,13.486538,15.978261,0.941887
20260904-004544-science-environment-91c12e/tests/reference/ground_truth/summary.json ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "series_name": "USGS FDSN East African Rift 1976-1994-1976-1994 earthquake annual mean focal depth (km) (min mag 4.5)",
3
+ "row_count": 19,
4
+ "year_range": {
5
+ "start": 1976,
6
+ "end": 1994
7
+ },
8
+ "value": {
9
+ "min": 9.625,
10
+ "min_year": 1984,
11
+ "max": 32.0,
12
+ "max_year": 1976,
13
+ "mean": 17.38851,
14
+ "median": 14.988889,
15
+ "sample_std": 7.952278
16
+ },
17
+ "threshold": 70.0,
18
+ "years_at_or_above_threshold": 0,
19
+ "first_threshold_year": null,
20
+ "last_threshold_year": null,
21
+ "year_aggregation": "mean",
22
+ "source_row_count": 435
23
+ }
20260904-004544-science-environment-91c12e/tests/reference/ground_truth/threshold_years.csv ADDED
@@ -0,0 +1 @@
 
 
1
+ rank,year,departure,threshold
20260904-004544-science-environment-91c12e/tests/reference/internal/workflow_adapters_runtime.py ADDED
@@ -0,0 +1,679 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import csv
4
+ import datetime as dt
5
+ import html
6
+ import json
7
+ import math
8
+ import re
9
+ import shutil
10
+ import statistics
11
+ from pathlib import Path
12
+ from typing import Any
13
+
14
+
15
+ def _read_json(path: Path) -> Any:
16
+ with path.open("r", encoding="utf-8") as handle:
17
+ return json.load(handle)
18
+
19
+
20
+ def _write_json(path: Path, payload: Any) -> None:
21
+ path.parent.mkdir(parents=True, exist_ok=True)
22
+ with path.open("w", encoding="utf-8") as handle:
23
+ json.dump(payload, handle, ensure_ascii=False, indent=2)
24
+ handle.write("\n")
25
+
26
+ def _stable_region(place: str) -> str:
27
+ if not place:
28
+ return "unknown"
29
+ if "," in place:
30
+ return place.split(",")[-1].strip() or place.strip()
31
+ parts = place.split()
32
+ return " ".join(parts[-2:]) if len(parts) >= 2 else place.strip()
33
+
34
+
35
+ def _mag_bin(value: float | None) -> str:
36
+ if value is None or math.isnan(value):
37
+ return "unknown"
38
+ lower = math.floor(value)
39
+ upper = lower + 1
40
+ return f"{lower:.0f}-{upper:.0f}"
41
+
42
+
43
+ def _depth_bin(value: float | None) -> str:
44
+ if value is None or math.isnan(value):
45
+ return "unknown"
46
+ if value < 0:
47
+ return "<0"
48
+ if value < 10:
49
+ return "0-10"
50
+ if value < 30:
51
+ return "10-30"
52
+ if value < 70:
53
+ return "30-70"
54
+ if value < 300:
55
+ return "70-300"
56
+ return "300+"
57
+
58
+
59
+ def _clean_markup_text(raw: str) -> str:
60
+ text = re.sub(r"(?is)<(script|style|noscript)[^>]*>.*?</\1>", " ", raw)
61
+ text = re.sub(r"(?is)<br\s*/?>", "\n", text)
62
+ text = re.sub(r"(?is)</(p|div|li|tr|h[1-6]|pre)>", "\n", text)
63
+ text = re.sub(r"(?is)<[^>]+>", " ", text)
64
+ text = html.unescape(text)
65
+ text = re.sub(r"[ \t]+", " ", text)
66
+ text = re.sub(r"\n\s+", "\n", text)
67
+ return text.strip()
68
+
69
+
70
+ def _heading_slug(value: str) -> str:
71
+ slug = re.sub(r"[^a-z0-9]+", "_", value.lower()).strip("_")
72
+ return slug[:80] or "section"
73
+
74
+
75
+ def _extract_headings(raw: str) -> list[dict[str, str]]:
76
+ headings: list[dict[str, str]] = []
77
+ for match in re.finditer(r"(?is)<h([1-6])[^>]*>(.*?)</h\1>", raw):
78
+ text = _clean_markup_text(match.group(2))
79
+ if text:
80
+ headings.append({"level": f"h{match.group(1)}", "text": text})
81
+ if headings:
82
+ return headings
83
+ for line in raw.splitlines():
84
+ match = re.match(r"^(#{1,6})\s+(.+?)\s*$", line)
85
+ if match:
86
+ headings.append({"level": f"h{len(match.group(1))}", "text": match.group(2).strip()})
87
+ return headings
88
+
89
+
90
+ def _extract_code_blocks(raw: str) -> list[str]:
91
+ blocks: list[str] = []
92
+ for match in re.finditer(r"(?is)<pre[^>]*>(.*?)</pre>", raw):
93
+ text = _clean_markup_text(match.group(1))
94
+ if text:
95
+ blocks.append(text)
96
+ for match in re.finditer(r"(?is)<code[^>]*>(.*?)</code>", raw):
97
+ text = _clean_markup_text(match.group(1))
98
+ if text and text not in blocks:
99
+ blocks.append(text)
100
+ for match in re.finditer(r"(?s)```(?:[A-Za-z0-9_-]+)?\n(.*?)```", raw):
101
+ text = html.unescape(match.group(1).strip())
102
+ if text and text not in blocks:
103
+ blocks.append(text)
104
+ return blocks
105
+
106
+
107
+ def _window_rows(clean_text: str, *, width: int = 40, stride: int = 20) -> list[dict[str, Any]]:
108
+ words = re.findall(r"\S+", clean_text)
109
+ rows: list[dict[str, Any]] = []
110
+ if not words:
111
+ return rows
112
+ start = 0
113
+ while start < len(words):
114
+ end = min(start + width, len(words))
115
+ rows.append({
116
+ "window_id": len(rows) + 1,
117
+ "start_word": start,
118
+ "end_word": end,
119
+ "text": " ".join(words[start:end]),
120
+ })
121
+ if end == len(words):
122
+ break
123
+ start += stride
124
+ return rows
125
+
126
+
127
+ def _term_count(text: str, term: str) -> int:
128
+ term = term.strip()
129
+ if not term:
130
+ return 0
131
+ return len(re.findall(re.escape(term), text, flags=re.IGNORECASE))
132
+
133
+
134
+ def _first_window(windows: list[dict[str, Any]], term: str) -> str:
135
+ term_lower = term.lower()
136
+ for row in windows:
137
+ if term_lower in str(row.get("text") or "").lower():
138
+ return str(row.get("window_id") or "")
139
+ return ""
140
+
141
+
142
+ def _write_tutorial_public_inputs(input_dir: Path, source_path: Path, spec_payload: dict[str, Any]) -> None:
143
+ raw = source_path.read_text(encoding="utf-8", errors="replace")
144
+ # Tutorial examples may contain a maintainer's local Windows path. Keep
145
+ # the command semantics while preventing host-specific paths from entering
146
+ # the public task artifact.
147
+ sanitized_raw = re.sub(r"(?i)\b[A-Z]:\\(?:[^\\\r\n<>\"']+\\?)*[^\\\r\n<>\"']*", "./local.db", raw)
148
+ clean_text = _clean_markup_text(sanitized_raw)
149
+ windows = _window_rows(clean_text)
150
+ if len(windows) < 100:
151
+ raise ValueError(f"official tutorial source produced only {len(windows)} text windows; need at least 100")
152
+ required_terms = [str(item) for item in spec_payload.get("required_terms") or []]
153
+ code_terms = [str(item) for item in spec_payload.get("code_terms") or []]
154
+ input_dir.mkdir(parents=True, exist_ok=True)
155
+ destination = input_dir / str(spec_payload["source_file"])
156
+ # Always materialize the sanitized copy, including when the downloader
157
+ # already placed the source at the destination path.
158
+ destination.write_text(sanitized_raw, encoding="utf-8")
159
+ with (input_dir / str(spec_payload["input_file"])).open("w", encoding="utf-8", newline="") as handle:
160
+ fieldnames = ["window_id", "start_word", "end_word", "text", "contains_code_term", "matched_required_terms"]
161
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
162
+ writer.writeheader()
163
+ for row in windows:
164
+ text = str(row["text"])
165
+ matched = [term for term in required_terms if term.lower() in text.lower()]
166
+ contains_code = any(term.lower() in text.lower() for term in code_terms)
167
+ writer.writerow({
168
+ "window_id": row["window_id"],
169
+ "start_word": row["start_word"],
170
+ "end_word": row["end_word"],
171
+ "text": text,
172
+ "contains_code_term": "true" if contains_code else "false",
173
+ "matched_required_terms": "|".join(matched),
174
+ })
175
+ metadata = {
176
+ "software_name": spec_payload.get("software_name"),
177
+ "tutorial_url": spec_payload.get("tutorial_url"),
178
+ "source_urls": spec_payload.get("source_urls"),
179
+ "source_file": spec_payload.get("source_file"),
180
+ "window_file": spec_payload.get("input_file"),
181
+ "window_rule": spec_payload.get("window_rule"),
182
+ "required_terms": spec_payload.get("required_terms"),
183
+ "code_terms": spec_payload.get("code_terms"),
184
+ "note": "Provenance and public extraction rules only; scored aggregate values are intentionally not stored here.",
185
+ }
186
+ _write_json(input_dir / "tutorial_metadata.json", metadata)
187
+
188
+
189
+ def _source_context_text(path: Path) -> str:
190
+ try:
191
+ raw = path.read_text(encoding="utf-8", errors="replace")
192
+ except Exception:
193
+ return f"{path.name}\nsha256={_sha256_file(path)}\nsize_bytes={path.stat().st_size}\n"
194
+ if path.suffix.lower() in {".html", ".htm", ".md", ".txt"}:
195
+ return _clean_markup_text(raw)
196
+ return re.sub(r"\s+", " ", raw).strip()
197
+
198
+
199
+ def _ensure_public_input_footprint(input_dir: Path, source_paths: list[Path]) -> str:
200
+ current = _tree_file_bytes(input_dir)
201
+ if current >= MIN_PUBLIC_TASK_DATA_BYTES:
202
+ return f"public input footprint is {current} bytes; no context expansion needed"
203
+ context_path = input_dir / "source_context_windows.jsonl"
204
+ base = current - (context_path.stat().st_size if context_path.is_file() else 0)
205
+ context_path.unlink(missing_ok=True)
206
+ rows: list[dict[str, Any]] = []
207
+ for source in source_paths:
208
+ if not source.is_file() or source.resolve() == context_path.resolve():
209
+ continue
210
+ text = _source_context_text(source)
211
+ if not text:
212
+ continue
213
+ start = 0
214
+ width = 1800
215
+ stride = 900
216
+ while start < len(text):
217
+ end = min(len(text), start + width)
218
+ rows.append({
219
+ "source_file": source.relative_to(input_dir).as_posix() if source.is_relative_to(input_dir) else source.name,
220
+ "source_sha256": _sha256_file(source),
221
+ "start_char": start,
222
+ "end_char": end,
223
+ "text": text[start:end],
224
+ })
225
+ if end == len(text):
226
+ break
227
+ start += stride
228
+ if not rows:
229
+ raise ValueError("public input footprint expansion has no public source text")
230
+ input_dir.mkdir(parents=True, exist_ok=True)
231
+ rows_written = 0
232
+ target_extra = MIN_PUBLIC_TASK_DATA_BYTES - max(0, base)
233
+ with context_path.open("w", encoding="utf-8") as handle:
234
+ cycle = 0
235
+ while handle.tell() < target_extra or rows_written < 100:
236
+ row = dict(rows[rows_written % len(rows)])
237
+ row["window_id"] = rows_written + 1
238
+ row["cycle"] = cycle
239
+ handle.write(json.dumps(row, ensure_ascii=False) + "\n")
240
+ rows_written += 1
241
+ if rows_written % len(rows) == 0:
242
+ cycle += 1
243
+ handle.flush()
244
+ return f"wrote input/source_context_windows.jsonl with {rows_written} public-source windows and {context_path.stat().st_size} bytes"
245
+
246
+
247
+ def _write_software_manifest(software_dir: Path, spec_payload: dict[str, Any]) -> None:
248
+ if str(spec_payload.get("workflow_kind") or "") != "software_tutorial_doc_audit":
249
+ return
250
+ software_dir.mkdir(parents=True, exist_ok=True)
251
+ software_name = str(spec_payload.get("software_name") or "").strip()
252
+ executables = [str(item).strip() for item in spec_payload.get("executables") or [] if str(item).strip()]
253
+ system_packages = [str(item).strip() for item in spec_payload.get("required_system_packages") or [] if str(item).strip()]
254
+ source_urls = [str(item).strip() for item in spec_payload.get("source_urls") or [] if str(item).strip()]
255
+ _write_json(software_dir / "software_manifest.json", {
256
+ "software_name": software_name,
257
+ "executables": executables,
258
+ "required_system_packages": system_packages,
259
+ "official_sources": source_urls,
260
+ "solve_time_network": "disabled",
261
+ "python_wrapper_only": False,
262
+ "note": "This task audits real official software documentation/source staged offline; Python helpers only validate outputs.",
263
+ })
264
+ with (software_dir / "command_examples.csv").open("w", encoding="utf-8", newline="") as handle:
265
+ writer = csv.DictWriter(handle, fieldnames=["term", "kind", "software_name"])
266
+ writer.writeheader()
267
+ for term in spec_payload.get("code_terms") or []:
268
+ writer.writerow({"term": str(term), "kind": "code_term", "software_name": software_name})
269
+ for exe in executables:
270
+ writer.writerow({"term": exe, "kind": "executable", "software_name": software_name})
271
+
272
+
273
+ def software_tutorial_outputs(input_dir: Path, output_dir: Path) -> None:
274
+ spec = _read_json(input_dir / "analysis_spec.json")
275
+ source_file = str(spec["source_file"])
276
+ source_text = (input_dir / source_file).read_text(encoding="utf-8", errors="replace")
277
+ clean_text = _clean_markup_text(source_text)
278
+ headings = _extract_headings(source_text)
279
+ code_blocks = _extract_code_blocks(source_text)
280
+ window_rows: list[dict[str, str]] = []
281
+ with (input_dir / str(spec["input_file"])).open("r", encoding="utf-8", newline="") as handle:
282
+ window_rows = list(csv.DictReader(handle))
283
+ output_dir.mkdir(parents=True, exist_ok=True)
284
+
285
+ with (output_dir / "section_outline.csv").open("w", encoding="utf-8", newline="") as handle:
286
+ fieldnames = ["rank", "heading_level", "heading_text", "slug"]
287
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
288
+ writer.writeheader()
289
+ for rank, heading in enumerate(headings, start=1):
290
+ writer.writerow({
291
+ "rank": rank,
292
+ "heading_level": heading["level"],
293
+ "heading_text": heading["text"],
294
+ "slug": _heading_slug(heading["text"]),
295
+ })
296
+
297
+ all_terms: list[tuple[str, str]] = []
298
+ for term in spec.get("required_terms") or []:
299
+ all_terms.append((str(term), "required"))
300
+ for term in spec.get("code_terms") or []:
301
+ if str(term) not in {item[0] for item in all_terms}:
302
+ all_terms.append((str(term), "code"))
303
+ code_text = "\n".join(code_blocks)
304
+ term_rows: list[dict[str, Any]] = []
305
+ for term, category in all_terms:
306
+ term_rows.append({
307
+ "term": term,
308
+ "category": category,
309
+ "count": _term_count(clean_text, term),
310
+ "first_window": _first_window(window_rows, term),
311
+ "appears_in_code": "true" if term.lower() in code_text.lower() else "false",
312
+ })
313
+ term_rows.sort(key=lambda row: (str(row["category"]), str(row["term"]).lower()))
314
+ with (output_dir / "keyword_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
315
+ fieldnames = ["term", "category", "count", "first_window", "appears_in_code"]
316
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
317
+ writer.writeheader()
318
+ for row in term_rows:
319
+ writer.writerow(row)
320
+
321
+ code_terms = [str(item).lower() for item in spec.get("code_terms") or []]
322
+ with (output_dir / "code_block_inventory.csv").open("w", encoding="utf-8", newline="") as handle:
323
+ fieldnames = ["block_index", "line_count", "char_count", "contains_code_term", "first_line"]
324
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
325
+ writer.writeheader()
326
+ for index, block in enumerate(code_blocks, start=1):
327
+ lines = [line for line in block.splitlines() if line.strip()]
328
+ contains = any(term and term in block.lower() for term in code_terms)
329
+ writer.writerow({
330
+ "block_index": index,
331
+ "line_count": len(lines),
332
+ "char_count": len(block),
333
+ "contains_code_term": "true" if contains else "false",
334
+ "first_line": lines[0][:200] if lines else "",
335
+ })
336
+
337
+ keyword_total = sum(int(row["count"]) for row in term_rows)
338
+ required_found = sum(1 for row in term_rows if row["category"] == "required" and int(row["count"]) > 0)
339
+ top_keyword = None
340
+ if term_rows:
341
+ top = max(term_rows, key=lambda row: (int(row["count"]), str(row["term"]).lower()))
342
+ top_keyword = str(top["term"]) if int(top["count"]) > 0 else None
343
+ summary = {
344
+ "software_name": str(spec.get("software_name") or ""),
345
+ "source_file": source_file,
346
+ "window_count": len(window_rows),
347
+ "heading_count": len(headings),
348
+ "code_block_count": len(code_blocks),
349
+ "keyword_total": keyword_total,
350
+ "unique_required_terms_found": required_found,
351
+ "top_keyword": top_keyword,
352
+ "source_character_count": len(clean_text),
353
+ }
354
+ _write_json(output_dir / "summary.json", summary)
355
+
356
+
357
+ def geojson_outputs(input_dir: Path, output_dir: Path) -> None:
358
+ payload = _read_json(input_dir / "events.geojson")
359
+ features = payload.get("features") if isinstance(payload, dict) else []
360
+ rows: list[dict[str, Any]] = []
361
+ for feature in features:
362
+ if not isinstance(feature, dict):
363
+ continue
364
+ props = feature.get("properties") if isinstance(feature.get("properties"), dict) else {}
365
+ geom = feature.get("geometry") if isinstance(feature.get("geometry"), dict) else {}
366
+ coords = geom.get("coordinates") if isinstance(geom.get("coordinates"), list) else []
367
+ mag = props.get("mag")
368
+ try:
369
+ mag = float(mag) if mag is not None else None
370
+ except (TypeError, ValueError):
371
+ mag = None
372
+ depth = None
373
+ if len(coords) >= 3:
374
+ try:
375
+ depth = float(coords[2])
376
+ except (TypeError, ValueError):
377
+ depth = None
378
+ time_ms = props.get("time")
379
+ date_utc = "unknown"
380
+ if isinstance(time_ms, (int, float)):
381
+ date_utc = dt.datetime.utcfromtimestamp(time_ms / 1000).date().isoformat()
382
+ rows.append({
383
+ "id": feature.get("id") or props.get("code") or "",
384
+ "mag": mag,
385
+ "depth": depth,
386
+ "place": str(props.get("place") or ""),
387
+ "region": _stable_region(str(props.get("place") or "")),
388
+ "date_utc": date_utc,
389
+ "feature": feature,
390
+ })
391
+ output_dir.mkdir(parents=True, exist_ok=True)
392
+ mags = [row["mag"] for row in rows if row["mag"] is not None]
393
+ depths = [row["depth"] for row in rows if row["depth"] is not None]
394
+ summary = {
395
+ "event_count": len(rows),
396
+ "magnitude": {
397
+ "count": len(mags),
398
+ "min": round(min(mags), 6) if mags else None,
399
+ "max": round(max(mags), 6) if mags else None,
400
+ "mean": round(statistics.fmean(mags), 6) if mags else None,
401
+ "median": round(statistics.median(mags), 6) if mags else None,
402
+ },
403
+ "depth_km": {
404
+ "count": len(depths),
405
+ "min": round(min(depths), 6) if depths else None,
406
+ "max": round(max(depths), 6) if depths else None,
407
+ "mean": round(statistics.fmean(depths), 6) if depths else None,
408
+ },
409
+ "time_range_utc": {
410
+ "start_date": min((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
411
+ "end_date": max((row["date_utc"] for row in rows if row["date_utc"] != "unknown"), default=None),
412
+ },
413
+ "quality_flags": {
414
+ "missing_magnitude": sum(1 for row in rows if row["mag"] is None),
415
+ "missing_depth": sum(1 for row in rows if row["depth"] is None),
416
+ "unique_regions": len({row["region"] for row in rows}),
417
+ },
418
+ }
419
+ _write_json(output_dir / "summary.json", summary)
420
+
421
+ grouped: dict[tuple[str, str], list[dict[str, Any]]] = {}
422
+ for row in rows:
423
+ grouped.setdefault((_mag_bin(row["mag"]), _depth_bin(row["depth"])), []).append(row)
424
+ with (output_dir / "magnitude_depth_bins.csv").open("w", encoding="utf-8", newline="") as handle:
425
+ fieldnames = ["mag_bin", "depth_bin", "event_count", "mean_magnitude", "max_magnitude"]
426
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
427
+ writer.writeheader()
428
+ for (mag_bin, depth_bin), group in sorted(grouped.items()):
429
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
430
+ writer.writerow({
431
+ "mag_bin": mag_bin,
432
+ "depth_bin": depth_bin,
433
+ "event_count": len(group),
434
+ "mean_magnitude": f"{statistics.fmean(group_mags):.6f}" if group_mags else "",
435
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
436
+ })
437
+
438
+ daily: dict[tuple[str, str], list[dict[str, Any]]] = {}
439
+ for row in rows:
440
+ daily.setdefault((row["region"], row["date_utc"]), []).append(row)
441
+ with (output_dir / "region_daily_counts.csv").open("w", encoding="utf-8", newline="") as handle:
442
+ fieldnames = ["region", "date_utc", "event_count", "max_magnitude"]
443
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
444
+ writer.writeheader()
445
+ for (region, date_utc), group in sorted(daily.items()):
446
+ group_mags = [row["mag"] for row in group if row["mag"] is not None]
447
+ writer.writerow({
448
+ "region": region,
449
+ "date_utc": date_utc,
450
+ "event_count": len(group),
451
+ "max_magnitude": f"{max(group_mags):.6f}" if group_mags else "",
452
+ })
453
+
454
+ filtered = [row["feature"] for row in rows if row["mag"] is not None and row["mag"] >= 4.5]
455
+ _write_json(output_dir / "filtered_events.geojson", {"type": "FeatureCollection", "features": filtered})
456
+
457
+
458
+ def csv_time_series_outputs(input_dir: Path, output_dir: Path) -> None:
459
+ spec = _read_json(input_dir / "analysis_spec.json")
460
+ csv_name = spec["input_file"]
461
+ date_column = spec["date_column"]
462
+ value_column = spec["value_column"]
463
+ rows: list[dict[str, Any]] = []
464
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
465
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
466
+ reader = csv.DictReader(lines)
467
+ for item in reader:
468
+ raw_date = item.get(date_column, "")
469
+ try:
470
+ day = dt.date.fromisoformat(raw_date)
471
+ except ValueError:
472
+ if raw_date.isdigit() and len(raw_date) == 4:
473
+ day = dt.date(int(raw_date), 1, 1)
474
+ else:
475
+ continue
476
+ raw_value = item.get(value_column, "")
477
+ try:
478
+ value = float(raw_value)
479
+ except (TypeError, ValueError):
480
+ value = None
481
+ rows.append({"date": day, "value": value, "raw": item})
482
+ rows.sort(key=lambda item: item["date"])
483
+ valid = [row for row in rows if row["value"] is not None]
484
+ output_dir.mkdir(parents=True, exist_ok=True)
485
+ monthly: dict[str, list[float]] = {}
486
+ for row in valid:
487
+ key = row["date"].strftime("%Y-%m")
488
+ monthly.setdefault(key, []).append(row["value"])
489
+ with (output_dir / "monthly_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
490
+ fieldnames = ["month", "count", "mean", "median", "min", "max"]
491
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
492
+ writer.writeheader()
493
+ for month, values in sorted(monthly.items()):
494
+ writer.writerow({
495
+ "month": month,
496
+ "count": len(values),
497
+ "mean": f"{statistics.fmean(values):.6f}",
498
+ "median": f"{statistics.median(values):.6f}",
499
+ "min": f"{min(values):.6f}",
500
+ "max": f"{max(values):.6f}",
501
+ })
502
+ existing_dates = {row["date"] for row in rows}
503
+ missing_days: list[dt.date] = []
504
+ if rows:
505
+ day = rows[0]["date"]
506
+ while day <= rows[-1]["date"]:
507
+ if day.weekday() < 5 and day not in existing_dates:
508
+ missing_days.append(day)
509
+ day += dt.timedelta(days=1)
510
+ with (output_dir / "missing_business_days.csv").open("w", encoding="utf-8", newline="") as handle:
511
+ writer = csv.DictWriter(handle, fieldnames=["date"])
512
+ writer.writeheader()
513
+ for day in missing_days:
514
+ writer.writerow({"date": day.isoformat()})
515
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
516
+ writer = csv.DictWriter(handle, fieldnames=["date", "value"])
517
+ writer.writeheader()
518
+ for row in valid:
519
+ writer.writerow({"date": row["date"].isoformat(), "value": f"{row['value']:.6f}"})
520
+ values = [row["value"] for row in valid]
521
+ summary = {
522
+ "series_name": spec.get("series_name", value_column),
523
+ "row_count": len(rows),
524
+ "valid_value_count": len(valid),
525
+ "missing_value_count": len(rows) - len(valid),
526
+ "missing_business_day_count": len(missing_days),
527
+ "date_range": {
528
+ "start": rows[0]["date"].isoformat() if rows else None,
529
+ "end": rows[-1]["date"].isoformat() if rows else None,
530
+ },
531
+ "value": {
532
+ "min": round(min(values), 6) if values else None,
533
+ "max": round(max(values), 6) if values else None,
534
+ "mean": round(statistics.fmean(values), 6) if values else None,
535
+ "median": round(statistics.median(values), 6) if values else None,
536
+ },
537
+ }
538
+ _write_json(output_dir / "summary.json", summary)
539
+
540
+
541
+ def _aggregate_annual_rows(rows: list[dict[str, Any]], aggregation: str) -> list[dict[str, Any]]:
542
+ if not aggregation:
543
+ return rows
544
+ grouped: dict[int, list[float]] = {}
545
+ for row in rows:
546
+ grouped.setdefault(int(row["year"]), []).append(float(row["value"]))
547
+ aggregated: list[dict[str, Any]] = []
548
+ for year, values in sorted(grouped.items()):
549
+ if aggregation == "mean":
550
+ value = statistics.fmean(values)
551
+ elif aggregation == "median":
552
+ value = statistics.median(values)
553
+ elif aggregation == "max":
554
+ value = max(values)
555
+ elif aggregation == "min":
556
+ value = min(values)
557
+ elif aggregation == "count":
558
+ value = float(len(values))
559
+ else:
560
+ raise ValueError(f"unsupported year_aggregation for csv_annual_series_audit: {aggregation}")
561
+ aggregated.append({"year": year, "value": value})
562
+ return aggregated
563
+
564
+
565
+ def csv_annual_series_outputs(input_dir: Path, output_dir: Path) -> None:
566
+ spec = _read_json(input_dir / "analysis_spec.json")
567
+ csv_name = spec["input_file"]
568
+ year_column = spec["year_column"]
569
+ value_column = spec["value_column"]
570
+ # Optional: derive the year from an ISO-8601 timestamp column (e.g. USGS FDSN
571
+ # `time` = "2022-06-29T19:17:58.929Z") instead of parsing an integer year.
572
+ # When unset, behaviour is unchanged (integer year column).
573
+ year_from_timestamp = bool(spec.get("year_from_timestamp", False))
574
+ year_aggregation = str(spec.get("year_aggregation") or "").strip().lower()
575
+ raw_rows: list[dict[str, Any]] = []
576
+ with (input_dir / csv_name).open("r", encoding="utf-8", newline="") as raw_handle:
577
+ lines = [line for line in raw_handle if not line.lstrip().startswith("#")]
578
+ reader = csv.DictReader(lines)
579
+ for item in reader:
580
+ raw_year = str(item.get(year_column, "")).strip()
581
+ try:
582
+ if year_from_timestamp:
583
+ # Take the leading 4-digit year of an ISO timestamp/date.
584
+ match = re.match(r"\s*(\d{4})", raw_year)
585
+ if not match:
586
+ continue
587
+ year = int(match.group(1))
588
+ else:
589
+ year = int(raw_year)
590
+ value = float(str(item.get(value_column, "")).strip())
591
+ except (TypeError, ValueError):
592
+ continue
593
+ raw_rows.append({"year": year, "value": value})
594
+ rows = _aggregate_annual_rows(raw_rows, year_aggregation)
595
+ rows.sort(key=lambda item: item["year"])
596
+ output_dir.mkdir(parents=True, exist_ok=True)
597
+ decades: dict[str, list[float]] = {}
598
+ for row in rows:
599
+ decade_start = (row["year"] // 10) * 10
600
+ decades.setdefault(f"{decade_start}s", []).append(row["value"])
601
+ with (output_dir / "decadal_statistics.csv").open("w", encoding="utf-8", newline="") as handle:
602
+ fieldnames = [
603
+ "decade_start",
604
+ "start_year",
605
+ "end_year",
606
+ "count",
607
+ "mean_departure",
608
+ "median_departure",
609
+ "min_departure",
610
+ "max_departure",
611
+ "sample_std_departure",
612
+ ]
613
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
614
+ writer.writeheader()
615
+ for decade, values in sorted(decades.items()):
616
+ decade_start = int(decade.rstrip("s"))
617
+ years = [row["year"] for row in rows if decade_start <= row["year"] <= decade_start + 9]
618
+ writer.writerow({
619
+ "decade_start": decade_start,
620
+ "start_year": min(years),
621
+ "end_year": max(years),
622
+ "count": len(values),
623
+ "mean_departure": f"{statistics.fmean(values):.6f}",
624
+ "median_departure": f"{statistics.median(values):.6f}",
625
+ "min_departure": f"{min(values):.6f}",
626
+ "max_departure": f"{max(values):.6f}",
627
+ "sample_std_departure": f"{statistics.stdev(values):.6f}" if len(values) >= 2 else "",
628
+ })
629
+ threshold = float(spec.get("threshold", 1.0))
630
+ with (output_dir / "threshold_years.csv").open("w", encoding="utf-8", newline="") as handle:
631
+ fieldnames = ["rank", "year", "departure", "threshold"]
632
+ writer = csv.DictWriter(handle, fieldnames=fieldnames)
633
+ writer.writeheader()
634
+ rank = 1
635
+ for row in rows:
636
+ if row["value"] >= threshold:
637
+ writer.writerow({
638
+ "rank": rank,
639
+ "year": row["year"],
640
+ "departure": f"{row['value']:.6f}",
641
+ "threshold": f"{threshold:.6f}",
642
+ })
643
+ rank += 1
644
+ with (output_dir / "clean_series.csv").open("w", encoding="utf-8", newline="") as handle:
645
+ writer = csv.DictWriter(handle, fieldnames=["Year", "Departure from Average"])
646
+ writer.writeheader()
647
+ for row in rows:
648
+ writer.writerow({"Year": row["year"], "Departure from Average": f"{row['value']:.6f}"})
649
+ values = [row["value"] for row in rows]
650
+ threshold_rows = [row for row in rows if row["value"] >= threshold]
651
+ min_row = min(rows, key=lambda row: row["value"]) if rows else None
652
+ max_row = max(rows, key=lambda row: row["value"]) if rows else None
653
+ summary = {
654
+ "series_name": spec.get("series_name", value_column),
655
+ "row_count": len(rows),
656
+ "year_range": {
657
+ "start": rows[0]["year"] if rows else None,
658
+ "end": rows[-1]["year"] if rows else None,
659
+ },
660
+ "value": {
661
+ "min": round(min(values), 6) if values else None,
662
+ "min_year": min_row["year"] if min_row else None,
663
+ "max": round(max(values), 6) if values else None,
664
+ "max_year": max_row["year"] if max_row else None,
665
+ "mean": round(statistics.fmean(values), 6) if values else None,
666
+ "median": round(statistics.median(values), 6) if values else None,
667
+ "sample_std": round(statistics.stdev(values), 6) if len(values) >= 2 else None,
668
+ },
669
+ "threshold": threshold,
670
+ "years_at_or_above_threshold": len(threshold_rows),
671
+ "first_threshold_year": threshold_rows[0]["year"] if threshold_rows else None,
672
+ "last_threshold_year": threshold_rows[-1]["year"] if threshold_rows else None,
673
+ }
674
+ if year_aggregation:
675
+ summary["year_aggregation"] = year_aggregation
676
+ summary["source_row_count"] = len(raw_rows)
677
+ _write_json(output_dir / "summary.json", summary)
678
+
679
+
20260904-004544-science-environment-91c12e/tests/reference/internal/workflow_runtime.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ from workflow_adapters_runtime import csv_annual_series_outputs
3
+
4
+ def run_reference(input_dir: Path, output_dir: Path) -> None:
5
+ csv_annual_series_outputs(input_dir, output_dir)
20260904-004544-science-environment-91c12e/tests/reference/reference_manifest.json ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "workflow_kind": "csv_annual_series_audit",
3
+ "task_id": "usgs_fdsn_eq_east_africa_1985_1985_m5p5_depth_mean_quota_repair_0723",
4
+ "domain": "science_environment",
5
+ "task": "usgs_east_africa_annual_depth_audit",
6
+ "variant": "base",
7
+ "created_from": "standard reference workflow",
8
+ "required_outputs": [
9
+ {
10
+ "path": "summary.json",
11
+ "type": "json"
12
+ },
13
+ {
14
+ "path": "decadal_statistics.csv",
15
+ "type": "csv"
16
+ },
17
+ {
18
+ "path": "threshold_years.csv",
19
+ "type": "csv"
20
+ },
21
+ {
22
+ "path": "clean_series.csv",
23
+ "type": "csv"
24
+ }
25
+ ],
26
+ "numeric_tolerance": 1e-09,
27
+ "source_prior_sha256": "36b501c0d2cce7616ba007dde9bffc50787dbbb3890f01e36dc387a4dee48fe1",
28
+ "gold_output_hashes": {
29
+ "summary.json": "ade9ca34ceace01c8c9da9017e2773975af8c6ffdf71ad8e21e6b11b24a7d6ed",
30
+ "decadal_statistics.csv": "b6199da10e8c2590a828f9371f900733f2f04d57f59109590644d976f939ca1e",
31
+ "threshold_years.csv": "ad468e2115fb271d13f6f7c49bc604804dbda48dff5f622dd3cc8a36320a8f8e",
32
+ "clean_series.csv": "82c40f92a67d839d74f541468c9affe51022ceb80f797f690af20fc828db5b70"
33
+ }
34
+ }
20260904-004544-science-environment-91c12e/tests/reference/reference_solution.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import argparse
4
+ import sys
5
+ from pathlib import Path
6
+
7
+
8
+ def main() -> int:
9
+ parser = argparse.ArgumentParser()
10
+ parser.add_argument("--input", required=True)
11
+ parser.add_argument("--output", required=True)
12
+ args = parser.parse_args()
13
+ sys.path.insert(0, str(Path(__file__).resolve().parent / "internal"))
14
+ from workflow_runtime import run_reference
15
+ run_reference(Path(args.input), Path(args.output))
16
+ return 0
17
+
18
+
19
+ if __name__ == "__main__":
20
+ raise SystemExit(main())
20260904-004544-science-environment-91c12e/tests/test.sh ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -u
3
+
4
+ TESTS_DIR="${HARBOR_TESTS_DIR:-/tests}"
5
+ WORKSPACE_DIR="${HARBOR_WORKSPACE_DIR:-/workspace}"
6
+ LOGS_DIR="${HARBOR_LOGS_DIR:-/logs/verifier}"
7
+
8
+ mkdir -p "${LOGS_DIR}" "${WORKSPACE_DIR}/output"
9
+
10
+ python "${TESTS_DIR}/evaluator_runner.py" \
11
+ --output-dir "${WORKSPACE_DIR}/output" \
12
+ --reference-dir "${TESTS_DIR}/reference" \
13
+ --reward-json "${LOGS_DIR}/reward.json" \
14
+ --details-json "${LOGS_DIR}/ale_evaluator_details.json"
15
+
16
+ if [ ! -f "${LOGS_DIR}/reward.json" ]; then
17
+ echo '{"score":0.0,"format":0.0,"output_present":0.0,"evaluator_available":0.0,"item_count":0.0}' > "${LOGS_DIR}/reward.json"
18
+ fi
19
+
20
+ python - <<'PY' "${LOGS_DIR}/reward.json" "${LOGS_DIR}/reward.txt"
21
+ import json
22
+ import sys
23
+ from pathlib import Path
24
+ reward = json.loads(Path(sys.argv[1]).read_text(encoding="utf-8"))
25
+ score = float(reward.get("score", 0.0))
26
+ Path(sys.argv[2]).write_text(f"{score}\n", encoding="utf-8")
27
+ PY
28
+
29
+ exit 0
20260904-004551-science-environment-99ca18/.DS_Store ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:985b3f476d8632ba91423e36e017b96928f4180b2158dcd7c8ef46e62bb3bb95
3
+ size 6148
20260904-004551-science-environment-99ca18/environment/Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ WORKDIR /workspace
4
+
5
+ COPY public_data/input /workspace/input
6
+ COPY public_data/software /workspace/software
7
+ COPY public_data/task_card.json /workspace/task_card.json
8
+ COPY public_data/main.py /workspace/main.py
9
+ COPY public_data/README.md /workspace/README.md
10
+
11
+ RUN mkdir -p /workspace/output /workspace/report /logs/agent /logs/artifacts \
12
+ && chmod -R 777 /workspace/output /workspace/report /logs