Skip to content

Content-aware classification: analyze document contents, richer prompts, Fable 5 - #9

Merged
zackkitzmiller merged 3 commits into
mainfrom
feat/content-aware-classification
Jun 13, 2026
Merged

Content-aware classification: analyze document contents, richer prompts, Fable 5#9
zackkitzmiller merged 3 commits into
mainfrom
feat/content-aware-classification

Conversation

@zackkitzmiller

Copy link
Copy Markdown
Member

Summary

Addresses mediocre classification results: photos of the same person all landed in one bucket regardless of companions/pets/setting, and all legal documents were dumped into a single folder regardless of case.

Root causes fixed

  1. Documents were never read — text files and PDFs were described to the grouping step by filename alone ("document file: x.pdf"), so contents could not influence grouping
  2. Describe prompt was too shallow — 1-2 generic sentences + 3 tags, with nothing asking who is pictured or what a document actually is
  3. Grouping prompt said "prefer fewer, larger groups" — one-big-bucket behavior by instruction

Changes

  • Extract text from PDFs (pdf-extract, panic-isolated on a blocking thread) and plain-text formats (txt/md/csv/json/xml/html/yaml/toml); send an 8KB excerpt via new AiProvider::describe_text (default impl preserves backward compatibility). doc/docx/rtf still fall back to filename
  • Describe prompts demand distinguishing detail: people count, selfie/posed/candid, pets and species, setting for photos; document type, parties, case numbers/dates for documents; 5-8 specific-first tags
  • Grouping prompt prefers specific groups ("Smith v. Jones Lawsuit") over catch-alls ("Legal Documents") and uses dest_name sub-paths for sub-subjects
  • Default model → claude-fable-5
  • Analysis cache versioned to .v2.json — existing shallow descriptions are invalidated and will be re-analyzed on next run
  • Also: semantic grouping API failure no longer crashes the run after analysis completes; falls back to a single group with a visible warning

Test plan

  • 277 tests pass (8 new: document extraction, empty/binary fallbacks, excerpt truncation, prompt content, cache versioning)
  • clippy clean, fmt applied
  • Manual run against a real mixed folder to confirm grouping granularity improves

A connection failure in propose_groups previously crashed the whole
run after all per-file analysis had completed, discarding the work.
Fall back to a single 'All Files' group and emit a GroupingFailed
event so the warning is visible, mirroring how per-file analysis
failures are already tolerated.
The grouping model previously never saw document contents — text
files and PDFs were described by filename alone, so distinct legal
cases, trips, or subjects all collapsed into one bucket.

- Extract text from PDFs (pdf-extract, panic-isolated) and plain-text
  formats, sending an 8KB excerpt to a new describe_text provider
  method (default impl keeps existing AiProvider impls compiling)
- Describe prompts now demand distinguishing detail: people count,
  selfie/posed, pets and species for photos; document type, parties,
  and case identifiers for documents; 5-8 specific-first tags
- Grouping prompt prefers specific groups over broad catch-alls,
  replacing the 'fewer, larger groups' rule that produced
  one-big-bucket results
- Default model: claude-sonnet-4-20250514 -> claude-fable-5
- Analysis cache versioned (.v2.json) to invalidate shallow cached
  descriptions written under the old prompts
@ecc-tools

ecc-tools Bot commented Jun 12, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

claude-fable-5 has been suspended; fall back to claude-opus-4-8 as
the default analysis model.
@ecc-tools

ecc-tools Bot commented Jun 13, 2026

Copy link
Copy Markdown

🔒 Upgrade Required

Private repository analysis requires Pro or Enterprise.

Upgrade: https://ecc.tools/pricing?plan=pro


ECC Tools keeps the core app open, and puts private repos, team features, and enterprise controls behind paid tiers.

@zackkitzmiller
zackkitzmiller merged commit 637bf28 into main Jun 13, 2026
1 check passed
@zackkitzmiller
zackkitzmiller deleted the feat/content-aware-classification branch June 13, 2026 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant