Skip to content

fix(store): escape forward slashes in FTS5 sanitize and normalize topic_key queries#210

Open
jorgehara wants to merge 4 commits intoGentleman-Programming:mainfrom
jorgehara:fix/fts5-slash-topic-key-search
Open

fix(store): escape forward slashes in FTS5 sanitize and normalize topic_key queries#210
jorgehara wants to merge 4 commits intoGentleman-Programming:mainfrom
jorgehara:fix/fts5-slash-topic-key-search

Conversation

@jorgehara
Copy link
Copy Markdown

Summary

  • Escape / to \/ in sanitizeFTS to prevent FTS5 "malformed query" errors when searching topic keys containing slashes (e.g., sdd/summa-kit/spec)
  • Normalize query through normalizeTopicKey() before the topic_key direct lookup path so human-readable slash-separated queries match stored hyphen-separated topic keys

Changes

File Change
internal/store/store.go Escape / in sanitizeFTS + normalize topic_key queries

Test Plan

  • All existing store tests pass (go test ./internal/store/...)
  • Search tests specifically pass (go test ./internal/store/... -run Search)

Checklist

- Add internal/claudecode package with export/import/sync functionality
- Export Engram observations to Claude Code's native memory folder as .md files
- Import memories from Claude Code's memory folder into Engram
- Add CLI commands: claude-code-export, claude-code-import, claude-code-sync
- Support bidirectional sync between Engram and Claude Code memory
- Allow users who switch between Claude Code native and other agents to have unified memory
- Add lazy bidirectional sync: when mem_search is called, automatically
  import new memories from Claude Code's native memory folder
- Consistent with Engram philosophy: agent-driven, no auto-capture,
  import only on explicit user request (search)
- Add comprehensive tests for Claude Code memory import
- Add documentation explaining the feature and design decisions for Alan

This enables users who switch between Claude Code native and other
agents to have unified memory without manual sync steps.
Add 'engram agents' command that detects and shows usage statistics
for all AI coding agents on the system (Claude Code, Gemini CLI,
OpenCode, Cursor, Codex).

Features:
- Reads native history files from each agent
- Shows sessions, projects, and activity range per agent
- ASCII bar chart visualization for easy comparison
- JSON output for scripting (--json flag)
- Read-only, no data written to Engram store

Consistent with Engram philosophy: simple, agent-driven, no auto-capture.
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.

bug(store): FTS5 search fails with '/' in topic keys like 'sdd/summa-kit/spec'

1 participant