Wrap an audit log port so missing actor, tenant, requestId, and
traceId fields are filled from the ambient request context at record time.
The server keeps the ambient context current for requests (including
identity elevated by hooks) and for service contexts created for jobs,
listeners, schedules, and tasks. Because enrichment happens when
record(...) runs, the wrapper also works for ports rebuilt per
transaction inside a unit of work — wrap both the top-level audit port and
the per-transaction rebuild.
Fields provided on the entry always win; only missing fields are filled.
When no ambient context is active (for example on runtimes without
AsyncLocalStorage propagation), entries pass through unchanged.
Underlying audit log port to write enriched entries to.
An audit log port that fills missing context fields before writing.
Ambient audit enrichment for app audit ports.