Commit graph

5 commits

Author SHA1 Message Date
Viktor Barzin
714fb366d0
fix: remove unused variable to pass ruff lint 2026-03-16 19:45:01 +00:00
Viktor Barzin
e47efee6b6
resilient memory sync: decouple push/pull, startup full resync, auth failure handling
- Decouple push and pull in _sync_once() so pull always runs even if push fails
- Add startup full resync to catch drift from other agents and schema changes
- Add periodic full resync every ~10 minutes for continuous drift correction
- Add auth failure detection (401/403) with graceful SQLite-only degradation
- Add /api/auth-check endpoint for lightweight key validation
- Add retry cap (5 attempts) on pending ops to prevent infinite queue buildup
- Add orphan reconciliation: push local-only records with content dedup
- Add memory_count MCP tool for sync diagnostics
- Add version-based SQLite schema migration (PRAGMA user_version)
- Fix API key in ~/.claude.json to match server
- Update README with sync resilience docs, test structure, project layout
- Add 30 new tests covering all new behaviors (155 total, all passing)
2026-03-16 18:37:59 +00:00
Viktor Barzin
ba9d31f479
fix pre-existing test failures blocking CI
- test_sync: URL-decode before asserting since param (percent-encoded +)
- test_api: already fixed in previous commit (included for completeness)
2026-03-15 22:44:16 +00:00
Viktor Barzin
0a4aed9e1b
fix: resolve ruff lint errors (unused imports and variables) 2026-03-14 13:04:40 +00:00
Viktor Barzin
cd80a67dfa
feat: add local SQLite cache with background sync and HA deployment
- Add SyncEngine for background sync between local SQLite cache and
  remote API with pending_ops queue for offline resilience
- Refactor MCP server to support three modes: SQLite-only, hybrid
  (local cache + sync, new default), and HTTP-only (legacy)
- Add GET /api/memories/sync endpoint for incremental sync
- Change DELETE to soft delete (set deleted_at) for sync support
- Add deleted_at IS NULL filters to all read queries
- Scale API deployment to 2 replicas with pod anti-affinity, PDB,
  and startup probe for high availability
- Add migration 003 for deleted_at column and updated_at index
- Add comprehensive tests for sync engine and API sync endpoint
2026-03-14 12:42:39 +00:00