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

Method append_raw_node

atomic-agent/src/provenance/accumulator/append.rs:269–293  ·  view source on GitHub ↗

Append a raw node with full control over its fields. This method bypasses the usual edge inference logic and allows direct insertion of nodes with custom details. Used for ingesting external trace formats (e.g., Sherpa JSONL) that carry their own structured data. Returns the new node's ID.

(
        &mut self,
        kind: NodeKind,
        timestamp: i64,
        summary: &str,
        detail: Option<serde_json::Value>,
    )

Source from the content-addressed store, hash-verified

267 ///
268 /// Returns the new node's ID.
269 pub fn append_raw_node(
270 &mut self,
271 kind: NodeKind,
272 timestamp: i64,
273 summary: &str,
274 detail: Option<serde_json::Value>,
275 ) -> String {
276 let node = GraphNode {
277 id: self.next_id(),
278 kind,
279 timestamp,
280 summary: summary.to_string(),
281 detail,
282 change_hash: None,
283 tool_name: None,
284 tool_call_id: None,
285 duration_ms: None,
286 classified: false,
287 confidence: None,
288 consolidated_from: Vec::new(),
289 };
290 let node_id = node.id.clone();
291 self.push_node(node);
292 node_id
293 }
294
295 /// Mark a human gate as resolved.
296 ///

Callers 1

ingest_sherpa_traceMethod · 0.80

Calls 3

next_idMethod · 0.80
push_nodeMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected