MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_duplicate

Function is_duplicate

atomic-agent/src/learnings.rs:274–283  ·  view source on GitHub ↗

Check if a learning line is already present in the existing learnings. Compares by the finding text (after the "— ") to handle cases where the line number changed but the finding is the same.

(existing: &[String], new_line: &str)

Source from the content-addressed store, hash-verified

272/// Compares by the finding text (after the "— ") to handle cases where
273/// the line number changed but the finding is the same.
274fn is_duplicate(existing: &[String], new_line: &str) -> bool {
275 // Extract the finding part (after "— ") for fuzzy matching
276 let new_finding = extract_finding(new_line);
277
278 existing.iter().any(|existing_line| {
279 let existing_finding = extract_finding(existing_line);
280 // Match on finding text, ignoring location differences
281 !new_finding.is_empty() && new_finding == existing_finding
282 })
283}
284
285/// Extract the finding portion from a learning line.
286///

Callers 1

dedup_learningsFunction · 0.85

Calls 3

extract_findingFunction · 0.85
iterMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected