Fix export/import: runtime bugs, add vectors, compression, validation#111
Merged
gvonness-apolitical merged 3 commits intomainfrom Feb 16, 2026
Merged
Fix export/import: runtime bugs, add vectors, compression, validation#111gvonness-apolitical merged 3 commits intomainfrom
gvonness-apolitical merged 3 commits intomainfrom
Conversation
archive.ts had 7 column/table name mismatches vs the actual schema (source_id→source_chunk_id, type→edge_type, weight→initial_weight, cluster_members→chunk_clusters, etc.) that would crash at runtime. All 19 tests were interface-only so never caught this. Changes: - Fix all SQL column/table names to match schema.sql - Add vector embedding export/import (semantic search works after import) - Add full cluster data: centroid, exemplar IDs, distances, membership hash - Add gzip compression (auto-detected on import) - Add validateArchive() with version, count, and referential integrity checks - Add dry-run import option - Add ExportResult/ImportResult return types with summary - Filter edges to require both endpoints in export (no dangling refs) - Wire CLI flags: --projects, --redact-paths, --redact-code, --no-vectors, --dry-run - Print formatted summary after export/import operations - Bump archive version to 1.1 (backward-compatible with 1.0) - Replace 19 interface-only tests with 27 integration tests using real DBs - Fix docs: remove phantom --format/--replace flags, fix magic bytes (CST\0)
Remove unused imports (gzipSync, ExportResult, ImportResult) and unused destructured variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
source_id→source_chunk_id,type→edge_type,weight→initial_weight,cluster_members→chunk_clusters, missingid/created_at/link_counton edges, missingsession_id/project_pathon chunks)--no-vectorsopt-out)--dry-runflag--projects,--redact-paths,--redact-code,--no-vectors,--dry-run--format/--replaceflags, fix magic bytes description (CST\0notCausantic\0)Test plan
npm run build— no type errorsnpm test— 82 files, 1707 tests pass (27 new archive integration tests)npx causantic export --output /tmp/test.json --no-encrypt— verify JSON contains vectors and full cluster datanpx causantic import /tmp/test.json— verify data restored, recall returns resultsnpx causantic import /tmp/test.json --dry-run— verify summary printed, DB unchanged