Purpose
-------
Unit tests for :mod:`oct.git.audit` — the rotating JSONL audit logger
and the :func:`audited` decorator for Phase 4B ``oct git`` commands
(G-B5 / G-B6).
Responsibilities
----------------
- Verify :class:`AuditRecord` serialises to JSONL as one-object-per-line.
- Verify the size-rotation threshold is honoured: the very first write
that lifts a file at/above :data:`AUDIT_MAX_SIZE_BYTES` goes into a
fresh file.
- Verify the count-rotation threshold: no more than
:data:`AUDIT_MAX_FILES` files live in ``logs/`` at once.
- Verify credential redaction applies to every ``args`` entry.
- Verify :func:`audited` writes a row on both success and exception,
never swallows exceptions from the wrapped function, and records
``duration_ms`` monotonically.
Diagnostics
-----------
Domain: GIT-TESTS
Levels:
L2 — test lifecycle
L3 — assertion details
L4 — deep tracing
Contracts
---------
- No real git subprocess, no real Click group — the decorator is tested
against a minimal SimpleNamespace stand-in for ``ctx``.
- Every test uses a ``tmp_path`` subdirectory as its project root so
the real ``logs/`` directory is never touched.