mirror of
https://github.com/instructkr/claw-code.git
synced 2026-05-18 21:41:26 +08:00
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:
@@ -310,7 +310,7 @@ fn doctor_and_resume_status_emit_json_when_requested() {
|
|||||||
assert!(summary["failures"].as_u64().is_some());
|
assert!(summary["failures"].as_u64().is_some());
|
||||||
|
|
||||||
let checks = doctor["checks"].as_array().expect("doctor checks");
|
let checks = doctor["checks"].as_array().expect("doctor checks");
|
||||||
assert_eq!(checks.len(), 6);
|
assert_eq!(checks.len(), 7);
|
||||||
let check_names = checks
|
let check_names = checks
|
||||||
.iter()
|
.iter()
|
||||||
.map(|check| {
|
.map(|check| {
|
||||||
@@ -327,6 +327,7 @@ fn doctor_and_resume_status_emit_json_when_requested() {
|
|||||||
"config",
|
"config",
|
||||||
"install source",
|
"install source",
|
||||||
"workspace",
|
"workspace",
|
||||||
|
"boot preflight",
|
||||||
"sandbox",
|
"sandbox",
|
||||||
"system"
|
"system"
|
||||||
]
|
]
|
||||||
@@ -352,6 +353,18 @@ fn doctor_and_resume_status_emit_json_when_requested() {
|
|||||||
assert!(workspace["cwd"].as_str().is_some());
|
assert!(workspace["cwd"].as_str().is_some());
|
||||||
assert!(workspace["in_git_repo"].is_boolean());
|
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
|
let sandbox = checks
|
||||||
.iter()
|
.iter()
|
||||||
.find(|check| check["name"] == "sandbox")
|
.find(|check| check["name"] == "sandbox")
|
||||||
|
|||||||
Reference in New Issue
Block a user