Overview
Audit record produced by any component and consumed by AuditLog. Provides a tamper-evident trail of all significant platform events. Defined in src/domain/__init__.py.
Contract
Consumers
- AuditLog
- IAuditRepository
Types
| Name | Base | Constraints / Values | Description |
|---|---|---|---|
| AuditEvent | dataclass | — | Immutable audit record appended by any component for compliance and traceability. |
Documents
AuditEvent Data Contract
Audit record produced by any platform component and persisted by AuditLogEventHistory.
Every domain event that flows through the EventBus is wrapped in an AuditEvent for immutable logging.
Source: src/domain/__init__.py — @dataclass class AuditEvent
Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
event_type |
str |
✓ | — | Event category (e.g. "ORDER_CREATED", "EXECUTION_FILLED", "RISK_REJECTED") |
source_component |
str |
✓ | — | Name of the component that produced the event |
payload |
dict |
✓ | — | Serialized domain object (e.g. serialized Order, Execution, Signal) |
timestamp |
datetime |
now() |
UTC timestamp of the audit record | |
audit_id |
str |
uuid4() |
Unique audit record identifier |
Event Types
event_type |
Source Component | Payload Type |
|---|---|---|
ORDER_CREATED |
OrderManagementSystem |
Order |
ORDER_CANCELLED |
OrderManagementSystem |
Order |
EXECUTION_FILLED |
ExecutionSimulator |
Execution |
RISK_APPROVED |
RiskManagementEngine |
RiskDecision |
RISK_REJECTED |
RiskManagementEngine |
RiskDecision |
SIGNAL_GENERATED |
StrategyEngine |
Signal |
POSITION_UPDATED |
PositionManager |
Position |
Consumers
| Component | Usage |
|---|---|
AuditLogEventHistory |
Persists every AuditEvent to immutable append-only storage |
Notes
AuditEventis immutable once written — no updates or deletespayloadis a serialized dict (JSON-compatible) of the originating domain objectaudit_idprovides a globally unique handle for each audit record- The audit log is the authoritative source of truth for all platform activity