enqueueDetailed

suspend fun enqueueDetailed(type: String, payloadJson: String, stableEventId: String? = null, idempotencyKeyOverride: String? = null, userId: String? = null): EnqueueResult

Enqueue an event through the v0.5.0 pipeline:

  1. Size guardrail

  2. Legacy denylist (fast-path, deprecated)

  3. Event Validation (JsonSchemaValidator)

  4. PII Detection -> REJECT / REDACT / FLAG_AND_ALLOW

  5. Anomaly Detection (statistical + optional ML)

  6. Data Classification tagging

  7. Field-Level Encryption (specified JSON paths)

  8. Queue Pressure check

  9. Idempotency Key

  10. Document Encryption (PayloadCodec -> AES-256-GCM)

  11. Room Insert (with userId, dataClassification, anomalyScore)

  12. Audit Record (PersistentAuditTrail)

Threading: Main-safe. Database and crypto IO dispatched internally.

Since

0.5.0 userId parameter, pipeline steps 3-7 added

Parameters

userId

Optional user identifier for GDPR data subject tracking.