Merge pull request #113 from yunyingk/codex/fix-112-remove-driftcount
Remove untraceable driftCount from approval-runs export (#112)
This commit is contained in:
3 files changed
+6
-4
No files matched your search
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
- **Approval Runs Export No Longer Emits `driftCount`** (#112): `approval-runs export` returned a bare audit-drift counter with no way to trace it back to a document — no SN, no `recordId`, no reason — so interpreting it required a separate per-document `approval-runs flow` query. The drift itself is already visible in the workbook's `E人工行为` / `E人工意见` columns (e.g. AI 决策「通过」with E人工行为「已撤回」and a formatted retraction opinion), and `seal_approval_runs_export` never enabled the flow alignment, so the field was a constant `0` there. Removed `driftCount` from the export result rather than enriching it; per-run `auditDrift` / `auditDriftReason` in `approval-runs flow` are unchanged.
|
||||
|
||||
## [0.10.24] - 2026-09-15
|
||||
|
||||
### Added & Enhanced
|
||||
|
||||
@@ -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