吸收数字员工跨设备策略冲突视图

This commit is contained in:
baiyanyun
2026-06-12 21:48:33 +08:00
parent b3f21adecb
commit 8a5d5d6474
13 changed files with 643 additions and 9 deletions

View File

@@ -1181,6 +1181,66 @@ function checkDigitalAdminActionLoop() {
console.log("[DigitalEmployeeCheck] admin action pull/apply loop hooks OK");
}
function checkDigitalAdminPolicySnapshots() {
console.log("\n[DigitalEmployeeCheck] Verify admin policy snapshot conflict view hooks");
const syncServicePath = path.join(packageRoot, "src", "main", "services", "digitalEmployee", "syncService.ts");
const syncTestPath = path.join(packageRoot, "src", "main", "services", "digitalEmployee", "syncService.test.ts");
const docsPath = path.resolve(packageRoot, "..", "..", "docs", "digital-employee-frontend-integration-plan.md");
const qimingRoot = path.resolve(packageRoot, "..", "..", "..", "qiming");
const backendRoot = path.resolve(packageRoot, "..", "..", "..", "qiming-backend");
const qimingOpsPath = path.join(qimingRoot, "src", "pages", "SystemManagement", "Content", "DigitalEmployeeOps", "index.tsx");
const qimingServicePath = path.join(qimingRoot, "src", "services", "systemManage.ts");
const qimingTypesPath = path.join(qimingRoot, "src", "types", "interfaces", "systemManage.ts");
const backendControllerPath = path.join(
backendRoot,
"app-platform-modules",
"app-platform-agent",
"app-platform-agent-core-ui",
"src",
"main",
"java",
"com",
"xspaceagi",
"agent",
"web",
"ui",
"controller",
"DigitalEmployeeAdminPolicyController.java",
);
const syncService = fs.readFileSync(syncServicePath, "utf8");
const syncTest = fs.readFileSync(syncTestPath, "utf8");
const docs = fs.readFileSync(docsPath, "utf8");
const qimingOps = fs.readFileSync(qimingOpsPath, "utf8");
const qimingService = fs.readFileSync(qimingServicePath, "utf8");
const qimingTypes = fs.readFileSync(qimingTypesPath, "utf8");
const backendController = fs.readFileSync(backendControllerPath, "utf8");
const requiredSnippets = [
[syncService, "policySnapshotBusinessView", "client policy snapshot business view"],
[syncService, "policy_snapshot", "client policy snapshot category"],
[syncService, "policy_kind", "client policy kind field"],
[syncService, "auto_create_governance_commands", "route policy conflict field"],
[syncService, "max_per_sweep", "dispatch policy conflict field"],
[syncService, "catch_up_on_startup", "scheduler policy conflict field"],
[syncTest, "event-route-policy-pull", "route policy snapshot sync test"],
[syncTest, "event-risk-policy-pull", "risk policy snapshot sync test"],
[backendController, "/snapshots", "backend policy snapshot endpoint"],
[qimingService, "apiDigitalEmployeeAdminPolicySnapshots", "qiming policy snapshot service"],
[qimingService, "/api/digital-employee/admin/policies/snapshots", "qiming policy snapshot endpoint"],
[qimingTypes, "DigitalEmployeePolicySnapshotRow", "qiming policy snapshot row type"],
[qimingTypes, "policy_conflicts", "qiming policy conflicts view type"],
[qimingOps, "策略冲突", "qiming policy conflict tab text"],
[qimingOps, "conflict_keys", "qiming conflict key display"],
[docs, "跨设备策略冲突视图", "docs policy conflict absorption"],
];
const missing = requiredSnippets
.filter(([content, snippet]) => !content.includes(snippet))
.map(([, , label]) => label);
if (missing.length > 0) {
throw new Error(`Missing admin policy snapshot hooks: ${missing.join(", ")}`);
}
console.log("[DigitalEmployeeCheck] admin policy snapshot conflict view hooks OK");
}
function checkLocalDatabaseSchema() {
console.log("\n[DigitalEmployeeCheck] Verify local SQLite digital schema");
const dbPath = path.join(os.homedir(), ".qimingclaw", "qimingclaw.db");
@@ -1240,6 +1300,7 @@ function main() {
checkDigitalOpsNotificationReportWorkbenches();
checkDigitalPolicySchedulerWorkbenches();
checkDigitalAdminActionLoop();
checkDigitalAdminPolicySnapshots();
checkLocalDatabaseSchema();
console.log("\n[DigitalEmployeeCheck] All checks passed");
} catch (error) {