|
78 | 78 | ) |
79 | 79 | from .control_plane.quota.recent_runs import ( |
80 | 80 | build_monitor_debt_arbitration as _build_monitor_debt_arbitration, |
| 81 | + goal_latest_run as _goal_latest_run, |
81 | 82 | goal_latest_runs as _goal_latest_runs, |
82 | 83 | recent_external_monitor_observation_unchanged as _recent_external_monitor_observation_unchanged, |
83 | 84 | ) |
@@ -507,13 +508,6 @@ def quota_status( |
507 | 508 | return payload |
508 | 509 |
|
509 | 510 |
|
510 | | -def _latest_run(goal: dict[str, Any]) -> dict[str, Any]: |
511 | | - latest_runs = goal.get("latest_runs") if isinstance(goal.get("latest_runs"), list) else [] |
512 | | - if latest_runs and isinstance(latest_runs[0], dict): |
513 | | - return latest_runs[0] |
514 | | - return {} |
515 | | - |
516 | | - |
517 | 511 | def _quota_sort_key(item: dict[str, Any]) -> tuple[int, float, int, str]: |
518 | 512 | quota = item.get("quota") if isinstance(item.get("quota"), dict) else {} |
519 | 513 | state = str(quota.get("state") or "waiting") |
@@ -910,7 +904,7 @@ def build_quota_plan(status_payload: dict[str, Any], *, mode: str = "status") -> |
910 | 904 | if isinstance(attention.get("project_asset"), dict) |
911 | 905 | else {} |
912 | 906 | ) |
913 | | - latest = _latest_run(goal) |
| 907 | + latest = _goal_latest_run(goal) |
914 | 908 | waiting_on = attention.get("waiting_on") or "none" |
915 | 909 | lifecycle_phase = attention.get("lifecycle_phase") or goal.get("lifecycle_phase") |
916 | 910 | lifecycle_flags = attention.get("lifecycle_flags") or goal.get("lifecycle_flags") |
|
0 commit comments