Skip to content

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

Comment 1, line 1

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

//! ZCode edge-case tests with nine datasets explicitly marked synthetic in paths and headers.

Comment 2, line 2

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

//! Manual expectations are referenced by each dataset's _expectations.md.

Comment 3, line 3

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

//!

Comment 4, line 4

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

//! Calculations: AI SDK {in,out,total,cr,cw}; Anthropic {in,out,cr,optional cw}.

Comment 5, line 5

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

//! - cache-write: {2000,100,2100,800,200} and Anthropic {1000,100,800,200}.

Comment 6, line 6

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

//! 1000+800+200=2000; views agree, no diagnostics, uncached=2000-800-200=1000.

Comment 7, line 7

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

//! Summary: input=2000, out=100, cr=800, cw=Some(200), total=2100.

Comment 8, line 8

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:8

//! - dual-fallback: record 1 lacks SDK usage; use Anthropic {200,50,800,100}

Comment 9, line 9

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:9

//! alone, deriving total input 1100 with reported uncached 200 and no source total.

Comment 10, line 10

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:10

//! Record 2 has SDK {1000,100,1100,400,0} without the comparison view.

Comment 11, line 11

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:11

//! Summary: input=2100, out=150, cr=1200, cw=Some(100), total=2250; one missing-SDK diagnostic.

Comment 12, line 12

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:12

//! - dual-mismatch: SDK input 1000 differs from Anthropic 999+400+0=1399.

Comment 13, line 13

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:13

//! Keep SDK input=1000, total/source=1100 and one dual_caliber_mismatch diagnostic.

Comment 14, line 14

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

//! - epoch-timestamps: completedAt 1800000000000 milliseconds and 1800000000 seconds

Comment 15, line 15

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:15

//! both map to occurred_at_ms=1,800,000,000,000 (2027-01-15 UTC).

Comment 16, line 16

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:16

//! Summary: input=1500, out=150, cr=400, cw=Some(0), total=1650.

Comment 17, line 17

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:17

//! - future-version: unregistered 9.9.9 uses latest_fallback; valid structure is counted

Comment 18, line 18

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:18

//! with active_compat. Summary: input=3000, out=300, cr=1200, total=3300.

Comment 19, line 19

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:19

//! - missing-request-id: use seq:syn-sess-1:1 and diagnose missing_request_id.

Comment 20, line 20

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:20

//! Summary: input=1000, total=1100.

Comment 21, line 21

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:21

//! - negative-usage: inputTokens=-5 skips that record, diagnoses usage_shape_deviation,

Comment 22, line 22

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:22

//! and degrades the file; the valid record still contributes input=1000, total=1100.

Comment 23, line 23

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:23

//! - no-usage: unfinished finishReason=null has no usage and produces no event/error.

Comment 24, line 24

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:24

//! Summary: input=1000, total=1100, with zero diagnostics.

Comment 25, line 25

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:25

//! - undocumented-type: second record type=other_event rejects the scan;

Comment 26, line 26

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:26

//! discard events, retain the cursor, and reject again on the next scan.

Comment 27, line 73

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:73

// Native samples have cw=0; this synthetic case has cw/cache_creation=200.

Comment 28, line 74

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:74

// Both usage views agree: 1000+800+200=2000, with zero diagnostics.

Comment 29, line 124

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

// Record 1 uses only Anthropic: derived input_total=1100,

Comment 30, line 125

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:125

// reported uncached=200, source_total=None because that view lacks totalTokens.

Comment 31, line 140

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:140

// Record 2 uses SDK usage without a comparison view; source_total=1100.

Comment 32, line 184

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:184

// Usage-view disagreement is a comparison diagnostic; the valid file stays active.

Comment 33, line 199

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:199

// 1800000000000 milliseconds equals 1800000000 seconds after conversion below 1e11.

Comment 34, line 231

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:231

// Valid structure imports both records (added=2); version compatibility remains unverified.

Comment 35, line 440

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:440

// A second scan rejects the same shape and adds one diagnostic for that scan.

Comment 36, line 487

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:487

// type=model_io without required sessionId identity is rejected.

Comment 37, line 506

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:506

// Native sample header 3.14.3 selects registered KnownVersion.

Comment 38, line 524

desktop/src-tauri/crates/core/tests/zcode_gaps_synthetic.rs:524

// Synthetic unregistered 9.9.9 selects a LatestFallback compatibility attempt.