registry
registry
¶
Instrument registry — the central lookup for all available instruments.
Combines native instruments (Marianne's 4 built-in backends) with config-loaded profiles from YAML files. The conductor creates a registry at startup, populates it with native instruments, then loads profiles from directories.
Native instruments map Marianne's existing Backend subclasses to InstrumentProfile
metadata. This lets the new instrument-based lookup coexist with the existing
backend system — scores using backend: continue to work unchanged, while
scores using instrument: resolve through this registry.
The registry is a simple dict wrapper. No caching, no lazy loading, no magic. Instruments are registered once at startup and looked up by name thereafter.
Usage
from marianne.instruments.registry import InstrumentRegistry, register_native_instruments
registry = InstrumentRegistry() register_native_instruments(registry)
... load profiles from directories ...¶
profile = registry.get("gemini-cli")
Classes¶
InstrumentRegistry
¶
Central registry for all available instruments.
A simple name-to-profile mapping with registration, lookup, and listing operations. Thread safety is not needed — the registry is populated at conductor startup before any concurrent access.
Source code in src/marianne/instruments/registry.py
Functions¶
register
¶
Register an instrument profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile
|
InstrumentProfile
|
The InstrumentProfile to register. |
required |
override
|
bool
|
If True, replace an existing profile with the same name. If False (default), raise ValueError on collision. |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If a profile with the same name is already registered and override is False. |
Source code in src/marianne/instruments/registry.py
get
¶
Look up an instrument by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The instrument name (e.g. 'claude_cli', 'gemini-cli'). |
required |
Returns:
| Type | Description |
|---|---|
InstrumentProfile | None
|
The InstrumentProfile, or None if not found. |
Source code in src/marianne/instruments/registry.py
Functions¶
register_native_instruments
¶
Register Marianne's 4 built-in backends as named instruments.
This bridges the native backend system (BackendConfig → Backend) with the new instrument system (InstrumentProfile → registry lookup). After calling this, the registry contains profiles for claude_cli, anthropic_api, ollama, and recursive_light.
Native instruments are registered first, before config-loaded profiles. Config profiles can override them with override=True if needed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
registry
|
InstrumentRegistry
|
The registry to populate. |
required |