feat(library): 目标维护窗口(持久所有权/独占/release-on-verify)+ known-broken 记录
build / build (push) Failing after 16s

为什么:用户确认维护窗口方案,需要真实占有目标而不是 503 页面。

- 迁移 000070 library_maintenance:scope 唯一持有者、作业/目标身份、服务原状态、阶段。
- worker 在写目标前 acquire,验证+登记成功才 release;回滚失败/未验证保持 needs_restore。
- API GET /library/maintenance + 同步入口在他人持有时 409。
- 已知缺陷如实记录:候选实例该路由 404;kill 取证脚本竞态导致三项断言为 false。
This commit is contained in:
姚章浩
2026-10-28 20:45:02 +08:00
parent b76a433574
commit 288e01a01a
10 changed files with 250 additions and 6 deletions
+37
View File
@@ -1025,6 +1025,43 @@
}
}
},
"/api/v1/library/maintenance": {
"get": {
"tags": [
"Runtime"
],
"operationId": "getLibraryMaintenance",
"summary": "目标维护窗口状态:谁持有、处于哪个阶段、是否已释放",
"parameters": [
{
"name": "scope",
"in": "query",
"required": true,
"schema": {
"type": "string",
"enum": [
"internal",
"external"
]
}
}
],
"responses": {
"200": {
"description": "维护窗口状态(held=true 表示目标仍被占用)"
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"500": {
"$ref": "#/components/responses/InternalError"
},
"503": {
"description": "维护窗口存储不可用"
}
}
}
},
"/api/v1/library/restores": {
"post": {
"tags": [