~bigbes/lethe: 2d9d2b8e

search: add /api/v1/search API and opencode collector parser

- Add FTS5 search repository with BM25 ranking, cursor pagination, and owner scoping
- Expose GET /api/v1/search with query, tool, host, since/until filters
- Add opencode collector parser reading from SQLite opencode.db
- Spike document recording canonical opencode storage format

Invariants: no schema migrations, no wire type changes, read-only search,
marker snippets (not HTML), invalid queries → 400 INVALID, parser interface
unchanged, collector state schema preserved, stats/react stubs untouched.

Reviewed: offset fix (message.rowid instead of time_created for progress marker),
all 22 test packages pass.

Eugene Blikh <bigbes@gmail.com> — 2026-05-04 06:19:16 UTC

Commit 2d9d2b8ec08ee09cc64c5d925ab85716b1d7d1fbview raw patch

Parent(s): 72508a53

14 changed file(s)

FileStatus+
cmd/lethe-collector/main.go M +2
cmd/lethe-collector/main_test.go M +13
cmd/lethe/main.go M +6 -1
cmd/lethe/main_e2e_test.go M +3
docs/spikes/opencode-format.md A +196
docs/tasks/lethe-search-and-opencode.md M +68 -3
internal/collector/parser/opencode/parser.go A +409
internal/collector/parser/opencode/parser_test.go A +334
internal/collector/parser/opencode/testdata/schema.sql A +31
internal/domain/search/handler.go A +154
internal/domain/search/handler_test.go A +283
internal/domain/search/repository.go A +274
internal/domain/search/repository_test.go A +262
internal/server/server.go M +8 -5