docs: document Translation Memory and config contracts
bat-rust / Build and test Rust (push) Canceled after 0s
bat-rust / Build and test Go API (push) Canceled after 0s

This commit is contained in:
2026-09-06 22:52:10 +08:00
parent e373e3fd32
commit 8fc93b8f39
17 changed files with 137 additions and 77 deletions
@@ -162,7 +162,7 @@
### 3.5 导入到 CAS 和资源仓储
官方同步下载、校验并发布 release 后,可以通过 `--import-repository`
`.env` `BAT_IMPORT_REPOSITORY=1` 自动触发 CAS + `ResourceRepository`
`config.toml` / 环境变量 `BAT_IMPORT_REPOSITORY=1` 自动触发 CAS + `ResourceRepository`
导入:
1. 读取已发布 release 下的 `official-download-manifest.json`
@@ -180,12 +180,14 @@
`available=false`,不会因为查询创建空库。发布后的 TextUnit 队列还会在当前
release 根目录写入 `translation-tasks.sqlite`,由版本化 `schema_migrations`
管理 queued/running/failed/completed/skipped、provider run、lease、失败分类、
重试计划和 TextUnit 级译文结果。`translation.tasks` 优先查询这份状态库,
重试计划和 TextUnit 级译文结果。跨 release 的 Translation Memory V1 独立存储在
`<output>/translation-memory.sqlite`,记录 raw source/hash、完整 context、candidate/
trusted 和 release/TextUnit/provider/run provenance`translation.tasks` 优先查询这份状态库,
`translation.worker.run` 由 Rust worker 回写状态;`translation.task.update` 仍供外部 provider 流程回写状态;
没有状态库的旧 release 才回退到 immutable JSON 队列。`bat doctor cas`
已提供只读 CAS 根目录、对象目录、元数据库文件和对象统计诊断;`resource.index`
已把 release、平台、bundle path 和常用数组 metadata 过滤下推到 SQLite。G-011
剩余工作是更丰富的 TextUnit 查询、翻译记忆查询和通用 Patch 发布所需资源视图。
剩余工作是更丰富的 TextUnit/TM 查询和通用 Patch 发布所需资源视图。
对应实现主要在: