Skip to content

feat: 完善统一金融数据网关 - #79

Open
yyq66 wants to merge 3 commits into
helsome:mainfrom
yyq66:feat/issue-22-financial-data-gateway
Open

feat: 完善统一金融数据网关#79
yyq66 wants to merge 3 commits into
helsome:mainfrom
yyq66:feat/issue-22-financial-data-gateway

Conversation

@yyq66

@yyq66 yyq66 commented Sep 11, 2026

Copy link
Copy Markdown

变更概述

  • 引入 provider-neutral 的金融数据查询契约,隔离 Longbridge 与 Massive 的供应商类型。
  • 通过 ProviderRouter 统一执行 quote、K-line 和 company profile 查询。
  • 完整保留实际 provider、抓取时间、市场时间、延迟和过期等 provenance 信息。
  • Massive 快照报价不可用时,自动回退到日线聚合数据。
  • 增加 Massive API 缓存与请求限制兼容处理。
  • 新增 Longbridge 与 Massive 双 Provider 真实 E2E 验证脚本。
  • 新增 E2E 守卫测试,默认不会发起真实网络请求。
  • 更新中英文文档和连接界面提示。
  • 保留 capability matrix 与 UNSUPPORTED_CAPABILITY 结构化错误行为。

验证结果

  • bun run typecheck:全部通过。
  • bun test packages/shared/src/providers:110 项通过。
  • bun run test:provider-e2e:guard:2 项通过。
  • 双 Provider 真实 E2E:Longbridge 和 Massive 的 quote、K-line、company profile 均通过。
  • git diff --check:通过。

共享包全量测试中有 1 个既有 Windows 路径断言失败:
PiRuntimeAdapter > isolates sessions by switching the runtime session file

该失败与本次 Provider/Massive 改动无关,表现为测试期望 /tmp/pi/...,Windows 实际返回 \\tmp\\pi\\...

Refs #22

统一 provider-neutral 请求类型,保留路由 provenance,并覆盖行情、历史和基本面能力。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当前实现可以按 #22 的增量 gateway wiring 审,不要求你补完整真实双 provider E2E,但正式测试报告还缺两项:请补 Bun 版本和 OS/平台。现有 typecheck + provider/capability 102 tests 不需要扩大重跑。

另外请把 Closes #22 改成 Refs #22 / Part of #22:你已经明确 Longbridge CLI 未安装、没有真实第二 provider 结果,因此还不足以关闭 #22 的“两种真实 provider + provenance/fallback”整体验收。补这两个小项后即可继续按安全增量审核。

@helsome
helsome dismissed their stale review September 11, 2026 15:29

作者已补齐 Bun/OS,并将 Closes #22 改为 Refs #22,明确不提前关闭真实双 Provider 验收;旧 Changes Requested 已过期。

@helsome helsome left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试材料已补齐:Bun 1.4.2 / Windows,provider + capability 102 tests 通过、全仓 typecheck 通过;该 PR 也已明确改为 Refs #22,只作为统一金融数据网关的增量实现,不提前声称完成真实双 Provider E2E。按当前 scope 可以合入。

helsome commented Sep 11, 2026

Copy link
Copy Markdown
Owner

代码与测试材料已通过 review;当前唯一阻塞是与最新 main 的 Git 冲突,GitHub merge 返回 Pull Request has merge conflicts。请只需 rebase/resolve 最新 main 后跑基础 CI,不要求补新的双 Provider E2E 或扩大实现 scope。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants