Skip to main content

Module dev_home_guard

Module dev_home_guard 

Source
Expand description

A dev build started by hand must not run on the real AgentMux home.

task dev gives each dev build a data home of its own (scripts/dev-home.mjs) and says so in AGENTMUX_DEV_HOME_MODE (isolated or real) and AGENTMUX_HOME_OVERRIDE. A launcher or host started by hand from a dev output folder (dist/cef-dev*, target/debug, target/release) has neither, resolves ~/.agentmux, creates its dev/<branch>/<clone> folders there and starts a srv on the person’s own home. This refuses that start with one plain line.

The way in on purpose is AGENTMUX_DEV_USE_REAL_HOME=1, the same switch task dev honours.

Structs§

DevHomeEnv
What the guard reads from the environment, as set values only (an empty value is unset).

Functions§

refusal
Why a dev build must not start, or None. real_home is the person’s own ~/.agentmux.
refusal_for_process
refusal for this process when it runs from a dev build folder. exe_dir is the binary’s folder.
refuse_or_continue
Exits with code 2 and one line on stderr when refusal_for_process applies. Call first, before anything creates a folder, opens a store or starts a child.
refuse_or_continue_current_exe
refuse_or_continue for the folder this binary runs from.