luplo.core.audit ================ .. py:module:: luplo.core.audit .. autoapi-nested-parse:: Operations for the audit_log table. Every write operation (create, update, delete, sync, approve) is logged here for compliance traceability. v0.5 is append-only — no query API is exposed yet (queries come in v1.0 with the compliance view). Functions --------- .. autoapisummary:: luplo.core.audit.record_audit Module Contents --------------- .. py:function:: record_audit(conn: psycopg.AsyncConnection[Any], *, actor_id: str, action: str, target_type: str | None = None, target_id: str | None = None, metadata: dict[str, Any] | None = None) -> None :async: Append an entry to the audit log. This is fire-and-forget — it returns nothing. The caller does not need to wait for or inspect the result. :param conn: Async psycopg connection. :param actor_id: Who performed the action. :param action: Action type — ``create``, ``update``, ``delete``, ``sync``, ``approve``, ``reject``, ``login``, etc. :param target_type: Entity type (e.g. ``"item"``, ``"work_unit"``). :param target_id: Entity ID. :param metadata: Optional JSONB payload with extra context.