From bd34855c9665c7a775e03b5feba88c3cd52508de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:07:49 +0000 Subject: [PATCH 1/2] Initial plan From 3b64eb3f313bea5461a8f8f728a389ab230b0885 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Mar 2026 22:09:36 +0000 Subject: [PATCH 2/2] fix: apply rustfmt formatting to fix CI lint check Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com> Agent-Logs-Url: https://github.com/knitli/recoco/sessions/41dcb415-44ee-4e98-b75d-594cb16e94b5 --- .../recoco-core/src/execution/row_indexer.rs | 33 +++++++++++++--- .../recoco-core/src/ops/targets/postgres.rs | 22 +++++------ crates/recoco-splitters/benches/splitting.rs | 39 ++++++++++--------- 3 files changed, 58 insertions(+), 36 deletions(-) diff --git a/crates/recoco-core/src/execution/row_indexer.rs b/crates/recoco-core/src/execution/row_indexer.rs index f3c6c687..1bbb3a80 100644 --- a/crates/recoco-core/src/execution/row_indexer.rs +++ b/crates/recoco-core/src/execution/row_indexer.rs @@ -1138,7 +1138,11 @@ mod tests { let calls = Arc::new(std::sync::atomic::AtomicUsize::new(0)); let result = collect_mutation_results([ - counted_fut(calls.clone(), "export/target-a", Err(internal_error!("target-a failed"))), + counted_fut( + calls.clone(), + "export/target-a", + Err(internal_error!("target-a failed")), + ), counted_fut(calls.clone(), "export/target-b", Ok(())), ]) .await; @@ -1148,7 +1152,10 @@ mod tests { 2, "both mutations must be attempted even when the first fails" ); - assert!(result.is_err(), "overall result should be Err when a target fails"); + assert!( + result.is_err(), + "overall result should be Err when a target fails" + ); } #[tokio::test] @@ -1158,7 +1165,11 @@ mod tests { let result = collect_mutation_results([ counted_fut(calls.clone(), "export/target-a", Ok(())), - counted_fut(calls.clone(), "export/target-b", Err(internal_error!("target-b failed"))), + counted_fut( + calls.clone(), + "export/target-b", + Err(internal_error!("target-b failed")), + ), ]) .await; @@ -1176,8 +1187,16 @@ mod tests { let calls = Arc::new(std::sync::atomic::AtomicUsize::new(0)); let result = collect_mutation_results([ - counted_fut(calls.clone(), "export/target-a", Err(internal_error!("first error"))), - counted_fut(calls.clone(), "export/target-b", Err(internal_error!("second error"))), + counted_fut( + calls.clone(), + "export/target-a", + Err(internal_error!("first error")), + ), + counted_fut( + calls.clone(), + "export/target-b", + Err(internal_error!("second error")), + ), counted_fut(calls.clone(), "export/target-c", Ok(())), ]) .await; @@ -1211,7 +1230,9 @@ mod tests { #[tokio::test] async fn test_empty_target_list_succeeds() { // Edge-case: no targets → should return Ok without panicking. - let result = collect_mutation_results(Vec::)>>::new()).await; + let result = + collect_mutation_results(Vec::)>>::new()) + .await; assert!(result.is_ok()); } } diff --git a/crates/recoco-core/src/ops/targets/postgres.rs b/crates/recoco-core/src/ops/targets/postgres.rs index afd9dde7..91af0f9d 100644 --- a/crates/recoco-core/src/ops/targets/postgres.rs +++ b/crates/recoco-core/src/ops/targets/postgres.rs @@ -565,10 +565,7 @@ fn qualified_table_name(table_id: &TableId) -> String { None => { let table_name = &table_id.table_name; if table_name.contains('.') { - table_name - .split('.') - .map(quote_identifier) - .join(".") + table_name.split('.').map(quote_identifier).join(".") } else { quote_identifier(table_name) } @@ -820,16 +817,19 @@ impl SetupChange { TableUpsertionAction::Create { keys, values } => { // Create schema if specified if let Some(schema) = &table_id.schema { - let sql = format!("CREATE SCHEMA IF NOT EXISTS {}", quote_identifier(schema)); + let sql = + format!("CREATE SCHEMA IF NOT EXISTS {}", quote_identifier(schema)); sqlx::query(&sql).execute(db_pool).await?; } - let mut fields = (keys.iter().map(|(name, typ)| { - format!("{} {typ} NOT NULL", quote_identifier(name)) - })) - .chain(values.iter().map(|(name, typ)| { - format!("{} {typ}", quote_identifier(name)) - })); + let mut fields = (keys + .iter() + .map(|(name, typ)| format!("{} {typ} NOT NULL", quote_identifier(name)))) + .chain( + values + .iter() + .map(|(name, typ)| format!("{} {typ}", quote_identifier(name))), + ); let sql = format!( "CREATE TABLE IF NOT EXISTS {table_name} ({}, PRIMARY KEY ({}))", fields.join(", "), diff --git a/crates/recoco-splitters/benches/splitting.rs b/crates/recoco-splitters/benches/splitting.rs index 5c84a5b3..86b9b901 100644 --- a/crates/recoco-splitters/benches/splitting.rs +++ b/crates/recoco-splitters/benches/splitting.rs @@ -49,7 +49,7 @@ fn load_fixture(tier: &str, name: &str) -> String { } struct Fixtures { - prose: Vec<(String, String)>, // (tier, content) + prose: Vec<(String, String)>, // (tier, content) rust: Vec<(String, String)>, python: Vec<(String, String)>, mixed: Vec<(String, String)>, @@ -69,7 +69,12 @@ fn load_all_fixtures() -> Fixtures { mixed.push((tier.to_string(), load_fixture(tier, "mixed.txt"))); } - Fixtures { prose, rust, python, mixed } + Fixtures { + prose, + rust, + python, + mixed, + } } // --------------------------------------------------------------------------- @@ -186,23 +191,19 @@ fn bench_recursive_chunk(c: &mut Criterion) { for &chunk_size in chunk_sizes { let param = format!("{tier}/cs={chunk_size}"); group.throughput(Throughput::Bytes(content.len() as u64)); - group.bench_with_input( - BenchmarkId::new("lang=rust", ¶m), - content, - |b, text| { - b.iter(|| { - chunker.split( - text, - RecursiveChunkConfig { - chunk_size, - min_chunk_size: None, - chunk_overlap: Some(chunk_size / 10), - language: Some("rust".to_string()), - }, - ) - }); - }, - ); + group.bench_with_input(BenchmarkId::new("lang=rust", ¶m), content, |b, text| { + b.iter(|| { + chunker.split( + text, + RecursiveChunkConfig { + chunk_size, + min_chunk_size: None, + chunk_overlap: Some(chunk_size / 10), + language: Some("rust".to_string()), + }, + ) + }); + }); } } group.finish();