feat(library): Wiki 页面级差异与页面展示
build / build (push) Successful in 1m24s

为什么:撤销文档后 Wiki 变化此前只有"快照保存"证据;页面级差异能给出增/改/撤,
但必须写明它不等于实体、概念、边与引用的语义重算。

- overview 差异新增 wiki 字段:读两份快照的 wiki_pages 行数组比较,缺部件时 unknown。
- 发布管理"本次变更"显示 Wiki 新增/更新/撤销页数与页面级声明。
- 真实归档验证:对内 vs 对外 = 新增 31 / 撤销 1,反向镜像一致。
This commit is contained in:
姚章浩
2026-10-28 15:15:33 +08:00
parent 7b8cc0384b
commit 2038462dbb
6 changed files with 113 additions and 1 deletions
+10
View File
@@ -209,6 +209,14 @@ describe('ReleaseTargetsView(确认稿布局)', () => {
removed: [{ id: 'doc-del-0003', title: '撤销的说明', digest: 'c'.repeat(64) }],
base_snapshot: 'prod00000000',
target_snapshot: 'test00000000',
wiki: {
state: 'computed',
added: 2,
updated: 1,
removed: 3,
sample: [],
note: '页面级差异',
},
},
},
})
@@ -218,6 +226,8 @@ describe('ReleaseTargetsView(确认稿布局)', () => {
expect(html).toContain('撤销的说明 · doc-del-')
expect(html).toContain('生产 prod00000000 → 测试 test00000000')
expect(html).not.toContain('变更清单来自生产与测试版本对比')
expect(html).toContain('Wiki 页面:新增 2 · 更新 1 · 撤销 3')
expect(html).toContain('不代表实体/边/引用重算')
})
it('准备信息注明快照时间与范围,不声称实时测试库已就绪', () => {
+6
View File
@@ -311,6 +311,12 @@ function ChangeTable({ diff }: { diff: LibraryOverview['diff'] }) {
)}
</tbody>
</table>
{diff.wiki && diff.wiki.state === 'computed' ? (
<p className="rel-scope-note">
Wiki 页面:新增 {diff.wiki.added} · 更新 {diff.wiki.updated} · 撤销 {diff.wiki.removed}
(页面级,不代表实体/边/引用重算)
</p>
) : null}
</div>
)
}
+10
View File
@@ -250,6 +250,16 @@ export interface LibraryDiff {
/** 这次比对用的两个整库版本(生产 → 测试),避免把历史差异当成当前。 */
base_snapshot?: string
target_snapshot?: string
/** 页面级 Wiki 差异;不代表实体、概念、边或引用被重算。 */
wiki?: {
state: 'computed' | 'unknown'
reason?: string
added: number
updated: number
removed: number
sample: string[]
note: string
}
}
export interface LibraryStageRow {