Skip to content

feat(transcripts): persist transcript index entries in SQLite #20

Description

@EloyEMC

Problem / requested outcome

The roadmap places local transcript indexing before embeddings and semantic search. Issue #19 defines deterministic in-memory TranscriptIndexEntry values, but the repository has no persistence boundary. Persist those entries using the existing SQLite/libSQL and Drizzle conventions, without coupling storage to embeddings or search.

Scope

  • Add an idempotent transcript-index table through existing database initialization conventions.
  • Persist video ID, chunk index, exact text, deterministic identity, and input order.
  • Preserve duplicate entries; identity alone must not be the sole row key.
  • Use conservative local-install scope because the current entry contract carries no user or channel ownership.
  • Define replace-per-video write semantics as an atomic operation: the replacement must not leave a partial index on failure.
  • Provide a narrow repository/adapter for replacing entries for a video, retrieving entries in deterministic order, and deleting entries for a video.
  • Keep the adapter compatible with the exact TranscriptIndexEntry contract from issue feat(transcripts): add storage-neutral index builder #19 commit 77cffa8.

Acceptance criteria

  • Schema and initialization follow existing Drizzle/libSQL conventions and are idempotent.
  • Replace, list, and delete operations are typed and covered by focused tests.
  • Replacing a video index removes stale entries and writes the new ordered entries atomically.
  • Duplicate input entries remain distinct and retain their order.
  • Retrieval is deterministic and preserves stored text, video ID, chunk index, identity, and order.
  • Empty replacement has explicit tested behavior.
  • No user/channel ownership is invented or persisted.
  • Existing transcript, chunking, index-builder, database, and full tests remain passing.

Non-goals

  • Embedding provider integration or vector columns.
  • Vector or semantic search, lexical ranking, or retrieval APIs.
  • Transcript fetching, fallback, normalization, or chunking changes.
  • API, CLI, MCP, UI, quota, analytics, playlist, or background-job integration.
  • Backfill, migrations for existing transcript data, or provider/model configuration.
  • Changing the public TranscriptResult or TranscriptIndexEntry contracts.

Planned validation

  • Focused storage tests using existing database test conventions.
  • npm test
  • npx tsc --noEmit
  • npm run lint
  • git diff --check
  • npm run build, subject to the known external node_modules symlink/Turbopack issue.

Dependency: issue #19, commit 77cffa8.
Roadmap: Phase 4 local transcript-index persistence before embeddings and semantic search.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions