fix(release): 完成分发身份与 CAS legacy ownership 收尾
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-13 10:44:24 +08:00
parent 786b739f99
commit 5bae90cb14
14 changed files with 867 additions and 109 deletions
+9 -3
View File
@@ -104,9 +104,11 @@ source relation 正确且 manifest/artifact integrity 通过的 release 才能
损坏、缺失、symlink/path escape 或未验证历史项不会回退到另一 channel。Rust 使用已发布
manifest 做轻量选择,HTTP 热路径不重新执行完整 release auditlocalized 必须额外满足
`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 对象损坏、缺失或元数据不一致时只产生诊断,