Zin299 commited on
Commit
8f604cb
·
1 Parent(s): 0d11aa0

Deploy v4.6.2 ocean download url base fix

Browse files
Files changed (41) hide show
  1. README.md +1 -1
  2. VERSION +1 -1
  3. services/ocean_batch.py +37 -7
  4. tests/test_api_entry_preflight_v456.py +1 -1
  5. tests/test_chat_lifecycle_progress_v393.py +1 -1
  6. tests/test_clarification_ui_v454.py +1 -1
  7. tests/test_context_and_multitask_finalize_v451.py +1 -1
  8. tests/test_download_host_authorization_v460.py +1 -1
  9. tests/test_download_opfs_fallback_v459.py +1 -1
  10. tests/test_download_progress_v391.py +1 -1
  11. tests/test_download_resilience_v422.py +1 -1
  12. tests/test_frontend_preflight_v457.py +1 -1
  13. tests/test_history_sidebar_v373.py +1 -1
  14. tests/test_large_download_jobs_v400.py +1 -1
  15. tests/test_merged_health_v433.py +1 -1
  16. tests/test_multitask_observability_v442.py +1 -1
  17. tests/test_multitask_sse_finalize_v452.py +1 -1
  18. tests/test_ocean_batch_downloads_v420.py +1 -1
  19. tests/test_ocean_batch_routing_v421.py +1 -1
  20. tests/test_ocean_batch_v410.py +1 -1
  21. tests/test_ocean_date_default_v453.py +1 -1
  22. tests/test_ocean_download_url_base_v462.py +21 -0
  23. tests/test_p0_finish_v380.py +1 -1
  24. tests/test_p0_phase2_v371.py +1 -1
  25. tests/test_p0_phase3_v372.py +1 -1
  26. tests/test_platform_reliability_v450.py +1 -1
  27. tests/test_quality_center_v362.py +1 -1
  28. tests/test_quality_trust_v361.py +1 -1
  29. tests/test_release_stability.py +1 -1
  30. tests/test_resumable_batch_download_v458.py +1 -1
  31. tests/test_route_region_clarification_v455.py +1 -1
  32. tests/test_runtime_hotfix_v376.py +1 -1
  33. tests/test_sidebar_collapse_v374.py +1 -1
  34. tests/test_sidebar_partial_collapse_v375.py +1 -1
  35. tests/test_smart_progress_avatar_sync_v441.py +1 -1
  36. tests/test_sse_heartbeat_v401.py +1 -1
  37. tests/test_ui_avatar_multitask_v440.py +1 -1
  38. tests/test_unified_download_manager_v392.py +1 -1
  39. tests/test_unified_query_v390.py +1 -1
  40. tests/test_upstream_refresh_retry_v461.py +1 -1
  41. tests/test_v381_navigation_ocean_intent.py +1 -1
README.md CHANGED
@@ -10,7 +10,7 @@ pinned: false
10
 
11
  # Global Marine Foundation Data Agent
12
 
13
- Current UI release: **v4.6.1**.
14
 
15
 
16
  ## v3.4.0 稳定性重构(第一阶段)
 
10
 
11
  # Global Marine Foundation Data Agent
12
 
13
+ Current UI release: **v4.6.2**.
14
 
15
 
16
  ## v3.4.0 稳定性重构(第一阶段)
VERSION CHANGED
@@ -1 +1 @@
1
- 4.6.1
 
1
+ 4.6.2
services/ocean_batch.py CHANGED
@@ -10,7 +10,7 @@ import time
10
  from datetime import date, datetime, timedelta
11
  from pathlib import Path
12
  from typing import Any
13
- from urllib.parse import urlparse
14
 
15
  from services.region_registry import resolve_region
16
 
@@ -110,9 +110,11 @@ class OceanBatchManager:
110
  def __init__(self,root:Path,api_url:str,concurrency:int=6):
111
  self.root=Path(root);self.root.mkdir(parents=True,exist_ok=True)
112
  self.api_url=str(api_url).rstrip("/")
 
 
 
113
  self.public_base_url=(
114
  os.environ.get("MARINE_PUBLIC_BASE_URL")
115
- or os.environ.get("PUBLIC_BASE_URL")
116
  or ""
117
  ).strip().rstrip("/")
118
  self.concurrency=max(1,min(int(concurrency),12))
@@ -130,11 +132,41 @@ class OceanBatchManager:
130
 
131
  def _path(self,jid):return self.root/f"{jid}.json"
132
 
 
 
 
133
  def _download_url(self,path):
134
  path=str(path or "").strip()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
135
  if not path.startswith("/download/"):
136
  return ""
137
- return f"{self.public_base_url or self.api_url}{path}"
 
 
 
 
 
 
 
 
 
138
  def _read(self,jid):
139
  p=self._path(jid)
140
  if not p.exists():return None
@@ -231,8 +263,7 @@ class OceanBatchManager:
231
  if not job:return
232
  sub=next((x for x in job["subtasks"] if x["subtask_id"]==subtask_id),None)
233
  if not sub:return
234
- if isinstance(result,dict) and result.get("download_path") and not result.get("download_url"):
235
- result["download_url"]=self._download_url(result["download_path"])
236
  if isinstance(result,dict) and result.get("download_url"):
237
  sub["status"]="completed"
238
  sub["download_url"]=str(result["download_url"])
@@ -368,8 +399,7 @@ class OceanBatchManager:
368
  except Exception as exc:
369
  detail=str(exc)[:500]
370
  if attempt<2:await asyncio.sleep(1.0*(2**attempt))
371
- if isinstance(result,dict) and result.get("download_path") and not result.get("download_url"):
372
- result["download_url"]=self._download_url(result["download_path"])
373
  if not isinstance(result,dict) or not result.get("download_url"):
374
  raise RuntimeError(detail or "无法刷新 Ocean 下载链接")
375
  job=self._read(jid)
 
10
  from datetime import date, datetime, timedelta
11
  from pathlib import Path
12
  from typing import Any
13
+ from urllib.parse import urlparse, urljoin
14
 
15
  from services.region_registry import resolve_region
16
 
 
110
  def __init__(self,root:Path,api_url:str,concurrency:int=6):
111
  self.root=Path(root);self.root.mkdir(parents=True,exist_ok=True)
112
  self.api_url=str(api_url).rstrip("/")
113
+ # Only an Ocean-specific public base may override the Marine API
114
+ # base. Generic PUBLIC_BASE_URL points to the Hugging Face UI Space in
115
+ # production and must never be used for Ocean /download/... files.
116
  self.public_base_url=(
117
  os.environ.get("MARINE_PUBLIC_BASE_URL")
 
118
  or ""
119
  ).strip().rstrip("/")
120
  self.concurrency=max(1,min(int(concurrency),12))
 
132
 
133
  def _path(self,jid):return self.root/f"{jid}.json"
134
 
135
+ def _marine_download_base(self) -> str:
136
+ return (self.public_base_url or self.api_url).rstrip("/")
137
+
138
  def _download_url(self,path):
139
  path=str(path or "").strip()
140
+ if not path:
141
+ return ""
142
+ parsed=urlparse(path)
143
+
144
+ # A /download/... URL hosted by the UI Space is a bad rebase. Remap
145
+ # that path to the Ocean/Marine service base.
146
+ if parsed.scheme in {"http","https"}:
147
+ host=(parsed.hostname or "").lower()
148
+ marine_host=(urlparse(self._marine_download_base()).hostname or "").lower()
149
+ if (
150
+ parsed.path.startswith("/download/")
151
+ and host.endswith(".hf.space")
152
+ and host != marine_host
153
+ ):
154
+ suffix=parsed.path + (("?" + parsed.query) if parsed.query else "")
155
+ return urljoin(self._marine_download_base()+"/", suffix.lstrip("/"))
156
+ return path
157
+
158
  if not path.startswith("/download/"):
159
  return ""
160
+ return urljoin(self._marine_download_base()+"/", path.lstrip("/"))
161
+
162
+ def _normalize_export_download_url(self,result):
163
+ if not isinstance(result,dict):
164
+ return ""
165
+ raw=str(result.get("download_url") or result.get("download_path") or "").strip()
166
+ normalized=self._download_url(raw)
167
+ if normalized:
168
+ result["download_url"]=normalized
169
+ return normalized
170
  def _read(self,jid):
171
  p=self._path(jid)
172
  if not p.exists():return None
 
263
  if not job:return
264
  sub=next((x for x in job["subtasks"] if x["subtask_id"]==subtask_id),None)
265
  if not sub:return
266
+ self._normalize_export_download_url(result)
 
267
  if isinstance(result,dict) and result.get("download_url"):
268
  sub["status"]="completed"
269
  sub["download_url"]=str(result["download_url"])
 
399
  except Exception as exc:
400
  detail=str(exc)[:500]
401
  if attempt<2:await asyncio.sleep(1.0*(2**attempt))
402
+ self._normalize_export_download_url(result)
 
403
  if not isinstance(result,dict) or not result.get("download_url"):
404
  raise RuntimeError(detail or "无法刷新 Ocean 下载链接")
405
  job=self._read(jid)
tests/test_api_entry_preflight_v456.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_guard_is_before_auth_and_dispatch():
8
  chat=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_guard_is_before_auth_and_dispatch():
8
  chat=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
tests/test_chat_lifecycle_progress_v393.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_393():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_frontend_lifecycle_progress():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_393():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_frontend_lifecycle_progress():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_clarification_ui_v454.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_missing_date_reuses_canonical_region_bbox():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_missing_date_reuses_canonical_region_bbox():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
tests/test_context_and_multitask_finalize_v451.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_new_query_slot_reset():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_new_query_slot_reset():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
tests/test_download_host_authorization_v460.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_batch_url_authorization_helper_exists():
8
  py=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_batch_url_authorization_helper_exists():
8
  py=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
tests/test_download_opfs_fallback_v459.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_opfs_is_probed_not_assumed():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_opfs_is_probed_not_assumed():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_download_progress_v391.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_391():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_p1_label_removed():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_391():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_p1_label_removed():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_download_resilience_v422.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_refresh_route_registered():
9
  t=(ROOT/"routes"/"ocean_batch.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_refresh_route_registered():
9
  t=(ROOT/"routes"/"ocean_batch.py").read_text(encoding="utf-8")
tests/test_frontend_preflight_v457.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_frontend_preflight_exists_before_progress():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_frontend_preflight_exists_before_progress():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_history_sidebar_v373.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_373():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_project_history_backend():
9
  route=(ROOT/"routes"/"project_package.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_373():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_project_history_backend():
9
  route=(ROOT/"routes"/"project_package.py").read_text(encoding="utf-8")
tests/test_large_download_jobs_v400.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_400():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_download_job_backend():
9
  route=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_400():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_download_job_backend():
9
  route=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
tests/test_merged_health_v433.py CHANGED
@@ -3,7 +3,7 @@ from services.ocean_batch import parse_ocean_batch_request
3
  ROOT=Path(__file__).resolve().parents[1]
4
 
5
  def test_merged_version():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_ocean_month_batch_survives_merge():
9
  p=parse_ocean_batch_request("查询 2002 年 8 月西北太平洋的 SST 数据,并导出为 CSV 文件供我下载")
 
3
  ROOT=Path(__file__).resolve().parents[1]
4
 
5
  def test_merged_version():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_ocean_month_batch_survives_merge():
9
  p=parse_ocean_batch_request("查询 2002 年 8 月西北太平洋的 SST 数据,并导出为 CSV 文件供我下载")
tests/test_multitask_observability_v442.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_frontend_sends_multitask_trace_headers():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_frontend_sends_multitask_trace_headers():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_multitask_sse_finalize_v452.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_parallel_sse_uses_real_blank_line_separator():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_parallel_sse_uses_real_blank_line_separator():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_ocean_batch_downloads_v420.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_420():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_manifest_has_filename_and_sizes():
9
  svc=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_420():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_manifest_has_filename_and_sizes():
9
  svc=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8")
tests/test_ocean_batch_routing_v421.py CHANGED
@@ -4,7 +4,7 @@ from services.ocean_batch import parse_ocean_batch_request
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_421():
7
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
8
 
9
  def test_exact_user_month_query_routes_to_batch():
10
  p=parse_ocean_batch_request("查询 2002 年 8 月西北太平洋的 SST 数据,并导出为 CSV 文件供我下载")
 
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_421():
7
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
8
 
9
  def test_exact_user_month_query_routes_to_batch():
10
  p=parse_ocean_batch_request("查询 2002 年 8 月西北太平洋的 SST 数据,并导出为 CSV 文件供我下载")
tests/test_ocean_batch_v410.py CHANGED
@@ -4,7 +4,7 @@ from services.ocean_batch import parse_ocean_batch_request
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_410():
7
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
8
 
9
  def test_month_three_variable_batch_plan():
10
  p=parse_ocean_batch_request("查询并导出 2002 年 8 月西北太平洋 120°E–140°E、20°N–40°N 的 SST、SSH、CHL 数据,并打包下载")
 
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_410():
7
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
8
 
9
  def test_month_three_variable_batch_plan():
10
  p=parse_ocean_batch_request("查询并导出 2002 年 8 月西北太平洋 120°E–140°E、20°N–40°N 的 SST、SSH、CHL 数据,并打包下载")
tests/test_ocean_date_default_v453.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_missing_date_never_defaults_to_today():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_missing_date_never_defaults_to_today():
8
  rt=(ROOT/"services"/"chat_runtime.py").read_text(encoding="utf-8")
tests/test_ocean_download_url_base_v462.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from pathlib import Path
2
+ ROOT=Path(__file__).resolve().parents[1]
3
+
4
+ def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
+
7
+ def test_generic_public_base_not_used():
8
+ py=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8")
9
+ block=py[py.index("self.public_base_url="):py.index("self.concurrency=",py.index("self.public_base_url="))]
10
+ assert "MARINE_PUBLIC_BASE_URL" in block
11
+ assert "os.environ.get(\"PUBLIC_BASE_URL\")" not in block
12
+
13
+ def test_hf_space_download_rebased_to_marine_service():
14
+ py=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8")
15
+ assert 'host.endswith(".hf.space")' in py
16
+ assert 'parsed.path.startswith("/download/")' in py
17
+ assert "urljoin(self._marine_download_base()" in py
18
+
19
+ def test_first_export_and_refresh_share_normalizer():
20
+ py=(ROOT/"services"/"ocean_batch.py").read_text(encoding="utf-8")
21
+ assert py.count("self._normalize_export_download_url(result)") >= 2
tests/test_p0_finish_v380.py CHANGED
@@ -3,7 +3,7 @@ import pathlib, re, subprocess, shutil
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_380():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_chat_runtime_extracted():
9
  ui=(ROOT/"ui_server.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_380():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_chat_runtime_extracted():
9
  ui=(ROOT/"ui_server.py").read_text(encoding="utf-8")
tests/test_p0_phase2_v371.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_frontend_feature_modules_exist():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_frontend_feature_modules_exist():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
tests/test_p0_phase3_v372.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_372():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_route_modules_exist():
9
  for name in ("datasets.py","user_state.py","project_package.py","data_health.py"):
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_372():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_route_modules_exist():
9
  for name in ("datasets.py","user_state.py","project_package.py","data_health.py"):
tests/test_platform_reliability_v450.py CHANGED
@@ -6,7 +6,7 @@ from services.ocean_batch import parse_ocean_batch_request
6
  ROOT=Path(__file__).resolve().parents[1]
7
 
8
  def test_version():
9
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
10
 
11
  def test_squid_center_uses_repository_membership():
12
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
6
  ROOT=Path(__file__).resolve().parents[1]
7
 
8
  def test_version():
9
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
10
 
11
  def test_squid_center_uses_repository_membership():
12
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_quality_center_v362.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT = pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_371():
6
- assert (ROOT / "VERSION").read_text(encoding="utf-8").strip() == "4.6.1"
7
 
8
  def test_native_health_backend():
9
  text = (ROOT / "routes" / "data_health.py").read_text(encoding="utf-8")
 
3
  ROOT = pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_371():
6
+ assert (ROOT / "VERSION").read_text(encoding="utf-8").strip() == "4.6.2"
7
 
8
  def test_native_health_backend():
9
  text = (ROOT / "routes" / "data_health.py").read_text(encoding="utf-8")
tests/test_quality_trust_v361.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version_current():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_quality_confidence_is_now_native_api_metric():
8
  text=(ROOT/"routes"/"data_health.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version_current():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_quality_confidence_is_now_native_api_metric():
8
  text=(ROOT/"routes"/"data_health.py").read_text(encoding="utf-8")
tests/test_release_stability.py CHANGED
@@ -7,7 +7,7 @@ def test_version_is_single_source():
7
  version = (ROOT / "VERSION").read_text(encoding="utf-8").strip()
8
  ui = (ROOT / "ui_server.py").read_text(encoding="utf-8")
9
  html = (ROOT / "app.html").read_text(encoding="utf-8")
10
- assert version == "4.6.1"
11
  assert 'with_name("VERSION")' in ui
12
  assert "__APP_VERSION__" in html
13
 
 
7
  version = (ROOT / "VERSION").read_text(encoding="utf-8").strip()
8
  ui = (ROOT / "ui_server.py").read_text(encoding="utf-8")
9
  html = (ROOT / "app.html").read_text(encoding="utf-8")
10
+ assert version == "4.6.2"
11
  assert 'with_name("VERSION")' in ui
12
  assert "__APP_VERSION__" in html
13
 
tests/test_resumable_batch_download_v458.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_network_loss_pauses_not_fails_all():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_network_loss_pauses_not_fails_all():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_route_region_clarification_v455.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_route_guard_exists_before_agent_dispatch():
8
  chat=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_route_guard_exists_before_agent_dispatch():
8
  chat=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
tests/test_runtime_hotfix_v376.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_376():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_no_stray_async_before_sidebar_toggle():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_376():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_no_stray_async_before_sidebar_toggle():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_sidebar_collapse_v374.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_374():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_sidebar_toggle_markup():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_374():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_sidebar_toggle_markup():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
tests/test_sidebar_partial_collapse_v375.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_375():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_sidebar_order_and_groups():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_375():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_sidebar_order_and_groups():
9
  html=(ROOT/"app.html").read_text(encoding="utf-8")
tests/test_smart_progress_avatar_sync_v441.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_simple_chat_hides_progress_until_needed():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_simple_chat_hides_progress_until_needed():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_sse_heartbeat_v401.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_401():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_chat_has_independent_heartbeat_wrapper():
9
  route=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_401():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_chat_has_independent_heartbeat_wrapper():
9
  route=(ROOT/"routes"/"chat.py").read_text(encoding="utf-8")
tests/test_ui_avatar_multitask_v440.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_assistant_avatar_removed_user_avatar_customizable():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_assistant_avatar_removed_user_avatar_customizable():
8
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
tests/test_unified_download_manager_v392.py CHANGED
@@ -3,7 +3,7 @@ import pathlib
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_392():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_download_proxy_route_registered():
9
  route=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_392():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_download_proxy_route_registered():
9
  route=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
tests/test_unified_query_v390.py CHANGED
@@ -4,7 +4,7 @@ from services.unified_query import plan_unified_query
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_390():
7
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
8
 
9
  def test_joint_squid_environment_plan():
10
  p=plan_unified_query("查询 2002 年 8 月西北太平洋柔鱼记录,并匹配 SST、SSH、CHL")
 
4
  ROOT=pathlib.Path(__file__).resolve().parents[1]
5
 
6
  def test_version_390():
7
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
8
 
9
  def test_joint_squid_environment_plan():
10
  p=plan_unified_query("查询 2002 年 8 月西北太平洋柔鱼记录,并匹配 SST、SSH、CHL")
tests/test_upstream_refresh_retry_v461.py CHANGED
@@ -2,7 +2,7 @@ from pathlib import Path
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
6
 
7
  def test_probe_returns_status_and_rejects_dead_url():
8
  py=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
 
2
  ROOT=Path(__file__).resolve().parents[1]
3
 
4
  def test_version():
5
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
6
 
7
  def test_probe_returns_status_and_rejects_dead_url():
8
  py=(ROOT/"routes"/"downloads.py").read_text(encoding="utf-8")
tests/test_v381_navigation_ocean_intent.py CHANGED
@@ -3,7 +3,7 @@ import pathlib, ast
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_381():
6
- assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.1"
7
 
8
  def test_recent_conversation_switches_to_chat():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")
 
3
  ROOT=pathlib.Path(__file__).resolve().parents[1]
4
 
5
  def test_version_381():
6
+ assert (ROOT/"VERSION").read_text(encoding="utf-8").strip()=="4.6.2"
7
 
8
  def test_recent_conversation_switches_to_chat():
9
  js=(ROOT/"static"/"js"/"app.js").read_text(encoding="utf-8")