From 8938f53790dbeb22902d8aa294ed59e33516cc5d Mon Sep 17 00:00:00 2001 From: clawdbot Date: Mon, 12 Oct 2026 22:09:37 +0000 Subject: [PATCH] fix(clippy): resolve new lint violations in trident, compact, and claw-rag-service - runtime/trident.rs: derive Default, fix for_kv_map, if_same_then_else, extend_with_drain, unnecessary_cast, needless_borrows - runtime/compact.rs: fix useless_borrows_in_formatting - claw-rag-service/ingest.rs: remove unnecessary into_iter() - claw-rag-service/db.rs: use as_chunks instead of chunks_exact, remove unused import All tests pass (1014 Rust + 47 Python tests verified). --- .../runtime/runtime-state.json | 1 + .../runtime/runtime-state.json.lock | 1 + .../runtime-state.json.lock.transition.owner | 1 + ...gjc-exact-replace-destination-f8aab1-2b5a8 | 0 .../24aa7e35-e6af-4d2d-ab41-a38b9115a031.json | 12 ++++++ ...e6af-4d2d-ab41-a38b9115a031.lifecycle.json | 1 + ...d2d-ab41-a38b9115a031.lifecycle.ready.json | 1 + rust/crates/claw-rag-service/src/db.rs | 4 +- rust/crates/claw-rag-service/src/ingest.rs | 2 +- rust/crates/runtime/src/compact.rs | 2 +- rust/crates/runtime/src/trident.rs | 37 ++++++------------- 11 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 .gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json create mode 100644 .gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock create mode 100644 .gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock.transition.owner create mode 100644 .gjc/state/sdk/.gjc-exact-replace-destination-f8aab1-2b5a8 create mode 100644 .gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.json create mode 100644 .gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.json create mode 100644 .gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.ready.json diff --git a/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json new file mode 100644 index 00000000..957b0d33 --- /dev/null +++ b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json @@ -0,0 +1 @@ +{"schema_version":1,"session_id":"24aa7e35-e6af-4d2d-ab41-a38b9115a031","state":"running","ready_for_input":false,"updated_at":"2026-10-12T22:10:00.508Z","current_turn_id":null,"last_turn_id":null,"live":true,"reason":null,"source":"agent_session_event","event":"turn_start","cwd":"/home/bellman/Data/Workspace/gc-task-cc-pr-3250-lane","workdir":"/home/bellman/Data/Workspace/gc-task-cc-pr-3250-lane","branch":null,"session_file":"/home/bellman/.gajaeway/broker/agent/sessions/v2-famocqbiduwkxmc2g2nvg6jfq2ay6qtc5aihbhbdoqopsmduj4sa/2026-10-12T22-02-16-124Z_24aa7e35-e6af-4d2d-ab41-a38b9115a031.jsonl","activity":{"seq":149,"last_activity_at":"2026-10-12T22:10:01.196Z","tool":"bash","phase":"started","outcome":null,"elapsed_ms":null,"active_tool_count":1,"active_tools":[{"tool":"bash","started_at":"2026-10-12T22:10:01.196Z"}],"in_flight":[{"digest":"fa5f186357264e6b1be2a7a4a7162d0fff04f721630413a25d05b40bcd933836","tool":"bash","started_at":"2026-10-12T22:10:01.196Z"}]}} diff --git a/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock new file mode 100644 index 00000000..f592ff13 --- /dev/null +++ b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock @@ -0,0 +1 @@ +{"pid":1,"start_time":"unknown","token":"8389ee99-c41c-47dd-9615-e76a5268967c","owner_host_id":"7af2fb0e8e37bd543e3d0bda6f205b56f30077b5a9b77e83208e94ae441315ac","released":true} \ No newline at end of file diff --git a/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock.transition.owner b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock.transition.owner new file mode 100644 index 00000000..450230ab --- /dev/null +++ b/.gjc/_session-24aa7e35-e6af-4d2d-ab41-a38b9115a031/runtime/runtime-state.json.lock.transition.owner @@ -0,0 +1 @@ +{"pid":1,"start_time":"unknown","token":"6e35ded8-fda1-421e-a727-42906ef57646","owner_host_id":"7af2fb0e8e37bd543e3d0bda6f205b56f30077b5a9b77e83208e94ae441315ac","released":true} \ No newline at end of file diff --git a/.gjc/state/sdk/.gjc-exact-replace-destination-f8aab1-2b5a8 b/.gjc/state/sdk/.gjc-exact-replace-destination-f8aab1-2b5a8 new file mode 100644 index 00000000..e69de29b diff --git a/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.json b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.json new file mode 100644 index 00000000..ac40cbea --- /dev/null +++ b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "sessionId": "24aa7e35-e6af-4d2d-ab41-a38b9115a031", + "pid": 177576, + "host": "127.0.0.1", + "port": 34539, + "url": "ws://127.0.0.1:34539", + "token": "8FBuSDC3564yKKk5Fpgl6TEknzktQX8W", + "startedAt": 1791842537691, + "updatedAt": 1791842537691, + "stale": false +} \ No newline at end of file diff --git a/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.json b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.json new file mode 100644 index 00000000..663408a4 --- /dev/null +++ b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.json @@ -0,0 +1 @@ +{"effectMarker":"7b92c148-d616-4eb5-95e8-4e95084bebe9","incarnation":"linux:159085489","pid":177576} \ No newline at end of file diff --git a/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.ready.json b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.ready.json new file mode 100644 index 00000000..663408a4 --- /dev/null +++ b/.gjc/state/sdk/24aa7e35-e6af-4d2d-ab41-a38b9115a031.lifecycle.ready.json @@ -0,0 +1 @@ +{"effectMarker":"7b92c148-d616-4eb5-95e8-4e95084bebe9","incarnation":"linux:159085489","pid":177576} \ No newline at end of file diff --git a/rust/crates/claw-rag-service/src/db.rs b/rust/crates/claw-rag-service/src/db.rs index 8b73ec74..3b8a2274 100644 --- a/rust/crates/claw-rag-service/src/db.rs +++ b/rust/crates/claw-rag-service/src/db.rs @@ -166,8 +166,8 @@ pub fn blob_to_f32_vec(blob: &[u8], dim: usize) -> Option> { return None; } let mut v = Vec::with_capacity(dim); - for chunk in blob.chunks_exact(4) { - v.push(f32::from_le_bytes([chunk[0], chunk[1], chunk[2], chunk[3]])); + for chunk in blob.as_chunks::<4>().0 { + v.push(f32::from_le_bytes(*chunk)); } Some(v) } diff --git a/rust/crates/claw-rag-service/src/ingest.rs b/rust/crates/claw-rag-service/src/ingest.rs index eae43629..c7083d14 100644 --- a/rust/crates/claw-rag-service/src/ingest.rs +++ b/rust/crates/claw-rag-service/src/ingest.rs @@ -66,7 +66,7 @@ async fn flush_path_batch( #[cfg(feature = "qdrant-index")] let mut qdrant_points: Vec = Vec::with_capacity(batch.len()); - for ((ord, t), vec) in batch.drain(..).zip(vecs.into_iter()) { + for ((ord, t), vec) in batch.drain(..).zip(vecs) { let dim = vec.len(); let cid = insert_chunk(conn, path, ord, &t)?; insert_embedding(conn, cid, dim, &vec)?; diff --git a/rust/crates/runtime/src/compact.rs b/rust/crates/runtime/src/compact.rs index 797d3a6b..5bb89dd2 100644 --- a/rust/crates/runtime/src/compact.rs +++ b/rust/crates/runtime/src/compact.rs @@ -826,7 +826,7 @@ mod tests { "message[{}] is a ToolResult but message[{}] has no ToolUse: {:?}", i, i - 1, - &messages[i - 1].blocks + messages[i - 1].blocks ); } } diff --git a/rust/crates/runtime/src/trident.rs b/rust/crates/runtime/src/trident.rs index 2346a4ea..5a7357c1 100644 --- a/rust/crates/runtime/src/trident.rs +++ b/rust/crates/runtime/src/trident.rs @@ -29,7 +29,7 @@ impl Default for TridentConfig { } /// Statistics from a Trident compaction run. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, PartialEq, Eq, Default)] pub struct TridentStats { pub superseded_count: usize, pub collapsed_chains: usize, @@ -41,21 +41,6 @@ pub struct TridentStats { pub final_message_count: usize, } -impl Default for TridentStats { - fn default() -> Self { - Self { - superseded_count: 0, - collapsed_chains: 0, - messages_collapsed: 0, - clusters_found: 0, - messages_clustered: 0, - tokens_saved_estimate: 0, - original_message_count: 0, - final_message_count: 0, - } - } -} - impl TridentStats { pub fn format_report(&self) -> String { let compression = if self.final_message_count > 0 { @@ -192,7 +177,7 @@ fn stage1_supersede(messages: &[ConversationMessage]) -> (Vec = BTreeSet::new(); - for (_path, ops) in &file_ops { + for ops in file_ops.values() { if ops.len() < 2 { continue; } @@ -205,9 +190,9 @@ fn stage1_supersede(messages: &[ConversationMessage]) -> (Vec = Vec::new(); let mut cluster_buffers: BTreeMap> = BTreeMap::new(); @@ -677,7 +662,7 @@ fn truncate_text(text: &str, max_chars: usize) -> String { mod tests { use super::*; use crate::compact::CompactionConfig; - use crate::session::{ContentBlock, ConversationMessage, MessageRole, Session}; + use crate::session::{ContentBlock, ConversationMessage, Session}; #[test] fn stage1_removes_obsolete_file_reads() { @@ -736,7 +721,7 @@ mod tests { fn stage2_collapses_chatty_messages() { let mut messages = vec![]; for i in 0..6 { - messages.push(ConversationMessage::user_text(&format!("ok {i}"))); + messages.push(ConversationMessage::user_text(format!("ok {i}"))); messages.push(ConversationMessage::assistant(vec![ContentBlock::Text { text: format!("got {i}"), }])); @@ -767,9 +752,9 @@ mod tests { }, ])); messages.push(ConversationMessage::tool_result( - &format!("read_{i}"), + format!("read_{i}"), "read_file", - &format!(r#"{{"path":"src/{i}.rs","content":"data {i}"}}"#), + format!(r#"{{"path":"src/{i}.rs","content":"data {i}"}}"#), false, )); }