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

Function neighbors_impl

libatomic/src/daemon/services_query.rs:1177–1190  ·  view source on GitHub ↗
(
    repo: &Repository,
    node_id: &str,
    depth: u8,
)

Source from the content-addressed store, hash-verified

1175// ---------------------------------------------------------------------------
1176
1177pub fn neighbors_impl(
1178 repo: &Repository,
1179 node_id: &str,
1180 depth: u8,
1181) -> Result<(Vec<KgNode>, Vec<KgEdge>), Status> {
1182 let mut subgraph = repo
1183 .vault_kg_neighbors(node_id, depth)
1184 .map_err(repository_error)?;
1185 repo.enrich_workflow_usage(&mut subgraph.nodes)
1186 .map_err(repository_error)?;
1187 let nodes = subgraph.nodes.into_iter().map(kg_node_proto).collect();
1188 let edges = subgraph.edges.into_iter().map(kg_edge_proto).collect();
1189 Ok((nodes, edges))
1190}
1191
1192/// Domain KG node → wire, with the FULL field set (add-only source and
1193/// metadata) so the client serializes the same JSON shape the local body

Callers 1

query_graphMethod · 0.85

Calls 4

vault_kg_neighborsMethod · 0.80
enrich_workflow_usageMethod · 0.80
collectMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected