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

Function neighbors_impl

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

Source from the content-addressed store, hash-verified

1172// ---------------------------------------------------------------------------
1173
1174pub fn neighbors_impl(
1175 repo: &Repository,
1176 node_id: &str,
1177 depth: u8,
1178) -> Result<(Vec<KgNode>, Vec<KgEdge>), Status> {
1179 let mut subgraph = repo
1180 .vault_kg_neighbors(node_id, depth)
1181 .map_err(repository_error)?;
1182 repo.enrich_workflow_usage(&mut subgraph.nodes)
1183 .map_err(repository_error)?;
1184 let nodes = subgraph.nodes.into_iter().map(kg_node_proto).collect();
1185 let edges = subgraph.edges.into_iter().map(kg_edge_proto).collect();
1186 Ok((nodes, edges))
1187}
1188
1189/// Domain KG node → wire, with the FULL field set (add-only source and
1190/// 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