setup
setup
¶
Shared execution setup — pure functions with no UI dependencies.
Consolidates the component creation logic that was duplicated between
cli/commands/_shared.py and daemon/job_service.py. Both paths
now call these functions:
- CLI wraps them with Rich console output for verbosity.
- Daemon calls them directly (no console).
This eliminates the "mirrors _shared.py" comments in job_service.py and ensures that adding a new backend type only requires updating one place.
Classes¶
Functions¶
create_backend_from_config
¶
Create the appropriate execution backend from a BackendConfig.
Supports: claude_cli, anthropic_api, recursive_light, ollama.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
backend_config
|
BackendConfig
|
Backend configuration with type and settings. |
required |
Returns:
| Type | Description |
|---|---|
Backend
|
Configured Backend instance. |
Source code in src/marianne/execution/setup.py
create_backend
¶
Create the appropriate execution backend from job config.
Convenience wrapper around create_backend_from_config that
extracts the backend config from a full job config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with backend settings. |
required |
Returns:
| Type | Description |
|---|---|
Backend
|
Configured Backend instance. |
Source code in src/marianne/execution/setup.py
setup_learning
¶
Setup outcome store and global learning store if learning is enabled.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with learning settings. |
required |
global_learning_store_override
|
GlobalLearningStore | None
|
If provided, use this store instead of the module-level singleton. The daemon injects its shared LearningHub store here to avoid opening a second SQLite connection. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[OutcomeStore | None, GlobalLearningStore | None]
|
Tuple of (outcome_store, global_learning_store), either may be None. |
Source code in src/marianne/execution/setup.py
setup_notifications
¶
Setup notification manager from config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with notification settings. |
required |
Returns:
| Type | Description |
|---|---|
NotificationManager | None
|
NotificationManager if notifications configured, else None. |
Source code in src/marianne/execution/setup.py
setup_grounding
¶
Setup grounding engine with hooks from config.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Job configuration with grounding settings. |
required |
Returns:
| Type | Description |
|---|---|
GroundingEngine | None
|
GroundingEngine if grounding enabled, else None. |
Source code in src/marianne/execution/setup.py
create_state_backend
¶
Create state persistence backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workspace
|
Path
|
Workspace directory for state files. |
required |
backend_type
|
str
|
"json" or "sqlite". |
'json'
|
Returns:
| Type | Description |
|---|---|
StateBackend
|
Configured StateBackend instance. |