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

Function print_trace

atomic-cli/src/commands/provenance/command.rs:348–368  ·  view source on GitHub ↗

Print the human-readable flywheel chain — the routed render: change -> activity -> generated -> agent -> person -> turnParent -> ... (the prior-turn chain arrives pre-walked on the wire).

(
    graphs: &[crate::commands::rpc::ProvenanceWireGraph],
    change_hash: &Hash,
    person_did: &str,
)

Source from the content-addressed store, hash-verified

346/// activity -> generated -> agent -> person -> turnParent -> ... (the
347/// prior-turn chain arrives pre-walked on the wire).
348fn print_trace(
349 graphs: &[crate::commands::rpc::ProvenanceWireGraph],
350 change_hash: &Hash,
351 person_did: &str,
352) {
353 println!(
354 "{} {}",
355 emphasis("Provenance for change"),
356 info(&change_hash.to_base32())
357 );
358 for (i, wire) in graphs.iter().enumerate() {
359 if graphs.len() > 1 {
360 println!(
361 "{}",
362 hint(&format!(" [graph {} of {}]", i + 1, graphs.len()))
363 );
364 }
365 print_activity_chain(&wire.input, &wire.prior_activities, wire.chain_truncated);
366 }
367 let _ = person_did;
368}
369
370/// The local fallback render (outside a routed repository): the same
371/// chain with the graphs walked live from the repository handle.

Callers 1

runMethod · 0.85

Calls 3

print_activity_chainFunction · 0.85
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected