mando-cli Codebase Cleanup

Path Update

All src/v2/ paths referenced below were flattened to src/ root on 2026-04-09. E.g. src/v2/telemetry/metrics.rs is now src/telemetry/metrics.rs.

Result

MetricBeforeAfter
Compiler warnings1160
Errors00
Tests passing6161
Dead files removed-~15
Unused deps removed-4

Files Deleted

Telemetry (3 files)

  • src/v2/telemetry/metrics.rs - BessMetrics, MetricEntry
  • src/v2/telemetry/collector.rs - LocalCollector, CollectorHandle
  • src/v2/telemetry/report.rs - DiagnosticBundle, SystemInfo, RepoState, ContainerState + 5 functions

Network (1 file)

  • src/v2/network/wiremock.rs - 247 lines, 7 structs, 1 function

Runtime (6 files)

  • docker.rs - all todo!() stubs
  • host.rs - all todo!() stubs
  • builder.rs - unused BuilderContext
  • manifest.rs - unused ServiceBuildManifest, BuildStrategy, RunError, HealthState
  • monitor.rs - unused RunningServiceMonitor trait
  • runner.rs - unused ArtifactRunner trait, RunSpec, RunError

Git (1 file)

  • src/v2/workspace/git/ssh.rs - unused ssh_has_alpiq function

Dead Code Removed (in active files)

  • MandoWorkspaceProject::with_state() - never called
  • MandoWorkspaceProject::clone_all() - never called
  • Unused imports: CloneProtocol, TracingGuard, runner::*, FlywayMigrationRunner re-exports
  • TelemetryError simplified to just TracingInit variant

Dependencies Removed

  • dialoguer - never referenced
  • reqwest - was used by deleted wiremock/report
  • open - was used by deleted report.rs
  • tokio-stream - never referenced

Bug Fixes

  • edition = "2024" to "2021" in Cargo.toml (2024 is not a valid Rust edition)
  • Lifetime error in ssh.rs (Output::lines() borrow)
  • Clippy: .map().flatten() to .and_then() in vfs.rs
  • Clippy: .filter_map(|x| x) to .flatten() in vfs.rs
  • Clippy: .clone() on double reference in dotenv.rs and profile.rs

Post-Cleanup Architecture

Runtime module (9 files to 4)

  • artifact.rs - BuiltArtifact struct (used by state management)
  • build_profile.rs - BuildProfile, ServiceBuildDef (used by build + profile commands)
  • docker_client.rs - DockerClient with build/pull/container lifecycle (used by build, up, down, volume commands)
  • infra.rs - ContainerSpec definitions for postgres, wiremock (used by up, volume commands)

Telemetry module (5 files to 2)

  • error.rs - TelemetryError enum
  • tracing_setup.rs - init_tracing function (used by main.rs)

What still works

All 13 commands remain functional. Build, pull, status, config, profile, mock, migrate, volume, init, up, down, override, release (debug-only).