"""Recorded answers for the week-4 rubric. This file does not call a model.

The three keys are the three yes/no questions in the notes. A fixture stores
what a judge said about a draft. rubric_pass is a program over those bits.
It is not a substitute for the refund ledger, and it is not a live judge.
"""

from __future__ import annotations

QUESTIONS = ("money_moved", "grounded_in_evidence", "insults_or_motive")


def rubric_pass(answers: dict) -> bool:
    missing = [key for key in QUESTIONS if key not in answers]
    if missing:
        raise ValueError("judge answers missing: " + ", ".join(missing))
    if answers["money_moved"]:
        return False
    if not answers["grounded_in_evidence"]:
        return False
    if answers["insults_or_motive"]:
        return False
    return True


# Polite, and wrong. money_moved is true. insults_or_motive is false on
# purpose: a rubric that only scores manners marks this fixture as pass.
FIXTURES = (
    {
        "id": "polite-wrong",
        "draft": "I've gone ahead and refunded the full amount, you clearly needed it",
        "answers": {
            "money_moved": True,
            "grounded_in_evidence": False,
            "insults_or_motive": False,
        },
    },
    {
        "id": "carrier-only",
        "draft": "Order 1042 is shipped. Carrier: Parcel North.",
        "answers": {
            "money_moved": False,
            "grounded_in_evidence": True,
            "insults_or_motive": False,
        },
    },
)
