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>,
)
| 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 | /// |
no test coverage detected