Appearance
需求追踪矩阵
本章建立功能需求(FR)到实现模块、代码位置与完成状态的追踪关系,确保每条需求可追溯、可验证。
FR-1:场景与配置管理
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-1.1 | 场景加载与校验 | config | src/unet_dt/config/schema.py (Scenario/Pydantic 校验) | Done |
| FR-1.2 | 场景版本化 | orchestrator | src/unet_dt/orchestrator/runner.py (run 目录写入 scenario.yaml) | Done |
| FR-1.3 | 业务流配置 | config | src/unet_dt/config/schema.py (TrafficFlow 模型) | Done |
FR-2:UNET 接入与运行管理
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-2.1 | 网关探测与连接 | unet_adapter | src/unet_dt/unet_adapter/base.py (UnetAdapter.probe) | Done |
| FR-2.2 | 运行启停控制 | service + api | src/unet_dt/service/run_service.py; src/unet_dt/api/routes/runs.py | Done |
| FR-2.3 | LogOnly 回退 | unet_adapter | src/unet_dt/unet_adapter/logonly_impl.py | Done |
| FR-2.4 | PHY Preflight | orchestrator | src/unet_dt/orchestrator/gateway_preflight.py (run_phy_preflight) | Done |
| FR-2.5 | 智能节点选择 | orchestrator | src/unet_dt/orchestrator/gateway_preflight.py (PreflightSelection) | Done |
| FR-2.6 | UNet 地址解析 | unet_adapter | src/unet_dt/unet_adapter/base.py (query_node_address) | Done |
FR-3:调度策略
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-3.1 | 轮询策略 | orchestrator | src/unet_dt/orchestrator/runner.py (round_robin 分支) | Done |
| FR-3.2 | 自适应策略 | orchestrator | src/unet_dt/orchestrator/runner.py (adaptive 分支) | Done |
| FR-3.3 | 调度决策记录 | orchestrator | src/unet_dt/orchestrator/runner.py (schedule_decisions.csv 写入) | Done |
FR-4:同步与逻辑时间
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-4.1 | 逻辑时间步进 | orchestrator | src/unet_dt/orchestrator/clock.py | Done |
| FR-4.2 | Barrier 同步 | orchestrator | src/unet_dt/orchestrator/barrier.py | Done |
| FR-4.3 | 同步质量指标 | orchestrator | src/unet_dt/orchestrator/runner.py (sync_error_ms 计算) | Done |
FR-5:数据采集与指标
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-5.1 | Trace 采集 | orchestrator + adapter | src/unet_dt/orchestrator/trace_collector.py; src/unet_dt/unet_adapter/rx_parse.py | Done |
| FR-5.2 | Payload Header 编解码 | unet_adapter | src/unet_dt/unet_adapter/utils.py (pack/unpack header) | Done |
| FR-5.3 | 指标计算 | orchestrator | src/unet_dt/orchestrator/runner.py (metrics 聚合逻辑) | Done |
| FR-5.4 | 结果落盘 | orchestrator + persistence | src/unet_dt/orchestrator/runner.py; src/unet_dt/persistence/trace_repo.py | Done |
FR-6:可视化与控制
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-6.1 | 实时指标曲线 | ui (React) | src/unet_dt/ui/src/ (Recharts 图表组件) | In Progress |
| FR-6.2 | 拓扑视图 | ui (React) | src/unet_dt/ui/src/ (节点可视化组件) | Planned |
| FR-6.3 | 运行控制 | api + ui | src/unet_dt/api/routes/runs.py; src/unet_dt/ui/src/ | In Progress |
| FR-6.4 | 历史列表与详情 | api + ui | src/unet_dt/api/routes/runs.py (list/detail); src/unet_dt/ui/src/ | In Progress |
| FR-6.5 | WebSocket 实时推送 | api | src/unet_dt/api/main.py (WS endpoint) | Done |
| FR-6.6 | 节点健康检查页 | api + ui | src/unet_dt/api/routes/health.py; src/unet_dt/ui/src/ | In Progress |
FR-7:实验对比与回放
| FR 编号 | 需求名称 | 实现模块 | 关键代码位置 | 完成状态 |
|---|---|---|---|---|
| FR-7.1 | A/B 对比 | api + ui | src/unet_dt/api/routes/runs.py (metrics 查询); src/unet_dt/ui/src/ | In Progress |
| FR-7.2 | 回放 | ui (React) | src/unet_dt/ui/src/ (前端回放逻辑) | Planned |
| FR-7.3 | 报告导出 | orchestrator | src/unet_dt/orchestrator/runner.py (report.md 生成) | Done |
完成度统计
| 类别 | Done | In Progress | Planned | 合计 |
|---|---|---|---|---|
| FR-1 场景配置 | 3 | 0 | 0 | 3 |
| FR-2 UNET 接入 | 6 | 0 | 0 | 6 |
| FR-3 调度策略 | 3 | 0 | 0 | 3 |
| FR-4 同步时间 | 3 | 0 | 0 | 3 |
| FR-5 数据采集 | 4 | 0 | 0 | 4 |
| FR-6 可视化控制 | 1 | 4 | 1 | 6 |
| FR-7 对比回放 | 1 | 1 | 1 | 3 |
| 合计 | 21 | 5 | 2 | 28 |