feat(library): 真实差异比对 + 孤儿作业回收 + 验收矩阵与台账
build / build (push) Successful in 1m18s

为什么:发布管理的差异一直显示"未接入",业务作业也可能因队列丢作业而永久占锁;
本轮把这两件做成真实实现,并把 30 个验收项与 CI/版本身份落成可审计文档。

- internal/librarydiff:稳定文档 ID + 排除易变列的整行摘要做增改撤销;overview 在
  生产权威版本与测试封存都在时给出 computed 差异并标注两侧快照,缺一侧仍是 unknown。
- 发布管理"本次变更"列文档身份与比对版本;无差异时明确写"没有文档差异"。
- ReconcileLibraryJobs:worker 启动清理队列已无对应作业的孤儿,避免永久互斥。
- docs/library-acceptance-matrix.md 与 docs/release-ledger.md 固定证据与版本事实。
This commit is contained in:
姚章浩
2026-10-28 14:39:17 +08:00
parent e3db157ba8
commit e313ae12f2
12 changed files with 490 additions and 1 deletions
+22
View File
@@ -195,6 +195,28 @@ describe('ReleaseTargetsView(确认稿布局)', () => {
expect(html).toContain('没有当前作业证据时不会把历史封存当作阶段完成')
})
it('差异已计算时按文档身份列增改撤销,并标注比对的两个版本', () => {
const html = render({
overview: {
...overview,
diff: {
state: 'computed',
added: [{ id: 'doc-new-0001', title: '新增的说明', digest: 'a'.repeat(64) }],
updated: [{ id: 'doc-upd-0002', title: '改过的说明', digest: 'b'.repeat(64) }],
removed: [{ id: 'doc-del-0003', title: '撤销的说明', digest: 'c'.repeat(64) }],
base_snapshot: 'prod00000000',
target_snapshot: 'test00000000',
},
},
})
expect(html).toContain('3 条')
expect(html).toContain('新增的说明 · doc-new-')
expect(html).toContain('改过的说明 · doc-upd-')
expect(html).toContain('撤销的说明 · doc-del-')
expect(html).toContain('生产 prod00000000 → 测试 test00000000')
expect(html).not.toContain('变更清单来自生产与测试版本对比')
})
it('准备信息注明快照时间与范围,不声称实时测试库已就绪', () => {
const html = render()
expect(html).toContain('依据 10/28 11:34 封存的测试库全库快照,不代表实时测试库已就绪')