吸收数字员工治理审计补齐

This commit is contained in:
baiyanyun
2026-06-12 10:33:46 +08:00
parent e473b5c147
commit 3a159e2f5a
11 changed files with 230 additions and 57 deletions

View File

@@ -1348,6 +1348,50 @@ describe("digital employee sync service", () => {
source: "qimingclaw-task-agent",
},
});
insertEventEntity("event-governance-pause", "governance_pause_plan", {
commandKind: "pause_plan",
commandId: "command-pause-plan",
correlationId: "route-1",
planId: "plan-1",
accepted: true,
message: "暂停计划",
riskLevel: "normal",
payload: {
source: "qimingclaw-ingress-route",
route_decision_id: "route-1",
route_kind: "PlanControl",
intent_kind: "control",
plan_id: "plan-1",
},
result: {
plan_id: "plan-1",
status: "accepted",
source: "qimingclaw-adapter",
},
});
insertEventEntity("event-governance-skip", "governance_skip_task", {
command_kind: "skip_task",
command_id: "command-skip-task",
correlation_id: "route-2",
plan_id: "plan-1",
task_id: "task-1",
run_id: "run-1",
step_id: "step-1",
accepted: false,
error: "policy_blocked",
risk_level: "medium",
payload: {
source: "qimingclaw-ingress-route",
route_decision_id: "route-2",
route_kind: "PlanControl",
intent_kind: "control",
task_id: "task-1",
},
result: {
status: "rejected",
error: "policy_blocked",
},
});
insertEventEntity("event-notification-read", "digital_workday_notification_read", {
metadata: {
notification_id: "task:task-1",
@@ -1498,6 +1542,8 @@ describe("digital employee sync service", () => {
{ entity_type: "event", entity_id: "event-lease" },
{ entity_type: "event", entity_id: "event-plan-step-ready" },
{ entity_type: "event", entity_id: "event-governance-input" },
{ entity_type: "event", entity_id: "event-governance-pause" },
{ entity_type: "event", entity_id: "event-governance-skip" },
{ entity_type: "event", entity_id: "event-notification-read" },
{ entity_type: "event", entity_id: "event-notification-dismiss" },
{ entity_type: "event", entity_id: "event-notification-reply" },
@@ -1639,6 +1685,36 @@ describe("digital employee sync service", () => {
input_length: 10,
});
expect(businessView("event-governance-input")).not.toHaveProperty("input");
expect(businessView("event-governance-pause")).toMatchObject({
category: "governance",
command_kind: "pause_plan",
accepted: true,
command_id: "command-pause-plan",
correlation_id: "route-1",
plan_id: "plan-1",
route_decision_id: "route-1",
route_kind: "PlanControl",
intent_kind: "control",
source: "qimingclaw-ingress-route",
status: "accepted",
risk_level: "normal",
});
expect(businessView("event-governance-skip")).toMatchObject({
category: "governance",
command_kind: "skip_task",
accepted: false,
error: "policy_blocked",
command_id: "command-skip-task",
correlation_id: "route-2",
plan_id: "plan-1",
task_id: "task-1",
run_id: "run-1",
step_id: "step-1",
route_decision_id: "route-2",
route_kind: "PlanControl",
intent_kind: "control",
risk_level: "medium",
});
expect(businessView("event-notification-read")).toMatchObject({
category: "notification",
notification_id: "task:task-1",