WeaveDocs
Weave Compliance

Regulatory

Regulatory reporting from Weave Compliance — generators for GDPR, SOC 2, and jurisdiction-specific submissions.

Purpose

Audit trails, regulatory reports, ethics checks, governance, evidence IDs, and compliance documentation.

This page follows the real source shape for Weave Compliance and explains the workflow a developer is likely to use first.

Developer workflow

Start from the smallest constructor or builder, perform one meaningful operation, inspect the returned state, then add the relevant policy, storage, or network integration. The examples below should be expanded whenever the crate API changes.

Primary types to know

  • AIDecision — libs/weave-compliance/src/ethics.rs
  • AIOperation — libs/weave-compliance/src/compliance.rs
  • ApiDocumentation — libs/weave-compliance/src/docs.rs
  • AuditEvent — libs/weave-compliance/src/audit.rs
  • AuditEventId — libs/weave-compliance/src/audit.rs
  • AuditReport — libs/weave-compliance/src/audit.rs
  • AuditReportCriteria — libs/weave-compliance/src/audit.rs
  • BiasAnalysis — libs/weave-compliance/src/ethics.rs
  • DataAsset — libs/weave-compliance/src/governance.rs
  • DataGovernanceResult — libs/weave-compliance/src/governance.rs
  • DataOperation — libs/weave-compliance/src/lib.rs
  • DataOperationRecord — libs/weave-compliance/src/governance.rs

Example shape

use std::collections::HashMap;
use weave_compliance::regulatory::{
    ProductionRegulatoryReporter, RegulatoryData, RegulatoryReporter, ReportingPeriod,
};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    // ProductionRegulatoryReporter is the default RegulatoryReporter; backends
    // for SOX/GDPR/HIPAA can be substituted by other implementations.
    let reporter = ProductionRegulatoryReporter::new();

    let mut sections = HashMap::new();
    sections.insert(
        "gdpr".into(),
        serde_json::json!({"data_subjects": 12_500, "deletion_requests": 4}),
    );
    let data = RegulatoryData { sections };
    let _gdpr_section = data.extract_gdpr_data()?;

    let report = reporter
        .generate_regulatory_report("GDPR", ReportingPeriod::Quarterly)
        .await?;
    let submission = reporter.submit_regulatory_report(report.clone()).await?;

    println!(
        "regulation={} period={:?} status={} submission={}",
        report.regulation, report.period, report.compliance_status, submission.submission_id,
    );
    Ok(())
}