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

Method append_raw_node

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

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

Callers

nothing calls this directly

Calls 3

next_idMethod · 0.80
push_nodeMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected