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

Function collect_new_items

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

Collect new learnings as heading → items map for merging.

(learnings: &Learnings)

Source from the content-addressed store, hash-verified

500
501/// Collect new learnings as heading → items map for merging.
502fn collect_new_items(learnings: &Learnings) -> HashMap<String, Vec<String>> {
503 let mut items: HashMap<String, Vec<String>> = HashMap::new();
504
505 for item in &learnings.repo {
506 items
507 .entry("### Repo".to_string())
508 .or_default()
509 .push(format!("- {}", item));
510 }
511
512 // Code learnings excluded from context file — they live in change.unhashed
513
514 for item in &learnings.workflow {
515 items
516 .entry("### Workflow".to_string())
517 .or_default()
518 .push(format!("- {}", item));
519 }
520
521 items
522}
523
524/// Merge new items into existing section headings without duplicating headings.
525///

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected