Skip to content

instrument_settings

instrument_settings

Typed score-facing instrument overrides shared by all four scopes.

Attributes

EffortLevel module-attribute

EffortLevel = Literal['minimal', 'low', 'medium', 'high', 'xhigh', 'max']

Marianne's reasoning-effort vocabulary (GH #535), lowest first.

A score names one of these; each instrument profile maps it to its harness's own word in its effort: block. The words are the ones Claude Code, Antigravity and Codex print for their reasoning control (low .. max) plus minimal, "the least reasoning this seat offers", which OpenAI-family models and opencode variants name and which a profile whose lowest native level is low maps to low. none (reasoning off) and Codex's ultra (adds task delegation) are different requests and are not levels.

Classes

InstrumentSettings

Bases: BaseModel, Mapping[str, Any]

Only declared instrument knobs are accepted; unset knobs do not override.

Functions:

coerce_first_output_timeout

coerce_first_output_timeout(value)

Single enforcement point for a first_output_timeout_seconds override.

Shared by the pydantic schema below and adapter dispatch validation so YAML loading and direct Sheet callers that bypass YAML cannot drift apart. Accepts a finite positive number (numeric strings included); refuses booleans, zero, negatives, nonfinite values, and garbage.

Source code in src/marianne/core/config/instrument_settings.py
def coerce_first_output_timeout(value: Any) -> float:
    """Single enforcement point for a first_output_timeout_seconds override.

    Shared by the pydantic schema below and adapter dispatch validation so
    YAML loading and direct ``Sheet`` callers that bypass YAML cannot drift
    apart. Accepts a finite positive number (numeric strings included);
    refuses booleans, zero, negatives, nonfinite values, and garbage.
    """
    if isinstance(value, bool):
        raise ValueError(
            "first_output_timeout_seconds must be a duration, not a boolean"
        )
    bound = float(value)
    if not math.isfinite(bound) or bound <= 0:
        raise ValueError("first_output_timeout_seconds must be finite and positive")
    return bound