Skip to content

feat: add memory_type to FTS5 index (#662)#664

Merged
ajianaz merged 4 commits into
developfrom
feat/fts5-memory-type
Jul 14, 2026
Merged

feat: add memory_type to FTS5 index (#662)#664
ajianaz merged 4 commits into
developfrom
feat/fts5-memory-type

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add memory_type column to the FTS5 full-text search index so that keyword searches can match against memory types (fact, decision, procedure, etc.).

Changes

  • FTS5 virtual table: Added memory_type as a new FTS5 column
  • Sync triggers: Updated all 3 triggers (INSERT, DELETE, UPDATE) to include memory_type
  • Migration v13->v14: Drops old FTS5 table + triggers, recreates with new schema, rebuilds index from existing data
  • Tests: Added test_fts5_memory_type_column_search and test_fts5_memory_type_rebuild

Closes #662

- Add memory_type column to FTS5 virtual table definition
- Update all 3 sync triggers (INSERT, DELETE, UPDATE) to include memory_type
- Add schema migration v13β†’v14: drop old FTS5 table/triggers, recreate with memory_type, rebuild index
- Add tests: memory_type column search and rebuild verification
@github-actions

Copy link
Copy Markdown

πŸ” Cora AI Code Review

βœ… No issues found. Code looks good!


Review powered by cora-cli Β· BYOK Β· MIT

@ajianaz

ajianaz commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

CI Failure Analysis

Error: Format check fail

schema.rs:972 β€” migration code formatting doesn't match cargo fmt. The diff shows:

  • Array literal ["memories_fts_ai", "memories_fts_ad", "memories_fts_au"] needs wrapping to single line
  • Method chain .conn.execute(...) needs reformatting

Fix: Run cargo fmt --all locally and push.

Note: Check, Clippy, and Build passed on the latest run (29320742498). Only Format failed.

@ajianaz

ajianaz commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Updated CI Failure β€” Run 29321960300

Format: βœ… FIXED

Build/Check/Clippy: βœ… PASS

Test: ❌ FAIL β€” 4 migration tests broken

All same root cause: CURRENT_SCHEMA_VERSION is now 14 (due to v13β†’v14 FTS5 migration), but 4 test assertions still expect version 13.

Failed tests:

  1. edges::tests::migration_dispatcher_reaches_v8 (edges.rs:1279)
  2. memory::crud::content_type_tests::test_schema_migration_v5_to_v6_adds_content_type (crud.rs:708)
  3. memory::store::tests::test_migration_v11_to_v12_from_v04x_db (store.rs:1781)
  4. timeline::tests::migration_dispatcher_reaches_v9 (timeline.rs:299)

Fix: Update all 4 assertions from == 13 to == 14:

// edges.rs:1279, crud.rs:708, store.rs:1781, timeline.rs:299
assert_eq!(version, 14);  // was 13

Also check CURRENT_SCHEMA_VERSION constant β€” if it's now 14, all these tests need to match.

4 tests hardcoded v13 but CURRENT_SCHEMA_VERSION is now 14
(FTS5 memory_type migration). Updates assertion values and
comment chain in crud.rs.

Fixes #671
@ajianaz ajianaz merged commit 241e597 into develop Jul 14, 2026
8 checks passed
@ajianaz ajianaz deleted the feat/fts5-memory-type branch July 14, 2026 09:59
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.

feat: add memory_type to FTS5 index for keyword search

1 participant