EMRY-005: DeployMode detection (embedded/sidecar/file) #53

Merged
vxfemboy merged 3 commits from emry-005-deploy-mode into main 2026-06-25 01:43:29 +00:00
vxfemboy commented 2026-06-25 01:02:17 +00:00 (Migrated from github.com)

Closes EMRY-005 (#6). Branched off main.

What

crates/emry-core/src/mode.rsDeployMode (Embedded/Sidecar/File), DeployEnv inputs struct, FromStr/Display, ParseDeployModeError.

Precedence: API override → EMRY_MODE → auto-detect (SSH/SLURM → sidecar, TTY → embedded, else file). Detection logic is a pure function of DeployEnv; only from_env()/detect() touch the real environment — so resolution is tested with deterministic table-driven cases, no racy global-env mutation.

Module doc is the canonical EMRY_MODE/EMRY_LIVE/EMRY_SOCKET/EMRY_LOG_DIR reference.

Verification

  • ./scripts/pre-commit-rust.sh green: fmt, clippy -D warnings, tests, mode.rs 99% lines
  • Table covers all 7 spec branches + empty/whitespace EMRY_MODE (pinned so the Python mirror EMRY-031 matches)

Review

No bugs found. Added the empty/whitespace-EMRY_MODE cases per review to lock the contract for EMRY-031.

Closes EMRY-005 (#6). Branched off `main`. ## What `crates/emry-core/src/mode.rs` — `DeployMode` (Embedded/Sidecar/File), `DeployEnv` inputs struct, `FromStr`/`Display`, `ParseDeployModeError`. Precedence: **API override → `EMRY_MODE` → auto-detect** (SSH/SLURM → sidecar, TTY → embedded, else file). Detection logic is a **pure** function of `DeployEnv`; only `from_env()`/`detect()` touch the real environment — so resolution is tested with deterministic table-driven cases, no racy global-env mutation. Module doc is the canonical `EMRY_MODE`/`EMRY_LIVE`/`EMRY_SOCKET`/`EMRY_LOG_DIR` reference. ## Verification - `./scripts/pre-commit-rust.sh` green: fmt, clippy `-D warnings`, tests, mode.rs 99% lines - Table covers all 7 spec branches + empty/whitespace `EMRY_MODE` (pinned so the Python mirror EMRY-031 matches) ## Review No bugs found. Added the empty/whitespace-`EMRY_MODE` cases per review to lock the contract for EMRY-031.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
femboy/emry!53
No description provided.