Show source and risk operations in readable audit

Why: Work-source decomposition, detected risks, human answers, and structure decisions were recorded but absent from the audit timeline.

Evidence: Focused presentation/tree tests, production build, and knip baseline pass.

Impact: Audit filters and rows now include the complete business-operation feed without raw payloads.

Refs: TT-N03 TT-R01 W4b
This commit is contained in:
2026-10-15 06:42:16 +00:00
parent ad503c9535
commit 987be7442f
2 changed files with 8 additions and 2 deletions
+7 -2
View File
@@ -22,7 +22,7 @@ import { exportNeedsDraft } from '../workspaces'
interface InspectProject { projectId: string; name: string; canAudit: boolean }
interface Capabilities { actor: string; projects: InspectProject[]; crossProject: boolean }
interface CoverageItem { face: string; reason: string }
interface ListShell<T = any> { items: T[]; nextCursor?: string; hasMore: boolean; truncated: boolean; coverage?: CoverageItem[] }
interface ListShell<T = any> { items: T[]; businessAudit?: T[]; nextCursor?: string; hasMore: boolean; truncated: boolean; coverage?: CoverageItem[] }
interface SummaryData { projectId: string; counts: Record<string, number>; watermark: number; lastOpAt: string; coverage?: CoverageItem[] }
type TreeItem = AuditTreeItem
interface RelationEntry { layer: string; edgeId?: string; kind?: string; type?: string; state: string; depth?: number; from: any; to: any; conf?: number }
@@ -52,6 +52,10 @@ const OPERATION_FILTERS = [
['change.applied', '应用变更'],
['open-item.add', '登记项目问题'],
['open-item.close', '关闭项目问题'],
['rdm.work.observe', '拆解工作来源'],
['rdm.work.risk', '发现项目风险'],
['rdm.work.risk.answer', '回答风险澄清'],
['rdm.structure.decide', '决定结构变更'],
] as const
/** 错误态(增量 2):分类文案(能力缺失/登录失效/查询失败)+ 原始回执折叠供诊断;
@@ -544,7 +548,8 @@ function TimelineTab({ pid }: { pid: string }) {
api.rdmCommand<ListShell<OpGroup | EventDTO>>('rdm.inspect.events', params)
.then(s => {
if (gen !== genRef.current) return
setItems(prev => replace ? s.items : [...prev, ...s.items])
const page = replace ? [...(s.businessAudit || []), ...s.items] : s.items
setItems(prev => replace ? page : [...prev, ...page])
setCursor(s.nextCursor || '')
setHasMore(s.hasMore)
})
+1
View File
@@ -36,6 +36,7 @@ const STATE_LABELS: Record<string, string> = {
active: '已生效', candidate: '待确认', pending: '待处理', baselined: '已建立基线',
approved: '已批准', rejected: '已拒绝', revoked: '已撤销', superseded: '已被取代',
failed: '失败', committed: '已生效', accepted: '已接受', cancelled: '已取消',
delivered: '已记录',
unknown: '结果未知', restricted: '部分信息受限',
}