| 189 | }) |
| 190 | } |
| 191 | fn graph( |
| 192 | change: Option<Hash>, |
| 193 | previous: Option<Hash>, |
| 194 | session: &str, |
| 195 | time: i64, |
| 196 | intent: &str, |
| 197 | ) -> ProvenanceGraph { |
| 198 | let mut graph = ProvenanceGraph::builder(session, "acceptance") |
| 199 | .timestamp(time) |
| 200 | .plan_id(intent) |
| 201 | .add_node(ProvenanceNode { |
| 202 | id: format!("goal-{time}"), |
| 203 | kind: ProvenanceNodeKind::Goal, |
| 204 | timestamp: time * 1000, |
| 205 | summary: "Recorded decision and evidence".into(), |
| 206 | detail: Some(json!({"fixture":"provenance-detail"}).to_string()), |
| 207 | change_hash: None, |
| 208 | tool_name: None, |
| 209 | tool_call_id: None, |
| 210 | duration_ms: None, |
| 211 | classified: false, |
| 212 | confidence: None, |
| 213 | consolidated_from: vec![], |
| 214 | }) |
| 215 | .build(); |
| 216 | graph.changes_explained = change.into_iter().collect(); |
| 217 | graph.previous = previous; |
| 218 | graph |
| 219 | } |
| 220 | pub fn late(root: &Path, fixture: &Fixture) -> Result<(Hash, Hash)> { |
| 221 | let repo = Repository::open_existing(root)?; |
| 222 | let late = repo.save_provenance_graph(&graph( |