orchestrata_ultimate.verification.models.opus

Reference › orchestrata_ultimate › verification › models › opus

ClaudeOpusModel is the Claude Opus 4 wrapper, described as suited to complex reasoning and nuanced edge cases (Spec 035 US-005). It implements the LLMModel protocol from base_model under the name claude-opus-4, with a base URL defaulting to the Anthropic API host, and declares capabilities of reasoning and formal verification but not multilingual or fast iteration. As written, its three methods return fixed dictionaries and make no network request: verify returns status "verified" with the constraint id, analyze counts results whose status is "satisfied", and generate_proof returns the proof type logical_deduction. No module imports it inside the package.

At a glance

Source src/orchestrata_ultimate/verification/models/opus.py
Lines of code 73
Classes 1
Functions 0
Imports (internal) orchestrata_ultimate.core.base.traces
Imported by none
Tests that import it tests/verification/test_models.py, tests/verification/test_verification_models.py

Class diagram

Class diagram orchestrata_ultimate.verification.models.opus

Dependency diagram

Dependency diagram orchestrata_ultimate.verification.models.opus

API

Classes

ClaudeOpusModel

Decorators: traces(spec='035', story='US-005', reqs=['REQ-035-US-005-001', 'REQ-035-US-005-011', 'REQ-035-US-005-021']) · Line 18

Claude Opus 4 wrapper — complex reasoning, nuanced edge cases.

Method Signature Summary
__init__ __init__(api_key: str = '', base_url: str = 'https://api.anthropic.com') -> None
name property name() -> str
capabilities property capabilities() -> dict[str, bool]
verify async verify(constraint: dict[str, Any], context: dict[str, Any]) -> dict[str, Any]
analyze async analyze(results: list[dict[str, Any]]) -> dict[str, Any]
generate_proof async generate_proof(constraint: dict[str, Any], context: dict[str, Any]) -> dict[str, Any]

Source

Permalink: https://gitlab.com/MSamy/orchestrata-ultimate-architecture/-/blob/a4cbc2bdf/src/orchestrata_ultimate/verification/models/opus.py

"""Claude Opus 4 model wrapper for verification."""

# Spec: 035 - Verification Agent

import logging
from typing import Any

from orchestrata_ultimate.core.base.traces import traces

logger = logging.getLogger(__name__)


@traces(
    spec="035",
    story="US-005",
    reqs=["REQ-035-US-005-001", "REQ-035-US-005-011", "REQ-035-US-005-021"],
)
class ClaudeOpusModel:
    """Claude Opus 4 wrapper — complex reasoning, nuanced edge cases."""

    def __init__(
        self, api_key: str = "", base_url: str = "https://api.anthropic.com"
    ) -> None:
        self._api_key = api_key
        self._base_url = base_url

    @property
    @traces(
        spec="035", story="US-005", reqs=["REQ-035-US-005-001", "REQ-035-US-005-011"]
    )
    def name(self) -> str:
        return "claude-opus-4"

    @property
    @traces(
        spec="035", story="US-005", reqs=["REQ-035-US-005-001", "REQ-035-US-005-011"]
    )
    def capabilities(self) -> dict[str, bool]:
        return {
            "reasoning": True,
            "formal_verification": True,
            "multilingual": False,
            "fast_iteration": False,
        }

    @traces(spec="035", story="US-005", reqs=["REQ-035-US-005-021"])
    async def verify(
        self, constraint: dict[str, Any], context: dict[str, Any]
    ) -> dict[str, Any]:
        return {
            "model": self.name,
            "status": "verified",
            "constraint_id": constraint.get("id", ""),
        }

    @traces(
        spec="035", story="US-005", reqs=["REQ-035-US-005-001", "REQ-035-US-005-011"]
    )
    async def analyze(self, results: list[dict[str, Any]]) -> dict[str, Any]:
        satisfied = sum(1 for r in results if r.get("status") == "satisfied")
        return {"model": self.name, "total": len(results), "satisfied": satisfied}

    @traces(
        spec="035", story="US-005", reqs=["REQ-035-US-005-001", "REQ-035-US-005-011"]
    )
    async def generate_proof(
        self, constraint: dict[str, Any], context: dict[str, Any]
    ) -> dict[str, Any]:
        return {
            "model": self.name,
            "proof_type": "logical_deduction",
            "constraint_id": constraint.get("id", ""),
        }