feat(tui): prompt enhancement & tag generation — facade #65

Merged
charles merged 1 commit from tui/ai-jobs-26 into main 2026-04-11 20:42:43 +00:00
Owner

Stacks on #64. Closes charles/loom#26. Completes Phase 3 of the loom-tui roadmap.

  • ai::AiJob enum (PromptEnhance / TagGenerate / EntityDescribe / FaceDetect / DefectDetect / RegionAnalyze) with .label()
  • ai::AiJobTracker — one in flight per kind, start/finish/is_active/any_active
  • apply_prompt_enhance(target, output, Replace|Append) — Replace clears, Append respects word boundaries
  • apply_tag_generation(prompt, new_tags) — case-insensitive dedupe, preserves existing token order

Tests (3 new, 81 total)

  • Tracker rejects duplicate starts
  • Replace vs Append prompt enhance
  • Tag dedupe keeps existing red and adds new yellow/purple

Out of scope

  • Actual PluginBridge::enhance_prompt / generate_tags / etc. calls — routed from screens in the glue PR that threads Arc<PluginBridge> through AppCtx. This module provides the state machine and result-application helpers those calls feed into
Stacks on #64. Closes charles/loom#26. Completes **Phase 3** of the loom-tui roadmap. - `ai::AiJob` enum (PromptEnhance / TagGenerate / EntityDescribe / FaceDetect / DefectDetect / RegionAnalyze) with `.label()` - `ai::AiJobTracker` — one in flight per kind, `start`/`finish`/`is_active`/`any_active` - `apply_prompt_enhance(target, output, Replace|Append)` — Replace clears, Append respects word boundaries - `apply_tag_generation(prompt, new_tags)` — case-insensitive dedupe, preserves existing token order ## Tests (3 new, 81 total) - Tracker rejects duplicate starts - Replace vs Append prompt enhance - Tag dedupe keeps existing `red` and adds new `yellow`/`purple` ## Out of scope - Actual `PluginBridge::enhance_prompt` / `generate_tags` / etc. calls — routed from screens in the glue PR that threads `Arc<PluginBridge>` through `AppCtx`. This module provides the state machine and result-application helpers those calls feed into
Adds ai::AiJob, ai::AiJobTracker, and two pure helpers
apply_prompt_enhance(mode) and apply_tag_generation(existing, new).
AiJobTracker guards "one in flight per kind" so re-triggering the
same AI action while one is pending is a no-op. Tag dedupe is
case-insensitive and preserves the order of already-present tokens.

The actual PluginBridge calls (enhance_prompt, generate_tags,
detect_defects, describe_region, detect_face_region) are kicked off
from screens in the glue PR that threads Arc<PluginBridge> through
AppCtx. This PR is the state machine + result-application helpers.

Closes charles/loom#26

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
charles changed target branch from tui/queue-overlay-24 to main 2026-04-11 20:42:36 +00:00
charles deleted branch tui/ai-jobs-26 2026-04-11 20:42:43 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/loom!65
No description provided.