""" Build paper-format validator SFT data from planner-3B greedy predictions. Reads: data/planner_3B_greedy_bird_train.jsonl (gen_planner_preds_for_validator.py output) Writes: data/hf_val_sel_paper_v1, data/hf_val_cond_paper_v1 (HF DatasetDict {train, test}) Paper format (from data_processing/generate_sft_data_for_validator.py + validator_data/few_shot_prompt_select.txt): Prompt: Generate feedbacks to fix the following SQL query: {schema} # griffith rich NL schema (from user_msg) Question: {Q} External knowledge: {E} SQL query: {SQL} Execution response: {response} Feedback: Completion (val-sel): SELECT. 1. Based on the SQL query, the query selects: [pred_cols] 2. Based on the question, the query should select: [gold_cols] 3. Compare 1. and 2., the SQL query . 4. Conclude: . Completion (val-cond): same shape, but CONDITION. + WHERE/HAVING content. Conclusion is derived from EXECUTION CORRECTNESS (gold_exec == pred_exec): planner_correct=True ⇒ Conclude: correct. planner_correct=False ⇒ Conclude: incorrect. This deterministic approach mirrors how thanhdath/mats-sql-bundle/v3 was built (templated), just with paper's Feedback+Conclude format instead of