M-4: factMutated + factsRetrieved events; delete legacy emit (R-017) #117

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

Goal

Add Memory.factMutated + factsRetrieved events. REPLACE old replay-event emit; do NOT parallel-emit. Preserves R-017 single-emit invariant.

Scope

  • New events: factMutated(op:, factId:), factsRetrieved(count:, query:)
  • DELETE old emit site in MemoryStore.applyOp
  • Critical: do not parallel-emit (Failure Mode 1)

Files

  • packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory+Adapter.swift
  • packages/Memory/Sources/Memory/MemoryStore.swift — DELETE legacy replay emit

Acceptance

  • bash scripts/check-single-memory-mutated-emit.sh green AFTER migration
  • bash scripts/check-single-memory-used-emit.sh green
  • Old emit site DELETED (grep confirms)
  • Behavioral assertion: one fact write = one event + one replay row

Test

S-MEM-005 asserts single-emit invariant.

Parent epic

#8

Source

.planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.5 (M-4.3) + §5.1 Failure Mode 1
.planning/architecture/REVIEW-MIGRATION-RISK.md R-017

## Goal Add Memory.factMutated + factsRetrieved events. REPLACE old replay-event emit; do NOT parallel-emit. Preserves R-017 single-emit invariant. ## Scope - New events: `factMutated(op:, factId:)`, `factsRetrieved(count:, query:)` - DELETE old emit site in `MemoryStore.applyOp` - Critical: do not parallel-emit (Failure Mode 1) ## Files - `packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Memory+Adapter.swift` - `packages/Memory/Sources/Memory/MemoryStore.swift` — DELETE legacy replay emit ## Acceptance - [ ] `bash scripts/check-single-memory-mutated-emit.sh` green AFTER migration - [ ] `bash scripts/check-single-memory-used-emit.sh` green - [ ] Old emit site DELETED (grep confirms) - [ ] Behavioral assertion: one fact write = one event + one replay row ## Test `S-MEM-005` asserts single-emit invariant. ## Parent epic #8 ## Source `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.5 (M-4.3) + §5.1 Failure Mode 1 `.planning/architecture/REVIEW-MIGRATION-RISK.md` R-017
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#117