From 43b182882aab2ef58a772683f2d3561fa884e5e7 Mon Sep 17 00:00:00 2001 From: bellman Date: Thu, 14 May 2026 17:51:47 +0900 Subject: [PATCH] Lock doctor JSON boot preflight contract Constraint: G003 boot/session work adds a structured doctor boot-preflight check that must be visible in JSON output. Rejected: reducing the doctor check count back to six | boot preflight is an explicit G003 acceptance surface. Confidence: high Scope-risk: narrow Directive: Keep doctor/status JSON contract tests aligned with boot_preflight schema fields when extending preflight diagnostics. Tested: git diff --check; cargo fmt --manifest-path rust/Cargo.toml --all -- --check; cargo test --manifest-path rust/Cargo.toml -p runtime trusted_roots -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p runtime startup -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p runtime worker_boot -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p tools path_scope -- --nocapture; cargo test --manifest-path rust/Cargo.toml -p rusty-claude-cli --test output_format_contract -- --nocapture; cargo check --manifest-path rust/Cargo.toml --workspace Not-tested: full cargo test --workspace remains deferred during active G003 team reconciliation. Co-authored-by: OmX --- .../tests/output_format_contract.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/rust/crates/rusty-claude-cli/tests/output_format_contract.rs b/rust/crates/rusty-claude-cli/tests/output_format_contract.rs index 56f9751e..aba37f94 100644 --- a/rust/crates/rusty-claude-cli/tests/output_format_contract.rs +++ b/rust/crates/rusty-claude-cli/tests/output_format_contract.rs @@ -310,7 +310,7 @@ fn doctor_and_resume_status_emit_json_when_requested() { assert!(summary["failures"].as_u64().is_some()); let checks = doctor["checks"].as_array().expect("doctor checks"); - assert_eq!(checks.len(), 6); + assert_eq!(checks.len(), 7); let check_names = checks .iter() .map(|check| { @@ -327,6 +327,7 @@ fn doctor_and_resume_status_emit_json_when_requested() { "config", "install source", "workspace", + "boot preflight", "sandbox", "system" ] @@ -352,6 +353,18 @@ fn doctor_and_resume_status_emit_json_when_requested() { assert!(workspace["cwd"].as_str().is_some()); assert!(workspace["in_git_repo"].is_boolean()); + let boot_preflight = checks + .iter() + .find(|check| check["name"] == "boot preflight") + .expect("boot preflight check"); + assert!(boot_preflight["boot_preflight"]["repo"]["exists"].is_boolean()); + assert!( + boot_preflight["boot_preflight"]["branch_freshness"]["behind"] + .as_u64() + .is_some() + ); + assert!(boot_preflight["boot_preflight"]["required_binaries"].is_array()); + let sandbox = checks .iter() .find(|check| check["name"] == "sandbox")