Skip to content

audit: bulk/Core/raw DML writes are never audited #557

Closed

Description

@antosubash

Follow-up from #498 (PR #556).

Audit capture runs only on ORM unit-of-work flushes. Three kinds of write skip it with no signal:

  • ORM bulk update()/delete() statements, and Core INSERT/UPDATE/DELETE run through session.execute (listeners.py only marks the session as written; writes.py);
  • raw text() DML;
  • the outbox's own state-change bulk UPDATEs and the task heartbeat UPDATE. These are deliberately excluded bookkeeping, so they only need documenting.

These gaps are listed in docs/modules/audit_log.md.

Options:

  • an audited bulk-write helper that records one entry per statement (filter plus values) inside the same transaction;
  • a strict mode that refuses unaudited statement DML on models that are audited;
  • database-side capture, using triggers, for installs that need full coverage.

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions