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 <omx@oh-my-codex.dev>
This commit is contained in:
bellman
2026-05-14 17:51:47 +09:00
parent 307b23d27f
commit 43b182882a

View File

@@ -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")