fix(release): 完成分发证明代际绑定与质量门禁收口
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-15 21:13:52 +08:00
parent 13b0bd5b45
commit 99355effe4
29 changed files with 1137 additions and 189 deletions
@@ -371,8 +371,8 @@ JSON-RPC 2.0 服务,是面向上层服务(Go 层)的**主要跨语言边
- CDN path 支持 `GET` / `HEAD` / Range / 条件请求;ETag 优先使用 download
manifest 中的 BLAKE3,响应包含 Last-Modified、Accept-Ranges 和长期缓存头。
- 版本/清单发现优先走 RPC:先 `daemon.status`,再 `daemon.doctor`,再读取
Rust 轻量 `release.attestation`,最后按 attested release/publication/manifest
identity 读取 `catalog.status` / `resource.manifest`(可用 `--socket` 指定 socket
Rust 轻量 `release.attestation`,最后按 attested release/publication/mapping/manifest
identity 和 verification generation 读取 `catalog.status` / `resource.manifest`(可用 `--socket` 指定 socket
文件)。Go 不重新实现 release verifier;普通 current CDN 只有在 attestation
fresh/ready、分页快照完整且本地只读路径检查都允许时才分发。
- `/v1/releases``/v1/distribution` 和受保护的 `/admin/releases/status`
@@ -270,6 +270,14 @@ distribution 查询只读取该文件、当前 manifest 的内容 identity 和
`destination_index`,再校验目标文件的 size/BLAKE3;不会为了定位一个 destination
重做完整 mapping canonicalization 或遍历其他资源。
`official-distribution-attestation.json` 是 Rust full local verification 的结果。发布时
文件先写入 `.staging/<id>`,但其中的 `resource_root` 永远记录最终的
`versions/<id>` canonical root;随后 staging 目录原子重命名并切换 `current`,不会因为
重命名再次增加 verification generation。周期性 current 验证、显式 verify/repair 和新
release 发布都会写入新的 generation;失败会写入 `ready=false``integrity_status=invalid`
`verified_at=null` 的新结果。`max_age_seconds` 由 Rust watch 的验证周期和失败重试
周期计算,缺失或为 0 的旧结果直接视为不可用,不使用固定兼容 fallback。
---
## 5. 发现与 seed URL 规则(L2