//! Community corpus contribution module for Aphoria.
//!
//! Enables opt-in anonymous contribution of scan patterns to a central corpus,
//! allowing community consensus to adjust default thresholds.
//!
//! # Privacy Model
//!
//! The anonymization pipeline strips all identifying information:
//! - Project names are wildcarded: `code://rust/myapp/tls` → `code://rust/*/tls`
//! - File paths, line numbers, and matched text are NOT included in the anon_hash
//! - Timestamps are rounded to the nearest hour for k-anonymity
//! - Server receives project_hash (not project_id) to prevent name leakage
//!
//! # User Journey
//!
//! ```text
//! [opt-in: [community] enabled=true]
//!    → [scan extracts claims]
//!    → [filter by community.exclude]
//!    → [anonymize: wildcard project path, strip file/line/text, rehash]
//!    → [push to POST /v1/aphoria/community/observations]
//!    → [server aggregates by (subject, predicate, value)]
//!    → [GET /v1/aphoria/patterns returns high-confidence patterns]
//! ```

mod anonymizer;
mod extractor_loader;
mod pattern_syncer;
mod types;

pub use anonymizer::{anonymize_claim, compute_anon_hash, wildcard_project_path};
pub use extractor_loader::CommunityExtractorLoader;
pub use pattern_syncer::{compute_pattern_hash, PatternSyncer};
pub use types::{
    AnonymizedObservation, CommunityClaimDef, CommunityExtractor, CommunityExtractorProvenance,
    CommunityObjectValue, PatternAggregate, SharedClaimTemplate, SharedPattern,
};
