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

Function is_duplicate

atomic-agent/src/learnings.rs:272–281  ·  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

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

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