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

Function doctor_check

atomic-cli/src/commands/rpc.rs:3244–3277  ·  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

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

Callers 1

runMethod · 0.85

Calls 7

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

Tested by

no test coverage detected