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

Method append_raw_node

atomic-agent/src/provenance/accumulator/append.rs:320–344  ·  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

318 ///
319 /// Returns the new node's ID.
320 pub fn append_raw_node(
321 &mut self,
322 kind: NodeKind,
323 timestamp: i64,
324 summary: &str,
325 detail: Option<serde_json::Value>,
326 ) -> String {
327 let node = GraphNode {
328 id: self.next_id(),
329 kind,
330 timestamp,
331 summary: summary.to_string(),
332 detail,
333 change_hash: None,
334 tool_name: None,
335 tool_call_id: None,
336 duration_ms: None,
337 classified: false,
338 confidence: None,
339 consolidated_from: Vec::new(),
340 };
341 let node_id = node.id.clone();
342 self.push_node(node);
343 node_id
344 }
345
346 /// Append a generic todo snapshot and link it to the active turn goal.
347 pub fn append_todo_snapshot(

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