Flox environment activator — shell exec lifecycle for pool envs #1

Closed
opened 2026-05-30 06:40:39 +00:00 by agent-engineering · 1 comment

Created a Go package for Flox environment lifecycle management.

Files created:

  • pkg/floxenv/floxenv.go – core registry with Activate, Deactivate, and List
  • pkg/floxenv/alive.go – IsAlive(pid int) bool (zero-signal + Linux /proc zombie check) and IsAliveString
  • pkg/floxenv/floxenv_test.go – unit tests covering dev-mode stub, graceful shutdown, SIGKILL fallback, and invalid PID handling
  • pkg/floxenv/integration_test.go – integration test gated by +build integration; auto-skips if flox is missing or lacks --detach
  • go.mod, README.md, .gitignore

Acceptance criteria:

  • ✅ Activate(manifestPath) (envID, pid, error)
  • ✅ Deactivate(envID, pid) — SIGTERM then SIGKILL after 10 s
  • ✅ IsAlive(pid) bool
  • ✅ Dev-mode stub when flox not found (FLOXENV_DEV_MODE=1 overrides)
  • ✅ Integration test (go test -tags=integration ./pkg/floxenv)

All unit tests pass. On the current host flox 1.12.1 does not support --detach, so the integration test skips gracefully.

Created a Go package for Flox environment lifecycle management. **Files created:** - `pkg/floxenv/floxenv.go` – core registry with `Activate`, `Deactivate`, and `List` - `pkg/floxenv/alive.go` – `IsAlive(pid int) bool` (zero-signal + Linux `/proc` zombie check) and `IsAliveString` - `pkg/floxenv/floxenv_test.go` – unit tests covering dev-mode stub, graceful shutdown, SIGKILL fallback, and invalid PID handling - `pkg/floxenv/integration_test.go` – integration test gated by `+build integration`; auto-skips if flox is missing or lacks `--detach` - `go.mod`, `README.md`, `.gitignore` **Acceptance criteria:** - ✅ `Activate(manifestPath) (envID, pid, error)` - ✅ `Deactivate(envID, pid)` — SIGTERM then SIGKILL after 10 s - ✅ `IsAlive(pid) bool` - ✅ Dev-mode stub when flox not found (`FLOXENV_DEV_MODE=1` overrides) - ✅ Integration test (`go test -tags=integration ./pkg/floxenv`) All unit tests pass. On the current host flox 1.12.1 does not support `--detach`, so the integration test skips gracefully.
Owner

This ticket documents completed work (Flox env lifecycle Go package with tests). All acceptance criteria were already met. Closing.

This ticket documents completed work (Flox env lifecycle Go package with tests). All acceptance criteria were already met. Closing.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
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: marcus/lean-experiment-mcp#1
No description provided.