feat(catalog): Katalogsuche Backend – RPC, Normalisierung, alternative Titel (KAT-01, 3a Backend) #64

Merged
cschlaefke merged 8 commits from feature/3a-katalog-suche-backend into main 2026-11-04 10:04:03 +00:00

8 commits

Author SHA1 Message Date
cschlaefke
9fa91eb684 fix(db): single filter set, filter tests with query, perf guards, evidence docs (KAT-01, 3a review)
All checks were successful
CI / flutter (pull_request) Successful in 1m19s
CI / web-build (pull_request) Successful in 57s
CI / supabase (pull_request) Successful in 11s
CI / supabase-tests (pull_request) Successful in 38s
CI / e2e (pull_request) Successful in 2m59s
Filters are evaluated once into an id set used by both search branches.
Adds tests for age/genre/mechanic filters with a search term, rank 2 vs 3
and null p_limit. approxNormalize uses NFKD. Perf script checks confirm_local
value and unix socket and re-analyzes after rollback. Adds
docs/specs/3-katalog-suche-umsetzung.md (measurements, log check incl. GET
finding), release checklist section 2a and the CSV-only note for alt titles.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 10:39:02 +01:00
cschlaefke
354206c766 Merge remote-tracking branch 'origin/main' into feature/3a-katalog-suche-backend 2026-11-04 10:31:07 +01:00
cschlaefke
c8bbd10d37 test(db): pin runbook 8.2 queries and QUE-04 log assumptions in pgTAP (KAT-01, 3a)
Adds the unchanged runbook queries (rolconfig, pg_available_extensions,
pg_settings) and asserts the settings that keep search terms out of logs.
katalog-pflege 8.2 now states that the three log settings depend on each other.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 10:06:46 +01:00
cschlaefke
0cbe813e5b docs(db): document search, alt titles and image-upgrade check (KAT-01, 3a)
datenmodell-r1, supabase README and katalog-pflege (alt titles, merge step 2b,
normalization check after image upgrades, rate limit and log hints).

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:40:43 +01:00
cschlaefke
729e51620c test(db): add local search measurement script (KAT-01 B5)
supabase/perf/catalog_search_perf.sql loads synthetic data in one rolled-back
transaction and measures search_catalog_games as anon with RLS (explain and
p50/p95/p99 per case). Lives outside supabase/tests so it never runs in CI.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:40:43 +01:00
cschlaefke
683b5c830e perf(db): set-based rank 4 and filters in search_catalog_games, harden tests (KAT-01, 3a)
Rank 4 and the genre/mechanic filters ran a correlated subplan per game
(13 s at 10 000 games). Now: one set-based word coverage, filters as one hashed
IN set, 'like all' patterns, similarity only for hits. Adds pgTAP cases found
by mutation testing (paging by relevance, alt title choice, duplicate words,
mechanic duplicates) and a Deno case for mark characters.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:40:43 +01:00
cschlaefke
976fbe9fe1 feat(db): startbestand tool reads alt_titles column (KAT-01, 3a)
Parses de:Title;en:Title (';' forbidden in titles, errors with line number),
generates an idempotent reconcile for game_alt_titles, adds an info row to
checks.sql and attaches alternative titles to Testspiel B. Regenerated files.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:12:25 +01:00
cschlaefke
3bb1c28831 feat(db): catalog search with search_normalize, alt titles and search_catalog_games RPC (KAT-01, 3a)
Adds pg_trgm/unaccent, search_normalize, generated title_search/name_search
columns, game_alt_titles (read-only for API roles), manual_fields key
alt_titles and the RPC search_catalog_games. pgTAP 09_catalog_search covers
rights, normalization, relevance, filters, paging and the runbook snippets.

Refs #3

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:12:25 +01:00