跳转到内容

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

第 1 条注释,第 1 行

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

//! oh-my-pi(omp)适配器缺口场景:合成样本(目录/文件头均标 synthetic)与

第 2 条注释,第 2 行

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

//! V17/V30 版本策略。覆盖缺少真实样本的场景:四类辅助用量记录、无 usage 的

第 3 条注释,第 3 行

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

//! assistant、fork 继承去重(与 pi 有相同的已知差异)、嵌套子 Agent 路径归属、

第 4 条注释,第 4 行

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

//! stopReason=error/aborted、cost 映射、detect 首行检查(title/session/Pending)、

第 5 条注释,第 5 行

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

//! 未知版本 latest_fallback 兼容回退(V30 规则,omp 没有已确认不兼容格式的

第 6 条注释,第 6 行

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

//! 分支,与 pi 不同)、未知格式 fail closed、未知条目类型诊断。

第 7 条注释,第 7 行

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

//! 期望值由测试数据手工核算;见各 _expectations.md。

第 8 条注释,第 32 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:32

// 手工核算值(synthetic-auxiliary-carriers,9 行 6 事件):

第 9 条注释,第 33 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:33

// primary:syn-a1(100/50/10/5/165)+ syn-a2(无 usage,token 全未知);

第 10 条注释,第 34 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:34

// 辅助调用:syn-u1(0/0/0/1000/1000)、syn-c1(200/100/0/0/300)、

第 11 条注释,第 35 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:35

// 辅助调用续:syn-b1(300/150/0/0/450)、syn-t1(10/5/0/0/15);

第 12 条注释,第 36 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:36

// 合计:call_count=6、input_total=1625(派生)、uncached=610、cache_read=10、

第 13 条注释,第 37 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:37

// 合计续:cache_write=1005、output=305、total=1930;syn-a2 有一条 usage_shape_deviation。

第 14 条注释,第 61 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:61

// syn-a2 无 usage(quality_bucket=unknown):计调用不算未知字段。

第 15 条注释,第 81 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:81

// 逐键核验归属与分类。

第 16 条注释,第 112 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:112

// 无 usage 的 assistant:计调用,token 全未知(不补零)。

第 17 条注释,第 127 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:127

// compaction/branch_summary 无模型字段:按 omp 组合形状 model_change 归属。

第 18 条注释,第 150 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:150

// toolResult 的 usage 是工具执行自身消耗:辅助调用,所属模型未知。

第 19 条注释,第 157 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:157

// omp 特有浮点毫秒取整:syn-a1 duration 200.4→200、ttft 60.6→61;

第 20 条注释,第 158 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:158

// syn-a2 duration 150.5→151、ttft 缺字段 None。

第 21 条注释,第 185 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:185

// 手工核算值(synthetic-fork-inherited):源文件 2 事件(150+300),fork 文件逐字

第 22 条注释,第 186 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:186

// 复制源 L3–L5 + 新 assistant syn-fa-3(15);总调用 3,合计 input_total=350

第 23 条注释,第 187 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:187

// (派生 input+cacheRead+cacheWrite:(100+0+0)+(200+40+0)+(10+0+0))、

第 24 条注释,第 188 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:188

// cache_read=40、output=115、total=465。已知差异见测试数据 _expectations.md。

第 25 条注释,第 201 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:201

// 第一轮只放源文件;第二轮补 fork 文件(两文件各扫一次)。

第 26 条注释,第 227 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:227

// 已知差异与 pi 相同:复制条目四元组相同,但事件 session_id/

第 27 条注释,第 228 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:228

// parent_session_id 取自 fork 会话头,与已存事件同键不同内容,按冲突处理

第 28 条注释,第 229 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:229

// 保留先扫描的事件,不重复计数,并保留来源会话归属。

第 29 条注释,第 241 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:241

// fork 新条目携带 fork 会话身份与 parentSession。

第 30 条注释,第 254 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:254

// 复制条目保留先扫文件(源会话)的归属,并被标记冲突。

第 31 条注释,第 271 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:271

// 手工核算值(synthetic-subagent-nested):主会话 syn-ma-1(10/5/0/0/15)primary;

第 32 条注释,第 272 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:272

// 两层子 Agent Research.jsonl syn-sa-1(100/50/0/0/150)与三层嵌套

第 33 条注释,第 273 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:273

// Research/Research.Compactor.jsonl syn-sa-2(200/60/40/0/300)均 sub_agent,

第 34 条注释,第 274 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:274

// parent 均为最近的 <ts>_<uuid> 祖先目录 d070。合计 call_count=3、

第 35 条注释,第 275 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:275

// input_total=350(派生)、cache_read=40、output=115、total=465、distinct session=3。

第 36 条注释,第 342 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:342

// 手工核算值(synthetic-error-aborted):2 事件均 primary;syn-e-1 error、

第 37 条注释,第 343 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:343

// syn-e-2 aborted(无 duration/ttft)。合计 input_total=25、cache_read=5、

第 38 条注释,第 344 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:344

// 合计续:cache_write=0、output=25、total=50。

第 39 条注释,第 388 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:388

// 手工核算值(synthetic-cost-estimated):syn-c1 cost.total=0.058278 → 58278 micro-USD

第 40 条注释,第 389 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:389

// estimated;syn-c2 cost.total=0 → 不映射。合计 input_total=105、output=55、total=160。

第 41 条注释,第 430 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:430

// 手工核算值(synthetic-detect-supported):首行 title(v=1)、次行 session v3;

第 42 条注释,第 431 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:431

// 5 行 1 事件(syn-a1:100/10/0/0/110,duration 100.4→100、ttft 50.4→50)。

第 43 条注释,第 483 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:483

// omp detect 接受 session 头在前的文件(与 pi 同形;limitations 已记)。

第 44 条注释,第 505 行

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

// 只有 title 而前 4 行内无 session 头:可能仍在首次写入中,下轮重探。

第 45 条注释,第 528 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:528

// 手工核算值(synthetic-unsupported-version,目录名为历史样本组织,V30 起行为

第 46 条注释,第 529 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:529

// 已变):未收录数值版本(version=4)与缺失 version(legacy 形状)都按

第 47 条注释,第 530 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:530

// LatestFallback 回退 session_v3 尝试(omp 旧版落盘格式尚未核验,尚未确认不兼容,

第 48 条注释,第 531 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:531

// 不直接拒绝——与 pi 的 evidenced-incompatible 分支不同)。两文件各 1 事件

第 49 条注释,第 532 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:532

// (100/10/0/0/110):合计 call_count=2、input_total=200(派生)、output=20、

第 50 条注释,第 533 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:533

// total=220;事件 parse_basis=latest_fallback;文件 active_compat;

第 51 条注释,第 534 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:534

// latest_fallback 诊断每文件一条(框架层探测时记)。

第 52 条注释,第 545 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:545

// 未收录数值版本与缺失 version 都回退最新内置解析器并带兼容标记。

第 53 条注释,第 585 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:585

// 兼容尝试成功的数据正常统计。

第 54 条注释,第 592 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:592

// 兼容标记持久化:事件 parse_basis、文件 active_compat、探测结论 JSON。

第 55 条注释,第 618 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:618

// 缺失 version 的 legacy 形状:schema_version 无从得知记 unknown,basis 仍带标记。

第 56 条注释,第 649 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:649

// file_id 排序:d020(version=4)在前,d021(缺失 version)在后。

第 57 条注释,第 655 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:655

// 重复扫描不增量(兼容标记不改变幂等)。

第 58 条注释,第 685 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:685

// 手工核算值(synthetic-unknown-record-type):1 事件(syn-m1:7/3/0/0/10);

第 59 条注释,第 686 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:686

// 未知类型 brand_new_thing 出现 2 次,诊断每文件每类型只记一次。

第 60 条注释,第 704 行

desktop/src-tauri/crates/core/tests/omp_gaps_synthetic.rs:704

// 未知类型不 fail closed:文件状态保持 active。