/** * 旧任务键 → 发布键。必须与 internal/workflowdef/keyspace.go 的 legacyToCanonical 逐项一致。 * 交付物池里的后缀对齐仍用 templateMatch.normalizeTaskKeyToProject,不要在这里再写一套池逻辑。 */ const LEGACY_TO_CANONICAL: Record = { intake: 'bd_intake', research: 'bd_research', feasibility_dev: 'bd_feasibility_dev', feasibility_reg: 'bd_feasibility_reg', user_requirements: 'bd_user_requirements', prelim_design: 'bd_prelim_design', cdo_quote: 'bd_cdo_quote', system_reqs: 'pm_system_reqs', test_manager: 'tm_system_verification', software_charter: 'sw_software_charter', source_inventory: 'sw_source_inventory', current_state_audit: 'sw_current_state_audit', architecture_baseline: 'sw_architecture_baseline', software_risk_register: 'sw_software_risk_register', product_requirements: 'sw_product_requirements', scope_backlog: 'sw_scope_backlog', target_architecture: 'sw_target_architecture', decision_log: 'sw_decision_log', bootstrap_roadmap: 'sw_bootstrap_roadmap', verification_strategy: 'sw_verification_strategy', operations_baseline: 'sw_operations_baseline', bootstrap_readiness: 'sw_bootstrap_readiness', change_brief: 'sw_change_brief', implementation_plan: 'sw_implementation_plan', change_manifest: 'sw_change_manifest', adr_delta: 'sw_adr_delta', test_report: 'sw_test_report', security_review: 'sw_security_review', release_plan: 'sw_release_plan', release_notes: 'sw_release_notes', retrospective: 'sw_retrospective', backlog_delta: 'sw_backlog_delta', }; export function canonicalTaskKey(key: string): string { const trimmed = key.trim(); return LEGACY_TO_CANONICAL[trimmed] ?? trimmed; }