Background
Identified during code review of #128 (Define local daemon observability).
LifecycleError::LaunchDaemon and LifecycleError::StartupFailed in crates/weaver-cli/src/lifecycle/error.rs both carry a runtime_dir: PathBuf field. This field is used exclusively by the CLI guidance layer (crates/weaver-cli/src/actionable_guidance.rs) to derive the weaverd.health path and surface it in actionable alternatives.
Injecting a filesystem path into a domain error type for the benefit of an adapter (the CLI output layer) violates the domain/adapter boundary.
Proposed direction
Remove runtime_dir from LifecycleError::LaunchDaemon and LifecycleError::StartupFailed. Thread the runtime directory separately through the CLI layer's context so that actionable_guidance.rs can derive the health-snapshot path without requiring the domain error to carry infrastructure-specific state.
Affected files
crates/weaver-cli/src/lifecycle/error.rs
crates/weaver-cli/src/lifecycle/spawning.rs
crates/weaver-cli/src/lifecycle/monitoring.rs
crates/weaver-cli/src/actionable_guidance.rs
crates/weaver-cli/src/tests/unit/actionable_guidance.rs
References
Background
Identified during code review of #128 (Define local daemon observability).
LifecycleError::LaunchDaemonandLifecycleError::StartupFailedincrates/weaver-cli/src/lifecycle/error.rsboth carry aruntime_dir: PathBuffield. This field is used exclusively by the CLI guidance layer (crates/weaver-cli/src/actionable_guidance.rs) to derive theweaverd.healthpath and surface it in actionable alternatives.Injecting a filesystem path into a domain error type for the benefit of an adapter (the CLI output layer) violates the domain/adapter boundary.
Proposed direction
Remove
runtime_dirfromLifecycleError::LaunchDaemonandLifecycleError::StartupFailed. Thread the runtime directory separately through the CLI layer's context so thatactionable_guidance.rscan derive the health-snapshot path without requiring the domain error to carry infrastructure-specific state.Affected files
crates/weaver-cli/src/lifecycle/error.rscrates/weaver-cli/src/lifecycle/spawning.rscrates/weaver-cli/src/lifecycle/monitoring.rscrates/weaver-cli/src/actionable_guidance.rscrates/weaver-cli/src/tests/unit/actionable_guidance.rsReferences