跳转到内容

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

第 1 条注释,第 1 行

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

//! ZCode 适配器缺口场景:九个合成 测试数据(目录/文件头均标 synthetic)全覆盖,

第 2 条注释,第 2 行

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

//! 期望值为人工核算(各 测试数据 目录 _expectations.md 指向本文件头部注释)。

第 3 条注释,第 3 行

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

//!(空行)

第 4 条注释,第 4 行

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

//! 手工核算(AI SDK 五键 {in, out, total, cr, cw};anthropic {in, out, cr, cw?}):

第 5 条注释,第 5 行

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

//! - cache-write 数据为 {2000,100,2100,800,200} 和 Anthropic {1000,100,800,200}。

第 6 条注释,第 6 行

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

//! 1000+800+200=2000 ✓ 两个 usage 视图的结果一致,0 诊断;uncached=2000-800-200=1000;

第 7 条注释,第 7 行

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

//! 汇总 input=2000 out=100 cr=800 cw=Some(200) total=2100。

第 8 条注释,第 8 行

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

//! - dual-fallback:rec1 usage 缺席、anthropic{200,50,800,100} 在场 ⇒ 互斥回退

第 9 条注释,第 9 行

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

//! 对照视图(input_total=1100 derived、uncached=200 reported、source_total=None);

第 10 条注释,第 10 行

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

//! rec2 AI SDK{1000,100,1100,400,0} 无对照视图 ⇒ 主视图;

第 11 条注释,第 11 行

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

//! 汇总 input=2100 out=150 cr=1200 cw=Some(100) total=2250;1 条 ai_sdk_usage_missing。

第 12 条注释,第 12 行

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

//! - dual-mismatch:AI SDK in=1000 vs anthropic 999+400+0=1399 ≠ 1000 ⇒ 1 条

第 13 条注释,第 13 行

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

//! dual_caliber_mismatch;AI SDK 主视图保留(input=1000 total=1100 source=1100)。

第 14 条注释,第 14 行

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

//! - epoch-timestamps:completedAt 数字 1800000000000(毫秒)与 1800000000(<1e11

第 15 条注释,第 15 行

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

//! 折算秒)⇒ 两事件 occurred_at_ms 均 1,800,000,000,000(2027-01-15 UTC);

第 16 条注释,第 16 行

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

//! 汇总 input=1500 out=150 cr=400 cw=Some(0) total=1650。

第 17 条注释,第 17 行

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

//! - future-version:9.9.9 未收录 ⇒ latest_fallback 兼容尝试,结构通过 ⇒

第 18 条注释,第 18 行

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

//! active_compat 标记统计;汇总 input=3000 out=300 cr=1200 total=3300。

第 19 条注释,第 19 行

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

//! - missing-request-id:缺 requestId ⇒ seq:syn-sess-1:1 + missing_request_id 诊断;

第 20 条注释,第 20 行

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

//! 汇总 input=1000 total=1100。

第 21 条注释,第 21 行

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

//! - negative-usage:inputTokens=-5 ⇒ usage_shape_deviation、该条跳过、文件 degraded;

第 22 条注释,第 22 行

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

//! 其余正常:input=1000 total=1100。

第 23 条注释,第 23 行

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

//! - no-usage:末条 finishReason=null 无 usage ⇒ 正常形状不产事件不失败;

第 24 条注释,第 24 行

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

//! input=1000 total=1100,0 诊断。

第 25 条注释,第 25 行

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

//! - undocumented-type:第二条 type=other_event ⇒ 扫描层 fail closed:

第 26 条注释,第 26 行

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

//! 事件清空、游标不推进、下轮确定性再拒。

第 27 条注释,第 73 行

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

// 真实样本全 cw=0;本合成场景 cw=200 且 anthropic cache_creation=200 在场,

第 28 条注释,第 74 行

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

// 两个 usage 视图的结果一致(1000+800+200=2000),0 诊断。

第 29 条注释,第 124 行

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

// rec1(回退 anthropic 对照视图):input_total=1100(derived)、

第 30 条注释,第 125 行

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

// uncached=200(reported)、source_total=None(对照视图无 totalTokens)。

第 31 条注释,第 140 行

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

// rec2(AI SDK 主视图无对照视图):source_total=1100。

第 32 条注释,第 184 行

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

// 矛盾是对照结论,不是形状损坏:文件保持 active。

第 33 条注释,第 199 行

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

// 毫秒值 1800000000000 与秒值 1800000000(<1e11 折算)⇒ 同一毫秒。

第 34 条注释,第 231 行

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

// 结构通过 ⇒ 数据照常统计(added=2),版本兼容性未验证单独标记。

第 35 条注释,第 440 行

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

// 二次扫描:确定性再拒,诊断每轮一条。

第 36 条注释,第 487 行

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

// type=model_io 但缺 sessionId 身份字段:fail closed。

第 37 条注释,第 506 行

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

// 已收录 3.14.3(真实 测试数据 首行)⇒ KnownVersion。

第 38 条注释,第 524 行

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

// 未收录 9.9.9(synthetic-future-version 首行)⇒ LatestFallback 兼容尝试。