Weave documentation
Rust referenceweave-compliance

weave-compliance · audit

Source declarations, signatures and documentation for audit.

Reviewed implementation boundary: The compliance module contains prototype/placeholder behavior. Production in a type name does not establish implemented audit integrity, verified signatures, governance encryption, regulatory submission, or a compliance certification. Read /libraries/weave-compliance/overview and the corresponding task guide for current boundaries.

Source: sigil/weave/libs/weave-compliance/src/audit.rs. SHA-256: 6b98bd3e2fcad8562d6e785f02593ec5f75d97c6248db2e65b86e8817b7708eb.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

audit::AuditEventId

Unique audit event id

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct AuditEventId(pub String);

Source line: 9.

audit::AuditEvent

Audit event model

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuditEvent {
/// event type e.g. "financial_transaction", "data_subject_forgotten"

pub event_type: String,
/// actor string (DID or system)

pub actor: String,
/// target entity

pub target: String,
/// details payload

pub details: serde_json::Value,
/// timestamp

pub timestamp: chrono::DateTime<Utc>,
/// optional compliance context, e.g. "SOX_Section_404"

pub compliance_context: Option<String>
}

Source line: 13.

audit::AuditReportCriteria

Criteria for audit report generation

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuditReportCriteria {
/// requester identity

pub requester: String
}

Source line: 30.

audit::AuditReport

Generated audit report

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AuditReport {
/// report id

pub id: String,
/// criteria used

pub criteria: AuditReportCriteria,
/// number of events analyzed

pub events_analyzed: usize,
/// integrity verified

pub integrity_verified: bool,
/// generated at time

pub generated_at: chrono::DateTime<Utc>,
/// generated by

pub generated_by: String,
/// digital signature placeholder

pub digital_signature: String
}

Source line: 37.

audit::ForgottenResult

Result of GDPR forgetting flow

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ForgottenResult {
/// data subject id processed

pub data_subject_id: String,
/// counts

pub anonymized_events: usize,
/// counts

pub deleted_events: usize,
/// completion timestamp

pub completion_time: chrono::DateTime<Utc>
}

Source line: 56.

audit::AuditTrailManager

Audit trail behavior

#[async_trait::async_trait]
pub trait AuditTrailManager: Send + Sync {
    /// Record a generic event and return its id
    async fn record_audit_event(&self, event: AuditEvent) -> Result<AuditEventId>;
    /// Generate a report over the audit trail
    async fn generate_audit_report(&self, criteria: AuditReportCriteria) -> Result<AuditReport>;
    /// Implement the right to be forgotten
    async fn implement_right_to_be_forgotten(
        &self,
        data_subject_id: &str,
    ) -> Result<ForgottenResult>;
    /// Record specific checks and return an evidence id
    async fn record_gdpr_compliance_check(&self, _op: &crate::DataOperation) -> Result<EvidenceId>;
    /// Record specific checks and return an evidence id
    async fn record_sox_compliance_check(
        &self,
        _fin: &crate::compliance::FinancialOperation,
    ) -> Result<EvidenceId>;
    /// Record specific checks and return an evidence id
    async fn record_ai_governance_check(
        &self,
        _ai: &crate::compliance::AIOperation,
    ) -> Result<EvidenceId>;
}

Source line: 69.

audit::ProductionAuditTrailManager

In-memory production-like audit manager (backends can be swapped later)

pub struct ProductionAuditTrailManager {

}

Source line: 94.

audit::ProductionAuditTrailManager::new

Create a new instance

pub fn new() -> Self;

Source line: 100.

On this page