Convert the wire's ranked ContextItems into the render's MemoryItems — the service layer's gather+rank already computed these; the renders are presentation (one render, two data sources).
(items: &[atomic_client::proto::ContextItem])
| 793 | /// the service layer's gather+rank already computed these; the renders are |
| 794 | /// presentation (one render, two data sources). |
| 795 | pub(crate) fn wire_items(items: &[atomic_client::proto::ContextItem]) -> Vec<MemoryItem> { |
| 796 | items |
| 797 | .iter() |
| 798 | .map(|item| MemoryItem { |
| 799 | memory_id: item.memory_id.clone(), |
| 800 | kg_node_id: item.kg_node_id.clone(), |
| 801 | revision_hash: item.revision_hash.clone(), |
| 802 | content_hash: item.content_hash.clone(), |
| 803 | path: item.path.clone(), |
| 804 | name: item.name.clone(), |
| 805 | kind: item.kind.clone(), |
| 806 | status: item.status.clone(), |
| 807 | updated_at: item.updated_at.clone(), |
| 808 | introduced_by: item.introduced_by, |
| 809 | score: item.score, |
| 810 | why_matched: item.why_matched.clone(), |
| 811 | body: item.body.clone().unwrap_or_default(), |
| 812 | truncated: item.truncated, |
| 813 | }) |
| 814 | .collect() |
| 815 | } |
| 816 | |
| 817 | /// Render the prompt-ready markdown block. Empty input renders to an |
| 818 | /// empty string so callers can prepend unconditionally. |
no test coverage detected