Remove untraceable driftCount from approval-runs export (#112)
`approval-runs export` returned a bare audit-drift counter with no way to trace it back to a document: no sourceDocumentSN, no recordId, no reason. Interpreting it required a separate per-document `approval-runs flow` query, and the word "drift" alone suggested the tool or the approval flow was broken rather than a snapshot/lifecycle difference. The drift itself is already visible in the workbook row: AI 决策「通过」 next to 人工审核「已取消」 and E人工行为「已撤回」, with the retraction recorded in the standard formatted E人工意见 column. The aggregate carried no information those columns do not. `seal_approval_runs_export` never enabled flow alignment, so for MCP consumers the field was a constant 0. Rather than enriching the field, remove it. Per-run auditDrift and auditDriftReason in `approval-runs flow` are unchanged.
This commit is contained in:
1 parent
a8a30f6065
commit
82d0d97efb
3 files changed
+6
-4
No files matched your search
@@ -354,6 +354,9 @@ describe("exportApprovalRunsToExcel integration", () => {
|
||||
});
|
||||
|
||||
expect(result.recordCount).toBe(1);
|
||||
// Audit drift is deliberately not aggregated here: a bare count cannot be traced back to a
|
||||
// record, while the drift itself is already visible in the E人工行为 / E人工意见 columns.
|
||||
expect("driftCount" in result).toBe(false);
|
||||
const wb = new ExcelJS.Workbook();
|
||||
await wb.xlsx.readFile(tmpOut);
|
||||
const ws = wb.worksheets[0]!;
|
||||
|
||||
@@ -46,7 +46,6 @@ export interface ApprovalRunsExportResult {
|
||||
rejectReasonCount: number;
|
||||
fileSizeBytes: number;
|
||||
exportedAt: string;
|
||||
driftCount?: number;
|
||||
excludedDeletedCount?: number;
|
||||
excludedSimulationCount?: number;
|
||||
}
|
||||
@@ -645,7 +644,6 @@ export async function exportApprovalRunsToExcel(
|
||||
|
||||
const statusCounts: Record<string, number> = {};
|
||||
let rejectReasonCount = 0;
|
||||
let driftCount = 0;
|
||||
|
||||
// 3.5 如果是合思租户且显式启用 withFlow(--with-flow),获取原生审批流并对齐 E人工行为 / E人工意见
|
||||
const alignmentsByRecordId = new Map<string, HoseRunAlignment>();
|
||||
@@ -696,7 +694,6 @@ export async function exportApprovalRunsToExcel(
|
||||
const aligned = alignApprovalRunsWithHoseFlow(runsForDoc, flow);
|
||||
for (const [recordId, align] of aligned.entries()) {
|
||||
alignmentsByRecordId.set(recordId, align);
|
||||
if (align.auditDrift) driftCount++;
|
||||
}
|
||||
} catch (err: any) {
|
||||
console.error(`⚠️ 拉取单据 ${displaySN} 审批流失败: ${err.message},使用降级对齐。`);
|
||||
@@ -1043,7 +1040,6 @@ export async function exportApprovalRunsToExcel(
|
||||
rejectReasonCount,
|
||||
fileSizeBytes: stat.size,
|
||||
exportedAt: new Date().toISOString(),
|
||||
driftCount,
|
||||
excludedDeletedCount,
|
||||
excludedSimulationCount
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user