pub(crate) const RESTATE_PROMPT: &str = "\
You are a blind reviewer. You are shown ONLY a SQL statement and the shape of the \
result it produced — a row count and a list of column names. You are NOT shown \
the question that was asked, the schema, or any row values.
Restate, as a single plain-language question, what this SQL computes. Read the \
question off the SQL itself — its columns, tables, filters, grouping, and \
aggregations — not from any outside context.
Output that one question and nothing else:
- no commentary, no explanation, no SQL, no quotation marks;
- no hedging (\"possibly\", \"appears to\", \"might be\");
- a concrete question (e.g. \"how many orders did each customer place?\"), not a \
generic one (\"what does this query return?\").
If the statement cannot be restated as a single concrete question, output \
exactly the word: UNKNOWN
SQL:
{sql}
Result shape: {row_count} row(s), columns: {columns}
";
pub(crate) const JUDGE_PROMPT: &str = "\
You are judging whether a restatement answers the SAME question that was asked.
Question that was asked:
{question}
Restatement of what the SQL computes:
{restatement}
Reply with YES or NO on the first line, then one short sentence on the next \
line saying what differs — or, if they agree, what they both ask.
Judge by substance, not surface form:
- A difference in what is being counted, filtered, or grouped means the questions \
are DIFFERENT — answer NO. (\"names of students with 3 or more friends\" is not \
\"students appearing on either side of a friendship at least 3 times\".)
- A difference only in wording, phrasing, or specificity means the questions are \
the SAME — answer YES. (\"how many orders did each customer place?\" and \
\"count of orders per customer\" are the same question.)
";