Commit Graph

248 Commits

Author SHA1 Message Date
2569718930@qq.com c9d03fd3e1 feat: implement dashboard state management, API proxy layer, and modular UI components for weather monitoring and payments 2026-05-14 15:05:13 +08:00
2569718930@qq.com 02add6d994 feat: implement city weather detail API routing, dashboard data models, and monitoring infrastructure 2026-05-14 14:21:28 +08:00
2569718930@qq.com 6c4f43fba6 Aurora→Denver 重命名 + 接入 MADIS HFMETAR 5 分钟数据源 2026-05-14 01:09:17 +08:00
2569718930@qq.com 40f231b76d 优化 Vercel Fluid CPU:API加CDN缓存、缩小middleware范围、跳过公共API的Supabase身份转发
- 7条GET路由加 s-maxage + stale-while-revalidate,fetch 改为 next revalidate
- middleware matcher 从全匹配缩小到9条需auth的路径,移除 isStaticAsset
- 8条公共API路由加 includeSupabaseIdentity: false
- backend-auth getSession 为空时跳过 getUser
- subscription-help 加 I18nProvider,移除 force-dynamic → 静态预渲染
- next.config.mjs 加静态资源 immutable 缓存头

Tested: npx tsc --noEmit 通过,npm run build 通过
2026-05-13 14:23:04 +08:00
AmandaloveYang c50a057562 首尔、釜山不再展示周边站(AMOS 跑道传感器已取代 KMA 站网)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 18:11:03 +08:00
AmandaloveYang 55bb06d213 移除 Masroor Air Base 机场城市(数据源、别名、时区、前端面板、文档、测试)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 16:39:04 +08:00
2569718930@qq.com b26ec05b81 AMOS 跑道温度范围:城市决策卡头部展示"跑道实况 14.6~15.2℃"
后端:
- amos_station_sources.py 新增 runway_temp_range (跑道温度 min,max)
- 取所有有效跑道温度的最小值和最大值

前端:
- CityCardHeader 新增 observedLabel prop(标签自定义)
- 有 AMOS 数据时显示"跑道实况"替代"当前温度"
- 温度展示格式:14.6~15.2℃(跑道温度范围)
- 无 AMOS 时回退原有 METAR 温度显示
2026-05-10 20:19:48 +08:00
2569718930@qq.com 23e5d10f65 Fix Korean AMOS runway parsing 2026-05-10 19:34:18 +08:00
2569718930@qq.com 3f351ac60c Busan 机场观测面板:METAR 数据兜底展示
问题:AMOS 仅支持仁川 RKSI,釜山 RKPK 无法获取跑道级数据
解决:AmosRunwayPanel 新增 airportCurrent 回退模式

- 有 AMOS 数据时:展示完整跑道卡片网格(首尔/仁川)
- 无 AMOS 时:展示单张机场观测卡片(釜山/所有其他机场)
  包含:温度、风向风速、气压 QNH、能见度
  标注数据来源(METAR/AMOS)和是否过旧
- AirportCurrentConditions 类型新增 pressure_hpa 字段

这样首尔有完整的 4 对跑道数据,釜山至少展示机场官方观测值
2026-05-10 18:58:42 +08:00
2569718930@qq.com fe3f48f255 城市决策卡新增 AMOS 跑道温度面板
- 新增 AmosRunwayPanel 组件:展示每条跑道的温度/露点/能见度/RVR/风速
- 跑道卡片网格布局 (auto-fit minmax 160px)
- 每条跑道独立显示:跑道编号、温度(含露点)、能见度、RVR、风速范围
- 官方 METAR 标签 vs 跑道中位数标签
- CityDetail 类型新增 AmosData 接口
- 暗色/浅色主题均已适配
- 仅首尔/釜山(有 AMOS 数据)时显示
2026-05-10 18:30:59 +08:00
2569718930@qq.com d94476f943 UX 审查修复:统一修正术语、图表"现在"标记、专业术语解释、异常行动建议
P0-1 术语统一:
- WeatherDecisionBand 改用"上修/下修/维持"替代"偏高温/暂不追/等待确认"
- 与 AI 后端提示词使用的术语体系一致

P0-9 图表"现在"标记:
- chart-utils.ts 导出 currentIndex
- AiCityTemperatureChart 在 currentIndex 处绘制竖线(蓝色虚线)

P0-13 专业术语解释:
- DataFreshnessBar 新增 labelTitle 属性(hover tooltip)
- METAR → "机场气象观测报文" / "Meteorological Aerodrome Report"
- HKO → "香港天文台官方实测" / "Hong Kong Observatory official readings"

P0-16 异常行动建议:
- primaryReason 追加行动指引(实测突破→建议关注偏高温区间等待确认 / 峰值已过→建议避免追高 / 观测过旧→建议等待新报文)

P1-8 DEB 路径分段样式:
- 过去部分实线(已确定),未来部分虚线(预测不确定)

P1-11 HistoryChart 单位:
- tooltip 使用 temp_symbol 替代硬编码 °

Tested: npx tsc --noEmit
2026-05-10 17:33:15 +08:00
2569718930@qq.com b3ea8dcfa7 数据链路 P1 修复:ETag 缓存 + 校准漂移检测
P1-5 ETag 支持:
- 后端新增 _etag_middleware:GET /api/* 自动返回 ETag (MD5)
- 支持 If-None-Match 请求头,匹配时返回 304 + 30s Cache-Control
- 前端 cache: no-store → default,浏览器自动处理 ETag/304 节省带宽

P1-6 校准漂移检测:
- probability_calibration.py 新增 check_calibration_drift()
- 对比最近 200 条 daily_records 的 CRPS 与校准基线
- 漂移 >15% 时返回 warning 提示重新训练
- 集成到 /api/system/status 的 probability.drift 字段

Tested: python -m ruff check ., npx tsc --noEmit
2026-05-10 16:54:48 +08:00
2569718930@qq.com c0bb2acf78 修复数据链路 P0 瓶颈:缓存炸弹、Context 重渲染、LGBM 循环、TTL 不匹配
P0-1 sessionStorage 限制:
- writeCityDetailCacheBundle 只保留最近 3 个城市的详情
- 避免 3-10MB JSON 序列化阻塞主线程

P0-2 Context 拆分:
- 新增 CityDetailsContext 独立管理 cityDetailsByName 变更
- 新增 useCityDetails hook,只订阅详情的组件不再因 cities/proAccess 变化重渲染
- DashboardStoreContext 保持不变,向后兼容

P0-3 扫描终端 TTL:
- SCAN_TERMINAL_PAYLOAD_TTL_SEC 30s → 120s
- 匹配 ThreadPoolExecutor(4) x 60 城的实际重算耗时

P0-4 LGBM 循环依赖:
- LGBM 预测值不再作为 DEB 输入参与权重计算
- 保留为独立参考字段 lgbm.prediction 输出给前端展示
- 消除 DEB → LGBM 训练 → DEB 的循环

新增 docs/data-architecture-review.md 完整数据链路审查报告

Tested: npx tsc --noEmit, python -m ruff check .
2026-05-10 16:48:28 +08:00
2569718930@qq.com ce1da6a686 完成产品审查剩余修复:新手指引、反馈入口、付费墙预览
P1-4:新增 WelcomeOverlay 新手指引
- 首次访问时显示 3 步引导:①从地图选城市 ②查看城市简报 ③解锁 Pro 深入分析
- 圆点进度指示、跳过/下一步按钮、点背景可关闭
- 看过一次后 localStorage 标记不再显示

P1-5:付费墙增加功能预览
- HistoryModal 在付费墙上方展示功能说明文案
- 新增 i18n 键 history.previewTitle / history.previewDesc(中英双语)

P2-9:新增反馈入口
- 顶栏增加 Telegram 反馈按钮(MessageCircle 图标)
- 点击跳转 PolyWeather 社群

Tested: npx tsc --noEmit
2026-05-10 16:19:21 +08:00
2569718930@qq.com 9635387beb 移除日历视图:功能与决策卡重叠,维护成本高于价值
- 删除 CalendarView.tsx、calendar-action-utils.ts 及其测试文件
- 删除 ScanTerminalCalendar.module.css
- ScanTerminalDashboard:移除日历 tab 按钮、日历渲染分支、ContentView 类型中的 calendar
- ScanTerminalLightTheme:清理所有 .scan-calendar-* 规则(~40 行)
- scan-root-styles.ts:移除 ScanTerminalCalendar 导入

同时完善地理排序:
- scan_terminal_filters.py:market_region_from_tz_offset 细化为 7 个区域(东亚/东南亚/中亚/西亚/欧洲非洲/南美/北美)并增加 sort_order
- scan_terminal_city_row.py:传递 trading_region_sort
- dashboard-types.ts:增加 trading_region_sort 字段
- decision-utils.ts:sortRowsByUserTime 按 trading_region_sort 优先排序

Rejected: keep-calendar-view, calendar-actions-overlap-with-decision-cards
Tested: npx tsc --noEmit, python -m ruff check .
2026-05-10 15:48:18 +08:00
2569718930@qq.com a684586cb4 统一 DEB 数据源为单一计算路径
getModelView 优先使用根级 detail.deb.prediction 保证与 AI 证据面板一致,
_build_city_detail_payload 补上缺失的 deb 和 multi_model_daily 字段,
_analyze_summary 补上 LGBM 增强步骤使其与 _analyze 产出相同的 DEB 值。

Constraint: 三个入口 (panel/full/summary) 的 DEB 必须经过同一套 calculate_dynamic_weights + LGBM 重算流程
Tested: ruff + tsc 全过
2026-05-06 18:24:15 +08:00
2569718930@qq.com 118d4e44df This version of Antigravity is no longer supported. Please upgrade to receive the latest features. 2026-05-01 11:37:09 +08:00
2569718930@qq.com 113c0131b5 This version of Antigravity is no longer supported. Please upgrade to receive the latest features. 2026-05-01 11:17:20 +08:00
2569718930@qq.com 9d0570a36b This version of Antigravity is no longer supported. Please upgrade to receive the latest features. 2026-05-01 11:11:17 +08:00
2569718930@qq.com 569f3eef97 Make weather-market UI reliable before shipping
Proxy routes now share one upstream-error adapter so client-actionable statuses such as auth, entitlement, validation, and rate limits survive the BFF instead of becoming opaque 502s. The scan terminal mobile overrides also load last and remove desktop rail constraints so phones get a single readable column.

Constraint: Mobile users reported the dashboard was unreadable, and BFF proxy errors were masking expected client states.

Rejected: Let every route keep bespoke error JSON | continued inconsistent status codes and production detail leakage.

Confidence: high

Scope-risk: moderate

Directive: Keep ScanTerminalMobile.module.css imported after desktop scan-terminal CSS so mobile breakpoints win.

Tested: npx tsc --noEmit --pretty false --project frontend/tsconfig.json

Tested: npm run build

Tested: npm run test:business

Tested: Chrome mobile smoke test at 390px with no horizontal overflow

Not-tested: Real device Safari/Android manual QA
2026-04-29 11:22:49 +08:00
2569718930@qq.com a77d613c2b Move weather summaries out of the dashboard utility bulk
Weather labels, METAR translation, risk badges, and hero meta chips were still embedded in dashboard-utils even though panel, modal, and detail views use them as focused presentation helpers. This moves them into weather-summary-utils while keeping dashboard-utils re-export compatibility.

Constraint: Preserve existing weather/METAR/risk/hero meta wording.

Rejected: Move airport narrative in the same pass | it has broader AI narrative coupling and should be separated independently.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for weather-summary-utils, dashboard-utils, PanelSections, DetailPanel, and FutureForecastModal

Tested: npm run build

Not-tested: Visual snapshot of every weather icon/label combination.
2026-04-28 12:17:42 +08:00
2569718930@qq.com 5dc39b1573 Move model views out of the dashboard utility bulk
Probability and multi-model view adapters were still embedded in dashboard-utils even though table, panel, modal, and city-card views use them as small pure selectors. This moves them into model-utils and keeps dashboard-utils re-export compatibility.

Constraint: Preserve model/probability return shapes and existing fallback behavior.

Rejected: Merge model-utils with chart-utils | model selectors and chart data preparation change at different rates.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for model-utils, dashboard-utils, and PanelSections

Tested: npm run build

Not-tested: Bundle analyzer size comparison.
2026-04-28 12:07:43 +08:00
2569718930@qq.com ecbba9160d Let chart views avoid the dashboard utility bulk
The intraday chart data builder lived inside dashboard-utils with observation-source and TAF helpers, so chart consumers had to depend on the large dashboard utility surface. This moves chart data preparation, observation-source helpers, and TAF marker labels into focused modules while keeping dashboard-utils re-export compatibility.

Constraint: Preserve existing chart data shape, observation labels, TAF labels, and legacy dashboard-utils exports.

Rejected: Rewrite chart data generation while moving it | this pass is a boundary move only so visual behavior remains stable.

Confidence: high

Scope-risk: moderate

Reversibility: clean

Tested: TypeScript diagnostics for chart-utils, dashboard-utils, observation-source-utils, and taf-utils

Tested: npm run build

Not-tested: Browser visual regression across every chart city.
2026-04-28 11:58:58 +08:00
2569718930@qq.com c476ad2123 Move pace math out of the dashboard utility bulk
Pace-adjusted high calculations were embedded in dashboard-utils alongside chart, profile, and modal helpers. This moves the pure pace model and reusable HM time helpers into focused modules while keeping dashboard-utils re-export compatibility for older callers.

Constraint: Preserve existing pace wording, thresholds, and calculation output.

Rejected: Split all remaining dashboard-utils helpers at once | model/chart/modal helpers have wider call surfaces and should move in separate reversible passes.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for pace-utils, time-utils, dashboard-utils, and FutureForecastModal

Tested: npm run build

Not-tested: Bundle analyzer size comparison.
2026-04-28 11:45:34 +08:00
2569718930@qq.com be41becb30 Let temperature formatting ship without dashboard bulk
Temperature formatting was embedded in the large dashboard utility module, so small scan-terminal views had to import the heavy utility surface for simple labels. This moves the pure temperature helpers into a lightweight module while keeping dashboard-utils re-exports for compatibility.

Constraint: Preserve existing temperature text output and all dashboard-utils import compatibility.

Rejected: Split chart, pace, and model helpers in the same pass | those helpers have wider coupling and should move one boundary at a time.

Confidence: high

Scope-risk: narrow

Reversibility: clean

Tested: TypeScript diagnostics for temperature-utils, dashboard-utils, and OpportunityTable

Tested: npm run build

Not-tested: Bundle analyzer size comparison.
2026-04-28 11:32:03 +08:00
2569718930@qq.com 89a71d1bc0 Add Qingdao to the tradable city network
Qingdao needs the same airport-settlement path as the other Wunderground-backed APAC cities, so the registry, aliases, timezone, prewarm, official links, market focus, and tests now point to ZSQD / Qingdao Jiaodong International Airport.

Constraint: User supplied Wunderground Qingdao/ZSQD settlement URL.
Rejected: Add a partial registry-only entry | it would show in APIs without frontend links, prewarm coverage, or alias support.
Confidence: high
Scope-risk: narrow
Reversibility: clean
Tested: pytest tests/test_country_networks.py tests/test_web_observability.py::test_cities_endpoint_includes_new_wunderground_cities -q
Tested: npm run build
Not-tested: Live Wunderground fetch for ZSQD in production.
2026-04-28 07:08:33 +08:00
2569718930@qq.com f39f59f47a feat: implement AI city forecasting and market scan hooks with backend API integration for the scan terminal dashboard 2026-04-26 11:28:36 +08:00
2569718930@qq.com 9b77a3a0e2 feat: implement AI city forecast and market scan integration for terminal dashboard 2026-04-26 11:08:58 +08:00
2569718930@qq.com e374ad4bf0 feat: add AI city forecast terminal and integration components 2026-04-26 10:43:14 +08:00
2569718930@qq.com 0f23d8af9d feat: implement dashboard types, Polymarket data collection, and decision utilities for AI-driven city weather analysis 2026-04-26 09:40:02 +08:00
2569718930@qq.com 1595f4a92e feat: implement ScanTerminalDashboard with AI-driven city forecast streaming and opportunity tracking 2026-04-26 08:12:31 +08:00
2569718930@qq.com ce0f7629a2 feat: implement scan terminal dashboard with AI-driven city analysis and state management 2026-04-26 03:42:13 +08:00
2569718930@qq.com 3237f95e8c feat: implement scan terminal dashboard with real-time opportunity tracking and visualization components 2026-04-26 00:24:11 +08:00
2569718930@qq.com d5fb40a544 feat: implement weather dashboard components, state management, and API routes for terminal scanning and assistant chat 2026-04-25 06:42:24 +08:00
2569718930@qq.com 3083d6b8fe feat: implement scan terminal service with caching, background refresh, and AI-driven market analysis support 2026-04-25 04:25:17 +08:00
2569718930@qq.com 77c0597e74 feat: implement Polymarket data collection and dashboard UI for weather market analysis 2026-04-25 03:59:02 +08:00
2569718930@qq.com 0e5a1f2652 feat: implement ScanTerminalDashboard with modular components and backend integration for Polymarket data collection 2026-04-25 03:26:28 +08:00
2569718930@qq.com 2b9e10384e Use fresh city detail for scan list probabilities 2026-04-25 02:41:38 +08:00
2569718930@qq.com 62a12257f0 Upgrade V4 scan to city analysis 2026-04-25 02:19:37 +08:00
2569718930@qq.com df6a2c73ed Add V4 scan run logs 2026-04-25 01:09:08 +08:00
2569718930@qq.com 091d2efef3 Add DeepSeek V4 scan review 2026-04-24 23:32:32 +08:00
2569718930@qq.com d2bc9e3ac8 Add scan terminal request timeouts 2026-04-24 22:47:03 +08:00
2569718930@qq.com 99ffa717ef Use model cluster for tail no scan signals 2026-04-24 15:12:53 +08:00
2569718930@qq.com 379a4b9e45 Fix intraday modal hook order 2026-04-24 13:04:27 +08:00
2569718930@qq.com 467f736602 feat: implement dashboard store and API routes for city market scanning and analysis 2026-04-24 12:46:44 +08:00
2569718930@qq.com c61a3f500d feat: implement Polymarket read-only data service and add scan terminal dashboard components 2026-04-24 10:19:16 +08:00
2569718930@qq.com a1faacb302 feat: add scan dashboard components and local development configuration 2026-04-24 02:14:20 +08:00
2569718930@qq.com 79b58a8b98 Add locale controls and distribution previews to scan terminal 2026-04-24 00:34:09 +08:00
2569718930@qq.com ddc0180ae6 Implement EMOS scan terminal with REST-only market data 2026-04-23 23:49:52 +08:00
2569718930@qq.com 9a2ef217eb feat: implement dashboard opportunity table and supporting UI components for weather market analysis 2026-04-23 23:03:26 +08:00