- USAGE 新增 §6.3.1「归档的日常操作」:查看 / 筛选(回写 URL)/ 导出完整 JSON / 以此参数再跑 / 删除(写明「删除即失去结果,结果只存归档一份」)/ 历史归档用 restore_experiment_from_job 按原 id 重建;并说明归档完整度如何标注 - USAGE/README 更正技术栈与图表基座:TradingView Lightweight Charts 4.2.3 为唯一 图表基座(ECharts 已从 package.json、pnpm-lock.yaml、node_modules、文档与 架构图标注中全部清除),并记录实测证据(个股页图表根节点为 div.tv-lightweight-charts,页面 canvas 无一来自其它图表库) - ARCHITECTURE 更正「当前数据库」(原写 SQLite/未来 MySQL):现为本机 MariaDB 10.11, §6 补目标库硬约束;USAGE 补服务器身份与实测连接证据 - AGENT.md 新增 §0.1:数据库目标只允许本机 MariaDB,禁止 192.168.1.10, 由 config.py::assert_db_target_allowed 硬拦截(命中直接抛错,不静默降级) - DEV_PLAN_DIVIDEND_BACKTEST 记录三轮实施与验证、归档恢复边界(§12.5)、已知限制 - DEV_PLAN v2/v3 标注为历史记录(避免把当时的远端库地址当现状照抄); ROADMAP 更正 M3 图表选型
66 lines
4.6 KiB
JSON
66 lines
4.6 KiB
JSON
{
|
||
"schema_version": 1,
|
||
"diagram_type": "architecture",
|
||
"meta": {
|
||
"title": "A股量化研究平台 · 系统架构",
|
||
"quality_profile": "showcase",
|
||
"viewBox": [1360, 660],
|
||
"views": [
|
||
{ "id": "main-chain", "label": "主研究链", "focus": ["web-ui", "api", "services", "domain", "sqlite", "parquet"], "note": "从 Web UI 经 Research Specification 到持久化的业务主链。" },
|
||
{ "id": "quant-path", "label": "量化引擎链路", "focus": ["services", "qlib-adapter", "qlib"], "note": "Qlib 只经 Adapter 被调用,业务层不直接 import qlib。" },
|
||
{ "id": "source-path", "label": "数据源链路", "focus": ["tushare", "sina", "services"], "note": "Tushare 首选,新浪仅作缺失兜底与交叉验证。" }
|
||
]
|
||
},
|
||
"components": [
|
||
{ "id": "web-ui", "type": "frontend", "label": "Web UI", "sublabel": "Next.js · Lightweight Charts", "pos": [460, 16], "size": [320, 64] },
|
||
{ "id": "api", "type": "backend", "label": "FastAPI API", "sublabel": "Pydantic DTO · REST / SSE", "pos": [460, 118], "size": [320, 64] },
|
||
{ "id": "services", "type": "backend", "label": "Application Services", "sublabel": "数据 / 因子 / 策略 / 回测 / 实验", "pos": [400, 232], "size": [440, 108] },
|
||
{ "id": "domain", "type": "backend", "label": "Domain · Repository", "sublabel": "实体 + Protocol(禁 SQL)", "pos": [460, 392], "size": [320, 80] },
|
||
{ "id": "agent", "type": "backend", "label": "Agent Service", "sublabel": "AI 助手 · 受控 Tool", "pos": [30, 40], "size": [240, 62] },
|
||
{ "id": "tushare", "type": "external", "label": "Tushare", "sublabel": "日线 / 财务 / 日历(首选)", "pos": [30, 232], "size": [240, 64] },
|
||
{ "id": "sina", "type": "external", "label": "新浪财经", "sublabel": "兜底 / 交叉验证(备用)", "pos": [30, 390], "size": [240, 64] },
|
||
{ "id": "qlib-adapter", "type": "backend", "label": "Quant · Qlib Adapter", "sublabel": "Dataset / 训练 / 回测封装", "pos": [1010, 232], "size": [290, 72] },
|
||
{ "id": "qlib", "type": "external", "label": "Qlib 引擎", "sublabel": "LightGBM / 回测(不改源码)", "pos": [1010, 400], "size": [290, 68] },
|
||
{ "id": "sqlite", "type": "database", "label": "SQLite", "sublabel": "元数据 / 实验 / Job", "pos": [330, 532], "size": [240, 64] },
|
||
{ "id": "parquet", "type": "database", "label": "Parquet · Qlib Dataset", "sublabel": "行情 / 财务 / 特征", "pos": [750, 532], "size": [260, 64] }
|
||
],
|
||
"connections": [
|
||
{ "id": "req-rest", "from": "web-ui", "to": "api", "label": "REST / SSE", "labelAt": [620, 94] },
|
||
{ "id": "to-spec", "from": "api", "to": "services", "label": "Research Specification", "variant": "emphasis", "labelAt": [620, 196] },
|
||
{ "id": "to-domain", "from": "services", "to": "domain", "label": "Repository Protocol · 编排", "labelAt": [620, 366] },
|
||
{ "id": "domain-sqlite", "from": "domain", "to": "sqlite", "label": "元数据 / 实验", "fromSide": "bottom", "toSide": "top" },
|
||
{ "id": "domain-parquet", "from": "domain", "to": "parquet", "label": "时序 / 特征", "fromSide": "bottom", "toSide": "top" },
|
||
{ "id": "fetch-tushare", "from": "tushare", "to": "services", "label": "行情 / 财务(首选)", "variant": "emphasis", "labelAt": [250, 318] },
|
||
{ "id": "fallback-sina", "from": "sina", "to": "services", "label": "兜底(缺失)", "variant": "dashed" },
|
||
{ "id": "to-adapter", "from": "services", "to": "qlib-adapter", "label": "因子 / 回测 Job", "variant": "emphasis" },
|
||
{ "id": "adapter-qlib", "from": "qlib-adapter", "to": "qlib", "label": "Dataset / 训练 / 回测", "fromSide": "bottom", "toSide": "top", "labelAt": [1155, 318] },
|
||
{ "id": "agent-tools", "from": "agent", "to": "services", "label": "受控 Tool(Phase 5)", "variant": "dashed" }
|
||
],
|
||
"cards": [
|
||
{
|
||
"dot": "emerald",
|
||
"title": "主研究链",
|
||
"items": [
|
||
"Web UI → API(Research Specification DTO)→ 服务编排 → Repository → SQLite / Parquet",
|
||
"Qlib 仅经 Qlib Adapter 调用,业务层不直接 import qlib"
|
||
]
|
||
},
|
||
{
|
||
"dot": "violet",
|
||
"title": "数据源与边界纪律",
|
||
"items": [
|
||
"Tushare 首选,新浪兜底须经统一 Provider 并记录来源,禁止静默切换",
|
||
"业务层禁 SQL / Session 直连;Agent 仅走受控 Tool(Phase 5)"
|
||
]
|
||
},
|
||
{
|
||
"dot": "amber",
|
||
"title": "异步与可复现",
|
||
"items": [
|
||
"因子 / 训练 / 回测为异步 Job:queued → running → success / failed / cancelled",
|
||
"所有研究落 Experiment,含数据与代码版本,可一键复跑"
|
||
]
|
||
}
|
||
]
|
||
}
|