Skip to content

[EPAC-2075]: build SearchHansard use case and FTS5 query adapter#608

Merged
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-2075-build-searchhansard-use-case-and-fts5-query-adap
May 25, 2026
Merged

[EPAC-2075]: build SearchHansard use case and FTS5 query adapter#608
riddim-developer-bot[bot] merged 1 commit into
mainfrom
symphony/epac-2075-build-searchhansard-use-case-and-fts5-query-adap

Conversation

@riddim-developer-bot

Copy link
Copy Markdown
Contributor

Why

The hansard-search Lambda had the D1 scaffold and index loader, but no query-layer policy or SQLite adapter. This adds the SearchHansard use case, typed validation/query-syntax errors, and the FTS5 repository implementation so D3 can wire the HTTP handler onto a tested search boundary instead of embedding SQL in transport code.

What changed

  • Added internal/usecase/search_hansard.go with the search value types, pagination, repository port, and input validation for empty queries and invalid page/per-page values.
  • Added internal/adapter/sqlitefts5 with the FTS5 MATCH/COUNT(*) queries, speaker/topic substring filters, control-character sanitization, snippet/bm25 mapping, and typed ErrInvalidQuerySyntax translation for modernc.org/sqlite parser failures.
  • Added fixture-backed adapter tests covering word match, phrase match, boolean operators, speaker/topic filters, pagination, empty results, and the invalid-syntax path.
  • Updated the hansard-search README and use-case catalog so the new backend boundary is discoverable, and removed the stale D2 note from OpenSearchIndex.

Trade-offs not taken

  • I did not wire the HTTP handler or OpenAPI surface here; that remains D3 per the ticket scope.
  • I kept the fixture database test-local instead of committing a binary SQLite artifact so the corpus stays easy to inspect and adjust in Go.

Test plan

  • GOWORK=$PWD/backend/go.work go test ./backend/hansard-search/...
  • go test ./... (from backend/hansard-search)
  • go test ./hansard-search/... (from backend)

Skipped checks

  • cd ios && make build was not run because this ticket only changes the Go backend hansard-search module.
  • No OpenAPI update is included because this PR does not add or change a live endpoint yet; D3 owns the handler wiring and spec change.

Reviewer-Boundary: review-only

Linear: https://linear.app/riddimsoftware/issue/EPAC-2075/build-searchhansard-use-case-and-fts5-query-adapter-for-hansard-search

@riddim-developer-bot riddim-developer-bot Bot added the autonomous Enrolled in prconverged daemon for automated review and merge label May 25, 2026
@riddim-developer-bot riddim-developer-bot Bot added the autonomous Enrolled in prconverged daemon for automated review and merge label May 25, 2026
@riddim-developer-bot
riddim-developer-bot Bot enabled auto-merge (squash) May 25, 2026 19:55
@riddim-developer-bot
riddim-developer-bot Bot merged commit aa75474 into main May 25, 2026
52 checks passed
@riddim-developer-bot
riddim-developer-bot Bot deleted the symphony/epac-2075-build-searchhansard-use-case-and-fts5-query-adap branch May 25, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autonomous Enrolled in prconverged daemon for automated review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants