Schedule image digestion: Claude Vision OCR to WorkQueueItems #204
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Type
Feature
Lineage
Standalone -- extends the existing Upload tab (#33, done) with AI-powered schedule parsing.
Repo
ldraney/landscaping-assistantUser Story
As a crew lead
I want to photograph my boss's printed weekly schedule and have the app parse it into WorkQueueItems
So that I don't have to manually re-enter 50+ property names across 5 days every week
Context
The boss prints a weekly schedule as a spreadsheet with columns for Monday through Friday. Each column lists property/client names to visit that day. The schedule has quirks that make naive OCR insufficient:
Column-overflow pattern: When one day's list is too long for its column, the boss continues it in the adjacent column below a visual gap. For example, Wednesday's overflow appears in Thursday's column space -- the bottom names in Thursday actually belong to Wednesday. The boss groups properties by geographic proximity, not strict column alignment.
Handwritten additions: Sometimes extra names are handwritten at the bottom of the page, outside the printed table structure.
Existing infrastructure:
client_name,latitude,longitudeproperty_id,work_date,position~/secrets/anthropic/credentials.envZero-bloat constraint: Unknown names (not matching any existing Property) must NEVER be inserted into the database. Only properties that fuzzy-match an existing
Property.client_nameget WorkQueueItems created. Unmatched names are displayed for informational awareness but discarded.File Targets
Files the agent should create:
app/services/schedule_digester.rb-- orchestrates the Vision API call and property matchingapp/views/uploads/digest.html.erb-- confirmation/review UI showing matched vs unmatched namesdb/migrate/TIMESTAMP_add_week_start_to_uploads.rb-- associate an upload with the week it coversFiles the agent should modify:
Gemfile-- addgem "anthropic"app/controllers/uploads_controller.rb-- adddigestandconfirm_digestactionsapp/models/upload.rb-- addweek_startdate field (no AR associations to WorkQueueItem; the service creates items directly, the relationship is implicit through week_start date range)config/routes.rb-- add digest routes under uploadsapp/views/uploads/show.html.erb-- add "Digest Schedule" buttonFiles the agent should NOT touch:
app/models/property.rb-- no schema changes to propertiesapp/controllers/weeks_controller.rb-- existing week view stays unchangedFeature Flag
Flag: none
This is an extension of the existing upload flow, not a new user-facing surface. The button only appears on the upload show page for lead+ roles who already have access.
Acceptance Criteria
Property.client_name(case-insensitive, tolerant of minor spelling differences)Test Expectations
ScheduleDigesterparses structured Claude response and matches against propertiesbundle exec rspec spec/services/schedule_digester_spec.rb spec/requests/uploads_spec.rbConstraints
anthropicRuby gem for API callsclaude-sonnet-4-20250514for vision (cost-effective for OCR)ENV["ANTHROPIC_API_KEY"](already in secrets)client_nameonly (not address)Checklist
Related
landscaping-assistant-- project this affectsScope Review: NEEDS_REFINEMENT
Review note:
review-1450-2026-06-13Well-structured feature issue with all template sections present. Four items need attention before this is READY:
schedule-uploaduser story on project-landscaping-assistant needs updating -- currently says "Snap a photo for later reference" but this ticket extends it to AI-powered parsing into WorkQueueItems.arch-rails-apparchitecture note exists in pal-e-docs. Create one for traceability completeness.Scope Review: APPROVED (re-review)
Review note:
review-1450-2026-06-13-r2Both [BODY] findings from the initial review have been resolved:
Two [SCOPE] items remain but are project-level shared gaps, not blocking:
Ticket is ready to move to next_up.
Validation: PARTIAL
Tiers executed: Tier 1 (code review), Tier 3 (CI pipeline + dev server)
Validation note:
validation-204-2026-06-1312 checks: 11 PASS, 1 FAIL
Passing checks
Failing check
ActiveRecord::PendingMigrationErrorblocks ALL routes. Two migrations pending:add_completed_by_other_to_work_queue_items(different PR) +add_week_start_to_uploads(this PR). Fix: runbin/rails db:migrateon dev server.Verdict rationale
PARTIAL because the code is correct and CI passes, but we cannot verify the UI or end-to-end flow on the live dev server until migrations are applied. This is an ops gap, not a code defect.
Validation: PASS (r2)
Tiers executed: Tier 1 (CI test suite), Tier 3 (prod deployment verification)
Validation note:
validation-204-2026-06-13-r212 checks: 12 PASS, 0 FAIL
Re-validation after migration fix. All checks that previously blocked (HTTP 500s on dev) now pass cleanly:
058fa49matches merge commit/upreturns 200 on both prod and dev funnelsPOST /uploads/:id/digest,POST /uploads/:id/confirm_digest) presentScheduleDigesterservice deployed,anthropicgem (1.48.1) installedweek_startmigration applied