Skip to content

[STALE] feat: metadata indexing infrastructure (Phase 1)#4

Open
turian wants to merge 1 commit intomainfrom
feat/metadata-index-infrastructure
Open

[STALE] feat: metadata indexing infrastructure (Phase 1)#4
turian wants to merge 1 commit intomainfrom
feat/metadata-index-infrastructure

Conversation

@turian
Copy link
Owner

@turian turian commented Feb 22, 2026

Status: NOT VIABLE FOR MERGE

This branch targets SQLite code that was deleted during the Dolt migration.
It would need a complete rewrite against the Dolt backend to be viable.

Keeping as reference for the indexing approach/design.

Original Summary

  • Metadata indexing infrastructure for efficient key/value lookups
  • Targeted internal/storage/sqlite/ which no longer exists in main

Rebase conflicts

CONFLICT (modify/delete): internal/storage/sqlite/issues.go
CONFLICT (modify/delete): internal/storage/sqlite/migrations.go
CONFLICT (modify/delete): internal/storage/sqlite/queries.go
CONFLICT (modify/delete): internal/storage/sqlite/transaction.go

Add issue_metadata_index table that indexes top-level scalar values
from Issue.Metadata JSON blobs. This establishes the "Index as Cache"
pattern (Option A from Discussion steveyegge#1588) where JSONL metadata is the
canonical source of truth and SQLite provides fast querying.

Changes:
- Migration 044: create issue_metadata_index table with composite
  indexes on (key, value_text) and (key, value_int)
- New metadata_index.go: updateMetadataIndex() indexes scalars
  including one level of nesting for namespaced keys (e.g.,
  jira.story_points); RebuildMetadataIndex() for bd doctor
- Wire indexing into all write paths: insertIssueStrict (single
  create), insertIssuesStrict (batch create), insertIssues (import),
  UpdateIssue (queries.go), and transaction UpdateIssue
- 6 tests covering string/int/float/bool types, nested keys,
  update refresh, empty metadata, and full rebuild

Closes steveyegge#1589

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant