diff --git a/web/src/App.test.tsx b/web/src/App.test.tsx index ae75aa9..05e8079 100644 --- a/web/src/App.test.tsx +++ b/web/src/App.test.tsx @@ -353,41 +353,34 @@ describe('ReleaseManagement', () => { releasePlan={releasePlan} selectedDeleteIDs={['tp-delete']} onToggleDelete={vi.fn()} />) - for (const text of ['来源与目录 → 测试知识库 → 生产知识库','自动发布计划','新增 1','更新 0','删除 1','未变化 11284','B.pdf','C.pdf','D.pdf','将从生产检索中移除','我确认所选删除项会停止生产检索','已选择删除:1(待确认)','已选 1 项(删除待确认)','为什么按钮不能点:请确认所选删除项会停止生产检索;至少 1 项动作通过确认;请填写批次名称','至少 1 项动作通过确认','来源当前不可用,保留生产知识','正在执行自动回滚','批次 1 / 1','每批最多 50 项','Snapshot #20260906-090000Z','审核要发布的知识', '需人工确认', '批准', '驳回', '创建并锁定清单', '锁定清单(不会上线)', 'Synthetic batch', '删除生产知识', '已从生产检索中移除', '已恢复生产知识', '仍可检查调整', 'Release Worker保持关闭', '锁定清单 ≠ 上线', '生产确认、发布验证与回滚', '生产操作权限:已阻断', '生产请求门禁已开启', '快照恢复验证未通过', '生产发布已阻断']) { + for (const text of ['来源与目录 → 测试知识库 → 生产知识库','发布计划','新增 1','更新 0','删除 1','未变化 11284','B.pdf','C.pdf','D.pdf','将从生产检索中移除','我确认所选删除项会停止生产检索','待发布(0 + 下架 1)','已选 1 项(删除待确认)','为什么按钮不能点:请确认所选删除项会停止生产检索;至少 1 项动作通过确认;请填写批次名称','至少 1 项动作通过确认','来源当前不可用,保留生产知识','正在执行自动回滚','批次 1 / 1','每批最多 50 项','Snapshot #20260906-090000Z','待你审核', '需人工确认', '批准', '驳回', '创建并锁定清单', '锁定清单(不会上线)', 'Synthetic batch', '删除生产知识', '已从生产检索中移除', '已恢复生产知识', '仍可检查调整', 'Release Worker 默认关闭', '锁定清单 ≠ 上线', '生产确认、发布验证与回滚', '生产操作权限:已阻断', '生产请求门禁已开启', '快照恢复验证未通过', '生产发布已阻断']) { expect(html).toContain(text) } + // 需求(2026-10-10):发布界面要简单——不再显示步骤脚手架/流程编号/引导卡。 for (const text of [ '从检查到发布,只走这 7 步', '1. 查看来源变化', '2. 确认测试结果', '3. 审核发布内容', '4. 创建并锁定发布清单', - '4. 创建并锁定发布清单', '5. 生产负责人确认', '6. 发布并验证', '7. 必要时回滚', - '当前在第 3 步,共 7 步', - '现在要做:审核 1 项知识', - '还有 1 项等待审核;已批准文件可先创建批次', - '完成本步的 3 件事', - '只审核本次准备发布的文件', - '勾选要发布的已批准知识', - '填写批次名称后创建(创建即冻结并锁定清单)', - '现在先做:逐条选择“批准”或“驳回”(操作自动记在当前登录人名下)', - '完成后进入:第 4 步,创建并锁定发布清单', - '为什么按钮不能点:请确认所选删除项会停止生产检索', + '当前在第', + '共 7 步', + '现在要做:', + '完成本步的', + '完成后进入:第', '如何决定批准或驳回', - '可以批准:基础测试通过,你已确认搜索结果相关,而且发布范围正确', - '应该驳回:内容错误、过期、敏感、搜索结果不相关,或者你无法确认', - '创建批次还需要', - '确认所选发布动作', '查看审核与发布说明', - '至少 1 项动作通过确认', - '填写批次名称', '普通业务操作,不会影响生产', '生产危险操作', + 'module-tabs', + 'release-journey', + 'release-guidance', + 'guidance-step', ]) { - expect(html).toContain(text) + expect(html).not.toContain(text) } expect(html).not.toContain('>授权生产发布') expect(html).not.toContain('knowledge_id') diff --git a/web/src/App.tsx b/web/src/App.tsx index 2cd83fd..b5aace1 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -924,184 +924,151 @@ export function ReleaseManagement(props: ReleaseManagementProps) { setSelectedIDs((current) => current.includes(publicationID) ? current.filter((id) => id !== publicationID) : [...current, publicationID]) } + // 待发布 = 已批准且门禁通过,可以直接发。待审核 = 尚未决定(对内通常已由系统自动批准,所以多为空)。 + const publishReady = props.reviewPage.items.filter((item) => item.review_state === 'approved' && item.gate_status === 'ready') + const pendingItems = props.reviewPage.items.filter((item) => item.review_state === 'pending') + const rejectedItems = props.reviewPage.items.filter((item) => item.review_state === 'rejected') + const publishableSelected = selectedIDs.filter((id) => publishReady.some((item) => item.publication_id === id)) + const selectedDeleteIDs = props.selectedDeleteIDs.filter(() => deleteConfirmed) + const publishSelectedIDs = [...publishableSelected, ...selectedDeleteIDs] + const startPublish = (ids: string[], label: string, deleteIDs: string[] = []) => props.onStartReleaseAction?.('publish_now', 'publish-now', label, ids, deleteIDs) + // 计划表筛选与分页(默认视图里这块在「更多」里,保留筛选与分页以免一次渲染上百行)。 + const planFiltered = props.releasePlan.items.filter((item) => { + if (planOnlyReleasable && !item.can_release) return false + if (planActionFilter === 'blocked' ? item.can_release : planActionFilter ? item.action !== planActionFilter : false) return false + if (planScopeFilter && item.target_scope !== planScopeFilter) return false + return true + }) + const actionLabel = (item: ReleasePlanItem) => item.action === 'add' ? '新增' : item.action === 'update' ? '更新' : item.action === 'delete' ? '删除' : '等待测试' + const planPageCount = Math.max(1, Math.ceil(planFiltered.length / planPageSize)) + const planSafePage = Math.min(planPage, planPageCount - 1) + const planPageItems = planFiltered.slice(planSafePage * planPageSize, planSafePage * planPageSize + planPageSize) + return

发布管理

-

测试知识库与生产知识库的同步。生产发布仍由独立门禁、备份和负责人确认保护。

+

挑一条知识点“发布到生产”,输入确认语句即可。生产发布仍由门禁、备份快照与负责人确认保护。

-
+
- -
{props.releaseCapabilities.production_backup_restore_verified ? '发布前将创建可恢复快照' : '生产发布当前不可执行'}{props.releaseCapabilities.production_backup_restore_verified ? '发布失败时系统会按已验证的快照执行回滚。' : '尚未通过生产备份恢复验证,当前只能审核和锁定发布清单。'}
-
查看审核与发布说明 -
-
操作顺序

从检查到发布,只走这 7 步

蓝色是当前步骤;绿色表示已完成;红色步骤会修改生产环境。

-
    - {releaseFlowSteps.map((item, index) => { - const number = index + 1 - const state = number < guidance.step ? 'done' : number === guidance.step ? 'current' : 'upcoming' - const danger = number >= 6 - return
  1. - {number < guidance.step ? '✓' : number} - {item.title} - {item.kind} -
  2. - })} -
-
-
-
当前在第 {guidance.step} 步,共 7 步
-
-

{guidance.title}

- {guidance.reason} - {guidance.step === 3 ?
完成本步的 3 件事
  1. 只审核本次准备发布的文件
  2. 勾选要发布的已批准知识
  3. 填写批次名称后创建(创建即冻结并锁定清单)
: null} -

{`现在先做:${guidance.action}`}

-

{`完成后进入:${guidance.after}`}

- {guidance.impact} -
- {guidance.step === 3 ? '滚动到审核列表' : guidance.button} -
-
+
-
{productionStatus}{props.releaseCapabilities.production_release_requests_enabled && !props.releaseCapabilities.production_backup_restore_verified ? '生产发布已阻断:先完成生产快照并通过恢复验证。' : '锁定清单只表示内容不再变化,不会自动上线;普通业务操作不会改动生产知识。'}
- 修改生产内容:关闭 -
查看技术状态

生产请求门禁{props.releaseCapabilities.production_release_requests_enabled ? '已开启' : '关闭'};快照恢复验证{props.releaseCapabilities.production_backup_restore_verified ? '已通过' : '未通过'};Release Worker保持关闭。

-
-
-

自动发布计划

来源与目录 → 测试知识库 → 生产知识库。来源标注是最终 Truth Source。

按知识级别同步
-
{`新增 ${props.releasePlan.summary.add}`}{`更新 ${props.releasePlan.summary.update}`}{`删除 ${props.releasePlan.summary.delete}`}{`阻断 ${props.releasePlan.summary.blocked}`}{`未变化 ${props.releasePlan.summary.unchanged}`}
- {(() => { - const filtered = props.releasePlan.items.filter((item) => { - if (planActionFilter === 'blocked' ? item.can_release : planActionFilter ? item.action !== planActionFilter : false) return false - if (planScopeFilter && item.target_scope !== planScopeFilter) return false - if (planOnlyReleasable && !item.can_release) return false - return true - }) - const pageCount = Math.max(1, Math.ceil(filtered.length / planPageSize)) - const safePage = Math.min(planPage, pageCount - 1) - const pageItems = filtered.slice(safePage * planPageSize, safePage * planPageSize + planPageSize) - const actionLabel = (item: ReleasePlanItem) => item.action === 'add' ? '新增' : item.action === 'update' ? '更新' : item.action === 'delete' ? '删除' : '等待测试' - return <> -
- - - - {`筛选 ${filtered.length} / 全部 ${props.releasePlan.items.length}`} -
- {pageItems.length ?
{pageItems.map((item, index) => )}
选择知识目标计划动作测试状态生产状态能否发布
{item.action === 'delete' && item.can_release ? { props.onToggleDelete(item.publication_id); setDeleteConfirmed(false) }} /> : '—'}{item.title}{item.target_scope === 'internal' ? '对内知识库' : '对外知识库'}{actionLabel(item)}{item.test_state === 'ready' ? '已通过' : item.test_state === 'not_required' ? '无需测试' : '未就绪'}{item.production_state === 'present' ? '已存在' : '不存在'}{item.can_release ? item.action === 'delete' ? '将从生产检索中移除' : '可加入发布批次' : item.blocker === 'source_unavailable' ? '来源当前不可用,保留生产知识' : '测试未就绪,当前阻断'}
: filtered.length ?
当前筛选没有发布变更。
:
来源、测试与生产状态一致,当前没有发布变更。
} - {pageCount > 1 ?
{`第 ${safePage + 1} / ${pageCount} 页 · 每页 ${planPageSize} 条`}
: null} - - })()} - {(() => { - const manifestShort = changeSet ? `${changeSet.manifest_sha256.slice(0, 8)}…${changeSet.manifest_sha256.slice(-6)}` : '' - const frozenActionLabel = (action: string) => action === 'add' ? '新增' : action === 'update' ? '更新' : action === 'delete' ? '删除' : action === 'blocked' ? '阻断' : '不变' - return
-

冻结发布计划集(R1)

生成即固化:来源刷新不会改变已确认清单;正式批次只能引用已确认版本。

- {changeSet ? v{changeSet.number} · {changeSet.state === 'confirmed' ? '已确认' : changeSet.state === 'consumed' ? '已消费' : changeSet.state === 'cancelled' ? '已取消' : '待确认'} : 尚未生成} -
- {changeSet ?
- {`清单 ${changeSet.items.length} 项(新增${changeSet.add_count}·更新${changeSet.update_count}·删除${changeSet.delete_count}·阻断${changeSet.blocked_count})`} - {`摘要 ${manifestShort}`} - {`绑定快照 ${changeSet.source_snapshot_ids.length} 个`} - {`生成人 ${changeSet.created_by} · ${new Date(changeSet.created_at).toLocaleString('zh-CN', { hour12: false })}`} - {changeSet.confirmed_by ? {`确认人 ${changeSet.confirmed_by} · ${changeSet.confirmed_at ? new Date(changeSet.confirmed_at).toLocaleString('zh-CN', { hour12: false }) : ''}`} : null} -
: null} - {changeSet && changeSet.state === 'planned' ?
查看冻结清单({changeSet.items.length}项)
    {changeSet.items.map((item) =>
  • {`${item.seq}. ${item.title} · ${item.target_scope === 'internal' ? '对内' : '对外'} · ${frozenActionLabel(item.action)}${item.can_release ? '' : '(阻断:' + (item.blocker === 'source_unavailable' ? '来源不可用' : '测试未就绪') + ')'}`}
  • )}
: null} - {changeSetError ?

{changeSetError}

: null} -
- {changeSet ? 建批时自动冻结当前计划(同摘要复用同一版本 v{changeSet.number}),无需手动确认冻结 : 建批时会自动冻结当前发布计划} -
-
- })()} - {props.selectedDeleteIDs.length > 0 ? : null} -
-
- - - - 0 && !deleteConfirmed ? `已选择删除:${props.selectedDeleteIDs.length}(待确认)` : '已选入批次'} value={selectedCount} tone="cyan" /> +
{productionStatus}{props.releaseCapabilities.production_backup_restore_verified ? '发布前会创建可恢复快照;失败自动按快照回滚。' : '生产发布已阻断:先完成生产快照并通过恢复验证。'}
+ {props.releaseCapabilities.production_release_requests_enabled ? '修改生产内容:待确认' : '修改生产内容:关闭'} +
查看技术状态

{`生产请求门禁${props.releaseCapabilities.production_release_requests_enabled ? '已开启' : '已关闭'};快照恢复验证${props.releaseCapabilities.production_backup_restore_verified ? '已通过' : '未通过'}。`}

+ + {props.releaseActionError ?
{props.releaseActionError}
: null} + {props.releaseActionMessage ?

{props.releaseActionMessage}

: null} +
-

第 3 步:审核要发布的知识

先确认测试结果和对内/对外范围,再批准或驳回。批准后才能勾选加入批次。可批准的多条支持一次批量批准。

{autoReviewNote(props.releaseCapabilities.test_auto_review_policy) ?

{autoReviewNote(props.releaseCapabilities.test_auto_review_policy)}

: null}
-
- {(() => { - // 「可批准」只含尚未决定且门禁通过的条目:已驳回的不能被"全选"顺手翻回来。 - const batchable = props.reviewPage.items.filter((item) => item.gate_status === 'ready' && item.review_state === 'pending').map((item) => item.publication_id) - // 已批准且可发布的选中项:一键"发布到生产"(建批+锁定+授权合成一个动作)。 - const publishableSelected = selectedIDs.filter((id) => props.reviewPage.items.some((item) => item.publication_id === id && item.review_state === 'approved' && item.gate_status === 'ready')) - return
- - - - {isAdmin && props.releaseCapabilities.production_release_requests_enabled ? : null} +
+

待发布({publishReady.length}{props.selectedDeleteIDs.length ? ` + 下架 ${props.selectedDeleteIDs.length}` : ''})

+

已批准、可直接发布到生产的知识。点单条后面的按钮即可发布。

+ {autoReviewNote(props.releaseCapabilities.test_auto_review_policy) ?

{autoReviewNote(props.releaseCapabilities.test_auto_review_policy)}

: null} +
+
+ + {props.reviewBatchMessage ? {props.reviewBatchMessage} : null} -
- })()} - {batchBlocker ?
{`为什么按钮不能点:${batchBlocker}`}
: null} -
-

如何决定批准或驳回

-

可以批准:基础测试通过,你已确认搜索结果相关,而且发布范围正确

-

应该驳回:内容错误、过期、敏感、搜索结果不相关,或者你无法确认

+
{props.reviewError ?
{props.reviewError}
: null} - {!props.reviewLoading && !props.reviewError && props.reviewPage.items.length === 0 ?
当前没有带最新验收结果的审核候选。
: null} - {props.reviewPage.items.length > 0 ?
- {props.reviewPage.items.map((item) => { - const visibility = visibilityByID[item.publication_id] ?? (item.decided_visibility || item.current_visibility) - const selectable = item.review_state === 'approved' && item.gate_status === 'ready' - return - - - - - - - - - })} + {!props.reviewLoading && publishReady.length === 0 ?
没有待发布的已批准知识。到「来源与目录」标注后,在「解析监控」处理完成即可发布。
: null} + {publishReady.length > 0 ?
选择知识内容测试结果能否继续发布范围审核状态操作
toggleSelected(item.publication_id)} />{item.title}{sourceTypeLabels[item.source_type] ?? item.source_type} - {item.knowledge_exists === 'passed' && item.chunks_present === 'passed' ? '基础测试通过' : '基础测试未通过'} - {item.retrieval_hit === 'manual_required' ? '搜索效果需人工确认' : `搜索测试${acceptanceLabels[item.retrieval_hit]}`} -
查看测试详情知识读取:{acceptanceLabels[item.knowledge_exists]};内容处理:{acceptanceLabels[item.chunks_present]};搜索验证:{acceptanceLabels[item.retrieval_hit]}
-
{reviewGateLabel(item)}{reviewLabels[item.review_state]}{item.reviewer_ref ? {item.reviewer_ref} : null}
{isAdmin && props.releaseCapabilities.production_release_requests_enabled && item.review_state === 'approved' && item.gate_status === 'ready' ? : null}
+ {publishReady.map((item) => + + + + + + + )}
选择知识目标测试审核操作
toggleSelected(item.publication_id)} />{item.title}{sourceTypeLabels[item.source_type] ?? item.source_type}{item.current_visibility === 'internal' ? '对内知识库' : '对外知识库'}{item.knowledge_exists === 'passed' && item.chunks_present === 'passed' ? '通过' : '未通过'}已批准{item.reviewer_ref ? {item.reviewer_ref} : null}
: null} -
创建批次还需要确认所选发布动作至少 1 项动作通过确认填写批次名称
-
已选 {selectedCount} 项{props.selectedDeleteIDs.length > 0 && !deleteConfirmed ? '(删除待确认)' : ''}
-
-
-

第 4 步:创建并锁定发布清单

建批时自动冻结清单并立即锁定:本批内容此后不再变化,但仍不会发布到生产。

锁定清单 ≠ 上线
- {props.batchError ?
{props.batchError}
: null} - {!props.batchLoading && !props.batchError && props.batchPage.items.length === 0 ?
尚无草稿或已锁定的发布清单。
: null} - {props.batchPage.items.length > 0 ?
- {props.batchPage.items.map((batch) => )} -
批次名称状态知识数量内容状态操作
{batch.name}{batchLabels[batch.state]}{batch.item_count}{batch.state === 'sealed' ? '内容已锁定' : '仍可检查调整'}
{batch.state === 'draft' ? : null}{batch.state === 'sealed' && isAdmin ? : null}

本批次包含

{props.batchDetail ? <>{props.batchDetail.items.map((item) =>
{item.title}{item.action === 'delete' ? '删除生产知识' : '新增或更新生产知识'}{item.decided_visibility === 'internal' ? '仅内部员工' : '允许外部用户'}
)}{props.batchDetail.items.length === 0 ?
批次没有知识。
: null} :
点击“查看内容”核对本次发布清单。
}
: null} + + {pendingItems.length > 0 ? <> +
+

待你审核({pendingItems.length})

先确认测试结果与发布范围,再批准或驳回。可批准的多条可一次批。

+
+ + + +
+
+ {batchBlocker ?
{`为什么按钮不能点:${batchBlocker}`}
: null} +
+ {pendingItems.map((item) => { + const visibility = visibilityByID[item.publication_id] ?? (item.decided_visibility || item.current_visibility) + return + + + + + + + + })} +
选择知识测试结果能否继续发布范围操作
toggleSelected(item.publication_id)} />{item.title}{sourceTypeLabels[item.source_type] ?? item.source_type}{item.knowledge_exists === 'passed' && item.chunks_present === 'passed' ? '基础测试通过' : '基础测试未通过'}{item.retrieval_hit === 'manual_required' ? '搜索效果需人工确认' : `搜索测试${acceptanceLabels[item.retrieval_hit]}`}{reviewGateLabel(item)}
+ : null} + + {rejectedItems.length > 0 ?
已驳回({rejectedItems.length})
    {rejectedItems.map((item) =>
  • {item.title}
  • )}
: null}
+
-

第 5–7 步:生产确认、发布验证与回滚

生产动作只对管理员开放:点击后需逐字输入固定确认语句;服务端请求门禁与执行门禁仍须开启。发布后的三通道读回与官方 API 验收由 Release Worker 自动完成,这里只读展示结果。

{props.releaseCapabilities.production_release_requests_enabled ? '生产操作可执行(待确认)' : '生产操作已锁定'}
+

发布记录

最近 20 条生产发布与回滚。生产确认、发布验证与回滚都由 Release Worker 完成,这里只读展示结果。

{props.releaseCapabilities.production_release_requests_enabled ? '生产操作可执行(待确认)' : '生产操作已锁定'}Release Worker 默认关闭
{props.pendingReleaseAction ?

{releaseActionLabels[props.pendingReleaseAction.kind]}「{props.pendingReleaseAction.label}」—— 请输入固定确认语句 {productionConfirmationPhrases[props.pendingReleaseAction.kind]} 后执行。

props.onReleaseActionPhrase?.(event.target.value)} placeholder={productionConfirmationPhrases[props.pendingReleaseAction.kind]} aria-label="生产动作确认语句" />
: null} - {props.releaseActionError ?
{props.releaseActionError}
: null} - {props.releaseActionMessage ?

{props.releaseActionMessage}

: null} {props.executionError ?
{props.executionError}
: null} - {!props.executionLoading && !props.executionError && props.executionPage.items.length === 0 ?
尚无生产发布或回滚执行记录。
: null} + {!props.executionLoading && !props.executionError && props.executionPage.items.length === 0 ?
还没有发布记录。发布一条知识后,这里会出现执行进度与逐项结果。
: null} {props.executionPage.items.length > 0 ?
- {props.executionPage.items.map((execution) => )} + {props.executionPage.items.map((execution) => )}
开始时间操作状态批次进度完成进度授权人操作
{formatTime(execution.created_at)}{execution.operation === 'publish' ? '发布' : '回滚'}{executionLabels[execution.state]}{executionStateDetail(execution, props.executionPage.items) ? {executionStateDetail(execution, props.executionPage.items)} : null}{execution.error_code ? {releaseFailureMessage(execution.error_code)} : null}{execution.total_batches>0?`批次 ${execution.current_batch} / ${execution.total_batches}`:'等待开始'}每批最多 {execution.batch_size} 项{execution.completed_item_count}/{execution.item_count}{execution.failed_item_count ? 失败 {execution.failed_item_count} : null}{execution.authorized_by}
{isAdmin && execution.state === 'failed' ? : null}{isAdmin && execution.operation === 'publish' && execution.state === 'completed' ? : null}
{formatTime(execution.created_at)}{execution.operation === 'publish' ? '发布' : '回滚'}{executionLabels[execution.state]}{executionStateDetail(execution, props.executionPage.items) ? {executionStateDetail(execution, props.executionPage.items)} : null}{execution.error_code ? {releaseFailureMessage(execution.error_code)} : null}{execution.total_batches > 0 ? `批次 ${execution.current_batch} / ${execution.total_batches}` : '等待开始'}每批最多 {execution.batch_size} 项{execution.completed_item_count}/{execution.item_count}{execution.failed_item_count ? 失败 {execution.failed_item_count} : null}{execution.authorized_by}
{isAdmin && execution.state === 'failed' ? : null}{isAdmin && execution.operation === 'publish' && execution.state === 'completed' ? : null}

每项知识的结果

{props.executionDetail ? <>{props.executionDetail.items.map((item) => { const result = releaseItemResult(item); return
{item.title}{result.detail}{item.target_knowledge_base_id ? ` · 目标库 ${item.target_knowledge_base_id.slice(0, 8)}…` : ''}{item.error_code ? ` · ${releaseFailureMessage(item.error_code)}` : ''}{result.outcome}
})}{props.executionDetail.items.length === 0 ?
发布尚无逐项结果。
: null} :
点击“查看结果”核对每项知识。
}
: null} {props.executionChain ?

发布审计链

批次{props.executionChain.release_batch_name || '未绑定批次'}{`创建 ${props.executionChain.created_by || '—'} · 锁定 ${props.executionChain.sealed_by || '—'} · 授权 ${props.executionChain.authorized_by || '—'}`}
{props.executionChain.release_change_set_id ?
发布计划集{props.executionChain.release_change_set_name}{`${props.executionChain.release_change_set_state === 'confirmed' ? '已确认' : props.executionChain.release_change_set_state} · 确认人 ${props.executionChain.release_change_set_confirmed_by || '—'} · 摘要 ${props.executionChain.manifest_sha256.slice(0, 8)}…${props.executionChain.manifest_sha256.slice(-6)}`}
: null} {props.executionChain.snapshots.length ?
来源快照{props.executionChain.snapshots.map((snap) => `${snap.source_name}(${snap.file_count})`).join('、')}
: null} - {props.executionChain.catalog_change_sets.length ?
来源变更集{props.executionChain.catalog_change_sets.map((set) => `${set.id}·${set.state}`).join('、')}
: null} {props.executionChain.rollback_execution_id ?
补偿回滚已关联回滚执行
: null} - {props.executionChain.prior_execution_id ?
上游发布由发布执行补偿而来
: null}
: null}
+ +
+ 更多 · 发布计划、下架与批次清单 +
+

发布计划

来源与目录 → 测试知识库 → 生产知识库。来源标注是最终 Truth Source。

按知识级别同步
+
新增 {props.releasePlan.summary.add}更新 {props.releasePlan.summary.update}删除 {props.releasePlan.summary.delete}阻断 {props.releasePlan.summary.blocked}未变化 {props.releasePlan.summary.unchanged}
+
+ + + + {`筛选 ${planFiltered.length} / 全部 ${props.releasePlan.items.length}`} +
+ {planPageItems.length ?
{planPageItems.map((item, index) => )}
选择知识目标计划动作测试状态生产状态能否发布
{item.action === 'delete' && item.can_release ? { props.onToggleDelete(item.publication_id); setDeleteConfirmed(false) }} /> : '—'}{item.title}{item.target_scope === 'internal' ? '对内知识库' : '对外知识库'}{actionLabel(item)}{item.test_state === 'ready' ? '已通过' : item.test_state === 'not_required' ? '无需测试' : '未就绪'}{item.production_state === 'present' ? '已存在' : '不存在'}{item.can_release ? item.action === 'delete' ? '将从生产检索中移除' : '可加入发布批次' : item.blocker === 'source_unavailable' ? '来源当前不可用,保留生产知识' : '测试未就绪,当前阻断'}
: planFiltered.length ?
当前筛选没有发布变更。
:
来源、测试与生产状态一致,当前没有发布变更。
} + {planPageCount > 1 ?
{`第 ${planSafePage + 1} / ${planPageCount} 页 · 每页 ${planPageSize} 条`}
: null} +
+

冻结发布计划集

建批时自动冻结当前计划;同一份计划复用同一版本。

{changeSet ? (changeSet.state === 'confirmed' ? `v${changeSet.number} · 已确认` : `v${changeSet.number} · 待确认`) : '尚未生成'}
+ {changeSet ?

{`清单 ${changeSet.item_count} 项(新增${changeSet.add_count}·更新${changeSet.update_count}·删除${changeSet.delete_count}·阻断${changeSet.blocked_count})· 摘要 ${changeSet.manifest_sha256.slice(0, 8)}…`}

: null} + {changeSetError ?

{changeSetError}

: null} +
{changeSet ? 建批时自动冻结当前计划,无需手动确认冻结 : 建批时会自动冻结当前发布计划}
+
+ +
已选 {selectedCount} 项{props.selectedDeleteIDs.length > 0 && !deleteConfirmed ? '(删除待确认)' : ''}
+
创建批次还需要确认所选发布动作至少 1 项动作通过确认填写批次名称
+
+
+

批次清单

建批即锁定;锁定 ≠ 上线。日常发布直接在上面「待发布」里点按钮;已锁定的批次也可以在这里逐条做生产确认。

锁定清单 ≠ 上线
+ {props.batchError ?
{props.batchError}
: null} + {props.batchPage.items.length === 0 ?
还没有批次。用上面的发布计划表创建,或直接在「待发布」里一键发布。
:
+ {props.batchPage.items.map((batch) => )} +
批次名称状态知识数量内容状态操作
{batch.name}{batchLabels[batch.state]}{batch.item_count}{batch.state === 'sealed' ? '内容已锁定' : '仍可检查调整'}
{batch.state === 'draft' ? : null}{batch.state === 'sealed' && isAdmin ? : null}

本批次包含

{props.batchDetail ? <>{props.batchDetail.items.map((item) =>
{item.title}{item.action === 'delete' ? '删除生产知识' : '新增或更新生产知识'}{item.decided_visibility === 'internal' ? '仅内部员工' : '允许外部用户'}
)}{props.batchDetail.items.length === 0 ?
批次没有知识。
: null} :
点击“查看内容”核对本次发布清单。
}
} +
+
}