An AI agent built to do Ralph loops - plan mode for planning and ralph mode for implementing.

fix(autonomy): apply code review fixes for phase_03

- Replace manual Default impl with #[derive(Default)] on AutonomyLevel enum
and add #[default] attribute to Supervised variant. This resolves the
clippy warning about derivable_impls.
- Fix formatting in test code (lines 378, 390, 402) via cargo fmt.

These changes resolve Important Issue 1 and Minor Issue 1 from code review.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+10 -22
+10 -22
src/autonomy.rs
··· 1 1 use serde::{Deserialize, Serialize}; 2 2 3 - #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] 3 + #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] 4 4 #[serde(rename_all = "lowercase")] 5 5 pub enum AutonomyLevel { 6 6 Full, 7 + #[default] 7 8 Supervised, 8 9 Gated, 9 - } 10 - 11 - impl Default for AutonomyLevel { 12 - fn default() -> Self { 13 - Self::Supervised 14 - } 15 10 } 16 11 17 12 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] ··· 378 373 ]; 379 374 380 375 for gate in gates { 381 - let result = 382 - checker.check_gate(gate, "ra-1234", "Test context", "Test action"); 383 - assert!(result.is_some(), "Gate {:?} should be active in Gated mode", gate); 376 + let result = checker.check_gate(gate, "ra-1234", "Test context", "Test action"); 377 + assert!( 378 + result.is_some(), 379 + "Gate {:?} should be active in Gated mode", 380 + gate 381 + ); 384 382 assert_eq!(result.unwrap().gate, gate); 385 383 } 386 384 } ··· 390 388 let checker = GateChecker::new(AutonomyLevel::Supervised); 391 389 392 390 let req1 = checker 393 - .check_gate( 394 - ApprovalGate::PlanReview, 395 - "ra-1234", 396 - "Test 1", 397 - "Action 1", 398 - ) 391 + .check_gate(ApprovalGate::PlanReview, "ra-1234", "Test 1", "Action 1") 399 392 .unwrap(); 400 393 401 394 let req2 = checker 402 - .check_gate( 403 - ApprovalGate::PlanReview, 404 - "ra-5678", 405 - "Test 2", 406 - "Action 2", 407 - ) 395 + .check_gate(ApprovalGate::PlanReview, "ra-5678", "Test 2", "Action 2") 408 396 .unwrap(); 409 397 410 398 assert_ne!(req1.id, req2.id);