Skip to content

[ADR-015] Schema Migration Ledger #334

@ohdearquant

Description

@ohdearquant

Summary

Update the versioned migration ledger mechanics, tests, comments, and transaction behavior after domain schema clusters have defined the concrete migrations.

Source ADRs

  • F082 ADR-015 (MAJ): Production MIGRATIONS contains four VersionedMigration entries, V1-V4, ending at dedupe_graph_edge_triples (from audit-foundation/e6/ADR-015.md)
  • F083 ADR-015 (MAJ): Migration tests treat V4 as the latest version (assert_eq!(version, 4)), and the idempotency test repeats that expectation (from audit-foundation/e6/ADR-015.md)
  • F084 ADR-015 (MAJ): Each migration is run with conn.transaction() (from audit-foundation/e6/ADR-015.md)
  • F085 ADR-015 (MIN): The versioned migration system comment still says ADR-022. (from audit-foundation/e6/ADR-015.md)

Files affected

  • crates/khive-db/src/migrations.rs (506 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 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-004] Event Observable and Provenance Model
  • Depends on: #[ADR-004] GTD Pack Schema Plan and Lifecycle Audit
  • Depends on: #[ADR-043] Embedding Model Registry and Vector Engine Migration
  • Depends on: #[ADR-025] Event-Sourced Proposals
  • Blocks: none

LOC estimate

~80 lines added/30 removed; 1 existing affected file(s) sampled at 506 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.

Auto-generated by ADR alignment triage

Metadata

Metadata

Assignees

No one assigned

    Labels

    adr-alignmentADR v1 series alignment workfoundationFoundation layer (ADR-001..015)platformPlatform layer (ADR-016..030)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions