Skip to content

Search: say where a matched moment ends - #36

Merged
davior merged 1 commit into
mainfrom
claude/funny-knuth-en5fly
Oct 16, 2026
Merged

davior merged 1 commit into
mainfrom
claude/funny-knuth-en5fly

Conversation

@davior

@davior davior commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Gecko Video Creator needs this change (GAM-1 in gvc's plan of attack). GVC turns a search hit ("where people talk about X") into a trimmed clip, and with only start_time it would have to guess the out point.

What changes

  • GET /api/search hits now carry end_time next to start_time. It's the end of the matched transcript segment.
  • The value is looked up from TranscriptSegment in one query per search, and only for the page being returned (services/search.py::_attach_end_times). It isn't stored in the FTS index: the index holds only the start, and adding a column there would mean rebuilding the whole index in a migration.
  • Moments found by either retriever get an end. A moment found only by semantic search is covered too.
  • Metadata hits, and hits whose segment has since been deleted (e.g. a transcript re-run), return null.
  • Frontend: SearchHit.end_time is added to the type. No UI uses it yet.
  • docs/plan-of-attack.md: the documented result shape now includes end_time.

Tests

  • Three new tests in test_search_api.py:
    • a keyword hit gives (412.0, 417.0);
    • a semantic-only hit ("armament") gives the same pair;
    • a metadata hit gives null/null.
  • With the service change stashed, the first two fail; with it they pass.
  • Backend: pytest -q passes, 1250 tests.
  • Frontend: format check, lint, npm test (393 tests) and build all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_016fiRJAt34ag62iPiuMkNhm


Generated by Claude Code

A spoken hit carried only its start_time. Gecko Video Creator turns a hit
("where people talk about X") into a trimmed clip, and with only a start
it would have to guess the out point.

The end is looked up from the transcript segments once per search, for
the page that is actually returned. The keyword index stores only the
start, and adding a column there would mean rebuilding the whole FTS
index in a migration.

Both retrievers get it: a moment found only by meaning has its end too.
A metadata hit, or one whose segment has since been deleted, says null
rather than something wrong.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016fiRJAt34ag62iPiuMkNhm
@davior
davior marked this pull request as ready for review October 16, 2026 04:16
@davior
davior merged commit f097591 into main Oct 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants