refactor(vision): finish vision_analyst tools — EXIF correction + metadata + doc fix#19
Merged
Merged
Conversation
…uctured metadata + doc fix
Audit found the supposed `image_inspector` / `image_editor` workers were
never implemented — only mentioned in CLAUDE.md §"도메인별 첫 분기 의무"
as gardened ghost names. The real Vision Team already exposes
`vision_analyst` with two PIL/Pillow tools (`get_image_metadata`,
`resize_image`), so this commit finishes that setup and aligns the doc.
- packages/agent-tools/src/agent_tools/vision.py
* `resize_image`: apply `ImageOps.exif_transpose` so phone photos with
EXIF Orientation tags read upright. Without this, vision_analyst was
reading rotated pixels and silently degrading recognition accuracy.
* `resize_image`: report `(new_size) from (original_size)` and the
`FileSize: a -> b bytes` delta so the analyst can reason about
whether the resize actually saved bytes.
* `get_image_metadata`: surface `FileSize`, `EXIF` presence, and
`Alpha` channel flag — gives the analyst structured signals beyond
bare format/size/mode.
- apps/backend/tests/test_agent_tools.py
* Lock the new metadata fields (`FileSize:`, `EXIF:`, `Alpha:`).
* Lock the resize summary's `from (...)` and `->` markers.
* New regression test: EXIF Orientation=6 (rotate 90 CW) must swap
width/height after resize.
- CLAUDE.md §"도메인별 첫 분기 의무"
* Vision row corrected: `image_inspector` → `image_editor` (ghosts)
replaced with `vision_analyst (tools: get_image_metadata,
resize_image)`. prompt-kit's `# REQUIRED FIRST ROUTES` /
`# VISION TEAM HANDOFF` blocks are now the single source.
Validation:
- pytest tests -q → 191 passed (190 baseline + 1 new EXIF regression).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit follow-up to #18 — the CLAUDE.md table referenced ghost workers (
image_inspector/image_editor) that never had implementations. The real Vision Team already exposesvision_analystwith two PIL tools; this PR finishes the setup and aligns the doc.Changes
resize_imagenow appliesImageOps.exif_transposeso phone photos with EXIF Orientation read upright (silent quality fix). Output now reports(new_size) from (original_size)+FileSize: a -> b bytesdelta.get_image_metadatasurfacesFileSize,EXIFpresence, andAlphachannel — structured signals beyond bare format/size/mode.vision_analyst (tools: get_image_metadata, resize_image); pointer to prompt-kit's# REQUIRED FIRST ROUTES/# VISION TEAM HANDOFF.Test plan
🤖 Generated with Claude Code