Files
2026-05-21 14:27:53 +00:00

27 lines
1.0 KiB
Markdown

# Audit Fields
Mutating calls and evidence-producing workflows must carry audit metadata from
the caller through to persisted `audit_events`.
## Required Fields
- `auditId`: stable audit event identifier.
- `traceId`: cross-service trace identifier.
- `actorType`: `user`, `service`, `agent`, `worker`, or `system`.
- `actorId`: stable identity for the actor.
- `action`: dotted action name such as `hardware.operation.requested`.
- `targetType`: resource family affected by the action.
- `targetId`: stable target identifier.
- `serviceId`: frozen HWLAB service ID emitting the event.
- `environment`: `dev` for MVP.
- `occurredAt`: RFC 3339 timestamp.
## Recommended Fields
- `projectId`: project scope for the action.
- `gatewaySessionId`: gateway session participating in the action.
- `workerSessionId`: worker session participating in the action.
- `operationId`: hardware operation connected to the action.
- `outcome`: `accepted`, `succeeded`, `failed`, `rejected`, or `canceled`.
- `reason`: short machine-readable reason for rejection or failure.