Skip to content

fix(cli): report orphaned embedding vectors and add cleanup --dry-run - #851

Merged
tobi merged 1 commit into
mainfrom
fix/768-orphan-vector-observability
Aug 13, 2026
Merged

fix(cli): report orphaned embedding vectors and add cleanup --dry-run#851
tobi merged 1 commit into
mainfrom
fix/768-orphan-vector-observability

Conversation

@tobi

@tobi tobi commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Summary

  • Incremental qmd update still does not auto-prune embedding vectors (a transient empty/partial mount would otherwise force a full re-embed).
  • qmd status now reports orphaned embedding chunks (count + percent) when any exist.
  • qmd update prints a hint when orphans exceed 10% of vectors: N orphaned embedding chunks (M% of vectors) — run 'qmd cleanup' to reclaim space.
  • qmd cleanup --dry-run previews cache/orphan/inactive/vacuum work without changing the database.

Fixes #768

Test plan

  • bun test test/store.helpers.unit.test.ts (countOrphanedVectors + existing cleanupOrphanedVectors)
  • bun test test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|CLI Status Command|CLI Update Command"
  • node ./node_modules/vitest/vitest.mjs run test/store.helpers.unit.test.ts test/cli.test.ts -t "orphaned embedding vectors|CLI Cleanup Command|countOrphanedVectors"
  • CI Bun/Node unit tests green (ignore pre-existing nix flake hash mismatches)

…#768)

Incremental update still does not auto-prune vectors (a transient empty
mount would force a full re-embed). Status and update now surface the
orphan ratio, and cleanup --dry-run previews what would be removed.
@PowderAddicts

PowderAddicts commented Aug 13, 2026 via email

Copy link
Copy Markdown

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.

qmd update never prunes orphaned embedding vectors — unbounded index bloat and vector-scan slowdown until a manual qmd cleanup

2 participants