mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 06:34:54 +08:00
fix(sync): 固化 release flow 状态码
This commit is contained in:
@@ -118,6 +118,15 @@ SQLite `ResourceRepository`,索引不存在时返回 `ok=true` 且
|
||||
`text_unit_error_count` 等字段。旧索引库会通过 `metadata_json` 迁移列得到
|
||||
默认空 metadata。
|
||||
|
||||
`resource.state`、`catalog.status`、`parse.status` 和 `localized.status`
|
||||
都会返回当前观察面的短状态 `status` 与稳定状态码 `status_code`。`status_code`
|
||||
使用命名空间格式,例如 `official.up_to_date`、`official.published`、
|
||||
`parse.completed`、`translation.queued_offline`、`localized.published` 和
|
||||
`distribution.ready`。这些状态码描述资源/解析/翻译 handoff/汉化/分发生命周期;
|
||||
失败原因仍使用 `BAT-ERR-*` 错误码,二者不混用。响应还会包含
|
||||
`status_phase`、`status_terminal` 和 `status_retryable`,供 `bat-api` 等读侧
|
||||
决定展示、重试或 readiness。
|
||||
|
||||
官方资源完整新版本发布后,Rust 侧会先比较上一完整 release 与当前 release
|
||||
的 download manifest,并在当前 release 根目录写出:
|
||||
|
||||
@@ -151,7 +160,9 @@ SQLite `ResourceRepository`,索引不存在时返回 `ok=true` 且
|
||||
`textunit_index_available=true`、`textunit_index_path` 和
|
||||
`textunit_index_summary`;存在 `official-textunit-tasks.json` 时,响应会包含
|
||||
`textunit_queue_available=true`、`textunit_task_queue_path` 和
|
||||
`textunit_task_summary`。
|
||||
`textunit_task_summary`。当 TextUnit 队列存在且有离线任务时,
|
||||
`translation_status_code=translation.queued_offline`;真实 Crowdin worker
|
||||
尚未接入时不会返回翻译完成状态。
|
||||
|
||||
`parse.text_units` / `parse.errors` 是只读查询;没有当前 release 或没有
|
||||
`official-textunit-index.json` 时返回 `ok=true` 且 `data.available=false`。
|
||||
@@ -202,6 +213,9 @@ offset 和 error。TypeTree-covered managed reference 字段会进入结构化
|
||||
| `catalog.refresh` | 已实现 | `{ "force": false }` | `{ "task_id": "...", "kind": "catalog.refresh" }`。 |
|
||||
|
||||
只读查询在没有可用版本时返回 `ok=true` 且 `data.available=false`。
|
||||
`catalog.status` 可用时会返回 `status_code=official.published`,并用
|
||||
`distribution_status_code=distribution.ready` 表示该官方 release 可被读侧分发;
|
||||
不可用时对应 `official.unavailable` / `distribution.blocked`。
|
||||
|
||||
### task
|
||||
|
||||
|
||||
@@ -230,6 +230,7 @@
|
||||
- `cmd/bat-api`:组织 Rust `bat` 已发布 release 的启动前资源入口,并只读分发官方 CDN host/path 形态资源。
|
||||
- **拉取归属 Rust `bat`**;`bat-api` 不做下载器。
|
||||
- 发现经 `bat.sock`:先 `daemon.status`,再 `daemon.doctor`,再 `catalog.status` / `resource.manifest`。
|
||||
- `bat-api` 通过 RPC 读取的 `resource.state`、`catalog.status`、`parse.status` 和 `localized.status` 会获得短状态 `status` 与稳定生命周期状态码 `status_code`;错误原因仍以 `BAT-ERR-*` 为准。
|
||||
- 生产与 Rust `bat` 同环境运行,资源根来自 RPC 返回的 `resource_root`;`--resource-root` 仅用于 fixture 或应急只读诊断。
|
||||
- `.env` 配置端口 / public base / RPC socket / RPC 刷新周期;预留 database/redis。
|
||||
- `/v1/bootstrap` 返回 RPC 健康、release 摘要、server-info URL、client-patch base 和改写后的 Addressables root。
|
||||
|
||||
@@ -65,6 +65,7 @@
|
||||
| H | 生产文件字节从 RPC 返回的 `resource_root` 读盘;`bat-api` 与 daemon 同服务器/同容器/共享文件系统部署;`--resource-root` 仅 fixture 或应急只读诊断 |
|
||||
| I | 真数据在**已全量拉取且长期运行 Rust `bat` 的远程服务器**;开发机不跑全量 `bat`,用 fixture、mock RPC 和 Go 门禁验证;远程联调等连接信息 |
|
||||
| J | 索引以 **manifest + 磁盘 Present/size** 为准 |
|
||||
| J2 | RPC 状态以 Rust 返回的 `status` / `status_code` 为准;`bat-api` 只读消费,不自行推导同步状态 |
|
||||
|
||||
### 进程配置
|
||||
|
||||
|
||||
Reference in New Issue
Block a user