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

Method append_human_gate

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

Append a human gate node (permission requested). Returns the new node's ID.

(&mut self, reason: &str, timestamp: i64)

Source from the content-addressed store, hash-verified

223 ///
224 /// Returns the new node's ID.
225 pub fn append_human_gate(&mut self, reason: &str, timestamp: i64) -> String {
226 let summary = truncate_prompt(reason, 200);
227 let mut node = GraphNode::new(self.next_id(), NodeKind::HumanGate, timestamp, &summary);
228 node.detail = Some(serde_json::json!({
229 "reason": reason,
230 "resolved": false,
231 }));
232
233 let node_id = node.id.clone();
234
235 // Edge: last_node --blocked_by-→ gate
236 if let Some(ref prev) = self.last_node {
237 self.edges.push(GraphEdge::new(
238 prev.clone(),
239 node_id.clone(),
240 EdgeKind::BlockedBy,
241 ));
242 self.stats.edge_count += 1;
243 }
244
245 self.pending_human_gate = Some(node_id.clone());
246
247 self.push_node(node);
248 node_id
249 }
250
251 /// Append a patch proposal node (change recorded).
252 ///

Calls 5

next_idMethod · 0.80
push_nodeMethod · 0.80
truncate_promptFunction · 0.70
cloneMethod · 0.45
pushMethod · 0.45

Tested by 5

test_human_gateFunction · 0.64
test_resolve_human_gateFunction · 0.64
test_stats_match_nodesFunction · 0.64