Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions crates/chat4n6-plugin-api/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,17 @@ pub enum ForensicWarning {
SelectiveDeletion { suspect_jid: String, deletion_rate_pct: u8 },
/// Timestamp order violated: a later ROWID has an earlier timestamp.
TimestampAnomaly { message_row_id: i64, description: String },
/// The message timestamp distribution is implausible in bulk — a large share
/// of messages predate the app's existence. A property of the whole set,
/// which no per-message check can express.
TimestampDistributionAnomaly {
total_messages: u32,
implausible_count: u32,
ratio_pct: u8,
/// The most frequent implausible instant, and how often it occurs.
modal_utc: DateTime<Utc>,
modal_occurrences: u32,
},
/// Backup crypt14/15 HMAC does not match payload — file may have been tampered.
HmacMismatch,
/// PRAGMA user_version inconsistent with claimed app version.
Expand Down Expand Up @@ -382,6 +393,11 @@ impl fmt::Display for ForensicWarning {
Self::TimestampAnomaly { message_row_id, description } => {
write!(f, "Timestamp anomaly at row {message_row_id}: {description}")
}
Self::TimestampDistributionAnomaly {
total_messages, implausible_count, ratio_pct, modal_utc, modal_occurrences
} => {
write!(f, "Implausible timestamp distribution: {implausible_count} of {total_messages} messages ({ratio_pct}%) predate 2009-01-01; most frequent is {modal_utc} ({modal_occurrences}×)")
}
Self::HmacMismatch => write!(f, "HMAC mismatch — backup integrity check FAILED"),
Self::SchemaVersionMismatch { db_version, app_version } => {
write!(f, "Schema v{db_version} incompatible with app version {app_version}")
Expand Down
1 change: 1 addition & 0 deletions crates/plugins/chat4n6-whatsapp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ regex = "1"
base64 = { workspace = true }

[dev-dependencies]
chat4n6-fs = { path = "../../chat4n6-fs", version = "0.1" }
tempfile = "3"
rusqlite = { version = "0.31", features = ["backup"] }
proptest = "1"
Loading
Loading