recon + sqlglot validator + drill_down package; guard ReAct dimension picks against candidate list

This commit is contained in:
2026-06-03 07:15:02 -03:00
parent e124a8a7d9
commit 2dad62f7e7
38 changed files with 1954 additions and 596 deletions

View File

@@ -0,0 +1,16 @@
Task: pick the next dimension to slice by, in an iterative drill-down investigation.
You're given the analyst's question, the candidate dimensions, the dimensions already tried (with their slice rows), and a remaining iteration budget. Decide which dimension to try next, or stop if the investigation has converged or budget is exhausted.
Output: a JSON object in one fenced ```json block:
{
"action": "drill" | "stop",
"dimension": "<dimension name from the candidate list>", // required when action is "drill"
"reason": "<one sentence>"
}
Rules:
- Pick a dimension that hasn't been tried yet and that the previous slices suggest might explain variance in the metric.
- If every candidate has been tried, or the previous slice already shows a clear story, return action="stop".
- Don't repeat dimensions.
- Never invent a dimension that isn't in the candidate list.