mind-body: chat images reach the Persona session as image blocks (ChatDelivery v2 image field) #11
Loading…
Reference in a new issue
No description provided.
Delete branch "eureka/chat-image-consumer"
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?
Cut B of Minds reading chat images (follow-up
gamecult-chat:follow_up:chat-mind-20261107T195444303Z-t20). Do not merge or deploy until Bifrost cut A emits v2 and a store exists.Wire (for Bifrost). Pending kind
gamecult.persona.chat_pending.v2. A delivery is a 12-element tuple: index 11 isimage, nil or[path: str, mime: str, size: u64, sha256: str].pathis relative to the Persona's image store and exactly<lowercase hex sha256 of the room id>/<lowercase hex sha256 of the bytes>[.<1-5 alnum ext>].mimeis exactlyimage/png|jpeg|gif|webpand must equal what the magic bytes say.sizeis the byte length, at most 5 MiB. Golden fixtures:tests/fixtures/persona-chat-v3/. v1 pending answers and 11-element records still decode (image: None), and the client accepts both kinds.Consumer.
chat_image::loadis the only place a reference becomes bytes; it refuses any path not of that shape or not for this delivery's room, anything whose canonical path differs (symlinks), non-regular files (checked before open, so a FIFO cannot block), over 5 MiB (declared and on disk), a size or sha256 differing from the declaration, non-image magic bytes, and a mime differing from the sniffed type. Only then base64.persona.rsputs a text block then one image block per image into the stream-json user message (at most 4 per line) and adds anattachment role=organ ... status=attached image=N | status=not_shown reason="..."line per image-bearing delivery, with fixed reasons. The echo reader treats a replayed line with blocks as our echo (else the session machinery would lose track of what she was shown). Store root:MIND_PERSONA_IMAGE_STORE(absolute); unset shows no image. No bytes are logged or in an error.Verification.
unshare -Ur cargo test -p mind-bodylib, chat_rudp, public_surface: green (760 lib tests; the control and persona_bin integration tests fail here for environment reasons that predate this change). Guards hand-mutated one at a time: every guard's removal fails a test except two recorded as equivalent:take(MAX+1)on the read (the metadata length check already bounds it; only a file growing mid-load differs) andsymlink_metadatavsmetadata(the canonical-path check already refuses symlinks). The CLI accepted the image-block line shape in a probe, but no model read was observed (no lease in the Self run).Open. The Persona unit needs read access to the store and the env var set. Images are untrusted input to the model; the Persona instructions should say so (not changed here).
🤖 Generated with Claude Code