diff options
| author | hamdog0203 <360416966+hamdog0203@users.noreply.github.com> | 2026-11-24 16:20:01 +0100 |
|---|---|---|
| committer | hamdog0203 <360416966+hamdog0203@users.noreply.github.com> | 2026-11-24 16:20:01 +0100 |
| commit | 3c2ad30d523ed06a6ed2debe30e035d08c984618 (patch) | |
| tree | 3439053fbe9636152d33402af05bf588df7854c3 /tools/progress_dashboard.py | |
| parent | 151e300abe18d760cf29d724b10cfaf62154ee9f (diff) | |
progress_dashboard: require string content_hash and dict metrics in history.json
Diffstat (limited to 'tools/progress_dashboard.py')
| -rw-r--r-- | tools/progress_dashboard.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/progress_dashboard.py b/tools/progress_dashboard.py index 8c4c22447..562bb0654 100644 --- a/tools/progress_dashboard.py +++ b/tools/progress_dashboard.py | |||
| @@ -1027,7 +1027,12 @@ def _load_history(hist_path): | |||
| 1027 | history = json.loads(read_utf8(hist_path).lstrip("\ufeff")) | 1027 | history = json.loads(read_utf8(hist_path).lstrip("\ufeff")) |
| 1028 | except ValueError as exc: | 1028 | except ValueError as exc: |
| 1029 | raise ValueError(f"{hist_path}: invalid JSON: {exc}") from None | 1029 | raise ValueError(f"{hist_path}: invalid JSON: {exc}") from None |
| 1030 | if not isinstance(history, list) or any(not isinstance(item, dict) or "content_hash" not in item for item in history): | 1030 | if not isinstance(history, list) or any( |
| 1031 | not isinstance(item, dict) | ||
| 1032 | or not isinstance(item.get("content_hash"), str) | ||
| 1033 | or not isinstance(item.get("metrics"), dict) | ||
| 1034 | for item in history | ||
| 1035 | ): | ||
| 1031 | raise ValueError(f"{hist_path}: expected a JSON list of snapshot summaries") | 1036 | raise ValueError(f"{hist_path}: expected a JSON list of snapshot summaries") |
| 1032 | return history | 1037 | return history |
| 1033 | 1038 | ||