Document grounding selection and pipeline order
The architecture of record still described the first stored search result being returned before ranking. It now says ranking decides among stored and new candidates, a stored source_url being scored on its stored recipe without refetching its page. State the exact per-candidate order in the docs and in ground: the photo download and validation (DownloadPhoto) precedes normalize_recipe, and CachePhoto records the photo in the same transaction as the recipe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -319,6 +319,11 @@ func (g *Grounder) storedRecipe(ctx context.Context, sourceURL string) (storedRe
|
||||
// ground downloads r's photo, normalizes it and stores it as sourceURL's
|
||||
// recipe. A problem with this recipe is returned as reason, so the caller
|
||||
// can try another; err is a failure that is not the recipe's.
|
||||
//
|
||||
// The order is fixed: the photo is downloaded and validated first, so a
|
||||
// recipe without a usable photo never costs a normalize_recipe call; then
|
||||
// normalize_recipe runs; then save records the photo (CachePhoto) and the
|
||||
// recipe in one transaction.
|
||||
func (g *Grounder) ground(ctx context.Context, sourceURL string, r Recipe) (gr Grounded, reason, err error) {
|
||||
photo, err := g.photos.DownloadPhoto(ctx, r.ImageURL)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user