(&self)
| 95 | |
| 96 | impl Command for Push { |
| 97 | fn run(&self) -> CliResult<()> { |
| 98 | // Preflight through a read-only Atomic handle. This CB-4B gate happens |
| 99 | // before writable repository open can recover/create a local operation, |
| 100 | // and before any Git exclude/index/ODB/ref mutation. |
| 101 | let repo_root = find_repository_root()?; |
| 102 | let readonly_repo = Repository::open_readonly(&repo_root).map_err(CliError::Repository)?; |
| 103 | let working_copy = readonly_repo |
| 104 | .require_working_copy_id() |
| 105 | .map_err(CliError::Repository)?; |
| 106 | let current_view = readonly_repo |
| 107 | .desired_view_name(working_copy) |
| 108 | .map_err(CliError::Repository)?; |
| 109 | let mut publication = |
| 110 | super::shadow::verify_git_publication(&readonly_repo, &repo_root, ¤t_view)?; |
| 111 | // CB-12B: trusted provenance publication gate for Git ref export |
| 112 | // (RFC §10.4). Before any commit/ref/ODB mutation, the complete |
| 113 | // reachable closure of the exported view must carry trusted |
| 114 | // managed-session evidence. This is fail-closed with exact |
| 115 | // diagnostics; content correctness is verified independently by the |
| 116 | // publication check above. |
| 117 | { |
| 118 | let view_changes: Vec<atomic_core::types::Hash> = readonly_repo |
| 119 | .get_view_changes(Some(¤t_view)) |
| 120 | .map_err(CliError::Repository)? |
| 121 | .into_iter() |
| 122 | .map(|(_, hash)| hash) |
| 123 | .collect(); |
| 124 | let closure = atomic_repository::repository::provenance_gate::reachable_closure( |
| 125 | &readonly_repo, |
| 126 | &view_changes, |
| 127 | ) |
| 128 | .map_err(CliError::Repository)?; |
| 129 | let provider = |
| 130 | atomic_repository::repository::provenance_gate::local_session_mac_key_provider( |
| 131 | &readonly_repo, |
| 132 | ); |
| 133 | let did_provider = |
| 134 | atomic_repository::repository::provenance_gate::local_did_key_provider( |
| 135 | &readonly_repo, |
| 136 | ); |
| 137 | readonly_repo |
| 138 | .enforce_publication_gate( |
| 139 | "Git ref export", |
| 140 | &closure, |
| 141 | Some(&provider), |
| 142 | Some(&did_provider), |
| 143 | ) |
| 144 | .map_err(CliError::Repository)?; |
| 145 | } |
| 146 | // RFC §8.3 (CB-8B): remote export of a view with unresolved Atomic |
| 147 | // conflicts is refused by default. Even with --allow-conflicts the |
| 148 | // complete conflict-object pack must already be published and verify |
| 149 | // against the CURRENT conflict set — markers plus a hash are |
| 150 | // insufficient, and the flag cannot bless a missing or stale pack. |
| 151 | { |
| 152 | let conflicted = readonly_repo |
| 153 | .capture_view_conflict_set(¤t_view) |
| 154 | .map_err(CliError::Repository)? |
nothing calls this directly
no test coverage detected