Skip to content

🔧 [P1] Increase core test coverage to 50%+ #129

Closed

Description

@ajianaz

Problem

Only 22 tests exist for a data-integrity-critical memory system. This is approximately 10-12% coverage.

Untested Modules

Module LOC Test Coverage Risk
lib.rs (Uteke struct) 783 ~0% 🔴 All 18+ public methods untested
store.rs 880 ~5% (store/delete only) 🔴 Tag ops, aging, search, namespace — untested
engine.rs 162 0% 🔴 Embedding pipeline — zero tests
vector.rs 386 0% 🔴 Index CRUD, search, save/load — untested
config.rs 510 0% 🟡 Config loading, merge, resolution — untested
main.rs 1028 0% 🟡 CLI arg parsing — untested (clap handles most)
types.rs 145 ~30% 🟢 Basic serialization tested

Critical Test Gaps

  • Tag operations — add, remove, rename, delete, filter (after 🔧 [P0] Refactor tag storage: JSON-in-TEXT → junction table #120 refactor)
  • Vector index — insert, remove, search, save/load, consistency
  • Import/export — data integrity roundtrip
  • Aging — tier classification, cleanup behavior
  • Contradiction detection — threshold behavior, edge cases
  • Consolidation — dedup accuracy, merge logic
  • Namespace isolation — cross-namespace data leakage
  • Config layering — CLI > project > global > defaults

Also: open_with_embedder() exists but is never used in tests

Proposed Approach

  1. Unit tests first — store.rs and vector.rs have the highest risk
  2. Integration tests — end-to-end remember → recall → search → forget
  3. Property-based tests — (optional) use proptest for embedding similarity

Acceptance Criteria

  • store.rs: 60%+ branch coverage (tag ops, search, aging, namespace)
  • vector.rs: 50%+ coverage (CRUD, search, save/load, consistency)
  • lib.rs: 40%+ coverage (core API methods)
  • engine.rs: basic smoke test (model load, embed, dimension check)
  • config.rs: 30%+ coverage (load, merge, resolution)
  • CI enforces minimum coverage (via cargo llvm-cov or similar)
  • All tests pass on all 4 platform targets

Effort: ~3-5 days

Activity

  1. added
    scope:core
    scope:cli
    on Jun 2, 2026
  2. added a commit that references this issue on Jun 2, 2026
  3. ajianaz commented on Jun 2, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in #157 — 34 → 94 tests

  4. added a commit that references this issue on Aug 13, 2026
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

    scope:cliscope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions