> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorpro.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.



## OpenAPI

````yaml post /api/v1/memory/confirm
openapi: 3.1.0
info:
  title: EDN Memory Engine
  version: 0.1.0
servers:
  - description: EDN evaluation endpoint
    url: https://api.tensorpro.ai
security:
  - EDNApiKey: []
paths:
  /api/v1/memory/confirm:
    post:
      summary: Confirm Memory Record
      description: >-
        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.
      operationId: confirm_memory_record_api_v1_memory_confirm_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConfirmRecordRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConfirmResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ConfirmRecordRequest:
      properties:
        record_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Record Id
      title: ConfirmRecordRequest
      type: object
    ConfirmResponse:
      properties:
        provenance:
          title: Provenance
          type: string
        record_id:
          title: Record Id
          type: string
        status:
          title: Status
          type: string
        supersedes_memory_id:
          title: Supersedes Memory Id
          type: string
      required:
        - status
        - record_id
        - supersedes_memory_id
        - provenance
      title: ConfirmResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    EDNApiKey:
      description: >-
        EDN API key presented as 'Bearer <key>' in the Authorization header.
        Create and manage keys from the Console.
      in: header
      name: Authorization
      type: apiKey

````