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

Function print_cross_view_outcome

atomic-cli/src/commands/insert.rs:825–871  ·  view source on GitHub ↗

Print the outcome of a cross-view insert operation.

(outcome: &CrossViewInsertOutcome, dry_run: bool)

Source from the content-addressed store, hash-verified

823
824/// Print the outcome of a cross-view insert operation.
825pub(crate) fn print_cross_view_outcome(outcome: &CrossViewInsertOutcome, dry_run: bool) {
826 if let Some(review) = &outcome.review_approval {
827 print_review_approval(review);
828 }
829 println!();
830
831 if dry_run {
832 if outcome.applied_hashes.is_empty() {
833 output::print_info("Dry run: No changes would be inserted.");
834 } else {
835 output::print_info(&format!(
836 "Dry run: {} change(s) would be inserted",
837 outcome.applied_hashes.len()
838 ));
839
840 println!();
841 println!("Changes:");
842 for hash in &outcome.applied_hashes {
843 println!(" {}", format_hash(hash, true));
844 }
845 }
846 return;
847 }
848
849 if outcome.changes_applied == 0 {
850 output::print_success("No changes to insert - already up to date.");
851 } else {
852 output::print_success(&format!("Inserted {} change(s)", outcome.changes_applied));
853 println!(" New state: {}", outcome.new_state.to_base32());
854
855 if !outcome.skipped_hashes.is_empty() {
856 println!(
857 " Skipped: {} (already inserted)",
858 outcome.skipped_hashes.len()
859 );
860 }
861 }
862
863 if let Some(review) = &outcome.review_decision {
864 output::print_warning(&format!("Attested review {} · evidence readiness {:?} · user disposition {:?} · {} explicitly accepted degradation(s). Report {}. This is not a clean-code or independent-approval claim.",review.decision,review.readiness,review.disposition,review.accepted_degradations,review.report_hash));
865 }
866
867 if outcome.has_conflicts {
868 println!();
869 output::print_warning("Conflicts detected. Run 'atomic conflicts' to see details.");
870 }
871}
872
873pub(crate) fn print_review_approval(review: &atomic_repository::NativeReviewEvidence) {
874 output::print_info(&format!(

Callers 8

insert_from_viewFunction · 0.85
insert_up_to_tagFunction · 0.85
insert_changesFunction · 0.85
insert_promoteFunction · 0.85
run_promote_to_parentFunction · 0.85
run_view_insertFunction · 0.85
run_tagFunction · 0.85
run_change_insertFunction · 0.85

Calls 5

print_review_approvalFunction · 0.85
print_infoFunction · 0.85
print_successFunction · 0.85
print_warningFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected