docs: refresh runtime guidance

This commit is contained in:
2026-04-03 13:48:49 +08:00
parent a399384e07
commit 771de8c49c
5 changed files with 34 additions and 501 deletions

View File

@@ -1,8 +1,26 @@
# Runtime Service API 变更文档
# Runtime Service API 说明
## 概述
本文档描述 `runtime_service` API 的改进,包括新增端点、增强响应字段和改进的错误处理
本文档描述当前 `runtime_service` API 的关键端点、增强响应字段和启动/健康检查相关行为
它应被视为 runtime API 的补充说明,而不是迁移过程中的一次性变更记录。
## 适用范围
- 运行时控制面:`backend.apps.runtime_service`
- 运行时 API 前缀:`/api/runtime/*`
- 当前推荐配套阅读:
- `README.md`
- `README_zh.md`
- `docs/current-architecture.md`
## 关于 `schedule_mode` 的当前约定
当前对外约定统一使用 `daily` / `interval`
- `interval` 是当前公开的盘中轮询名称
- `intraday` 仅作为向后兼容输入别名保留
- runtime API 的响应和写回配置应优先输出 `interval`
## 新增端点
@@ -26,7 +44,8 @@
- `mode`: 运行模式,`"live"`(实盘)或 `"backtest"`(回测),运行时停止时为 `"stopped"`
- `is_backtest`: 是否为回测模式
- `run_id`: 当前运行的任务 ID
- `schedule_mode`: 调度模式`"daily"``"intraday"`
- `schedule_mode`: 调度模式字段。当前公开值为 `daily``interval`
历史输入别名 `intraday` 会在服务端归一化为 `interval`
- `is_running`: Gateway 是否正在运行
---
@@ -113,7 +132,7 @@
---
## 改进的端点
## 关键端点说明
### GET /api/runtime/gateway/status
@@ -256,7 +275,8 @@ Gateway 启动前会自动验证以下配置:
- `start_date` 必须早于 `end_date`
6. **调度模式**
- `schedule_mode` 必须是 `"daily"` `"intraday"`
- 当前公开校验值为 `"daily"` / `"interval"`
- 历史输入 `"intraday"` 会被兼容性归一化为 `"interval"`
**验证失败响应**: