feat(shipping-process-gates): 落地全门禁中断恢复并消除双真相

纳入 Execution/Gate/Attempt 模型与迁移、Worker/API/前端恢复卡片与 Admin 诊断,
Gate 阻断时清零旧 action_buttons,异常摘要统一脱敏,并为运维筛选与 Attempt Diff 补齐入口。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-01 13:08:32 +08:00
1 parent b352c281d5
commit 323928626b
92 files changed
+11930 -458

No files matched your search

@@ -2,7 +2,7 @@
* features/workspace/shipping-task-center/TaskProgressTimeline.spec.ts
* 用途:锁定任务中心时间线同时消费 Task Event 与 Workflow Event。
* 依赖:Vitest、@vue/test-utils、TaskProgressTimeline。
* 逻辑:合并排序后两类事件均可见;Workflow 操作人展示 type/id。
* 逻辑:合并排序后两类事件均可见;未知内部码、操作人 ID 与 JSON 详情不展示。
*/
import { describe, expect, it } from 'vitest';
import { mount } from '@vue/test-utils';
@@ -21,8 +21,10 @@ const messages = {
empty: '暂无事件记录',
detail: '查看详情',
sourceTask: '任务事件',
sourceWorkflow: 'Workflow 事件',
workflowEvent: 'Workflow 事件',
sourceWorkflow: '文件处理记录',
workflowEvent: '文件处理记录',
updated: '处理状态已更新',
actors: { user: '业务人员', system: '系统' },
},
},
},
@@ -51,10 +53,40 @@ describe('TaskProgressTimeline', () => {
});
// 关键断言:时间线同时展示 Task 与 Workflow 事件来源标签,且 Workflow 显示操作人。
expect(wrapper.text()).toContain('任务事件');
expect(wrapper.text()).toContain('Workflow 事件');
expect(wrapper.text()).toContain('文件处理记录');
expect(wrapper.text()).toContain('任务已创建');
expect(wrapper.text()).toContain('人工上传已登记');
expect(wrapper.text()).toContain('操作者 1');
expect(wrapper.text()).toContain('操作者 user/42');
expect(wrapper.text()).toContain('操作者 业务人员');
expect(wrapper.text()).not.toContain('user/42');
expect(wrapper.text()).not.toContain('操作者 1');
});
it('does not expose unknown event codes or raw detail JSON', () => {
const i18n = createI18n({ legacy: false, locale: 'zh-CN', messages });
const wrapper = mount(TaskProgressTimeline, {
props: {
events: [{
event_type: 'internal_task_event',
actor_id: 99,
detail_json: { node_id: 'node-1', error: 'HTTP 500' },
}],
workflowEvents: [{
seq_no: 2,
event_code: 'internal_workflow_event',
actor_type: 'worker',
actor_id: 'worker-7',
payload: { gate_code: 'quality_gate_internal' },
}],
},
global: { plugins: [i18n] },
});
const text = wrapper.text();
expect(text).toContain('处理状态已更新');
for (const technicalText of [
'internal_task_event', 'internal_workflow_event', 'node_id', 'HTTP 500',
'gate_code', 'quality_gate_internal', 'worker-7',
]) {
expect(text).not.toContain(technicalText);
}
});
});