Skip to content

Refactor: remove runtime_dir from LifecycleError domain error variants #137

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions