Skip to content

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

Merged
vxfemboy merged 3 commits into
mainfrom
emry-005-deploy-mode
Jun 25, 2026
Merged

vxfemboy merged 3 commits into
mainfrom
emry-005-deploy-mode

Conversation

@vxfemboy

Copy link
Copy Markdown
Member

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.

vxfemboy added 3 commits June 24, 2026 21:00
Pure DeployMode::resolve(api, &DeployEnv) with precedence api > EMRY_MODE >
auto-detect (SSH/SLURM -> sidecar, TTY -> embedded, else file). DeployEnv::
from_env() reads real env + stdout TTY; detection logic stays pure for
deterministic table-driven tests. FromStr/Display, ParseDeployModeError.
Module doc lists EMRY_MODE/EMRY_LIVE/EMRY_SOCKET/EMRY_LOG_DIR.
@vxfemboy
vxfemboy merged commit 8c043be into main Jun 25, 2026
3 checks passed
@vxfemboy vxfemboy mentioned this pull request Jun 25, 2026
3 tasks
@vxfemboy
vxfemboy deleted the emry-005-deploy-mode branch July 2, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant