Skip to content

[ADR-043] Embedding Model Registry and Vector Engine Migration #330

@ohdearquant

Description

@ohdearquant

Summary

Add vector/embedding engine migration steps and registry-backed table naming after storage and retrieval contracts are settled.

Source ADRs

  • F227 ADR-043 (CRIT): MIGRATIONS contains only V1 through V4 and stops at dedupe_graph_edge_triples. (from audit-rest/r5/ADR-043.md)
  • F228 ADR-043 (CRIT): Vector tables are created as vec_<model_key> with only subject_id, namespace, kind, and embedding columns. (from audit-rest/r5/ADR-043.md)

Files affected

  • crates/khive-db/src/migrations.rs (506 sampled LOC)
  • crates/khive-db/src/backend.rs (627 sampled LOC)
  • crates/khive-storage/src/types.rs (436 sampled LOC)
  • crates/khive-storage/src/vectors.rs (446 sampled LOC)

Acceptance criteria

  • All source findings listed above are addressed exactly once in this cluster.
  • Public types, handlers, schema, and docs touched by the affected files agree on the ADR contract.
  • Regression tests cover happy path and edge cases for the changed public APIs or schema behavior.
  • cargo test -p khive-db -p khive-storage passes.
  • cargo clippy --workspace -- -D warnings passes.
  • make ci passes.

Dependencies

  • Depends on: #[ADR-001] Entity Kind and Type Contract
  • Depends on: #[ADR-002] Edge Ontology, Lifecycle, and Bulk Link Semantics
  • Depends on: #[ADR-004] Note Kind, Storage, and Curation Operations
  • Depends on: #[ADR-005] Storage Capabilities, Sparse Store, and Vector Contract
  • Depends on: #[ADR-004] Event Observable and Provenance Model
  • Depends on: #[ADR-003] Runtime Backend and Substrate Coordinator
  • Depends on: #[ADR-004] HandlerDef Pack Contract
  • Depends on: #[ADR-004] GTD Pack Schema Plan and Lifecycle Audit
  • Blocks: #[ADR-025] Event-Sourced Proposals
  • Blocks: #[ADR-015] Schema Migration Ledger

LOC estimate

~100 lines added/30 removed; 4 existing affected file(s) sampled at 2015 current LOC via wc -l, plus 0 new/planned path(s).

Risk notes

  • Same-file dependencies must merge first; dependency list includes the exact overlapping paths.
  • Contains CRIT findings; do not defer without owner approval.

Auto-generated by ADR alignment triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    adr-alignmentADR v1 series alignment workadvancedAdvanced layer (ADR-031..046)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions