1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Per-subcommand handler modules.
//!
//! Each `cmd::<name>` module owns:
//! * its `handle_<name>` entry point (called from `main()`'s
//! dispatch),
//! * any helpers / constants that exist *only* to serve that
//! handler (validation logic, atomic-write policy, doctor env-
//! info builders).
//!
//! What lives at the crate root instead:
//! * `Cli` / `Commands` (clap derive) — CLI surface, not handler
//! internals.
//! * `AppContext` / `OptionalContext` — runtime assembly used by
//! multiple handlers.
//! * `CmdOutcome` / `CmdResult` — the contract every handler
//! returns through.
//! * `Spinner`, `resolve_config`, `compute_precache_fingerprint` —
//! pre-handler utilities.
//!
//! What lives in `util/` instead: leaf helpers that have *no*
//! command-specific policy (shell detection, the
//! `command_exists` factory, the y/N prompt). See `util/mod.rs`.
//!
//! ## Layering
//!
//! `cmd → app → {domain, infra}`. Handlers must not import
//! `crate::domain::expand` / `crate::domain::hook` / orchestration
//! symbols from `domain::shell` directly — go through `app::*`
//! use-case wrappers instead. The
//! `runex/tests/architecture.rs::no_cmd_to_domain_behavior_imports`
//! test pins the contract.