Merge branch 'dev' into runny827
feat(training): 新增精益培训视频与周任务管理 # Conflicts: # backend/app/models/__init__.py
This commit is contained in:
1 parent
85d27e9ffa
commit
91b7233872
812 files changed
+73763
-18908
No files matched your search
@@ -175,6 +175,7 @@ export function buildProcessingSemanticKey(
|
||||
summary: {
|
||||
total_tasks: projection.summary?.total_tasks || 0,
|
||||
total_files: projection.summary?.total_files || 0,
|
||||
submitted_files: projection.summary?.submitted_files || 0,
|
||||
processing: projection.summary?.processing || 0,
|
||||
needs_action: projection.summary?.needs_action || 0,
|
||||
completed: projection.summary?.completed || 0,
|
||||
@@ -276,23 +277,17 @@ export function createIntakeOtStabilizer(options?: { graceMs?: number }): Intake
|
||||
}
|
||||
|
||||
/**
|
||||
* 归一化生命周期状态:把旧/兼容形态统一映射为新的单一状态。
|
||||
* 核心逻辑:waiting_human(旧 conversation_processing 兜底)一律归并为
|
||||
* waiting_review(新统一投影);pending_review 收敛到 waiting_review;
|
||||
* 其它保持原值。用于避免两套投影切换时造成状态文本闪烁、语义签名漂移。
|
||||
* 透传生命周期/用户态码;禁止把 F2 user_status 压成 stage 词。
|
||||
* 核心逻辑:waiting_human 保持 waiting_human;waiting_review 仅当输入本就
|
||||
* 是 stage/progress 码时原样返回。不再做 LEGACY-UNIFY 同义词折叠。
|
||||
* @param status - 原始 lifecycle / userStatus / status_label
|
||||
* @returns 归一化后的生命周期状态码
|
||||
* @returns 归一化后的状态码(空输入返回空串)
|
||||
*/
|
||||
export function normalizeLifecycleStatus(
|
||||
status: string | null | undefined,
|
||||
): string {
|
||||
const raw = String(status || '').trim().toLowerCase();
|
||||
if (!raw) return '';
|
||||
// [LEGACY-UNIFY] 旧兼容状态一律收敛为 waiting_review,保证显示「待复核」而非 waiting human。
|
||||
if (raw === 'waiting_human' || raw === 'pending_review' || raw === 'review_required') {
|
||||
return 'waiting_review';
|
||||
}
|
||||
if (raw === 'partially_completed') return 'waiting_review';
|
||||
if (raw === 'manual_upload' || raw === 'waiting_manual_upload') return 'manual_upload_pending';
|
||||
if (raw === 'retryable') return 'failed';
|
||||
return raw;
|
||||
@@ -887,8 +882,8 @@ export function resolveConversationProcessingFromUnified(
|
||||
|
||||
/**
|
||||
* 归一化旧 conversation_processing 投影的生命周期状态。
|
||||
* 核心逻辑:将所有组的 userStatus/status_label 统一为新形态,waiting_human 归并为 waiting_review,
|
||||
* 避免 work_items 为空回退时,旧投影状态与统一 work_items 状态来回切换造成文案闪烁。
|
||||
* 核心逻辑:浅拷贝 tasks 并规范 ui_state;userStatus/status_label 保持 F2 原词,
|
||||
* 禁止把 waiting_human 折叠为 waiting_review。
|
||||
*
|
||||
* @param projection - 原始 embedded conversation_processing 投影
|
||||
* @returns 归一化后的投影(新对象,浅拷贝 tasks 并覆盖 userStatus/status_label)
|
||||
@@ -1037,7 +1032,10 @@ export function normalizeConversationProcessingProjection(
|
||||
status_groups: normalizedGroups,
|
||||
lifecycle_nodes: projection.lifecycle_nodes || [],
|
||||
unclassified_summary: projection.unclassified_summary || { count: 0 },
|
||||
ui_state: projection.ui_state || undefined,
|
||||
// [AUTHORITY] 批次级 ui_state 与任务级 uiState 同为后端 snake_case DTO,必须统一
|
||||
// 归一化(blocking_reason/primary_action 增补 i18nKey;lifecycle_stage→lifecycleStage),
|
||||
// 否则三面阶段口径与工作台导航会读到两套字段名。
|
||||
ui_state: normalizeUiState(projection.ui_state) || undefined,
|
||||
output_artifacts: projection.output_artifacts || [],
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user