"""Adapter-profile compatibility gates for Paperclip migration."""
from __future__ import annotations

import importlib.util
from pathlib import Path

_SCRIPT = Path(__file__).resolve().parents[2] / "scripts" / "adapter_profiles.py"
_spec = importlib.util.spec_from_file_location("adapter_profiles", _SCRIPT)
profiles = importlib.util.module_from_spec(_spec)
_spec.loader.exec_module(profiles)


def test_codex_local_profile_accepts_openai_model_ids():
    assert profiles.model_matches_provider("gpt-5.3-codex", "codex_local")
    assert profiles.model_matches_provider("o4-mini", "codex_local")
    assert profiles.model_matches_provider("codex-mini-latest", "codex_local")


def test_codex_local_profile_rejects_foreign_model_ids():
    assert not profiles.model_matches_provider("claude-opus-4-8", "codex_local")
    assert not profiles.model_matches_provider("gemini-3.1-pro-preview", "codex_local")
