feat(library): Wiki 撤销按贡献比对,维护窗口在页面如实呈现
build / build (push) Successful in 1m18s

为什么:删除一篇与别人共同贡献同一 Wiki 页的文档后,页面还在、名字也在,
只有那篇文档的正文与引用被摘掉。原来的页面级差异会把这种语义重算显示成
"无变化",操作员据此会误判撤销没有生效。

怎么改:librarydiff 新增 CompareWiki,以 slug 为身份把正文/来源文档/引用分块/
出入边/目录分别取集合比较,输出 sources_removed、citations 变化与具体类别;
overview 的 diff.wiki 增加逐页明细(最多 50 页,超出置 pages_truncated),
说明文字明确"重算发生在源侧,本平台只如实比对与保留结果"。

页面:新增目标维护面板(实例级/库级、持有、入口开关、阶段、进度、恢复错误),
只有窗口仍持有且作业失败时才给"按预备份恢复";没有维护记录时写未接入 + fail closed。
变更页把 Wiki 逐页差异列出来源/引用怎么变。kind 补上 restore。

验过:go test ./internal/librarydiff ./internal/httpapi;web vitest 453 项;
make verify 全绿(15 项,无未运行项)。真实撤销语义验收见交付报告。
This commit is contained in:
姚章浩
2026-10-29 04:45:34 +08:00
parent 0ef79846e8
commit 1f482e4b49
10 changed files with 1006 additions and 37 deletions
+3 -1
View File
@@ -149,9 +149,11 @@ const base: ViewProps = {
pendingCapture: false,
canCapture: true,
canWrite: true,
maintenance: null,
now: new Date('2026-10-28T03:35:00Z').getTime(),
onRefresh: vi.fn(),
onCapture: vi.fn(),
onRecover: vi.fn(),
}
const render = (overrides: Partial<ViewProps> = {}) =>
@@ -227,7 +229,7 @@ describe('ReleaseTargetsView(确认稿布局)', () => {
expect(html).toContain('生产 prod00000000 → 测试 test00000000')
expect(html).not.toContain('变更清单来自生产与测试版本对比')
expect(html).toContain('Wiki 页面:新增 2 · 更新 1 · 撤销 3')
expect(html).toContain('不代表实体/边/引用重算')
expect(html).toContain('重算发生在源侧')
})
it('准备信息注明快照时间与范围,不声称实时测试库已就绪', () => {