Skip to content

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

Comment 1, line 1

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

//! Regression tests for M8 review fixes (2026-09-29).

Comment 2, line 2

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

//!

Comment 3, line 3

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

//! Each case preserves behavior for a problem identified in review:

Comment 4, line 4

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

//! - copilot: fall back for unknown schemas; diagnose invalid token fields without replacing them with zero.

Comment 5, line 5

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

//! - otel: convert three TTFT fields using their documented units; skip records with out-of-range tokens;

Comment 6, line 6

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

//! span status ERROR maps to error_status. The unlabelled agentlens field has a separate heuristic below.

Comment 7, line 7

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

//! - roo: retain two api_req_started records in the same millisecond; include sequence in the key.

Comment 8, line 8

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

//! - jcode: report truncated journal reads as BudgetExhausted/LineTooLong;

Comment 9, line 9

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

//! retain trailing messages; revise same-timestamp corrections using the session update time.

Comment 10, line 10

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

//! - aider: retain identical lines using line numbers; preserve manual roots with the same parent.

Comment 11, line 11

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

//! - goose: retain valid provider cost with all-NULL tokens; a changed schema fingerprint

Comment 12, line 12

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

//! resets the cursor for a complete reread; reread updated cumulative sessions from old databases.

Comment 13, line 13

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

//! - crush/kiro/zed: resume after SQLite row limits; replace revised Crush cumulative costs;

Comment 14, line 14

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

//! return Pending for an incomplete Kiro SQLite header.

Comment 15, line 15

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

//! - atomcode: count multi-model turn round_count once in an unattributed row;

Comment 16, line 16

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

//! retain calls from rows with rounds and unknown zero-valued tokens.

Comment 17, line 17

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

//! - gajae: version≠5 events retain parse_basis=LatestFallback.

Comment 18, line 18

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

//! - grok: skip out-of-range token rows and record diagnostics.

Comment 19, line 19

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

//! - junie: a usage fingerprint beyond 64 KiB remains Supported; typed logs without it remain Pending.

Comment 20, line 20

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

//! - zed/crush: diagnose and skip individual type errors without stopping the scan.

Comment 21, line 21

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

//! - xum: read the top-level version; do not scan disabled sources selected by per-source tasks.

Comment 22, line 93

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:93

// OTel tests.

Comment 23, line 103

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:103

// copilot_chat.time_to_first_token uses milliseconds: 7298 ms remains 7298,

Comment 24, line 104

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:104

// without guessing that small values use seconds and converting it to 7,298,000 ms.

Comment 25, line 107

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:107

// gen_ai.response.time_to_first_chunk uses seconds, including fractions: 1.5 s becomes 1500 ms.

Comment 26, line 110

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:110

// response.time_to_first_token (agentlens) has no stated unit; use the magnitude heuristic

Comment 27, line 111

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:111

// only for this key: 300 becomes 300000 ms; 15000 remains in milliseconds.

Comment 28, line 134

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:134

// Negative tokens reject the whole record rather than silently omitting the invalid field.

Comment 29, line 137

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:137

// Valid records remain readable.

Comment 30, line 220

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:220

// Roo tests.

Comment 31, line 230

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:230

// Retain the second same-millisecond request, including retries or parallel subtasks.

Comment 32, line 245

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:245

// Jcode tests.

Comment 33, line 269

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:269

// Beyond the hard-coded 100k-line limit, the old implementation reported Complete and permanently missed trailing messages.

Comment 34, line 386

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:386

// Aider tests.

Comment 35, line 393

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:393

// Identical repeated sends (same prompt in the same second) have identical content hashes;

Comment 36, line 394

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:394

// distinguish their keys by line number to preserve both calls.

Comment 37, line 484

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:484

// Goose tests.

Comment 38, line 512

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:512

// All tokens are NULL, but valid provider_reported cost must be retained as reported cost.

Comment 39, line 554

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:554

// A changed schema column set invalidates the old cursor; reread fully with idempotent upserts.

Comment 40, line 614

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:614

// AtomCode tests.

Comment 41, line 648

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:648

// Attribute rounds to the model of a single-model turn.

Comment 42, line 653

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:653

// Keep 3 rounds from a multi-model turn + 2 from a turn without model_usage unattributed.

Comment 43, line 659

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:659

// Rows with rounds and zero tokens retain call counts; tokens remain unknown.

Comment 44, line 663

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:663

// Preserve total call counts: 5 + 5 + 4 = 14 = 3+5+2+4.

Comment 45, line 672

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:672

// gajae-code tests.

Comment 46, line 690

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:690

// The built-in version=5 format uses KnownVersion; this synthetic test checks parser selection.

Comment 47, line 699

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:699

// Unlisted version=6 uses LatestFallback, without claiming KnownVersion.

Comment 48, line 710

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:710

// Grok tests.

Comment 49, line 761

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:761

// Junie tests.

Comment 50, line 768

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:768

// The first 64 KiB contain only an event fingerprint; usage appears later in the file.

Comment 51, line 769

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:769

// The old implementation incorrectly returned UnknownFormat and never imported this session.

Comment 52, line 799

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:799

// Reject files without the Junie format.

Comment 53, line 806

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:806

// Zed/Crush row-level type-error tests.

Comment 54, line 822

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:822

// INTEGER in data causes a String read error; skip that row and continue the scan.

Comment 55, line 862

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:862

// Non-numeric cost text remains TEXT because REAL affinity cannot convert it;

Comment 56, line 863

desktop/src-tauri/crates/core/tests/m8_review_fixes.rs:863

// the f64 read error skips that row without stopping the scan.