mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 11:34:59 +08:00
fix(tm):建立 Trusted 唯一性与 Supersede 治理
This commit is contained in:
+17
-9
@@ -189,7 +189,8 @@ launcher 兼容端点只服务启动前资源发现。它们复用 Rust `bat` sn
|
||||
| `translation-task-update` | `translation.task.update` | `{ "task_id": "...", "status": "completed", "provider": "manual", "provider_run_id": "...", "translation_results": [{ "unit_id": "...", "source_text": "...", "translated_text": "...", "glossary_override": { "qa_identity": "...", "reviewer": "...", "reason": "...", "provenance": "...", "confirmed_unix_seconds": 1 } }] }` | `202` + 当前任务记录 |
|
||||
| `translation-worker-run` | `translation.worker.run` | `{ "provider": "mock", "concurrency": 8, "max_tasks": 2 }` | `202` + worker task |
|
||||
| `translation-proofread` | `translation.proofread` | 无 | `202` + 汉化状态 |
|
||||
| `translation-memory-confirm` | `translation.memory.confirm` | `{ "record_id": "...", "reviewer": "...", "reason": "..." }` | `202` + 已确认的 TM 记录 |
|
||||
| `translation-memory-confirm` | `translation.memory.confirm` | `{ "record_id": "...", "reviewer": "...", "reason": "...", "supersede_record_id": "..." }` | `202` + 已确认的 TM 记录 |
|
||||
| `translation-memory-resolve-conflict` | `translation.memory.resolve_conflict` | `{ "winner_record_id": "...", "expected_trusted_record_ids": ["..."], "reviewer": "...", "reason": "..." }` | `202` + 冲突解决报告 |
|
||||
| `translation-glossary-add` | `translation.glossary.add` | term draft JSON | `202` + Glossary term |
|
||||
| `translation-glossary-update` | `translation.glossary.update` | term draft + `reviewer` | `202` + Glossary term |
|
||||
| `translation-glossary-approve` | `translation.glossary.approve` | `{ "term_id": "...", "reviewer": "...", "reason": "..." }` | `202` + approved term |
|
||||
@@ -300,7 +301,7 @@ curl -i -H 'Range: bytes=0-1023' \
|
||||
- 已运行的 daemon 不会热读 `config.toml`;默认 `reload` 只唤醒后台重新发现和刷新。需要应用配置文件变更时,使用带显式启动参数的 `restart`/`reload`,或先 `stop` 再重新启动 daemon。
|
||||
- `BAT_REDIS_URL` / `BAT_REDIS_PASSWORD` 为**预留键**:Redis 任务后端尚未接入,当前任务历史持久化在 `<state-dir>/bat-tasks.json`。
|
||||
|
||||
### Translation Memory V1
|
||||
### Translation Memory persistence schema V2
|
||||
|
||||
Translation Memory 由 Rust `bat` 独立持有,默认路径为
|
||||
`<output>/translation-memory.sqlite`,不在 `versions/<id>` 内,也不使用当前 release
|
||||
@@ -311,16 +312,23 @@ Translation Memory 由 Rust `bat` 独立持有,默认路径为
|
||||
bat i18n memory summary
|
||||
bat i18n memory query --tm-source-text '原始文本' --tm-context-json '{"destination":"Table.bytes","archive_entry":"","field_path":"Text"}'
|
||||
bat i18n memory confirm --tm-record-id 'tm-...' --tm-reviewer 'operator' --tm-reason '人工校对通过'
|
||||
bat i18n memory conflicts --tm-limit 100
|
||||
bat i18n memory resolve-conflict --tm-record-id 'tm-winner-...' \
|
||||
--tm-expected-trusted-record-ids-json '["tm-winner-...","tm-loser-..."]' \
|
||||
--tm-reviewer 'operator' --tm-reason '确认唯一译文'
|
||||
```
|
||||
|
||||
只有 raw source 完全相同、完整 context 完全相同且状态为 `trusted` 的记录会被 worker
|
||||
自动复用。provider 输出写入先是 `candidate`;manual task result 即使 completed 也不会自动
|
||||
建立 TM 或 trusted。查询、诊断和显式 confirm 对应 Rust
|
||||
RPC `translation.memory.summary`、`translation.memory.query`、`translation.memory.confirm`。
|
||||
context 不完整或不一致、normalized source 辅助命中和 workflow `proofread` 都不会自动
|
||||
建立 trusted 记录。
|
||||
只有 raw source 完全相同、完整 context 完全相同且状态为 current `trusted` 的单条记录会被
|
||||
worker 自动复用。provider 输出写入先是 `candidate`;manual task result 即使 completed
|
||||
也不会自动建立 TM 或 trusted。查询、诊断、确认和冲突治理对应 Rust
|
||||
RPC `translation.memory.summary`、`translation.memory.query`、
|
||||
`translation.memory.confirm`、`translation.memory.conflicts` 和
|
||||
`translation.memory.resolve_conflict`。同一 identity 存在多个 current Trusted 时,
|
||||
查询返回 `trusted_conflict`,worker 禁止自动复用;确认不同译文必须显式指定 supersede
|
||||
目标,历史冲突必须通过 resolve_conflict 选择稳定 record ID。context 不完整或不一致、
|
||||
normalized source 辅助命中和 workflow `proofread` 都不会自动建立 trusted 记录。
|
||||
|
||||
### Glossary V2
|
||||
### Glossary domain/feature contract V1,SQLite persistence schema V2
|
||||
|
||||
Glossary 由 Rust `bat` 独立持有,默认路径为 `<output>/glossary.sqlite`,不位于
|
||||
`versions/<id>`,也不与 TM 或当前 release 的 task 库共用。配置覆盖方式为
|
||||
|
||||
Reference in New Issue
Block a user