diff --git a/TODO.md b/TODO.md index 52bf70a..fa2f693 100644 --- a/TODO.md +++ b/TODO.md @@ -128,6 +128,19 @@ - Effect: - avoids backend 500 during the Gemini Vision evaluation stage for mid-sized result sets +## Current Session Update (2026-03-13, Artgrid Query Coverage Fix) +- Another Artgrid no-results regression was found even after the collector URL matcher was widened. +- Root cause: + - Artgrid collector query generation still leaned on `site:artgrid.io/clip/` + - in practice, canonical clip pages can surface under `artlist.io/stock-footage/clip/...` + - so some Artgrid-only searches still returned zero renderable results even though the accept filter had been fixed +- Fix applied: + - Artgrid query generation now searches both: + - `site:artgrid.io/clip/` + - `site:artlist.io/stock-footage/clip/` +- Effect: + - improves Artgrid recall in SearXNG result sets that favor canonical Artlist URLs over Artgrid URLs + ## Local Self-Test Workflow - Primary command: - `bash scripts/selftest.sh` diff --git a/backend/services/cse.go b/backend/services/cse.go index 67d35e4..3fbc94d 100644 --- a/backend/services/cse.go +++ b/backend/services/cse.go @@ -336,6 +336,8 @@ func buildArtgridQueries(base string) []string { return []string{ fmt.Sprintf(`"%s" ("stock footage" OR "b-roll" OR cinematic OR editorial) site:artgrid.io/clip/`, base), fmt.Sprintf(`"%s" ("footage" OR "cinematic" OR "establishing shot") site:artgrid.io/clip/`, base), + fmt.Sprintf(`"%s" ("stock footage" OR "b-roll" OR cinematic OR editorial) site:artlist.io/stock-footage/clip/`, base), + fmt.Sprintf(`"%s" ("footage" OR "cinematic" OR "establishing shot") site:artlist.io/stock-footage/clip/`, base), } } diff --git a/backend/services/cse_test.go b/backend/services/cse_test.go index 1320297..cc32177 100644 --- a/backend/services/cse_test.go +++ b/backend/services/cse_test.go @@ -1,6 +1,9 @@ package services -import "testing" +import ( + "strings" + "testing" +) func TestExtractVideoPreviewURLFindsEnvatoPreview(t *testing.T) { html := `` @@ -64,6 +67,20 @@ func TestIsRenderableArtgridResultAcceptsArtlistCanonical(t *testing.T) { } } +func TestBuildArtgridQueriesIncludesArtlistCanonicalDomain(t *testing.T) { + queries := buildArtgridQueries("friendly couple") + found := false + for _, query := range queries { + if strings.Contains(query, "site:artlist.io/stock-footage/clip/") { + found = true + break + } + } + if !found { + t.Fatal("expected Artgrid queries to include artlist canonical domain") + } +} + func TestGeminiCandidateLimitNeverExceedsCandidates(t *testing.T) { if got := GeminiCandidateLimit(9); got != 9 { t.Fatalf("expected Gemini limit to stay within candidate count, got %d", got)