feat(shipping-notice): 落地 XFA 统一视觉拆分确认门禁与处理投影收敛

闭合拆分预览令牌单次消费、样本 checksum 绑定与确认审计;正式提取改为 bindings-only。
同步统一标注工作台交互,并补齐进度投影/任务中心与迁移文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:21:25 +08:00
1 parent d2b3d74def
commit 84a881b554
195 files changed
+20269 -3463

No files matched your search

@@ -1,12 +1,14 @@
/**
* features/shipping-progress/progressWindow.spec.ts
* 用途:验收密度窗口切分与节点态推导。
* 用途:验收密度窗口切分、stageNodes 优先与范围摘要。
*/
import { describe, expect, it } from 'vitest';
import type { ShippingProcessingProjection } from '@/features/chat/types/shipping.api.types';
import {
buildProgressRangeHint,
buildProgressWindow,
buildReviewProgressDomainSummary,
computeProgressWindowRange,
resolveStageNodeStatus,
stageAbsoluteIndex,
@@ -80,4 +82,40 @@ describe('progressWindow', () => {
expect(start).toBeLessThanOrEqual(7);
expect(end).toBeGreaterThan(7);
});
it('prefers backend stageNodes status over index heuristic', () => {
const nodes = buildProgressWindow(baseProjection({
stage: 'inventory_source_resolving',
status: 'processing',
stageNodes: [
{ stage: 'upload_received', absoluteIndex: 0, status: 'passed' },
{ stage: 'inventory_source_resolving', absoluteIndex: 7, status: 'failed' },
],
}), 'workbench');
expect(nodes[7]?.status).toBe('failed');
});
it('buildProgressRangeHint returns done/total and current label key', () => {
const hint = buildProgressRangeHint(baseProjection({
stage: 'waiting_review',
status: 'waiting_review',
}), 'review');
expect(hint).not.toBeNull();
expect(hint!.currentLabelKey).toBe('chat.shippingProcessing.stage.waiting_review');
expect(hint!.total).toBeGreaterThan(0);
expect(hint!.done).toBeGreaterThanOrEqual(0);
});
it('buildReviewProgressDomainSummary maps waiting_review into order_confirm blocked', () => {
const domains = buildReviewProgressDomainSummary(baseProjection({
stage: 'waiting_review',
status: 'blocked',
}));
expect(domains).toHaveLength(5);
expect(domains[0]?.state).toBe('passed');
expect(domains[1]?.state).toBe('passed');
expect(domains[2]?.key).toBe('order_confirm');
expect(domains[2]?.state).toBe('blocked');
expect(domains[3]?.state).toBe('pending');
});
});