File size: 953 Bytes
2b3313a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46b3240
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from typing import Dict, Any

from server.inputs.simulated.tasks import TASKS


TASK_ID_MAP = {
    "easy": "easy-deployment-sprints",
    "medium": "medium-traffic-readiness",
    "hard": "hard-project-legacy-migration",
}


class TaskSelector:
    def __init__(self):
        pass

    def next_task_list(self, task_id: str) -> Dict:
        # Prefer direct internal IDs; if not provided, resolve deterministic aliases.
        resolved_task_id = task_id
        direct_match = next((item for item in TASKS if item.get("task_id") == resolved_task_id), None)
        if direct_match is not None:
            return direct_match

        resolved_task_id = TASK_ID_MAP.get(task_id, task_id)

        match = next((item for item in TASKS if item.get("task_id") == resolved_task_id), None)
        if match is None:
            raise ValueError(f"Unknown task_id: {task_id} (resolved: {resolved_task_id})")
        return match