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

Function build_forensic_report

atomic-cli/src/commands/status.rs:975–1216  ·  view source on GitHub ↗
(
    repo_root: &Path,
    atomic: &AtomicAnchorObservation,
    checkpoint: Option<&crate::commands::git::observation::ShimCheckpointObservation>,
    git: &GitObservation,
    eligibility: &Provisi

Source from the content-addressed store, hash-verified

973}
974
975fn build_forensic_report(
976 repo_root: &Path,
977 atomic: &AtomicAnchorObservation,
978 checkpoint: Option<&crate::commands::git::observation::ShimCheckpointObservation>,
979 git: &GitObservation,
980 eligibility: &ProvisionalCheckpointEligibility,
981 manifest_root: Option<&str>,
982) -> String {
983 let mut report = String::new();
984 let _ = writeln!(
985 report,
986 "Forensic status (read-only; reconciliation disabled)"
987 );
988 let _ = writeln!(report, "Atomic root: {}", repo_root.display());
989 let _ = writeln!(report, "Atomic view: {}", atomic.view);
990 let _ = writeln!(report, "Atomic state: {}", atomic.state);
991 match manifest_root {
992 Some(root) => {
993 let _ = writeln!(report, "Durable manifest root: {root}");
994 }
995 None => {
996 let _ = writeln!(
997 report,
998 "Durable manifest root: unavailable (non-colocated or projection refused)"
999 );
1000 }
1001 }
1002 let _ = writeln!(report, "Drift (observed, not classified):");
1003 for line in forensic_drift(checkpoint, atomic, git) {
1004 let _ = writeln!(report, " {line}");
1005 }
1006
1007 match checkpoint {
1008 Some(checkpoint) => {
1009 let _ = writeln!(report, "Shim checkpoint: present");
1010 let _ = writeln!(report, " view: {}", checkpoint.view);
1011 let _ = writeln!(report, " atomic state: {}", checkpoint.atomic_state);
1012 let _ = writeln!(report, " Git HEAD: {}", checkpoint.git_head);
1013 let _ = writeln!(report, " Git tree: {}", checkpoint.git_tree);
1014 }
1015 None => {
1016 let _ = writeln!(report, "Shim checkpoint: absent");
1017 }
1018 }
1019
1020 match git {
1021 GitObservation::NoGit { root } => {
1022 let _ = writeln!(report, "Git: not present");
1023 let _ = writeln!(report, " inspected root: {}", root.display());
1024 }
1025 GitObservation::Repository(repository) => {
1026 let _ = writeln!(report, "Git: present");
1027 let _ = writeln!(
1028 report,
1029 " worktree root: {}",
1030 repository
1031 .paths
1032 .worktree_root

Callers

nothing calls this directly

Calls 2

forensic_driftFunction · 0.85
write_raw_path_listFunction · 0.85

Tested by

no test coverage detected