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

Method append_human_gate

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

172 ///
173 /// Returns the new node's ID.
174 pub fn append_human_gate(&mut self, reason: &str, timestamp: i64) -> String {
175 let summary = truncate_prompt(reason, 200);
176 let mut node = GraphNode::new(self.next_id(), NodeKind::HumanGate, timestamp, &summary);
177 node.detail = Some(serde_json::json!({
178 "reason": reason,
179 "resolved": false,
180 }));
181
182 let node_id = node.id.clone();
183
184 // Edge: last_node --blocked_by-→ gate
185 if let Some(ref prev) = self.last_node {
186 self.edges.push(GraphEdge::new(
187 prev.clone(),
188 node_id.clone(),
189 EdgeKind::BlockedBy,
190 ));
191 self.stats.edge_count += 1;
192 }
193
194 self.pending_human_gate = Some(node_id.clone());
195
196 self.push_node(node);
197 node_id
198 }
199
200 /// Append a patch proposal node (change recorded).
201 ///

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