mirror of
https://github.com/instructkr/claude-code.git
synced 2026-05-14 18:06:45 +00:00
Keep G003 integrated runtime tests compiling
Constraint: G003 worker outputs added config and startup evidence fields that must compile under focused runtime validation before leader push. Rejected: pushing auto-checkpoints without leader validation | integrated tests initially failed to compile due missing imports and stale StartupEvidenceBundle fixtures. Confidence: high Scope-risk: narrow Directive: When extending StartupEvidenceBundle, update all in-crate fixtures in the same change. 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 check --manifest-path rust/Cargo.toml --workspace Not-tested: full cargo test --workspace remains deferred during active G003 team work. Co-authored-by: OmX <omx@oh-my-codex.dev>
This commit is contained in:
@@ -1272,8 +1272,8 @@ fn push_unique(target: &mut Vec<String>, value: String) {
|
||||
mod tests {
|
||||
use super::{
|
||||
deep_merge_objects, parse_permission_mode_label, ConfigLoader, ConfigSource,
|
||||
McpServerConfig, McpTransport, ResolvedPermissionMode, RuntimeHookConfig,
|
||||
RuntimePluginConfig, CLAW_SETTINGS_SCHEMA_NAME,
|
||||
McpServerConfig, McpTransport, ResolvedPermissionMode, RuntimeFeatureConfig,
|
||||
RuntimeHookConfig, RuntimePluginConfig, CLAW_SETTINGS_SCHEMA_NAME,
|
||||
};
|
||||
use crate::json::JsonValue;
|
||||
use crate::sandbox::FilesystemIsolationMode;
|
||||
|
||||
@@ -1969,7 +1969,10 @@ mod tests {
|
||||
fn startup_evidence_bundle_serializes_correctly() {
|
||||
let bundle = StartupEvidenceBundle {
|
||||
last_lifecycle_state: WorkerStatus::Running,
|
||||
last_lifecycle_at: 1_234_567_889,
|
||||
pane_command: "test command".to_string(),
|
||||
pane_observed_at: 1_234_567_891,
|
||||
command_started_at: 1_234_567_800,
|
||||
prompt_sent_at: Some(1_234_567_890),
|
||||
prompt_acceptance_state: false,
|
||||
trust_prompt_detected: true,
|
||||
@@ -1977,7 +1980,9 @@ mod tests {
|
||||
tool_permission_prompt_age_seconds: None,
|
||||
tool_permission_allow_scope: None,
|
||||
transport_healthy: true,
|
||||
transport_health: StartupHealthSummary::observed("transport", true),
|
||||
mcp_healthy: false,
|
||||
mcp_health: StartupHealthSummary::observed("mcp", false),
|
||||
elapsed_seconds: 60,
|
||||
};
|
||||
|
||||
@@ -1999,7 +2004,10 @@ mod tests {
|
||||
fn classify_startup_failure_detects_transport_dead() {
|
||||
let evidence = StartupEvidenceBundle {
|
||||
last_lifecycle_state: WorkerStatus::Spawning,
|
||||
last_lifecycle_at: 1,
|
||||
pane_command: "test".to_string(),
|
||||
pane_observed_at: 2,
|
||||
command_started_at: 0,
|
||||
prompt_sent_at: None,
|
||||
prompt_acceptance_state: false,
|
||||
trust_prompt_detected: false,
|
||||
@@ -2007,7 +2015,9 @@ mod tests {
|
||||
tool_permission_prompt_age_seconds: None,
|
||||
tool_permission_allow_scope: None,
|
||||
transport_healthy: false,
|
||||
transport_health: StartupHealthSummary::observed("transport", false),
|
||||
mcp_healthy: true,
|
||||
mcp_health: StartupHealthSummary::observed("mcp", true),
|
||||
elapsed_seconds: 30,
|
||||
};
|
||||
|
||||
@@ -2019,7 +2029,10 @@ mod tests {
|
||||
fn classify_startup_failure_defaults_to_unknown() {
|
||||
let evidence = StartupEvidenceBundle {
|
||||
last_lifecycle_state: WorkerStatus::Spawning,
|
||||
last_lifecycle_at: 1,
|
||||
pane_command: "test".to_string(),
|
||||
pane_observed_at: 2,
|
||||
command_started_at: 0,
|
||||
prompt_sent_at: None,
|
||||
prompt_acceptance_state: false,
|
||||
trust_prompt_detected: false,
|
||||
@@ -2027,7 +2040,9 @@ mod tests {
|
||||
tool_permission_prompt_age_seconds: None,
|
||||
tool_permission_allow_scope: None,
|
||||
transport_healthy: true,
|
||||
transport_health: StartupHealthSummary::observed("transport", true),
|
||||
mcp_healthy: true,
|
||||
mcp_health: StartupHealthSummary::observed("mcp", true),
|
||||
elapsed_seconds: 10,
|
||||
};
|
||||
|
||||
@@ -2041,7 +2056,10 @@ mod tests {
|
||||
// Don't have prompt in flight (no prompt_sent_at) to avoid matching PromptAcceptanceTimeout
|
||||
let evidence = StartupEvidenceBundle {
|
||||
last_lifecycle_state: WorkerStatus::Spawning,
|
||||
last_lifecycle_at: 1,
|
||||
pane_command: "test".to_string(),
|
||||
pane_observed_at: 2,
|
||||
command_started_at: 0,
|
||||
prompt_sent_at: None, // No prompt sent yet
|
||||
prompt_acceptance_state: false,
|
||||
trust_prompt_detected: false,
|
||||
@@ -2049,7 +2067,9 @@ mod tests {
|
||||
tool_permission_prompt_age_seconds: None,
|
||||
tool_permission_allow_scope: None,
|
||||
transport_healthy: true,
|
||||
mcp_healthy: false, // MCP unhealthy but transport healthy suggests crash
|
||||
transport_health: StartupHealthSummary::observed("transport", true),
|
||||
mcp_healthy: false,
|
||||
mcp_health: StartupHealthSummary::observed("mcp", false), // MCP unhealthy but transport healthy suggests crash
|
||||
elapsed_seconds: 45,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user