Phase 3: smarter grouping — EXIF/docx signals, structured outputs, model split, batched grouping - #17
Open
zackkitzmiller wants to merge 2 commits into
Open
Conversation
…odel split, batched grouping, needs-review bucket - images now send EXIF capture date / camera / GPS presence as a metadata hint (fs mtime as fallback); documents send mtime — dates are the strongest photo-grouping signal and were unused - docx (zip -> word/document.xml) and rtf (control-word stripping) now yield real text excerpts instead of filename-only guesses - describe/group API calls request structured outputs (output_config.format json_schema); regex JSON extraction remains as fallback for proxies that ignore it - model split: per-file descriptions default to claude-haiku-4-5, grouping stays on the big model; configurable via [ai].describe_model; cost estimates price each stage at its own model - grouping of >120 files runs in topic-coherent batches; labels from earlier batches feed later ones and same-label groups merge - placements with description confidence < 0.6 land in a visible 'Needs Review' group instead of silently joining a folder - --dupes-only now respects the organized ledger
2 tasks
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.
Why
Grouping quality was limited by its inputs and plumbing: EXIF was a declared dependency but never read (photo dates/cameras unused), docx/rtf fell back to filename-only descriptions, JSON came back via regex extraction, one giant prompt handled up to 500 files, every call ran on the most expensive model, and low-confidence placements silently joined folders.
Stacked on #16.
Changes
analyze::exif_hint): capture date, camera model, GPS presence sent asmetadata_hintfor images; filesystem mtime as universal fallback for images and documents.word/document.xml→ tag-strip with paragraph preservation; rtf = control-word stripper. Both feed the normal text-describe path..docremains filename-only.output_config.format(json_schema forContentDescriptionand the groups shape).extract_jsonstays as a fallback for proxies/models that ignore the parameter.claude-haiku-4-5(high-volume vision → 5x cheaper), grouping stays on[ai].model. New[ai].describe_modelconfig;estimate_costprices each stage at its own model.Needs Reviewgroup.--dupes-only: already-organized files are skipped there too.Test plan
cargo test— 374 passed (new: docx xml stripping + real docx structure, rtf control-word stripping, exif-none-for-plain-png, quarantine positive/noop, cross-chunk label merge at 2×batch+5 files, split-model pricing)cargo clippy --all-targets— clean