INNER CODE UNIT · Python
is_driver_crash_line
lij768423-svg/grok-register-panel · batch_supervisor.py:73
def is_driver_crash_line(line: str) -> bool:
text = str(line or "")
return any(marker in text for marker in _DRIVER_CRASH_MARKERS)
def read_completed(path: str | os.PathLike[str]) -> int:
try:
data = json.loads(Path(path).read_text(encoding="utf-8"))
return max(0, int(data.get("completed", 0) or 0))
except (OSError, ValueError, TypeError, json.JSONDecodeError):
return 0
def initialize_progress(path: str | os.PathLike[str], target: int) -> Path:
progress_path = Path(path)
atomic_write_json(
progress_path,
{