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

Function collect_new_items

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

Collect new learnings as heading → items map for merging.

(learnings: &Learnings)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected