clone
clone
¶
Conductor clone support — isolated conductor instances for safe testing.
When --conductor-clone is passed to any Marianne CLI command, all daemon interactions are routed to a clone conductor instead of the production one. The clone owns its IPC and stdio MCP sockets, PID file, state DB, profiler files, and log file.
This enables safe testing of Marianne CLI commands and daemon features without risking the production conductor. The production conductor continues running undisturbed.
Usage
mzt start --conductor-clone # Start default clone mzt start --conductor-clone=staging # Start named clone mzt run score.yaml --conductor-clone # Submit to default clone mzt status --conductor-clone=staging # Query named clone
Architecture
- A module-level _clone_name stores the active clone (set by CLI callback)
- _resolve_socket_path() in detect.py checks get_clone_name() before falling back to SocketConfig defaults
- resolve_clone_paths() computes all isolated paths from a clone name
- build_clone_config() produces a DaemonConfig with clone-specific paths
Attributes¶
Classes¶
ClonePaths
dataclass
¶
Functions:¶
set_clone_name
¶
Set the active clone name. Called by CLI --conductor-clone callback.
Also establishes tmux-socket isolation: the conductor's startup orphan
sweep kills every mzt-* session on its tmux socket on the premise
that nothing else owns them — true for a lone conductor, FALSE when a
clone starts beside production. A clone therefore gets its own tmux
socket (exported via the env var every TmuxControl honors; fork-based
daemonization inherits it). An explicit pre-existing override wins.
Source code in src/marianne/daemon/clone.py
get_clone_name
¶
is_clone_active
¶
resolve_clone_paths
¶
Compute isolated paths for a clone instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Clone name (None or empty for default clone, string for named clone). |
required |
Returns:
| Type | Description |
|---|---|
ClonePaths
|
ClonePaths with socket, PID, state DB, and log paths. |
ClonePaths
|
Runtime artifacts (socket/PID/log) live in ~/.config/mzt (#227, |
ClonePaths
|
matching the production convention); state DB in ~/.marianne. |
Source code in src/marianne/daemon/clone.py
build_clone_config
¶
Build a DaemonConfig with clone-specific paths.
Inherits all non-path settings from base_config (or defaults). Overrides owned runtime, state, and profiler paths with clone-specific values. Configured stdio MCP sockets move into a conductor-specific directory; external transports retain their configured endpoints.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Clone name (None for default clone). |
required |
base_config
|
DaemonConfig | None
|
Production DaemonConfig to inherit from. |
None
|
Returns:
| Type | Description |
|---|---|
DaemonConfig
|
A DaemonConfig with isolated clone paths. |
Source code in src/marianne/daemon/clone.py
active_registry_db_path
¶
The registry DB of the conductor the CLI is currently addressing.
Production DAEMON_STATE_DB_PATH unless --conductor-clone selected
a clone, in which case the clone's own state DB (GH #401). Every offline
registry reader (recover, diagnose, status fallbacks, dashboard stream)
must go through this instead of the constant. Lives on the daemon side
because it depends on clone selection; core/ never imports daemon/
(GH #414).