Skip to content

instrument_effort

instrument_effort

Reasoning-effort check (V335, GH #535).

instrument_config.effort names a level of Marianne's vocabulary (the schema refuses any other word); whether it can run depends on the RESOLVED profile's effort: mapping and, when a model row carries effort_levels, on the model. The schema cannot see either, so this check resolves every sheet (and every fallback entry that carries its own effort) to its profile and model and refuses what dispatch would refuse, in the same words (InstrumentProfile.effort_refusal), before a run is paid for.

Classes

SheetEffortCheck

V335 (ERROR): instrument_config.effort the resolved profile cannot apply.

Refusals, one code: the profile declares no effort: mapping; the level is not mapped by the profile (or by the resolved model's effort_levels); the sheet is a schema sheet (response_format) and the level is outside effort.schema_levels (claude-code refuses max there: with --json-schema it emits nothing until the sheet timeout); or the sheet runs interactively on a mapping marked interactive: false. Dispatch refuses the same sheets, so this is an ERROR, not advice. An unregistered instrument name is V210's finding and is skipped here.

Functions:

shadowed_builtin_sentence

shadowed_builtin_sentence(profile, mapping)

One sentence when a higher-layer file hides a builtin's mapping block (GH #543).

Empty unless a builtin of the same name declares mapping and the resolved profile came from a different (organization or venue) file.

Source code in src/marianne/validation/checks/instrument_effort.py
def shadowed_builtin_sentence(profile: InstrumentProfile, mapping: str) -> str:
    """One sentence when a higher-layer file hides a builtin's ``mapping`` block (GH #543).

    Empty unless a builtin of the same name declares ``mapping`` and the
    resolved profile came from a different (organization or venue) file.
    """
    source = profile._source_path
    if source is None:
        return ""
    try:
        from marianne.instruments.loader import InstrumentProfileLoader, profile_source_dirs

        builtins_dir = profile_source_dirs()[0]
        if source.parent == builtins_dir.resolve():
            return ""
        builtin = InstrumentProfileLoader.load_directories([builtins_dir]).get(profile.name)
    except Exception:  # noqa: BLE001 — message text only; never block the finding
        return ""
    if builtin is None or getattr(builtin, mapping, None) is None:
        return ""
    return (
        f" The builtin '{profile.name}' declares {mapping}:, but {source.name} "
        f"({source.parent}) shadows it whole; `extends: {profile.name}` in that file "
        f"inherits it."
    )