吸收数字员工管理端审批治理预览

This commit is contained in:
baiyanyun
2026-06-12 23:03:58 +08:00
parent bd7d7b4913
commit 8ed4e0ce3b
6 changed files with 204 additions and 2 deletions

View File

@@ -1382,6 +1382,73 @@ function checkDigitalAdminRecordBillingArchiveShell() {
console.log("[DigitalEmployeeCheck] admin send/billing/audit archive shell hooks OK");
}
function checkDigitalAdminApprovalGovernanceWorkbench() {
console.log("\n[DigitalEmployeeCheck] Verify admin approval governance workbench hooks");
const backendRoot = path.resolve(packageRoot, "..", "..", "..", "qiming-backend");
const qimingRoot = path.resolve(packageRoot, "..", "..", "..", "qiming");
const servicePath = path.join(
backendRoot,
"app-platform-modules",
"app-platform-agent",
"app-platform-agent-core-application",
"src",
"main",
"java",
"com",
"xspaceagi",
"agent",
"core",
"application",
"service",
"DigitalEmployeeSyncApplicationServiceImpl.java",
);
const testPath = path.join(
backendRoot,
"app-platform-modules",
"app-platform-agent",
"app-platform-agent-core-application",
"src",
"test",
"java",
"com",
"xspaceagi",
"agent",
"core",
"application",
"service",
"DigitalEmployeeSyncApplicationServiceImplTest.java",
);
const qimingOpsPath = path.join(qimingRoot, "src", "pages", "SystemManagement", "Content", "DigitalEmployeeOps", "index.tsx");
const qimingTypesPath = path.join(qimingRoot, "src", "types", "interfaces", "systemManage.ts");
const docsPath = path.resolve(packageRoot, "..", "..", "docs", "digital-employee-frontend-integration-plan.md");
const service = fs.readFileSync(servicePath, "utf8");
const test = fs.readFileSync(testPath, "utf8");
const qimingOps = fs.readFileSync(qimingOpsPath, "utf8");
const qimingTypes = fs.readFileSync(qimingTypesPath, "utf8");
const docs = fs.readFileSync(docsPath, "utf8");
const requiredSnippets = [
[service, "approval_governance", "backend approval governance view"],
[service, "isApprovalGovernanceRow", "backend approval governance matcher"],
[service, "approval_conflict_active", "backend approval conflict classifier"],
[service, "risk_approval", "backend risk approval classifier"],
[service, "approval_action_recorded", "backend approval action history classifier"],
[test, "queryAdminWorkbenchApprovalGovernanceReturnsApprovalConflictRiskAndHistoryRowsOnly", "backend approval governance test"],
[qimingTypes, "approval_governance", "qiming approval governance view type"],
[qimingOps, "审批治理", "qiming approval governance tab"],
[qimingOps, "保留本地", "qiming approval keep local action"],
[qimingOps, "标记复核", "qiming approval mark reviewed action"],
[qimingOps, "批量/高风险裁决不开放", "qiming approval governance safety copy"],
[docs, "正式管理端审批工作台预览", "docs approval governance absorption"],
];
const missing = requiredSnippets
.filter(([content, snippet]) => !content.includes(snippet))
.map(([, , label]) => label);
if (missing.length > 0) {
throw new Error(`Missing admin approval governance workbench hooks: ${missing.join(", ")}`);
}
console.log("[DigitalEmployeeCheck] admin approval governance workbench hooks OK");
}
function checkLocalDatabaseSchema() {
console.log("\n[DigitalEmployeeCheck] Verify local SQLite digital schema");
const dbPath = path.join(os.homedir(), ".qimingclaw", "qimingclaw.db");
@@ -1444,6 +1511,7 @@ function main() {
checkDigitalAdminPolicySnapshots();
checkDigitalBackendMaterializedFacts();
checkDigitalAdminRecordBillingArchiveShell();
checkDigitalAdminApprovalGovernanceWorkbench();
checkLocalDatabaseSchema();
console.log("\n[DigitalEmployeeCheck] All checks passed");
} catch (error) {