Skip to content

feat(vision): title + describe commands + engine refactor#74

Merged
gfargo merged 1 commit into
mainfrom
feat/vision-title-describe
May 11, 2026
Merged

feat(vision): title + describe commands + engine refactor#74
gfargo merged 1 commit into
mainfrom
feat/vision-title-describe

Conversation

@gfargo
Copy link
Copy Markdown
Owner

@gfargo gfargo commented May 11, 2026

Closes #73. See issue for full design. CI green required before merge.

Companions to `caption` that generate WP title (short noun phrase) and
description (2-3 sentences) using the same Ollama vision plumbing.
Foundation for the broader vision-AI metadata expansion.

Engine refactor:
- CaptionOptions gains `kind: 'alt' | 'title' | 'description' | 'classify' | 'tags'`
- Per-kind prompt templates in buildPrompt(kind, language)
- Per-kind post-processors:
  - cleanCaption (existing, used for alt + description default)
  - cleanTitle — strip "Title:" labels, trim trailing punctuation,
    80-char word-boundary truncate
  - cleanClassify — closed-set label match (groundwork for Tier 2)
  - cleanTags / cleanTagsArray — normalize + dedupe (groundwork for Tier 2)
- New shared runBulkVision in engine/caption/run-bulk.ts that handles the
  per-item loop, time-machine snapshots, FK-safe processing_history,
  and graceful failure. Caption.ts stays as-is for safety; future PR
  can migrate it once the abstraction proves itself.

CLI:
  localpress title [ids...] [--missing-title] [--all] [--apply] [--language]
  localpress describe [ids...] [--missing-description] [--all] [--apply]

The --missing-title filter auto-detects machine-generated WP titles:
Screenshot-…, IMG_…, DSC_…, hex hashes, untitled, bare numbers.

MCP:
- generate_title
- generate_description
Both honor concurrency, dry-run-by-default for bulk, defaults.captionModel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gfargo gfargo merged commit bda81a8 into main May 11, 2026
4 checks passed
@gfargo gfargo deleted the feat/vision-title-describe branch May 11, 2026 20:35
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.

feat(vision): title + describe commands + engine refactor

1 participant