inference_log must not store base64/binary image payloads #87
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
inference_log.request_payloadstores the full vision chat messages, including base64 data-URLs of processed photos. That is binary image content in the audit log.Live UAT evidence (5060
deploy_slab_db, 2026-09-21)All three Call 1 rows hit the hard truncate and still never capture the text prompt:
image_parts + [text])._log_calldoesjson.dumps(request)[:200000](backend/inference.py).Classify/SYNCED TAXONOMY/ taxonomy JSON in stored payload. Prompt audit is unusable; DB grows with image bytes.Photos exist separately in
slab_photos(e.g. latest Call 1 slab has photofd913934-…seq=1, ~292KB processed_blob). Logging base64 duplicates that blob intoinference_log.Root cause
What it should do
Log a redacted / referential request payload suitable for prompt debugging:
photo_id(slab_photos.id)seqwidth_px/height_px,is_calibration, byte lengthphoto seq=1 id=fd913934-….png(or original filename if/when that column exists — schema today has no orig_filename)data:image/...;base64,...intoinference_log.Scope
backend/inference.py:_log_calland/or a sanitizer applied before insert (Call 1 and Call 2).processed_blob— need id/seq for the log ref).data:image/ base64 image payloads; assert text prompt + taxonomy present; assert image slots are refs.DATA-MODEL.md§9 / METADATA-66 — "model request" means auditable text + media refs, not binary.Out of scope
Acceptance
request_payloadcontains full text prompt + taxonomy; zero base64 image data-URLs.inference_logrow — text readable, payload size ≪ 200k for typical 1–2 photo slabs.Filed from live UAT while reviewing Call 1 prompts (#86 follow-on): log was unusable for prompt review because images consumed the entire 200k cap.
Fixed in
41401a7._redact_request_for_log: data-URLs →image_ref(photo_id/seq/bytes/label); full text keptdata:image, length ≪ 200kClosing.