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

Function activity_id_for

atomic-cli/src/commands/provenance/mapping.rs:26–31  ·  view source on GitHub ↗

Build a unique activity id for a turn's graph. All turns of one session share `session_id`, so keying the activity purely on `session_id` would collide across turns. We disambiguate with the explained change's base32 so each turn-activity is uniquely addressable (and `turnParent` resolution stays consistent with this scheme). The id is keyed on the GRAPH itself — ` #<first-explained-c

(graph: &ProvenanceGraph)

Source from the content-addressed store, hash-verified

24/// of which of its explained changes was traced, so a child turn's `turnParent`
25/// reference to it always matches.
26pub fn activity_id_for(graph: &ProvenanceGraph) -> String {
27 match graph.changes_explained.first() {
28 Some(h) => format!("{}#{}", graph.session_id, h.to_base32()),
29 None => graph.session_id.clone(),
30 }
31}
32
33/// Map a loaded `ProvenanceGraph` into the plain projector input.
34///

Callers 1

map_graph_to_inputFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected