fix(intern-decision-serve): 0.1.2 treats empty/null images as absent

Audit finding on 0.1.1: a Jev client that always sends an images array with no
images was rejected for nothing. Only a non-empty value is 422 now. Also aligns
the contract's response example with the wire (model is the name@revision
string, not an object).

Re-accepted live: images []/null -> 200, ["a.png"] -> 422; JevBench all 202/231,
hard 83/111, 0 changed rows across the bench's r1..r4 (924).
This commit is contained in:
vh
2026-09-30 13:04:31 -07:00
parent da50696fe8
commit 1866c003e8
14 changed files with 2893 additions and 11 deletions
@@ -78,7 +78,9 @@ class SystemOneBody(BaseModel):
@property
def images_present(self) -> bool:
return "images" in (self.model_extra or {})
"""A NON-EMPTY images value only: [] and null count as absent (audit 2026-09-30 — a
client that always sends the field must not be rejected for nothing)."""
return bool((self.model_extra or {}).get("images"))
class ApiError(Exception):