Spaces:
Sleeping
Sleeping
| """Sub-task registry for ConsultEnv module decomposition.""" | |
| SUB_TASKS = { | |
| "secondary": ["research_scoping", "desk_research", "findings_synthesis"], | |
| "benchmarking": ["peer_set_definition", "benchmark_data_collection", "gap_and_variance_analysis"], | |
| "interviews": ["discussion_guide_and_mapping","interview_execution", "thematic_synthesis"], | |
| "data_modelling": ["model_architecture", "base_case_build", "scenario_and_sensitivity"], | |
| "insight_gen": ["issue_tree_mapping", "insight_sharpening", "recommendation_structuring"], | |
| "presentation": ["storyline_development", "deck_build", "internal_review"], | |
| "workshops": ["pre_read_and_agenda", "workshop_facilitation", "action_registry"], | |
| } | |
| # module -> sub_task_name where skip=True is legal | |
| OPTIONAL_SUB_TASKS = { | |
| "data_modelling": "scenario_and_sensitivity", | |
| "presentation": "internal_review", | |
| "workshops": "pre_read_and_agenda", | |
| } | |
| # Fraction of module's base_days consumed by each sub-task | |
| DAYS_FRACS = { | |
| "secondary": [0.20, 0.60, 0.20], | |
| "benchmarking": [0.20, 0.60, 0.20], | |
| "interviews": [0.20, 0.60, 0.20], | |
| "data_modelling": [0.25, 0.50, 0.25], | |
| "insight_gen": [0.25, 0.50, 0.25], | |
| "presentation": [0.25, 0.50, 0.25], | |
| "workshops": [0.15, 0.70, 0.15], | |
| } | |
| # Quality contribution weight per sub-task (sums to 1.0 per module) | |
| QUALITY_WEIGHTS = { | |
| "secondary": [0.20, 0.50, 0.30], | |
| "benchmarking": [0.20, 0.50, 0.30], | |
| "interviews": [0.15, 0.55, 0.30], | |
| "data_modelling": [0.25, 0.45, 0.30], | |
| "insight_gen": [0.25, 0.45, 0.30], | |
| "presentation": [0.25, 0.45, 0.30], | |
| "workshops": [0.20, 0.60, 0.20], | |
| } | |
| # Sub-task index at which qc=True has effect (per module) | |
| QC_SUB_TASK = { | |
| "secondary": 2, | |
| "benchmarking": 2, | |
| "interviews": 2, | |
| "data_modelling": 1, | |
| "insight_gen": 2, | |
| "presentation": 1, | |
| "workshops": 2, | |
| } | |
| def get_sub_task_name(module: str, progress: int) -> str: | |
| return SUB_TASKS[module][progress] | |
| def is_optional(module: str, progress: int) -> bool: | |
| optional_name = OPTIONAL_SUB_TASKS.get(module) | |
| if optional_name is None: | |
| return False | |
| return SUB_TASKS[module][progress] == optional_name | |
| def module_complete(module: str, progress: int) -> bool: | |
| return progress >= len(SUB_TASKS[module]) | |