diff --git a/backend/src/protocol/codec.rs b/backend/src/protocol/codec.rs index f9186a43..bcbe646c 100644 --- a/backend/src/protocol/codec.rs +++ b/backend/src/protocol/codec.rs @@ -22,8 +22,8 @@ // `perf/zero-copy-codec` branch but was never merged because the scatter-gather // I/O implementation was incomplete for TLS connections. -use crate::protocol::{ProtocolError, MAX_MESSAGE_SIZE, MIN_COMPATIBLE_VERSION, PROTOCOL_VERSION}; -use std::io::{Cursor, Read, Write}; +use crate::protocol::{ProtocolError, MIN_COMPATIBLE_VERSION, PROTOCOL_VERSION}; +use std::io::{Cursor, Read}; // --------------------------------------------------------------------------- // FRAME CONSTANTS @@ -35,6 +35,9 @@ pub const FRAME_MAGIC: u32 = 0x544F5446; /// Size of the frame header in bytes. pub const FRAME_HEADER_SIZE: usize = 24; +/// Size of the reserved header field in bytes. +const FRAME_RESERVED_SIZE: usize = 8; + /// Maximum frame payload size (16 MB). pub const FRAME_MAX_PAYLOAD_SIZE: usize = 16 * 1024 * 1024; @@ -129,7 +132,7 @@ impl FrameEncoder { buf.extend_from_slice(&frame.flags.to_be_bytes()); buf.extend_from_slice(&(frame.payload.len() as u32).to_be_bytes()); buf.extend_from_slice(&frame.sequence.to_be_bytes()); - buf.extend_from_slice(&[0u8; 4]); // reserved + buf.extend_from_slice(&[0u8; FRAME_RESERVED_SIZE]); // reserved // Payload buf.extend_from_slice(&frame.payload); @@ -142,7 +145,9 @@ impl FrameEncoder { Ok(buf) } - pub fn encode_stream<'a>(frames: impl Iterator) -> Result, ProtocolError> { + pub fn encode_stream<'a>( + frames: impl Iterator, + ) -> Result, ProtocolError> { let mut buf = Vec::new(); for frame in frames { buf.extend_from_slice(&Self::encode(frame)?); @@ -158,6 +163,7 @@ impl FrameEncoder { pub struct FrameDecoder { buffer: Vec, partial_frame: Option>, + accepted_frames: u64, } impl FrameDecoder { @@ -165,13 +171,33 @@ impl FrameDecoder { Self { buffer: Vec::with_capacity(FRAME_MAX_SIZE), partial_frame: None, + accepted_frames: 0, } } + pub fn accepted_frames(&self) -> u64 { + self.accepted_frames + } + pub fn feed(&mut self, data: &[u8]) { self.buffer.extend_from_slice(data); } + fn discard_until_next_magic(&mut self) { + let magic = FRAME_MAGIC.to_be_bytes(); + if let Some(pos) = self + .buffer + .windows(magic.len()) + .enumerate() + .skip(1) + .find_map(|(idx, window)| (window == magic).then_some(idx)) + { + self.buffer.drain(..pos); + } else { + self.buffer.clear(); + } + } + pub fn decode(&mut self) -> Result, ProtocolError> { if self.buffer.len() < FRAME_HEADER_SIZE { return Ok(None); @@ -181,54 +207,77 @@ impl FrameDecoder { // Read and validate magic let mut magic_bytes = [0u8; 4]; - cursor.read_exact(&mut magic_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut magic_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let magic = u32::from_be_bytes(magic_bytes); if magic != FRAME_MAGIC { - self.buffer.clear(); + self.discard_until_next_magic(); return Err(ProtocolError::InvalidMessage); } // Read version let mut version_bytes = [0u8; 1]; - cursor.read_exact(&mut version_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut version_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let version = version_bytes[0]; if version < MIN_COMPATIBLE_VERSION as u8 || version > PROTOCOL_VERSION as u8 { - self.buffer.clear(); + self.discard_until_next_magic(); return Err(ProtocolError::UnsupportedVersion); } // Read message type let mut type_bytes = [0u8; 1]; - cursor.read_exact(&mut type_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut type_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let message_type = type_bytes[0]; // Read flags let mut flags_bytes = [0u8; 2]; - cursor.read_exact(&mut flags_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut flags_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let flags = u16::from_be_bytes(flags_bytes); // Read payload length let mut len_bytes = [0u8; 4]; - cursor.read_exact(&mut len_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut len_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let payload_length = u32::from_be_bytes(len_bytes) as usize; if payload_length > FRAME_MAX_PAYLOAD_SIZE { - self.buffer.clear(); + self.discard_until_next_magic(); return Err(ProtocolError::MessageTooLarge); } // Read sequence number let mut seq_bytes = [0u8; 4]; - cursor.read_exact(&mut seq_bytes).map_err(|_| ProtocolError::InvalidMessage)?; + cursor + .read_exact(&mut seq_bytes) + .map_err(|_| ProtocolError::InvalidMessage)?; let sequence = u32::from_be_bytes(seq_bytes); // Skip reserved bytes - let mut reserved = [0u8; 4]; - cursor.read_exact(&mut reserved).map_err(|_| ProtocolError::InvalidMessage)?; + let mut reserved = [0u8; FRAME_RESERVED_SIZE]; + cursor + .read_exact(&mut reserved) + .map_err(|_| ProtocolError::InvalidMessage)?; // Check if we have the full frame let checksum_size = if flags & FLAG_CHECKSUMED != 0 { 4 } else { 0 }; let total_frame_size = FRAME_HEADER_SIZE + payload_length + checksum_size; + if reserved != [0u8; FRAME_RESERVED_SIZE] { + if self.buffer.len() >= total_frame_size { + self.buffer.drain(..total_frame_size); + } else { + self.buffer.clear(); + } + return Err(ProtocolError::InvalidMessage); + } + if self.buffer.len() < total_frame_size { return Ok(None); } @@ -258,6 +307,7 @@ impl FrameDecoder { // Remove consumed bytes from buffer self.buffer.drain(..total_frame_size); + self.accepted_frames += 1; let frame = Frame { version, @@ -332,8 +382,7 @@ mod tests { #[test] fn test_frame_encode_decode() { let payload = b"Hello, World!".to_vec(); - let frame = Frame::new(0x01, payload.clone()) - .with_checksum(); + let frame = Frame::new(0x01, payload.clone()).with_checksum(); let encoded = FrameEncoder::encode(&frame).unwrap(); @@ -390,4 +439,101 @@ mod tests { let result = decoder.decode(); assert!(matches!(result, Err(ProtocolError::ChecksumMismatch))); } + + #[test] + fn test_truncated_header_and_payload_do_not_decode_or_corrupt_buffer() { + let frame = Frame::new(0x01, b"payload".to_vec()).with_checksum(); + let encoded = FrameEncoder::encode(&frame).unwrap(); + + for cut in [0, 1, FRAME_HEADER_SIZE - 1] { + let mut decoder = FrameDecoder::new(); + decoder.feed(&encoded[..cut]); + + assert!(decoder.decode().unwrap().is_none()); + assert_eq!(decoder.buffered_bytes(), cut); + } + + let payload_cut = FRAME_HEADER_SIZE + frame.payload.len() - 1; + let mut decoder = FrameDecoder::new(); + decoder.feed(&encoded[..payload_cut]); + + assert!(decoder.decode().unwrap().is_none()); + assert_eq!(decoder.buffered_bytes(), payload_cut); + } + + #[test] + fn test_invalid_payload_length_is_rejected_without_panic() { + let mut encoded = FrameEncoder::encode(&Frame::new(0x01, Vec::new())).unwrap(); + encoded[8..12].copy_from_slice(&((FRAME_MAX_PAYLOAD_SIZE as u32) + 1).to_be_bytes()); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&encoded); + + assert!(matches!( + decoder.decode(), + Err(ProtocolError::MessageTooLarge) + )); + assert_eq!(decoder.buffered_bytes(), 0); + + let valid = Frame::new(0x02, b"valid after invalid length".to_vec()).with_sequence(7); + let valid_encoded = FrameEncoder::encode(&valid).unwrap(); + decoder.feed(&valid_encoded); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.sequence, 7); + assert_eq!(decoded.payload, b"valid after invalid length"); + assert_eq!(decoder.buffered_bytes(), 0); + } + + #[test] + fn test_invalid_reserved_bytes_are_rejected_and_next_frame_decodes() { + let mut invalid = FrameEncoder::encode(&Frame::new(0x01, Vec::new())).unwrap(); + invalid[16] = 0x80; + + let valid = Frame::new(0x02, b"after reserved".to_vec()).with_sequence(42); + let valid_encoded = FrameEncoder::encode(&valid).unwrap(); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid_encoded); + + assert!(matches!( + decoder.decode(), + Err(ProtocolError::InvalidMessage) + )); + assert_eq!(decoder.buffered_bytes(), valid_encoded.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x02); + assert_eq!(decoded.sequence, 42); + assert_eq!(decoded.payload, b"after reserved"); + assert_eq!(decoder.buffered_bytes(), 0); + } + + #[test] + fn test_checksum_mismatch_preserves_following_valid_frame() { + let mut invalid = + FrameEncoder::encode(&Frame::new(0x01, b"bad checksum".to_vec()).with_checksum()) + .unwrap(); + invalid[FRAME_HEADER_SIZE] ^= 0x01; + + let valid = Frame::new(0x03, b"after checksum".to_vec()).with_sequence(99); + let valid_encoded = FrameEncoder::encode(&valid).unwrap(); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid_encoded); + + assert!(matches!( + decoder.decode(), + Err(ProtocolError::ChecksumMismatch) + )); + assert_eq!(decoder.buffered_bytes(), valid_encoded.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x03); + assert_eq!(decoded.sequence, 99); + assert_eq!(decoded.payload, b"after checksum"); + assert_eq!(decoder.buffered_bytes(), 0); + } } diff --git a/backend/src/protocol/frame_tests.rs b/backend/src/protocol/frame_tests.rs new file mode 100644 index 00000000..dfff4894 --- /dev/null +++ b/backend/src/protocol/frame_tests.rs @@ -0,0 +1,226 @@ +use super::codec::{ + Frame, FrameDecoder, FrameEncoder, FRAME_HEADER_SIZE, FRAME_MAGIC, FRAME_MAX_PAYLOAD_SIZE, +}; +use super::{ProtocolError, PROTOCOL_VERSION}; + +fn encoded_frame(message_type: u8, payload: &[u8], checksum: bool) -> Vec { + let mut frame = Frame::new(message_type, payload.to_vec()); + if checksum { + frame = frame.with_checksum(); + } + FrameEncoder::encode(&frame).expect("test frame should encode") +} + +fn set_payload_length(encoded: &mut [u8], length: u32) { + encoded[8..12].copy_from_slice(&length.to_be_bytes()); +} + +fn set_reserved_nonzero(encoded: &mut [u8]) { + encoded[16] = 0x80; +} + +fn corrupt_checksum(encoded: &mut [u8]) { + let last = encoded.len() - 1; + encoded[last] ^= 0x01; +} + +fn assert_error(result: Result, ProtocolError>, expected: ProtocolError) { + match result { + Err(actual) => assert_eq!(actual, expected), + Ok(None) => panic!("expected {expected:?}, got incomplete frame"), + Ok(Some(frame)) => panic!("expected {expected:?}, got frame {frame:?}"), + } +} + +#[test] +fn encoded_header_size_matches_decoder_contract() { + let payload = b"size-check"; + let encoded = encoded_frame(0x01, payload, false); + + assert_eq!(encoded.len(), FRAME_HEADER_SIZE + payload.len()); + assert_eq!(&encoded[..4], &FRAME_MAGIC.to_be_bytes()); +} + +#[test] +fn truncated_header_returns_none_without_panic() { + let encoded = encoded_frame(0x02, b"payload", false); + let mut decoder = FrameDecoder::new(); + + decoder.feed(&encoded[..FRAME_HEADER_SIZE - 1]); + + assert!(decoder.decode().unwrap().is_none()); + assert_eq!(decoder.buffered_bytes(), FRAME_HEADER_SIZE - 1); + assert_eq!(decoder.accepted_frames(), 0); +} + +#[test] +fn truncated_payload_returns_none_without_panic() { + let encoded = encoded_frame(0x03, b"payload", false); + let mut decoder = FrameDecoder::new(); + + decoder.feed(&encoded[..FRAME_HEADER_SIZE + 3]); + + assert!(decoder.decode().unwrap().is_none()); + assert_eq!(decoder.buffered_bytes(), FRAME_HEADER_SIZE + 3); + assert_eq!(decoder.accepted_frames(), 0); +} + +#[test] +fn truncated_payload_completes_after_more_bytes_arrive() { + let encoded = encoded_frame(0x04, b"complete me", false); + let split = FRAME_HEADER_SIZE + 4; + let mut decoder = FrameDecoder::new(); + + decoder.feed(&encoded[..split]); + assert!(decoder.decode().unwrap().is_none()); + + decoder.feed(&encoded[split..]); + let decoded = decoder.decode().unwrap().unwrap(); + + assert_eq!(decoded.message_type, 0x04); + assert_eq!(decoded.payload, b"complete me"); + assert_eq!(decoder.accepted_frames(), 1); + assert_eq!(decoder.buffered_bytes(), 0); +} + +#[test] +fn invalid_magic_preserves_following_valid_frame() { + let mut invalid = encoded_frame(0x05, b"bad magic", false); + invalid[0] ^= 0xFF; + let valid = encoded_frame(0x06, b"after magic", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid); + + assert_error(decoder.decode(), ProtocolError::InvalidMessage); + assert_eq!(decoder.buffered_bytes(), valid.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x06); + assert_eq!(decoded.payload, b"after magic"); + assert_eq!(decoder.accepted_frames(), 1); +} + +#[test] +fn unsupported_version_preserves_following_valid_frame() { + let mut invalid = encoded_frame(0x07, b"bad version", false); + invalid[4] = (PROTOCOL_VERSION as u8).saturating_add(1); + let valid = encoded_frame(0x08, b"after version", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid); + + assert_error(decoder.decode(), ProtocolError::UnsupportedVersion); + assert_eq!(decoder.buffered_bytes(), valid.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x08); + assert_eq!(decoded.payload, b"after version"); + assert_eq!(decoder.accepted_frames(), 1); +} + +#[test] +fn oversize_payload_length_preserves_following_valid_frame() { + let mut invalid = encoded_frame(0x09, b"oversize", false); + set_payload_length(&mut invalid, (FRAME_MAX_PAYLOAD_SIZE + 1) as u32); + let valid = encoded_frame(0x0A, b"after oversize", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid); + + assert_error(decoder.decode(), ProtocolError::MessageTooLarge); + assert_eq!(decoder.buffered_bytes(), valid.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x0A); + assert_eq!(decoded.payload, b"after oversize"); + assert_eq!(decoder.accepted_frames(), 1); +} + +#[test] +fn nonzero_reserved_bytes_are_rejected() { + let mut invalid = encoded_frame(0x0B, b"reserved", false); + set_reserved_nonzero(&mut invalid); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + + assert_error(decoder.decode(), ProtocolError::InvalidMessage); + assert_eq!(decoder.buffered_bytes(), 0); + assert_eq!(decoder.accepted_frames(), 0); +} + +#[test] +fn valid_frame_after_invalid_reserved_bytes_decodes() { + let mut invalid = encoded_frame(0x0C, b"reserved", false); + set_reserved_nonzero(&mut invalid); + let valid = encoded_frame(0x0D, b"after reserved", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid); + + assert_error(decoder.decode(), ProtocolError::InvalidMessage); + assert_eq!(decoder.buffered_bytes(), valid.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x0D); + assert_eq!(decoded.payload, b"after reserved"); + assert_eq!(decoder.accepted_frames(), 1); +} + +#[test] +fn checksum_mismatch_preserves_following_valid_frame() { + let mut invalid = encoded_frame(0x0E, b"bad checksum", true); + corrupt_checksum(&mut invalid); + let valid = encoded_frame(0x0F, b"after checksum", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&invalid); + decoder.feed(&valid); + + assert_error(decoder.decode(), ProtocolError::ChecksumMismatch); + assert_eq!(decoder.buffered_bytes(), valid.len()); + + let decoded = decoder.decode().unwrap().unwrap(); + assert_eq!(decoded.message_type, 0x0F); + assert_eq!(decoded.payload, b"after checksum"); + assert_eq!(decoder.accepted_frames(), 1); +} + +#[test] +fn decode_all_returns_all_complete_frames_and_leaves_partial_buffered() { + let first = encoded_frame(0x10, b"first", false); + let second = encoded_frame(0x11, b"second", false); + let partial = encoded_frame(0x12, b"partial", false); + + let mut decoder = FrameDecoder::new(); + decoder.feed(&first); + decoder.feed(&second); + decoder.feed(&partial[..FRAME_HEADER_SIZE + 2]); + + let frames = decoder.decode_all().unwrap(); + + assert_eq!(frames.len(), 2); + assert_eq!(frames[0].payload, b"first"); + assert_eq!(frames[1].payload, b"second"); + assert_eq!(decoder.accepted_frames(), 2); + assert_eq!(decoder.buffered_bytes(), FRAME_HEADER_SIZE + 2); +} + +#[test] +fn empty_payload_frame_decodes_and_increments_counter() { + let encoded = encoded_frame(0x13, b"", false); + let mut decoder = FrameDecoder::new(); + decoder.feed(&encoded); + + let decoded = decoder.decode().unwrap().unwrap(); + + assert_eq!(decoded.message_type, 0x13); + assert!(decoded.payload.is_empty()); + assert_eq!(decoder.accepted_frames(), 1); + assert_eq!(decoder.buffered_bytes(), 0); +} diff --git a/backend/src/protocol/mod.rs b/backend/src/protocol/mod.rs index 3323f4c5..5bc3f057 100644 --- a/backend/src/protocol/mod.rs +++ b/backend/src/protocol/mod.rs @@ -25,6 +25,8 @@ pub mod events; pub mod messages; pub mod serialize; pub mod validate; +#[cfg(test)] +mod frame_tests; pub mod codec; pub mod rpc; diff --git a/diagnostic/build-3ce6b853.json b/diagnostic/build-3ce6b853.json new file mode 100644 index 00000000..a50d05ac --- /dev/null +++ b/diagnostic/build-3ce6b853.json @@ -0,0 +1,87 @@ +{ + "generated_at": "2026-06-19T19:50:46.583903+00:00", + "commit": "3ce6b853", + "diagnostic_logd": "diagnostic/build-3ce6b853.logd", + "diagnostic_logd_error": null, + "message_blocker": null, + "chunked": false, + "chunk_size_bytes": null, + "password": "0c6ebf67e9e942199d8c", + "decrypt_command": "encryptly unpack diagnostic/build-3ce6b853.logd --password 0c6ebf67e9e942199d8c", + "total_modules": 10, + "passed": 7, + "failed": 3, + "modules": [ + { + "name": "backend", + "status": "PASS", + "elapsed_seconds": 49.557, + "artifact": "/workspace/TentOfTrials-issue2/backend/target", + "output": "\u001b[1m\u001b[92m Compiling\u001b[0m icu_normalizer_data v2.2.0\n\u001b[1m\u001b[92m Compiling\u001b[0m icu_normalizer v2.2.0\n\u001b[1m\u001b[92m Compiling\u001b[0m idna_adapter v1.2.2\n\u001b[1m\u001b[92m Compiling\u001b[0m idna v1.1.0\n\u001b[1m\u001b[92m Compiling\u001b[0m url v2.5.8\n\u001b[1m\u001b[92m Compiling\u001b[0m tower-http v0.6.11\n\u001b[1m\u001b[92m Compiling\u001b[0m reqwest v0.12.28\n\u001b[1m\u001b[92m Compiling\u001b[0m tent-backend v0.1.0 (/workspace/TentOfTrials-issue2/backend)\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `warn`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/embeddings.rs:28:28\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m28\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use tracing::{debug, info, warn};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `error`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:25:22\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m25\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use tracing::{debug, error, info, warn};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `error` and `warn`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/mod.rs:40:22\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m40\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use tracing::{debug, error, info, warn};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `c_int` and `c_uint`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:38:20\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m38\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::os::raw::{c_int, c_uint, c_ulong};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `std::ffi::CString`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/legacy.rs:35:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m35\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::ffi::CString;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `c_char`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/legacy.rs:36:20\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m36\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::os::raw::{c_char, c_ulong};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `CStr`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/types.rs:27:16\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::ffi::{CStr, CString};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `c_double` and `c_long`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/types.rs:29:28\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m29\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::os::raw::{c_char, c_double, c_int, c_uint, c_void, c_long, c_ulong};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `AtomicBool`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:14:25\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m14\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::sync::atomic::{AtomicBool, AtomicU64, AtomicUsize, Ordering};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `EntityKind` and `legacy_normalize_phone_number`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/v1_compat.rs:8:47\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m8\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use crate::legacy::deprecations::{LegacyUuid, EntityKind, LegacyPagination, legacy_normalize_phone_number};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `super::ProtocolError`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/validate.rs:27:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use super::ProtocolError;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `Ordering`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:25:36\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m25\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::sync::atomic::{AtomicU64, Ordering};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `Duration` and `Instant`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:27:17\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m27\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use std::time::{Duration, Instant};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `Deserialize` and `Serialize`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:28:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m28\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use serde::{Deserialize, Serialize};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused import: `MAX_MESSAGE_SIZE`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:31:28\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m31\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use super::{ProtocolError, MAX_MESSAGE_SIZE, DEFAULT_TIMEOUT_MS};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused imports: `FrameDecoder` and `FrameEncoder`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:32:27\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m32\u001b[0m \u001b[1m\u001b[94m|\u001b[0m use super::codec::{Frame, FrameEncoder, FrameDecoder, FLAG_REQUIRES_ACK};\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: use of deprecated unit variant `legacy::deprecations::EntityKind::Team`: Teams are now Organizations. Use Organization instead.\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:244:25\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m244\u001b[0m \u001b[1m\u001b[94m|\u001b[0m EntityKind::Team => \"org\", // Legacy mapping\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(deprecated)]` on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: use of deprecated unit variant `legacy::deprecations::EntityKind::Project`: Projects were removed in the Platform v2 migration\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:245:25\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m245\u001b[0m \u001b[1m\u001b[94m|\u001b[0m EntityKind::Project => \"workspace\", // Legacy mapping\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: use of deprecated unit variant `legacy::deprecations::EntityKind::Team`: Teams are now Organizations. Use Organization instead.\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:266:25\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m266\u001b[0m \u001b[1m\u001b[94m|\u001b[0m EntityKind::Team\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: use of deprecated unit variant `legacy::deprecations::EntityKind::Project`: Projects were removed in the Platform v2 migration\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:267:31\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m267\u001b[0m \u001b[1m\u001b[94m|\u001b[0m | EntityKind::Project\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: variable does not need to be mutable\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:317:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m317\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let mut buffer = unsafe { &mut *c_buffer };\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m----\u001b[0m\u001b[1m\u001b[33m^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94mhelp: remove this `mut`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused variable: `initialized`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:440:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m440\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let initialized = Arc::new(AtomicBool::new(true));\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_initialized`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: variable does not need to be mutable\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/legacy.rs:267:13\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m267\u001b[0m \u001b[1m\u001b[94m|\u001b[0m let mut buffer = unsafe { &mut *c_buffer };\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m----\u001b[0m\u001b[1m\u001b[33m^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94mhelp: remove this `mut`\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused variable: `value`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/legacy/deprecations.rs:508:15\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m508\u001b[0m \u001b[1m\u001b[94m|\u001b[0m for (key, value) in configs {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^\u001b[0m \u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_value`\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: unused variable: `obj`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/validate.rs:282:25\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m282\u001b[0m \u001b[1m\u001b[94m|\u001b[0m if let Some(obj) = value.as_object() {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^\u001b[0m \u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_obj`\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: type `BridgeStats` is more private than the item `ConnectorBridge::stats`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:415:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m415\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn stats(&self) -> BridgeStats {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33mmethod `ConnectorBridge::stats` is reachable at visibility `pub`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: but type `BridgeStats` is only usable at visibility `pub(self)`\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:225:1\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m225\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct BridgeStats {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(private_interfaces)]` on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: type `CircuitState` is more private than the item `ConnectorBridge::circuit_state`\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:423:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m423\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub fn circuit_state(&self) -> CircuitState {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m \u001b[1m\u001b[33mmethod `ConnectorBridge::circuit_state` is reachable at visibility `pub`\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[92mnote\u001b[0m: but type `CircuitState` is only usable at visibility `pub(self)`\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:79:1\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m 79\u001b[0m \u001b[1m\u001b[94m|\u001b[0m enum CircuitState {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[92m^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `NCP_TEMPERATURE` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/mod.rs:53:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m53\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const NCP_TEMPERATURE: f64 = 0.42;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `MIN_CONFIDENCE_THRESHOLD` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/mod.rs:61:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m61\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const MIN_CONFIDENCE_THRESHOLD: f64 = 0.65;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `MAX_INFERENCE_RETRIES` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/mod.rs:65:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m65\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const MAX_INFERENCE_RETRIES: u32 = 5;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `discovery`, `broker`, and `registry` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/mod.rs:173:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m171\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct AiOrchestrator {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m172\u001b[0m \u001b[1m\u001b[94m|\u001b[0m /// Reference to the service discovery subsystem\n\u001b[1m\u001b[94m173\u001b[0m \u001b[1m\u001b[94m|\u001b[0m discovery: Arc>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m174\u001b[0m \u001b[1m\u001b[94m|\u001b[0m /// Reference to the message broker subsystem\n\u001b[1m\u001b[94m175\u001b[0m \u001b[1m\u001b[94m|\u001b[0m broker: Arc>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\u001b[1m\u001b[94m176\u001b[0m \u001b[1m\u001b[94m|\u001b[0m /// Reference to the service registry subsystem\n\u001b[1m\u001b[94m177\u001b[0m \u001b[1m\u001b[94m|\u001b[0m registry: Arc>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `window_start` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/embeddings.rs:661:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m658\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct ContextWindowManager {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m--------------------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m661\u001b[0m \u001b[1m\u001b[94m|\u001b[0m window_start: Instant,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `MAX_RETRIES` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:41:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m41\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const MAX_RETRIES: u32 = 3;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `RETRY_BASE_DELAY_MS` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:44:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m44\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const RETRY_BASE_DELAY_MS: u64 = 1000;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `api_key`, `base_url`, and `client` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:453:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m452\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct AnthropicClient {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m453\u001b[0m \u001b[1m\u001b[94m|\u001b[0m api_key: String,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m454\u001b[0m \u001b[1m\u001b[94m|\u001b[0m base_url: String,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m455\u001b[0m \u001b[1m\u001b[94m|\u001b[0m models: Vec,\n\u001b[1m\u001b[94m456\u001b[0m \u001b[1m\u001b[94m|\u001b[0m client: reqwest::Client,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `AnthropicClient` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `routing_table` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:719:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m716\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct ModelRouter {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m719\u001b[0m \u001b[1m\u001b[94m|\u001b[0m routing_table: RwLock>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `ModelRouter` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `cost_history` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/ai/inference.rs:951:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m947\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct TokenCounter {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m------------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m951\u001b[0m \u001b[1m\u001b[94m|\u001b[0m cost_history: RwLock>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: constant `HEALTH_CHECK_TIMEOUT_MS` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:64:7\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m64\u001b[0m \u001b[1m\u001b[94m|\u001b[0m const HEALTH_CHECK_TIMEOUT_MS: u64 = 1000;\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `id` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:152:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m151\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct PoolEntry {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m152\u001b[0m \u001b[1m\u001b[94m|\u001b[0m id: usize,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: method `stats` is never used\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:195:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m163\u001b[0m \u001b[1m\u001b[94m|\u001b[0m impl ConnectionPool {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-------------------\u001b[0m \u001b[1m\u001b[94mmethod in this implementation\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m195\u001b[0m \u001b[1m\u001b[94m|\u001b[0m fn stats(&self) -> PoolStats {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: struct `PoolStats` is never constructed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:203:8\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m203\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct PoolStats {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `circuit_breaker_trips` and `health_check_failures` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/connector/bridge.rs:229:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m225\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct BridgeStats {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m229\u001b[0m \u001b[1m\u001b[94m|\u001b[0m circuit_breaker_trips: u64,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m230\u001b[0m \u001b[1m\u001b[94m|\u001b[0m health_check_failures: u64,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n \u001b[1m\u001b[94m|\u001b[0m\n \u001b[1m\u001b[94m= \u001b[0m\u001b[1mnote\u001b[0m: `BridgeStats` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `consumers` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/messaging/mod.rs:38:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m35\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct MessageBroker {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-------------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m38\u001b[0m \u001b[1m\u001b[94m|\u001b[0m consumers: DashMap>>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `version` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/messages.rs:293:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m291\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct MessageRegistry {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m292\u001b[0m \u001b[1m\u001b[94m|\u001b[0m handlers: HashMap,\n\u001b[1m\u001b[94m293\u001b[0m \u001b[1m\u001b[94m|\u001b[0m version: u32,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `version` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/serialize.rs:258:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m255\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct Schema {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m258\u001b[0m \u001b[1m\u001b[94m|\u001b[0m version: u32,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `required` and `default_value` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/serialize.rs:264:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m261\u001b[0m \u001b[1m\u001b[94m|\u001b[0m struct SchemaField {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m-----------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m264\u001b[0m \u001b[1m\u001b[94m|\u001b[0m required: bool,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m265\u001b[0m \u001b[1m\u001b[94m|\u001b[0m default_value: Option,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: variant `Custom` is never constructed\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/serialize.rs:276:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m269\u001b[0m \u001b[1m\u001b[94m|\u001b[0m enum FieldValidation {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------------\u001b[0m \u001b[1m\u001b[94mvariant in this enum\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m276\u001b[0m \u001b[1m\u001b[94m|\u001b[0m Custom(String),\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: fields `next_request_id`, `pending_requests`, `serializer`, and `timeout_ms` are never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:218:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m217\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct RpcClient {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------\u001b[0m \u001b[1m\u001b[94mfields in this struct\u001b[0m\n\u001b[1m\u001b[94m218\u001b[0m \u001b[1m\u001b[94m|\u001b[0m next_request_id: AtomicU64,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m219\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pending_requests: Arc, RpcError>>>>>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m220\u001b[0m \u001b[1m\u001b[94m|\u001b[0m serializer: Serializer,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^\u001b[0m\n\u001b[1m\u001b[94m221\u001b[0m \u001b[1m\u001b[94m|\u001b[0m timeout_ms: u64,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `serializer` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/protocol/rpc.rs:271:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m269\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct RpcServer {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m270\u001b[0m \u001b[1m\u001b[94m|\u001b[0m handlers: HashMap,\n\u001b[1m\u001b[94m271\u001b[0m \u001b[1m\u001b[94m|\u001b[0m serializer: Serializer,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m\u001b[1m: field `events` is never read\u001b[0m\n \u001b[1m\u001b[94m--> \u001b[0msrc/registry/mod.rs:31:5\n \u001b[1m\u001b[94m|\u001b[0m\n\u001b[1m\u001b[94m28\u001b[0m \u001b[1m\u001b[94m|\u001b[0m pub struct ServiceRegistry {\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[94m---------------\u001b[0m \u001b[1m\u001b[94mfield in this struct\u001b[0m\n\u001b[1m\u001b[94m...\u001b[0m\n\u001b[1m\u001b[94m31\u001b[0m \u001b[1m\u001b[94m|\u001b[0m events: Arc>>,\n \u001b[1m\u001b[94m|\u001b[0m \u001b[1m\u001b[33m^^^^^^\u001b[0m\n\n\u001b[1m\u001b[33mwarning\u001b[0m: `tent-backend` (lib) generated 50 warnings (run `cargo fix --lib -p tent-backend` to apply 21 suggestions)\n\u001b[1m\u001b[92m Finished\u001b[0m `dev` profile [unoptimized + debuginfo] target(s) in 49.48s" + }, + { + "name": "frontend", + "status": "PASS", + "elapsed_seconds": 38.758, + "artifact": "/workspace/TentOfTrials-issue2/frontend/dist", + "output": "> tent-frontend@0.0.0 build\n> tsc -b && vite build\n\nvite v6.4.3 building for production...\ntransforming...\n\u2713 100 modules transformed.\nrendering chunks...\ncomputing gzip size...\ndist/index.html 0.63 kB \u2502 gzip: 0.35 kB\ndist/assets/state-BkjSKDbY.js 8.91 kB \u2502 gzip: 3.54 kB \u2502 map: 57.15 kB\ndist/assets/vendor-CREcWLHI.js 48.93 kB \u2502 gzip: 17.25 kB \u2502 map: 481.27 kB\ndist/assets/index-CyxcoTyU.js 231.32 kB \u2502 gzip: 72.16 kB \u2502 map: 1,045.57 kB\n\u2713 built in 4.86s" + }, + { + "name": "market", + "status": "PASS", + "elapsed_seconds": 7.723, + "artifact": "/workspace/TentOfTrials-issue2/market/market", + "output": "go: downloading go.uber.org/zap v1.27.0\ngo: downloading github.com/google/uuid v1.6.0\ngo: downloading github.com/gorilla/websocket v1.5.3\ngo: downloading github.com/shopspring/decimal v1.4.0\ngo: downloading go.uber.org/multierr v1.10.0" + }, + { + "name": "frailbox", + "status": "FAIL", + "elapsed_seconds": 0.227, + "artifact": null, + "output": "gcc -Wall -Wextra -Wpedantic -std=c2x -O2 -g -D_FORTIFY_SOURCE=3 -fstack-protector-strong -fPIE -Iinclude -MMD -MP -c src/arena.c -o build/src/arena.o\nsrc/arena.c: In function 'region_alloc':\nsrc/arena.c:13:36: error: 'MAP_ANONYMOUS' undeclared (first use in this function)\n 13 | int mmap_flags = MAP_PRIVATE | MAP_ANONYMOUS;\n | ^~~~~~~~~~~~~\nsrc/arena.c:13:36: note: each undeclared identifier is reported only once for each function it appears in\nsrc/arena.c:17:23: error: 'MAP_HUGETLB' undeclared (first use in this function)\n 17 | mmap_flags |= MAP_HUGETLB;\n | ^~~~~~~~~~~\nsrc/arena.c: In function 'arena_contains':\nsrc/arena.c:179:17: warning: comparison of distinct pointer types lacks a cast\n 179 | ptr < (char *)region->start + region->size) {\n | ^\nmake: *** [Makefile:27: build/src/arena.o] Error 1" + }, + { + "name": "engine", + "status": "FAIL", + "elapsed_seconds": 3.132, + "artifact": null, + "output": "[ 11%] Building CXX object CMakeFiles/trial-engine.dir/main.cpp.o\n/workspace/TentOfTrials-issue2/frailbox/engine/main.cpp:12:10: fatal error: format: No such file or directory\n 12 | #include \n | ^~~~~~~~\ncompilation terminated.\ngmake[2]: *** [CMakeFiles/trial-engine.dir/build.make:76: CMakeFiles/trial-engine.dir/main.cpp.o] Error 1\ngmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/trial-engine.dir/all] Error 2\ngmake: *** [Makefile:136: all] Error 2" + }, + { + "name": "compliance", + "status": "PASS", + "elapsed_seconds": 1.825, + "artifact": "/workspace/TentOfTrials-issue2/compliance/build", + "output": "" + }, + { + "name": "v2-market-stream", + "status": "PASS", + "elapsed_seconds": 0.04, + "artifact": null, + "output": "Syntax OK\nruby: warning: shebang line ending with \\r may cause problems" + }, + { + "name": "nfc-scanner", + "status": "PASS", + "elapsed_seconds": 0.008, + "artifact": null, + "output": "" + }, + { + "name": "openapi-haskell", + "status": "FAIL", + "elapsed_seconds": 0, + "artifact": null, + "output": "Command not found: [Errno 2] No such file or directory: 'ghc'" + }, + { + "name": "openapi-tools", + "status": "PASS", + "elapsed_seconds": 0.015, + "artifact": null, + "output": "" + } + ], + "pr_note": "Include the encrypted diagnostic logd artifact(s): diagnostic/build-3ce6b853.logd. The encrypted .logd is the required diagnostic content for PR review; this JSON file is metadata. Maintainers may ask you to remove these diagnostic artifacts before merging." +} diff --git a/diagnostic/build-3ce6b853.logd b/diagnostic/build-3ce6b853.logd new file mode 100644 index 00000000..161df98a Binary files /dev/null and b/diagnostic/build-3ce6b853.logd differ