Normalize an entry's name into its checkpoint ID. JSON filenames are ``{ts}_{uuid}_p-{parent}.json``; SQLite IDs are already ``{ts}_{uuid}``. This strips the JSON suffix so fork-parent lookups work in both providers.
(entry: dict[str, Any])
| 86 | |
| 87 | |
| 88 | def _entry_id(entry: dict[str, Any]) -> str: |
| 89 | """Normalize an entry's name into its checkpoint ID. |
| 90 | |
| 91 | JSON filenames are ``{ts}_{uuid}_p-{parent}.json``; SQLite IDs |
| 92 | are already ``{ts}_{uuid}``. This strips the JSON suffix so |
| 93 | fork-parent lookups work in both providers. |
| 94 | """ |
| 95 | name = str(entry.get("name", "")) |
| 96 | if name.endswith(".json"): |
| 97 | name = name[: -len(".json")] |
| 98 | idx = name.find("_p-") |
| 99 | if idx != -1: |
| 100 | name = name[:idx] |
| 101 | return name |
| 102 | |
| 103 | |
| 104 | def _build_progress_bar(completed: int, total: int, width: int = 20) -> str: |
no test coverage detected
searching dependent graphs…