Load task_id -> task_value_usd mapping and full pool metadata.
()
| 15 | |
| 16 | |
| 17 | def load_task_values() -> tuple: |
| 18 | """Load task_id -> task_value_usd mapping and full pool metadata.""" |
| 19 | values = {} |
| 20 | pool = {} |
| 21 | if not TASK_VALUES_PATH.exists(): |
| 22 | return values, pool |
| 23 | for entry in read_jsonl(TASK_VALUES_PATH): |
| 24 | tid = entry.get("task_id") |
| 25 | val = entry.get("task_value_usd") |
| 26 | if tid and val is not None: |
| 27 | values[tid] = val |
| 28 | pool[tid] = { |
| 29 | "task_value_usd": val, |
| 30 | "occupation": entry.get("occupation", "Unknown"), |
| 31 | "sector": entry.get("sector", "Unknown"), |
| 32 | } |
| 33 | return values, pool |
| 34 | |
| 35 | |
| 36 | def read_jsonl(path: Path) -> list: |
no test coverage detected