1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
//! Local uses and insights module
//!
//! This module provides privacy-respecting behavioral capture for sqry,
//! enabling users to understand their own usage patterns and share
//! anonymous insights if they choose to.
//!
//! # Architecture
//!
//! ```text
//! sqry operations ──▶ UsesCollector ──▶ Daily JSONL files
//! (fire-and-forget) │
//! ▼
//! DiagnosticsAggregator ◀─┘
//! │
//! ▼
//! Weekly summaries + Insights reports
//! ```
//!
//! # Privacy Guarantees
//!
//! All data is local-first:
//! - Events capture behavioral patterns, never code content
//! - All fields are strongly-typed enums (no arbitrary strings)
//! - Sharing is always explicit and requires confirmation
//! - Users can disable entirely via config or environment
//!
//! # Feature Gating
//!
//! This module is gated behind the `uses` feature flag. The hierarchy is:
//! - `uses`: Local uses recording
//! - `insights`: Local summaries and reports (requires `uses`)
//! - `troubleshoot`: Support bundle generation (requires `insights`)
//!
//! Build with `--no-default-features` to produce a binary with no collection code.
//!
//! # Usage
//!
//! ```rust,ignore
//! use sqry_core::uses::{UseEvent, UseEventType, QueryKind, DiagnosticsAggregator};
//!
//! // Record an event (fire-and-forget)
//! let event = UseEvent::new(UseEventType::QueryExecuted {
//! kind: QueryKind::CallChain,
//! result_count: 42,
//! });
//! collector.record(event);
//!
//! // Get weekly insights
//! let aggregator = DiagnosticsAggregator::new(&uses_dir);
//! let summary = aggregator.summarize_week("2025-W50")?;
//! ```
// Core uses modules
// Insights module (aggregator)
// Feature-gated submodules
// Re-export all types from the types module
pub use *;
// Re-export collector, config, and storage
pub use ;
pub use ;
pub use ;
// Feature-gated re-exports
pub use ;
pub use generate_bundle;
pub use ;