Native repair refuses unrepairable authority in a read-only handler preflight.
()
| 3207 | |
| 3208 | /// Native repair refuses unrepairable authority in a read-only handler preflight. |
| 3209 | pub fn doctor_repair_native_indexes() -> CliResult<()> { |
| 3210 | let root = super::find_repository_root()?; |
| 3211 | let session = Service::open_root(&root)?.ok_or_else(|| CliError::InvalidArgument { |
| 3212 | message: "native-index repair requires a local repository service".into(), |
| 3213 | })?; |
| 3214 | print_info("Rebuilding native derived indexes from graph authority..."); |
| 3215 | let outcome = session.repair(pb::RepairRequest { |
| 3216 | repository: Some(session.reference.clone()), |
| 3217 | meta: request_meta(), |
| 3218 | action: pb::RepairAction::RebuildNativeIndexes as i32, |
| 3219 | force: false, |
| 3220 | view: String::new(), |
| 3221 | })?; |
| 3222 | if outcome.native_already_healthy { |
| 3223 | print_success(&format!( |
| 3224 | "Native derived indexes are already consistent ({} rows).", |
| 3225 | outcome.native_rows_written |
| 3226 | )); |
| 3227 | } else { |
| 3228 | print_success(&format!( |
| 3229 | "Repaired {} native derived-index problem(s); wrote {} rows atomically{}.", |
| 3230 | outcome.native_problems_repaired, |
| 3231 | outcome.native_rows_written, |
| 3232 | outcome |
| 3233 | .native_operation |
| 3234 | .map(|operation| format!("; journaled as operation {operation}")) |
| 3235 | .unwrap_or_default() |
| 3236 | )); |
| 3237 | } |
| 3238 | Ok(()) |
| 3239 | } |
| 3240 | |
| 3241 | /// `atomic doctor check` over CheckRepository — the read-only consistency |
| 3242 | /// check. Rendered to mirror the in-process path exactly (non-zero exit |
no test coverage detected