Skip to main content

MiniChatAuditPluginClientV1

Trait MiniChatAuditPluginClientV1 

Source
pub trait MiniChatAuditPluginClientV1: Send + Sync {
    // Required methods
    fn emit_turn_audit<'life0, 'async_trait>(
        &'life0 self,
        event: TurnAuditEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn emit_turn_retry_audit<'life0, 'async_trait>(
        &'life0 self,
        event: TurnRetryAuditEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn emit_turn_edit_audit<'life0, 'async_trait>(
        &'life0 self,
        event: TurnEditAuditEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn emit_turn_delete_audit<'life0, 'async_trait>(
        &'life0 self,
        event: TurnDeleteAuditEvent,
    ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Plugin API trait for mini-chat audit event publishing.

Plugins implement this trait to receive audit events from the mini-chat module. The mini-chat module discovers plugins via GTS types-registry and dispatches audit events to all registered implementations.

§Caller contract

The caller (mini-chat domain service) MUST redact secret patterns and truncate string content (max 8 KiB per field) before invoking any method on this trait. Plugins MUST assume all content fields are already sanitized. See DESIGN.md “Audit content handling (P1)” for the full redaction rule table.

§Delivery semantics

Audit emission is best-effort (fire-and-forget after DB commit). There is no transactional outbox for audit events. If the process crashes between DB commit and audit emission, the event is lost. Callers SHOULD track emission outcomes via mini_chat_audit_emit_total{result} metrics.

§Independence

When multiple audit plugin instances are registered, each MUST be independent. A failure in one plugin MUST NOT prevent delivery to others.

Required Methods§

Source

fn emit_turn_audit<'life0, 'async_trait>( &'life0 self, event: TurnAuditEvent, ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit a turn audit event (turn completed or failed).

Source

fn emit_turn_retry_audit<'life0, 'async_trait>( &'life0 self, event: TurnRetryAuditEvent, ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit a turn-retry audit event.

Source

fn emit_turn_edit_audit<'life0, 'async_trait>( &'life0 self, event: TurnEditAuditEvent, ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit a turn-edit audit event.

Source

fn emit_turn_delete_audit<'life0, 'async_trait>( &'life0 self, event: TurnDeleteAuditEvent, ) -> Pin<Box<dyn Future<Output = Result<(), MiniChatAuditPluginError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Emit a turn-delete audit event.

Implementors§