Skip to content

Commit d705106

Browse files
haasonsaasclaude
andcommitted
feat: configurable verification pass, git blame tool, enhanced feedback loop
- Make verification pass configurable: toggle on/off, model role, min score, max comments — all via config, CLI flag, and web UI - Add get_blame agent tool using git2::Repository::blame_file() with line range support, path traversal protection, and spawn_blocking for safety - Extend FeedbackStore with per-category, per-file-pattern, and composite tracking with acceptance_rate() helpers - Generate and inject learned feedback patterns into review prompts - Add feedback-adjusted confidence scoring (0%→0.5x, 100%→1.0x multiplier) - Record enhanced feedback stats in submit_feedback API handler - 26 new tests covering all three features Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f89e363 commit d705106

9 files changed

Lines changed: 890 additions & 17 deletions

File tree

src/config.rs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,31 @@ pub struct Config {
289289
/// Which agent tools are enabled. None = all tools enabled.
290290
#[serde(default)]
291291
pub agent_tools_enabled: Option<Vec<String>>,
292+
293+
/// Whether to run the verification pass on review comments (default true).
294+
#[serde(default = "default_true")]
295+
pub verification_pass: bool,
296+
297+
/// Which model role to use for the verification pass (default Weak).
298+
#[serde(default = "default_verification_model_role")]
299+
pub verification_model_role: ModelRole,
300+
301+
/// Minimum verification score to keep a comment (0-10, default 5).
302+
#[serde(default = "default_verification_min_score")]
303+
pub verification_min_score: u8,
304+
305+
/// Maximum number of comments to send through verification (default 20).
306+
#[serde(default = "default_verification_max_comments")]
307+
pub verification_max_comments: usize,
308+
309+
/// Enable enhanced feedback loop with per-category/file-pattern tracking
310+
/// and feedback-adjusted confidence scores (default false).
311+
#[serde(default)]
312+
pub enhanced_feedback: bool,
313+
314+
/// Minimum number of feedback observations before adjusting confidence (default 5).
315+
#[serde(default = "default_feedback_min_observations")]
316+
pub feedback_min_observations: usize,
292317
}
293318

294319
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
@@ -431,6 +456,12 @@ impl Default for Config {
431456
agent_max_iterations: default_agent_max_iterations(),
432457
agent_max_total_tokens: None,
433458
agent_tools_enabled: None,
459+
verification_pass: true,
460+
verification_model_role: default_verification_model_role(),
461+
verification_min_score: default_verification_min_score(),
462+
verification_max_comments: default_verification_max_comments(),
463+
enhanced_feedback: false,
464+
feedback_min_observations: default_feedback_min_observations(),
434465
}
435466
}
436467
}
@@ -490,6 +521,7 @@ pub struct CliOverrides {
490521
pub agent_review: bool,
491522
pub agent_max_iterations: Option<usize>,
492523
pub agent_max_total_tokens: Option<usize>,
524+
pub verification_pass: Option<bool>,
493525
}
494526

495527
impl Config {
@@ -563,6 +595,9 @@ impl Config {
563595
if let Some(v) = cli.agent_max_total_tokens {
564596
self.agent_max_total_tokens = Some(v);
565597
}
598+
if let Some(v) = cli.verification_pass {
599+
self.verification_pass = v;
600+
}
566601
}
567602

568603
pub fn normalize(&mut self) {
@@ -1229,6 +1264,22 @@ fn default_agent_max_iterations() -> usize {
12291264
10
12301265
}
12311266

1267+
fn default_verification_model_role() -> ModelRole {
1268+
ModelRole::Weak
1269+
}
1270+
1271+
fn default_verification_min_score() -> u8 {
1272+
5
1273+
}
1274+
1275+
fn default_verification_max_comments() -> usize {
1276+
20
1277+
}
1278+
1279+
fn default_feedback_min_observations() -> usize {
1280+
5
1281+
}
1282+
12321283
fn normalize_comment_types(values: &[String]) -> Vec<String> {
12331284
if values.is_empty() {
12341285
return default_comment_types();

0 commit comments

Comments
 (0)