Confirm Memory Record
Confirm an inferred/generated record, upgrading it to USER_CONFIRMED.
Append-only supersession: a NEW MemoryRecord is written through the writer
chokepoint with provenance=USER_CONFIRMED and
supersedes_memory_id set to the target, copying the target’s stored
embedding (no re-embed), content_summary, domain, record_type, raw_text and
role. The superseded original is soft-deleted (is_active=False) so the
confirmed record replaces it in browse and retrieval while history is
preserved via the supersession link.
Ordering / atomicity: the original is marked inactive and then
write_memory_record flushes both the new INSERT and the dirty
soft-delete and commits them in a single transaction (the RLS GUC set by
get_db_for_principal has already autobegun it). A failure rolls both
back, so the operation never leaves both records active or both inactive.
Provenance gate: existing_provenance carries the target’s real
provenance so check_provenance_gate sees the true transition (it permits
AI_INFERRED -> USER_CONFIRMED and AI_GENERATED -> USER_CONFIRMED).
Returns 404 (never 403) when the record is missing, already inactive, or owned by another user, so cross-tenant existence is not leaked. Returns 409 when the target’s provenance does not require confirmation (already USER_CONFIRMED, or USER_STATED/DOCUMENT_VERIFIED/ROUND/SYSTEM_DERIVED).
IDOR AUDIT PASS - MemoryRecord.user_id == authenticated user_id is
enforced in the WHERE clause on the lookup; the write inherits user_id
from the principal.
Authorizations
EDN API key presented as 'Bearer ' in the Authorization header. Create and manage keys from the Console.
