Skip to content

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs

Comment 1, line 1

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:1

//! Kilo missing/invalid-data tests: every kilo.db here is synthetic.

Comment 2, line 2

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:2

//! Schema DDL comes from real samples; token values are calculated manually.

Comment 3, line 3

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:3

//!

Comment 4, line 4

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:4

//! Covers assistant messages without usage, unknown session.version latest_fallback,

Comment 5, line 5

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:5

//! valid rows alongside bad JSON/orphan messages and reported/derived-total mismatch.

Comment 6, line 6

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:6

//! Reject session_message-only databases lacking message;

Comment 7, line 7

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:7

//! retain earlier results with a busy writer under read-only requirement 4.

Comment 8, line 14

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:14

/// Synthetic message baseline: epoch milliseconds, 2026-07-02T13:46:40Z.

Comment 9, line 100

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:100

// syn-a-1: assistant without tokens counts one call with unknown token fields.

Comment 10, line 124

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:124

// quality_bucket=unknown counts the call but has no known fields or unknown-field denominators.

Comment 11, line 144

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:144

// Unregistered session.version=9.9.9 uses latest_fallback and retains compatibility status.

Comment 12, line 189

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:189

// syn-good is valid; syn-bad has invalid data JSON and receives diagnostics.

Comment 13, line 190

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:190

// syn-orphan references a missing session; LEFT JOIN still counts the call with no_snapshot.

Comment 14, line 216

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:216

// Write syn-bad data as invalid JSON text directly, bypassing sanitized-data serialization.

Comment 15, line 297

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:297

// Retain two events, good and orphan, while diagnosing the bad row.

Comment 16, line 308

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:308

// The orphan counts as a call and has no_snapshot reconciliation.

Comment 17, line 329

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:329

// Unassigned bad JSON leaves 255 as a valid-row subtotal, not a complete total to compare with snapshot 286.

Comment 18, line 348

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:348

// Reported total 999 differs from derived 255; diagnose source_total_mismatch without clipping.

Comment 19, line 383

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:383

// session_message without message is unknown_format and is not read as a supported format.

Comment 20, line 423

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:423

// Read-only requirement 4: an exclusive rollback-journal writer blocks a consistent read.

Comment 21, line 424

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:424

// Staging backup also fails to acquire the lock; the source time limit interrupts, retaining results/cursor.

Comment 22, line 451

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:451

// Another connection holds EXCLUSIVE; neither the short read nor staging backup can read consistently.

Comment 23, line 490

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:490

// Retain old totals and history, without replacing them with zero.

Comment 24, line 502

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:502

// Collection resumes after the lock is released.

Comment 25, line 505

desktop/src-tauri/crates/core/tests/kilo_gaps_synthetic.rs:505

// Remove staging copies after use; this process leaves none in the system temporary directory.