Add failure-safe cluster image capture hook
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a06ecb-456a-71c2-b41e-0755d336e883
This commit is contained in:
parent
05f315be84
commit
da42f764c0
4 changed files with 60 additions and 3 deletions
|
|
@ -8,6 +8,7 @@ import hashlib
|
|||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
|
||||
|
|
@ -17,7 +18,7 @@ def read_images(path: Path) -> set[str]:
|
|||
image = line.strip()
|
||||
if not image or image.startswith("#"):
|
||||
continue
|
||||
if any(c.isspace() for c in image) or "/" not in image:
|
||||
if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9._:/@+-]*", image):
|
||||
raise ValueError("invalid image export")
|
||||
images.add(image)
|
||||
if not images:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue