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

Function doctor_check

atomic-cli/src/commands/rpc.rs:3245–3278  ·  view source on GitHub ↗

`atomic doctor check` over CheckRepository — the read-only consistency check. Rendered to mirror the in-process path exactly (non-zero exit when problems are found).

(_args: &super::doctor::Check)

Source from the content-addressed store, hash-verified

3243/// check. Rendered to mirror the in-process path exactly (non-zero exit
3244/// when problems are found).
3245pub fn doctor_check(_args: &super::doctor::Check) -> CliResult<bool> {
3246 let Some(session) = Service::open()? else {
3247 return Ok(false);
3248 };
3249 let request = pb::CheckRepositoryRequest {
3250 repository: Some(session.reference.clone()),
3251 };
3252 let response = session.check_repository(request)?;
3253
3254 println!("Verifying working-copy consistency against the graph...");
3255 print_info(&format!(
3256 "Checked {} clean file(s); {} with uncommitted edits skipped; {} conflicted.",
3257 response.clean_files_checked, response.uncommitted_skipped, response.conflicted_files
3258 ));
3259
3260 if response.consistent {
3261 print_success("Working copy is consistent with the graph.");
3262 return Ok(true);
3263 }
3264
3265 print_warning(&format!("{} problem(s) found:", response.findings.len()));
3266 for finding in &response.findings {
3267 println!(" ✗ {finding}");
3268 }
3269 print_hint(
3270 "Materialization drift can often be repaired by re-materializing \
3271 (e.g. `atomic view switch <current-view>`); conflict-state \
3272 disagreements indicate a bug worth reporting.",
3273 );
3274 Err(CliError::Internal(anyhow::anyhow!(
3275 "working-copy verification found {} problem(s)",
3276 response.findings.len()
3277 )))
3278}
3279
3280/// `atomic doctor repair-dependency-index` over MaintenanceService.Repair.
3281pub fn doctor_repair_dependency_index(

Callers 1

runMethod · 0.85

Calls 7

print_infoFunction · 0.85
print_successFunction · 0.85
print_warningFunction · 0.85
print_hintFunction · 0.85
openFunction · 0.50
cloneMethod · 0.45
check_repositoryMethod · 0.45

Tested by

no test coverage detected