mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 11:34:59 +08:00
fix(release): 完成分发身份与 CAS legacy ownership 收尾
This commit is contained in:
@@ -243,7 +243,7 @@ trusted 和 release/TextUnit/provider/run provenance;`translation.tasks` 优
|
||||
12. 将 staging rename 为 `<output>/versions/<id>`,再原子替换 `<output>/current` symlink 指向该 versioned 目录。
|
||||
13. 发布完成后先对比上一完整 release 和当前 release 的 `official-download-manifest.json`,写出 `official-resource-changes.json` 和 `crowdin-translation-handoff.json`。同一 destination 只有 size 或 BLAKE3 变化才算 modified;新增+变更资源进入解析/翻译 handoff,删除资源只进入差异记录。当前只预留 Crowdin 本地 handoff,不发外部 API 请求。
|
||||
14. 随后刷新 active release 下的 `official-parse-cache.json` 和 `official-textunit-index.json`,并从 Added/Modified 资源、parse cache 与 TextUnit 明细索引派生 `official-textunit-tasks.json`、`crowdin-textunit-queue.json` 和版本化的 `translation-tasks.sqlite`;up-to-date 轮询在已有有效解析缓存、TextUnit 明细索引和 TextUnit 队列时只读取摘要,不重复解析,重新同步队列时保留已有 worker 状态。历史 release 复用只允许不可变资源 payload/sidecar 硬链接;download manifest、snapshot、parse/textunit cache、queue、handoff、bootstrap、CAS reuse references 以及 `translation-tasks.sqlite`、WAL/SHM 都必须独立复制,不能共享可变 inode。
|
||||
15. 若启用 `--import-repository`,已校验 release 会被导入 CAS + `ResourceRepository`,并可经 `resource.index` 查询。历史 release 候选失效时,已有 CAS 对象会先经过完整性和元数据校验,再增加 release 引用并原子物化;当前 release 在 `official-cas-reuse-references.json` 中记录引用和首次生成后持久化的 `ownership_id`,staging/release 清理时按 `ownership_id + ordinal` 递减,旧无 identity 清单走明确 legacy key 路径,失败则回退网络并保留诊断。
|
||||
15. 若启用 `--import-repository`,已校验 release 会被导入 CAS + `ResourceRepository`,并可经 `resource.index` 查询。历史 release 候选失效时,已有 CAS 对象会先经过完整性和元数据校验,再增加 release 引用并原子物化;当前 release 在 `official-cas-reuse-references.json` 中记录引用和首次生成后持久化的 `ownership_id`,staging/release 清理时按 `ownership_id + ordinal` 递减。旧无 identity 清单按 output-root scope、稳定 source mapping identity 和 generation counter 迁移;已有 basename ledger 的部分 cleanup 继续使用兼容 key,直到该 generation 完成,后续同名 generation 不复用该 key,失败则回退网络并保留诊断。
|
||||
16. 官方同步报告默认给出 `localized_release_status=not_localized`,表示原版资源已发布、汉化资源未发布;generic manifest 驱动的 Binary/JSON/Text 以及当前支持的 UnityFS TextAsset、TypeTree string field 和 managed-reference string field patch 发布成功并通过 `localized-patch-manifest.json`、current symlink、release ID 及 ZIP 内层最终重解析校验后,`localized.status` 才返回 `localized`,表示原版和汉化两套资源都已发布。`localized.status` 分开返回 `patch_manifest_contract_status` 与 `artifact_integrity_status`;state/current/identity 存在但文件被截断或手工修改时返回 `localized.degraded`,只读检查不回滚、不删除、不修复。`translation.proofread` 只会把 workflow 标记成 `manual_proofreading` / `translation.manual_proofreading`,不会回退已发布汉化 release 的发布状态。
|
||||
|
||||
维护期特殊分支:如果官方 launcher/server-info 已经指向新资源根,但 client-patch seed marker 或必需 seed catalog 仍返回 403/404 等未开放状态,`bat` 返回 `waiting_for_official_resources`,保留现有 `current`,不创建失败 staging;若本轮启用 `--auto-discover`,会在 `<output>/official-launcher-bootstrap.pending.json` 写入待处理 launcher bootstrap 证据,供后续排障和自研客户端开发使用。
|
||||
|
||||
@@ -104,9 +104,11 @@ source relation 正确且 manifest/artifact integrity 通过的 release 才能
|
||||
损坏、缺失、symlink/path escape 或未验证历史项不会回退到另一 channel。Rust 使用已发布
|
||||
manifest 做轻量选择,HTTP 热路径不重新执行完整 release audit;localized 必须额外满足
|
||||
`localized-distribution-manifest.json` 与 source official manifest 的 destination/URL
|
||||
集合一致,并返回实际 localized bytes/hash。返回的 `resource_root` 和 manifest entry
|
||||
集合及 deterministic source mapping identity 一致,并返回实际 localized bytes/hash。
|
||||
manifest 同时保存 localized mapping identity 和 destination index;返回的 `resource_root` 和 manifest entry
|
||||
由 Rust 决定,Go 只做 typed forwarding;传入 `destination` 时 Rust 会重新校验该文件的
|
||||
实际 bytes/BLAKE3。
|
||||
实际 bytes/BLAKE3。单条请求只比较发布时持久化的 identity、通过 destination index
|
||||
定位 entry,不重新遍历全量映射或资源文件。
|
||||
|
||||
localized publish/rollback 先取得 `.localized-release.lock`,并在 output root 下记录
|
||||
`.localized-transaction.json`。current、version-state 和 version 目录的切换按日志阶段
|
||||
@@ -137,7 +139,11 @@ reference、无法确认 ownership 的对象均保留;只删除重新验证后
|
||||
|
||||
从 CAS 物化资源时,`official-cas-reuse-references.json` 首次创建时生成并持久化
|
||||
`ownership_id`,记录每个获取的对象引用;文件带版本字段且允许重复 object ID。
|
||||
没有 `ownership_id` 的旧清单保留 legacy ownership key,不在读取时随机迁移。
|
||||
没有 `ownership_id` 的旧清单首次 cleanup 按 output-root scope、release ID、稳定 source
|
||||
mapping identity 和 generation counter 建立 persistent legacy generation identity;
|
||||
若已存在 basename ledger,则在该 generation 完成前继续使用 basename compatibility key,
|
||||
完成后同名新 generation 使用新的 ownership。`.cas-owner-scope` 是 output-root 私有状态,
|
||||
不会复制到另一个 release 或 staging。
|
||||
孤儿 staging 或显式 release 清理必须先按
|
||||
清单减少 CAS 引用,再删除目录;cleanup execute 与官方同步共用
|
||||
`.official-sync.lock`,localized cleanup 使用 `.localized-release.lock`。CAS 对象损坏、缺失或元数据不一致时只产生诊断,
|
||||
|
||||
Reference in New Issue
Block a user