Commit Graph

5 Commits

Author SHA1 Message Date
freemo f0a40afecc refactor(audit): implement async audit recording to unblock event pipeline (#1279)
Implements a write-behind queue with a background daemon thread in AuditService so that record() returns immediately without blocking the calling domain operation on a synchronous SQLite INSERT + COMMIT.

Changes:
- AuditService: add _writer_loop(), _write_payload(), flush() methods and a write-behind queue with a background thread
- record() enqueues the payload and returns a placeholder entry with id=-1 in async mode
- close() calls flush() to drain the queue before closing the session
- Settings: add audit_async (default True) and audit_queue_maxsize (default 10000) fields
- 20 BDD scenarios covering non-blocking record(), flush/close lifecycle, ordering, sync fallback, and settings

Closes #718

Co-authored-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
Co-committed-by: Jeffrey Phillips Freeman <the@jeffreyfreeman.me>
2026-04-02 17:00:53 +00:00
brent.edwards 0397a00eb6 test(e2e): add M1 source-code plan lifecycle suite 2026-02-25 04:50:43 +00:00
khyari hamza eeb0d49377 test(security): add coverage for audit CLI, logging, and redaction edge cases
Add 22 new Behave scenarios covering:
- audit CLI commands (list, show, prune, count)
- audit service context manager and owned-session paths
- corrupt JSON details fallback in _row_to_entry
- configure_structlog dev/prod/invalid and get_logger
- redaction edge cases (empty key, empty URL, empty pattern,
  show_secrets bypass, nested dict processor)
2026-02-19 20:10:56 +00:00
khyari hamza 201be39632 fix(security): address review findings for audit logging 2026-02-19 19:23:30 +00:00
khyari hamza ae41167a1d feat(security): add audit logging for apply 2026-02-19 19:23:30 +00:00