55//! Trait-based design ensures Hydra compatibility — swap implementors without refactoring.
66//!
77//! Note: Codebase has no core library crate, so bridges live in the MCP crate.
8+ #![ allow( dead_code) ]
89
910/// Bridge to agentic-memory for persisting code analysis in memory.
1011pub trait MemoryBridge : Send + Sync {
@@ -93,7 +94,12 @@ pub trait ContractBridge: Send + Sync {
9394/// Bridge to agentic-vision for code-visual bindings.
9495pub trait VisionBridge : Send + Sync {
9596 /// Link a code unit to a visual capture
96- fn link_to_capture ( & self , unit_id : u64 , capture_id : u64 , binding_type : & str ) -> Result < ( ) , String > {
97+ fn link_to_capture (
98+ & self ,
99+ unit_id : u64 ,
100+ capture_id : u64 ,
101+ binding_type : & str ,
102+ ) -> Result < ( ) , String > {
97103 let _ = ( unit_id, capture_id, binding_type) ;
98104 Err ( "Vision bridge not connected" . to_string ( ) )
99105 }
@@ -108,7 +114,12 @@ pub trait VisionBridge: Send + Sync {
108114/// Bridge to agentic-comm for code-aware messaging.
109115pub trait CommBridge : Send + Sync {
110116 /// Broadcast a code change notification
111- fn broadcast_change ( & self , unit_id : u64 , change_type : & str , channel_id : u64 ) -> Result < ( ) , String > {
117+ fn broadcast_change (
118+ & self ,
119+ unit_id : u64 ,
120+ change_type : & str ,
121+ channel_id : u64 ,
122+ ) -> Result < ( ) , String > {
112123 let _ = ( unit_id, change_type, channel_id) ;
113124 Err ( "Comm bridge not connected" . to_string ( ) )
114125 }
@@ -132,7 +143,7 @@ impl VisionBridge for NoOpBridges {}
132143impl CommBridge for NoOpBridges { }
133144
134145/// Configuration for which bridges are active.
135- #[ derive( Debug , Clone ) ]
146+ #[ derive( Debug , Clone , Default ) ]
136147pub struct BridgeConfig {
137148 pub memory_enabled : bool ,
138149 pub identity_enabled : bool ,
@@ -142,19 +153,6 @@ pub struct BridgeConfig {
142153 pub comm_enabled : bool ,
143154}
144155
145- impl Default for BridgeConfig {
146- fn default ( ) -> Self {
147- Self {
148- memory_enabled : false ,
149- identity_enabled : false ,
150- time_enabled : false ,
151- contract_enabled : false ,
152- vision_enabled : false ,
153- comm_enabled : false ,
154- }
155- }
156- }
157-
158156/// Hydra adapter trait — future orchestrator discovery interface.
159157pub trait HydraAdapter : Send + Sync {
160158 fn adapter_id ( & self ) -> & str ;
@@ -246,7 +244,7 @@ mod tests {
246244
247245 #[ test]
248246 fn noop_bridges_default_and_clone ( ) {
249- let b = NoOpBridges :: default ( ) ;
247+ let b = NoOpBridges ;
250248 let _b2 = b. clone ( ) ;
251249 }
252250}
0 commit comments