fix(release): 修复发布管理F01-F11资源闭包与状态呈现
build / build (push) Successful in 1m44s

F01:捕获、写前镜像、指纹和恢复后内容校验共用按目标精确绑定的资源闭包:
从已限定范围的 resource_bindings 与正文 handle 一次提取,再按索引取资源,
不再对每个租户资源扫描全部正文表。无绑定正文引用仍保留,缺失资源仍失败。

F02/F03:恢复验证使用 capture/verify/canary/restore/finalize 自己的阶段,登记
证据不再叫新版本生效;顶部优先在飞作业;已验证且 API reason 为空时不再同屏
显示未读到状态,报告可展开。

F04-F11:显示实际目标实例/项目/库;运行中主按钮查看当前任务并禁止重复启动;
快照历史默认已登记、可筛选分页并定位所选;无真实下次计划时显示未读取;各
scope 独立 overview;新操作清旧通知;存储行按文档/分块/资源/绑定及 Wiki
页面/目录/日志分项。高影响恢复验证/恢复增加一次影响确认。

验证:隔离 PG 20k 无关资源夹具旧扫描 683ms→新导出 41ms,资源 ID 闭包相等;
Go/前端全量及 make verify 17 项通过。未部署、未做 8088 UI 验收。
This commit is contained in:
姚章浩
2026-11-05 12:50:11 +08:00
parent 7675e2cd88
commit 1a0f99e346
18 changed files with 835 additions and 86 deletions
+15
View File
@@ -11,6 +11,7 @@ export interface LibraryVerificationRecord {
snapshot_id: string
job_id: string
failure?: string
report?: Record<string, unknown>
started_at: string
finished_at: string
}
@@ -76,6 +77,7 @@ export function parseVerificationRecord(value: unknown): LibraryVerificationReco
snapshot_id: text(value.snapshot_id),
job_id: text(value.job_id),
failure: text(value.failure) || undefined,
report: record(value.report) ? value.report : undefined,
started_at: text(value.started_at),
finished_at: text(value.finished_at),
}
@@ -172,3 +174,16 @@ export function verificationStatusText(view: LibraryVerificationView | null, sta
if (view.latest) return view.latest.status === 'failed' ? '最近一次未通过' : '未通过'
return '还没有验证记录'
}
// F03: when the API has a passed record, its reason is empty by design. The
// panel must not fall back to "还没有读到验证状态" and contradict the green
// status. This also keeps loading/error/never-verified distinct.
export function verificationReasonText(view: LibraryVerificationView | null, stale = false): string {
if (!view) return '还没有读到验证状态'
if (stale) return '刷新失败:这是上次成功读取的证据,当前目标是否仍可恢复未知'
if (view.running) return view.reason || `验证作业 ${view.job_id || ''} 正在执行(${view.stage || '执行中'})`
if (view.verified)
return `当前目标的最近一次真实恢复验证已通过${view.latest ? `(快照 ${view.latest.snapshot_id.slice(0, 12)})` : ''}`
if (view.latest) return view.reason || view.latest.failure || '最近一次恢复验证未通过'
return view.reason || '还没有验证记录'
}