M-4: define JarvisAPI.Memory protocol + adapter (listRecentFacts/searchFacts/listTurns) #115

Open
opened 2026-05-12 19:37:08 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:37:08 +00:00 (Migrated from github.com)

Goal

Define JarvisAPI.Memory protocol with listRecentFacts, searchFacts, listTurns queries. Implement adapter wrapping MemoryStore. listTurns is also exposed on Turn surface per F-008 — Memory's public spec drops it but substrate-side helper kept.

Scope

  • JarvisAPI.Memory protocol
  • Queries: listRecentFacts, searchFacts, listTurns (substrate)
  • searchFacts returns typed Result<MemoryHits, MemoryError>
  • MemoryHits includes vectorAvailable: Bool flag (R-011)

Files

  • packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory.swift (new)
  • packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory+Adapter.swift (new)

Acceptance

  • Protocol + adapter compile
  • listRecentFacts returns sorted list
  • searchFacts round-trips through both transport modes (non-vector path)

Test

S-MEM-001..003 (queries) green; vector subset gated JARVIS_REAL_MODELS=1.

Parent epic

#8

Source

.planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.5 (M-4.1)
.planning/architecture/JARVIS-API-DESIGN-v0.2.md F-008

## Goal Define JarvisAPI.Memory protocol with listRecentFacts, searchFacts, listTurns queries. Implement adapter wrapping MemoryStore. listTurns is also exposed on Turn surface per F-008 — Memory's public spec drops it but substrate-side helper kept. ## Scope - `JarvisAPI.Memory` protocol - Queries: `listRecentFacts`, `searchFacts`, `listTurns` (substrate) - `searchFacts` returns typed `Result<MemoryHits, MemoryError>` - `MemoryHits` includes `vectorAvailable: Bool` flag (R-011) ## Files - `packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory.swift` (new) - `packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory+Adapter.swift` (new) ## Acceptance - [ ] Protocol + adapter compile - [ ] `listRecentFacts` returns sorted list - [ ] `searchFacts` round-trips through both transport modes (non-vector path) ## Test `S-MEM-001..003` (queries) green; vector subset gated `JARVIS_REAL_MODELS=1`. ## Parent epic #8 ## Source `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.5 (M-4.1) `.planning/architecture/JARVIS-API-DESIGN-v0.2.md` F-008
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#115