Run the CB-7A anchoring phase for `shim enable`.
(root: &Path, options: &EnableAnchorOptions)
| 56 | |
| 57 | /// Run the CB-7A anchoring phase for `shim enable`. |
| 58 | pub(crate) fn run_enable_anchor(root: &Path, options: &EnableAnchorOptions) -> CliResult<()> { |
| 59 | if options.adopt_git { |
| 60 | return Err(adopt_git_refusal()); |
| 61 | } |
| 62 | match enable_anchor_inner(root, options) { |
| 63 | Ok(EnableAnchorOutcome::Anchored { |
| 64 | binding_id, |
| 65 | view, |
| 66 | git_head, |
| 67 | replayed, |
| 68 | }) => { |
| 69 | if replayed { |
| 70 | print_success(&format!( |
| 71 | "Anchor binding {binding_id} already exists; repeat enable changed nothing (view '{view}', Git HEAD {git_head})" |
| 72 | )); |
| 73 | } else { |
| 74 | print_success(&format!( |
| 75 | "Anchor binding {binding_id} created for view '{view}' at Git HEAD {git_head}; verified working-copy checkpoint written" |
| 76 | )); |
| 77 | } |
| 78 | print_info("Unbound Git adoption and --adopt-git remain unavailable until Phase 9 foreign synthesis (CB-9B/9C)."); |
| 79 | Ok(()) |
| 80 | } |
| 81 | Ok(EnableAnchorOutcome::NotAnchored { refusal }) => { |
| 82 | print_warning(&format!("shim anchor not created: {refusal}")); |
| 83 | Ok(()) |
| 84 | } |
| 85 | Err(error) => Err(error), |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | fn enable_anchor_inner( |
| 90 | root: &Path, |
no test coverage detected