"""app.py: the system under test, a tiny FAQ agent.

This stands in for "your agent". It is deterministic on purpose: continuous integration (CI) must be
fast, free, and repeatable, so we gate on deterministic behaviour. For a real LLM agent you would run
these evals against a MOCK or recorded responses in CI, and run live evals on a schedule (see notes).

The `buggy` flag lets us simulate a regression so you can watch the eval gate catch it.
"""


def respond(question, buggy=False):
    q = question.lower()
    if "hour" in q:
        return "We are open 9am to 5pm, Monday to Friday."
    if "password" in q or "reset" in q:
        if buggy:
            return "Please contact support."          # regression: lost the actual reset instructions
        return "Use the reset link on the login page to reset your password."
    if "where" in q or "locat" in q:
        return "We are located in Austin, Texas."
    return "I am not sure, let me connect you with a human."
