Fix temporal_next edges: wire link_temporal_next into capture path, fix events_query decryption

- capture.py: call link_temporal_next() after store.insert() in capture_turn()
- retrieve.py: call link_temporal_next() in contradict() for contradict inserts
- qdrant_store.py: events_query() was json.loads() on encrypted data_json,
  losing record_id — pass raw string so query_events() can decrypt it
This commit is contained in:
Apunkt 2026-06-11 12:18:03 +02:00
parent eec312dcb4
commit 344e5edaa8
No known key found for this signature in database
3 changed files with 18 additions and 5 deletions

View file

@ -201,6 +201,13 @@ def capture_turn(
log.exception("capture_turn insert failed")
return {"status": "skipped", "record_id": None, "reason": f"insert-failed: {type(e).__name__}"}
# Wire temporal_next: link this insert to the previous same-session insert.
try:
from iai_mcp.retrieve import link_temporal_next
link_temporal_next(store, rec, session_id=session_id)
except Exception:
pass # diagnostic only; never block the write path.
return {"status": "inserted", "record_id": str(rec.id), "reason": f"tier={tier}"}