Commit Graph
7 Commits
Author SHA1 Message Date
dev_agentandClaude Opus 5.5 24d91b5bf6 Rank stored candidates on their stored recipe without refetching
CI / ci (push) Successful in 1m48s
CI / ci (pull_request) Successful in 1m48s
Ground no longer fetches the page of a candidate whose source URL is
already stored: the stored recipe, its photo, ingredients and steps are
scored as a fetched page would be, so ranking still decides between it
and new candidates, and a stored page that is now unavailable can still
be reused. Rank's fetch-and-extract is split out behind a loader so
Rank and Ground share one scoring path.

The reuse test removes the stored page and checks that only the new
candidate is fetched; the ranking regression test lists the unrelated
stored recipe first so search order cannot pass it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 15:35:37 -04:00
dev_agentandClaude Opus 5.5 871a566800 Rank stored candidates instead of reusing them first
CI / ci (push) Successful in 1m48s
CI / ci (pull_request) Successful in 1m53s
Ground returned the first search result that was already stored before
fetching or ranking anything, so an unrelated stored recipe could win
over a relevant new one. Ground now ranks every candidate and walks the
ranking best first, reusing a stored recipe only at its ranked place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 15:18:29 -04:00
dev_agentandClaude Opus 5.5 ceedc45309 Grounding pipeline and recipe-search settings API
CI / ci (push) Successful in 1m49s
CI / ci (pull_request) Successful in 1m48s
recipes.Grounder ties search, fetch/extract, Rank, the photo cache and
normalize_recipe together. Ground(ctx, dishName, query) reuses a stored
source_url among the top candidates without fetching, otherwise tries the
ranked recipes best first and stores the photo, recipe, ingredients and
steps in one transaction, returning Grounded{recipe_id, photo_id, method,
minutes_total, difficulty, source_url, site_name} or a typed
*ErrUngroundable listing every reason. GroundURL grounds a pasted URL the
same way; GroundMany grounds items 3 at a time with per-item results.

PhotoCache is split into DownloadPhoto (fetch, decode, size check, no
writes) and CachePhoto(ctx, tx, photo), which records the row in the
caller's transaction; RemovePhotoFiles cleans up after a rollback.

Migration 0007 adds photo_id, method, difficulty and minutes_total to
recipes, and api_key_last4 to recipe_search_settings. SearXNG is now
called at recipe_search_settings.base_url.

GET/PATCH /api/v1/settings/recipe-search (Brave key sealed with
secretbox, only api_key_set and api_key_last4 returned) and POST
/api/v1/settings/recipe-search/test (searches "chicken tikka masala",
returns the count, 409 not_configured or 502 search_failed).

Maestro task 53afd59c-6c35-4af7-904c-6c167d1ad69d.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 15:06:39 -04:00
dev_agent 58e8f30f0e Photo cache and /media endpoint (#68)
CI / ci (push) Successful in 1m38s
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
2026-10-05 14:24:11 -04:00
dev_agent 2fb7807af3 Search providers: SearXNG and Brave with ranking (#67)
CI / ci (push) Successful in 1m37s
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
2026-10-05 13:41:48 -04:00
dev_agent ec5b586c16 schema.org Recipe JSON-LD extractor (#66)
CI / ci (push) Successful in 1m36s
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
2026-10-05 13:13:03 -04:00
dev_agent 24eee8bc61 SSRF-safe recipe fetcher (#65)
CI / ci (push) Successful in 1m34s
Co-authored-by: dev_agent <dev_agent@cubecraftlabs.com>
2026-10-05 12:38:58 -04:00