from uuid import uuid4

from src.domain.l3_registry.schemas import L3CandidateCreate, L3ReviewAction


def test_l3_candidate_contract_defaults_to_project_scoped_experimental_candidate():
    project_id = uuid4()
    candidate = L3CandidateCreate(
        semantic="booking.waitlist",
        project_id=project_id,
        requirement_summary="Allow staff to waitlist unavailable booking slots.",
        gap_reason="The current admitted booking manifest has no waitlist lifecycle.",
        dependencies=["booking.reserve", "booking.resources"],
        proposed_contract={"operations": {"join": {}, "list": {}, "promote": {}}},
    )

    assert candidate.scope == "project"
    assert candidate.version == "0.1.0"
    assert candidate.promotion_candidate is True


def test_review_actions_keep_architecture_admission_explicit():
    action = L3ReviewAction(action="approve_for_architecture_review")
    assert action.action == "approve_for_architecture_review"
    assert L3ReviewAction(action="keep_project_specific").action != "promote"
