Repository navigation
Add SQLite FTS5 search for conversations and memory, plus local Skill importer - #380
Merged
Merged
Conversation
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
Implements SQLite FTS5 full-text search across conversations and memory notes, plus a local Skill importer in Add-ons → Skills:
appd/src/store.rs,appd/src/core.rs,PROTOCOL.md):search_items+search_fts(tokenize='trigram', content-synced via triggers) to replace the full-transcript JSON scan inStore::search. Coalesces streamedtextdeltas at the first piece'sseq, stays in sync onappend,rewind_transcript, andON DELETE CASCADE(conversation/bot deletion), and backfills existingapp.dbfiles automatically on first open.search_itemsfor 1–2 char queries and cased non-ASCII queries so Unicode case folding and short queries stay exact while ASCII and CJK queries use the FTS5 trigram index.memory_index+memory_fts(tokenize='trigram') andsearch_memory(text, optionalbotorprojectId,limit) synced incrementally onwrite_memory,delete_memory,restore_memory_version, disk edits by bots, and bot/project deletion.appd/src/skills.rs,appd/src/core.rs,window/ui/src/Skills.tsx,native/src/skills.rs,PROTOCOL.md):discover_skills(runs offCore::runviareply_later) scanning standard local skill folders (~/.agents/skills,~/.claude/skills,~/.codex/skills,~/.cursor/skills,~/.gemini/skills, orBATE_DISCOVER_SKILLS_DIRSin tests), deduplicated by canonical path and validated withproto::skills::parse.window/uiandnative(hidden when empty), reusing the existingpreview_skill→ install sheet →install_skillconsent flow.Closes #373.
Evidence
cd window/ui && npm ci && npm run build && npm test: passed (141/141 tests, including stand-in command coverage and UI lint checks).cargo fmt --all --check: passed.cargo clippy --workspace --all-targets --locked -- -D warnings: passed.cargo test --workspace --locked --no-fail-fast: passed, including new unit and integration tests:store::tests::fts5_indexes_transcript_backfill_rewind_cjk_and_memory(verifies coalesced replies, CJK, short/Unicode queries, rewind, backfill on existing DB, memory FTS5, and FTS5integrity-check).store::tests::deleting_a_bot_or_a_project_leaves_no_row_that_points_at_it(verifiessearch_items,memory_index, and FTS5integrity-checkafter cascade deletes).skills::tests::discover_finds_valid_skills_and_deduplicates_symlinks.service::search_memory_finds_bot_and_project_notes_and_stays_in_sync_on_update_delete_and_disk_writes.service::discover_skills_lists_local_skills_for_preview_and_install.native/tests/addons.rs::discovered_local_skills_appear_under_on_this_mac_and_open_the_install_sheet(existing snapshots unchanged).Merge Danger
Low-to-medium. Adds SQLite tables/triggers (
search_items,search_fts,memory_index,memory_fts) with an idempotent one-time backfill onStore::openwhensearch_itemsdoes not yet exist; no existing table schema is altered or dropped, so rollback is safe.searchpreserves its exact wire format and semantics.Device decision
search_memory: Allowed for paired Devices (ALLOWED_OVER_LAN), matchingsearch,list_memory, andread_memory.discover_skills: Refused (forbidden) for paired Devices (REFUSED_OVER_LAN), matchingpreview_skillandinstall_skill— scanning local Mac folders is restricted to Bate's own window on this Mac.